diff --git a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckDetail_saveFastInputLine.xml b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckDetail_saveFastInputLine.xml index df43183b7b6243e93e1ce3164bbe308ae23d582e..e7a2d9dd3111be9c91e29b502cb87d35fb8d4af5 100644 --- a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckDetail_saveFastInputLine.xml +++ b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckDetail_saveFastInputLine.xml @@ -134,7 +134,7 @@ for line in listbox:\n check_type_relative_url = check_type_relative_url[len(\'check_type/\'):]\n line_kw_dict[\'check_type\'] = check_type_relative_url\n check_type = context.getPortalObject().restrictedTraverse(check_type_relative_url)\n - line_kw_dict[\'price\'] = check_type.getQuantity()\n + line_kw_dict[\'price\'] = check_type.getPrice()\n line_kw_dict[\'price_currency\'] = check_type.getParentValue().getPriceCurrency()\n if add_line:\n number_of_line_created += 1\n diff --git a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckModelTypeVariation_view.xml b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckModelTypeVariation_view.xml index d5863015b1b3dbae23c8c0a8ab9d6814a5bb1ad3..af66fb3ed57ed87a789f20af0a7b44491de5de3d 100644 --- a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckModelTypeVariation_view.xml +++ b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckModelTypeVariation_view.xml @@ -102,7 +102,7 @@ <value> <list> <string>my_title</string> - <string>my_quantity</string> + <string>my_price</string> <string>my_description</string> </list> </value> diff --git a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckModelTypeVariation_view/my_quantity.xml b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckModelTypeVariation_view/my_price.xml similarity index 99% rename from bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckModelTypeVariation_view/my_quantity.xml rename to bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckModelTypeVariation_view/my_price.xml index a5892a41a70e4c0bcf905691254ddae7cd44b1e6..e279e02b1ad2efc11217c6ffedc43c4dbe6195b0 100644 --- a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckModelTypeVariation_view/my_quantity.xml +++ b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckModelTypeVariation_view/my_price.xml @@ -14,7 +14,7 @@ <dictionary> <item> <key> <string>id</string> </key> - <value> <string>my_quantity</string> </value> + <value> <string>my_price</string> </value> </item> <item> <key> <string>message_values</string> </key> diff --git a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_init.xml b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_init.xml index e298adea871d1f94b16b3fa2e8b982ebff8f1510..c06c37cf33d27a7094b1f4d2e7f5904f895c5df4 100644 --- a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_init.xml +++ b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_init.xml @@ -69,6 +69,9 @@ <item> <key> <string>_body</string> </key> <value> <string>context.setSource(context.getBaobabSource())\n +reference_currency = context.Baobab_getPortalReferenceCurrencyID()\n +context.setPriceCurrency(\'currency_module/%s\' %(reference_currency,))\n +context.setCurrencyExchangeType(\'transfer\')\n </string> </value> </item> <item> @@ -118,6 +121,7 @@ <string>kw</string> <string>_getattr_</string> <string>context</string> + <string>reference_currency</string> </tuple> </value> </item> diff --git a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookModel_view/listbox.xml b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookModel_view/listbox.xml index 0947da88c1192d29411a1b7a1c37974d2cc4ca2c..1b200264aec8655ffe1047d32cfa81856123270e 100644 --- a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookModel_view/listbox.xml +++ b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookModel_view/listbox.xml @@ -345,6 +345,10 @@ <string>title</string> <string>Title</string> </tuple> + <tuple> + <string>price</string> + <string>Amount</string> + </tuple> <tuple> <string>quantity</string> <string>Quantity</string> diff --git a/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/scripts/validatePositionAccounting.xml b/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/scripts/validatePositionAccounting.xml index 033b63dd50ceb82dffba5fd6468ee2c62803446d..784793906ab5741c61bd0eac8fc83a230448c470 100644 --- a/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/scripts/validatePositionAccounting.xml +++ b/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/scripts/validatePositionAccounting.xml @@ -85,7 +85,7 @@ if not transaction.Baobab_checkCounterDateOpen(site=source, date=date):\n \n site = transaction.getSourceValue()\n \n -if not context.Baobab_checkCounterOpened(site):\n +if not transaction.Baobab_checkCounterOpened(site):\n msg = Message(domain = "ui", message="Counter is not opened")\n raise ValidationFailed, (msg,)\n \n @@ -100,12 +100,12 @@ price = transaction.getSourceTotalAssetPrice()\n bank_account.serialize()\n \n # Make sure there are no other operations pending for this account\n -if context.BankAccount_isMessagePending(bank_account):\n +if transaction.BankAccount_isMessagePending(bank_account):\n msg = Message(domain=\'ui\', message="There are operations pending for this account that prevent form calculating its position. Please try again later.")\n raise ValidationFailed, (msg,)\n \n # Index the banking operation line so it impacts account position\n -context.BankingOperationLine_index(line)\n +transaxtion.BankingOperationLine_index(line)\n \n # Check if the banking operation is correct. Do not depend on catalog because line might not be indexed immediatelly.\n if - price != (line.getPrice() * line.getQuantity()):\n @@ -113,7 +113,7 @@ if - price != (line.getPrice() * line.getQuantity()):\n raise ValidationFailed, (msg,)\n \n # Test if the account balance is sufficient.\n -error = context.BankAccount_checkBalance(bank_account.getRelativeUrl(), price)\n +error = transaction.BankAccount_checkBalance(bank_account.getRelativeUrl(), price)\n if error[\'error_code\'] == 1:\n msg = Message(domain=\'ui\', message="Bank account is not sufficient.")\n raise ValidationFailed, (msg,)\n @@ -192,6 +192,7 @@ elif error[\'error_code\'] != 0:\n <string>line</string> <string>bank_account</string> <string>price</string> + <string>transaxtion</string> <string>error</string> </tuple> </value> diff --git a/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/transitions/order.xml b/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/transitions/order.xml index 5482a279325cf83ac80908b626bca4edd3ca8f0b..c0215f167c6f16a017a1a85bc32b6867cb49a7a8 100644 --- a/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/transitions/order.xml +++ b/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/transitions/order.xml @@ -91,6 +91,7 @@ <tuple> <string>Manager</string> <string>Assignee</string> + <string>Assignor</string> </tuple> </value> </item> diff --git a/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/transitions/order_action.xml b/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/transitions/order_action.xml index 9ec5038cba91ba506338e41aa7a1e424515e1478..41d989304b19db25032b572b358fd880d6698bb2 100644 --- a/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/transitions/order_action.xml +++ b/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/transitions/order_action.xml @@ -91,6 +91,7 @@ <tuple> <string>Manager</string> <string>Assignee</string> + <string>Assignor</string> </tuple> </value> </item> diff --git a/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_reception_workflow/scripts/CheckbookReception_generateItemList.xml b/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_reception_workflow/scripts/CheckbookReception_generateItemList.xml index e2bff6fd3d739e81db68fb2f33c573b4bd7b2240..33961f1367401c8097e1d97b5727b93a8fc58990 100644 --- a/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_reception_workflow/scripts/CheckbookReception_generateItemList.xml +++ b/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_reception_workflow/scripts/CheckbookReception_generateItemList.xml @@ -68,7 +68,9 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n + <value> <string encoding="cdata"><![CDATA[ + +from Products.DCWorkflow.DCWorkflow import ValidationFailed\n \n delivery = state_change.object\n portal = context.getPortalObject()\n @@ -113,9 +115,10 @@ for line in line_list:\n item.setReference(reference_range_min)\n item.setTitle(reference_range_min)\n reference_range_min = str(int(float(reference_range_min)) + 1)\n - if resource.isQuantityRequired():\n - item.setQuantity(line.getPrice())\n - item.setPriceCurrency(line.getPriceCurrency())\n + if len(resource.objectValues())>0:\n + item_type = line.getCheckTypeValue()\n + item.setPrice(item_type.getPrice())\n + item.setPriceCurrency(line.getPriceCurrency())\n item.setDestinationPayment(line.getDestinationPayment())\n item.setDestinationTrade(line.getDestinationTrade())\n item.setResourceValue(resource)\n @@ -126,7 +129,9 @@ for line in line_list:\n \n # Finally set the aggregate list on the line\n line.setAggregateValueList(aggregate_list)\n -</string> </value> + + +]]></string> </value> </item> <item> <key> <string>_code</string> </key> @@ -205,6 +210,8 @@ for line in line_list:\n <string>str</string> <string>int</string> <string>float</string> + <string>len</string> + <string>item_type</string> </tuple> </value> </item>