diff --git a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_balance_regulation_workflow/scripts/validateVaultBalance.xml b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_balance_regulation_workflow/scripts/validateVaultBalance.xml index e7e3ed721674a2ef7365a72371c9fe83bfe4b9fc..44893898de0ce15f51fa9546f6c76d0202fcf188 100644 --- a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_balance_regulation_workflow/scripts/validateVaultBalance.xml +++ b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_balance_regulation_workflow/scripts/validateVaultBalance.xml @@ -73,7 +73,8 @@ transaction = state_change[\'object\']\n vault = transaction.getSource()\n \n \n -if not(vault.endswith(\'encaisse_des_billets_et_monnaies\') or vault.endswith(\'encaisse_des_externes\')):\n +if not (vault.endswith(\'encaisse_des_billets_et_monnaies\') or vault.endswith(\'encaisse_des_externes\')or \\\n + \'encaisse_des_devises\' in vault) :\n msg = Message(domain="ui", message="Invalid source.")\n raise ValidationFailed, (msg,)\n \n @@ -85,6 +86,14 @@ if vault.endswith(\'encaisse_des_externes\'):\n msg = Message(domain="ui", message="You must not select the local emission letter.")\n raise ValidationFailed, (msg,)\n \n +# check resource between line and document\n +doc_resource = transaction.getResource()\n +for line in transaction.contentValues(portal_type=[\'Outgoing Cash Balance Regulation Line\',\n + \'Incoming Cash Balance Regulation Line\']):\n + if line.getResourceValue().getPriceCurrency() != doc_resource:\n + msg = Message(domain="ui", message="Resource defined on document is different from input cash.")\n + raise ValidationFailed, (msg,)\n +\n # check again that we are in the good accounting date\n transaction.Baobab_checkCounterDateOpen(site=vault, date=transaction.getStartDate())\n \n @@ -181,6 +190,7 @@ if incoming_total != outgoing_total:\n <string>site_emission_letter</string> <string>_getiter_</string> <string>line</string> + <string>doc_resource</string> <string>resource_one</string> <string>resource_two</string> <string>amount</string> diff --git a/bt5/erp5_banking_cash/bt/revision b/bt5/erp5_banking_cash/bt/revision index e88ff725aa658875592c48db3d8326e3c495477e..fb4abc5b58afe044458d57c1aa764b5f5d5b0311 100644 --- a/bt5/erp5_banking_cash/bt/revision +++ b/bt5/erp5_banking_cash/bt/revision @@ -1 +1 @@ -602 \ No newline at end of file +603 \ No newline at end of file