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

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Nov 12 14:29:59 CET 2008


Author: aurel
Date: Wed Nov 12 14:29:52 2008
New Revision: 24558

URL: http://svn.erp5.org?rev=24558&view=rev
Log:
when doing a destruction from an auxiliary agency, site than can be selected depends on the vault

Modified:
    erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_destruction_workflow/scripts/validateVaultBalance.xml
    erp5/trunk/bt5/erp5_banking_cash/bt/revision

Modified: erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_destruction_workflow/scripts/validateVaultBalance.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_destruction_workflow/scripts/validateVaultBalance.xml?rev=24558&r1=24557&r2=24558&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_destruction_workflow/scripts/validateVaultBalance.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_destruction_workflow/scripts/validateVaultBalance.xml [utf8] Wed Nov 12 14:29:52 2008
@@ -90,11 +90,21 @@
      msg = Message(domain="ui", message="Invalid Foreign Agency.")\n
      raise ValidationFailed, (msg,)\n
 \n
-if "auxiliaire" in vault and transaction.getSourceSection() in (None, ""):\n
-   msg = Message(domain="ui", message="You must select a foreign agency.")\n
-   raise ValidationFailed, (msg,)\n
-\n
-\n
+if "auxiliaire" in vault:\n
+  site = transaction.getSourceSection()\n
+  if site  in (None, ""):\n
+    msg = Message(domain="ui", message="You must select a foreign agency.")\n
+    raise ValidationFailed, (msg,)\n
+  source_country  = transaction.Baobab_getCountryForSite(transaction.getSource())\n
+  site_country = transaction.Baobab_getCountryForSite(site)\n
+  if \'encaisse_des_externes\' in vault and \\\n
+         site_country == source_country:\n
+    msg = Message(domain="ui", message="You must select an agency from a foreign country.")    \n
+    raise ValidationFailed, (msg,)\n
+  elif site_country == source_country:    \n
+    msg = Message(domain="ui", message="You must select an agency from the same country.")    \n
+    raise ValidationFailed, (msg,)\n
+ \n
 # In case of dematerialization, we must have only coins\n
 if transaction.isDematerialization():\n
   for line in transaction.objectValues(portal_type=\'Monetary Destruction Line\'):\n
@@ -120,7 +130,7 @@
 # Get price and total_price.\n
 amount = transaction.getSourceTotalAssetPrice()\n
 total_price = transaction.getTotalPrice(portal_type=[\'Monetary Destruction Line\',\'Monetary Destruction Cell\'],fast=0)\n
-resource = transaction.CashDelivery_checkCounterInventory(source=source_object.getPath(), portal_type=\'Monetary Destruction Line\')\n
+resource = transaction.CashDelivery_checkCounterInventory(source=source_object.getRelativeUrl(), portal_type=\'Monetary Destruction Line\')\n
 \n
 if resource == 2:\n
   msg = Message(domain="ui", message="No Resource.")\n
@@ -190,6 +200,9 @@
                             <string>msg</string>
                             <string>source_section</string>
                             <string>None</string>
+                            <string>site</string>
+                            <string>source_country</string>
+                            <string>site_country</string>
                             <string>_getiter_</string>
                             <string>line</string>
                             <string>amount</string>

Modified: erp5/trunk/bt5/erp5_banking_cash/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/bt/revision?rev=24558&r1=24557&r2=24558&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_cash/bt/revision [utf8] Wed Nov 12 14:29:52 2008
@@ -1,1 +1,1 @@
-646
+647




More information about the Erp5-report mailing list