Commit b834bd14 authored by Romain Courteaud's avatar Romain Courteaud

Rebuild payment if the previous one has been cancelled.

parent bc1d70f1
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>table_0\r\n
table_1\r\n
RELATED_QUERY_SEPARATOR=" AND "\r\n
query_table="catalog"</string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_hook</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z_related_causality_payment_transaction</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>max_rows_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[
<dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.causality.getUid()">\n
AND <dtml-var table_1>.uid = <dtml-var table_0>.uid\n
AND <dtml-var table_1>.portal_type = \'Payment Transaction\'\n
AND <dtml-var table_1>.simulation_state not in (\'deleted\', \'cancelled\')\n
\n
<dtml-var RELATED_QUERY_SEPARATOR>\n
<dtml-var table_0>.category_uid = <dtml-var query_table>.uid\n
\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<key_list>
<key>causality_payment_transaction_related_uid | category,catalog/uid/z_related_causality_payment_transaction</key>
<key>children_portal_type | catalog/portal_type/z_related_children</key>
</key_list>
\ No newline at end of file
......@@ -53,7 +53,7 @@
<value> <string>from Products.ERP5Type.Document import newTempSimulationMovement\n
\n
portal = context.getPortalObject()\n
select_dict = {\'causality_related_uid\': None}\n
select_dict = {\'causality_payment_transaction_related_uid\': None}\n
\n
select_kw = kwargs.copy()\n
select_kw.pop(\'portal_type\', None)\n
......@@ -64,7 +64,7 @@ select_kw.update(\n
limit=10, # do only some in one shot\n
select_dict=select_dict,\n
left_join_list=select_dict.keys(),\n
causality_related_uid=None\n
causality_payment_transaction_related_uid=None,\n
)\n
\n
default_source_uid=portal.restrictedTraverse(\'account_module/receivable\').getUid()\n
......
......@@ -1350,6 +1350,27 @@ class TestSlapOSPaymentTransactionOrderBuilder(testSlapOSMixin):
self.tic()
payment = payment_list[0].getObject()
self.assertPayment(payment, invoice)
def test_cancelled_payment(self):
person = self.portal.person_module.template_member\
.Base_createCloneDocument(batch_mode=1)
invoice = self.portal.accounting_module.template_sale_invoice_transaction\
.Base_createCloneDocument(batch_mode=1)
invoice.edit(destination_section=person.getRelativeUrl())
invoice.confirm()
invoice.stop()
self.tic()
payment_list = self.fullBuild(uid=invoice.getUid())
payment_list[0].cancel()
self.tic()
payment_list = self.fullBuild(uid=invoice.getUid())
self.tic()
self.emptyBuild(uid=invoice.getUid())
self.assertEqual(1, len(payment_list))
payment = payment_list[0].getObject()
self.assertPayment(payment, invoice)
......
244
\ No newline at end of file
245
\ No newline at end of file
erp5_mysql_innodb/z_related_causality_payment_transaction
\ No newline at end of file
children_portal_type | catalog/portal_type/z_related_children
\ No newline at end of file
children_portal_type | catalog/portal_type/z_related_children
causality_payment_transaction_related_uid | category,catalog/uid/z_related_causality_payment_transaction
\ 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