diff --git a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_destruction_workflow/scripts/validateVaultBalance.xml b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_destruction_workflow/scripts/validateVaultBalance.xml index c32dbe0df53ad8cf8f4b9e5f9d1bdd2de600c51e..74f3bd532fa5eea15efd182193ed88fb96a88acc 100644 --- a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_destruction_workflow/scripts/validateVaultBalance.xml +++ b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_destruction_workflow/scripts/validateVaultBalance.xml @@ -90,21 +90,6 @@ if \'encaisse_des_externes\' in vault:\n msg = Message(domain="ui", message="Invalid Foreign Agency.")\n raise ValidationFailed, (msg,)\n \n -if "principale" not 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 \'encaisse_des_billets_retires_de_la_circulation\' in vault and \\\n - 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 @@ -113,6 +98,11 @@ if transaction.isDematerialization():\n msg = Message(domain="ui", message="Sorry, dematerialization is possible only with coins.")\n raise ValidationFailed, (msg,)\n \n + # Not possible from auxiliary agency\n + if \'auxiliaire\' in vault:\n + msg = Message(domain="ui", message="You can\'t do this operation on auxiliary site.")\n + raise ValidationFailed, (msg,)\n + \n # Also we must make sure that the source_section is defined\n source_section = transaction.getSourceSection()\n if source_section is None:\n @@ -126,7 +116,23 @@ if transaction.isDematerialization():\n if source_section in source_object.getPath():\n msg = Message(domain="ui", message="You can\'t used this site.")\n raise ValidationFailed, (msg,)\n - \n +# Check specific for auxiliary agencies\n +elif "principale" not 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 \'encaisse_des_billets_retires_de_la_circulation\' in vault and \\\n + 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 \n # Get price and total_price.\n amount = transaction.getSourceTotalAssetPrice()\n @@ -201,11 +207,11 @@ elif resource <> 0 :\n <string>msg</string> <string>source_section</string> <string>None</string> + <string>_getiter_</string> + <string>line</string> <string>site</string> <string>source_country</string> <string>site_country</string> - <string>_getiter_</string> - <string>line</string> <string>amount</string> <string>total_price</string> <string>resource</string> diff --git a/bt5/erp5_banking_cash/bt/revision b/bt5/erp5_banking_cash/bt/revision index f874bfc9fc8e538830cba7dee0812429b50ab4c0..7383593264266047971edd4d66abb1edfbe8b204 100644 --- a/bt5/erp5_banking_cash/bt/revision +++ b/bt5/erp5_banking_cash/bt/revision @@ -1 +1 @@ -651 \ No newline at end of file +652 \ No newline at end of file