Commit 9e7a6244 authored by Jérome Perrin's avatar Jérome Perrin

improved trial balance


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4730 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7a152191
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
<key> <string>Default</string> </key> <key> <string>Default</string> </key>
<value> <value>
<list> <list>
<string>from_date</string>
<string>at_date</string> <string>at_date</string>
<string>transaction_section_category</string> <string>transaction_section_category</string>
<string>transaction_simulation_state</string> <string>transaction_simulation_state</string>
......
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
<string>my_transaction_section_category</string> <string>my_transaction_section_category</string>
<string>my_from_date</string> <string>my_from_date</string>
<string>my_at_date</string> <string>my_at_date</string>
<string>my_expand_accounts</string>
<string>my_portal_skin</string> <string>my_portal_skin</string>
</list> </list>
</value> </value>
......
...@@ -70,15 +70,15 @@ ...@@ -70,15 +70,15 @@
if kw.has_key(\'where_expression\'):\n if kw.has_key(\'where_expression\'):\n
params[\'where_expression\'] = kw[\'where_expression\']\n params[\'where_expression\'] = kw[\'where_expression\']\n
if kw.get(\'resource\'):\n if kw.get(\'resource\'):\n
try: params[\'resource_uid\'] = context.restritedTraverse(selection_params[\'resource\'])\n try: params[\'resource_uid\'] = context.restritedTraverse(selection_params[\'resource\']).getUid()\n
except KeyError: pass\n except (KeyError, AttributeError): pass\n
\n \n
# read settings from user preference\n # read settings from user preference\n
preference = context.getPortalObject().portal_preferences\n preference = context.getPortalObject().portal_preferences\n
from_date = preference.getPreferredAccountingTransactionFromDate()\n from_date = kw.get(\'from_date\', preference.getPreferredAccountingTransactionFromDate())\n
if from_date :\n if from_date :\n
params[\'from_date\'] = from_date\n params[\'from_date\'] = from_date\n
at_date = preference.getPreferredAccountingTransactionAtDate()\n at_date = kw.get(\'at_date\', preference.getPreferredAccountingTransactionAtDate())\n
if at_date :\n if at_date :\n
params[\'at_date\'] = at_date\n params[\'at_date\'] = at_date\n
simulation_state = preference.getPreferredAccountingTransactionSimulationStateList()\n simulation_state = preference.getPreferredAccountingTransactionSimulationStateList()\n
...@@ -93,48 +93,84 @@ if kw.get(\'omit_input\') :\n ...@@ -93,48 +93,84 @@ if kw.get(\'omit_input\') :\n
if kw.get(\'omit_output\') :\n if kw.get(\'omit_output\') :\n
params[\'omit_output\'] = 1\n params[\'omit_output\'] = 1\n
\n \n
result = context.Account_zGetTotalQuantity(node_uid=context.getUid(), **params)\n MARKER = []\n
kw = selection.getParams()\n
source_payment_uid = kw.get(\'source_payment_uid\', MARKER)\n
if source_payment_uid is not MARKER:\n
params[\'source_payment_uid\'] = source_payment_uid\n
no_source_payment = kw.get(\'no_source_payment_uid\', MARKER)\n
if no_source_payment is not MARKER:\n
params[\'no_source_payment_uid\'] = 1\n
\n
destination_section_uid = kw.get(\'destination_section_uid\', MARKER)\n
if destination_section_uid is not MARKER:\n
params[\'destination_section_uid\'] = destination_section_uid\n
no_destination_section = kw.get(\'no_destination_section\', MARKER)\n
if no_destination_section is not MARKER:\n
params[\'no_destination_section\'] = 1\n
\n
params[\'node_uid\'] = kw.get(\'node_uid\', context.getUid())\n
\n
if kw.get(\'from_date_summary\', 0) :\n
if params.has_key(\'from_date\'):\n
del params[\'from_date\']\n
\n
#context.log("SQL with %s \\n" % params, context.Account_zGetTotalQuantity(src__=1, **params))\n
result = context.Account_zGetTotalQuantity(**params)\n
row = result[0]\n row = result[0]\n
return float(\'%.02f\' % (row.quantity or 0.0) )\n return float(\'%.02f\' % (row.quantity or 0.0) )\n
\n
# vim: syntax=python\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
<value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAQAAABIAAAAgAAAASwAA <value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAQAAABgAAAAzAAAASwAA
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wYXJhbXNzCAAAAEtleUVycm9ycw4AAABBdHRyaWJ1dGVFcnJvcnMKAAAAcHJlZmVy
ZW5jZXMJAAAAZnJvbV9kYXRlcwcAAABhdF9kYXRlcxAAAABzaW11bGF0aW9uX3N0YXRlcxAAAABz
ZWN0aW9uX2NhdGVnb3J5cwYAAABNQVJLRVJzEgAAAHNvdXJjZV9wYXltZW50X3VpZHMRAAAAbm9f
c291cmNlX3BheW1lbnRzFwAAAGRlc3RpbmF0aW9uX3NlY3Rpb25fdWlkcxYAAABub19kZXN0aW5h
dGlvbl9zZWN0aW9ucwcAAABfYXBwbHlfcwYAAAByZXN1bHRzAwAAAHJvd3MFAAAAZmxvYXQoAAAA
ACgAAAAAcw8AAABTY3JpcHQgKFB5dGhvbilzGQAAAEFjY291bnRfc3RhdFNvdXJjZUJhbGFuY2UB
AAAAc1YAAAAJARMBIAETATsBHQMbASQBBwEUASQBBwEUARIBBwEUARIBBwEXAhMBFwETARQCBgES
ARgBDQEUARgBDQEUAhgBDQEUARgBDQEUAjECGQEWARIDGAEPASgBAAAAcxkAAABBY2NvdW50X3N0
YXRTb3VyY2VCYWxhbmNlKAEAAABzGQAAAEFjY291bnRfc3RhdFNvdXJjZUJhbGFuY2UoAAAAACgA
AAAAcw8AAABTY3JpcHQgKFB5dGhvbilzCAAAADxtb2R1bGU+AQAAAHMAAAAA</string> </value>
</item> </item>
<item> <item>
<key> <string>_dav_writelocks</string> </key> <key> <string>_dav_writelocks</string> </key>
...@@ -191,11 +227,17 @@ ACgAAAAAcw8AAABTY3JpcHQgKFB5dGhvbilzCAAAADxtb2R1bGU+AQAAAHMAAAAA</string> </valu ...@@ -191,11 +227,17 @@ ACgAAAAAcw8AAABTY3JpcHQgKFB5dGhvbilzCAAAADxtb2R1bGU+AQAAAHMAAAAA</string> </valu
<string>context</string> <string>context</string>
<string>selection_params</string> <string>selection_params</string>
<string>KeyError</string> <string>KeyError</string>
<string>AttributeError</string>
<string>preference</string> <string>preference</string>
<string>from_date</string> <string>from_date</string>
<string>at_date</string> <string>at_date</string>
<string>simulation_state</string> <string>simulation_state</string>
<string>section_category</string> <string>section_category</string>
<string>MARKER</string>
<string>source_payment_uid</string>
<string>no_source_payment</string>
<string>destination_section_uid</string>
<string>no_destination_section</string>
<string>_apply_</string> <string>_apply_</string>
<string>result</string> <string>result</string>
<string>row</string> <string>row</string>
......
...@@ -39,13 +39,41 @@ ...@@ -39,13 +39,41 @@
<item> <item>
<key> <string>_data</string> </key> <key> <string>_data</string> </key>
<value> <value>
<dictionary/> <dictionary>
<item>
<key> <string>at_date</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>node_uid</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>simulation_state</string> </key>
<value>
<dictionary>
<item>
<key> <string>type</string> </key>
<value> <string>list</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</value> </value>
</item> </item>
<item> <item>
<key> <string>_keys</string> </key> <key> <string>_keys</string> </key>
<value> <value>
<list/> <list>
<string>node_uid</string>
<string>at_date</string>
<string>simulation_state</string>
</list>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -104,7 +132,9 @@ ...@@ -104,7 +132,9 @@
</item> </item>
<item> <item>
<key> <string>arguments_src</string> </key> <key> <string>arguments_src</string> </key>
<value> <string></string> </value> <value> <string>node_uid\r\n
at_date\r\n
simulation_state:list</string> </value>
</item> </item>
<item> <item>
<key> <string>cache_time_</string> </key> <key> <string>cache_time_</string> </key>
...@@ -140,16 +170,34 @@ ...@@ -140,16 +170,34 @@
</item> </item>
<item> <item>
<key> <string>src</string> </key> <key> <string>src</string> </key>
<value> <string>SELECT DISTINCT\n <value> <string encoding="cdata"><![CDATA[
SELECT DISTINCT\n
catalog.uid,\n catalog.uid,\n
catalog.path\n catalog.path,\n
catalog.relative_url,\n
catalog.title, \n
catalog.portal_type\n
FROM\n FROM\n
catalog,\n catalog,\n
stock\n stock\n
WHERE\n WHERE\n
stock.mirror_section_uid = catalog.uid\n stock.mirror_section_uid = catalog.uid\n
<dtml-if node_uid>\n
AND stock.node_uid = <dtml-sqlvar node_uid type="string">\n
</dtml-if>\n
<dtml-if at_date>\n
AND stock.date <= <dtml-sqlvar at_date type="datetime">\n
</dtml-if>\n
<dtml-if simulation_state>\n
AND ( <dtml-in simulation_state>\n
stock.simulation_state = <dtml-sqlvar sequence-item type="string"><dtml-unless sequence-end>OR </dtml-unless>\n
</dtml-in> )\n
</dtml-if>\n
ORDER BY\n ORDER BY\n
catalog.title</string> </value> catalog.portal_type, catalog.title
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>template</string> </key> <key> <string>template</string> </key>
...@@ -183,16 +231,34 @@ ORDER BY\n ...@@ -183,16 +231,34 @@ ORDER BY\n
</item> </item>
<item> <item>
<key> <string>raw</string> </key> <key> <string>raw</string> </key>
<value> <string>SELECT DISTINCT\n <value> <string encoding="cdata"><![CDATA[
SELECT DISTINCT\n
catalog.uid,\n catalog.uid,\n
catalog.path\n catalog.path,\n
catalog.relative_url,\n
catalog.title, \n
catalog.portal_type\n
FROM\n FROM\n
catalog,\n catalog,\n
stock\n stock\n
WHERE\n WHERE\n
stock.mirror_section_uid = catalog.uid\n stock.mirror_section_uid = catalog.uid\n
<dtml-if node_uid>\n
AND stock.node_uid = <dtml-sqlvar node_uid type="string">\n
</dtml-if>\n
<dtml-if at_date>\n
AND stock.date <= <dtml-sqlvar at_date type="datetime">\n
</dtml-if>\n
<dtml-if simulation_state>\n
AND ( <dtml-in simulation_state>\n
stock.simulation_state = <dtml-sqlvar sequence-item type="string"><dtml-unless sequence-end>OR </dtml-unless>\n
</dtml-in> )\n
</dtml-if>\n
ORDER BY\n ORDER BY\n
catalog.title</string> </value> catalog.portal_type, catalog.title
]]></string> </value>
</item> </item>
</dictionary> </dictionary>
</state> </state>
......
...@@ -46,6 +46,12 @@ ...@@ -46,6 +46,12 @@
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>destination_section_uid</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>from_date</string> </key> <key> <string>from_date</string> </key>
<value> <value>
...@@ -58,6 +64,18 @@ ...@@ -58,6 +64,18 @@
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>no_destination_section_uid</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>no_source_payment_uid</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>omit_input</string> </key> <key> <string>omit_input</string> </key>
<value> <value>
...@@ -99,6 +117,12 @@ ...@@ -99,6 +117,12 @@
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>source_payment_uid</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>to_date</string> </key> <key> <string>to_date</string> </key>
<value> <value>
...@@ -148,6 +172,10 @@ ...@@ -148,6 +172,10 @@
<string>at_date</string> <string>at_date</string>
<string>transaction_simulation_state</string> <string>transaction_simulation_state</string>
<string>transaction_section_category</string> <string>transaction_section_category</string>
<string>source_payment_uid</string>
<string>no_source_payment_uid</string>
<string>destination_section_uid</string>
<string>no_destination_section_uid</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -188,7 +216,11 @@ from_date\r\n ...@@ -188,7 +216,11 @@ from_date\r\n
to_date\r\n to_date\r\n
at_date\r\n at_date\r\n
transaction_simulation_state:list\r\n transaction_simulation_state:list\r\n
transaction_section_category</string> </value> transaction_section_category\r\n
source_payment_uid\r\n
no_source_payment_uid\r\n
destination_section_uid\r\n
no_destination_section_uid</string> </value>
</item> </item>
<item> <item>
<key> <string>cache_time_</string> </key> <key> <string>cache_time_</string> </key>
...@@ -236,14 +268,11 @@ SELECT\n ...@@ -236,14 +268,11 @@ SELECT\n
destination_section.title AS third_party,\n destination_section.title AS third_party,\n
IF(stock.quantity > 0, stock.quantity, 0.0) AS source_debit,\n IF(stock.quantity > 0, stock.quantity, 0.0) AS source_debit,\n
IF(stock.quantity < 0, - stock.quantity, 0.0) AS source_credit,\n IF(stock.quantity < 0, - stock.quantity, 0.0) AS source_credit,\n
stock.quantity AS source_balance\n stock.quantity AS source_balance,\n
stock.payment_uid AS source_payment_uid\n
FROM\n FROM\n
movement,\n movement,\n
stock\n stock,\n
LEFT JOIN catalog AS destination_section \n
ON destination_section.uid = stock.mirror_section_uid\n
AND stock.node_uid = <dtml-var getUid>,\n
\n
catalog,\n catalog,\n
catalog AS transaction_line,\n catalog AS transaction_line,\n
catalog AS transaction,\n catalog AS transaction,\n
...@@ -254,9 +283,14 @@ FROM\n ...@@ -254,9 +283,14 @@ FROM\n
<dtml-if selection_domain>, <dtml-var "selection_domain.asSqlJoinExpression()"> </dtml-if>\n <dtml-if selection_domain>, <dtml-var "selection_domain.asSqlJoinExpression()"> </dtml-if>\n
<dtml-if selection_report>, <dtml-var "selection_report.asSqlJoinExpression()"> </dtml-if>\n <dtml-if selection_report>, <dtml-var "selection_report.asSqlJoinExpression()"> </dtml-if>\n
<dtml-if where_expression>, category </dtml-if>\n <dtml-if where_expression>, category </dtml-if>\n
\n
LEFT JOIN catalog AS destination_section \n
ON destination_section.uid = stock.mirror_section_uid\n
AND stock.node_uid = <dtml-var getUid>\n
\n \n
WHERE stock.node_uid = <dtml-var getUid>\n WHERE stock.node_uid = <dtml-var getUid>\n
AND transaction_line.uid = stock.uid \n AND transaction_line.uid = stock.uid \n
AND transaction_line.portal_type <> \'Simulation Movement\'\n
AND transaction_line.parent_uid = transaction.uid\n AND transaction_line.parent_uid = transaction.uid\n
AND catalog.uid = stock.section_uid\n AND catalog.uid = stock.section_uid\n
AND movement.uid = stock.uid\n AND movement.uid = stock.uid\n
...@@ -269,13 +303,13 @@ WHERE stock.node_uid = <dtml-var getUid>\n ...@@ -269,13 +303,13 @@ WHERE stock.node_uid = <dtml-var getUid>\n
)\n )\n
</dtml-if>\n </dtml-if>\n
<dtml-if from_date>\n <dtml-if from_date>\n
AND movement.stop_date >= <dtml-sqlvar from_date type="datetime">\n AND movement.start_date >= <dtml-sqlvar from_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if at_date>\n <dtml-if at_date>\n
AND movement.stop_date <= <dtml-sqlvar at_date type="datetime">\n AND movement.start_date <= <dtml-sqlvar at_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if to_date>\n <dtml-if to_date>\n
AND movement.stop_date < <dtml-sqlvar to_date type="datetime">\n AND movement.start_date < <dtml-sqlvar to_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if omit_input>\n <dtml-if omit_input>\n
AND stock.quantity < 0\n AND stock.quantity < 0\n
...@@ -283,6 +317,18 @@ WHERE stock.node_uid = <dtml-var getUid>\n ...@@ -283,6 +317,18 @@ WHERE stock.node_uid = <dtml-var getUid>\n
<dtml-if omit_output>\n <dtml-if omit_output>\n
AND stock.quantity > 0\n AND stock.quantity > 0\n
</dtml-if>\n </dtml-if>\n
<dtml-if source_payment_uid>\n
AND stock.payment_uid = <dtml-sqlvar source_payment_uid type="int">\n
</dtml-if>\n
<dtml-if no_source_payment_uid>\n
AND stock.payment_uid IS NULL\n
</dtml-if>\n
<dtml-if destination_section_uid>\n
AND stock.mirror_section_uid = <dtml-sqlvar destination_section_uid type="int">\n
</dtml-if>\n
<dtml-if no_destination_section_uid>\n
AND stock.mirror_section_uid IS NULL\n
</dtml-if>\n
<dtml-if transaction_simulation_state>\n <dtml-if transaction_simulation_state>\n
AND (\n AND (\n
<dtml-in transaction_simulation_state>\n <dtml-in transaction_simulation_state>\n
...@@ -359,14 +405,11 @@ SELECT\n ...@@ -359,14 +405,11 @@ SELECT\n
destination_section.title AS third_party,\n destination_section.title AS third_party,\n
IF(stock.quantity > 0, stock.quantity, 0.0) AS source_debit,\n IF(stock.quantity > 0, stock.quantity, 0.0) AS source_debit,\n
IF(stock.quantity < 0, - stock.quantity, 0.0) AS source_credit,\n IF(stock.quantity < 0, - stock.quantity, 0.0) AS source_credit,\n
stock.quantity AS source_balance\n stock.quantity AS source_balance,\n
stock.payment_uid AS source_payment_uid\n
FROM\n FROM\n
movement,\n movement,\n
stock\n stock,\n
LEFT JOIN catalog AS destination_section \n
ON destination_section.uid = stock.mirror_section_uid\n
AND stock.node_uid = <dtml-var getUid>,\n
\n
catalog,\n catalog,\n
catalog AS transaction_line,\n catalog AS transaction_line,\n
catalog AS transaction,\n catalog AS transaction,\n
...@@ -377,9 +420,14 @@ FROM\n ...@@ -377,9 +420,14 @@ FROM\n
<dtml-if selection_domain>, <dtml-var "selection_domain.asSqlJoinExpression()"> </dtml-if>\n <dtml-if selection_domain>, <dtml-var "selection_domain.asSqlJoinExpression()"> </dtml-if>\n
<dtml-if selection_report>, <dtml-var "selection_report.asSqlJoinExpression()"> </dtml-if>\n <dtml-if selection_report>, <dtml-var "selection_report.asSqlJoinExpression()"> </dtml-if>\n
<dtml-if where_expression>, category </dtml-if>\n <dtml-if where_expression>, category </dtml-if>\n
\n
LEFT JOIN catalog AS destination_section \n
ON destination_section.uid = stock.mirror_section_uid\n
AND stock.node_uid = <dtml-var getUid>\n
\n \n
WHERE stock.node_uid = <dtml-var getUid>\n WHERE stock.node_uid = <dtml-var getUid>\n
AND transaction_line.uid = stock.uid \n AND transaction_line.uid = stock.uid \n
AND transaction_line.portal_type <> \'Simulation Movement\'\n
AND transaction_line.parent_uid = transaction.uid\n AND transaction_line.parent_uid = transaction.uid\n
AND catalog.uid = stock.section_uid\n AND catalog.uid = stock.section_uid\n
AND movement.uid = stock.uid\n AND movement.uid = stock.uid\n
...@@ -392,13 +440,13 @@ WHERE stock.node_uid = <dtml-var getUid>\n ...@@ -392,13 +440,13 @@ WHERE stock.node_uid = <dtml-var getUid>\n
)\n )\n
</dtml-if>\n </dtml-if>\n
<dtml-if from_date>\n <dtml-if from_date>\n
AND movement.stop_date >= <dtml-sqlvar from_date type="datetime">\n AND movement.start_date >= <dtml-sqlvar from_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if at_date>\n <dtml-if at_date>\n
AND movement.stop_date <= <dtml-sqlvar at_date type="datetime">\n AND movement.start_date <= <dtml-sqlvar at_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if to_date>\n <dtml-if to_date>\n
AND movement.stop_date < <dtml-sqlvar to_date type="datetime">\n AND movement.start_date < <dtml-sqlvar to_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if omit_input>\n <dtml-if omit_input>\n
AND stock.quantity < 0\n AND stock.quantity < 0\n
...@@ -406,6 +454,18 @@ WHERE stock.node_uid = <dtml-var getUid>\n ...@@ -406,6 +454,18 @@ WHERE stock.node_uid = <dtml-var getUid>\n
<dtml-if omit_output>\n <dtml-if omit_output>\n
AND stock.quantity > 0\n AND stock.quantity > 0\n
</dtml-if>\n </dtml-if>\n
<dtml-if source_payment_uid>\n
AND stock.payment_uid = <dtml-sqlvar source_payment_uid type="int">\n
</dtml-if>\n
<dtml-if no_source_payment_uid>\n
AND stock.payment_uid IS NULL\n
</dtml-if>\n
<dtml-if destination_section_uid>\n
AND stock.mirror_section_uid = <dtml-sqlvar destination_section_uid type="int">\n
</dtml-if>\n
<dtml-if no_destination_section_uid>\n
AND stock.mirror_section_uid IS NULL\n
</dtml-if>\n
<dtml-if transaction_simulation_state>\n <dtml-if transaction_simulation_state>\n
AND (\n AND (\n
<dtml-in transaction_simulation_state>\n <dtml-in transaction_simulation_state>\n
......
...@@ -50,12 +50,30 @@ ...@@ -50,12 +50,30 @@
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>destination_section_uid</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>from_date</string> </key> <key> <string>from_date</string> </key>
<value> <value>
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>no_destination_section_uid</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>no_source_payment_uid</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>node_uid</string> </key> <key> <string>node_uid</string> </key>
<value> <value>
...@@ -91,6 +109,12 @@ ...@@ -91,6 +109,12 @@
</dictionary> </dictionary>
</value> </value>
</item> </item>
<item>
<key> <string>source_payment_uid</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>to_date</string> </key> <key> <string>to_date</string> </key>
<value> <value>
...@@ -131,6 +155,10 @@ ...@@ -131,6 +155,10 @@
<string>at_date</string> <string>at_date</string>
<string>transaction_simulation_state</string> <string>transaction_simulation_state</string>
<string>transaction_section_category</string> <string>transaction_section_category</string>
<string>source_payment_uid</string>
<string>no_source_payment_uid</string>
<string>destination_section_uid</string>
<string>no_destination_section_uid</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -160,9 +188,13 @@ omit_output\r\n ...@@ -160,9 +188,13 @@ omit_output\r\n
resource_uid:list\r\n resource_uid:list\r\n
from_date\r\n from_date\r\n
to_date\r\n to_date\r\n
at_date\n at_date\r\n
transaction_simulation_state:list\r\n transaction_simulation_state:list\r\n
transaction_section_category</string> </value> transaction_section_category\r\n
source_payment_uid\r\n
no_source_payment_uid\r\n
destination_section_uid\r\n
no_destination_section_uid</string> </value>
</item> </item>
<item> <item>
<key> <string>cache_time_</string> </key> <key> <string>cache_time_</string> </key>
...@@ -220,6 +252,7 @@ WHERE stock.node_uid = <dtml-var node_uid>\n ...@@ -220,6 +252,7 @@ WHERE stock.node_uid = <dtml-var node_uid>\n
AND child.uid = stock.uid \n AND child.uid = stock.uid \n
AND child.parent_uid = catalog.uid\n AND child.parent_uid = catalog.uid\n
AND movement.uid = stock.uid\n AND movement.uid = stock.uid\n
AND child.portal_type <> \'Simulation Movement\'\n
AND movement.is_accountable = 1\n AND movement.is_accountable = 1\n
<dtml-if resource_uid>\n <dtml-if resource_uid>\n
AND (\n AND (\n
...@@ -243,6 +276,18 @@ WHERE stock.node_uid = <dtml-var node_uid>\n ...@@ -243,6 +276,18 @@ WHERE stock.node_uid = <dtml-var node_uid>\n
<dtml-if omit_output>\n <dtml-if omit_output>\n
AND stock.quantity < 0.0\n AND stock.quantity < 0.0\n
</dtml-if>\n </dtml-if>\n
<dtml-if source_payment_uid>\n
AND stock.payment_uid = <dtml-sqlvar source_payment_uid type="int">\n
</dtml-if>\n
<dtml-if no_source_payment_uid>\n
AND stock.payment_uid IS NULL\n
</dtml-if>\n
<dtml-if destination_section_uid>\n
AND stock.mirror_section_uid = <dtml-sqlvar destination_section_uid type="int">\n
</dtml-if>\n
<dtml-if no_destination_section_uid>\n
AND stock.mirror_section_uid IS NULL\n
</dtml-if>\n
<dtml-if transaction_simulation_state>\n <dtml-if transaction_simulation_state>\n
AND (\n AND (\n
<dtml-in transaction_simulation_state>\n <dtml-in transaction_simulation_state>\n
...@@ -320,6 +365,7 @@ WHERE stock.node_uid = <dtml-var node_uid>\n ...@@ -320,6 +365,7 @@ WHERE stock.node_uid = <dtml-var node_uid>\n
AND child.uid = stock.uid \n AND child.uid = stock.uid \n
AND child.parent_uid = catalog.uid\n AND child.parent_uid = catalog.uid\n
AND movement.uid = stock.uid\n AND movement.uid = stock.uid\n
AND child.portal_type <> \'Simulation Movement\'\n
AND movement.is_accountable = 1\n AND movement.is_accountable = 1\n
<dtml-if resource_uid>\n <dtml-if resource_uid>\n
AND (\n AND (\n
...@@ -343,6 +389,18 @@ WHERE stock.node_uid = <dtml-var node_uid>\n ...@@ -343,6 +389,18 @@ WHERE stock.node_uid = <dtml-var node_uid>\n
<dtml-if omit_output>\n <dtml-if omit_output>\n
AND stock.quantity < 0.0\n AND stock.quantity < 0.0\n
</dtml-if>\n </dtml-if>\n
<dtml-if source_payment_uid>\n
AND stock.payment_uid = <dtml-sqlvar source_payment_uid type="int">\n
</dtml-if>\n
<dtml-if no_source_payment_uid>\n
AND stock.payment_uid IS NULL\n
</dtml-if>\n
<dtml-if destination_section_uid>\n
AND stock.mirror_section_uid = <dtml-sqlvar destination_section_uid type="int">\n
</dtml-if>\n
<dtml-if no_destination_section_uid>\n
AND stock.mirror_section_uid IS NULL\n
</dtml-if>\n
<dtml-if transaction_simulation_state>\n <dtml-if transaction_simulation_state>\n
AND (\n AND (\n
<dtml-in transaction_simulation_state>\n <dtml-in transaction_simulation_state>\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment