Commit e0caf6c3 authored by Sebastien Robin's avatar Sebastien Robin

make sure that the we will take into accont new stock value with account incident

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12153 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e5a67614
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: cell.getTotalPrice(deliveryLineType=\'Incoming Account Incident Line\')</string> </value> <value> <string>python: cell.getTotalPrice(deliveryLineType=\'Outgoing Account Incident Line\')</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: cell.getTotalPrice(deliveryLineType=\'Outgoing Account Incident Line\')</string> </value> <value> <string>python: cell.getTotalPrice(deliveryLineType=\'Incoming Account Incident Line\')</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># first get the source of the document,\n
# we will need to add the counter\n
source = context.getSource()\n
baobab_source = None\n
context.log(\'baobab_source\', baobab_source)\n
# Get the history of the workflow\n
user_id=\'None\'\n
context.log(\'workflow_item_list:\',context.Base_getWorkflowHistoryItemList(\'check_payment_workflow\',display=0))\n
for workflow_item in context.Base_getWorkflowHistoryItemList(\'check_payment_workflow\',display=0):\n
context.log(\'workflow_item.getProperty(action)\',workflow_item.getProperty(\'action\'))\n
if workflow_item.getProperty(\'action\')==\'deliver_action\':\n
user_id=workflow_item.getProperty(\'actor\')\n
context.log(\'user_id\',user_id)\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
context.log(\'CheckPayment_getBaobabSource site_list\',site_list)\n
for site in site_list:\n
site_value = context.portal_categories.getCategoryValue(site)\n
context.log(\'site\', site)\n
if site_value.getVaultType().endswith(\'guichet\') and source in site:\n
baobab_source = site + \'/encaisse_des_billets_et_monnaies/sortante\'\n
break\n
context.log(\'baobab_source\', baobab_source)\n
\n
\n
context.log(\'baobab_source\', baobab_source)\n
return baobab_source\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>source</string>
<string>None</string>
<string>baobab_source</string>
<string>user_id</string>
<string>_getiter_</string>
<string>workflow_item</string>
<string>site_list</string>
<string>site</string>
<string>site_value</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountIncident_getBaobabSource</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -70,6 +70,13 @@ ...@@ -70,6 +70,13 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>user_site = context.Baobab_getUserAssignedRootSiteList()[0]\n <value> <string>user_site = context.Baobab_getUserAssignedRootSiteList()[0]\n
context.edit(source=user_site)\n context.edit(source=user_site)\n
transaction = context\n
\n
movement = transaction.newContent(portal_type=\'Banking Operation Line\',\n
id=\'movement\',\n
source=\'account_module/bank_account\', # Set default source\n
destination=\'account_module/bank_account\', # Set default destination\n
)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -124,6 +131,8 @@ context.edit(source=user_site)\n ...@@ -124,6 +131,8 @@ context.edit(source=user_site)\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>user_site</string> <string>user_site</string>
<string>transaction</string>
<string>movement</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>total = 0\n
for line in context.objectValues(portal_type = context.getPortalAccountingMovementTypeList()) :\n
total += line.getSourceCredit()\n
\n
return total\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>total</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>line</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountIncident_statSourceCredit</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>total = 0\n
for line in context.objectValues(portal_type = context.getPortalAccountingMovementTypeList()) :\n
total += line.getSourceDebit()\n
\n
return total\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>total</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>line</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountIncident_statSourceDebit</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
\n \n
cash_detail_dict = {\'line_portal_type\' : \'Outgoing Account Incident Line\'\n cash_detail_dict = {\'line_portal_type\' : \'Outgoing Account Incident Line\'\n
, \'operation_currency\' : context.Baobab_getPortalReferenceCurrencyID()\n , \'operation_currency\' : context.Baobab_getPortalReferenceCurrencyID()\n
, \'cash_status_list\' : [\'to_sort\']\n , \'cash_status_list\' : [\'valid\',\'new_emitted\']\n
, \'emission_letter_list\' : None\n , \'emission_letter_list\' : None\n
, \'variation_list\' : context.Baobab_getResourceVintageList(banknote=1, coin=1)\n , \'variation_list\' : context.Baobab_getResourceVintageList(banknote=1, coin=1)\n
, \'currency_cash_portal_type\': None\n , \'currency_cash_portal_type\': None\n
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>return "%s/surface/salle_tri/encaisse_des_differences" %(context.getSource(),)\n <value> <string>return "%s/surface/caisse_courante/encaisse_des_billets_et_monnaies" %(context.getSource(),)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -197,7 +197,7 @@ def split_head(CD_file_line_list):\n ...@@ -197,7 +197,7 @@ def split_head(CD_file_line_list):\n
\'/\' + head_start_date_string[0:2] + \' 0:0am\'\n \'/\' + head_start_date_string[0:2] + \' 0:0am\'\n
head_start_date = DateTime(head_start_date_string )\n head_start_date = DateTime(head_start_date_string )\n
except:\n except:\n
return {\'error\':True, \'message\':"message_dict[\'01\']", \'head_dict\':{}}\n return {\'error\':True, \'message\':message_dict[\'01\'], \'head_dict\':{}}\n
#\n #\n
\n \n
head_resource_string = (head_resource_string or \'\').strip()\n head_resource_string = (head_resource_string or \'\').strip()\n
......
...@@ -71,20 +71,24 @@ ...@@ -71,20 +71,24 @@
<value> <string>destination = context.getDestination()\n <value> <string>destination = context.getDestination()\n
baobab_destination = None\n baobab_destination = None\n
# Get the history of the workflow\n # Get the history of the workflow\n
user_id=None\n if destination is not None:\n
for workflow_item in context.Base_getWorkflowHistoryItemList(\'money_deposit_workflow\',display=0):\n user_id=None\n
if workflow_item.getProperty(\'action\')==\'deliver_action\':\n for workflow_item in context.Base_getWorkflowHistoryItemList(\'money_deposit_workflow\',display=0):\n
user_id=workflow_item.getProperty(\'actor\')\n if workflow_item.getProperty(\'action\')==\'deliver_action\':\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n user_id=workflow_item.getProperty(\'actor\')\n
for site in site_list:\n site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
site_value = context.portal_categories.getCategoryValue(site)\n context.log(\'MoneyDeposit_getBaobabDestination, site_list\',site_list)\n
if site_value.getVaultType().endswith(\'guichet\') and destination in site:\n for site in site_list:\n
baobab_destination = site + \'/encaisse_des_billets_et_monnaies/entrante\'\n site_value = context.portal_categories.getCategoryValue(site)\n
break\n context.log(\'MoneyDeposit_getBaobabDestination, destination\',destination)\n
if user_id is not None and baobab_destination is None:\n context.log(\'MoneyDeposit_getBaobabDestination, site\',site)\n
from Products.ERP5Type.Message import Message\n if site_value.getVaultType().endswith(\'guichet\') and destination in site:\n
message = Message(domain="ui", message="The owner is not assigned to the right vault.")\n baobab_destination = site + \'/encaisse_des_billets_et_monnaies/entrante\'\n
raise ValueError,message\n break\n
if user_id is not None and baobab_destination is None:\n
from Products.ERP5Type.Message import Message\n
message = Message(domain="ui", message="The owner is not assigned to the right vault.")\n
raise ValueError,message\n
return baobab_destination\n return baobab_destination\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>return "%s/surface/salle_tri/encaisse_des_differences" %(context.getSource(),)\n <value> <string>return "%s/surface/caisse_courante/encaisse_des_billets_et_monnaies" %(context.getSource(),)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -75,9 +75,29 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed\n ...@@ -75,9 +75,29 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import Message\n
\n \n
txn = state_change[\'object\']\n txn = state_change[\'object\']\n
\n
user_id = txn.portal_membership.getAuthenticatedMember().getUserName()\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
# context.log(\'validateVaultBalance site_list\',site_list)\n
source = txn.getSource()\n
baobab_source = None\n
for site in site_list:\n
site_value = context.portal_categories.getCategoryValue(site)\n
if site_value.getVaultType().endswith(\'guichet\') and source in site:\n
baobab_source = site + \'/encaisse_des_billets_et_monnaies/entrante\'\n
break\n
source = baobab_source\n
source_object = context.portal_categories.getCategoryValue(source)\n
\n
# check again that we are in the good accounting date\n
if not txn.Baobab_checkCounterDateOpen(site=source_object, date=txn.getStartDate()):\n
msg = Message(domain = "ui", message="Transaction not in the good accounting date")\n
raise ValidationFailed, (msg,)\n
\n
\n
in_list = txn.objectValues(portal_type=\'Incoming Account Incident Line\')\n in_list = txn.objectValues(portal_type=\'Incoming Account Incident Line\')\n
out_list = txn.objectValues(portal_type=\'Outgoing Account Incident Line\')\n out_list = txn.objectValues(portal_type=\'Outgoing Account Incident Line\')\n
vault = "%s/surface/salle_tri/encaisse_des_differences" %(txn.getSource(),)\n vault = "%s/surface/caisse_courante/encaisse_des_billets_et_monnaies" %(txn.getSource(),)\n
price = txn.getSourceTotalAssetPrice()\n price = txn.getSourceTotalAssetPrice()\n
in_price = txn.getTotalPrice(portal_type=[\'Incoming Account Incident Line\',\'Cash Delivery Cell\'],fast=0)\n in_price = txn.getTotalPrice(portal_type=[\'Incoming Account Incident Line\',\'Cash Delivery Cell\'],fast=0)\n
out_price = txn.getTotalPrice(portal_type=[\'Outgoing Account Incident Line\',\'Cash Delivery Cell\'],fast=0)\n out_price = txn.getTotalPrice(portal_type=[\'Outgoing Account Incident Line\',\'Cash Delivery Cell\'],fast=0)\n
...@@ -149,6 +169,17 @@ elif (in_price != 0 and in_price != price) or (out_price != 0 and out_price != p ...@@ -149,6 +169,17 @@ elif (in_price != 0 and in_price != price) or (out_price != 0 and out_price != p
<string>_getitem_</string> <string>_getitem_</string>
<string>txn</string> <string>txn</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>user_id</string>
<string>context</string>
<string>site_list</string>
<string>source</string>
<string>None</string>
<string>baobab_source</string>
<string>_getiter_</string>
<string>site</string>
<string>site_value</string>
<string>source_object</string>
<string>msg</string>
<string>in_list</string> <string>in_list</string>
<string>out_list</string> <string>out_list</string>
<string>vault</string> <string>vault</string>
...@@ -156,7 +187,6 @@ elif (in_price != 0 and in_price != price) or (out_price != 0 and out_price != p ...@@ -156,7 +187,6 @@ elif (in_price != 0 and in_price != price) or (out_price != 0 and out_price != p
<string>in_price</string> <string>in_price</string>
<string>out_price</string> <string>out_price</string>
<string>len</string> <string>len</string>
<string>msg</string>
<string>resource</string> <string>resource</string>
</tuple> </tuple>
</value> </value>
......
...@@ -73,12 +73,15 @@ bank_account = transaction.getDestinationPaymentValue()\n ...@@ -73,12 +73,15 @@ bank_account = transaction.getDestinationPaymentValue()\n
price = transaction.getSourceTotalAssetPrice()\n price = transaction.getSourceTotalAssetPrice()\n
line = transaction.get(\'movement\')\n line = transaction.get(\'movement\')\n
\n \n
if (): \n in_list = transaction.objectValues(portal_type=\'Incoming Account Incident Line\')\n
out_list = transaction.objectValues(portal_type=\'Outgoing Account Incident Line\')\n
\n
if (len(in_list)!= 0): \n
if line is not None and line.getPortalType() == \'Banking Operation Line\':\n if line is not None and line.getPortalType() == \'Banking Operation Line\':\n
# This is a single currency operation, so it is not necessary to convert the price.\n # This is a single currency operation, so it is not necessary to convert the price.\n
line.setSourceCredit(price)\n line.setSourceCredit(price)\n
\n \n
elif () :\n elif (len(out_list) != 0) :\n
line = transaction.get(\'movement\')\n line = transaction.get(\'movement\')\n
if line is not None and line.getPortalType() == \'Banking Operation Line\':\n if line is not None and line.getPortalType() == \'Banking Operation Line\':\n
# This is a single currency operation, so it is not necessary to convert the price.\n # This is a single currency operation, so it is not necessary to convert the price.\n
...@@ -146,6 +149,9 @@ elif () :\n ...@@ -146,6 +149,9 @@ elif () :\n
<string>bank_account</string> <string>bank_account</string>
<string>price</string> <string>price</string>
<string>line</string> <string>line</string>
<string>in_list</string>
<string>out_list</string>
<string>len</string>
<string>None</string> <string>None</string>
</tuple> </tuple>
</value> </value>
......
...@@ -18,31 +18,28 @@ ...@@ -18,31 +18,28 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>planned</string> </value> <value> <string>cancelled</string> </value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Sent to validation</string> </value> <value> <string>Cancelled</string> </value>
</item> </item>
<item> <item>
<key> <string>transitions</string> </key> <key> <string>transitions</string> </key>
<value> <value>
<tuple> <tuple/>
<string>archive</string>
<string>archive_action</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -54,62 +51,4 @@ ...@@ -54,62 +51,4 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary>
<item>
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Add portal content</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -18,23 +18,23 @@ ...@@ -18,23 +18,23 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>archived</string> </value> <value> <string>confirmed</string> </value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Delivered</string> </value> <value> <string>Confirmed</string> </value>
</item> </item>
<item> <item>
<key> <string>transitions</string> </key> <key> <string>transitions</string> </key>
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
<tuple> <tuple>
<string>cancel</string> <string>cancel</string>
<string>cancel_action</string> <string>cancel_action</string>
<string>deliver</string>
<string>deliver_action</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -54,64 +56,4 @@ ...@@ -54,64 +56,4 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary>
<item>
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Add portal content</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.States</string>
<string>StateDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>delivered</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Delivered</string> </value>
</item>
<item>
<key> <string>transitions</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_list</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -40,8 +40,10 @@ ...@@ -40,8 +40,10 @@
<key> <string>transitions</string> </key> <key> <string>transitions</string> </key>
<value> <value>
<tuple> <tuple>
<string>plan</string> <string>cancel</string>
<string>plan_action</string> <string>cancel_action</string>
<string>confirm</string>
<string>confirm_action</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -18,6 +18,12 @@ ...@@ -18,6 +18,12 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value> <value> <string>workflow</string> </value>
...@@ -46,11 +52,11 @@ ...@@ -46,11 +52,11 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>plan</string> </value> <value> <string>cancel</string> </value>
</item> </item>
<item> <item>
<key> <string>new_state_id</string> </key> <key> <string>new_state_id</string> </key>
<value> <string>planned</string> </value> <value> <string>cancelled</string> </value>
</item> </item>
<item> <item>
<key> <string>script_name</string> </key> <key> <string>script_name</string> </key>
...@@ -58,7 +64,7 @@ ...@@ -58,7 +64,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Send To Validation</string> </value> <value> <string>Cancel</string> </value>
</item> </item>
<item> <item>
<key> <string>trigger_type</string> </key> <key> <string>trigger_type</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Transitions</string>
<string>TransitionDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Cancel</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string>%(content_url)s/BaseWorkflow_viewWorkflowActionDialog?workflow_action=cancel_action</string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string>cancel</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>cancel_action</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Cancel</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Guard</string>
<string>Guard</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Manager</string>
<string>Assignor</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Transitions</string>
<string>TransitionDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string>updateBankingOperation</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>confirm</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string>confirmed</string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Send To Validation</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Guard</string>
<string>Guard</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Manager</string>
<string>Assignor</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -18,6 +18,12 @@ ...@@ -18,6 +18,12 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value> <value> <string>workflow</string> </value>
...@@ -28,11 +34,11 @@ ...@@ -28,11 +34,11 @@
</item> </item>
<item> <item>
<key> <string>actbox_url</string> </key> <key> <string>actbox_url</string> </key>
<value> <string>%(content_url)s/BaseWorkflow_viewWorkflowActionDialog?workflow_action=plan_action</string> </value> <value> <string>%(content_url)s/BaseWorkflow_viewWorkflowActionDialog?workflow_action=confirm_action</string> </value>
</item> </item>
<item> <item>
<key> <string>after_script_name</string> </key> <key> <string>after_script_name</string> </key>
<value> <string>plan</string> </value> <value> <string>confirm</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -46,7 +52,7 @@ ...@@ -46,7 +52,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>plan_action</string> </value> <value> <string>confirm_action</string> </value>
</item> </item>
<item> <item>
<key> <string>new_state_id</string> </key> <key> <string>new_state_id</string> </key>
......
...@@ -18,6 +18,12 @@ ...@@ -18,6 +18,12 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value> <value> <string>workflow</string> </value>
...@@ -46,11 +52,11 @@ ...@@ -46,11 +52,11 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>archive</string> </value> <value> <string>deliver</string> </value>
</item> </item>
<item> <item>
<key> <string>new_state_id</string> </key> <key> <string>new_state_id</string> </key>
<value> <string>archived</string> </value> <value> <string>delivered</string> </value>
</item> </item>
<item> <item>
<key> <string>script_name</string> </key> <key> <string>script_name</string> </key>
......
...@@ -18,6 +18,12 @@ ...@@ -18,6 +18,12 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value> <value> <string>workflow</string> </value>
...@@ -28,11 +34,11 @@ ...@@ -28,11 +34,11 @@
</item> </item>
<item> <item>
<key> <string>actbox_url</string> </key> <key> <string>actbox_url</string> </key>
<value> <string>%(content_url)s/BaseWorkflow_viewWorkflowActionDialog?workflow_action=archive_action</string> </value> <value> <string>%(content_url)s/BaseWorkflow_viewWorkflowActionDialog?workflow_action=deliver_action</string> </value>
</item> </item>
<item> <item>
<key> <string>after_script_name</string> </key> <key> <string>after_script_name</string> </key>
<value> <string>archive</string> </value> <value> <string>deliver</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -46,7 +52,7 @@ ...@@ -46,7 +52,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>archive_action</string> </value> <value> <string>deliver_action</string> </value>
</item> </item>
<item> <item>
<key> <string>new_state_id</string> </key> <key> <string>new_state_id</string> </key>
......
...@@ -109,7 +109,7 @@ Base_viewWorklist?simulation_state=confimed&portal_type=Account Incident&reset=1 ...@@ -109,7 +109,7 @@ Base_viewWorklist?simulation_state=confimed&portal_type=Account Incident&reset=1
<key> <string>simulation_state</string> </key> <key> <string>simulation_state</string> </key>
<value> <value>
<tuple> <tuple>
<string>planned</string> <string>confirmed</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -73,10 +73,31 @@ from Products.ERP5Type.Message import Message\n ...@@ -73,10 +73,31 @@ from Products.ERP5Type.Message import Message\n
\n \n
transaction = state_change[\'object\']\n transaction = state_change[\'object\']\n
\n \n
source = transaction.getSource()\n destination = transaction.getDestination()\n
resource = transaction.CashDelivery_checkCounterInventory(source = source, portal_type=\'Cash Delivery Line\', no_balance_check=1)\n resource = transaction.CashDelivery_checkCounterInventory(source = destination, portal_type=\'Cash Delivery Line\', \n
same_source=1,no_balance_check=1)\n
#transaction.log("call to CashDelivery_getCounterInventory return", resource)\n #transaction.log("call to CashDelivery_getCounterInventory return", resource)\n
\n \n
\n
user_id = transaction.portal_membership.getAuthenticatedMember().getUserName()\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
# context.log(\'validateVaultBalance site_list\',site_list)\n
destination = transaction.getDestination()\n
baobab_destination = None\n
for site in site_list:\n
site_value = context.portal_categories.getCategoryValue(site)\n
if site_value.getVaultType().endswith(\'guichet\') and destination in site:\n
baobab_destination = site + \'/encaisse_des_billets_et_monnaies/entrante\'\n
break\n
destination = baobab_destination\n
destination_object = context.portal_categories.getCategoryValue(destination)\n
\n
# check again that we are in the good accounting date\n
if not transaction.Baobab_checkCounterDateOpen(site=destination_object, date=transaction.getStartDate()):\n
msg = Message(domain = "ui", message="Transaction not in the good accounting date")\n
raise ValidationFailed, (msg,)\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 Line\',\'Cash Delivery Cell\'],fast=0)\n cash_detail = transaction.getTotalPrice(portal_type=[\'Cash Delivery Line\',\'Cash Delivery Cell\'],fast=0)\n
...@@ -146,11 +167,20 @@ elif price != cash_detail:\n ...@@ -146,11 +167,20 @@ elif price != cash_detail:\n
<string>_getitem_</string> <string>_getitem_</string>
<string>transaction</string> <string>transaction</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>source</string> <string>destination</string>
<string>resource</string> <string>resource</string>
<string>user_id</string>
<string>context</string>
<string>site_list</string>
<string>None</string>
<string>baobab_destination</string>
<string>_getiter_</string>
<string>site</string>
<string>site_value</string>
<string>destination_object</string>
<string>msg</string>
<string>price</string> <string>price</string>
<string>cash_detail</string> <string>cash_detail</string>
<string>msg</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
<key> <string>transitions</string> </key> <key> <string>transitions</string> </key>
<value> <value>
<tuple> <tuple>
<string>cancel</string>
<string>cancel_action</string>
<string>deliver</string> <string>deliver</string>
<string>deliver_action</string> <string>deliver_action</string>
</tuple> </tuple>
......
...@@ -78,6 +78,11 @@ date = transaction.getStartDate()\n ...@@ -78,6 +78,11 @@ date = transaction.getStartDate()\n
vault = transaction.getSource()\n vault = transaction.getSource()\n
vaultDestination = transaction.getDestination()\n vaultDestination = transaction.getDestination()\n
\n \n
# use of the constraint\n
vliste = transaction.checkConsistency()\n
if len(vliste) != 0:\n
raise ValidationFailed, (vliste[0].getTranslatedMessage(),)\n
\n
# check we are in an opened accounting day\n # check we are in an opened accounting day\n
if not transaction.Baobab_checkCounterDateOpen(site=vault, date=date):\n if not transaction.Baobab_checkCounterDateOpen(site=vault, date=date):\n
msg = Message(domain = "ui", message="Counter Date is not opened")\n msg = Message(domain = "ui", message="Counter Date is not opened")\n
...@@ -158,6 +163,9 @@ elif resource <> 0 :\n ...@@ -158,6 +163,9 @@ elif resource <> 0 :\n
<string>date</string> <string>date</string>
<string>vault</string> <string>vault</string>
<string>vaultDestination</string> <string>vaultDestination</string>
<string>vliste</string>
<string>len</string>
<string>_getitem_</string>
<string>msg</string> <string>msg</string>
<string>resource</string> <string>resource</string>
<string>amount</string> <string>amount</string>
......
141 144
\ No newline at end of file \ No newline at end of file
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