Commit 8930592c authored by Łukasz Nowak's avatar Łukasz Nowak

Simplify Payment exposition.

If there is any payment in planned or confirmed state, expose it as to be paid
one.

While user will click, than system will try to do correct operation with payzen.
parent 4a407bad
...@@ -50,20 +50,16 @@ ...@@ -50,20 +50,16 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n <value> <string>person = context\n
\n
payment_amount = context.portal_catalog.countResults(\n
portal_type=\'Payment Transaction\',\n
default_destination_section_uid=person.getUid()\n
)[0][0]\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\', \'confirmed\'],\n simulation_state=[\'planned\', \'confirmed\'],\n
default_destination_section_uid=person.getUid()\n default_destination_section_uid=person.getUid(),\n
sort_on=((\'creation_date\', \'ASC\'), )\n
)\n )\n
\n \n
if payment_amount == 1 and payment_transaction is not None and payment_transaction.getSimulationState() in [\'planned\', \'confirmed\']:\n if 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>
...@@ -74,7 +70,7 @@ return None\n ...@@ -74,7 +70,7 @@ return None\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ERP5Site_getInitialPlannedPaymentTransaction</string> </value> <value> <string>Person_getOutstandingPayment</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
59 60
\ No newline at end of file \ No newline at end of file
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.ERP5Site_getInitialPlannedPaymentTransaction() is not None</string> </value> <value> <string>python: here.ERP5Site_getAuthenticatedMemberPersonValue().Person_getOutstandingPayment() is not None</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.ERP5Site_getInitialPlannedPaymentTransaction().getRelativeUrl() + \'/AccountingTransaction_startPayment\'</string> </value> <value> <string>python: here.ERP5Site_getAuthenticatedMemberPersonValue().Person_getOutstandingPayment().getRelativeUrl() + \'/AccountingTransaction_startPayment\'</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -312,7 +312,7 @@ Registration Payment Information are being updated. Please wait a while. ...@@ -312,7 +312,7 @@ Registration Payment Information are being updated. Please wait a while.
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.ERP5Site_getInitialPlannedPaymentTransaction() is None</string> </value> <value> <string>python: here.ERP5Site_getAuthenticatedMemberPersonValue().Person_getOutstandingPayment() is None</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
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