[Erp5-report] r8562 - /erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflo...
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Jul 19 13:24:46 CEST 2006
Author: aurel
Date: Wed Jul 19 13:24:44 2006
New Revision: 8562
URL: http://svn.erp5.org?rev=8562&view=rev
Log:
check that counter date and couter are open to do a usual cahs transfer
Modified:
erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/usual_cash_transfer_workflow/scripts/validateVaultBalance.xml
Modified: erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/usual_cash_transfer_workflow/scripts/validateVaultBalance.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/usual_cash_transfer_workflow/scripts/validateVaultBalance.xml?rev=8562&r1=8561&r2=8562&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/usual_cash_transfer_workflow/scripts/validateVaultBalance.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/usual_cash_transfer_workflow/scripts/validateVaultBalance.xml Wed Jul 19 13:24:44 2006
@@ -74,8 +74,21 @@
from Products.ERP5Type.Message import Message\n
\n
transaction = state_change.object\n
+vault = transaction.getSource()\n
+date = transaction.getStartDate()\n
\n
-vault = transaction.getSource()\n
+# check we are in an opened accounting day\n
+if not transaction.Baobab_checkCounterDateOpen(site=vault, date=date):\n
+ msg = Message(domain = "ui", message="Counter Date is not opened")\n
+ raise ValidationFailed, (msg,)\n
+\n
+# check counter is opened\n
+site = transaction.getDestinationValue()\n
+if not context.Baobab_checkCounterOpened(site):\n
+ msg = Message(domain = "ui", message="Counter is not opened")\n
+ raise ValidationFailed, (msg,)\n
+\n
+\n
resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Cash Delivery Line\')\n
\n
# Get price and total_price.\n
@@ -147,10 +160,13 @@
<string>_getattr_</string>
<string>transaction</string>
<string>vault</string>
+ <string>date</string>
+ <string>msg</string>
+ <string>site</string>
+ <string>context</string>
<string>resource</string>
<string>amount</string>
<string>total_price</string>
- <string>msg</string>
</tuple>
</value>
</item>
More information about the Erp5-report
mailing list