Commit 90d70f30 authored by Fabien Morin's avatar Fabien Morin

2008-02-14 fabien

* correct some year to date calcul scripts : context was used instead paysheet, so results were calculated using the current paysheet instead of using all the previous.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19317 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 54aa9efc
...@@ -68,14 +68,14 @@ ...@@ -68,14 +68,14 @@
<value> <string>if paysheet is None:\n <value> <string>if paysheet is None:\n
paysheet = context\n paysheet = context\n
\n \n
portal_simulation = context.getPortalObject().portal_simulation\n portal_simulation = paysheet.getPortalObject().portal_simulation\n
\n \n
params = {\n params = {\n
\'node_uid\' : paysheet.getSourceSectionUid(),\n \'node_uid\' : paysheet.getSourceSectionUid(),\n
\'mirror_section_uid\' : paysheet.getSourceSectionUid(),\n \'mirror_section_uid\' : paysheet.getSourceSectionUid(),\n
\'section_uid\' : paysheet.getDestinationSectionUid(),\n \'section_uid\' : paysheet.getDestinationSectionUid(),\n
\'tax_category_uid\' :\\\n \'tax_category_uid\' :\\\n
context.portal_categories.tax_category.employee_share.getUid(),\n paysheet.portal_categories.tax_category.employee_share.getUid(),\n
\'to_date\' : paysheet.getStartDate(),\n \'to_date\' : paysheet.getStartDate(),\n
\'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n \'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n
\'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n \'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n
......
...@@ -68,14 +68,14 @@ ...@@ -68,14 +68,14 @@
<value> <string>if paysheet is None:\n <value> <string>if paysheet is None:\n
paysheet = context\n paysheet = context\n
\n \n
portal_simulation = context.getPortalObject().portal_simulation\n portal_simulation = paysheet.getPortalObject().portal_simulation\n
\n \n
params = {\n params = {\n
\'node_uid\' : paysheet.getSourceSectionUid(),\n \'node_uid\' : paysheet.getSourceSectionUid(),\n
\'mirror_section_uid\' : paysheet.getSourceSectionUid(),\n \'mirror_section_uid\' : paysheet.getSourceSectionUid(),\n
\'section_uid\' : paysheet.getDestinationSectionUid(),\n \'section_uid\' : paysheet.getDestinationSectionUid(),\n
\'tax_category_uid\' :\\\n \'tax_category_uid\' :\\\n
context.portal_categories.tax_category.employee_share.getUid(),\n paysheet.portal_categories.tax_category.employee_share.getUid(),\n
\'to_date\' : paysheet.getStartDate(),\n \'to_date\' : paysheet.getStartDate(),\n
\'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n \'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n
\'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n \'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n
......
...@@ -68,24 +68,27 @@ ...@@ -68,24 +68,27 @@
<value> <string>if paysheet is None:\n <value> <string>if paysheet is None:\n
paysheet = context\n paysheet = context\n
\n \n
portal_simulation = context.getPortalObject().portal_simulation\n portal_simulation = paysheet.getPortalObject().portal_simulation\n
\n \n
params = {\n params = {\n
\'section_uid\' : paysheet.getDestinationSectionUid(),\n \'section_uid\' : paysheet.getDestinationSectionUid(),\n
\'node_uid\' : paysheet.getSourceSectionUid(),\n \'node_uid\' : paysheet.getSourceSectionUid(),\n
\'tax_category_uid\' :\\\n \'tax_category_uid\' :\\\n
context.portal_categories.tax_category.employee_share.getUid(),\n paysheet.portal_categories.tax_category.employee_share.getUid(),\n
\'to_date\' : paysheet.getStartDate(),\n \'to_date\' : paysheet.getStartDate(),\n
\'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n \'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n
\'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n \'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n
\'precision\' : paysheet.getPriceCurrencyValue().getQuantityPrecision(),\n \'precision\' : paysheet.getPriceCurrencyValue().getQuantityPrecision(),\n
\'resource_category\' : [\'base_amount/deductible_tax\', \n \'resource_category\' : [\'base_amount/deductible_tax\', \n
\'base_amount/non_deductible_tax\'],\n \'base_amount/non_deductible_tax\'],\n
}\n }\n
\n \n
deductible_tax = portal_simulation.getInventoryAssetPrice(**params)\n deductible_tax = portal_simulation.getInventoryAssetPrice(**params)\n
over_time = context.PaySheetTransaction_getYearToDateOvertimeAmount()\n over_time = paysheet.PaySheetTransaction_getYearToDateOvertimeAmount()\n
return context.PaySheetTransaction_getYearToDateGrossSalary() - over_time - deductible_tax\n gross_salary = paysheet.PaySheetTransaction_getYearToDateGrossSalary() \n
net_pay = gross_salary - over_time - deductible_tax\n
\n
return net_pay\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -138,6 +141,8 @@ return context.PaySheetTransaction_getYearToDateGrossSalary() - over_time - dedu ...@@ -138,6 +141,8 @@ return context.PaySheetTransaction_getYearToDateGrossSalary() - over_time - dedu
<string>_apply_</string> <string>_apply_</string>
<string>deductible_tax</string> <string>deductible_tax</string>
<string>over_time</string> <string>over_time</string>
<string>gross_salary</string>
<string>net_pay</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -68,14 +68,14 @@ ...@@ -68,14 +68,14 @@
<value> <string>if paysheet is None:\n <value> <string>if paysheet is None:\n
paysheet = context\n paysheet = context\n
\n \n
portal_simulation = context.getPortalObject().portal_simulation\n portal_simulation = paysheet.getPortalObject().portal_simulation\n
\n \n
params = {\n params = {\n
\'node_uid\' : paysheet.getSourceSectionUid(),\n \'node_uid\' : paysheet.getSourceSectionUid(),\n
\'mirror_section_uid\' : paysheet.getSourceSectionUid(),\n \'mirror_section_uid\' : paysheet.getSourceSectionUid(),\n
\'section_uid\' : paysheet.getDestinationSectionUid(),\n \'section_uid\' : paysheet.getDestinationSectionUid(),\n
\'tax_category_uid\' :\\\n \'tax_category_uid\' :\\\n
context.portal_categories.tax_category.employee_share.getUid(),\n paysheet.portal_categories.tax_category.employee_share.getUid(),\n
\'to_date\' : paysheet.getStartDate(),\n \'to_date\' : paysheet.getStartDate(),\n
\'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n \'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n
\'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n \'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n
......
...@@ -83,10 +83,10 @@ paysheet_list = accounting_module.searchFolder( **search_params)\n ...@@ -83,10 +83,10 @@ paysheet_list = accounting_module.searchFolder( **search_params)\n
\n \n
yearly_work_time = 0\n yearly_work_time = 0\n
for paysheet in paysheet_list:\n for paysheet in paysheet_list:\n
annotation_line = context.getAnnotationLineFromReference(\\\n annotation_line = paysheet.getAnnotationLineFromReference(\\\n
reference=\'overtime_small_rate\')\n reference=\'overtime_small_rate\')\n
nb_heures_supp = annotation_line.getQuantity()\n nb_heures_supp = annotation_line.getQuantity()\n
annotation_line = context.getAnnotationLineFromReference(\\\n annotation_line = paysheet.getAnnotationLineFromReference(\\\n
reference=\'overtime_big_rate\')\n reference=\'overtime_big_rate\')\n
nb_heures_supp += annotation_line.getQuantity()\n nb_heures_supp += annotation_line.getQuantity()\n
yearly_work_time += nb_heures_supp \n yearly_work_time += nb_heures_supp \n
......
...@@ -68,13 +68,13 @@ ...@@ -68,13 +68,13 @@
<value> <string>if paysheet is None:\n <value> <string>if paysheet is None:\n
paysheet = context\n paysheet = context\n
\n \n
portal_simulation = context.getPortalObject().portal_simulation\n portal_simulation = paysheet.getPortalObject().portal_simulation\n
\n \n
params = {\n params = {\n
\'section_uid\' : paysheet.getDestinationSectionUid(),\n \'section_uid\' : paysheet.getDestinationSectionUid(),\n
\'node_uid\' : paysheet.getSourceSectionUid(),\n \'node_uid\' : paysheet.getSourceSectionUid(),\n
\'tax_category_uid\' :\\\n \'tax_category_uid\' :\\\n
context.portal_categories.tax_category.employee_share.getUid(),\n paysheet.portal_categories.tax_category.employee_share.getUid(),\n
\'to_date\' : paysheet.getStartDate(),\n \'to_date\' : paysheet.getStartDate(),\n
\'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n \'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n
\'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n \'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n
...@@ -85,10 +85,12 @@ params = {\n ...@@ -85,10 +85,12 @@ params = {\n
\n \n
\n \n
deductible_tax = portal_simulation.getInventoryAssetPrice(**params)\n deductible_tax = portal_simulation.getInventoryAssetPrice(**params)\n
over_time = context.PaySheetTransaction_getYearToDateOvertimeAmount()\n over_time = paysheet.PaySheetTransaction_getYearToDateOvertimeAmount()\n
gross_salary = context.PaySheetTransaction_getYearToDateGrossSalary()\n gross_salary = paysheet.PaySheetTransaction_getYearToDateGrossSalary()\n
\n \n
return gross_salary - over_time - deductible_tax\n taxable_net_pay = gross_salary - over_time - deductible_tax\n
\n
return taxable_net_pay\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -142,6 +144,7 @@ return gross_salary - over_time - deductible_tax\n ...@@ -142,6 +144,7 @@ return gross_salary - over_time - deductible_tax\n
<string>deductible_tax</string> <string>deductible_tax</string>
<string>over_time</string> <string>over_time</string>
<string>gross_salary</string> <string>gross_salary</string>
<string>taxable_net_pay</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -83,7 +83,7 @@ paysheet_list = accounting_module.searchFolder( **search_params)\n ...@@ -83,7 +83,7 @@ paysheet_list = accounting_module.searchFolder( **search_params)\n
\n \n
yearly_work_time = 0\n yearly_work_time = 0\n
for paysheet in paysheet_list:\n for paysheet in paysheet_list:\n
annotation_line = context.getAnnotationLineFromReference(\\\n annotation_line = paysheet.getAnnotationLineFromReference(\\\n
reference=\'work_time_annotation_line\')\n reference=\'work_time_annotation_line\')\n
nb_heures = annotation_line.getQuantity()\n nb_heures = annotation_line.getQuantity()\n
yearly_work_time += nb_heures\n yearly_work_time += nb_heures\n
......
2008-02-14 fabien
* correct some script : context was used instead paysheet, so results were wrong
2008-01-24 fabien 2008-01-24 fabien
* set version number to 2.1 : this bt is the second version of payroll. * set version number to 2.1 : this bt is the second version of payroll.
......
204 205
\ No newline at end of file \ 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