Commit 0b75c584 authored by Jérome Perrin's avatar Jérome Perrin

PaymentTransaction_selectMovement could select movements by date

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18797 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e7d25f7d
...@@ -70,9 +70,11 @@ ...@@ -70,9 +70,11 @@
kw[\'parent_specialise_portal_type\'] = \'Payment Rule\'\n kw[\'parent_specialise_portal_type\'] = \'Payment Rule\'\n
kw[\'portal_type\'] = \'Simulation Movement\'\n kw[\'portal_type\'] = \'Simulation Movement\'\n
kw.update(context.portal_catalog.buildSQLQuery(**kw))\n kw.update(context.portal_catalog.buildSQLQuery(**kw))\n
kw[\'max_movement_date\'] = DateTime() + 30\n
\n \n
movement_list = [x.getObject() for x in context.PaymentTransaction_zSelectMovement(**kw)]\n
LOG("SQL used = %s"%context.PaymentTransaction_zSelectMovement(src__=1, **kw))\n LOG("SQL used = %s"%context.PaymentTransaction_zSelectMovement(src__=1, **kw))\n
movement_list = [x.getObject() for x in context.PaymentTransaction_zSelectMovement(**kw)]\n
\n
LOG("movement_list = %s"%movement_list)\n LOG("movement_list = %s"%movement_list)\n
return movement_list\n return movement_list\n
</string> </value> </string> </value>
...@@ -124,6 +126,7 @@ return movement_list\n ...@@ -124,6 +126,7 @@ return movement_list\n
<string>_getattr_</string> <string>_getattr_</string>
<string>_apply_</string> <string>_apply_</string>
<string>context</string> <string>context</string>
<string>DateTime</string>
<string>append</string> <string>append</string>
<string>$append0</string> <string>$append0</string>
<string>_getiter_</string> <string>_getiter_</string>
......
...@@ -48,6 +48,12 @@ ...@@ -48,6 +48,12 @@
</dictionary> </dictionary>
</value> </value>
</item> </item>
<item>
<key> <string>max_movement_date</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>order_by_expression</string> </key> <key> <string>order_by_expression</string> </key>
<value> <value>
...@@ -70,6 +76,7 @@ ...@@ -70,6 +76,7 @@
<string>from_table_list</string> <string>from_table_list</string>
<string>where_expression</string> <string>where_expression</string>
<string>order_by_expression</string> <string>order_by_expression</string>
<string>max_movement_date</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -88,7 +95,8 @@ ...@@ -88,7 +95,8 @@
<key> <string>arguments_src</string> </key> <key> <string>arguments_src</string> </key>
<value> <string>from_table_list:list\r\n <value> <string>from_table_list:list\r\n
where_expression\r\n where_expression\r\n
order_by_expression</string> </value> order_by_expression\r\n
max_movement_date</string> </value>
</item> </item>
<item> <item>
<key> <string>cache_time_</string> </key> <key> <string>cache_time_</string> </key>
...@@ -155,15 +163,21 @@ WHERE\n ...@@ -155,15 +163,21 @@ WHERE\n
\n \n
AND parent.uid = catalog.parent_uid\n AND parent.uid = catalog.parent_uid\n
AND grandparent.uid = parent.parent_uid\n AND grandparent.uid = parent.parent_uid\n
AND grandparent.simulation_state in (\'confirmed\', \'stopped\', \'delivered\')\n
\n \n
AND movement.source_uid is not NULL\n AND ((\n
grandparent.simulation_state NOT IN (\'cancelled\', \'deleted\')\n
AND ( movement.start_date < <dtml-sqlvar max_movement_date type="datetime"> OR \n
movement.stop_date < <dtml-sqlvar max_movement_date type="datetime"> )\n
) OR (\n
grandparent.simulation_state in (\'confirmed\', \'stopped\', \'delivered\')\n
))\n
\n
AND movement.uid = catalog.uid\n AND movement.uid = catalog.uid\n
AND movement.resource_uid is not NULL\n AND movement.resource_uid is not NULL\n
AND category.category_uid is NULL\n AND category.category_uid is NULL\n
\n \n
<dtml-if order_by_expression>\n <dtml-if order_by_expression>\n
ORDER BY <dtml-var order_by_expression>\n ORDER BY <dtml-var order_by_expression>\n
</dtml-if> </dtml-if>
]]></string> </value> ]]></string> </value>
...@@ -231,15 +245,21 @@ WHERE\n ...@@ -231,15 +245,21 @@ WHERE\n
\n \n
AND parent.uid = catalog.parent_uid\n AND parent.uid = catalog.parent_uid\n
AND grandparent.uid = parent.parent_uid\n AND grandparent.uid = parent.parent_uid\n
AND grandparent.simulation_state in (\'confirmed\', \'stopped\', \'delivered\')\n
\n \n
AND movement.source_uid is not NULL\n AND ((\n
grandparent.simulation_state NOT IN (\'cancelled\', \'deleted\')\n
AND ( movement.start_date < <dtml-sqlvar max_movement_date type="datetime"> OR \n
movement.stop_date < <dtml-sqlvar max_movement_date type="datetime"> )\n
) OR (\n
grandparent.simulation_state in (\'confirmed\', \'stopped\', \'delivered\')\n
))\n
\n
AND movement.uid = catalog.uid\n AND movement.uid = catalog.uid\n
AND movement.resource_uid is not NULL\n AND movement.resource_uid is not NULL\n
AND category.category_uid is NULL\n AND category.category_uid is NULL\n
\n \n
<dtml-if order_by_expression>\n <dtml-if order_by_expression>\n
ORDER BY <dtml-var order_by_expression>\n ORDER BY <dtml-var order_by_expression>\n
</dtml-if> </dtml-if>
]]></string> </value> ]]></string> </value>
......
546 547
\ No newline at end of file \ No newline at end of file
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