From 939c7f212d5f9c1b3e29df348cb464099a485f47 Mon Sep 17 00:00:00 2001
From: Kevin Deldycke <kevin@nexedi.com>
Date: Fri, 20 Oct 2006 11:47:24 +0000
Subject: [PATCH] Add new solidarity_day service. Reactivate lodging helps
 contribution. De-activate transportation contibution and add comments about
 how subtile is it to calculate it. Executive contributions (APEC) are due to
 march only.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10847 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../payroll_service_module/solidarity_day.xml | 172 ++++++++++++++++++
 ...ransaction_preCalculation_l10n_fr_2006.xml |  62 +++++--
 bt5/erp5_payroll/bt/revision                  |   2 +-
 bt5/erp5_payroll/bt/template_path_list        |  35 +---
 4 files changed, 218 insertions(+), 53 deletions(-)
 create mode 100644 bt5/erp5_payroll/PathTemplateItem/payroll_service_module/solidarity_day.xml

diff --git a/bt5/erp5_payroll/PathTemplateItem/payroll_service_module/solidarity_day.xml b/bt5/erp5_payroll/PathTemplateItem/payroll_service_module/solidarity_day.xml
new file mode 100644
index 0000000000..a1bd53b3a5
--- /dev/null
+++ b/bt5/erp5_payroll/PathTemplateItem/payroll_service_module/solidarity_day.xml
@@ -0,0 +1,172 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.ERP5Type.Document.Resource</string>
+          <string>Resource</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_Access_contents_information_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Associate</string>
+                <string>Auditor</string>
+                <string>Author</string>
+                <string>Manager</string>
+                <string>Owner</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Modify_portal_content_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Author</string>
+                <string>Manager</string>
+                <string>Owner</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_View_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Associate</string>
+                <string>Auditor</string>
+                <string>Author</string>
+                <string>Manager</string>
+                <string>Owner</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_count</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_mt_index</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_tree</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>salary_range/france/salaire_brut</string>
+                <string>product_line/salary</string>
+                <string>quantity_unit/time/month</string>
+                <string>tax_category/social/employer_share</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>solidarity_day</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Service</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string encoding="base64">Sm91cm7DqWUgZGUgU29saWRhcml0w6k=</string> </value>
+        </item>
+        <item>
+            <key> <string>uid</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>variation_base_category_list</string> </key>
+            <value>
+              <tuple>
+                <string>tax_category</string>
+                <string>salary_range</string>
+              </tuple>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.Length</string>
+          <string>Length</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle> <int>0</int> </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.OOBTree</string>
+          <string>OOBTree</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <none/>
+    </pickle>
+  </record>
+  <record id="4" aka="AAAAAAAAAAQ=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.OOBTree</string>
+          <string>OOBTree</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <none/>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_preCalculation_l10n_fr_2006.xml b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_preCalculation_l10n_fr_2006.xml
index 19c5ad3836..e55b5ed42f 100644
--- a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_preCalculation_l10n_fr_2006.xml
+++ b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_preCalculation_l10n_fr_2006.xml
@@ -237,20 +237,32 @@ if not executive:\n
 #   , \'base\'          : gross_salary\n
 #   }\n
 # else:\n
