Commit 3cf5954f authored by Łukasz Nowak's avatar Łukasz Nowak

Simplify logic.

Payment in planned or confirmed state are interesting for user.
parent 09e0e3c8
...@@ -64,6 +64,12 @@ ...@@ -64,6 +64,12 @@
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -75,7 +81,7 @@ ...@@ -75,7 +81,7 @@
<item> <item>
<key> <string>href</string> </key> <key> <string>href</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -132,6 +138,19 @@ ...@@ -132,6 +138,19 @@
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.ERP5Site_getInitialPlannedPaymentTransaction() is not None</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle> </pickle>
......
...@@ -146,7 +146,9 @@ ...@@ -146,7 +146,9 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
...@@ -302,4 +304,17 @@ Registration Payment Information are being updated. Please wait a while. ...@@ -302,4 +304,17 @@ Registration Payment Information are being updated. Please wait a while.
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.ERP5Site_getInitialPlannedPaymentTransaction() is None</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -59,11 +59,11 @@ payment_amount = context.portal_catalog.countResults(\n ...@@ -59,11 +59,11 @@ payment_amount = context.portal_catalog.countResults(\n
\n \n
payment_transaction = context.portal_catalog.getResultValue(\n payment_transaction = context.portal_catalog.getResultValue(\n
portal_type=\'Payment Transaction\',\n portal_type=\'Payment Transaction\',\n
simulation_state=\'planned\',\n simulation_state=[\'planned\', \'confirmed\'],\n
default_destination_section_uid=person.getUid()\n default_destination_section_uid=person.getUid()\n
)\n )\n
\n \n
if payment_amount == 1 and payment_transaction is not None and payment_transaction.getSimulationState() == \'planned\':\n if payment_amount == 1 and payment_transaction is not None and payment_transaction.getSimulationState() in [\'planned\', \'confirmed\']:\n
return payment_transaction\n return payment_transaction\n
return None\n return None\n
</string> </value> </string> </value>
......
359 360
\ 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