Commit 19ceedfd authored by Aurel's avatar Aurel

overtime is no longer defined in annotation line, update report scripts according to new definition

parent f18a24d3
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </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>\'\'\'\n
return the quantity composed by all quantity of paysheet line wich category of\n
category_list parameter is in variation_category_list of the PaySheet line \n
and wich has a base_contribution in the base_contribution_list\n
\'\'\'\n
if excluded_reference_list is None:\n
excluded_reference_list = []\n
\n
total_quantity = 0\n
movement_list = context.getMovementList(portal_type=(\'Pay Sheet Line\', \'Pay Sheet Cell\'))\n
for movement in movement_list:\n
# Reference must be checked on line\n
if excluded_reference_list:\n
if "Cell" in movement.getPortalType():\n
line = movement.getParentValue()\n
else:\n
line = movement\n
if line.getReference() in excluded_reference_list:\n
continue\n
\n
if base_contribution is not None and movement.isMemberOf(base_contribution) or no_base_contribution:\n
\n
# base_contribution is mandatory, but not contribution_share. If contribution_share is\n
# given, search with it, if not, care only about base_contribution\n
if contribution_share is not None and movement.isMemberOf(contribution_share):\n
total_quantity += movement.getQuantity()\n
elif include_empty_contribution and (contribution_share is None or len(movement.getContributionShareList()) == 0):\n
total_quantity += movement.getQuantity()\n
\n
return total_quantity\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>base_contribution=None, contribution_share=None, no_base_contribution=False, include_empty_contribution=True, excluded_reference_list=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaySheetTransaction_getMovementQuantityFromCategory</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -68,19 +68,8 @@ paysheet_list = accounting_module.searchFolder( **search_params)\n
\n
nb_heures_supp = 0\n
for paysheet in paysheet_list:\n
small_heures_supp = 0\n
big_heures_supp = 0\n
annotation_line = paysheet.getAnnotationLineFromReference(\\\n
reference=\'overtime_small_rate\')\n
if annotation_line is not None :\n
small_heures_supp = annotation_line.getQuantity()\n
\n
annotation_line = paysheet.getAnnotationLineFromReference(\\\n
reference=\'overtime_big_rate\')\n
if annotation_line is not None :\n
big_heures_supp = annotation_line.getQuantity()\n
\n
nb_heures_supp += (small_heures_supp + big_heures_supp)\n
nb_heures_supp += paysheet.PaySheetTransaction_getMovementQuantityFromCategory(\n
\'base_contribution/base_amount/payroll/report/overtime\')\n
\n
return nb_heures_supp\n
</string> </value>
......
592
\ No newline at end of file
591
\ No newline at end of file
......@@ -113,6 +113,7 @@ def getPriceCurrencyId(currency):\n
return s\n
\n
getMovementTotalPriceFromCategory = paysheet.PaySheetTransaction_getMovementTotalPriceFromCategory\n
getMovementQuantityFromCategory = paysheet.PaySheetTransaction_getMovementQuantityFromCategory\n
\n
salaire_net_imposable = getMovementTotalPriceFromCategory(\\\n
base_contribution=\'base_contribution/base_amount/payroll/base/income_tax\',\n
......@@ -193,11 +194,11 @@ worked_hour_count = paysheet.getWorkTimeAnnotationLineQuantity(0)\n
year_to_date_worked_hour_count = worked_hour_count + \\\n
paysheet.PaySheetTransaction_getYearToDateWorkTimeSalary() or 0\n
\n
over_time_small_rate = paysheet.getAnnotationLineFromReference(reference=\'overtime_small_rate\')\n
over_time_big_rate = paysheet.getAnnotationLineFromReference(reference=\'overtime_big_rate\')\n
bonus_worked_hour_count = over_time_small_rate is not None and \\\n
over_time_big_rate is not None and \\\n
over_time_small_rate.getQuantity() + over_time_big_rate.getQuantity() or 0\n
#over_time_small_rate = paysheet.getAnnotationLineFromReference(reference=\'overtime_small_rate\')\n
#over_time_big_rate = paysheet.getAnnotationLineFromReference(reference=\'overtime_big_rate\')\n
bonus_worked_hour_count = getMovementQuantityFromCategory(\\\n
base_contribution=\'base_contribution/base_amount/payroll/report/overtime\')\n
\n
year_to_date_bonus_worked_hour_count = bonus_worked_hour_count + \\\n
paysheet.PaySheetTransaction_getYearToDateOvertimeHours() or 0\n
\n
......
140
\ No newline at end of file
141
\ 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