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

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Nov 27 16:12:04 CET 2007


Author: fabien
Date: Tue Nov 27 16:12:04 2007
New Revision: 17825

URL: http://svn.erp5.org?rev=17825&view=rev
Log:
- change for imbrication order to update base participation only when changing
slice.
- remove an if condition wich was a mistake

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=17825&r1=17824&r2=17825&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/PaySheetTransaction.py (original)
+++ erp5/trunk/products/ERP5/Document/PaySheetTransaction.py Tue Nov 27 16:12:04 2007
@@ -322,8 +322,8 @@
       variation_slice_list = model_line.getVariationCategoryList(\
                                       base_category_list=['salary_range',])
 
-      for share in variation_share_list:
-        for slice in variation_slice_list:
+      for slice in variation_slice_list:
+        for share in variation_share_list:
           cell = model_line.getCell(slice, share)
           if cell is None:
             LOG('createNotEditablePaySheetLineList : cell is None')
@@ -383,20 +383,19 @@
                      }
           cell_list.append(new_cell)
 
-          # update base participation
-          base_participation_list = service.getBaseAmountList(base=1)
-          for base_participation in base_participation_list:
-            if quantity:
-              if base_amount_current_value_dict.has_key(base_participation):
-                old_val = base_amount_current_value_dict[base_participation]
-              else:
-                old_val = 0
-              new_val = old_val + quantity
-
-              if price:
-                if old_val != 0:
-                  new_val = round((old_val + quantity*price), precision) 
-              base_amount_current_value_dict[base_participation] = new_val
+        # update base participation
+        base_participation_list = service.getBaseAmountList(base=1)
+        for base_participation in base_participation_list:
+          if quantity:
+            if base_amount_current_value_dict.has_key(base_participation):
+              old_val = base_amount_current_value_dict[base_participation]
+            else:
+              old_val = 0
+            new_val = old_val + quantity
+
+            if price:
+              new_val = round((old_val + quantity*price), precision) 
+            base_amount_current_value_dict[base_participation] = new_val
 
       if cell_list:
         # create the PaySheetLine




More information about the Erp5-report mailing list