[Erp5-report] r19110 - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_skins/er...
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Feb 6 18:46:57 CET 2008
Author: yusei
Date: Wed Feb 6 18:46:56 2008
New Revision: 19110
URL: http://svn.erp5.org?rev=19110&view=rev
Log:
Fixed wrong sub queries for calculation of debit and credit.
Modified:
erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml
erp5/trunk/bt5/erp5_accounting/bt/revision
Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml?rev=19110&r1=19109&r2=19110&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml Wed Feb 6 18:46:56 2008
@@ -636,8 +636,8 @@
<dtml-else>\n
SELECT catalog.*,\n
<dtml-let accounting_movement_list="portal_url.getPortalObject().getPortalAccountingMovementTypeList()">\n
- ( SELECT SUM(stock.total_price) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.total_price > 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS debit,\n
- ( SELECT -SUM(stock.total_price) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.total_price < 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS credit\n
+ ( SELECT IFNULL(SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price > 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS debit,\n
+ ( SELECT IFNULL(-SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price < 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS credit\n
FROM (\n
</dtml-let>\n
</dtml-if>\n
@@ -665,6 +665,7 @@
, delivery.start_date as operation_date\n
, \'source\' as section_mark\n
, catalog.source_reference as specific_reference\n
+ <dtml-if "section_category">, category.uid as category_uid</dtml-if>\n
<dtml-if "not (stat or count) and query[\'order_by_expression\']">\n
<dtml-let order_column="query[\'order_by_expression\'].split(\' \')[0]">\n
<dtml-if "not order_column in (\'operation_date\', \'specific_reference\')">\n
@@ -847,6 +848,7 @@
, delivery.stop_date as operation_date\n
, \'destination\' as section_mark\n
, catalog.destination_reference as specific_reference\n
+ <dtml-if "section_category">, category.uid as category_uid</dtml-if>\n
<dtml-if "not (stat or count) and query[\'order_by_expression\']">\n
<dtml-let order_column="query[\'order_by_expression\'].split(\' \')[0]">\n
<dtml-if "not order_column in (\'operation_date\', \'specific_reference\')">\n
@@ -1278,8 +1280,8 @@
<dtml-else>\n
SELECT catalog.*,\n
<dtml-let accounting_movement_list="portal_url.getPortalObject().getPortalAccountingMovementTypeList()">\n
- ( SELECT SUM(stock.total_price) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.total_price > 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS debit,\n
- ( SELECT -SUM(stock.total_price) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.total_price < 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS credit\n
+ ( SELECT IFNULL(SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price > 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS debit,\n
+ ( SELECT IFNULL(-SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price < 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS credit\n
FROM (\n
</dtml-let>\n
</dtml-if>\n
@@ -1307,6 +1309,7 @@
, delivery.start_date as operation_date\n
, \'source\' as section_mark\n
, catalog.source_reference as specific_reference\n
+ <dtml-if "section_category">, category.uid as category_uid</dtml-if>\n
<dtml-if "not (stat or count) and query[\'order_by_expression\']">\n
<dtml-let order_column="query[\'order_by_expression\'].split(\' \')[0]">\n
<dtml-if "not order_column in (\'operation_date\', \'specific_reference\')">\n
@@ -1489,6 +1492,7 @@
, delivery.stop_date as operation_date\n
, \'destination\' as section_mark\n
, catalog.destination_reference as specific_reference\n
+ <dtml-if "section_category">, category.uid as category_uid</dtml-if>\n
<dtml-if "not (stat or count) and query[\'order_by_expression\']">\n
<dtml-let order_column="query[\'order_by_expression\'].split(\' \')[0]">\n
<dtml-if "not order_column in (\'operation_date\', \'specific_reference\')">\n
Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=19110&r1=19109&r2=19110&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision Wed Feb 6 18:46:56 2008
@@ -1,1 +1,1 @@
-588
+590
More information about the Erp5-report
mailing list