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

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jun 17 10:39:09 CEST 2008


Author: jerome
Date: Tue Jun 17 10:39:09 2008
New Revision: 21633

URL: http://svn.erp5.org?rev=21633&view=rev
Log:
Previously, if ratio was set to 0 or None on a model line, it was assumed that
the ratio was 100%. We want to separate it in two different cases:
- ratio is 0 -> the line should not be created.
- ratio is not set (ie. None) -> this means that no ratio apply here, it's a
simple amount, so ratio default to 100%
Move this in the default calculation script so that it's possible to
change the behaviour.
Add tests for those two cases (price = None and price = 0)

Modified:
    erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_defaultCalculationScript.xml
    erp5/trunk/bt5/erp5_payroll/bt/revision

Modified: erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_defaultCalculationScript.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_defaultCalculationScript.xml?rev=21633&r1=21632&r2=21633&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_defaultCalculationScript.xml (original)
+++ erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_defaultCalculationScript.xml Tue Jun 17 10:39:09 2008
@@ -69,8 +69,10 @@
 
 precision = context.getPriceCurrencyValue().getQuantityPrecision()\n
 \n
-quantity = cell.getQuantity() or 0\n
-price = cell.getPrice() or 0\n
+quantity = cell.getQuantity()\n
+price = cell.getPrice()\n
+if price is None:\n
+  price = 1\n
 \n
 model_line = cell.getParentValue()\n
 \n
@@ -181,13 +183,13 @@
                             <string>precision</string>
                             <string>quantity</string>
                             <string>price</string>
+                            <string>None</string>
                             <string>model_line</string>
                             <string>dict</string>
                             <string>base_application</string>
                             <string>tax_category_list</string>
                             <string>_getitem_</string>
                             <string>tax_category</string>
-                            <string>None</string>
                             <string>_getiter_</string>
                             <string>base</string>
                             <string>_inplacevar_</string>

Modified: erp5/trunk/bt5/erp5_payroll/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_payroll/bt/revision?rev=21633&r1=21632&r2=21633&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_payroll/bt/revision (original)
+++ erp5/trunk/bt5/erp5_payroll/bt/revision Tue Jun 17 10:39:09 2008
@@ -1,1 +1,1 @@
-291
+292




More information about the Erp5-report mailing list