Commit ad794a97 authored by Kevin Deldycke's avatar Kevin Deldycke

Support localised paysheet calculation (very simple mecanism, must be extended)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6755 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f0fdb095
...@@ -66,411 +66,21 @@ ...@@ -66,411 +66,21 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string># This script must select the right localized version of PaySheetTransaction_preCalculation\n
# depending of given parameters.\n
True = 1\n
False = 0\n
\n \n
global paysheet\n # Force which script to use manually.\n
paysheet = context.getObject()\n country = \'fr\'\n
paysheet_type = paysheet.getPortalType()\n year = \'2006\'\n
\n \n
employee = paysheet.getDestinationSection()\n script_name = \'_\'.join([ "PaySheetTransaction_preCalculation_l10n"\n
employee_object = paysheet.getDestinationSectionValue()\n , country\n
employer = paysheet.getSourceSection()\n , year\n
employer_object = paysheet.getSourceSectionValue()\n ])\n
calculation_method = getattr(context, script_name)\n
\n \n
\n return calculation_method(**kw)\n
gross_salary = abs(paysheet.getGrossSalary())\n </string> </value>
\n
# each year, look at http://www.urssaf.fr to complete the table\n
ceiling_salary_list = { 2003 : 2432.0\n
, 2004 : 2476.0\n
, 2005 : 2516.0\n
}\n
# the default ceiling salary is the last one\n
paysheet_year = paysheet.getStartDate().year()\n
ceiling_salary_available_years = ceiling_salary_list.keys()\n
if paysheet_year not in ceiling_salary_available_years:\n
paysheet_year = ceiling_salary_available_years[-1]\n
ceiling_salary = ceiling_salary_list[paysheet_year]\n
\n
# limited salary = salaire plafonn\xc3\xa9\n
if gross_salary < ceiling_salary:\n
limited_salary = gross_salary\n
else:\n
limited_salary = ceiling_salary\n
\n
# check if the employee is executive or not\n
if employee_object.getCareerGrade().split(\'/\')[-1] in (\'engineer\'):\n
executive = True\n
else:\n
executive = False\n
\n
company_birth = employer_object.getCreationDate()\n
\n
employer_region = employer_object.getDefaultAddress().getZipCode()[:2]\n
\n
# get the number of person which are employed by the company ,\n
# sub_list = employer_object.getSubordinationRelatedValueList()\n
# company_size = 0\n
# for person in sub_list:\n
# if person.getPortalType() == \'Person\': # add condition: if current role == internal and defaultCareerEnd and defaultCareerStart fit in the current year\n
# #print repr(person) + repr(person.getTitle())\n
# company_size += 1\n
#\n
# print repr(company_size)\n
#\n
# return printed\n
\n
company_size = 3\n
\n
\n
# "Char" slice type\n
slice_a_value = ceiling_salary\n
slice_b_value = ceiling_salary * 4\n
slice_c_value = ceiling_salary * 8\n
char_slices = {}\n
if gross_salary < slice_a_value:\n
char_slices[\'A\'] = gross_salary\n
else:\n
char_slices[\'A\'] = slice_a_value\n
if gross_salary < slice_b_value:\n
char_slices[\'B\'] = float(gross_salary) - float(slice_a_value)\n
else:\n
char_slices[\'B\'] = slice_b_value\n
if gross_salary < slice_c_value:\n
char_slices[\'C\'] = float(gross_salary) - float(slice_b_value)\n
else:\n
char_slices[\'C\'] = slice_c_value\n
\n
# "Number" slice type\n
slice_1_value = ceiling_salary\n
slice_2_value = ceiling_salary * 3\n
num_slices = {}\n
if gross_salary < slice_1_value:\n
char_slices[\'1\'] = gross_salary\n
else:\n
char_slices[\'1\'] = slice_1_value\n
if gross_salary < slice_2_value:\n
char_slices[\'2\'] = gross_salary - slice_1_value\n
else:\n
char_slices[\'2\'] = slice_2_value\n
\n
# age-slice of the company\n
old_limit = DateTime(1997, 1, 1)\n
if company_birth < old_limit:\n
comp_type = \'old\'\n
else:\n
comp_type = \'new\'\n
\n
\n
#################\n
# This script will fill the PaySheetTransaction_preview with default values for base salary calculation, employer and employee share\n
#################\n
\n
default = {}\n
# initialize all variables to None\n
paysheet_services = []\n
erp5site = context.portal_url.getPortalObject()\n
# during 06/2005 service module has been renamed service_module\n
# both names are supported\n
if hasattr(erp5site, \'service_module\') : \n
service_module = erp5site.service_module\n
else : \n
service_module = erp5site.service\n
for service in service_module.searchFolder( portal_type = \'Service\', product_line_id=\'payroll\') :\n
service = service.getObject()\n
base_cat = service.getVariationRangeBaseCategoryList()\n
if \'tax_category\' in base_cat and \'salary_range\' in base_cat:\n
paysheet_services.append(service)\n
for serv in paysheet_services:\n
cat_list = serv.getCategoryList()\n
tax_cat = []\n
range_cat = []\n
for cat in cat_list:\n
if str(cat).find(\'tax_category\') != -1:\n
tax_cat.append(cat)\n
if str(cat).find(\'salary_range\') != -1:\n
range_cat.append(cat)\n
for base in range_cat:\n
new_name = serv.getId() + \'/\' + context.portal_categories.resolveCategory(base).getId()\n
default[new_name] = {\'employer_rate\':None,\'employee_rate\':None,\'base\':None}\n
\n
# sickness insurance\n
if employer_region in (\'57\', \'67\', \'68\'):\n
er = 1.70\n
else:\n
er = 0.75\n
default[\'sickness_insurance/salaire_brut\'] = \\\n
{ \'employer_rate\' : 12.80\n
, \'employee_rate\' : er\n
, \'base\' : gross_salary\n
}\n
\n
# old-age insurance\n
default[\'oldage_insurance/salaire_brut\'] = \\\n
{ \'employer_rate\' : 1.60\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
default[\'oldage_insurance/salaire_plafonne\'] = \\\n
{ \'employer_rate\' : 8.20\n
, \'employee_rate\' : 6.55\n
, \'base\' : limited_salary\n
}\n
\n
# widowhood insurance\n
default[\'widowhood_insurance/salaire_brut\'] = \\\n
{ \'employer_rate\' : None\n
, \'employee_rate\' : 0.10\n
, \'base\' : gross_salary\n
}\n
\n
# family benefits\n
default[\'family_benefits/salaire_brut\'] = \\\n
{ \'employer_rate\' : 5.40\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# industrial accident\n
# industrial_accident_rate is a parameter of this script, because rate depending of company size, department & trade (1.10 is for Nexedi, 1.0 is the default value)\n
if industrial_accident_rate in (\'\', 0, None):\n
industrial_accident_rate = 1.0\n
default[\'industrial_accident/salaire_brut\'] = \\\n
{ \'employer_rate\' : industrial_accident_rate\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# lodging helps\n
if company_size > 9:\n
default[\'lodging_helps/salaire_brut\'] = \\\n
{ \'employer_rate\' : 0.40\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
else:\n
default[\'lodging_helps/salaire_plafonne\'] = \\\n
{ \'employer_rate\' : 0.10\n
, \'employee_rate\' : None\n
, \'base\' : limited_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 transport_payment_rate in (\'\', 0, None):\n
transport_payment_rate = 1.80\n
if company_size > 9:\n
default[\'transport_payment/salaire_brut\'] = \\\n
{ \'employer_rate\' : transport_payment_rate\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# CSG\n
default[\'csg_deductible/salaire_brut_csg\'] = \\\n
{ \'employer_rate\' : None\n
, \'employee_rate\' : 5.10\n
, \'base\' : 0.95 * gross_salary\n
}\n
default[\'csg_non_deductible/salaire_brut_csg\'] = \\\n
{ \'employer_rate\' : None\n
, \'employee_rate\' : 2.4\n
, \'base\' : 0.95 * gross_salary\n
}\n
\n
# CRDS\n
default[\'crds/salaire_brut_crds\'] = \\\n
{ \'employer_rate\' : None\n
, \'employee_rate\' : 0.50\n
, \'base\' : 0.95 * gross_salary\n
}\n
\n
# unemployment insurance\n
if char_slices.has_key(\'A\'):\n
default[\'unemployment_insurance/tranche_a\'] = \\\n
{ \'employer_rate\' : 4.0\n
, \'employee_rate\' : 2.4\n
, \'base\' : char_slices[\'A\']\n
}\n
if char_slices.has_key(\'B\'):\n
default[\'unemployment_insurance/tranche_b\'] = \\\n
{ \'employer_rate\' : 4.0\n
, \'employee_rate\' : 2.4\n
, \'base\' : char_slices[\'B\']\n
}\n
\n
# AGS\n
# ags_rate is a parameter of this script, 0.35% was the default value, now it\'s 0.45%\n
if ags_rate in (\'\', 0, None):\n
ags_rate = 0.45\n
if char_slices.has_key(\'A\'):\n
default[\'ags/tranche_a\'] = \\\n
{ \'employer_rate\' : ags_rate\n
, \'employee_rate\' : None\n
, \'base\' : char_slices[\'A\']\n
}\n
if char_slices.has_key(\'B\'):\n
default[\'ags/tranche_b\'] = \\\n
{ \'employer_rate\' : ags_rate\n
, \'employee_rate\' : None\n
, \'base\' : char_slices[\'B\']\n
}\n
\n
# ARRCO\n
if executive == False:\n
if num_slices.has_key(\'1\'):\n
default[\'arrco/tranche_1\'] = \\\n
{ \'employer_rate\' : 4.5\n
, \'employee_rate\' : 3.0\n
, \'base\' : num_slices[\'1\']\n
}\n
if num_slices.has_key(\'2\'):\n
if comp_type == \'old\':\n
employee_share_rate = 6.0\n
employer_share_rate = 9.0\n
else:\n
employee_share_rate = 8.0\n
employer_share_rate = 12.0\n
\n
default[\'arrco/tranche_2\'] = \\\n
{ \'employer_rate\' : employer_share_rate\n
, \'employee_rate\' : employee_share_rate\n
, \'base\' : num_slices[\'2\']\n
}\n
elif char_slices.has_key(\'A\'):\n
default[\'arrco/tranche_a\'] = \\\n
{ \'employer_rate\' : 4.5\n
, \'employee_rate\' : 3.0\n
, \'base\' : char_slices[\'A\']\n
}\n
\n
# AGFF\n
if executive == True:\n
if char_slices.has_key(\'A\'):\n
default[\'agff/tranche_a\'] = \\\n
{ \'employer_rate\' : 1.20\n
, \'employee_rate\' : 0.80\n
, \'base\' : char_slices[\'A\']\n
}\n
if char_slices.has_key(\'B\'):\n
default[\'agff/tranche_b\'] = \\\n
{ \'employer_rate\' : 1.30\n
, \'employee_rate\' : 0.90\n
, \'base\' : char_slices[\'B\']\n
}\n
else:\n
if num_slices.has_key(\'1\'):\n
default[\'agff/tranche_1\'] = \\\n
{ \'employer_rate\' : 1.20\n
, \'employee_rate\' : 0.80\n
, \'base\' : num_slices[\'1\']\n
}\n
if num_slices.has_key(\'2\'):\n
default[\'agff/tranche_2\'] = \\\n
{ \'employer_rate\' : 1.30\n
, \'employee_rate\' : 0.90\n
, \'base\' : num_slices[\'2\']\n
}\n
\n
# AGIRC\n
# TODO: fix the repartition of share rate in case of slice C\n
if executive == True:\n
if char_slices.has_key(\'B\'):\n
default[\'agirc/tranche_b\'] = \\\n
{ \'employer_rate\' : 12.50\n
, \'employee_rate\' : 7.50\n
, \'base\' : char_slices[\'B\']\n
}\n
if char_slices.has_key(\'C\'):\n
# free repartition (20% to share between employee & employer)\n
default[\'agirc/tranche_c\'] = \\\n
{ \'employer_rate\' : 10.00\n
, \'employee_rate\' : 10.00\n
, \'base\' : char_slices[\'C\']\n
}\n
\n
# CET\n
if executive == True:\n
if char_slices.has_key(\'A\'):\n
default[\'cet/tranche_a\'] = \\\n
{ \'employer_rate\' : 0.22\n
, \'employee_rate\' : 0.13\n
, \'base\' : char_slices[\'A\']\n
}\n
if char_slices.has_key(\'B\'):\n
default[\'cet/tranche_b\'] = \\\n
{ \'employer_rate\' : 0.22\n
, \'employee_rate\' : 0.13\n
, \'base\' : char_slices[\'B\']\n
}\n
if char_slices.has_key(\'C\'):\n
default[\'cet/tranche_c\'] = \\\n
{ \'employer_rate\' : 0.22\n
, \'employee_rate\' : 0.13\n
, \'base\' : char_slices[\'C\']\n
}\n
\n
# life insurance\n
if executive == True and char_slices.has_key(\'A\'):\n
default[\'life_insurance/tranche_a\'] = \\\n
{ \'employer_rate\' : 1.5\n
, \'employee_rate\' : None\n
, \'base\' : char_slices[\'A\']\n
}\n
\n
# APEC\n
if char_slices.has_key(\'B\'):\n
default[\'apec/tranche_b\'] = \\\n
{ \'employer_rate\' : 0.036\n
, \'employee_rate\' : 0.024\n
, \'base\' : char_slices[\'B\']\n
}\n
\n
# construction tax\n
if company_size > 9:\n
default[\'construction_tax/salaire_brut\'] = \\\n
{ \'employer_rate\' : 0.45\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# training tax\n
default[\'training_tax/salaire_brut\'] = \\\n
{ \'employer_rate\' : 0.50\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# courses tax\n
if company_size < 10:\n
rate = 0.15\n
else:\n
rate = 1.5\n
default[\'courses_tax/salaire_brut\'] = \\\n
{ \'employer_rate\' : rate\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# Syntec convention\n
if \'syntec\' in employee_object.getCareerCollectiveAgreementTitle().lower():\n
# set the syntec rate according to the employee marital status\n
syntec_rate = 0.915\n
if employee_object.getMaritalStatusId() == \'married\':\n
syntec_rate *= 2\n
default[\'syntec_insurance/salaire_plafonne_syntec\'] = \\\n
{ \'employer_rate\' : syntec_rate\n
, \'employee_rate\' : syntec_rate\n
, \'base\' : ceiling_salary\n
}\n
\n
return default\n
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -482,9 +92,15 @@ return default\n ...@@ -482,9 +92,15 @@ return default\n
<key> <string>_filepath</string> </key> <key> <string>_filepath</string> </key>
<value> <string>Script (Python):/nexedi/portal_skins/erp5_payroll/PaySheetTransaction_preCalculation</string> </value> <value> <string>Script (Python):/nexedi/portal_skins/erp5_payroll/PaySheetTransaction_preCalculation</string> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>ags_rate=None, industrial_accident_rate=None, transport_payment_rate=None</string> </value> <value> <string>**kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -504,71 +120,21 @@ return default\n ...@@ -504,71 +120,21 @@ return default\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>3</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>ags_rate</string> <string>kw</string>
<string>industrial_accident_rate</string> <string>country</string>
<string>transport_payment_rate</string> <string>year</string>
<string>True</string>
<string>False</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>script_name</string>
<string>getattr</string>
<string>context</string> <string>context</string>
<string>paysheet</string> <string>calculation_method</string>
<string>paysheet_type</string> <string>_apply_</string>
<string>employee</string>
<string>employee_object</string>
<string>employer</string>
<string>employer_object</string>
<string>abs</string>
<string>gross_salary</string>
<string>ceiling_salary_list</string>
<string>paysheet_year</string>
<string>ceiling_salary_available_years</string>
<string>_getitem_</string>
<string>ceiling_salary</string>
<string>limited_salary</string>
<string>executive</string>
<string>company_birth</string>
<string>employer_region</string>
<string>company_size</string>
<string>slice_a_value</string>
<string>slice_b_value</string>
<string>slice_c_value</string>
<string>char_slices</string>
<string>_write_</string>
<string>float</string>
<string>slice_1_value</string>
<string>slice_2_value</string>
<string>num_slices</string>
<string>DateTime</string>
<string>old_limit</string>
<string>comp_type</string>
<string>default</string>
<string>paysheet_services</string>
<string>erp5site</string>
<string>hasattr</string>
<string>service_module</string>
<string>_getiter_</string>
<string>service</string>
<string>base_cat</string>
<string>serv</string>
<string>cat_list</string>
<string>tax_cat</string>
<string>range_cat</string>
<string>cat</string>
<string>str</string>
<string>base</string>
<string>new_name</string>
<string>None</string>
<string>er</string>
<string>employee_share_rate</string>
<string>employer_share_rate</string>
<string>rate</string>
<string>syntec_rate</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -580,11 +146,7 @@ return default\n ...@@ -580,11 +146,7 @@ return default\n
<item> <item>
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<tuple>
<none/> <none/>
<none/>
<none/>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value> <string encoding="base64">O/INCg==</string> </value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
True = 1\n
False = 0\n
\n
global paysheet\n
paysheet = context.getObject()\n
paysheet_type = paysheet.getPortalType()\n
\n
employee = paysheet.getDestinationSection()\n
employee_object = paysheet.getDestinationSectionValue()\n
employer = paysheet.getSourceSection()\n
employer_object = paysheet.getSourceSectionValue()\n
\n
\n
gross_salary = abs(paysheet.getGrossSalary())\n
\n
# each year, look at http://www.urssaf.fr to complete the table\n
ceiling_salary_list = { 2003 : 2432.0\n
, 2004 : 2476.0\n
, 2005 : 2516.0\n
, 2006 : 2589.0\n
}\n
# the default ceiling salary is the last one\n
paysheet_year = paysheet.getStartDate().year()\n
ceiling_salary_available_years = ceiling_salary_list.keys()\n
if paysheet_year not in ceiling_salary_available_years:\n
paysheet_year = ceiling_salary_available_years[-1]\n
ceiling_salary = ceiling_salary_list[paysheet_year]\n
\n
# limited salary = salaire plafonn\xc3\xa9\n
if gross_salary < ceiling_salary:\n
limited_salary = gross_salary\n
else:\n
limited_salary = ceiling_salary\n
\n
# check if the employee is executive or not\n
if employee_object.getCareerGrade().split(\'/\')[-1:][0] in (\'engineer\'):\n
executive = True\n
else:\n
executive = False\n
\n
company_birth = employer_object.getCreationDate()\n
\n
employer_region = employer_object.getDefaultAddress().getZipCode()[:2]\n
\n
# get the number of person which are employed by the company ,\n
# sub_list = employer_object.getSubordinationRelatedValueList()\n
# company_size = 0\n
# for person in sub_list:\n
# if person.getPortalType() == \'Person\': # add condition: if current role == internal and defaultCareerEnd and defaultCareerStart fit in the current year\n
# #print repr(person) + repr(person.getTitle())\n
# company_size += 1\n
#\n
# print repr(company_size)\n
#\n
# return printed\n
\n
company_size = 3\n
\n
\n
# "Char" slice type\n
slice_a_value = ceiling_salary\n
slice_b_value = ceiling_salary * 4\n
slice_c_value = ceiling_salary * 8\n
char_slices = {}\n
if gross_salary < slice_a_value:\n
char_slices[\'A\'] = gross_salary\n
else:\n
char_slices[\'A\'] = slice_a_value\n
if gross_salary < slice_b_value:\n
char_slices[\'B\'] = float(gross_salary) - float(slice_a_value)\n
else:\n
char_slices[\'B\'] = slice_b_value\n
if gross_salary < slice_c_value:\n
char_slices[\'C\'] = float(gross_salary) - float(slice_b_value)\n
else:\n
char_slices[\'C\'] = slice_c_value\n
\n
# "Number" slice type\n
slice_1_value = ceiling_salary\n
slice_2_value = ceiling_salary * 3\n
num_slices = {}\n
if gross_salary < slice_1_value:\n
char_slices[\'1\'] = gross_salary\n
else:\n
char_slices[\'1\'] = slice_1_value\n
if gross_salary < slice_2_value:\n
char_slices[\'2\'] = gross_salary - slice_1_value\n
else:\n
char_slices[\'2\'] = slice_2_value\n
\n
# age-slice of the company\n
old_limit = DateTime(1997, 1, 1)\n
if company_birth < old_limit:\n
comp_type = \'old\'\n
else:\n
comp_type = \'new\'\n
\n
\n
#################\n
# This script will fill the PaySheetTransaction_preview with default values for base salary calculation\n
# employer and employee share.\n
#################\n
\n
default = {}\n
# initialize all variables to None\n
paysheet_services = []\n
erp5site = context.portal_url.getPortalObject()\n
# during 06/2005 service module has been renamed service_module\n
# both names are supported\n
if hasattr(erp5site, \'service_module\'): \n
service_module = erp5site.service_module\n
else : \n
service_module = erp5site.service\n
for service in service_module.objectValues():\n
base_cat = service.getVariationRangeBaseCategoryList()\n
if \'tax_category\' in base_cat and \'salary_range\' in base_cat:\n
paysheet_services.append(service)\n
for serv in paysheet_services:\n
cat_list = serv.getCategoryList()\n
tax_cat = []\n
range_cat = []\n
for cat in cat_list:\n
if str(cat).find(\'tax_category\') != -1:\n
tax_cat.append(cat)\n
if str(cat).find(\'salary_range\') != -1:\n
range_cat.append(cat)\n
for base in range_cat:\n
mycategory = context.portal_categories.resolveCategory(base)\n
if mycategory is None:\n
context.log("PaySheetTransaction_preCalculation","WARNING : category not found : %s" % base)\n
else:\n
new_name = serv.getId() + \'/\' + mycategory.getId()\n
default[new_name] = {\'employer_rate\':None,\'employee_rate\':None,\'base\':None}\n
\n
# sickness insurance\n
if employer_region in (\'57\', \'67\', \'68\'):\n
er = 1.70\n
else:\n
er = 0.75\n
default[\'sickness_insurance/salaire_brut\'] = \\\n
{ \'employer_rate\' : 12.80\n
, \'employee_rate\' : er\n
, \'base\' : gross_salary\n
}\n
\n
# old-age insurance\n
default[\'oldage_insurance/salaire_brut\'] = \\\n
{ \'employer_rate\' : 1.60\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
default[\'oldage_insurance/salaire_plafonne\'] = \\\n
{ \'employer_rate\' : 8.20\n
, \'employee_rate\' : 6.55\n
, \'base\' : limited_salary\n
}\n
\n
# Commented by vincent 2006/01/13 : Antoine told me it\'s unused\n
# widowhood insurance\n
#default[\'widowhood_insurance/salaire_brut\'] = \\\n
#{ \'employer_rate\' : None\n
#, \'employee_rate\' : 0.10\n
#, \'base\' : gross_salary\n
#}\n
\n
# family benefits\n
default[\'family_benefits/salaire_brut\'] = \\\n
{ \'employer_rate\' : 5.40\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# industrial accident\n
# industrial_accident_rate is a parameter of this script, because rate depending of company size, department & trade (1.10 is for Nexedi, 1.0 is the default value)\n
if industrial_accident_rate in (\'\', 0, None):\n
industrial_accident_rate = 1.0\n
default[\'industrial_accident/salaire_brut\'] = \\\n
{ \'employer_rate\' : industrial_accident_rate\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# lodging helps\n
if company_size > 9:\n
default[\'lodging_helps/salaire_brut\'] = \\\n
{ \'employer_rate\' : 0.40\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
else:\n
default[\'lodging_helps/salaire_plafonne\'] = \\\n
{ \'employer_rate\' : 0.10\n
, \'employee_rate\' : None\n
, \'base\' : limited_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 transport_payment_rate in (\'\', 0, None):\n
transport_payment_rate = 1.80\n
if company_size > 9:\n
default[\'transport_payment/salaire_brut\'] = \\\n
{ \'employer_rate\' : transport_payment_rate\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# CSG\n
default[\'csg_deductible/salaire_brut_csg\'] = \\\n
{ \'employer_rate\' : None\n
, \'employee_rate\' : 5.10\n
, \'base\' : 0.97 * gross_salary\n
}\n
default[\'csg_non_deductible/salaire_brut_csg\'] = \\\n
{ \'employer_rate\' : None\n
, \'employee_rate\' : 2.4\n
, \'base\' : 0.97 * gross_salary\n
}\n
\n
# CRDS\n
default[\'crds/salaire_brut_crds\'] = \\\n
{ \'employer_rate\' : None\n
, \'employee_rate\' : 0.50\n
, \'base\' : 0.97 * gross_salary\n
}\n
\n
# unemployment insurance\n
if char_slices.has_key(\'A\'):\n
default[\'unemployment_insurance/tranche_a\'] = \\\n
{ \'employer_rate\' : 4.0\n
, \'employee_rate\' : 2.4\n
, \'base\' : char_slices[\'A\']\n
}\n
if char_slices.has_key(\'B\'):\n
default[\'unemployment_insurance/tranche_b\'] = \\\n
{ \'employer_rate\' : 4.0\n
, \'employee_rate\' : 2.4\n
, \'base\' : char_slices[\'B\']\n
}\n
\n
# FNGS\n
default[\'fngs/tranche_a\'] = \\\n
{ \'employer_rate\' : 0.35\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# Commented by vincent 2006/01/13 : Antoine told me it\'s unused\n
# AGS\n
# ags_rate is a parameter of this script, 0.35% was the default value, now it\'s 0.45%\n
#if ags_rate in (\'\', 0, None):\n
# ags_rate = 0.45\n
#if char_slices.has_key(\'A\'):\n
# default[\'ags/tranche_a\'] = \\\n
# { \'employer_rate\' : ags_rate\n
# , \'employee_rate\' : None\n
# , \'base\' : char_slices[\'A\']\n
# }\n
#if char_slices.has_key(\'B\'):\n
# default[\'ags/tranche_b\'] = \\\n
# { \'employer_rate\' : ags_rate\n
# , \'employee_rate\' : None\n
# , \'base\' : char_slices[\'B\']\n
# }\n
\n
# ARRCO\n
if executive == False:\n
if num_slices.has_key(\'1\'):\n
default[\'arrco/tranche_1\'] = \\\n
{ \'employer_rate\' : 4.5\n
, \'employee_rate\' : 3.0\n
, \'base\' : num_slices[\'1\']\n
}\n
if num_slices.has_key(\'2\'):\n
if comp_type == \'old\':\n
employee_share_rate = 6.0\n
employer_share_rate = 9.0\n
else:\n
employee_share_rate = 8.0\n
employer_share_rate = 12.0\n
\n
default[\'arrco/tranche_2\'] = \\\n
{ \'employer_rate\' : employer_share_rate\n
, \'employee_rate\' : employee_share_rate\n
, \'base\' : num_slices[\'2\']\n
}\n
elif char_slices.has_key(\'A\'):\n
default[\'arrco/tranche_a\'] = \\\n
{ \'employer_rate\' : 4.5\n
, \'employee_rate\' : 3.0\n
, \'base\' : char_slices[\'A\']\n
}\n
\n
# AGFF\n
if executive == True:\n
if char_slices.has_key(\'A\'):\n
default[\'agff/tranche_a\'] = \\\n
{ \'employer_rate\' : 1.20\n
, \'employee_rate\' : 0.80\n
, \'base\' : char_slices[\'A\']\n
}\n
if char_slices.has_key(\'B\'):\n
default[\'agff/tranche_b\'] = \\\n
{ \'employer_rate\' : 1.30\n
, \'employee_rate\' : 0.90\n
, \'base\' : char_slices[\'B\']\n
}\n
else:\n
if num_slices.has_key(\'1\'):\n
default[\'agff/tranche_1\'] = \\\n
{ \'employer_rate\' : 1.20\n
, \'employee_rate\' : 0.80\n
, \'base\' : num_slices[\'1\']\n
}\n
if num_slices.has_key(\'2\'):\n
default[\'agff/tranche_2\'] = \\\n
{ \'employer_rate\' : 1.30\n
, \'employee_rate\' : 0.90\n
, \'base\' : num_slices[\'2\']\n
}\n
\n
# AGIRC\n
# TODO: fix the repartition of share rate in case of slice C\n
if executive == True:\n
if char_slices.has_key(\'B\'):\n
default[\'agirc/tranche_b\'] = \\\n
{ \'employer_rate\' : 12.50\n
, \'employee_rate\' : 7.50\n
, \'base\' : char_slices[\'B\']\n
}\n
if char_slices.has_key(\'C\'):\n
# free repartition (20% to share between employee & employer)\n
default[\'agirc/tranche_c\'] = \\\n
{ \'employer_rate\' : 10.00\n
, \'employee_rate\' : 10.00\n
, \'base\' : char_slices[\'C\']\n
}\n
\n
# CET\n
if executive == True:\n
if char_slices.has_key(\'A\'):\n
default[\'cet/tranche_a\'] = \\\n
{ \'employer_rate\' : 0.22\n
, \'employee_rate\' : 0.13\n
, \'base\' : char_slices[\'A\']\n
}\n
if char_slices.has_key(\'B\'):\n
default[\'cet/tranche_b\'] = \\\n
{ \'employer_rate\' : 0.22\n
, \'employee_rate\' : 0.13\n
, \'base\' : char_slices[\'B\']\n
}\n
if char_slices.has_key(\'C\'):\n
default[\'cet/tranche_c\'] = \\\n
{ \'employer_rate\' : 0.22\n
, \'employee_rate\' : 0.13\n
, \'base\' : char_slices[\'C\']\n
}\n
\n
# life insurance\n
if executive == True and char_slices.has_key(\'A\'):\n
default[\'life_insurance/tranche_a\'] = \\\n
{ \'employer_rate\' : 1.5\n
, \'employee_rate\' : None\n
, \'base\' : char_slices[\'A\']\n
}\n
\n
# APEC\n
if char_slices.has_key(\'B\'):\n
default[\'apec/tranche_b\'] = \\\n
{ \'employer_rate\' : 0.036\n
, \'employee_rate\' : 0.024\n
, \'base\' : char_slices[\'B\']\n
}\n
\n
# construction tax\n
if company_size > 9:\n
default[\'construction_tax/salaire_brut\'] = \\\n
{ \'employer_rate\' : 0.45\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# training tax\n
default[\'training_tax/salaire_brut\'] = \\\n
{ \'employer_rate\' : 0.50\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# courses tax\n
if company_size < 10:\n
rate = 0.15\n
else:\n
rate = 1.5\n
default[\'courses_tax/salaire_brut\'] = \\\n
{ \'employer_rate\' : rate\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# Syntec convention\n
if \'syntec\' in employee_object.getCareerCollectiveAgreementTitle().lower():\n
# set the syntec rate according to the employee marital status\n
syntec_rate = 0.915\n
if employee_object.getMaritalStatusId() == \'married\':\n
syntec_rate *= 2\n
default[\'syntec_insurance/salaire_plafonne_syntec\'] = \\\n
{ \'employer_rate\' : syntec_rate\n
, \'employee_rate\' : syntec_rate\n
, \'base\' : ceiling_salary\n
}\n
\n
# antoine taxs. by vincent and jerome \n
if not executive :\n
default[\'oldage_unlimited/salaire_brut\'] = \\\n
{ \'employer_rate\' : 1.60\n
, \'employee_rate\' : 0.10\n
, \'base\' : gross_salary\n
}\n
default[\'industrial_accident/salaire_brut\'] = \\\n
{ \'employer_rate\' : 1.10\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
default[\'family_benefits/salaire_brut\'] = \\\n
{ \'employer_rate\' : 5.40\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
\n
# quick hack for maladie and primes - j\xc3\xa9 2006-02-01\n
if 1:\n
default[\'retenue_maladie/salaire_brut\'] = \\\n
{ \'employer_rate\' : 0\n
, \'employee_rate\' : 0\n
, \'base\' : 0\n
}\n
default[\'primes/salaire_brut\'] = \\\n
{ \'employer_rate\' : 0\n
, \'employee_rate\' : 0\n
, \'base\' : 0\n
}\n
\n
return default\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/nexedi/portal_skins/erp5_payroll/PaySheetTransaction_preCalculation_l10n_fr_2005</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>ags_rate=None, industrial_accident_rate=None, transport_payment_rate=None</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>ags_rate</string>
<string>industrial_accident_rate</string>
<string>transport_payment_rate</string>
<string>True</string>
<string>False</string>
<string>_getattr_</string>
<string>context</string>
<string>paysheet</string>
<string>paysheet_type</string>
<string>employee</string>
<string>employee_object</string>
<string>employer</string>
<string>employer_object</string>
<string>abs</string>
<string>gross_salary</string>
<string>ceiling_salary_list</string>
<string>paysheet_year</string>
<string>ceiling_salary_available_years</string>
<string>_getitem_</string>
<string>ceiling_salary</string>
<string>limited_salary</string>
<string>executive</string>
<string>company_birth</string>
<string>employer_region</string>
<string>company_size</string>
<string>slice_a_value</string>
<string>slice_b_value</string>
<string>slice_c_value</string>
<string>char_slices</string>
<string>_write_</string>
<string>float</string>
<string>slice_1_value</string>
<string>slice_2_value</string>
<string>num_slices</string>
<string>DateTime</string>
<string>old_limit</string>
<string>comp_type</string>
<string>default</string>
<string>paysheet_services</string>
<string>erp5site</string>
<string>hasattr</string>
<string>service_module</string>
<string>_getiter_</string>
<string>service</string>
<string>base_cat</string>
<string>serv</string>
<string>cat_list</string>
<string>tax_cat</string>
<string>range_cat</string>
<string>cat</string>
<string>str</string>
<string>base</string>
<string>mycategory</string>
<string>None</string>
<string>new_name</string>
<string>er</string>
<string>employee_share_rate</string>
<string>employer_share_rate</string>
<string>rate</string>
<string>syntec_rate</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
<none/>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaySheetTransaction_preCalculation_l10n_fr_2005</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value> <string encoding="base64">O/INCg==</string> </value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
#\n
global paysheet\n
paysheet = context.getObject()\n
paysheet_type = paysheet.getPortalType()\n
\n
employee = paysheet.getDestinationSection()\n
employee_object = paysheet.getDestinationSectionValue()\n
employer = paysheet.getSourceSection()\n
employer_object = paysheet.getSourceSectionValue()\n
\n
gross_salary = abs(paysheet.getGrossSalary())\n
\n
######\n
# This script define all rates to apply in 2006 to calculate an entire paysheet\n
# according french fiscal & social rules for a SME.\n
######\n
\n
### This part of the script define usefull variables to help us calculate dynamic rates\n
\n
# each year, look at http://www.urssaf.fr to complete the table\n
ceiling_salary_list = { 2003 : 2432.0\n
, 2004 : 2476.0\n
, 2005 : 2516.0\n
, 2006 : 2589.0\n
}\n
# the default ceiling salary is the last one\n
paysheet_year = paysheet.getStartDate().year()\n
ceiling_salary_available_years = ceiling_salary_list.keys()\n
if paysheet_year not in ceiling_salary_available_years:\n
paysheet_year = ceiling_salary_available_years[-1]\n
ceiling_salary = ceiling_salary_list[paysheet_year]\n
\n
# limited salary = salaire plafonnee\n
if gross_salary < ceiling_salary:\n
limited_salary = gross_salary\n
else:\n
limited_salary = ceiling_salary\n
\n
# check if the employee is executive or not\n
if employee_object.getCareerGrade().split(\'/\')[-1:][0] in (\'engineer\'):\n
executive = True\n
else:\n
executive = False\n
\n
company_birth = employer_object.getCreationDate()\n
\n
employer_region = employer_object.getDefaultAddress().getZipCode()[:2]\n
\n
# get the number of person which are employed by the company ,\n
# sub_list = employer_object.getSubordinationRelatedValueList()\n
# company_size = 0\n
# for person in sub_list:\n
# if person.getPortalType() == \'Person\': # add condition: if current role == internal and defaultCareerEnd and defaultCareerStart fit in the current year\n
# #print repr(person) + repr(person.getTitle())\n
# company_size += 1\n
#\n
# print repr(company_size)\n
#\n
# return printed\n
\n
company_size = 3\n
\n
# Get the list of all slice the employee fall in\n
salary_slices = {}\n
\n
# "Char" slice type\n
slice_a_value = ceiling_salary\n
slice_b_value = ceiling_salary * 4\n
slice_c_value = ceiling_salary * 8\n
if gross_salary < slice_a_value:\n
salary_slices[\'A\'] = gross_salary\n
else:\n
salary_slices[\'A\'] = slice_a_value\n
if gross_salary < slice_b_value:\n
salary_slices[\'B\'] = float(gross_salary) - float(slice_a_value)\n
else:\n
salary_slices[\'B\'] = slice_b_value\n
if gross_salary < slice_c_value:\n
salary_slices[\'C\'] = float(gross_salary) - float(slice_b_value)\n
else:\n
salary_slices[\'C\'] = slice_c_value\n
\n
# "Number" slice type\n
slice_1_value = ceiling_salary\n
slice_2_value = ceiling_salary * 3\n
if gross_salary < slice_1_value:\n
salary_slices[\'1\'] = gross_salary\n
else:\n
salary_slices[\'1\'] = slice_1_value\n
if gross_salary < slice_2_value:\n
salary_slices[\'2\'] = gross_salary - slice_1_value\n
else:\n
salary_slices[\'2\'] = slice_2_value\n
\n
# age-slice of the company\n
old_limit = DateTime(1997, 1, 1)\n
if company_birth < old_limit:\n
comp_type = \'old\'\n
else:\n
comp_type = \'new\'\n
\n
\n
### This part of the script aggregate base salary and rates.\n
\n
default = {}\n
\n
# initialize all variables to None\n
paysheet_services = []\n
erp5site = context.portal_url.getPortalObject()\n
\n
# during 06/2005 service module has been renamed service_module\n
# both names are supported\n
if hasattr(erp5site, \'service_module\'):\n
service_module = erp5site.service_module\n
else :\n
service_module = erp5site.service\n
for service in service_module.objectValues():\n
base_cat = service.getVariationRangeBaseCategoryList()\n
if \'tax_category\' in base_cat and \'salary_range\' in base_cat:\n
paysheet_services.append(service)\n
for serv in paysheet_services:\n
cat_list = serv.getCategoryList()\n
tax_cat = []\n
range_cat = []\n
for cat in cat_list:\n
if str(cat).find(\'tax_category\') != -1:\n
tax_cat.append(cat)\n
if str(cat).find(\'salary_range\') != -1:\n
range_cat.append(cat)\n
for base in range_cat:\n
mycategory = context.portal_categories.resolveCategory(base)\n
if mycategory is None:\n
context.log("PaySheetTransaction_preCalculation","WARNING! Category not found : %s" % base)\n
else:\n
new_name = serv.getId() + \'/\' + mycategory.getId()\n
default[new_name] = {\'employer_rate\':None,\'employee_rate\':None,\'base\':None}\n
\n
# Sickness insurance = Assurance maladie\n
if executive:\n
employer_rate = None\n
employee_rate = 1.15\n
else:\n
employer_rate = 13.10\n
employee_rate = 0.75\n
default[\'sickness_insurance/salaire_brut\'] = \\\n
{ \'employer_rate\' : employer_rate\n
, \'employee_rate\' : employee_rate\n
, \'base\' : gross_salary\n
}\n
\n
# Old-age insurance = Assurance vieillesse\n
if executive:\n
default[\'oldage_insurance/salaire_plafonne\'] = \\\n
{ \'employer_rate\' : None\n
, \'employee_rate\' : 6.65\n
, \'base\' : limited_salary\n
}\n
else:\n
default[\'oldage_insurance/salaire_brut\'] = \\\n
{ \'employer_rate\' : 1.60\n
, \'employee_rate\' : 0.10\n
, \'base\' : gross_salary\n
}\n
default[\'oldage_insurance/salaire_plafonne\'] = \\\n
{ \'employer_rate\' : 8.30\n
, \'employee_rate\' : 6.65\n
, \'base\' : limited_salary\n
}\n
\n
# Family benefits = Allocations familliale\n
if not executive:\n
default[\'family_benefits/salaire_brut\'] = \\\n
{ \'employer_rate\' : 5.40\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# Industrial accident = Accidents du travail\n
if not executive:\n
default[\'industrial_accident/salaire_brut\'] = \\\n
{ \'employer_rate\' : 1.10\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# Lodging helps = Aide au logemenent\n
# if company_size > 9:\n
# default[\'lodging_helps/salaire_brut\'] = \\\n
# { \'employer_rate\' : 0.40\n
# , \'employee_rate\' : None\n
# , \'base\' : gross_salary\n
# }\n
# else:\n
# default[\'lodging_helps/salaire_plafonne\'] = \\\n
# { \'employer_rate\' : 0.10\n
# , \'employee_rate\' : None\n
# , \'base\' : limited_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 transport_payment_rate in (\'\', 0, None):\n
# transport_payment_rate = 1.80\n
# if company_size > 9:\n
# default[\'transport_payment/salaire_brut\'] = \\\n
# { \'employer_rate\' : transport_payment_rate\n
# , \'employee_rate\' : None\n
# , \'base\' : gross_salary\n
# }\n
\n
# CSG\n
default[\'csg_deductible/salaire_brut_csg\'] = \\\n
{ \'employer_rate\' : None\n
, \'employee_rate\' : 5.10\n
, \'base\' : 0.97 * gross_salary\n
}\n
default[\'csg_non_deductible/salaire_brut_csg\'] = \\\n
{ \'employer_rate\' : None\n
, \'employee_rate\' : 2.9\n
, \'base\' : 0.97 * gross_salary\n
}\n
\n
# CRDS\n
# default[\'crds/salaire_brut_crds\'] = \\\n
# { \'employer_rate\' : None\n
# , \'employee_rate\' : 0.50\n
# , \'base\' : 0.97 * gross_salary\n
# }\n
\n
# Unemployment insurance = Assurance chomage\n
default[\'unemployment_insurance/salaire_brut\'] = \\\n
{ \'employer_rate\' : 4.04\n
, \'employee_rate\' : 2.44\n
, \'base\' : gross_salary\n
}\n
\n
# FNGS\n
default[\'fngs/salaire_brut\'] = \\\n
{ \'employer_rate\' : 0.25\n
, \'employee_rate\' : None\n
, \'base\' : gross_salary\n
}\n
\n
# ARRCO\n
if not executive:\n
if salary_slices.has_key(\'1\'):\n
default[\'arrco/tranche_1\'] = \\\n
{ \'employer_rate\' : 4.5\n
, \'employee_rate\' : 3.0\n
, \'base\' : salary_slices[\'1\']\n
}\n
if salary_slices.has_key(\'2\'):\n
if comp_type == \'old\':\n
employee_share_rate = 6.0\n
employer_share_rate = 9.0\n
else:\n
employee_share_rate = 8.0\n
employer_share_rate = 12.0\n
\n
default[\'arrco/tranche_2\'] = \\\n
{ \'employer_rate\' : employer_share_rate\n
, \'employee_rate\' : employee_share_rate\n
, \'base\' : salary_slices[\'2\']\n
}\n
elif salary_slices.has_key(\'A\'):\n
default[\'arrco/tranche_a\'] = \\\n
{ \'employer_rate\' : 4.5\n
, \'employee_rate\' : 3.0\n
, \'base\' : salary_slices[\'A\']\n
}\n
\n
# AGFF\n
if executive:\n
if salary_slices.has_key(\'A\'):\n
default[\'agff_tranche_a/tranche_a\'] = \\\n
{ \'employer_rate\' : 1.20\n
, \'employee_rate\' : 0.80\n
, \'base\' : salary_slices[\'A\']\n
}\n
if salary_slices.has_key(\'B\'):\n
default[\'agff_tranche_b/tranche_b\'] = \\\n
{ \'employer_rate\' : 1.30\n
, \'employee_rate\' : 0.90\n
, \'base\' : salary_slices[\'B\']\n
}\n
else:\n
if salary_slices.has_key(\'1\'):\n
default[\'agff_tranche_a/tranche_1\'] = \\\n
{ \'employer_rate\' : 1.20\n
, \'employee_rate\' : 0.80\n
, \'base\' : salary_slices[\'1\']\n
}\n
if salary_slices.has_key(\'2\'):\n
default[\'agff_tranche_b/tranche_2\'] = \\\n
{ \'employer_rate\' : 1.30\n
, \'employee_rate\' : 0.90\n
, \'base\' : salary_slices[\'2\']\n
}\n
\n
# ARGIC\n
# TODO: fix the repartition of share rate in case of slice C\n
if executive:\n
if salary_slices.has_key(\'B\'):\n
default[\'argic/tranche_b\'] = \\\n
{ \'employer_rate\' : 12.60\n
, \'employee_rate\' : 7.70\n
, \'base\' : salary_slices[\'B\']\n
}\n
if salary_slices.has_key(\'C\'):\n
# free repartition (20.30% to share between employee & employer)\n
default[\'argic/tranche_c\'] = \\\n
{ \'employer_rate\' : 10.15\n
, \'employee_rate\' : 10.15\n
, \'base\' : salary_slices[\'C\']\n
}\n
\n
# CET\n
if executive:\n
if salary_slices.has_key(\'A\'):\n
default[\'cet/tranche_a\'] = \\\n
{ \'employer_rate\' : 0.22\n
, \'employee_rate\' : 0.13\n
, \'base\' : salary_slices[\'A\']\n
}\n
if salary_slices.has_key(\'B\'):\n
default[\'cet/tranche_b\'] = \\\n
{ \'employer_rate\' : 0.22\n
, \'employee_rate\' : 0.13\n
, \'base\' : salary_slices[\'B\']\n
}\n
if salary_slices.has_key(\'C\'):\n
default[\'cet/tranche_c\'] = \\\n
{ \'employer_rate\' : 0.22\n
, \'employee_rate\' : 0.13\n
, \'base\' : salary_slices[\'C\']\n
}\n
\n
# Life insurance = Assurance vie\n
# if executive == True and salary_slices.has_key(\'A\'):\n
# default[\'life_insurance/tranche_a\'] = \\\n
# { \'employer_rate\' : 1.5\n
# , \'employee_rate\' : None\n
# , \'base\' : salary_slices[\'A\']\n
# }\n
\n
# APEC forfaitaire\n
if executive:\n
default[\'apec/forfait\'] = \\\n
{ \'employer_rate\' : 3.72\n
, \'employee_rate\' : 2.49\n
, \'base\' : 100.0\n
}\n
if salary_slices.has_key(\'B\'):\n
default[\'apec/tranche_b\'] = \\\n
{ \'employer_rate\' : 0.036\n
, \'employee_rate\' : 0.024\n
, \'base\' : salary_slices[\'B\']\n
}\n
\n
# Retirement = Retraite forfaitaire\n
if executive:\n
default[\'cavcic/forfait\'] = \\\n
{ \'employer_rate\' : 34.58\n
, \'employee_rate\' : 20.75\n
, \'base\' : 100.0\n
}\n
\n
# construction tax\n
# if company_size > 9:\n
# default[\'construction_tax/salaire_brut\'] = \\\n
# { \'employer_rate\' : 0.45\n
# , \'employee_rate\' : None\n
# , \'base\' : gross_salary\n
# }\n
\n
# training tax\n
# default[\'training_tax/salaire_brut\'] = \\\n
# { \'employer_rate\' : 0.50\n
# , \'employee_rate\' : None\n
# , \'base\' : gross_salary\n
# }\n
\n
# courses tax\n
# if company_size < 10:\n
# rate = 0.15\n
# else:\n
# rate = 1.5\n
# default[\'courses_tax/salaire_brut\'] = \\\n
# { \'employer_rate\' : rate\n
# , \'employee_rate\' : None\n
# , \'base\' : gross_salary\n
# }\n
\n
# Syntec convention\n
# TOD0: We can\'t take the decision based on the CollectiveAgreementTitle since each\n
# employee has the right to choose if they want benefit from the insurance or not.\n
# We can use instead the social_contract property of the (near-)future HR-related stuff.\n
col_agr = employee_object.getCareerCollectiveAgreementTitle()\n
if col_agr not in (None, \'\') and \'syntec\' in col_agr.lower():\n
# set the syntec rate according to the employee marital status\n
syntec_rate = 0.96\n
if employee_object.getMaritalStatusId() == \'married\':\n
syntec_rate *= 2\n
default[\'syntec_insurance/salaire_plafonne_syntec\'] = \\\n
{ \'employer_rate\' : syntec_rate\n
, \'employee_rate\' : syntec_rate\n
, \'base\' : ceiling_salary\n
}\n
\n
# Add blank lines for wickness holding (= retenue maladie) and pay bonus (= primes).\n
# Thanks to this, the accountant has the freedom to add the missing amount of money\n
# that this script can\'t guess.\n
default[\'retenue_maladie/salaire_brut\'] = \\\n
{ \'employer_rate\' : None\n
, \'employee_rate\' : None\n
, \'base\' : None\n
}\n
default[\'primes/salaire_brut\'] = \\\n
{ \'employer_rate\' : None\n
, \'employee_rate\' : None\n
, \'base\' : None\n
}\n
\n
return default\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/nexedi/portal_skins/erp5_payroll/PaySheetTransaction_preCalculation_l10n_fr_2006</string> </value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>paysheet</string>
<string>paysheet_type</string>
<string>employee</string>
<string>employee_object</string>
<string>employer</string>
<string>employer_object</string>
<string>abs</string>
<string>gross_salary</string>
<string>ceiling_salary_list</string>
<string>paysheet_year</string>
<string>ceiling_salary_available_years</string>
<string>_getitem_</string>
<string>ceiling_salary</string>
<string>limited_salary</string>
<string>True</string>
<string>executive</string>
<string>False</string>
<string>company_birth</string>
<string>employer_region</string>
<string>company_size</string>
<string>salary_slices</string>
<string>slice_a_value</string>
<string>slice_b_value</string>
<string>slice_c_value</string>
<string>_write_</string>
<string>float</string>
<string>slice_1_value</string>
<string>slice_2_value</string>
<string>DateTime</string>
<string>old_limit</string>
<string>comp_type</string>
<string>default</string>
<string>paysheet_services</string>
<string>erp5site</string>
<string>hasattr</string>
<string>service_module</string>
<string>_getiter_</string>
<string>service</string>
<string>base_cat</string>
<string>serv</string>
<string>cat_list</string>
<string>tax_cat</string>
<string>range_cat</string>
<string>cat</string>
<string>str</string>
<string>base</string>
<string>mycategory</string>
<string>None</string>
<string>new_name</string>
<string>employer_rate</string>
<string>employee_rate</string>
<string>employee_share_rate</string>
<string>employer_share_rate</string>
<string>col_agr</string>
<string>syntec_rate</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaySheetTransaction_preCalculation_l10n_fr_2006</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment