diff --git a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/AccountTransfer_duplicate.xml b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/AccountTransfer_duplicate.xml deleted file mode 100644 index 528f935d9d15740a639de053dff7736b31b6f98f..0000000000000000000000000000000000000000 --- a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/AccountTransfer_duplicate.xml +++ /dev/null @@ -1,203 +0,0 @@ -<?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 encoding="cdata"><![CDATA[ - -# We will create a new account transfer and then copy most of local properties\n -# to the new account transfer created\n -request=context.REQUEST\n -portal = context.getPortalObject()\n -N_ = portal.Base_translateString\n -\n -edit_kw = {}\n -edit_kw[\'delivery_mode\'] = context.getDeliveryMode()\n -edit_kw[\'source_section\'] = context.getSourceSection()\n -edit_kw[\'source_payment\'] = context.getSourcePayment()\n -edit_kw[\'external_software\'] = context.getExternalSoftware()\n -edit_kw[\'posted\'] = context.getPosted()\n -edit_kw[\'description\'] = context.getDescription()\n -\n -new_transfer = context.account_transfer_module.newContent(**edit_kw)\n -\n -message = N_("Account Transfer duplicated.")\n -if not selection_index:\n - redirect_url = \'%s/%s?portal_status_message=%s\' % (new_transfer.absolute_url(),\n - form_id,\n - message)\n -else:\n - redirect_url = \'%s/%s?selection_index=%s&selection_name=%s&portal_status_message=%s\' % (\n - new_transfer.absolute_url(),\n - form_id,\n - selection_index,\n - selection_name,\n - message)\n -\n -return request[\'RESPONSE\'].redirect(redirect_url)\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>form_id, selection_index=0, selection_name=\'\', dialog_id=\'\', ignore_layout=None,**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>5</int> </value> - </item> - <item> - <key> <string>co_varnames</string> </key> - <value> - <tuple> - <string>form_id</string> - <string>selection_index</string> - <string>selection_name</string> - <string>dialog_id</string> - <string>ignore_layout</string> - <string>kw</string> - <string>_getattr_</string> - <string>context</string> - <string>request</string> - <string>portal</string> - <string>N_</string> - <string>edit_kw</string> - <string>_write_</string> - <string>_apply_</string> - <string>new_transfer</string> - <string>message</string> - <string>redirect_url</string> - <string>_getitem_</string> - </tuple> - </value> - </item> - </dictionary> - </state> - </object> - </value> - </item> - <item> - <key> <string>func_defaults</string> </key> - <value> - <tuple> - <int>0</int> - <string></string> - <string></string> - <none/> - </tuple> - </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>AccountTransfer_duplicate</string> </value> - </item> - <item> - <key> <string>warnings</string> </key> - <value> - <tuple/> - </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/AccountTransfer_init.xml b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/AccountTransfer_init.xml deleted file mode 100644 index 5573ec31687d8a11ecda28b0149a904938c7e146..0000000000000000000000000000000000000000 --- a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/AccountTransfer_init.xml +++ /dev/null @@ -1,163 +0,0 @@ -<?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 encoding="cdata"><![CDATA[ - -user_site_list = context.Baobab_getUserAssignedSiteList()\n -if len(user_site_list)>0:\n - site = context.Baobab_getVaultSite(user_site_list[0])\n - site_url = site.getRelativeUrl()\n - context.setSite(site_url)\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>user_site_list</string> - <string>len</string> - <string>_getitem_</string> - <string>site</string> - <string>site_url</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>AccountTransfer_init</string> </value> - </item> - <item> - <key> <string>warnings</string> </key> - <value> - <tuple/> - </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/IncomingCashSortingIncidentLine_getBaobabDestination.xml b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/IncomingCashSortingIncidentLine_getBaobabDestination.xml index 25be6d653f5ea8b5791f26e009b42f715db33b49..f06a9e2dd7f5f10a2380264efb886f1447154802 100644 --- a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/IncomingCashSortingIncidentLine_getBaobabDestination.xml +++ b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/IncomingCashSortingIncidentLine_getBaobabDestination.xml @@ -68,7 +68,7 @@ </item> <item> <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> </item> <item> diff --git a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingCashSortingIncidentLine_getBaobabSource.xml b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingCashSortingIncidentLine_getBaobabSource.xml index b87d43c96b9114241b88ba2065ff6c2c78fb031e..f0a5fed74c749492088b2ce02ac1056cf84fabea 100644 --- a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingCashSortingIncidentLine_getBaobabSource.xml +++ b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingCashSortingIncidentLine_getBaobabSource.xml @@ -68,7 +68,7 @@ </item> <item> <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> </item> <item> diff --git a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingUsualCashIncidentLine_getBaobabSource.xml b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingUsualCashIncidentLine_getBaobabSource.xml index 85bb55cb66c23f93983466374be063fa14dea18e..589adc84283db9d1ecdab271c0edc8d869928726 100644 --- a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingUsualCashIncidentLine_getBaobabSource.xml +++ b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingUsualCashIncidentLine_getBaobabSource.xml @@ -68,7 +68,7 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string>return "%s/surface/caisse_courante/encaisse_des_billets_et_monnaies" %(context.getSource(),)\n + <value> <string>return None\n </string> </value> </item> <item> @@ -119,8 +119,7 @@ <tuple> <string>args</string> <string>kw</string> - <string>_getattr_</string> - <string>context</string> + <string>None</string> </tuple> </value> </item> diff --git a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_sorting_incident_workflow/scripts/checkConsistency.xml b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_sorting_incident_workflow/scripts/checkConsistency.xml index cac66e74f11314df3c4a88867bb4cd15a4880e2c..660745ff49e112f9729c2c2b04acb5d23d2c91b3 100644 --- a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_sorting_incident_workflow/scripts/checkConsistency.xml +++ b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_sorting_incident_workflow/scripts/checkConsistency.xml @@ -79,7 +79,7 @@ out_list = txn.objectValues(portal_type=\'Outgoing Cash Sorting Incident Line\') price = txn.getSourceTotalAssetPrice()\n in_price = txn.getTotalPrice(portal_type=[\'Incoming Cash Sorting Incident Line\',\'Cash Delivery Cell\'],fast=0)\n out_price = txn.getTotalPrice(portal_type=[\'Outgoing Cash Sorting Incident Line\',\'Cash Delivery Cell\'],fast=0)\n -\n +vault = "%s/surface/caisse_courante/encaisse_des_billets_et_monnaies" %(txn.getSource(),)\n \n if len(in_list) != 0 and len(out_list) != 0:\n msg = Message(domain = "ui", message="You can\'t have excess and deficit on the document.")\n @@ -87,10 +87,16 @@ if len(in_list) != 0 and len(out_list) != 0:\n elif len(in_list) == 0 and len(out_list) == 0:\n msg = Message(domain = "ui", message="No resource.")\n raise ValidationFailed, (msg,)\n -\n elif (in_price != 0 and in_price != price) or (out_price != 0 and out_price != price):\n msg = Message(domain = "ui", message="Price differs between document and resource.")\n raise ValidationFailed, (msg,)\n +\n +if len(out_list) !=0:\n + \n + resource = txn.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Outgoing Cash Sorting Incident Line\')\n + if resource != 0 :\n + msg = Message(domain="ui", message="Insufficient Balance.")\n + raise ValidationFailed, (msg,)\n </string> </value> </item> <item> @@ -146,8 +152,10 @@ elif (in_price != 0 and in_price != price) or (out_price != 0 and out_price != p <string>price</string> <string>in_price</string> <string>out_price</string> + <string>vault</string> <string>len</string> <string>msg</string> + <string>resource</string> </tuple> </value> </item> diff --git a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_sorting_incident_workflow/scripts/validateVaultBalance.xml b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_sorting_incident_workflow/scripts/validateVaultBalance.xml deleted file mode 100644 index b6ff39d6a8c4317cf5bde208565ce2d2a5d9eb41..0000000000000000000000000000000000000000 --- a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_sorting_incident_workflow/scripts/validateVaultBalance.xml +++ /dev/null @@ -1,212 +0,0 @@ -<?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>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n -from Products.ERP5Type.Message import Message\n -\n -transaction = state_change[\'object\']\n -# Compute the source form the vault choosen by\n -# the accountant and find the counter with the\n -# user logged in\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 -source = transaction.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/sortante\'\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 transaction.Baobab_checkCounterDateOpen(site=source_object, date=transaction.getStartDate()):\n - msg = Message(domain = "ui", message="Transaction not in the good accounting date")\n - raise ValidationFailed, (msg,)\n -\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 -# Get price and total_price.\n -price = transaction.getSourceTotalAssetPrice()\n -cash_detail = transaction.getTotalPrice(portal_type = (\'Cash Delivery Line\',\'Cash Delivery Cell\'), fast=0)\n -#transaction.log("price vs cash detail", str((price, cash_detail)))\n -if resource == 3:\n - msg = Message(domain="ui", message="No banknote or coin defined.")\n - raise ValidationFailed, (msg,)\n -elif resource == 2:\n - msg = Message(domain="ui", message="No resource defined.")\n - raise ValidationFailed, (msg,)\n -elif price != cash_detail:\n - msg = Message(domain="ui", message="Amount differs from input.")\n - raise ValidationFailed, (msg,)\n -elif resource == 1:\n - msg = Message(domain="ui", message="Insufficient Balance in counter.")\n - raise ValidationFailed, (msg,)\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>state_change</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>1</int> </value> - </item> - <item> - <key> <string>co_varnames</string> </key> - <value> - <tuple> - <string>state_change</string> - <string>Products.DCWorkflow.DCWorkflow</string> - <string>ValidationFailed</string> - <string>Products.ERP5Type.Message</string> - <string>Message</string> - <string>_getitem_</string> - <string>transaction</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>resource</string> - <string>price</string> - <string>cash_detail</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>validateVaultBalance</string> </value> - </item> - <item> - <key> <string>warnings</string> </key> - <value> - <tuple/> - </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/usual_cash_incident_workflow/scripts/checkConsistency.xml b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/usual_cash_incident_workflow/scripts/checkConsistency.xml index fb8b1f84752e80f7d4498ca475426e3c7ac0cdfb..57242a4f4b47cd9fca7441c6dd2e5e70dd59f095 100644 --- a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/usual_cash_incident_workflow/scripts/checkConsistency.xml +++ b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/usual_cash_incident_workflow/scripts/checkConsistency.xml @@ -108,11 +108,7 @@ elif len(in_list) == 0 and len(out_list) == 0:\n msg = Message(domain = "ui", message="No resource.")\n raise ValidationFailed, (msg,)\n \n -elif len(out_list) !=0:\n - resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Outgoing Usual Cash Incident Line\')\n - if resource <> 0 :\n - msg = Message(domain="ui", message="Insufficient Balance.")\n - raise ValidationFailed, (msg,)\n +\n \n elif (in_price != 0 and in_price != price) or (out_price != 0 and out_price != price):\n msg = Message(domain = "ui", message="Price differs between document and resource.")\n @@ -183,7 +179,6 @@ elif (in_price != 0 and in_price != price) or (out_price != 0 and out_price != p <string>in_price</string> <string>out_price</string> <string>len</string> - <string>resource</string> </tuple> </value> </item> diff --git a/bt5/erp5_banking_cash/bt/revision b/bt5/erp5_banking_cash/bt/revision index 89a16a7ddc3b772d81302efaab91722efa3e1429..4a8d924028a2939d1a825e445ab19cb445b03a93 100644 --- a/bt5/erp5_banking_cash/bt/revision +++ b/bt5/erp5_banking_cash/bt/revision @@ -1 +1 @@ -172 \ No newline at end of file +174 \ No newline at end of file