[Erp5-report] r10915 - in /erp5/trunk/bt5/erp5_payroll: SkinTemplateItem/portal_skins/erp5_...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Oct 24 17:32:21 CEST 2006


Author: kevin
Date: Tue Oct 24 17:32:19 2006
New Revision: 10915

URL: http://svn.erp5.org?rev=10915&view=rev
Log:
Fix gross salary / base salary mix.

Modified:
    erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_postCalculation.xml
    erp5/trunk/bt5/erp5_payroll/bt/change_log
    erp5/trunk/bt5/erp5_payroll/bt/revision
    erp5/trunk/bt5/erp5_payroll/bt/version

Modified: erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_postCalculation.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_postCalculation.xml?rev=10915&r1=10914&r2=10915&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_postCalculation.xml (original)
+++ erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_postCalculation.xml Tue Oct 24 17:32:19 2006
@@ -156,8 +156,7 @@
 # This list contain all paysheet items, indexed by service\n
 paysheet_items = {}\n
 \n
-# Initialise the user preview line index\n
-user_line_index = 0\n
+gross_salary = 0.0\n
 total_employee_share = 0.0\n
 \n
 # Scan every preview line to create an item for each service\n
@@ -199,6 +198,10 @@
                    , "base" : -base\n
                    , "rate" : share\n
                    }\n
+        # Update the gross salary\n
+        # The payroll service "setup convention" require that the fixed value should be defined on \'employer_share\'\n
+        if salary_range.endswith(\'/fixed/gross\'):\n
+          gross_salary = r_(gross_salary + share)\n
       if cat.endswith(\'/employee_share\') and employee_share not in (None, \'\'):\n
         share = float(employee_share)\n
         new_cell = { "x"    : cat\n
@@ -206,8 +209,7 @@
                    , "base" : -base\n
                    , "rate" : share\n
                    }\n
-      #context.log("PaySheetTransaction_postCalculation","cat=%s base=%s rate=%s" % (cat, base, rate))\n
-\n
+        # Update the total employee share\n
         total_employee_share = r_(total_employee_share + r_(base * float(share)))\n
       # Add the cell to the conresponding paysheet item\n
       if new_cell != None:\n
@@ -234,8 +236,6 @@
 if labour_service is None:\n
   raise ValueError, "Unable to find `labour` service"\n
 \n
-gross_salary = r_(context.getGrossSalary())\n
-\n
 labour_employee_share_category = None\n
 labour_employer_share_category = None\n
 for c in labour_service.getCategoryList():\n
@@ -244,6 +244,9 @@
     if c.endswith(\'employer_share\'): labour_employer_share_category = c\n
   if c.startswith(\'salary_range\'):\n
     labour_salary_range = c\n
+\n
+base_salary = r_(context.getGrossSalary())\n
+gross_salary = r_(gross_salary + r_(context.getGrossSalary()))\n
 \n
 createPaySheetItem( title    = \'Salary\' # labour_service.getTitleOrId()\n
                   , res      = labour_service.getRelativeUrl()\n
@@ -256,7 +259,7 @@
                                 { "x"    : labour_employer_share_category\n
                                 , "y"    : labour_salary_range\n
                                 , "base" : -1.0\n
-                                , "rate" : gross_salary\n
+                                , "rate" : base_salary\n
                                 }]\n
                   )\n
 \n
@@ -335,7 +338,7 @@
                             <string>payroll_date</string>
                             <string>_getitem_</string>
                             <string>paysheet_items</string>
-                            <string>user_line_index</string>
+                            <string>gross_salary</string>
                             <string>total_employee_share</string>
                             <string>line</string>
                             <string>service_id</string>
@@ -353,11 +356,11 @@
                             <string>item</string>
                             <string>labour_service</string>
                             <string>ValueError</string>
-                            <string>gross_salary</string>
                             <string>labour_employee_share_category</string>
                             <string>labour_employer_share_category</string>
                             <string>c</string>
                             <string>labour_salary_range</string>
+                            <string>base_salary</string>
                             <string>True</string>
                             <string>ZTUtils</string>
                             <string>make_query</string>

Modified: erp5/trunk/bt5/erp5_payroll/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_payroll/bt/change_log?rev=10915&r1=10914&r2=10915&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_payroll/bt/change_log (original)
+++ erp5/trunk/bt5/erp5_payroll/bt/change_log Tue Oct 24 17:32:19 2006
@@ -1,3 +1,6 @@
+2006-10-24 Kevin
+* Support dynamic update of gross salary calculation on pay sheet preview.
+
 2006-10-23 Kevin
 * Change category structure to support additional lines beside base salary to constitute the gross salary. Now the gross salary can be composed of several lines, variable or fixed.
 * Use Paysheet currency for precision rounding.

Modified: erp5/trunk/bt5/erp5_payroll/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_payroll/bt/revision?rev=10915&r1=10914&r2=10915&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_payroll/bt/revision (original)
+++ erp5/trunk/bt5/erp5_payroll/bt/revision Tue Oct 24 17:32:19 2006
@@ -1,1 +1,1 @@
-58
+65

Modified: erp5/trunk/bt5/erp5_payroll/bt/version
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_payroll/bt/version?rev=10915&r1=10914&r2=10915&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_payroll/bt/version (original)
+++ erp5/trunk/bt5/erp5_payroll/bt/version Tue Oct 24 17:32:19 2006
@@ -1,1 +1,1 @@
-0.1.14
+0.1.15




More information about the Erp5-report mailing list