[Erp5-report] r6382 - /erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_ac...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Mar 31 01:49:30 CEST 2006


Author: kevin
Date: Fri Mar 31 01:49:29 2006
New Revision: 6382

URL: http://svn.erp5.org?rev=6382&view=rev
Log:
* Filter section by portal_type to break acquisition of 'group' property from Person to Organisation.
  * Round summed values to avoid the following case: total_quantity can be equal to 4470.7572 without this rounding which is interpreted on the python side as "4470.76" when rouding instead of "4470.75" which is the true value. This problem appear often when we deal with social-related accounting data which are lots of little amounts of money based on percent calculation.

Modified:
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_zGetTotalQuantity.xml

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_zGetTotalQuantity.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_zGetTotalQuantity.xml?rev=6382&r1=6381&r2=6382&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_zGetTotalQuantity.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_zGetTotalQuantity.xml Fri Mar 31 01:49:29 2006
@@ -145,20 +145,20 @@
                         <key> <string>_keys</string> </key>
                         <value>
                           <list>
-                            <string>node_uid</string>
-                            <string>query</string>
-                            <string>omit_input</string>
-                            <string>omit_output</string>
-                            <string>resource_uid</string>
-                            <string>from_date</string>
-                            <string>to_date</string>
-                            <string>at_date</string>
-                            <string>transaction_simulation_state</string>
-                            <string>transaction_section_category</string>
-                            <string>payment_uid</string>
-                            <string>no_payment_uid</string>
-                            <string>mirror_section_uid</string>
-                            <string>no_mirror_section_uid</string>
+<string>node_uid</string>
+<string>query</string>
+<string>omit_input</string>
+<string>omit_output</string>
+<string>resource_uid</string>
+<string>from_date</string>
+<string>to_date</string>
+<string>at_date</string>
+<string>transaction_simulation_state</string>
+<string>transaction_section_category</string>
+<string>payment_uid</string>
+<string>no_payment_uid</string>
+<string>mirror_section_uid</string>
+<string>no_mirror_section_uid</string>
                           </list>
                         </value>
                     </item>
@@ -235,8 +235,8 @@
             <value> <string encoding="cdata"><![CDATA[
 
 SELECT\n
-  SUM(stock.quantity) AS quantity,\n
-  SUM(stock.total_price) AS total_price\n
+  SUM(ROUND(stock.quantity,2)) AS quantity,\n
+  SUM(ROUND(stock.total_price,2)) AS total_price\n
 FROM\n
   movement,\n
   stock,\n
@@ -304,6 +304,7 @@
   AND section_membership.category_uid =  section_c.uid\n
   AND section_membership.base_category_uid = section_bc.uid\n
   AND section_membership.uid = section.uid\n
+  AND section.portal_type = \'Organisation\'\n
 <dtml-if query>\n
   AND category.uid = stock.section_uid\n
 AND <dtml-var query>\n
@@ -347,8 +348,8 @@
                         <value> <string encoding="cdata"><![CDATA[
 
 SELECT\n
-  SUM(stock.quantity) AS quantity,\n
-  SUM(stock.total_price) AS total_price\n
+  SUM(ROUND(stock.quantity,2)) AS quantity,\n
+  SUM(ROUND(stock.total_price,2)) AS total_price\n
 FROM\n
   movement,\n
   stock,\n
@@ -416,6 +417,7 @@
   AND section_membership.category_uid =  section_c.uid\n
   AND section_membership.base_category_uid = section_bc.uid\n
   AND section_membership.uid = section.uid\n
+  AND section.portal_type = \'Organisation\'\n
 <dtml-if query>\n
   AND category.uid = stock.section_uid\n
 AND <dtml-var query>\n




More information about the Erp5-report mailing list