-#   kw[\'lodging_helps/salaire_plafonne\'] = \\\n
-#   { \'employer_share\': 0.10\n
-#   , \'employee_share\': None\n
-#   , \'base\'          : limited_salary\n
-#   }\n
+kw[\'lodging_helps/salaire_plafonne\'] = \\\n
+{ \'employer_share\': 0.10\n
+, \'employee_share\': None\n
+, \'base\'          : limited_salary\n
+}\n
+\n
+# Solidarity day = Journ\xe9e de Solidarit\xe9\n
+kw[\'solidarity_day/salaire_brut\'] = \\\n
+{ \'employer_share\': 0.30\n
+, \'employee_share\': None\n
+, \'base\'          : gross_salary\n
+}\n
 \n
 # Transport payment\n
 # TODO: rate depending of the town, 1.80 is the \'default\' value (when the town isn\'t referenced by laws)\n
-if company_size > 9:\n
-  kw[\'transport_payment/salaire_brut\'] = \\\n
-  { \'employer_share\': 1.80\n
-  , \'employee_share\': None\n
-  , \'base\'          : gross_salary\n
-  }\n
+# TODO: Even if the company size is more than 9, you don\'t pay this contribution until 3 years.\n
+#       The 4th year you pay 25%\n
+#       The 5th year you pay 50%\n
+#       The 6th year you pay 75%\n
+#       Starting from the 7th year you pay 100%\n
+# if company_size > 9:\n
+#   kw[\'transport_payment/salaire_brut\'] = \\\n
+#   { \'employer_share\': 1.80\n
+#   , \'employee_share\': None\n
+#   , \'base\'          : gross_salary\n
+#   }\n
 \n
 # CSG\n
 kw[\'csg_deductible/salaire_brut_csg\'] = \\\n
@@ -391,7 +403,12 @@ if executive:\n
 #   }\n
 \n
 # APEC forfaitaire\n
-if executive:\n
+# This contribution is due for March only\n
+comp_date = DateTime(start_date.year(), 3, 31)\n
+while comp_date < comp_date:\n
+  comp_date = DateTime(comp_date.year() + 1, 3, 31)\n
+context.log("kev date", repr(comp_date))\n
+if executive and start_date <= comp_date <= stop_date:\n
   kw[\'apec/forfait\'] = \\\n
   { \'employer_share\': 3.72\n
   , \'employee_share\': 2.49\n
@@ -454,10 +471,21 @@ if col_agr not in (None, \'\') and \'syntec\' in col_agr.lower():\n
   , \'base\'          : ceiling_salary\n
   }\n
 \n
+# Also add a brand new line for "Reduction Fillon", a negative contribution.\n
+# This tax can be calculated automaticcaly.\n
+# Because of lack of time we just let the accountant do the work.\n
+# See coresponding service description for more details.\n
+kw[\'reduction_fillon_forfait/forfait\'] = \\\n
+{ \'employer_share\': None\n
+, \'employee_share\': None\n
+, \'base\'          : 1.0\n
+}\n
+\n
 # Add blank lines for:\n
 #   * wickness holding (= retenue maladie)\n
 #   * pay bonus (= primes)\n
 #   * non-working days (= absences)\n
+#   * vacation compensation (= ICCP)\n
 # Thanks to this, the accountant has the freedom to add the missing amount of money\n
 #   that this script can\'t guess.\n
 kw[\'retenue_maladie/forfait\'] = \\\n
@@ -475,17 +503,13 @@ kw[\'absences/forfait\'] = \\\n
 , \'employee_share\': None\n
 , \'base\'          : 1.0\n
 }\n
-\n
-# Also add a brand new line for "Reduction Fillon", a negative contribution.\n
-# This tax can be calculated automaticcaly.\n
-# Because of lack of time we just let the accountant do the work.\n
-# See coresponding service description for more details.\n
-kw[\'reduction_fillon_forfait/forfait\'] = \\\n
+kw[\'iccp/forfait\'] = \\\n
 { \'employer_share\': None\n
 , \'employee_share\': None\n
 , \'base\'          : 1.0\n
 }\n
 \n
+\n
 return kw\n
 
 
@@ -584,6 +608,8 @@ return kw\n
                             <string>fngs_employer_rate</string>
                             <string>employee_share_rate</string>
                             <string>employer_share_rate</string>
+                            <string>comp_date</string>
+                            <string>repr</string>
                             <string>col_agr</string>
                             <string>syntec_rate</string>
                           </tuple>
diff --git a/bt5/erp5_payroll/bt/revision b/bt5/erp5_payroll/bt/revision
index dc7b54ad01..c24b6ae77d 100644
--- a/bt5/erp5_payroll/bt/revision
+++ b/bt5/erp5_payroll/bt/revision
@@ -1 +1 @@
-33
\ No newline at end of file
+38
\ No newline at end of file
diff --git a/bt5/erp5_payroll/bt/template_path_list b/bt5/erp5_payroll/bt/template_path_list
index 103844f009..71af240d91 100644
--- a/bt5/erp5_payroll/bt/template_path_list
+++ b/bt5/erp5_payroll/bt/template_path_list
@@ -6,40 +6,7 @@ organisation_module/assedic
 organisation_module/etat
 organisation_module/henner
 organisation_module/urssaf
-payroll_service_module/agff
-payroll_service_module/agff_tranche_a
-payroll_service_module/agff_tranche_b
-payroll_service_module/agirc
-payroll_service_module/ags
-payroll_service_module/apec
-payroll_service_module/argic
-payroll_service_module/arrco
-payroll_service_module/cavcic
-payroll_service_module/cet
-payroll_service_module/construction
-payroll_service_module/courses_tax
-payroll_service_module/crds
-payroll_service_module/csg_deductible
-payroll_service_module/csg_non_deductible
-payroll_service_module/family_benefits
-payroll_service_module/fngs
-payroll_service_module/iccp
-payroll_service_module/indemnite_precarite
-payroll_service_module/industrial_accident
-payroll_service_module/labour
-payroll_service_module/life_insurance
-payroll_service_module/lodging_helps
-payroll_service_module/oldage_insurance
-payroll_service_module/oldage_unlimited
-payroll_service_module/primes
-payroll_service_module/reduction_fillon_forfait
-payroll_service_module/retenue_maladie
-payroll_service_module/sickness_insurance
-payroll_service_module/syntec_insurance
-payroll_service_module/training_tax
-payroll_service_module/transport_payment
-payroll_service_module/unemployment_insurance
-payroll_service_module/widowhood_insurance
+payroll_service_module/**
 portal_categories/product_line/salary
 portal_categories/product_line/social_service
 portal_categories/product_line/social_service/**
-- 
2.30.9