Commit 6f975a16 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Display reference to number on payzen/wechat receipt on the Invoice UI.

parent a8c80c16
......@@ -69,7 +69,8 @@
"Instance",
"From",
"To",
"Quantity"
"Quantity",
"Payment Receipt Reference"
];
return new RSVP.Queue()
.push(function () {
......@@ -121,6 +122,17 @@
"hidden": 0,
"type": "StringField"
},
"my_payment_transaction_external_id": {
"description": "",
"title": result[1][13],
"default": gadget.state.doc.payment_transaction_external_id,
"css_class": "",
"required": 0,
"editable": 0,
"key": "payment_transaction_external_id",
"hidden": gadget.state.doc.payment_transaction_external_id === "",
"type": "StringField"
},
"my_total_price": {
"description": "",
"title": result[1][3],
......@@ -201,7 +213,10 @@
group_list: [[
"left",
[["my_start_date"], ["my_reference"], ["my_total_price"],
["my_resource_title"], ['my_payment_state'], ["my_download"]]
["my_resource_title"], ["my_download"]]
],[
"right",
[["my_payment_transaction_external_id"], ['my_payment_state']]
],[
"bottom",
[["listbox"]]
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>992.9877.18647.54442</string> </value>
<value> <string>992.11149.35424.21572</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1621377250.27</float>
<float>1621448974.82</float>
<string>UTC</string>
</tuple>
</state>
......
from zExceptions import Unauthorized
if REQUEST is not None:
raise Unauthorized
portal = context.getPortalObject()
portal_membership=portal.portal_membership
person = portal_membership.getAuthenticatedMember().getUserValue()
def wrapWithShadow(**kw):
payment = portal.portal_catalog.getResultValue(
portal_type="Payment Transaction",
default_causality_uid=context.getUid(),
simulation_state="stopped"
)
if not payment:
return
if context.getPaymentMode() == "payzen":
return payment.PaymentTransaction_getPayzenId()
elif context.getPaymentMode() == "wechat":
return payment.PaymentTransaction_getWechatId()
transaction_date, transaction_id = person.Person_restrictMethodAsShadowUser(
shadow_document=person,
callable_object=wrapWithShadow,
argument_list=[])
if transaction_id is None:
return
return "%s-%s" % (transaction_date.strftime("%Y%m%d"), transaction_id)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleInvoiceTransaction_getRelatedPaymentTransactionIntegrationId</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -98,6 +98,7 @@
<string>my_start_date</string>
<string>my_total_price</string>
<string>my_resource_title</string>
<string>my_payment_transaction_external_id</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_payment_transaction_external_id</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>External Payment Reference</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</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>context/SaleInvoiceTransaction_getRelatedPaymentTransactionIntegrationId</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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