Commit 803a31fe authored by Aurel's avatar Aurel

update categories used in payroll

improve scripts

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45047 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 503246f6
......@@ -121,7 +121,9 @@ def getTaxableNetPayId(salaire_net_imposable):\n
return s\n
\n
total_employee_tax = context.PaySheetTransaction_getMovementTotalPriceFromCategory(\\\n
base_contribution=\'base_contribution/base_amount/payroll/tax\',\n
no_base_contribution=True,\n
include_empty_contribution=False,\n
excluded_reference_list=[\'ticket_restaurant\',],\n
contribution_share=\'contribution_share/employee\')\n
def getTotalEmployeeTaxId(total_employee_tax):\n
s = \'\'\n
......@@ -131,7 +133,9 @@ def getTotalEmployeeTaxId(total_employee_tax):\n
return s\n
\n
total_employer_tax = context.PaySheetTransaction_getMovementTotalPriceFromCategory(\\\n
base_contribution=\'base_contribution/base_amount/payroll/tax\',\n
no_base_contribution=True,\n
include_empty_contribution=False,\n
excluded_reference_list=[\'ticket_restaurant\',],\n
contribution_share=\'contribution_share/employer\')\n
def getTotalEmployerTaxId(total_employer_tax):\n
s = \'\'\n
......@@ -176,10 +180,11 @@ def getPaymentConditionText(paysheet):\n
gross_salary = context.PaySheetTransaction_getMovementTotalPriceFromCategory(\\\n
base_contribution=\'base_contribution/base_amount/payroll/report/salary/gross\',\n
contribution_share=\'contribution_share/employee\')\n
year_to_date_gross_salary = context.PaySheetTransaction_getYearToDateBaseContributionTotalPrice(\\\n
paysheet=context, base_contribution_list=\'payroll/report/salary/gross\') + gross_salary\n
\n
#year_to_date_gross_salary = context.PaySheetTransaction_getYearToDateBaseContributionTotalPrice(\\\n
# paysheet=context, base_contribution_list=\'payroll/report/salary/gross\') + gross_salary\n
year_to_date_gross_salary = context.PaySheetTransaction_getYearToDateSlice()\n
year_to_date_slice_a = context.PaySheetTransaction_getYearToDateSlice(\'salary_range/france/tranche_a\')\n
year_to_date_slice_b = context.PaySheetTransaction_getYearToDateSlice(\'salary_range/france/tranche_b\')\n
\n
worked_hour_count = context.getWorkTimeAnnotationLineQuantity(0)\n
year_to_date_worked_hour_count = worked_hour_count + \\\n
......@@ -234,6 +239,7 @@ data_dict = {\n
\'description\': getFieldAsLineList(context.getDescription() or \'\'),\n
\'year_to_date_gross_salary\': year_to_date_gross_salary,\n
\'year_to_date_slice_a\': year_to_date_slice_a,\n
\'year_to_date_slice_b\': year_to_date_slice_b,\n
\'year_to_date_worked_hour_count\': year_to_date_worked_hour_count,\n
\'year_to_date_bonus_worked_hour_count\': year_to_date_bonus_worked_hour_count,\n
\'year_to_date_bonus_worked_hour_amount\': year_to_date_bonus_worked_hour_amount,\n
......
......@@ -70,31 +70,16 @@ search_params = {\n
}\n
\n
paysheet_list = [r.getObject() for r in accounting_module.searchFolder(**search_params)]\n
\n
paysheet_list.append(context)\n
yearly_slice_amount = 0\n
# get the slice value for this paysheet :\n
model = context.getSpecialiseValue().getEffectiveModel(\\\n
start_date=context.getStartDate(),\n
stop_date=context.getStopDate())\n
slice = model.getCell(slice_path, paysheet=context)\n
\n
if slice is None:\n
return 0.0\n
\n
plafond_max = slice.getQuantityRangeMax()\n
plafond_min = slice.getQuantityRangeMin()\n
\n
gross_salary = context.PaySheetTransaction_getMovementTotalPriceFromCategory(\\\n
for paysheet in paysheet_list :\n
gross_salary=paysheet.PaySheetTransaction_getMovementTotalPriceFromCategory(\\\n
base_contribution=\'base_contribution/base_amount/payroll/report/salary/gross\',\n
contribution_share=\'contribution_share/employee\')\n
\n
if gross_salary < plafond_max:\n
slice_amount = gross_salary - plafond_min\n
else:\n
slice_amount = plafond_max - plafond_min\n
yearly_slice_amount += slice_amount\n
\n
for paysheet in paysheet_list :\n
if slice_path is None:\n
yearly_slice_amount += gross_salary\n
continue\n
model = paysheet.getSpecialiseValue().getEffectiveModel(\\\n
start_date=paysheet.getStartDate(),\n
stop_date=paysheet.getStopDate())\n
......@@ -104,9 +89,6 @@ for paysheet in paysheet_list :\n
return 0.0\n
plafond_max = slice.getQuantityRangeMax()\n
plafond_min = slice.getQuantityRangeMin()\n
gross_salary=paysheet.PaySheetTransaction_getMovementTotalPriceFromCategory(\\\n
base_contribution=\'base_contribution/base_amount/payroll/report/salary/gross\',\n
contribution_share=\'contribution_share/employee\')\n
slice_amount = 0\n
if gross_salary < plafond_max:\n
slice_amount = gross_salary - plafond_min\n
......
133
\ No newline at end of file
135
\ No newline at end of file
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