Commit 35e7e566 authored by Aurel's avatar Aurel

remove uneeded stuff in workflow script

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7170 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent de828cc9
...@@ -75,36 +75,29 @@ transaction = state_change[\'object\']\n ...@@ -75,36 +75,29 @@ transaction = state_change[\'object\']\n
# user logged in\n # user logged in\n
user_id = transaction.portal_membership.getAuthenticatedMember().getUserName()\n user_id = transaction.portal_membership.getAuthenticatedMember().getUserName()\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
#context.log(\'validateVaultBalance site_list\',site_list)\n # context.log(\'validateVaultBalance site_list\',site_list)\n
source = transaction.getSource()\n source = transaction.getSource()\n
baobab_source = None\n baobab_source = None\n
for site in site_list:\n for site in site_list:\n
site_value = context.portal_categories.getCategoryValue(site)\n site_value = context.portal_categories.getCategoryValue(site)\n
if site_value.getVault().endswith(\'guichet\') and source in site:\n if site_value.getVaultType().endswith(\'guichet\') and source in site:\n
baobab_source = site\n baobab_source = site + \'/encaisse_des_billets_et_monnaies/sortante\'\n
break\n break\n
source = baobab_source\n source = baobab_source\n
source_object = context.portal_category.getCategoryValue(source)\n source_object = context.portal_categories.getCategoryValue(source)\n
#source_object = transaction.getSourceValue()\n
\n
site_list = context.ERP5Type_getSecurityCategoryFromAssignment((\'site\',),user_id,context,context.getPortalType())\n
context.log(\'CheckPayment_getBaobabSource site_list\',site_list)\n
for site in site_list:\n
site_value = context.portal_categories.getCategoryValue(site)\n
if site_value.getVault().endswith(\'guichet\') and source in site:\n
baobab_source = site\n
\n \n
# check again that we are in the good accounting date\n # check again that we are in the good accounting date\n
if not transaction.Baobab_checkCounterDateOpen(site=source_object, date=transaction.getStartDate()):\n if not transaction.Baobab_checkCounterDateOpen(site=source_object, date=transaction.getStartDate()):\n
msg = Message(domain = "ui", message="Transaction not in the good accounting date")\n msg = Message(domain = "ui", message="Transaction not in the good accounting date")\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
\n \n
resource = transaction.CashDelivery_checkCounterInventory(source = source, portal_type=\'Cash Delivery Line\')\n resource = transaction.CashDelivery_checkCounterInventory(source = source, portal_type=\'Cash Delivery Line\', same_source=1)\n
#transaction.log("call to CashDelivery_getCounterInventory return", resource)\n
\n \n
# Get price and total_price.\n # Get price and total_price.\n
price = transaction.getSourceTotalAssetPrice()\n price = transaction.getSourceTotalAssetPrice()\n
cash_detail = transaction.getTotalPrice(portal_type = \'Cash Delivery Cell\')\n cash_detail = transaction.getTotalPrice(portal_type = \'Cash Delivery Cell\')\n
\n #transaction.log("price vs cash detail", str((price, cash_detail)))\n
if resource == 3:\n if resource == 3:\n
msg = Message(domain="ui", message="No banknote or coin defined.")\n msg = Message(domain="ui", message="No banknote or coin defined.")\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment