[Erp5-report] r17017 - in /erp5/trunk/bt5/erp5_banking_cash: WorkflowTemplateItem/portal_wo...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Oct 16 10:31:58 CEST 2007


Author: aurel
Date: Tue Oct 16 10:31:58 2007
New Revision: 17017

URL: http://svn.erp5.org?rev=17017&view=rev
Log:
check resource is the same between document and lines

Modified:
    erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_to_currency_purchase_workflow/scripts/validateVaultBalance.xml
    erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_reception_workflow/scripts/checkDestination.xml
    erp5/trunk/bt5/erp5_banking_cash/bt/revision

Modified: erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_to_currency_purchase_workflow/scripts/validateVaultBalance.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_to_currency_purchase_workflow/scripts/validateVaultBalance.xml?rev=17017&r1=17016&r2=17017&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_to_currency_purchase_workflow/scripts/validateVaultBalance.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_to_currency_purchase_workflow/scripts/validateVaultBalance.xml Tue Oct 16 10:31:58 2007
@@ -75,9 +75,9 @@
 encaisse_billets_et_monnaies = "/encaisse_des_billets_et_monnaies/sortante"\n
 \n
 \n
-var_ressource_title = transaction.getResourceTitle().lower()\n
-var_ressource_title = var_ressource_title.replace(" ", "_")\n
-encaisse_devise = "/encaisse_des_devises/%s/entrante" %(var_ressource_title)\n
+ressource_title = transaction.getResourceTitle().lower()\n
+ressource_title = ressource_title.replace(" ", "_")\n
+encaisse_devise = "/encaisse_des_devises/%s/entrante" %(ressource_title)\n
 \n
 #encaisse_devise = "/encaisse_des_devises/%s/entrante" %(transaction.getResourceTitle().lower())\n
 \n
@@ -106,8 +106,12 @@
 fix_montant = transaction.getDiscount()\n
 pourcentage = transaction.getDiscountRatio()\n
 \n
-\n
-\n
+# check resource on incoming line\n
+doc_resource = transaction.getResource()\n
+for line in transaction.contentValues(portal_type="Incoming Cash To Currency Purchase Line"):\n
+  if line.getResource() != doc_resource:\n
+    msg = Message(domain="ui", message="Resource defined on document is different from input cash.")\n
+    raise ValidationFailed, (msg,)\n
 \n
 resource_two = transaction.CashDelivery_checkCounterInventory(outgoing_source,portal_type=\'Outgoing Cash To Currency Purchase Line\')\n
 \n
@@ -190,7 +194,7 @@
                             <string>_getattr_</string>
                             <string>currency</string>
                             <string>encaisse_billets_et_monnaies</string>
-                            <string>var_ressource_title</string>
+                            <string>ressource_title</string>
                             <string>encaisse_devise</string>
                             <string>counter_site</string>
                             <string>incoming_destination</string>
@@ -201,6 +205,9 @@
                             <string>msg</string>
                             <string>fix_montant</string>
                             <string>pourcentage</string>
+                            <string>doc_resource</string>
+                            <string>_getiter_</string>
+                            <string>line</string>
                             <string>resource_two</string>
                             <string>billetage_entre</string>
                             <string>billetage_sorti</string>

Modified: erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_reception_workflow/scripts/checkDestination.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_reception_workflow/scripts/checkDestination.xml?rev=17017&r1=17016&r2=17017&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_reception_workflow/scripts/checkDestination.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_reception_workflow/scripts/checkDestination.xml Tue Oct 16 10:31:58 2007
@@ -83,7 +83,7 @@
   raise ValidationFailed, (msg,)\n
        \n
 dest = object.getDestinationValue()\n
-if \'encaisse_des_billets_retires_de_la_circulation\' in dest.getRelativeUrl():\n
+if dest is None or \'encaisse_des_billets_retires_de_la_circulation\' in dest.getRelativeUrl():\n
   msg = Message(domain="ui", message="Wrong Destination Selected.")\n
   raise ValidationFailed, (msg,)\n
 \n
@@ -154,6 +154,7 @@
                             <string>len</string>
                             <string>msg</string>
                             <string>dest</string>
+                            <string>None</string>
                             <string>first_movement</string>
                             <string>line_letter</string>
                           </tuple>

Modified: erp5/trunk/bt5/erp5_banking_cash/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/bt/revision?rev=17017&r1=17016&r2=17017&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/bt/revision (original)
+++ erp5/trunk/bt5/erp5_banking_cash/bt/revision Tue Oct 16 10:31:58 2007
@@ -1,1 +1,1 @@
-521
+522




More information about the Erp5-report mailing list