From 955fcaf17cd3fc9833c22ebd08f895b2414bb89e Mon Sep 17 00:00:00 2001 From: Kevin Deldycke <kevin@nexedi.com> Date: Thu, 30 Mar 2006 23:49:29 +0000 Subject: [PATCH] * 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. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6382 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../Account_zGetTotalQuantity.xml | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_zGetTotalQuantity.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_zGetTotalQuantity.xml index ddaae4df17..694bcef04d 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_zGetTotalQuantity.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_zGetTotalQuantity.xml @@ -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 @@ no_mirror_section_uid</string> </value> <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 @@ WHERE stock.node_uid = <dtml-var node_uid>\n 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 @@ AND <dtml-var query>\n <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 @@ WHERE stock.node_uid = <dtml-var node_uid>\n 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 -- 2.30.9