Commit 66670bd2 authored by Jérome Perrin's avatar Jérome Perrin

Payment mean and SEPA credit transfer

 - update for ERP5JS compatibility
 - prevent an error with "Select Payments" update action, when limit was empty
 - export to generate SEPA credit transfer ( pain.001.001.02 )
 - new mode in "Select Payment" to select planned/confirmed payment and validate them at the same time
 - allow selecting lines individually in "Select Payments"
 - allow filtering by third party in "Select Payments" (only supported in xhtml_style for now)
 - fix issue that Deliver transaction leaves PTG in Delivering state 
 - french translations

See merge request nexedi/erp5!1400
parents f6637a16 eab9ddd0
......@@ -175,7 +175,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: list(context.getPortalItemTypeList()) + [\'Payment Transaction Group\', ]</string> </value>
<value> <string>python: [(x, x) for x in list(context.getPortalItemTypeList()) + [\'Payment Transaction Group\', ]]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -175,7 +175,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: list(context.getPortalItemTypeList()) + (\'Payment Transaction Group\', )</string> </value>
<value> <string>python: [(x, x) for x in list(context.getPortalItemTypeList()) + [\'Payment Transaction Group\', ]]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -1194,6 +1194,9 @@ msgstr "Produits"
msgid "Income Tax"
msgstr "Impôt Sur Le Revenu"
msgid "Incoming"
msgstr "Entrant"
msgid "India"
msgstr "Inde"
......@@ -1893,6 +1896,9 @@ msgstr "Fabrication d'autres matériels de transport"
msgid "Others Liabilities"
msgstr "Autres dettes"
msgid "Outgoing"
msgstr "Sortant"
msgid "Overtime"
msgstr "Heures supplémentaires"
......
......@@ -1531,9 +1531,18 @@ msgstr "Domiciliation bancaire"
msgid "Bank Account Type"
msgstr "Type de compte en banque"
msgid "Bank Account must belong to Section"
msgstr "Le compte en banque doit appartenir à la section"
msgid "Bank Accounts"
msgstr "Comptes bancaires"
msgid "Bank Accounts must be validated"
msgstr "Les comptes en banque doivent être validés"
msgid "Bank Accounts must have IBAN and BIC"
msgstr "Les comptes en banque doivent avoir un IBAN et un BIC"
msgid "Bank Branch"
msgstr "Code guichet"
......@@ -5575,6 +5584,9 @@ msgstr "Id du script de générateur de prévision"
msgid "Generate References"
msgstr "Générer les références"
msgid "Generate SEPA Credit Transfer File"
msgstr "Générer un fichier de virements SEPA"
msgid "Generate Web Section Structure from Category"
msgstr "Générer une section web à partir des catégories"
......@@ -6871,9 +6883,15 @@ msgstr "Délai max. (jours)"
msgid "Max. delay (day)"
msgstr "Délai Max (jours)"
msgid "Maximum Date"
msgstr "Date maximale"
msgid "Maximum Delay (Day)"
msgstr "Délai maximum (jours)"
msgid "Maximum Number of Payments"
msgstr "Nombre maximum de règlements"
msgid "Maximum User Inactivity Duration"
msgstr "Durée maximale d'inactivité"
......@@ -7159,6 +7177,9 @@ msgstr "Minimiser le prix"
msgid "Minimize"
msgstr "Minimiser"
msgid "Minimum Date"
msgstr "Date minimale"
msgid "Minimum Delay (Day)"
msgstr "Délai minimum (jours)"
......@@ -7570,6 +7591,9 @@ msgstr "Aucun document correspondant n'a été trouvé."
msgid "No trade condition."
msgstr "Pas de condition commerciale trouvée."
msgid "No valid payment transaction group found"
msgstr "Pas de groupe d'écritures de trésorerie valide trouvé"
msgid "No valid transaction in your selection."
msgstr "Pas d'écritures valides dans votre sélection."
......@@ -8431,6 +8455,9 @@ msgstr "Date d'échéance du paiement"
msgid "Payment Delay (days)"
msgstr "Délai de paiement"
msgid "Payment Group Manager"
msgstr "Responsable du groupe d'écritures de trésorerie"
msgid "Payment Mode"
msgstr "Moyen de paiement"
......@@ -8464,9 +8491,24 @@ msgstr "Groupe d'écritures de trésorerie"
msgid "Payment Transaction Group Type"
msgstr "Type de groupe d'écritures de trésorerie"
msgid "Payment Transaction Group Type must be defined"
msgstr "Le type de groupe d'écritures de trésorerie doit être défini"
msgid "Payment Transaction Group Workflow"
msgstr "Workflow des groupes d'écritures de trésorerie"
msgid "Payment Transaction Groups"
msgstr "Groupes d'écritures de trésorerie"
msgid "Payment Transaction Groups to Close"
msgstr "Groupes d'écritures de trésorerie à clôturer"
msgid "Payment Transaction Groups to Deliver"
msgstr "Groupes d'écritures de trésorerie à livrer"
msgid "Payment Transaction Groups to Open"
msgstr "Groupes d'écritures de trésorerie à ouvrir"
msgid "Payment Transaction Lines"
msgstr "Lignes comptables"
......@@ -8482,6 +8524,9 @@ msgstr "Écritures de trésorerie à l'état brouillard"
msgid "Payment Transaction related to Sale Invoice Transaction."
msgstr "Écriture de paiement liée à l'écriture de vente."
msgid "Payment Transactions"
msgstr "Écritures de trésorerie"
msgid "Payment additional term (day)"
msgstr "le"
......@@ -8500,6 +8545,9 @@ msgstr "Mode de règlement"
msgid "Payment of ${invoice_title}"
msgstr "Paiement de ${invoice_title}"
msgid "Payment selection in progress."
msgstr "Sélection des règlements en cours."
msgid "Payment term (day)"
msgstr "Terme du payement"
......@@ -8857,6 +8905,9 @@ msgstr "Posté"
msgid "Posted [state in query_workflow]"
msgstr "Posté"
msgid "Posted automatically with payment transaction group ${payment_transaction_group_reference}"
msgstr "Brouillard validé automatiquement depuis le groupe d'écritures de trésorerie ${payment_transaction_group_reference}"
msgid "Posted to General Ledger"
msgstr "Brouillard validé"
......@@ -9973,6 +10024,9 @@ msgstr "Écriture de trésorerie correspondante créée"
msgid "Related Payment Transaction"
msgstr "Écriture de trésorerie correspondante"
msgid "Related Payment Transaction Group"
msgstr "Groupe d'écritures de trésorerie lié"
msgid "Related Person"
msgstr "Personne liée"
......@@ -10075,6 +10129,12 @@ msgstr "Mémoriser mon nom"
msgid "Remove"
msgstr "Enlever"
msgid "Remove from Payment Transaction Group"
msgstr "Supprimer du groupe d'écritures de trésorerie"
msgid "Removed from payment transaction group"
msgstr "Supprimé du groupe d'écritures de trésorerie"
msgid "Rename"
msgstr "Renommer"
......@@ -10432,6 +10492,9 @@ msgstr "Lancer les tests unitaires"
msgid "Running Balance"
msgstr "Net"
msgid "SEPA Credit Transfer File generated."
msgstr "Fichier de virements SEPA généré"
msgid "SQL Cache"
msgstr "Cache SQL"
......@@ -10810,6 +10873,12 @@ msgstr "Sélectionner un module"
msgid "Select Non Reconciled Transactions"
msgstr "Sélectionner les écritures non rapprochées"
msgid "Select Payments"
msgstr "Sélectionner des règlements"
msgid "Select Planned or Confirmed Payments and Post them to General Ledger"
msgstr "Sélectionner des écritures planifiées ou confirmées et les passer au brouillard"
msgid "Select Print"
msgstr "Type d'impression"
......@@ -10825,6 +10894,9 @@ msgstr "Sélectionner un filtre prédéfini"
msgid "Select Variation"
msgstr "Variantes à commander"
msgid "Select already Posted to General Ledger or Closed Payments"
msgstr "Sélectionner des écritures au brouillard validé ou clôturées"
msgid "Select appropriate document in the list."
msgstr "Sélectionnez le document approprié dans la liste."
......@@ -11059,6 +11131,9 @@ msgstr "Montrer les écritures rapprochées"
msgid "Show tabs"
msgstr "Montrer les onglets"
msgid "Sign"
msgstr "Signe"
msgid "Signature Preview"
msgstr "Aperçu de la signature"
......@@ -11351,7 +11426,7 @@ msgid "Source Ref"
msgstr "Réf Fournisseur."
msgid "Source Reference"
msgstr "Référence"
msgstr "Référence de source"
msgid "Source Section"
msgstr "Section Source"
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_onlyxhtml_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_onlyxhtml_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document_list</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>11.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Documents</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Base_viewDocumentList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>priority</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>int</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_onlyjio_jump</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_onlyjio_jump</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>jump_to_document</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Documents</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Base_jumpToRelatedDocumentList</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:portal.Base_checkPermission(\'document_module\', \'View\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_action</string>
<string>action_type/object_jio_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
<value> <string>object_jio_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_action</string>
<string>action_type/object_jio_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
<value> <string>object_jio_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
<workflow_chain>
<chain>
<type>Payment Transaction Group</type>
<workflow>edit_workflow, payment_transaction_group_validation_workflow</workflow>
<workflow>edit_workflow, payment_transaction_group_delivering_interaction_workflow, payment_transaction_group_validation_workflow</workflow>
</chain>
</workflow_chain>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaymentTransactionGroupConstraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_base_category</string> </key>
<value>
<tuple>
<string>payment_mode</string>
</tuple>
</value>
</item>
<item>
<key> <string>constraint_portal_type</string> </key>
<value> <string>python: (\'Category\', )</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Payment mode must be defined</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>payment_mode_category_existence_constraint</string> </value>
</item>
<item>
<key> <string>message_category_not_set</string> </key>
<value> <string>Payment Mode must be defined</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Existence Constraint</string> </value>
</item>
<item>
<key> <string>use_acquisition</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_base_category</string> </key>
<value>
<tuple>
<string>payment_transaction_group_type</string>
</tuple>
</value>
</item>
<item>
<key> <string>constraint_portal_type</string> </key>
<value> <string>python: (\'Category\', )</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Payment Transaction Group Type must be defined</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>payment_transaction_group_type_category_existence_constraint</string> </value>
</item>
<item>
<key> <string>message_category_not_set</string> </key>
<value> <string>Payment Transaction Group Type must be defined</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Existence Constraint</string> </value>
</item>
<item>
<key> <string>use_acquisition</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_base_category</string> </key>
<value>
<tuple>
<string>price_currency</string>
</tuple>
</value>
</item>
<item>
<key> <string>constraint_portal_type</string> </key>
<value> <string>python: (\'Currency\', )</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Currency must be defined</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>price_currency_category_existence_constraint</string> </value>
</item>
<item>
<key> <string>message_category_not_set</string> </key>
<value> <string>Currency must be defined</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Existence Constraint</string> </value>
</item>
<item>
<key> <string>use_acquisition</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_base_category</string> </key>
<value>
<tuple>
<string>source_payment</string>
</tuple>
</value>
</item>
<item>
<key> <string>constraint_portal_type</string> </key>
<value> <string>python: object.getPortalPaymentNodeTypeList()</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Source payment must be defined</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>source_payment_category_existence_constraint</string> </value>
</item>
<item>
<key> <string>message_category_not_set</string> </key>
<value> <string>Section bank account must be defined</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Existence Constraint</string> </value>
</item>
<item>
<key> <string>use_acquisition</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_base_category</string> </key>
<value>
<tuple>
<string>source_section</string>
</tuple>
</value>
</item>
<item>
<key> <string>constraint_portal_type</string> </key>
<value> <string>python: (\'Organisation\', )</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Source section must be defined</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>source_section_category_existence_constraint</string> </value>
</item>
<item>
<key> <string>message_category_not_set</string> </key>
<value> <string>Section must be defined</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Existence Constraint</string> </value>
</item>
<item>
<key> <string>use_acquisition</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>message_property_not_set</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_property</string> </key>
<value>
<tuple>
<string>stop_date</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Date must be defined</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>stop_date_constraint</string> </value>
</item>
<item>
<key> <string>message_no_such_property</string> </key>
<value> <string>Date must be defined</string> </value>
</item>
<item>
<key> <string>message_property_not_set</string> </key>
<value> <string>Date must be defined</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Existence Constraint</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""Adds the payment transaction group to the already aggregated items on this line.
Also ensures that the payment transaction has a reference.
This script has a proxy role to be able to modify delivered lines and to call generateReference.
"""
portal = context.getPortalObject()
assert context.getPortalType() in portal.getPortalAccountingMovementTypeList()
context.setDefaultActivateParameterDict({"activate_kw": activate_kw})
context.setAggregate(aggregate, portal_type='Payment Transaction Group')
context.getParentValue().getTypeBasedMethod('generateReference')()
......@@ -57,12 +57,13 @@
<value>
<tuple>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountingTransactionLine_setAggregate</string> </value>
<value> <string>AccountingTransactionLine_addPaymentTransactionGroup</string> </value>
</item>
</dictionary>
</pickle>
......
context.setDefaultActivateParameterDict({"activate_kw": activate_kw})
context.setAggregate(aggregate)
from Products.ERP5Type.Message import translateString
portal = context.getPortalObject()
payment_transaction_group = portal.restrictedTraverse(aggregate)
payment_transaction = context.getParentValue()
payment_transaction.setDefaultActivateParameterDict({"activate_kw": activate_kw})
if payment_transaction.getSimulationState() == 'planned':
payment_transaction.Base_workflowStatusModify(
workflow_action='confirm_action',
batch_mode=True,
)
if payment_transaction.getSimulationState() == 'confirmed':
payment_transaction.Base_workflowStatusModify(
workflow_action='start_action',
batch_mode=True,
)
payment_transaction.Base_workflowStatusModify(
workflow_action='stop_action',
comment=translateString(
"Posted automatically with payment transaction group ${payment_transaction_group_reference}",
mapping={
'payment_transaction_group_reference':
payment_transaction_group.getSourceReference()
or payment_transaction_group.getReference()}),
batch_mode=True,
)
if payment_transaction.getSimulationState() == 'stopped':
context.AccountingTransactionLine_addPaymentTransactionGroup(
aggregate=aggregate,
activate_kw=activate_kw,
)
<?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>aggregate, activate_kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountingTransactionLine_stopAndAddPaymentTransactionGroup</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -14,6 +14,7 @@
<string>columns</string>
<string>domain_root_list</string>
<string>domain_tree</string>
<string>portal_types</string>
<string>selection_name</string>
<string>title</string>
</list>
......@@ -201,6 +202,17 @@
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value>
<list>
<tuple>
<string>Payment Transaction Group</string>
<string>Payment Transaction Group</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string>payment_transaction_group_module_selection</string> </value>
......
......@@ -3,4 +3,4 @@ if REQUEST is not None:
for payment_transaction_line in context.getAggregateRelatedValueList():
payment_transaction_line.setDefaultActivateParameterDict({"tag": tag})
payment_transaction_line.setAggregate(None)
payment_transaction_line.setAggregate(None, portal_type=context.getPortalType())
......@@ -12,12 +12,14 @@ except KeyError:
row, = portal.portal_simulation.getInventoryList(
select_dict={'count': 'COUNT(*)'},
ignore_group_by=1,
section_uid=context.getSourceSectionUid(),
section_uid=context.getSourceSection()
and portal.Base_getSectionUidListForSectionCategory(
context.getSourceSectionValue().getGroup(base=True)),
strict_aggregate_uid=context.getUid(),
node_uid=[x.uid for x in portal.portal_catalog(
portal_type='Account',
strict_account_type_uid=portal.portal_categories.account_type.asset.cash.bank.getUid(),
)],
)] or -1,
**params
)
cache[cache_key] = result = (row.count, row.total_quantity)
......
portal = context.getPortalObject()
kw['section_uid'] = context.getSourceSectionUid()
kw['section_uid'] = -1
if context.getSourceSection():
kw['section_uid'] = portal.Base_getSectionUidListForSectionCategory(
context.getSourceSectionValue().getGroup(base=True))
kw['default_aggregate_uid'] = context.getUid()
kw['parent_portal_type'] = ('Payment Transaction', 'Accounting Transaction')
......
portal = context.getPortalObject()
if select_mode is None:
# To show an empty listbox the first time the dialog is open
container.REQUEST.set('PaymentTransactionGroup_statGroupablePaymentTransactionLineList.total_quantity', None)
return []
elif select_mode == 'stopped_or_delivered':
simulation_state = ('delivered', 'stopped')
else:
assert select_mode == 'planned_or_confirmed', "Unknown select_mode, %r" % select_mode
simulation_state = ('planned', 'confirmed')
search_kw = dict(
parent_portal_type='Payment Transaction',
limit=None,
simulation_state=('delivered', 'stopped'),
section_uid=context.getSourceSectionUid(),
simulation_state=simulation_state,
section_uid=context.getSourceSection()
and portal.Base_getSectionUidListForSectionCategory(
context.getSourceSectionValue().getGroup(base=True)),
payment_uid=context.getSourcePaymentUid(),
resource_uid=context.getPriceCurrencyUid(),
node_category='account_type/asset/cash/bank',
......@@ -17,14 +29,17 @@ search_kw = dict(
if context.getPaymentMode():
search_kw['payment_transaction_line_payment_mode_uid'] = context.getPaymentModeUid()
if limit:
search_kw['limit'] = limit
if select_limit:
search_kw['limit'] = select_limit
if start_date_range_max:
search_kw['at_date'] = start_date_range_max.latestTime()
if start_date_range_min:
search_kw['from_date'] = start_date_range_min
if Movement_getMirrorSectionTitle:
search_kw['stock_mirror_section_title'] = Movement_getMirrorSectionTitle
if sign in ('outgoing', 'out'):
search_kw['omit_asset_increase'] = True
elif sign in ('incoming', 'in'):
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, **kw</string> </value>
<value> <string>select_limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, select_mode=None, Movement_getMirrorSectionTitle=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -8,10 +8,13 @@ if context.getPortalObject().portal_activities.countMessageWithTag(tag,):
"Some payments are still beeing processed in the background, please retry later")))
context.activate(tag=tag).PaymentTransactionGroup_selectPaymentTransactionLineListActive(
limit=limit,
uids=uids,
select_limit=select_limit,
start_date_range_min=start_date_range_min,
start_date_range_max=start_date_range_max,
sign=sign,
select_mode=select_mode,
Movement_getMirrorSectionTitle=listbox_Movement_getMirrorSectionTitle,
tag=tag)
return context.Base_redirect(form_id,
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>form_id=\'view\', limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, **kw</string> </value>
<value> <string>uids=(), form_id=\'view\', select_limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, select_mode=None, listbox_Movement_getMirrorSectionTitle=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
portal = context.getPortalObject()
batch_size = 100
priority = 1
......@@ -5,19 +6,32 @@ activate_kw = dict(tag=tag, priority=priority)
aggregate = context.getRelativeUrl()
payment_relative_url_list = [brain.relative_url for brain
if uids:
payment_relative_url_list = [brain.relative_url for brain
in portal.portal_catalog(uid=uids, select_dict={'relative_url': None})]
else:
payment_relative_url_list = [brain.relative_url for brain
in context.PaymentTransactionGroup_getGroupablePaymentTransactionLineList(
limit=limit,
select_limit=select_limit,
start_date_range_min=start_date_range_min,
start_date_range_max=start_date_range_max,
sign=sign,)]
sign=sign,
select_mode=select_mode,
Movement_getMirrorSectionTitle=Movement_getMirrorSectionTitle,)]
if select_mode == 'stopped_or_delivered':
method_id = 'AccountingTransactionLine_addPaymentTransactionGroup'
else:
assert select_mode == 'planned_or_confirmed', "Unknown select_mode, %r" % select_mode
method_id = 'AccountingTransactionLine_stopAndAddPaymentTransactionGroup'
object_list_len = len(payment_relative_url_list)
activate = context.getPortalObject().portal_activities.activate
activate = portal.portal_activities.activate
for i in xrange(0, object_list_len, batch_size):
current_path_list = payment_relative_url_list[i:i+batch_size]
activate(activity='SQLQueue', activate_kw=activate_kw,).callMethodOnObjectList(
current_path_list,
'AccountingTransactionLine_setAggregate',
method_id,
aggregate=aggregate,
activate_kw=activate_kw)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, tag=\'\'</string> </value>
<value> <string>uids=(), select_limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, select_mode=None, Movement_getMirrorSectionTitle=None, tag=\'\'</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......
......@@ -108,7 +108,7 @@
</tuple>
<tuple>
<string>Movement_getSpecificReference</string>
<string>Specific Reference</string>
<string>Transaction Reference</string>
</tuple>
<tuple>
<string>Movement_getExplanationTitle</string>
......
......@@ -98,10 +98,11 @@
<key> <string>left</string> </key>
<value>
<list>
<string>your_limit</string>
<string>your_select_limit</string>
<string>your_start_date_range_min</string>
<string>your_start_date_range_max</string>
<string>your_sign</string>
<string>your_select_mode</string>
</list>
</value>
</item>
......
......@@ -262,9 +262,7 @@
</item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
......@@ -289,13 +287,13 @@
<item>
<key> <string>lines</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>list_action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
......@@ -345,7 +343,7 @@
<item>
<key> <string>selection_name</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
......@@ -411,7 +409,7 @@
</tuple>
<tuple>
<string>Movement_getSpecificReference</string>
<string>Specific Reference</string>
<string>Transaction Reference</string>
</tuple>
<tuple>
<string>Movement_getExplanationTitle</string>
......@@ -543,7 +541,7 @@
<item>
<key> <string>list_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
<item>
......@@ -582,17 +580,22 @@
</item>
<item>
<key> <string>search</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>search_columns</string> </key>
<value>
<list/>
<list>
<tuple>
<string>Movement_getMirrorSectionTitle</string>
<string>Third Party</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>select</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
......@@ -607,7 +610,12 @@
<item>
<key> <string>sort_columns</string> </key>
<value>
<list/>
<list>
<tuple>
<string>none</string>
<string>sort disabled</string>
</tuple>
</list>
</value>
</item>
<item>
......@@ -619,7 +627,7 @@
<item>
<key> <string>stat_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAc=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
<item>
......@@ -651,19 +659,6 @@
</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>python:request.form.get(\'sign\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
......@@ -676,7 +671,7 @@
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
......@@ -693,7 +688,7 @@ string:Base_viewListMode?proxy_form_id=${form/getId}&proxy_field_id=${field/getI
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
......@@ -706,7 +701,7 @@ string:Base_viewListMode?proxy_form_id=${form/getId}&proxy_field_id=${field/getI
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="Method" module="Products.Formulator.MethodField"/>
</pickle>
......@@ -719,7 +714,7 @@ string:Base_viewListMode?proxy_form_id=${form/getId}&proxy_field_id=${field/getI
</dictionary>
</pickle>
</record>
<record id="7" aka="AAAAAAAAAAc=">
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<global name="Method" module="Products.Formulator.MethodField"/>
</pickle>
......
......@@ -10,6 +10,9 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>end</string>
<string>required</string>
<string>start</string>
<string>title</string>
</list>
......@@ -17,7 +20,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_limit</string> </value>
<value> <string>your_select_limit</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -61,10 +64,18 @@
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>start</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>
......@@ -72,6 +83,14 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string>50</string> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <int>1000</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_integer_value</string> </value>
......@@ -80,6 +99,10 @@
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <int>0</int> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ListField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_select_mode</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>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>unknown_selection</string> </key>
<value> <string>You selected an item that was not in the list.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string>stopped_or_delivered</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list>
<tuple>
<string>Select already Posted to General Ledger or Closed Payments</string>
<string>stopped_or_delivered</string>
</tuple>
<tuple>
<string>Select Planned or Confirmed Payments and Post them to General Ledger</string>
<string>planned_or_confirmed</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Mode</string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </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>python: [(context.Base_translateString(label), value) for (label, value) in field.get_orig_value(\'items\')]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -8,7 +8,7 @@ for line in context.getMovementList(
payment_transaction_group = line.getAggregateValue(portal_type=portal_type)
if payment_transaction_group is not None and \
payment_transaction_group.getValidationState() not in ('delivered',):
line.setAggregateValue(None)
line.setAggregateValue(None, portal_type=portal_type)
removed = True
message = translateString('No valid payment transaction group found')
......
......@@ -25,9 +25,14 @@
#
##############################################################################
import urlparse
from DateTime import DateTime
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from erp5.component.test.testAccounting import AccountingTestCase
class TestPaymentTransactionGroup(ERP5TypeTestCase):
class TestPaymentTransactionGroupReferences(ERP5TypeTestCase):
def test_source_reference_generated(self):
ptg = self.portal.payment_transaction_group_module.newContent(
portal_type='Payment Transaction Group')
......@@ -42,3 +47,313 @@ class TestPaymentTransactionGroup(ERP5TypeTestCase):
# a new source reference
self.assertNotEqual(
ptg.getSourceReference(), cloned_ptg.getSourceReference())
class TestPaymentTransactionGroupWorkflow(ERP5TypeTestCase):
def test_workflow_transitions(self):
ptg = self.portal.payment_transaction_group_module.newContent(
portal_type='Payment Transaction Group')
self.assertEqual(ptg.getValidationState(), 'draft')
self.portal.portal_workflow.doActionFor(ptg, 'open_action')
self.assertEqual(ptg.getValidationState(), 'open')
self.portal.portal_workflow.doActionFor(ptg, 'close_action')
self.assertEqual(ptg.getValidationState(), 'closed')
self.portal.portal_workflow.doActionFor(ptg, 'deliver_action')
self.assertEqual(ptg.getValidationState(), 'delivered')
class TestPaymentTransactionGroupConstraint(ERP5TypeTestCase):
def afterSetUp(self):
ti = self.portal.portal_types['Payment Transaction Group']
ti.setTypePropertySheetList(
ti.getTypePropertySheetList() + ['PaymentTransactionGroupConstraint'])
self.commit()
def beforeTearDown(self):
self.abort()
ti = self.portal.portal_types['Payment Transaction Group']
ti.setTypePropertySheetList(
[ps for ps in ti.getTypePropertySheetList() if ps != 'PaymentTransactionGroupConstraint'])
self.commit()
def test_constraints(self):
ptg = self.portal.payment_transaction_group_module.newContent(
portal_type='Payment Transaction Group',
stop_date=None,
)
self.assertEqual(
sorted([str(m.getMessage()) for m in ptg.checkConsistency()]),
[
'Currency must be defined',
'Date must be defined',
'Payment Mode must be defined',
'Payment Transaction Group Type must be defined',
'Section bank account must be defined',
'Section must be defined',
],
)
ptg.setPriceCurrencyValue(
self.portal.currency_module.newContent(portal_type='Currency'))
self.assertEqual(
sorted([str(m.getMessage()) for m in ptg.checkConsistency()]),
[
'Date must be defined',
'Payment Mode must be defined',
'Payment Transaction Group Type must be defined',
'Section bank account must be defined',
'Section must be defined',
],
)
ptg.setStopDate(DateTime(2021, 1, 1))
self.assertEqual(
sorted([str(m.getMessage()) for m in ptg.checkConsistency()]),
[
'Payment Mode must be defined',
'Payment Transaction Group Type must be defined',
'Section bank account must be defined',
'Section must be defined',
],
)
ptg.setPaymentModeValue(
self.portal.portal_categories.payment_mode.newContent(portal_type='Category'))
self.assertEqual(
sorted([str(m.getMessage()) for m in ptg.checkConsistency()]),
[
'Payment Transaction Group Type must be defined',
'Section bank account must be defined',
'Section must be defined',
],
)
ptg.setPaymentTransactionGroupTypeValue(
self.portal.portal_categories.payment_transaction_group_type.incoming)
self.assertEqual(
sorted([str(m.getMessage()) for m in ptg.checkConsistency()]),
[
'Section bank account must be defined',
'Section must be defined',
],
)
section = self.portal.organisation_module.newContent(
portal_type='Organisation'
)
ptg.setSourceSectionValue(section)
self.assertEqual(
sorted([str(m.getMessage()) for m in ptg.checkConsistency()]),
[
'Section bank account must be defined',
],
)
bank_account = section.newContent(
portal_type='Bank Account'
)
ptg.setSourcePaymentValue(bank_account)
self.assertEqual(
sorted([str(m.getMessage()) for m in ptg.checkConsistency()]),
[])
class TestRemoveFromPaymentTransactionGroup(AccountingTestCase):
def afterSetUp(self):
AccountingTestCase.afterSetUp(self)
self.bank_account = self.main_section.newContent(
portal_type='Bank Account',
price_currency_value=self.portal.currency_module.euro)
self.bank_account.validate()
self.tic()
def test_other_item_types(self):
account_module = self.account_module
payment = self._makeOne(
portal_type='Payment Transaction',
source_section_value=self.main_section,
source_payment_value=self.bank_account,
destination_section_value=self.organisation_module.client_1,
start_date=DateTime(2014, 1, 1),
lines=(
dict(
source_value=account_module.bank,
source_debit=100,
id='bank'),
dict(
source_value=account_module.receivable,
source_credit=100)))
self.tic()
self.assertFalse(payment.getReference())
ptg = self.portal.payment_transaction_group_module.newContent(
portal_type='Payment Transaction Group',
source_section_value=self.main_section,
source_payment_value=self.bank_account,
stop_date=DateTime(2014, 1, 31),)
self.tic()
item = self.portal.item_module.newContent(portal_type='Item')
payment.bank.setAggregateValueList([ptg, item])
self.tic()
payment.PaymentTransaction_removeFromPaymentTransactionGroup()
self.tic()
self.assertEqual(
payment.bank.getAggregateValueList(),
[item])
class TestPaymentTransactionGroupPaymentSelection(AccountingTestCase):
def afterSetUp(self):
AccountingTestCase.afterSetUp(self)
self.bank_account = self.main_section.newContent(
portal_type='Bank Account',
price_currency_value=self.portal.currency_module.euro)
self.bank_account.validate()
self.tic()
# TODO: more PaymentTransactionGroup_getGroupablePaymentTransactionLineList test
def test_PaymentTransactionGroup_getGroupablePaymentTransactionLineList_mapping_organisation(self):
account_module = self.account_module
payment_main_section = self._makeOne(
portal_type='Payment Transaction',
simulation_state='delivered',
title='main section',
reference='P1',
source_section_value=self.main_section,
source_payment_value=self.bank_account,
destination_section_value=self.organisation_module.client_1,
start_date=DateTime(2014, 1, 1),
lines=(
dict(
source_value=account_module.bank,
source_debit=100,
id='bank'),
dict(
source_value=account_module.receivable,
source_credit=100)))
payment_section = self._makeOne(
portal_type='Payment Transaction',
simulation_state='delivered',
title='section',
reference='P2',
source_section_value=self.section,
source_payment_value=self.bank_account,
destination_section_value=self.organisation_module.client_2,
start_date=DateTime(2014, 1, 2),
lines=(
dict(
source_value=account_module.bank,
source_debit=200,
id='bank'),
dict(
source_value=account_module.receivable,
source_credit=200)))
ptg = self.portal.payment_transaction_group_module.newContent(
portal_type='Payment Transaction Group',
source_section_value=self.main_section,
source_payment_value=self.bank_account,
stop_date=DateTime(2014, 1, 31),)
self.tic()
line_list = ptg.PaymentTransactionGroup_getGroupablePaymentTransactionLineList(
limit=None,
start_date_range_min=None,
start_date_range_max=None,
sign='incoming',
select_mode='stopped_or_delivered',
)
self.assertEqual(
sorted([line.getObject().getRelativeUrl() for line in line_list]),
sorted([payment_main_section.bank.getRelativeUrl(), payment_section.bank.getRelativeUrl()]))
# Add a payment to the group
payment_section.bank.setAggregateValue(ptg)
self.tic()
# Now the listbox only remaining transactions
line_list = ptg.PaymentTransactionGroup_getGroupablePaymentTransactionLineList(
limit=None,
start_date_range_min=None,
start_date_range_max=None,
sign='incoming',
select_mode='stopped_or_delivered',
)
self.assertEqual(
sorted([line.getObject().getRelativeUrl() for line in line_list]),
sorted([payment_main_section.bank.getRelativeUrl()]))
# Add the other payment to the group
payment_main_section.bank.setAggregateValue(ptg)
self.tic()
# the listbox of the payment transaction group correctly show both payments.
line_list = ptg.PaymentTransactionGroup_view.listbox.get_value(
'default',
render_format='list',)
self.assertEqual(
sorted([(line.is_stat_line, line['Movement_getMirrorSectionTitle'], line['total_quantity'])
for line in line_list if not line.is_title_line]),
[(0, 'Client 1', 100.0), (0, 'Client 2', 200.0), (1, None, 300.0)],
)
def test_adding_to_payment_transaction_set_reference(self):
account_module = self.account_module
payment = self._makeOne(
portal_type='Payment Transaction',
simulation_state='delivered',
source_section_value=self.main_section,
source_payment_value=self.bank_account,
payment_mode_value=self.portal.portal_categories.payment_mode.cash,
resource_value=self.portal.currency_module.euro,
destination_section_value=self.organisation_module.client_1,
start_date=DateTime(2014, 1, 1),
lines=(
dict(
source_value=account_module.bank,
source_debit=100,
id='bank'),
dict(
source_value=account_module.receivable,
source_credit=100)))
self.tic()
self.assertFalse(payment.getReference())
ptg = self.portal.payment_transaction_group_module.newContent(
portal_type='Payment Transaction Group',
source_section_value=self.main_section,
source_payment_value=self.bank_account,
payment_mode_value=self.portal.portal_categories.payment_mode.cash,
price_currency_value=self.portal.currency_module.euro,
stop_date=DateTime(2014, 1, 31),)
self.tic()
ptg.PaymentTransactionGroup_selectPaymentTransactionLineList(select_mode='stopped_or_delivered')
self.tic()
self.assertEqual(
payment.bank.getAggregateValueList(),
[ptg])
self.assertTrue(payment.getReference())
def test_select_payment_transaction_refused_when_activities_are_running(self):
ptg1 = self.portal.payment_transaction_group_module.newContent(
portal_type='Payment Transaction Group',)
ptg2 = self.portal.payment_transaction_group_module.newContent(
portal_type='Payment Transaction Group',)
self.tic()
ret = ptg1.PaymentTransactionGroup_selectPaymentTransactionLineList(select_mode='stopped_or_delivered')
self.assertEqual(
urlparse.parse_qs(urlparse.urlparse(ret).query)['portal_status_message'],
['Payment selection in progress.'])
self.commit()
ret = ptg1.PaymentTransactionGroup_selectPaymentTransactionLineList(select_mode='stopped_or_delivered')
self.assertEqual(
urlparse.parse_qs(urlparse.urlparse(ret).query)['portal_status_message'],
['Some payments are still beeing processed in the background, please retry later'])
self.commit()
# another PTG is same, because we also want to prevent things like two users selecting
# payments at the same time.
ret = ptg2.PaymentTransactionGroup_selectPaymentTransactionLineList(select_mode='stopped_or_delivered')
self.assertEqual(
urlparse.parse_qs(urlparse.urlparse(ret).query)['portal_status_message'],
['Some payments are still beeing processed in the background, please retry later'])
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Interaction Workflow" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Directly deliver the payment transaction groups at the beginning of delivery.\n
\n
This workflow is meant to be replaced by interaction workflow doing more complex interactions, like using a banking interface.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>payment_transaction_group_delivering_interaction_workflow</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Interaction Workflow</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>payment_transaction_group_delivering_interaction_workflow</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Interaction Workflow Interaction" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>after_script/portal_workflow/payment_transaction_group_delivering_interaction_workflow/script_Workflow_deliver</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_beginDelivery</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Interaction Workflow Interaction</string> </value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Begin Delivery</string> </value>
</item>
<item>
<key> <string>trigger_method_id</string> </key>
<value>
<tuple>
<string>beginDelivery</string>
</tuple>
</value>
</item>
<item>
<key> <string>trigger_once_per_transaction</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Script" module="erp5.portal_type"/>
</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>state_change</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Workflow_deliver</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Script</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2021-04-23
* New "Select Planned or Confirmed Payments and Post them to General Ledger" mode to select payments.
2011-07-13 Gabriel:
* Add field on PaymentTransactionGroup_view to display the source_administration property
......
Payment Transaction Group Module | view
Payment Transaction Group | document_list
Payment Transaction Group | jump_to_document
Payment Transaction Group | select_payment_list
Payment Transaction Group | view
Payment Transaction | jump_payment_transaction_group
......
Payment Transaction Group | edit_workflow
Payment Transaction Group | payment_transaction_group_delivering_interaction_workflow
Payment Transaction Group | payment_transaction_group_validation_workflow
\ No newline at end of file
PaymentTransactionGroupConstraint
\ No newline at end of file
payment_transaction_group_delivering_interaction_workflow
payment_transaction_group_validation_workflow
\ No newline at end of file
erp5_full_text_mroonga_catalog
erp5_accounting_ui_test
erp5_item
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Zuite" module="Products.Zelenium.zuite"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>renderjs_ui_payment_mean_zuite</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testPaymentTransactionGroupSelectPaymentsFastInput</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title tal:content="template/title_or_id"></title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3" tal:content="template/title_or_id"></td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanRenderJsUiTest/macros/init" />
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanRenderJsUiTest/macros/prepare_data" />
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanRenderJsUiTest/macros/view_fast_input" />
<tr>
<td>assertSelected</td>
<td>field_your_sign</td>
<td>Outgoing</td>
</tr>
<!-- there's an empty listbox by default (and not a "Invalid Search Criteria-Reset" error) -->
<tal:block tal:define="pagination_configuration python: {'header': '(0)', 'footer': 'No records'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block>
<!-- update dialog -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/update_dialog" />
<tal:block tal:define="pagination_configuration python: {'header': '(2)', 'footer': '2 Records'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block>
<!-- choose limit -->
<tr>
<td>type</td>
<td>//input[@name='field_your_select_limit']</td>
<td>1</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/update_dialog" />
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '1 Records'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block>
<!-- choose dates -->
<tr>
<td>type</td>
<td>//input[@name='field_your_select_limit']</td>
<td>10</td>
</tr>
<tr>
<td>type</td>
<td>//input[@name='field_your_start_date_range_max']</td>
<td>2019-10-20</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/update_dialog" />
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '1 Records'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block>
<!-- choose sign -->
<tr>
<td>select</td>
<td>field_your_sign</td>
<td>Incoming</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/update_dialog" />
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '1 Records'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block>
<!-- select -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Payment selection in progress.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${renderjs_url}/payment_transaction_group_module/erp5_payment_mean_ui_test_payment_transaction_group</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '1 Records'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testPaymentTransactionGroupSelectPaymentsFastInputSelectLines</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title tal:content="template/title_or_id"></title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3" tal:content="template/title_or_id"></td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanRenderJsUiTest/macros/init" />
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanRenderJsUiTest/macros/prepare_data" />
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanRenderJsUiTest/macros/view_fast_input" />
<tr>
<td>assertSelected</td>
<td>field_your_sign</td>
<td>Outgoing</td>
</tr>
<!-- update dialog -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/update_dialog" />
<tal:block tal:define="pagination_configuration python: {'header': '(2)', 'footer': '2 Records'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block>
<!-- select one line -->
<tr>
<td>click</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_field_listbox.html')]//tbody/tr[1]/td[1]/input</td>
<td></td>
</tr>
<!-- select -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Payment selection in progress.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${renderjs_url}/payment_transaction_group_module/erp5_payment_mean_ui_test_payment_transaction_group</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '1 Records'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testPaymentTransactionGroupSelectPlannedOrConfirmedPaymentsFastInput</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title tal:content="template/title_or_id"></title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3" tal:content="template/title_or_id"></td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanRenderJsUiTest/macros/init" />
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanRenderJsUiTest/macros/prepare_data" />
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanRenderJsUiTest/macros/view_fast_input" />
<tr>
<td>assertSelected</td>
<td>field_your_select_mode</td>
<td>Select already Posted to General Ledger or Closed Payments</td>
</tr>
<!-- update dialog -->
<tr>
<td>select</td>
<td>field_your_select_mode</td>
<td>Select Planned or Confirmed Payments and Post them to General Ledger</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/update_dialog" />
<!-- out of the 3, one is not consistent -->
<tal:block tal:define="pagination_configuration python: {'header': '(3)', 'footer': '3 Records'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block>
<!-- select -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Payment selection in progress.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${renderjs_url}/payment_transaction_group_module/erp5_payment_mean_ui_test_payment_transaction_group</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<!-- the not consistent transaction was not selected, we selected and validated the two consistent ones -->
<tal:block tal:define="pagination_configuration python: {'header': '(2)', 'footer': '2 Records'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td>assertTextPresent</td>
<td>Posted to General Ledger</td>
<td></td>
</tr>
<!-- XXX we don't really need to wait for activities here, but we need to `open` a different page so that we can
open erp5_payment_mean_ui_test_confirmed_not_consistent_outgoing_payment later.
selenium open command expect that a new page is loaded, without this we would just re-open the same page with
a different fragment and selenium would never notice with open is executed.
-->
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<!-- the not consistent transaction is left separately, there's a note in history explaining why it could not be selected -->
<tr>
<td>open</td>
<td>${renderjs_url}/accounting_module/erp5_payment_mean_ui_test_confirmed_not_consistent_outgoing_payment</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Views'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_header_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'History'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_page_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tr>
<td>assertTextPresent</td>
<td>Transaction is not balanced for erp5_payment_mean_ui_test_organisation</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_payment_mean_renderjs_ui_test</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>description</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>text</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Common Template for PTZuite, it will reuse parts of the Listbox Zuite</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_viewCommonTemplatePaymentMeanRenderJsUiTest</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<tal:block metal:define-macro="init">
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/portal_preferences/ERP5Site_setPaymentMeanUiTestPreference</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Set Payment Mean Preference Successfully.</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>${base_url}/web_site_module/renderjs_runner/#</td>
<td>renderjs_url</td>
</tr>
</tal:block>
<tal:block metal:define-macro="delete_data">
<tr>
<td colspan="3"><b>Delete Payment Mean Test Data</b></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/ERP5Site_deletePaymentMeanUiTestData</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Deleted Successfully.</td>
<td></td>
</tr>
<tr>
<td colspan="3"><p></p></td>
</tr>
</tal:block>
<tal:block metal:define-macro="prepare_data">
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanRenderJsUiTest/macros/delete_data" />
<tr>
<td colspan="3"><b>Create Payment Mean Test Data</b></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/ERP5Site_createPaymentMeanUiTestData</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Test Data Created.</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td colspan="3"><p></p></td>
</tr>
</tal:block>
<tal:block metal:define-macro="view_fast_input">
<tr>
<td colspan="3"><b>Display the fast input</b></td>
</tr>
<tr>
<td>open</td>
<td>${renderjs_url}/payment_transaction_group_module/erp5_payment_mean_ui_test_payment_transaction_group</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<!-- Wait for gadget to be loaded -->
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_view.html']</td>
<td></td>
</tr>
<tal:block tal:define="click_configuration python: {'text': 'Actions'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_header_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_action.html']</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Select Payments</td>
<td></td>
</tr>
<tal:block tal:define="click_configuration python: {'text': 'Select Payments'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_page_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_dialog.html']</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Select Payments</td>
<td></td>
</tr>
<tr>
<td colspan="3"><p></p></td>
</tr>
</tal:block>
</tal:block>
\ No newline at end of file
##############################################################################
#
# Copyright (c) 2021 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from Products.ERP5Type.tests import ERP5TypeFunctionalTestCase
class TestFunctionalRenderJSPaymentMean(ERP5TypeFunctionalTestCase.ERP5TypeFunctionalTestCase):
run_only = "renderjs_ui_payment_mean_zuite"
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testFunctionalRJSPaymentMean</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testFunctionalRJSPaymentMean</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Copyright (C) 2021 Nexedi SA
\ No newline at end of file
erp5_payment_mean_ui_test
erp5_web_renderjs_ui_test
\ No newline at end of file
portal_tests/renderjs_ui_payment_mean_zuite
portal_tests/renderjs_ui_payment_mean_zuite/**
\ No newline at end of file
erp5_payment_mean_renderjs_ui_test
\ No newline at end of file
test.erp5.testFunctionalRJSPaymentMean
\ No newline at end of file
erp5_full_text_mroonga_catalog
\ No newline at end of file
erp5_payment_mean_renderjs_ui_test
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_jio_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>generate_sepa_credit_transfer</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>4.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Generate SEPA Credit Transfer File</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/PaymentTransactionGroup_viewGenerateSEPACreditTransferFileDialog?reset:int=1</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: context.getValidationState() in ( \'open\', \'closed\', \'delivered\') and context.isMemberOf(\'payment_transaction_group_type/outgoing\') and context.isMemberOf(\'payment_mode/%s\' % context.getPortalObject().portal_preferences.getPreferredSepaCreditTransferPaymentMode())</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>payment_mean_sepa_preference</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>11.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>SEPA</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SystemPreference_viewPaymentMeanSepa</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Constraints checking that lines of payment transactions satisfy all the requirements to be used in SEPA Credit Transfer</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountingTransactionLineSEPACreditTransferConstraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: context.AccountingTransactionLine_checkPaymentBelongToSection(source=True) and context.AccountingTransactionLine_checkPaymentBelongToSection(source=False)</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>payment_belong_to_section_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>Bank Account must belong to Section</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.isMemberOf(\'payment_mode/%s\' % context.getPortalObject().portal_preferences.getPreferredSepaCreditTransferPaymentMode()) and ((context.getSource(portal_type=\'Account\') and context.getSourceValue(portal_type=\'Account\').isMemberOf(\'account_type/asset/cash/bank\')) or (context.getDestination(portal_type=\'Account\') and context.getDestinationValue(portal_type=\'Account\').isMemberOf(\'account_type/asset/cash/bank\')))\n
</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: context.getDestinationPayment(portal_type=\'Bank Account\') and context.getDestinationPaymentValue(portal_type=\'Bank Account\').getIban() and context.getDestinationPaymentValue(portal_type=\'Bank Account\').getBicCode() and context.getSourcePayment(portal_type=\'Bank Account\') and context.getSourcePaymentValue(portal_type=\'Bank Account\').getIban() and context.getSourcePaymentValue(portal_type=\'Bank Account\').getBicCode()</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>payment_iban_bic_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>Bank Accounts must have IBAN and BIC</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.isMemberOf(\'payment_mode/%s\' % context.getPortalObject().portal_preferences.getPreferredSepaCreditTransferPaymentMode()) and ((context.getSource(portal_type=\'Account\') and context.getSourceValue(portal_type=\'Account\').isMemberOf(\'account_type/asset/cash/bank\')) or (context.getDestination(portal_type=\'Account\') and context.getDestinationValue(portal_type=\'Account\').isMemberOf(\'account_type/asset/cash/bank\')))\n
</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: context.getDestinationPayment(portal_type=\'Bank Account\') and context.getDestinationPaymentValue(portal_type=\'Bank Account\').getValidationState() == \'validated\' and context.getSourcePayment(portal_type=\'Bank Account\') and context.getSourcePaymentValue(portal_type=\'Bank Account\').getValidationState() == \'validated\'</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>payment_validated_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>Bank Accounts must be validated</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.isMemberOf(\'payment_mode/%s\' % context.getPortalObject().portal_preferences.getPreferredSepaCreditTransferPaymentMode()) and ((context.getSource(portal_type=\'Account\') and context.getSourceValue(portal_type=\'Account\').isMemberOf(\'account_type/asset/cash/bank\')) or (context.getDestination(portal_type=\'Account\') and context.getDestinationValue(portal_type=\'Account\').isMemberOf(\'account_type/asset/cash/bank\')))\n
</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaymentMeanSEPAPreference</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Payment Mode category to use for SEPA Credit Transferts</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>preferred_sepa_credit_transfer_payment_mode_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>preference</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_payment_mean_sepa</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""Check that the bank account "belong" to the destination section.
"""
portal = context.getPortalObject()
if source:
section = context.getSourceSectionValue(portal_type=portal.getPortalEntityTypeList())
bank_account = context.getSourcePaymentValue(portal_type=portal.getPortalPaymentNodeTypeList())
else:
section = context.getDestinationSectionValue(portal_type=portal.getPortalEntityTypeList())
bank_account = context.getDestinationPaymentValue(portal_type=portal.getPortalPaymentNodeTypeList())
if section is None or bank_account is None:
return True
section = section.Organisation_getMappingRelatedOrganisation()
return bank_account.getParentValue() == section
<?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>source</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountingTransactionLine_checkPaymentBelongToSection</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""Return a text to use as Unstructured RemittanceInformation for this payment transaction.
This is used in SEPA Credit Transfer export, 2.90 RemittanceInformation
This script is a customization point.
"""
ptg = context.getAggregateValue(portal_type='Payment Transaction Group')
if ptg.getSourcePayment() == context.getSourcePayment():
third_party = context.getDestinationSectionValue()
else:
third_party = context.getSourceSectionValue()
third_party_name = third_party.getCorporateName() or third_party.getTitle()
return "{invoice_reference} {third_party_name}".format(
invoice_reference=context.getParentValue().getCausalityReference() or '',
third_party_name=third_party_name,
).strip()
<?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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountingTransactionLine_getSEPACreditTransferRemittanceInformation</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
from Products.ERP5Type.Message import translateString
# Same check as in PaymentTransactionGroup_selectPaymentTransactionLineList
tag = 'PaymentTransactionGroup_selectPaymentTransactionList'
context.serialize()
if context.getPortalObject().portal_activities.countMessageWithTag(tag,):
return context.Base_redirect(form_id, keep_items=dict(portal_status_message=translateString(
"Some payments are still beeing processed in the background, please retry later")))
assert version == 'pain.001.001.02', 'Unsupported version'
portal = context.getPortalObject()
portal.portal_contributions.newContent(
reference=context.getSourceReference(),
data=getattr(context, 'PaymentTransactionGroup_viewAsSEPACreditTransferPain.001.001.02')().encode('utf-8'),
filename=context.getSourceReference() + '.xml',
# XXX we should probably use a dedicated type based method or preference,
# for now we use the same as for *attached* documents.
publication_section=context.getTypeBasedMethod('getPreferredAttachedDocumentPublicationSection')(),
follow_up=context.getRelativeUrl(),
).release()
return context.Base_redirect(form_id, keep_items={
'portal_status_message': translateString('SEPA Credit Transfer File generated.')
})
<?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>version, form_id=\'\', **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaymentTransactionGroup_generateSEPACreditTransferFile</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
section = context.getSourceSectionValue()
section_bank_account = context.getSourcePaymentValue()
assert section_bank_account.getValidationState() == 'validated'
currency = context.getPriceCurrencyReference() or context.getPriceCurrencyTitle()
assert currency.upper() == 'EUR', 'Wrong currency %s' % currency
data_dict = {
'GrpHdr': {
'MsgId': context.getSourceReference(),
'CreDtTm': context.getStopDate().toZone('UTC').asdatetime().isoformat(),
'InitgPty': {
'Nm': section.getCorporateName() or section.getTitle(),
}
},
'PmtInf': {
'PmtInfId': context.getReference() or context.getSourceReference(),
'ReqdExctnDt':context.getStopDate().toZone('UTC').asdatetime().strftime('%Y-%m-%d'),
'Dbtr': {
'Nm': section.getCorporateName() or section.getTitle(),
},
'DbtrAcct': {
'Id': {
'IBAN': section_bank_account.getIban().replace(' ', '').replace('\t', ''),
}
},
'DbtrAgt': {
'FinInstnId': {
'BIC': section_bank_account.getBicCode().strip(),
}
}
},
}
# This does not support payment transactions with multiple lines.
# To prevent generating a file where the same end to end id exists twice,
# we just check that EndToEndId are unique in this file.
end_to_end_id_set = set([])
transaction_list = []
total = 0
for brain in context.PaymentTransactionGroup_getAccountingTransactionLineList():
amount = round(-brain.total_quantity, 2)
assert amount > 0
total += amount
transaction_line = brain.getObject()
transaction = transaction_line.getExplanationValue()
if brain.payment_uid == transaction_line.getSourcePaymentUid():
creditor_entity = transaction_line.getDestinationSectionValue()
creditor_bank_account = transaction_line.getDestinationPaymentValue()
else:
assert brain.payment_uid == transaction_line.getDestinationPaymentUid()
creditor_entity = transaction_line.getSourceSectionValue()
creditor_bank_account = transaction_line.getSourcePaymentValue()
assert creditor_bank_account.getValidationState() == 'validated', \
'%s is not validated' % creditor_bank_account.getRelativeUrl()
assert transaction_line.AccountingTransactionLine_checkPaymentBelongToSection(source=True), \
'source bank account on %s does not belong to section' % transaction_line.getRelativeUrl()
assert transaction_line.AccountingTransactionLine_checkPaymentBelongToSection(source=False), \
'destination bank account on %s does not belong to section' % transaction_line.getRelativeUrl()
end_to_end_id = transaction.getReference()
assert end_to_end_id
assert end_to_end_id not in end_to_end_id_set
end_to_end_id_set.add(end_to_end_id)
transaction_list.append(
{
'PmtId': {
'EndToEndId': end_to_end_id,
},
'RmtInf': {
'Ustrd': transaction_line.AccountingTransactionLine_getSEPACreditTransferRemittanceInformation(),
},
'Cdtr': {
'Nm': creditor_entity.getCorporateName() or creditor_entity.getTitle(),
'PstlAdr': (creditor_entity.getDefaultAddressText() or '').splitlines(),
'Ctry': creditor_entity.getDefaultAddressRegion() and creditor_entity.getDefaultAddressValue().getRegionReference(),
},
'Amt': {
'InstdAmt': '%0.2f' % amount
},
'CdtrAcct': {
'Id': {
'IBAN': creditor_bank_account.getIban().replace(' ', '').replace('\t', ''),
}
},
'CdtrAgt': {
'FinInstnId': {
'BIC': section_bank_account.getBicCode().strip(),
}
}
}
)
data_dict['GrpHdr']['NbOfTxs'] = len(transaction_list)
data_dict['GrpHdr']['CtrlSum'] = '%0.2f' % total
data_dict['transaction_list'] = transaction_list
return data_dict
<?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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaymentTransactionGroup_getSEPACreditTransferDataDict</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/xml</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaymentTransactionGroup_viewAsSEPACreditTransferPain.001.001.02</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Document
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02"
tal:define="data context/PaymentTransactionGroup_getSEPACreditTransferDataDict">
<pain.001.001.02>
<GrpHdr>
<MsgId tal:content="data/GrpHdr/MsgId"></MsgId>
<CreDtTm tal:content="data/GrpHdr/CreDtTm">2001-02-03T04:05:06</CreDtTm>
<BtchBookg>true</BtchBookg>
<NbOfTxs tal:content="data/GrpHdr/NbOfTxs">1</NbOfTxs>
<CtrlSum tal:content="data/GrpHdr/CtrlSum">1000</CtrlSum>
<Grpg>MIXD</Grpg>
<InitgPty>
<Nm tal:content="data/GrpHdr/InitgPty/Nm"></Nm>
</InitgPty>
</GrpHdr>
<PmtInf>
<PmtInfId tal:content="data/PmtInf/PmtInfId"></PmtInfId>
<PmtMtd>TRF</PmtMtd>
<PmtTpInf>
<SvcLvl>
<Cd>SEPA</Cd>
</SvcLvl>
</PmtTpInf>
<ReqdExctnDt tal:content="data/PmtInf/ReqdExctnDt">1970-01-01</ReqdExctnDt>
<Dbtr>
<Nm tal:content="data/PmtInf/Dbtr/Nm"></Nm>
</Dbtr>
<DbtrAcct>
<Id>
<IBAN tal:content="data/PmtInf/DbtrAcct/Id/IBAN"></IBAN>
</Id>
<Ccy>EUR</Ccy>
</DbtrAcct>
<DbtrAgt>
<FinInstnId>
<BIC tal:content="data/PmtInf/DbtrAgt/FinInstnId/BIC"></BIC>
</FinInstnId>
</DbtrAgt>
<CdtTrfTxInf tal:repeat="transaction data/transaction_list">
<PmtId>
<EndToEndId tal:content="transaction/PmtId/EndToEndId"></EndToEndId>
</PmtId>
<Amt>
<InstdAmt Ccy="EUR" tal:content="transaction/Amt/InstdAmt">123.45</InstdAmt>
</Amt>
<CdtrAgt>
<FinInstnId>
<BIC tal:content="transaction/CdtrAgt/FinInstnId/BIC">XXX</BIC>
</FinInstnId>
</CdtrAgt>
<Cdtr>
<Nm tal:content="transaction/Cdtr/Nm"></Nm>
<PstlAdr tal:condition="transaction/Cdtr/Ctry">
<tal:block tal:repeat="line transaction/Cdtr/PstlAdr">
<AdrLine tal:content="line"></AdrLine>
</tal:block>
<Ctry tal:content="transaction/Cdtr/Ctry"></Ctry>
</PstlAdr>
</Cdtr>
<CdtrAcct>
<Id>
<IBAN tal:content="transaction/CdtrAcct/Id/IBAN">FR76...</IBAN>
</Id>
</CdtrAcct>
<RmtInf>
<Ustrd tal:content="transaction/RmtInf/Ustrd"></Ustrd>
</RmtInf>
</CdtTrfTxInf>
</PmtInf>
</pain.001.001.02>
</Document>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>PaymentTransactionGroup_generateSEPACreditTransferFile</string> </value>
</item>
<item>
<key> <string>action_title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>your_version</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaymentTransactionGroup_viewGenerateSEPACreditTransferFileDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Generate SEPA Credit Transfer File</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ListField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_version</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>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>unknown_selection</string> </key>
<value> <string>You selected an item that was not in the list.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string>pain.001.001.02</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list>
<tuple>
<string></string>
<string></string>
</tuple>
<tuple>
<string>pain.001.001.02</string>
<string>pain.001.001.02</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Version</string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </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>python: [(context.Base_translateString(label), value) for (label, value) in field.get_orig_value(\'items\')]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>action_title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_preferred_sepa_credit_transfer_payment_mode</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SystemPreference_viewPaymentMeanSepa</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>SystemPreference_viewPaymentMeanSepa</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>SEPA</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>items</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_preferred_sepa_credit_transfer_payment_mode</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>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</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>field_id</string> </key>
<value> <string>my_category</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</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>Preferred Payment Mode for SEPA Credit Transfers</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>python: getattr(here.portal_categories.payment_mode, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(local_sort_id=(\'int_index\', \'translated_title\'), checked_permission=\'View\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0" encoding="UTF-8"?>
<!--
This document is a copy of the XSD from https://www.iso20022.org/
This is not the official source and the sole hat the sole source of up-to-date materials and information on ISO 20022 message standards and Repository is https://www.iso20022.org/.
-->
<!--Generated by SWIFTStandards Workstation (build:R5.1.0.4) on 2006 Sep 08 11:58:39-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02">
<xs:element name="Document" type="Document"/>
<xs:complexType name="AccountIdentification3Choice">
<xs:sequence>
<xs:choice>
<xs:element name="IBAN" type="IBANIdentifier"/>
<xs:element name="BBAN" type="BBANIdentifier"/>
<xs:element name="UPIC" type="UPICIdentifier"/>
<xs:element name="PrtryAcct" type="SimpleIdentificationInformation2"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="AddressType2Code">
<xs:restriction base="xs:string">
<xs:enumeration value="ADDR"/>
<xs:enumeration value="PBOX"/>
<xs:enumeration value="HOME"/>
<xs:enumeration value="BIZZ"/>
<xs:enumeration value="MLTO"/>
<xs:enumeration value="DLVY"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="AmountType2Choice">
<xs:sequence>
<xs:choice>
<xs:element name="InstdAmt" type="CurrencyAndAmount"/>
<xs:element name="EqvtAmt" type="EquivalentAmount"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="BBANIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z0-9]{1,30}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="BEIIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="BICIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="BaseOneRate">
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="10"/>
<xs:totalDigits value="11"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="BatchBookingIndicator">
<xs:restriction base="xs:boolean"/>
</xs:simpleType>
<xs:complexType name="BranchAndFinancialInstitutionIdentification3">
<xs:sequence>
<xs:element name="FinInstnId" type="FinancialInstitutionIdentification5Choice"/>
<xs:element name="BrnchId" type="BranchData" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="BranchData">
<xs:sequence>
<xs:element name="Id" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="Nm" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="PstlAdr" type="PostalAddress1" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="CHIPSUniversalIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="CH[0-9]{6,6}"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CashAccount7">
<xs:sequence>
<xs:element name="Id" type="AccountIdentification3Choice"/>
<xs:element name="Tp" type="CashAccountType2" minOccurs="0" maxOccurs="1"/>
<xs:element name="Ccy" type="CurrencyCode" minOccurs="0" maxOccurs="1"/>
<xs:element name="Nm" type="Max70Text" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CashAccountType2">
<xs:sequence>
<xs:choice>
<xs:element name="Cd" type="CashAccountType4Code"/>
<xs:element name="Prtry" type="Max35Text"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="CashAccountType4Code">
<xs:restriction base="xs:string">
<xs:enumeration value="CASH"/>
<xs:enumeration value="CHAR"/>
<xs:enumeration value="COMM"/>
<xs:enumeration value="TAXE"/>
<xs:enumeration value="CISH"/>
<xs:enumeration value="TRAS"/>
<xs:enumeration value="SACC"/>
<xs:enumeration value="CACC"/>
<xs:enumeration value="SVGS"/>
<xs:enumeration value="ONDP"/>
<xs:enumeration value="MGLD"/>
<xs:enumeration value="NREX"/>
<xs:enumeration value="MOMA"/>
<xs:enumeration value="LOAN"/>
<xs:enumeration value="SLRY"/>
<xs:enumeration value="ODFT"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ChargeBearerType1Code">
<xs:restriction base="xs:string">
<xs:enumeration value="DEBT"/>
<xs:enumeration value="CRED"/>
<xs:enumeration value="SHAR"/>
<xs:enumeration value="SLEV"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="Cheque5">
<xs:sequence>
<xs:element name="ChqTp" type="ChequeType2Code" minOccurs="0" maxOccurs="1"/>
<xs:element name="ChqNb" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="ChqFr" type="NameAndAddress3" minOccurs="0" maxOccurs="1"/>
<xs:element name="DlvryMtd" type="ChequeDeliveryMethod1Choice" minOccurs="0" maxOccurs="1"/>
<xs:element name="DlvrTo" type="NameAndAddress3" minOccurs="0" maxOccurs="1"/>
<xs:element name="InstrPrty" type="Priority2Code" minOccurs="0" maxOccurs="1"/>
<xs:element name="ChqMtrtyDt" type="ISODate" minOccurs="0" maxOccurs="1"/>
<xs:element name="FrmsCd" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="MemoFld" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="RgnlClrZone" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="PrtLctn" type="Max35Text" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="ChequeDelivery1Code">
<xs:restriction base="xs:string">
<xs:enumeration value="MLDB"/>
<xs:enumeration value="MLCD"/>
<xs:enumeration value="MLFA"/>
<xs:enumeration value="CRDB"/>
<xs:enumeration value="CRCD"/>
<xs:enumeration value="CRFA"/>
<xs:enumeration value="PUDB"/>
<xs:enumeration value="PUCD"/>
<xs:enumeration value="PUFA"/>
<xs:enumeration value="RGDB"/>
<xs:enumeration value="RGCD"/>
<xs:enumeration value="RGFA"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ChequeDeliveryMethod1Choice">
<xs:sequence>
<xs:choice>
<xs:element name="Cd" type="ChequeDelivery1Code"/>
<xs:element name="Prtry" type="Max35Text"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="ChequeType2Code">
<xs:restriction base="xs:string">
<xs:enumeration value="CCHQ"/>
<xs:enumeration value="CCCH"/>
<xs:enumeration value="BCHQ"/>
<xs:enumeration value="DRFT"/>
<xs:enumeration value="ELDR"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ClearingChannel2Code">
<xs:restriction base="xs:string">
<xs:enumeration value="RTGS"/>
<xs:enumeration value="RTNS"/>
<xs:enumeration value="MPNS"/>
<xs:enumeration value="BOOK"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ClearingSystemMemberIdentification3Choice">
<xs:sequence>
<xs:choice>
<xs:element name="Id" type="ExternalClearingSystemMemberCode"/>
<xs:element name="Prtry" type="Max35Text"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="CountryCode">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]{2,2}"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CreditTransferTransactionInformation1">
<xs:sequence>
<xs:element name="PmtId" type="PaymentIdentification1"/>
<xs:element name="PmtTpInf" type="PaymentTypeInformation1" minOccurs="0" maxOccurs="1"/>
<xs:element name="Amt" type="AmountType2Choice"/>
<xs:element name="XchgRateInf" type="ExchangeRateInformation1" minOccurs="0" maxOccurs="1"/>
<xs:element name="ChrgBr" type="ChargeBearerType1Code" minOccurs="0" maxOccurs="1"/>
<xs:element name="ChqInstr" type="Cheque5" minOccurs="0" maxOccurs="1"/>
<xs:element name="UltmtDbtr" type="PartyIdentification8" minOccurs="0" maxOccurs="1"/>
<xs:element name="IntrmyAgt1" type="BranchAndFinancialInstitutionIdentification3" minOccurs="0" maxOccurs="1"/>
<xs:element name="IntrmyAgt1Acct" type="CashAccount7" minOccurs="0" maxOccurs="1"/>
<xs:element name="IntrmyAgt2" type="BranchAndFinancialInstitutionIdentification3" minOccurs="0" maxOccurs="1"/>
<xs:element name="IntrmyAgt2Acct" type="CashAccount7" minOccurs="0" maxOccurs="1"/>
<xs:element name="IntrmyAgt3" type="BranchAndFinancialInstitutionIdentification3" minOccurs="0" maxOccurs="1"/>
<xs:element name="IntrmyAgt3Acct" type="CashAccount7" minOccurs="0" maxOccurs="1"/>
<xs:element name="CdtrAgt" type="BranchAndFinancialInstitutionIdentification3" minOccurs="0" maxOccurs="1"/>
<xs:element name="CdtrAgtAcct" type="CashAccount7" minOccurs="0" maxOccurs="1"/>
<xs:element name="Cdtr" type="PartyIdentification8" minOccurs="0" maxOccurs="1"/>
<xs:element name="CdtrAcct" type="CashAccount7" minOccurs="0" maxOccurs="1"/>
<xs:element name="UltmtCdtr" type="PartyIdentification8" minOccurs="0" maxOccurs="1"/>
<xs:element name="InstrForCdtrAgt" type="InstructionForCreditorAgent1" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="InstrForDbtrAgt" type="Max140Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="Purp" type="Purpose1Choice" minOccurs="0" maxOccurs="1"/>
<xs:element name="RgltryRptg" type="RegulatoryReporting2" minOccurs="0" maxOccurs="10"/>
<xs:element name="Tax" type="TaxInformation2" minOccurs="0" maxOccurs="1"/>
<xs:element name="RltdRmtInf" type="RemittanceLocation1" minOccurs="0" maxOccurs="10"/>
<xs:element name="RmtInf" type="RemittanceInformation1" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CreditorReferenceInformation1">
<xs:sequence>
<xs:element name="CdtrRefTp" type="CreditorReferenceType1" minOccurs="0" maxOccurs="1"/>
<xs:element name="CdtrRef" type="Max35Text" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CreditorReferenceType1">
<xs:sequence>
<xs:choice>
<xs:element name="Cd" type="DocumentType3Code"/>
<xs:element name="Prtry" type="Max35Text"/>
</xs:choice>
<xs:element name="Issr" type="Max35Text" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="CurrencyAndAmount_SimpleType">
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0"/>
<xs:fractionDigits value="5"/>
<xs:totalDigits value="18"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CurrencyAndAmount">
<xs:simpleContent>
<xs:extension base="CurrencyAndAmount_SimpleType">
<xs:attribute name="Ccy" type="CurrencyCode" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="CurrencyCode">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]{3,3}"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="DateAndPlaceOfBirth">
<xs:sequence>
<xs:element name="BirthDt" type="ISODate"/>
<xs:element name="PrvcOfBirth" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="CityOfBirth" type="Max35Text"/>
<xs:element name="CtryOfBirth" type="CountryCode"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="DecimalNumber">
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="17"/>
<xs:totalDigits value="18"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="Document">
<xs:sequence>
<xs:element name="pain.001.001.02" type="pain.001.001.02"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="DocumentType2Code">
<xs:restriction base="xs:string">
<xs:enumeration value="MSIN"/>
<xs:enumeration value="CNFA"/>
<xs:enumeration value="DNFA"/>
<xs:enumeration value="CINV"/>
<xs:enumeration value="CREN"/>
<xs:enumeration value="DEBN"/>
<xs:enumeration value="HIRI"/>
<xs:enumeration value="SBIN"/>
<xs:enumeration value="CMCN"/>
<xs:enumeration value="SOAC"/>
<xs:enumeration value="DISP"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="DocumentType3Code">
<xs:restriction base="xs:string">
<xs:enumeration value="RADM"/>
<xs:enumeration value="RPIN"/>
<xs:enumeration value="FXDR"/>
<xs:enumeration value="DISP"/>
<xs:enumeration value="PUOR"/>
<xs:enumeration value="SCOR"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="DunsIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{9,9}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="EANGLNIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{13,13}"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="EquivalentAmount">
<xs:sequence>
<xs:element name="Amt" type="CurrencyAndAmount"/>
<xs:element name="CcyOfTrf" type="CurrencyCode"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ExchangeRateInformation1">
<xs:sequence>
<xs:element name="XchgRate" type="BaseOneRate" minOccurs="0" maxOccurs="1"/>
<xs:element name="RateTp" type="ExchangeRateType1Code" minOccurs="0" maxOccurs="1"/>
<xs:element name="CtrctId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="ExchangeRateType1Code">
<xs:restriction base="xs:string">
<xs:enumeration value="SPOT"/>
<xs:enumeration value="SALE"/>
<xs:enumeration value="AGRD"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ExternalClearingSystemMemberCode">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="35"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ExternalLocalInstrumentCode">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="35"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ExternalPurposeCode">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="35"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="FinancialInstitutionIdentification3">
<xs:sequence>
<xs:element name="BIC" type="BICIdentifier" minOccurs="0" maxOccurs="1"/>
<xs:element name="ClrSysMmbId" type="ClearingSystemMemberIdentification3Choice" minOccurs="0" maxOccurs="1"/>
<xs:element name="Nm" type="Max70Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="PstlAdr" type="PostalAddress1" minOccurs="0" maxOccurs="1"/>
<xs:element name="PrtryId" type="GenericIdentification3" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="FinancialInstitutionIdentification5Choice">
<xs:sequence>
<xs:choice>
<xs:element name="BIC" type="BICIdentifier"/>
<xs:element name="ClrSysMmbId" type="ClearingSystemMemberIdentification3Choice"/>
<xs:element name="NmAndAdr" type="NameAndAddress7"/>
<xs:element name="PrtryId" type="GenericIdentification3"/>
<xs:element name="CmbndId" type="FinancialInstitutionIdentification3"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:complexType name="GenericIdentification3">
<xs:sequence>
<xs:element name="Id" type="Max35Text"/>
<xs:element name="Issr" type="Max35Text" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="GenericIdentification4">
<xs:sequence>
<xs:element name="Id" type="Max35Text"/>
<xs:element name="IdTp" type="Max35Text"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="GroupHeader1">
<xs:sequence>
<xs:element name="MsgId" type="Max35Text"/>
<xs:element name="CreDtTm" type="ISODateTime"/>
<xs:element name="Authstn" type="Max128Text" minOccurs="0" maxOccurs="2"/>
<xs:element name="BtchBookg" type="BatchBookingIndicator" minOccurs="0" maxOccurs="1"/>
<xs:element name="NbOfTxs" type="Max15NumericText"/>
<xs:element name="CtrlSum" type="DecimalNumber" minOccurs="0" maxOccurs="1"/>
<xs:element name="Grpg" type="Grouping1Code"/>
<xs:element name="InitgPty" type="PartyIdentification8"/>
<xs:element name="FwdgAgt" type="BranchAndFinancialInstitutionIdentification3" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="Grouping1Code">
<xs:restriction base="xs:string">
<xs:enumeration value="SNGL"/>
<xs:enumeration value="GRPD"/>
<xs:enumeration value="MIXD"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="IBANIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="IBEIIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]{2,2}[B-DF-HJ-NP-TV-XZ0-9]{7,7}[0-9]{1,1}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ISODate">
<xs:restriction base="xs:date"/>
</xs:simpleType>
<xs:simpleType name="ISODateTime">
<xs:restriction base="xs:dateTime"/>
</xs:simpleType>
<xs:simpleType name="Instruction3Code">
<xs:restriction base="xs:string">
<xs:enumeration value="CHQB"/>
<xs:enumeration value="HOLD"/>
<xs:enumeration value="PHOB"/>
<xs:enumeration value="TELB"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="InstructionForCreditorAgent1">
<xs:sequence>
<xs:element name="Cd" type="Instruction3Code" minOccurs="0" maxOccurs="1"/>
<xs:element name="InstrInf" type="Max140Text" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="LocalInstrument1Choice">
<xs:sequence>
<xs:choice>
<xs:element name="Cd" type="ExternalLocalInstrumentCode"/>
<xs:element name="Prtry" type="Max35Text"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="Max128Text">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="128"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Max140Text">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="140"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Max15NumericText">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{1,15}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Max16Text">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="16"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Max256Text">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="256"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Max34Text">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="34"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Max35Text">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="35"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Max3Text">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="3"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Max70Text">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="70"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="NameAndAddress3">
<xs:sequence>
<xs:element name="Nm" type="Max70Text"/>
<xs:element name="Adr" type="PostalAddress1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="NameAndAddress7">
<xs:sequence>
<xs:element name="Nm" type="Max70Text"/>
<xs:element name="PstlAdr" type="PostalAddress1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="OrganisationIdentification2">
<xs:sequence>
<xs:element name="BIC" type="BICIdentifier" minOccurs="0" maxOccurs="1"/>
<xs:element name="IBEI" type="IBEIIdentifier" minOccurs="0" maxOccurs="1"/>
<xs:element name="BEI" type="BEIIdentifier" minOccurs="0" maxOccurs="1"/>
<xs:element name="EANGLN" type="EANGLNIdentifier" minOccurs="0" maxOccurs="1"/>
<xs:element name="USCHU" type="CHIPSUniversalIdentifier" minOccurs="0" maxOccurs="1"/>
<xs:element name="DUNS" type="DunsIdentifier" minOccurs="0" maxOccurs="1"/>
<xs:element name="BkPtyId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="TaxIdNb" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="PrtryId" type="GenericIdentification3" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Party2Choice">
<xs:sequence>
<xs:choice>
<xs:element name="OrgId" type="OrganisationIdentification2"/>
<xs:element name="PrvtId" type="PersonIdentification3" minOccurs="1" maxOccurs="4"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PartyIdentification8">
<xs:sequence>
<xs:element name="Nm" type="Max70Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="PstlAdr" type="PostalAddress1" minOccurs="0" maxOccurs="1"/>
<xs:element name="Id" type="Party2Choice" minOccurs="0" maxOccurs="1"/>
<xs:element name="CtryOfRes" type="CountryCode" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="PaymentCategoryPurpose1Code">
<xs:restriction base="xs:string">
<xs:enumeration value="CORT"/>
<xs:enumeration value="SALA"/>
<xs:enumeration value="TREA"/>
<xs:enumeration value="CASH"/>
<xs:enumeration value="DIVI"/>
<xs:enumeration value="GOVT"/>
<xs:enumeration value="INTE"/>
<xs:enumeration value="LOAN"/>
<xs:enumeration value="PENS"/>
<xs:enumeration value="SECU"/>
<xs:enumeration value="SSBE"/>
<xs:enumeration value="SUPP"/>
<xs:enumeration value="TAXS"/>
<xs:enumeration value="TRAD"/>
<xs:enumeration value="VATX"/>
<xs:enumeration value="HEDG"/>
<xs:enumeration value="INTC"/>
<xs:enumeration value="WHLD"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="PaymentIdentification1">
<xs:sequence>
<xs:element name="InstrId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="EndToEndId" type="Max35Text"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PaymentInstructionInformation1">
<xs:sequence>
<xs:element name="PmtInfId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="PmtMtd" type="PaymentMethod3Code"/>
<xs:element name="PmtTpInf" type="PaymentTypeInformation1" minOccurs="0" maxOccurs="1"/>
<xs:element name="ReqdExctnDt" type="ISODate"/>
<xs:element name="PoolgAdjstmntDt" type="ISODate" minOccurs="0" maxOccurs="1"/>
<xs:element name="Dbtr" type="PartyIdentification8"/>
<xs:element name="DbtrAcct" type="CashAccount7"/>
<xs:element name="DbtrAgt" type="BranchAndFinancialInstitutionIdentification3"/>
<xs:element name="DbtrAgtAcct" type="CashAccount7" minOccurs="0" maxOccurs="1"/>
<xs:element name="UltmtDbtr" type="PartyIdentification8" minOccurs="0" maxOccurs="1"/>
<xs:element name="ChrgBr" type="ChargeBearerType1Code" minOccurs="0" maxOccurs="1"/>
<xs:element name="ChrgsAcct" type="CashAccount7" minOccurs="0" maxOccurs="1"/>
<xs:element name="ChrgsAcctAgt" type="BranchAndFinancialInstitutionIdentification3" minOccurs="0" maxOccurs="1"/>
<xs:element name="CdtTrfTxInf" type="CreditTransferTransactionInformation1" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="PaymentMethod3Code">
<xs:restriction base="xs:string">
<xs:enumeration value="CHK"/>
<xs:enumeration value="TRF"/>
<xs:enumeration value="TRA"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="PaymentTypeInformation1">
<xs:sequence>
<xs:element name="InstrPrty" type="Priority2Code" minOccurs="0" maxOccurs="1"/>
<xs:choice>
<xs:element name="SvcLvl" type="ServiceLevel2Choice" minOccurs="0" maxOccurs="1"/>
<xs:element name="ClrChanl" type="ClearingChannel2Code" minOccurs="0" maxOccurs="1"/>
</xs:choice>
<xs:element name="LclInstrm" type="LocalInstrument1Choice" minOccurs="0" maxOccurs="1"/>
<xs:element name="CtgyPurp" type="PaymentCategoryPurpose1Code" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="PercentageRate">
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="10"/>
<xs:totalDigits value="11"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="PersonIdentification3">
<xs:sequence>
<xs:choice>
<xs:element name="DrvrsLicNb" type="Max35Text"/>
<xs:element name="CstmrNb" type="Max35Text"/>
<xs:element name="SclSctyNb" type="Max35Text"/>
<xs:element name="AlnRegnNb" type="Max35Text"/>
<xs:element name="PsptNb" type="Max35Text"/>
<xs:element name="TaxIdNb" type="Max35Text"/>
<xs:element name="IdntyCardNb" type="Max35Text"/>
<xs:element name="MplyrIdNb" type="Max35Text"/>
<xs:element name="DtAndPlcOfBirth" type="DateAndPlaceOfBirth"/>
<xs:element name="OthrId" type="GenericIdentification4"/>
</xs:choice>
<xs:element name="Issr" type="Max35Text" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PostalAddress1">
<xs:sequence>
<xs:element name="AdrTp" type="AddressType2Code" minOccurs="0" maxOccurs="1"/>
<xs:element name="AdrLine" type="Max70Text" minOccurs="0" maxOccurs="5"/>
<xs:element name="StrtNm" type="Max70Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="BldgNb" type="Max16Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="PstCd" type="Max16Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="TwnNm" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="CtrySubDvsn" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="Ctry" type="CountryCode"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="Priority2Code">
<xs:restriction base="xs:string">
<xs:enumeration value="HIGH"/>
<xs:enumeration value="NORM"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="Purpose1Choice">
<xs:sequence>
<xs:choice>
<xs:element name="Cd" type="ExternalPurposeCode"/>
<xs:element name="Prtry" type="Max35Text"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ReferredDocumentAmount1Choice">
<xs:sequence>
<xs:choice>
<xs:element name="DuePyblAmt" type="CurrencyAndAmount"/>
<xs:element name="DscntApldAmt" type="CurrencyAndAmount"/>
<xs:element name="RmtdAmt" type="CurrencyAndAmount"/>
<xs:element name="CdtNoteAmt" type="CurrencyAndAmount"/>
<xs:element name="TaxAmt" type="CurrencyAndAmount"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ReferredDocumentInformation1">
<xs:sequence>
<xs:element name="RfrdDocTp" type="ReferredDocumentType1" minOccurs="0" maxOccurs="1"/>
<xs:element name="RfrdDocNb" type="Max35Text" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ReferredDocumentType1">
<xs:sequence>
<xs:choice>
<xs:element name="Cd" type="DocumentType2Code"/>
<xs:element name="Prtry" type="Max35Text"/>
</xs:choice>
<xs:element name="Issr" type="Max35Text" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="RegulatoryAuthority">
<xs:sequence>
<xs:element name="AuthrtyNm" type="Max70Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="AuthrtyCtry" type="CountryCode" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="RegulatoryReporting2">
<xs:sequence>
<xs:element name="DbtCdtRptgInd" type="RegulatoryReportingType1Code" minOccurs="0" maxOccurs="1"/>
<xs:element name="Authrty" type="RegulatoryAuthority" minOccurs="0" maxOccurs="1"/>
<xs:element name="RgltryDtls" type="StructuredRegulatoryReporting2" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="RegulatoryReportingType1Code">
<xs:restriction base="xs:string">
<xs:enumeration value="CRED"/>
<xs:enumeration value="DEBT"/>
<xs:enumeration value="BOTH"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="RemittanceInformation1">
<xs:sequence>
<xs:element name="Ustrd" type="Max140Text" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Strd" type="StructuredRemittanceInformation6" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="RemittanceLocation1">
<xs:sequence>
<xs:element name="RmtId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="RmtLctnMtd" type="RemittanceLocationMethod1Code" minOccurs="0" maxOccurs="1"/>
<xs:element name="RmtLctnElctrncAdr" type="Max256Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="RmtLctnPstlAdr" type="NameAndAddress3" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="RemittanceLocationMethod1Code">
<xs:restriction base="xs:string">
<xs:enumeration value="FAXI"/>
<xs:enumeration value="EDIC"/>
<xs:enumeration value="URID"/>
<xs:enumeration value="EMAL"/>
<xs:enumeration value="POST"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ServiceLevel1Code">
<xs:restriction base="xs:string">
<xs:enumeration value="SEPA"/>
<xs:enumeration value="SDVA"/>
<xs:enumeration value="PRPT"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ServiceLevel2Choice">
<xs:sequence>
<xs:choice>
<xs:element name="Cd" type="ServiceLevel1Code"/>
<xs:element name="Prtry" type="Max35Text"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:complexType name="SimpleIdentificationInformation2">
<xs:sequence>
<xs:element name="Id" type="Max34Text"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="StructuredRegulatoryReporting2">
<xs:sequence>
<xs:element name="Cd" type="Max3Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="Amt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
<xs:element name="Inf" type="Max35Text" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="StructuredRemittanceInformation6">
<xs:sequence>
<xs:element name="RfrdDocInf" type="ReferredDocumentInformation1" minOccurs="0" maxOccurs="1"/>
<xs:element name="RfrdDocRltdDt" type="ISODate" minOccurs="0" maxOccurs="1"/>
<xs:element name="RfrdDocAmt" type="ReferredDocumentAmount1Choice" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="CdtrRefInf" type="CreditorReferenceInformation1" minOccurs="0" maxOccurs="1"/>
<xs:element name="Invcr" type="PartyIdentification8" minOccurs="0" maxOccurs="1"/>
<xs:element name="Invcee" type="PartyIdentification8" minOccurs="0" maxOccurs="1"/>
<xs:element name="AddtlRmtInf" type="Max140Text" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="TaxDetails">
<xs:sequence>
<xs:element name="CertId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="TaxTp" type="TaxType" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="TaxInformation2">
<xs:sequence>
<xs:element name="CdtrTaxId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="CdtrTaxTp" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="DbtrTaxId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="TaxRefNb" type="Max140Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="TtlTaxblBaseAmt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
<xs:element name="TtlTaxAmt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
<xs:element name="TaxDt" type="ISODate" minOccurs="0" maxOccurs="1"/>
<xs:element name="TaxTpInf" type="TaxDetails" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="TaxType">
<xs:sequence>
<xs:element name="CtgyDesc" type="Max35Text" minOccurs="0" maxOccurs="1"/>
<xs:element name="Rate" type="PercentageRate" minOccurs="0" maxOccurs="1"/>
<xs:element name="TaxblBaseAmt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
<xs:element name="Amt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="UPICIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{8,17}"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="pain.001.001.02">
<xs:sequence>
<xs:element name="GrpHdr" type="GroupHeader1"/>
<xs:element name="PmtInf" type="PaymentInstructionInformation1" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>pain.001.001.02.xsd</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/xml</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>pain.001.001.02.xsd</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
##############################################################################
# coding: utf-8
# Copyright (c) 2021 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
import urlparse
import lxml.etree
from DateTime import DateTime
from erp5.component.test.testAccounting import AccountingTestCase
class TestPaymentTransactionGroupPaymentSEPA(AccountingTestCase):
def afterSetUp(self):
AccountingTestCase.afterSetUp(self)
self.login()
self.bank_account = self.section.newContent(
portal_type='Bank Account',
iban='FR76 3000 6000 0112 3456 7890 189',
bic_code='TESTXXXX',
price_currency_value=self.portal.currency_module.euro)
self.bank_account.validate()
if 'FR' not in self.portal.portal_categories.region.objectIds():
self.portal.portal_categories.region.newContent(
portal_type='Category',
id='FR',
title='France',
reference='FR',
)
def _createPTG(self):
ptg = self.portal.payment_transaction_group_module.newContent(
portal_type='Payment Transaction Group',
source_section_value=self.section,
source_payment_value=self.bank_account,
price_currency_value=self.portal.currency_module.euro,
stop_date=DateTime('2021/01/02 03:04:05 Europe/Paris'),
)
ptg.open()
account_module = self.account_module
invoice_1 = self._makeOne(
portal_type='Sale Invoice Transaction',
reference='INVOICE1'
)
supplier1 = self.portal.organisation_module.newContent(
portal_type='Organisation',
title='Supplier1',
default_address_street_address='1 rue des pommes\n3ème étage',
default_address_city='LILLE',
default_address_zip_code='59000',
default_address_region='FR',
)
bank_account_supplier1 = supplier1.newContent(
portal_type='Bank Account',
iban='FI1410093000123458',
bic_code='TESTXXXX'
)
bank_account_supplier1.validate()
self._makeOne(
portal_type='Payment Transaction',
simulation_state='delivered',
title='one',
reference='PT-1',
causality_value=invoice_1,
source_section_value=self.section,
source_payment_value=self.bank_account,
destination_section_value=supplier1,
destination_payment_value=bank_account_supplier1,
start_date=DateTime(2021, 1, 1),
lines=(
dict(
source_value=account_module.payable,
source_debit=100),
dict(
source_value=account_module.bank,
source_credit=100,
aggregate_value=ptg)))
supplier2 = self.portal.organisation_module.newContent(
portal_type='Organisation',
title='Supplier2'
)
bank_account_supplier2 = supplier2.newContent(
portal_type='Bank Account',
iban='CY21002001950000357001234567',
bic_code='TESTXXXX'
)
bank_account_supplier2.validate()
self._makeOne(
portal_type='Payment Transaction',
simulation_state='delivered',
title='two',
reference='PT-2',
destination_section_value=self.section,
destination_payment_value=self.bank_account,
source_section_value=supplier2,
source_payment_value=bank_account_supplier2,
start_date=DateTime(2021, 1, 1),
lines=(
dict(
destination_value=account_module.payable,
destination_debit=200),
dict(
destination_value=account_module.bank,
destination_credit=200,
aggregate_value=ptg)))
self.tic()
return ptg
def test_PaymentTransactionGroup_viewAsSEPACreditTransferPain_001_001_02(self):
ptg = self._createPTG()
pain = lxml.etree.fromstring(
getattr(ptg, 'PaymentTransactionGroup_viewAsSEPACreditTransferPain.001.001.02')().encode('utf-8'))
# this XML validates against the schema
xmlschema = lxml.etree.XMLSchema(
lxml.etree.fromstring(str(getattr(self.portal, 'pain.001.001.02.xsd').data)))
xmlschema.assertValid(pain)
self.assertEqual(
[node.text for node in pain.findall('.//{*}GrpHdr/{*}MsgId')],
[ptg.getSourceReference()],
)
self.assertEqual(
[node.text for node in pain.findall('.//{*}GrpHdr/{*}NbOfTxs')],
['2'],
)
self.assertEqual(
[node.text for node in pain.findall('.//{*}GrpHdr/{*}CtrlSum')],
['300.00'],
)
self.assertEqual(
[node.text for node in pain.findall('.//{*}CreDtTm')],
['2021-01-02T02:04:05+00:00'],
)
self.assertEqual(
[node.text for node in pain.findall('.//{*}InitgPty/{*}Nm')],
['My Organisation Inc.'],
)
self.assertEqual(
[node.text for node in pain.findall('.//{*}DbtrAcct/{*}Id/{*}IBAN')],
['FR7630006000011234567890189'],
)
self.assertEqual(
sorted([node.text for node in pain.findall('.//{*}CdtTrfTxInf/{*}CdtrAcct/{*}Id/{*}IBAN')]),
['CY21002001950000357001234567', 'FI1410093000123458'],
)
self.assertEqual(
sorted([node.text for node in pain.findall('.//{*}CdtTrfTxInf/{*}Amt/{*}InstdAmt')]),
['100.00', '200.00'],
)
self.assertEqual(
sorted([node.text for node in pain.findall('.//{*}CdtTrfTxInf/{*}Cdtr/{*}Nm')]),
['Supplier1', 'Supplier2'],
)
self.assertEqual(
[node.text for node in pain.findall('.//{*}CdtTrfTxInf/{*}Cdtr/{*}PstlAdr/{*}AdrLine')],
[u'1 rue des pommes', u'3ème étage', u'59000 LILLE'],
)
self.assertEqual(
sorted([node.text for node in pain.findall('.//{*}CdtTrfTxInf/{*}RmtInf/{*}Ustrd')]),
['INVOICE1 Supplier1', 'Supplier2'],
)
self.assertEqual(
sorted([node.text for node in pain.findall('.//{*}CdtTrfTxInf/{*}PmtId/{*}EndToEndId')]),
['PT-1', 'PT-2'],
)
def test_generate_sepa_credit_transfer_action(self):
ptg = self._createPTG()
ret = ptg.PaymentTransactionGroup_generateSEPACreditTransferFile(
version='pain.001.001.02')
self.assertEqual(
urlparse.parse_qs(urlparse.urlparse(ret).query)['portal_status_message'],
['SEPA Credit Transfer File generated.'])
self.tic()
f, = ptg.getFollowUpRelatedValueList(
portal_type='File',
)
self.assertEqual(f.getReference(), ptg.getSourceReference())
pain = lxml.etree.fromstring(f.getData())
xmlschema = lxml.etree.XMLSchema(
lxml.etree.fromstring(str(getattr(self.portal, 'pain.001.001.02.xsd').data)))
xmlschema.assertValid(pain)
self.assertEqual(
[node.text for node in pain.findall('.//{*}GrpHdr/{*}CtrlSum')],
['300.00'],
)
def test_generate_sepa_credit_transfer_refused_when_activities_are_pending(self):
ptg = self._createPTG()
ptg.PaymentTransactionGroup_selectPaymentTransactionLineList(
select_mode='stopped_or_delivered')
self.commit()
ret = ptg.PaymentTransactionGroup_generateSEPACreditTransferFile(
version='pain.001.001.02')
self.assertEqual(
urlparse.parse_qs(urlparse.urlparse(ret).query)['portal_status_message'],
['Some payments are still beeing processed in the background, please retry later'])
self.tic()
class TestSEPAConstraints(AccountingTestCase):
def afterSetUp(self):
AccountingTestCase.afterSetUp(self)
ti = self.portal.portal_types['Accounting Transaction Line']
ti.setTypePropertySheetList(
ti.getTypePropertySheetList() + ['AccountingTransactionLineSEPACreditTransferConstraint'])
if 'wire_transfer' not in self.portal.portal_categories.payment_mode.objectIds():
self.portal.portal_categories.payment_mode.newContent(
portal_type='Category',
id='wire_transfer',
title='Wire Transfer',
)
self.portal.portal_preferences.getActiveSystemPreference().setPreferredSepaCreditTransferPaymentMode('wire_transfer')
self.tic()
def beforeTearDown(self):
self.abort()
ti = self.portal.portal_types['Accounting Transaction Line']
ti.setTypePropertySheetList(
[ps for ps in ti.getTypePropertySheetList() if ps != 'AccountingTransactionLineSEPACreditTransferConstraint'])
self.commit()
def test_payment_transaction_constraint(self):
section_bank_account = self.section.newContent(
portal_type='Bank Account',
bic_code='X',
iban='FR76...',
)
section_bank_account.validate()
supplier = self.portal.organisation_module.newContent(
portal_type='Organisation',
)
supplier_bank_account = supplier.newContent(
portal_type='Bank Account',
)
payment_transaction = self._makeOne(
portal_type='Payment Transaction',
resource_value=self.currency_module.euro,
source_section_value=self.section,
source_payment_value=section_bank_account,
destination_section_value=supplier,
start_date=DateTime(2021, 1, 1),
lines=(
dict(
source_value=self.portal.account_module.payable,
source_debit=100),
dict(
source_value=self.portal.account_module.bank,
source_credit=100)))
self.assertEqual(
sorted([str(m.getMessage()) for m in payment_transaction.checkConsistency()]),
[],
)
payment_transaction.setPaymentModeValue(self.portal.portal_categories.payment_mode.wire_transfer)
self.assertEqual(
sorted([str(m.getMessage()) for m in payment_transaction.checkConsistency()]),
['Bank Accounts must be validated', 'Bank Accounts must have IBAN and BIC', ],
)
payment_transaction.setDestinationPaymentValue(supplier_bank_account)
supplier_bank_account.setBicCode('X')
supplier_bank_account.setIban('FR76...')
self.assertEqual(
sorted([str(m.getMessage()) for m in payment_transaction.checkConsistency()]),
['Bank Accounts must be validated', ],
)
supplier_bank_account.validate()
self.assertEqual(
sorted([str(m.getMessage()) for m in payment_transaction.checkConsistency()]),
[],
)
payment_transaction.setSourcePaymentValue(supplier_bank_account)
self.assertEqual(
sorted([str(m.getMessage()) for m in payment_transaction.checkConsistency()]),
['Bank Account must belong to Section', ],
)
payment_transaction.setSourcePaymentValue(section_bank_account)
self.assertEqual(
sorted([str(m.getMessage()) for m in payment_transaction.checkConsistency()]),
[],
)
payment_transaction.setDestinationPaymentValue(section_bank_account)
self.assertEqual(
sorted([str(m.getMessage()) for m in payment_transaction.checkConsistency()]),
['Bank Account must belong to Section', ],
)
payment_transaction.setDestinationPaymentValue(supplier_bank_account)
self.assertEqual(
sorted([str(m.getMessage()) for m in payment_transaction.checkConsistency()]),
[],
)
section_bank_account.setIban('')
self.assertEqual(
sorted([str(m.getMessage()) for m in payment_transaction.checkConsistency()]),
['Bank Accounts must have IBAN and BIC', ],
)
section_bank_account.invalidate()
self.assertEqual(
sorted([str(m.getMessage()) for m in payment_transaction.checkConsistency()]),
['Bank Accounts must be validated', 'Bank Accounts must have IBAN and BIC', ],
)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testPaymentTransactionGroupSEPA</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testPaymentTransactionGroupSEPA</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
erp5_payment_mean
erp5_ingestion
erp5_dms
\ No newline at end of file
Single Euro Payments Area (SEPA) support for payment transactions.
\ No newline at end of file
Payment Transaction Group | generate_sepa_credit_transfer
System Preference | payment_mean_sepa_preference
\ No newline at end of file
PaymentMeanSEPAPreference
AccountingTransactionLineSEPACreditTransferConstraint
\ No newline at end of file
erp5_payment_mean_sepa
\ No newline at end of file
test.erp5.testPaymentTransactionGroupSEPA
\ No newline at end of file
erp5_full_text_mroonga_catalog
erp5_accounting_ui_test
\ No newline at end of file
erp5_payment_mean_sepa
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Zuite" module="Products.Zelenium.zuite"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>payment_mean_zuite</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testPaymentTransactionGroupSelectPaymentsFastInput</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title tal:content="template/title_or_id"></title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3" tal:content="template/title_or_id"></td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanUiTest/macros/init" />
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanUiTest/macros/prepare_data" />
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanUiTest/macros/view_fast_input" />
<tr>
<td>assertSelected</td>
<td>field_your_sign</td>
<td>Outgoing</td>
</tr>
<!-- update dialog -->
<tr>
<td>clickAndWait</td>
<td>dialog_update_button</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>2 records</td>
</tr>
<!-- choose limit -->
<tr>
<td>type</td>
<td>//input[@name='field_your_select_limit']</td>
<td>1</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>dialog_update_button</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>1 records</td>
</tr>
<!-- choose dates -->
<tr>
<td>type</td>
<td>//input[@name='field_your_select_limit']</td>
<td>10</td>
</tr>
<tr>
<td>type</td>
<td>//input[@name='subfield_field_your_start_date_range_max_year']</td>
<td>2019</td>
</tr>
<tr>
<td>type</td>
<td>//input[@name='subfield_field_your_start_date_range_max_month']</td>
<td>10</td>
</tr>
<tr>
<td>type</td>
<td>//input[@name='subfield_field_your_start_date_range_max_day']</td>
<td>20</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>dialog_update_button</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>1 records</td>
</tr>
<!-- choose sign -->
<tr>
<td>select</td>
<td>field_your_sign</td>
<td>Incoming</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>dialog_update_button</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>1 records</td>
</tr>
<!-- select -->
<tr>
<td>clickAndWait</td>
<td>dialog_submit_button</td>
<td></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Payment selection in progress.</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${base_url}/payment_transaction_group_module/erp5_payment_mean_ui_test_payment_transaction_group</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>1 records</td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testPaymentTransactionGroupSelectPaymentsFastInputSearchByThirdPartyName</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title tal:content="template/title_or_id"></title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3" tal:content="template/title_or_id"></td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanUiTest/macros/init" />
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanUiTest/macros/prepare_data" />
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanUiTest/macros/view_fast_input" />
<!-- update dialog -->
<tr>
<td>clickAndWait</td>
<td>dialog_update_button</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>2 records</td>
</tr>
<!-- search -->
<tr>
<td>type</td>
<td>//table[contains(@class, "listbox")]//input[@name="listbox_Movement_getMirrorSectionTitle"]</td>
<td>erp5_payment_mean_ui_test_first_supplier</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>dialog_update_button</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>1 records</td>
</tr>
<!-- select -->
<tr>
<td>clickAndWait</td>
<td>dialog_submit_button</td>
<td></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Payment selection in progress.</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${base_url}/payment_transaction_group_module/erp5_payment_mean_ui_test_payment_transaction_group</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>1 records</td>
</tr>
<tr>
<td>assertText</td>
<td>//table[contains(@class, "listbox")]//tr[1]/td[5]</td>
<td>erp5_payment_mean_ui_test_first_supplier</td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testPaymentTransactionGroupSelectPaymentsFastInputSelectLines</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title tal:content="template/title_or_id"></title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3" tal:content="template/title_or_id"></td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanUiTest/macros/init" />
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanUiTest/macros/prepare_data" />
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanUiTest/macros/view_fast_input" />
<!-- update dialog -->
<tr>
<td>clickAndWait</td>
<td>dialog_update_button</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>2 records</td>
</tr>
<!-- select one line -->
<tr>
<td>click</td>
<td>//table[contains(@class, "listbox")]//tr[1]/td[1]/input</td>
<td></td>
</tr>
<!-- select -->
<tr>
<td>clickAndWait</td>
<td>dialog_submit_button</td>
<td></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Payment selection in progress.</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${base_url}/payment_transaction_group_module/erp5_payment_mean_ui_test_payment_transaction_group</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>1 records</td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testPaymentTransactionGroupSelectPlannedOrConfirmedPaymentsFastInput</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title tal:content="template/title_or_id"></title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3" tal:content="template/title_or_id"></td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanUiTest/macros/init" />
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanUiTest/macros/prepare_data" />
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanUiTest/macros/view_fast_input" />
<tr>
<td>assertSelected</td>
<td>field_your_select_mode</td>
<td>Select already Posted to General Ledger or Closed Payments</td>
</tr>
<!-- update dialog -->
<tr>
<td>select</td>
<td>field_your_select_mode</td>
<td>Select Planned or Confirmed Payments and Post them to General Ledger</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>dialog_update_button</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<!-- out of the 3, one is not consistent -->
<td>3 records</td>
</tr>
<!-- select -->
<tr>
<td>clickAndWait</td>
<td>dialog_submit_button</td>
<td></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Payment selection in progress.</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${base_url}/payment_transaction_group_module/erp5_payment_mean_ui_test_payment_transaction_group</td>
<td></td>
</tr>
<!-- the not consistent transaction was not selected, we selected and validated the two consistent ones -->
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>2 records</td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Posted to General Ledger</td>
<td></td>
</tr>
<!-- the not consistent transaction is left separately, there's a note in history explaining why it could not be selected -->
<tr>
<td>open</td>
<td>${base_url}/accounting_module/erp5_payment_mean_ui_test_confirmed_not_consistent_outgoing_payment/Base_viewHistory</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Transaction is not balanced for erp5_payment_mean_ui_test_organisation</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_payment_mean_ui_test</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
from DateTime import DateTime
portal = context.getPortalObject()
# validate rules ( see Products.ERP5Type.tests.ERP5TypeTestCase )
for rule in portal.portal_rules.contentValues():
if rule.getValidationState() != 'validated':
rule.validate()
# validate other documents used in this test
for document in (
portal.account_module.equity,
portal.account_module.bank,
portal.currency_module.euro, ):
if document.getValidationState() != 'validated':
document.validate()
organisation_id = "erp5_payment_mean_ui_test_organisation"
organisation = portal.organisation_module.newContent(
portal_type='Organisation',
id=organisation_id,
title=organisation_id,
group_value=portal.portal_categories.group.demo_group,
)
bank_account_id = "erp5_payment_mean_bank"
bank_account = organisation.newContent(
portal_type='Bank Account',
id=bank_account_id,
title=bank_account_id
)
payment_mean_id = "erp5_payment_mean_ui_test_payment_transaction_group"
payment_mean = portal.payment_transaction_group_module.newContent(
portal_type="Payment Transaction Group",
id=payment_mean_id,
title=payment_mean_id,
source_section_value=organisation,
source_payment_value=bank_account,
stop_date=DateTime('2019/10/21'),
price_currency_value=portal.currency_module.euro,
payment_mode_value=portal.portal_categories.payment_mode.cash,
payment_transaction_group_type_value=portal.portal_categories.payment_transaction_group_type.outgoing,
)
payment_mean.open()
first_supplier = portal.organisation_module.newContent(id="erp5_payment_mean_ui_test_first_supplier")
first_supplier.validate()
second_supplier = portal.organisation_module.newContent(id="erp5_payment_mean_ui_test_second_supplier")
second_supplier.validate()
for id_, supplier, date, resource_value, payment_mode_value, quantity, state, consistent in (
('erp5_payment_mean_ui_test_incoming_payment', first_supplier, DateTime('2019/10/20'), portal.currency_module.euro, portal.portal_categories.payment_mode.cash, -100, 'stopped', True),
('erp5_payment_mean_ui_test_outgoing_payment', first_supplier, DateTime('2019/10/20'), portal.currency_module.euro, portal.portal_categories.payment_mode.cash, 100, 'stopped', True),
('erp5_payment_mean_ui_test_second_outgoing_payment', second_supplier, DateTime('2019/10/21'), portal.currency_module.euro, portal.portal_categories.payment_mode.cash, 100, 'stopped', True),
('erp5_payment_mean_ui_test_planned_outgoing_payment', first_supplier, DateTime('2019/10/20'), portal.currency_module.euro, portal.portal_categories.payment_mode.cash, 100, 'planned', True),
('erp5_payment_mean_ui_test_confirmed_outgoing_payment', first_supplier, DateTime('2019/10/20'), portal.currency_module.euro, portal.portal_categories.payment_mode.cash, 100, 'confirmed', True),
('erp5_payment_mean_ui_test_confirmed_not_consistent_outgoing_payment', first_supplier, DateTime('2019/10/20'), portal.currency_module.euro, portal.portal_categories.payment_mode.cash, 100, 'confirmed', False),
('erp5_payment_mean_ui_test_wrong_payment_mode_outgoing_payment', first_supplier, DateTime('2019/10/20'), portal.currency_module.euro, portal.portal_categories.payment_mode.check, 100, 'stopped', True),
('erp5_payment_mean_ui_test_wrong_currency_outgoing_payment', first_supplier, DateTime('2019/10/20'), portal.currency_module.yen, portal.portal_categories.payment_mode.cash, 100, 'stopped', True),
):
payment = portal.accounting_module.newContent(
portal_type='Payment Transaction',
id=id_,
source_section_value=organisation,
source_payment_value=bank_account,
destination_section_value=supplier,
start_date=date,
resource_value=resource_value,
payment_mode_value=payment_mode_value,
specialise_value=portal.business_process_module.erp5_default_business_process,
)
payment.bank.edit(
source_value=portal.account_module.bank,
quantity=quantity
)
payment.receivable.edit(
source_value=portal.account_module.equity if consistent else None,
quantity=-quantity
)
if state == 'planned':
payment.plan()
elif state == 'confirmed':
payment.confirm()
elif state == 'stopped':
payment.stop()
else:
raise ValueError("unknown state", state)
return "Test Data Created."
<?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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_createPaymentMeanUiTestData</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
portal = context.getPortalObject()
for portal_type, document_id_list in (
('Organisation', (
'erp5_payment_mean_ui_test_organisation',
'erp5_payment_mean_ui_test_first_supplier',
'erp5_payment_mean_ui_test_second_supplier',),),
('Payment Transaction Group', ('erp5_payment_mean_ui_test_payment_transaction_group',),),
('Payment Transaction', (
'erp5_payment_mean_ui_test_incoming_payment',
'erp5_payment_mean_ui_test_outgoing_payment',
'erp5_payment_mean_ui_test_planned_outgoing_payment',
'erp5_payment_mean_ui_test_confirmed_outgoing_payment',
'erp5_payment_mean_ui_test_confirmed_not_consistent_outgoing_payment',
'erp5_payment_mean_ui_test_second_outgoing_payment',
'erp5_payment_mean_ui_test_wrong_payment_mode_outgoing_payment',
'erp5_payment_mean_ui_test_wrong_currency_outgoing_payment',),),
):
module = portal.getDefaultModule(portal_type)
for document_id in document_id_list:
if getattr(module, document_id, None) is not None:
module.manage_delObjects([document_id])
return "Deleted Successfully."
<?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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_deletePaymentMeanUiTestData</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
context.Zuite_setPreference('')
pref = context.portal_preferences.erp5_ui_test_preference
pref.setPreferredSourceCodeEditor('monaco')
return 'Set Payment Mean Preference Successfully.'
<?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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_setPaymentMeanUiTestPreference</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>description</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>text</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Common Template for PTZuite, it will reuse parts of the Listbox Zuite</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_viewCommonTemplatePaymentMeanUiTest</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<tal:block metal:define-macro="init">
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/portal_preferences/ERP5Site_setPaymentMeanUiTestPreference</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Set Payment Mean Preference Successfully.</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>${base_url}/web_site_module/renderjs_runner/#</td>
<td>renderjs_url</td>
</tr>
</tal:block>
<tal:block metal:define-macro="delete_data">
<tr>
<td colspan="3"><b>Delete Payment Mean Test Data</b></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/ERP5Site_deletePaymentMeanUiTestData</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Deleted Successfully.</td>
<td></td>
</tr>
<tr>
<td colspan="3"><p></p></td>
</tr>
</tal:block>
<tal:block metal:define-macro="prepare_data">
<tal:block metal:use-macro="here/Zuite_viewCommonTemplatePaymentMeanUiTest/macros/delete_data" />
<tr>
<td colspan="3"><b>Create Payment Mean Test Data</b></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/ERP5Site_createPaymentMeanUiTestData</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Test Data Created.</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td colspan="3"><p></p></td>
</tr>
</tal:block>
<tal:block metal:define-macro="view_fast_input">
<tr>
<td colspan="3"><b>Display the fast input</b></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/payment_transaction_group_module/erp5_payment_mean_ui_test_payment_transaction_group</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>select_action</td>
<td>Select Payments</td>
</tr>
<tr>
<td>assertText</td>
<td>dialog_submit_button</td>
<td>Select Payments</td>
</tr>
<tr>
<td>assertSelected</td>
<td>field_your_sign</td>
<td>Outgoing</td>
</tr>
<tr>
<td colspan="3"><p></p></td>
</tr>
</tal:block>
</tal:block>
\ No newline at end of file
##############################################################################
#
# Copyright (c) 2021 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from Products.ERP5Type.tests import ERP5TypeFunctionalTestCase
class TestFunctionalPaymentMean(ERP5TypeFunctionalTestCase.ERP5TypeFunctionalTestCase):
run_only = "payment_mean_zuite"
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testFunctionalPaymentMean</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testFunctionalPaymentMean</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Copyright (C) 2021 Nexedi SA
\ No newline at end of file
erp5_payment_mean
erp5_configurator_standard_accounting_template
erp5_configurator_standard_trade_template
erp5_configurator_standard_invoicing_template
erp5_configurator_standard_solver
erp5_accounting_ui_test
\ No newline at end of file
GPL
\ No newline at end of file
portal_tests/payment_mean_zuite
portal_tests/payment_mean_zuite/**
\ No newline at end of file
erp5_payment_mean_ui_test
\ No newline at end of file
test.erp5.testFunctionalPaymentMean
\ No newline at end of file
erp5_full_text_mroonga_catalog
\ No newline at end of file
erp5_payment_mean_ui_test
\ 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