[Erp5-report] r17821 - /erp5/trunk/products/ERP5/Document/PaySheetTransaction.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Nov 27 14:37:40 CET 2007


Author: fabien
Date: Tue Nov 27 14:37:40 2007
New Revision: 17821

URL: http://svn.erp5.org?rev=17821&view=rev
Log:
remove a hack and put it in the localized script PaySheetTransaction_postCalculation

Modified:
    erp5/trunk/products/ERP5/Document/PaySheetTransaction.py

Modified: erp5/trunk/products/ERP5/Document/PaySheetTransaction.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/PaySheetTransaction.py?rev=17821&r1=17820&r2=17821&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/PaySheetTransaction.py (original)
+++ erp5/trunk/products/ERP5/Document/PaySheetTransaction.py Tue Nov 27 14:37:40 2007
@@ -295,7 +295,6 @@
     model_line_list = [line for line in model_line_list if not line.getEditable()]
 
     pay_sheet_line_list = []
-    employee_tax_amount = 0
 
     # main loop : find all informations and create cell and PaySheetLines
     for model_line in model_line_list:
@@ -330,7 +329,6 @@
             LOG('createNotEditablePaySheetLineList : cell is None')
             continue
           # get the slice :
-          model_slice = None
           model_slice = model_line.getParentValue().getCell(slice)
           quantity = 0.0
           price = 0.0
@@ -369,7 +367,7 @@
           LOG('script_name :', 0, script_name)
           result = calculation_script(\
             base_amount_current_value_dict=base_amount_current_value_dict,
-            share=share,
+            share=share, #XXX
             model_slice_min=model_slice_min, 
             model_slice_max=model_slice_max, 
             cell=cell,)
@@ -384,13 +382,6 @@
                        'price'    : price,
                      }
           cell_list.append(new_cell)
-
-          #XXX this is a hack to have the net salary
-          base_list = model_line.getResourceValue().getBaseAmountList()
-          if price is not None and 'employee_share' in share and\
-              ('deductible_tax' in base_list or\
-               'non_deductible_tax' in base_list):
-            employee_tax_amount += round((price * quantity), precision)
 
           # update base participation
           base_participation_list = service.getBaseAmountList(base=1)
@@ -422,9 +413,9 @@
 
     # this script is used to add a line that permit to have good accounting 
     # lines
-    localized_add_end_line_script = getattr(self,
+    post_calculation_script = getattr(self,
                                 'PaySheetTransaction_postCalculation', None)
-    if localized_add_end_line_script:
-      localized_add_end_line_script(employee_tax_amount)
+    if post_calculation_script:
+      post_calculation_script()
 
     return pay_sheet_line_list




More information about the Erp5-report mailing list