From 596ba4526c3b04538d6075a66d348fad696a04c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com>
Date: Thu, 7 Sep 2006 17:17:58 +0000
Subject: [PATCH] add a script to check available inventory fix forms groups
 some script changes

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9750 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../BankAccount_checkAvailableBalance.xml     | 234 ++++++++++++++++++
 .../BankAccount_checkBalance.xml              |   4 +-
 .../Baobab_checkCounterDateOpen.xml           |   4 +-
 .../CashDetail_saveFastInputLine.xml          |  12 +-
 .../CheckModule_viewCheckList.xml             |  30 +--
 ...bookModelModule_viewCheckbookModelList.xml |  23 +-
 .../CheckbookModule_viewCheckbookList.xml     |  30 +--
 .../Checkbook_viewCreateCheckListDialog.xml   |   4 +-
 .../CounterDateModule_viewCounterDateList.xml |   4 +-
 .../CounterDate_viewOpenDialog.xml            |  14 +-
 .../CounterModule_getVaultTransactionList.xml |  16 +-
 .../CounterModule_viewCounterList.xml         |  29 +--
 .../CounterModule_viewReportDialog.xml        |   4 +-
 .../CounterModule_viewVaultReport.xml         |  28 +--
 ...urrencyCashModule_viewCurrencyCashList.xml |   4 +-
 .../CurrencyPurchase_getQuantity.xml          |   6 +-
 .../CurrencySale_getQuantity.xml              |   6 +-
 .../ERP5Banking_getExchangeValue.xml          |   3 +-
 .../Folder_viewCashCurrencyList.xml           |  23 +-
 .../Folder_viewCashCurrencyListIn.xml         |  23 +-
 .../Folder_viewCashCurrencyListOut.xml        |  23 +-
 21 files changed, 296 insertions(+), 228 deletions(-)
 create mode 100644 bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankAccount_checkAvailableBalance.xml

diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankAccount_checkAvailableBalance.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankAccount_checkAvailableBalance.xml
new file mode 100644
index 0000000000..c1ab163203
--- /dev/null
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankAccount_checkAvailableBalance.xml
@@ -0,0 +1,234 @@
+<?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[
+
+# check that the amount of `resource` in account `payment` is greater than or equal to `quantity`\n
+\n
+# returns a dictionnary like : {\'error_code\', \'balance\'}\n
+\n
+#workflow_id = \'bank_account_workflow\'\n
+workflow_correct_state_list = (\'valid\', \'being_modified\', \'validating_modification\')\n
+manual_validation_account_category_list = (\'test\',)\n
+\n
+# First check that the payment account is in an acceptable state\n
+#payment_state = context.portal_workflow.getInfoFor(ob=payment, name=\'simulation_state\', wf_id=workflow_id)\n
+payment_value = context.restrictedTraverse(payment)\n
+payment_state = payment_value.getValidationState()\n
+\n
+if payment_state not in workflow_correct_state_list :\n
+  return {\'error_code\':2} # closed account\n
+\n
+resource = payment_value.getPriceCurrencyValue()\n
+\n
+if resource is None :\n
+  raise AttributeError, \'No currency defined on %s\' % payment\n
+\n
+# Next, check the balance of the account\n
+account_balance = resource.getAvailableInventory(payment=payment, src__=src__)\n
+context.log("account balance",account_balance)\n
+context.log("resource payement", str((resource,payment)))\n
+if src__ :\n
+  return account_balance \n
+\n
+if account_balance - quantity < 0 :\n
+#  if payment.getBankAccountType() in manual_validation_account_category_list :\n
+#    return {\'error_code\':3, \'balance\':account_balance} # manual_validation\n
+\n
+  return {\'error_code\':1, \'balance\':account_balance} # insufficient balance\n
+\n
+return {\'error_code\':0, \'balance\':account_balance} # ok\n
+
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_dav_writelocks</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value> <string>Script (Python):/baobab/portal_skins/erp5_banking_core/BankAccount_checkAvailableBalance</string> </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>payment, quantity, src__=0</string> </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple>
+                <string>Manager</string>
+              </tuple>
+            </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>3</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>payment</string>
+                            <string>quantity</string>
+                            <string>src__</string>
+                            <string>workflow_correct_state_list</string>
+                            <string>manual_validation_account_category_list</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>payment_value</string>
+                            <string>payment_state</string>
+                            <string>resource</string>
+                            <string>None</string>
+                            <string>AttributeError</string>
+                            <string>account_balance</string>
+                            <string>str</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <int>0</int>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>BankAccount_checkAvailableBalance</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </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/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankAccount_checkBalance.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankAccount_checkBalance.xml
index 4ea3af20a0..1748fe479f 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankAccount_checkBalance.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankAccount_checkBalance.xml
@@ -93,7 +93,8 @@ if resource is None :\n
 \n
 # Next, check the balance of the account\n
 account_balance = resource.getFutureInventory(payment=payment, src__=src__)\n
-#context.log("account balance",account_balance)\n
+context.log("account balance",account_balance)\n
+context.log("resource payement", str((resource,payment)))\n
 if src__ :\n
   return account_balance \n
 \n
@@ -179,6 +180,7 @@ return {\'error_code\':0, \'balance\':account_balance} # ok\n
                             <string>None</string>
                             <string>AttributeError</string>
                             <string>account_balance</string>
+                            <string>str</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_checkCounterDateOpen.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_checkCounterDateOpen.xml
index 0ba8b42230..0b34bc39ac 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_checkCounterDateOpen.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_checkCounterDateOpen.xml
@@ -74,7 +74,9 @@ if date is None:\n
   # get current date\n
   from DateTime import DateTime\n
   date = DateTime()\n
-  date = date.Date()\n
+\n
+# Make sure we have a date with no hours\n
+date = date.Date()\n
 \n
 if site is None:\n
   # get site from user assignment\n
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDetail_saveFastInputLine.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDetail_saveFastInputLine.xml
index c39bcf3b1b..ffef6af887 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDetail_saveFastInputLine.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDetail_saveFastInputLine.xml
@@ -95,7 +95,7 @@ base_category_list = (\'emission_letter\', \'cash_status\', \'variation\')\n
 per_resource_dict = {}\n
 \n
 # remove previous line\n
-old_line = [x.getObject() for x in context.searchFolder(portal_type=[line_portal_type,])]\n
+old_line = context.objectValues(portal_type=[line_portal_type,])\n
 #context.log("will erease old line", old_line)\n
 if len(old_line)>0:\n
   for object_list in old_line:\n
@@ -266,7 +266,7 @@ if variation_not_defined:\n
 else:\n
   request  = context.REQUEST\n
   redirect_url = \'%s/view?%s\' % ( context.absolute_url()\n
-                                  , \'portal_status_message=Lines%%20Created\'\n
+                                  , \'portal_status_message=Lines%20Created\'\n
                                   )\n
   request[ \'RESPONSE\' ].redirect( redirect_url )\n
 
@@ -349,14 +349,11 @@ else:\n
                             <string>column_base_list</string>
                             <string>base_category_list</string>
                             <string>per_resource_dict</string>
-                            <string>append</string>
-                            <string>$append0</string>
-                            <string>_getiter_</string>
                             <string>_getattr_</string>
                             <string>context</string>
-                            <string>x</string>
                             <string>old_line</string>
                             <string>len</string>
+                            <string>_getiter_</string>
                             <string>object_list</string>
                             <string>line</string>
                             <string>xrange</string>
@@ -389,6 +386,9 @@ else:\n
                             <string>mapped_value_list</string>
                             <string>variation_item</string>
                             <string>cell</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>x</string>
                             <string>request</string>
                             <string>redirect_url</string>
                           </tuple>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckModule_viewCheckList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckModule_viewCheckList.xml
index 6a8d80a4e6..53599d16fd 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckModule_viewCheckList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckModule_viewCheckList.xml
@@ -67,11 +67,7 @@
             <key> <string>group_list</string> </key>
             <value>
               <list>
-                <string>left</string>
-                <string>right</string>
-                <string>center</string>
                 <string>bottom</string>
-                <string>hidden</string>
               </list>
             </value>
         </item>
@@ -80,37 +76,13 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>bottom</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>center</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>hidden</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>left</string> </key>
+                    <key>                 <string>bottom</string> </key>
                     <value>
                       <list>
                         <string>listbox</string>
                       </list>
                     </value>
                 </item>
-                <item>
-                    <key> <string>right</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
               </dictionary>
             </value>
         </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModelModule_viewCheckbookModelList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModelModule_viewCheckbookModelList.xml
index 9ccc26dee9..2a9e0fb53d 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModelModule_viewCheckbookModelList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModelModule_viewCheckbookModelList.xml
@@ -67,9 +67,6 @@
             <key> <string>group_list</string> </key>
             <value>
               <list>
-                <string>left</string>
-                <string>right</string>
-                <string>center</string>
                 <string>bottom</string>
               </list>
             </value>
@@ -79,31 +76,13 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>bottom</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>center</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>left</string> </key>
+                    <key>                 <string>bottom</string> </key>
                     <value>
                       <list>
                         <string>listbox</string>
                       </list>
                     </value>
                 </item>
-                <item>
-                    <key> <string>right</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
               </dictionary>
             </value>
         </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList.xml
index bacfa109ce..1b01d2de95 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList.xml
@@ -67,11 +67,7 @@
             <key> <string>group_list</string> </key>
             <value>
               <list>
-                <string>left</string>
-                <string>right</string>
-                <string>center</string>
                 <string>bottom</string>
-                <string>hidden</string>
               </list>
             </value>
         </item>
@@ -80,37 +76,13 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>bottom</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>center</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>hidden</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>left</string> </key>
+                    <key>                 <string>bottom</string> </key>
                     <value>
                       <list>
                         <string>listbox</string>
                       </list>
                     </value>
                 </item>
-                <item>
-                    <key> <string>right</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
               </dictionary>
             </value>
         </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Checkbook_viewCreateCheckListDialog.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Checkbook_viewCreateCheckListDialog.xml
index d88a4cdad7..ab4981f75c 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Checkbook_viewCreateCheckListDialog.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Checkbook_viewCreateCheckListDialog.xml
@@ -67,7 +67,7 @@
             <key> <string>group_list</string> </key>
             <value>
               <list>
-                <string>Default</string>
+                <string>left</string>
               </list>
             </value>
         </item>
@@ -76,7 +76,7 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>Default</string> </key>
+                    <key>                 <string>left</string> </key>
                     <value>
                       <list>
                         <string>my_start_number</string>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDateModule_viewCounterDateList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDateModule_viewCounterDateList.xml
index ad43566af7..6d3e0ca0af 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDateModule_viewCounterDateList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDateModule_viewCounterDateList.xml
@@ -67,7 +67,7 @@
             <key> <string>group_list</string> </key>
             <value>
               <list>
-                <string>Default</string>
+                <string>bottom</string>
                 <string>hidden</string>
               </list>
             </value>
@@ -77,7 +77,7 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>Default</string> </key>
+                    <key>                 <string>bottom</string> </key>
                     <value>
                       <list>
                         <string>listbox</string>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_viewOpenDialog.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_viewOpenDialog.xml
index 7670113d6f..7e78041194 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_viewOpenDialog.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_viewOpenDialog.xml
@@ -67,7 +67,7 @@
             <key> <string>group_list</string> </key>
             <value>
               <list>
-                <string>Default</string>
+                <string>left</string>
                 <string>right</string>
                 <string>center</string>
                 <string>bottom</string>
@@ -79,12 +79,6 @@
             <key> <string>groups</string> </key>
             <value>
               <dictionary>
-                <item>
-                    <key> <string>Default</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
                 <item>
                     <key> <string>bottom</string> </key>
                     <value>
@@ -108,6 +102,12 @@
                       </list>
                     </value>
                 </item>
+                <item>
+                    <key>                 <string>left</string> </key>
+                    <value>
+                      <list/>
+                    </value>
+                </item>
                 <item>
                     <key> <string>right</string> </key>
                     <value>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList.xml
index 3f77a793c2..c86490d698 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList.xml
@@ -130,8 +130,8 @@ if column_names == 1:\n
   column_list.append((\'general_total_price\', \'General TotalPrice\'))\n
   return column_list\n
 \n
-context.log(\'node_category\',vault)\n
-context.log(\'inventory_kw\',inventory_kw)\n
+#context.log(\'node_category\',vault)\n
+#context.log(\'inventory_kw\',inventory_kw)\n
 vault_inventory_list = context.portal_simulation.getCurrentInventoryList( node_category=vault\n
                                                                  , ignore_variation=0\n
                                                                  ,**inventory_kw\n
@@ -155,6 +155,9 @@ for vault_inventory in vault_inventory_list:\n
     total_price = vault_inventory.total_price\n
     if total_price is None:\n
       total_price = 0\n
+    if only_positive:\n
+      total_price = abs(total_price)\n
+      total_quantity = abs(total_quantity)\n
 #     context.log(\'type\',type(total_price))\n
 #     context.log(\'sql total_price\',total_price)\n
     vault_inventory_dict[vault_url][resource] = {\'quantity\':total_quantity, \'total_price\':total_price,\n
@@ -257,7 +260,7 @@ return repr([x for x in total_inventory_list])\n
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>vault=None,at_date=None,from_date=None,vault_report_type=None,column_names=0,resource_portal_type=(\'Banknote\',\'Coin\'),**kw</string> </value>
+            <value> <string>vault=None,at_date=None,from_date=None,vault_report_type=None,column_names=0,resource_portal_type=(\'Banknote\',\'Coin\'), only_positive=0, **kw</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -277,7 +280,7 @@ return repr([x for x in total_inventory_list])\n
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>6</int> </value>
+                        <value> <int>7</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
@@ -289,6 +292,7 @@ return repr([x for x in total_inventory_list])\n
                             <string>vault_report_type</string>
                             <string>column_names</string>
                             <string>resource_portal_type</string>
+                            <string>only_positive</string>
                             <string>kw</string>
                             <string>Products.ERP5Type.Document</string>
                             <string>newTempBase</string>
@@ -306,13 +310,14 @@ return repr([x for x in total_inventory_list])\n
                             <string>_getitem_</string>
                             <string>column_list</string>
                             <string>_getiter_</string>
-                            <string>context</string>
                             <string>_apply_</string>
+                            <string>context</string>
                             <string>vault_inventory_list</string>
                             <string>vault_inventory</string>
                             <string>resource</string>
                             <string>total_quantity</string>
                             <string>total_price</string>
+                            <string>abs</string>
                             <string>total_inventory_list</string>
                             <string>i</string>
                             <string>variation_text</string>
@@ -352,6 +357,7 @@ return repr([x for x in total_inventory_list])\n
                   <string>Banknote</string>
                   <string>Coin</string>
                 </tuple>
+                <int>0</int>
               </tuple>
             </value>
         </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_viewCounterList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_viewCounterList.xml
index df880a0b9c..24bf2c6a1c 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_viewCounterList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_viewCounterList.xml
@@ -67,9 +67,6 @@
             <key> <string>group_list</string> </key>
             <value>
               <list>
-                <string>left</string>
-                <string>right</string>
-                <string>center</string>
                 <string>bottom</string>
                 <string>hidden</string>
               </list>
@@ -80,39 +77,21 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>bottom</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>center</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>hidden</string> </key>
+                    <key>                 <string>bottom</string> </key>
                     <value>
                       <list>
-                        <string>listbox_site</string>
+                        <string>listbox</string>
                       </list>
                     </value>
                 </item>
                 <item>
-                    <key> <string>left</string> </key>
+                    <key> <string>hidden</string> </key>
                     <value>
                       <list>
-                        <string>listbox</string>
+                        <string>listbox_site</string>
                       </list>
                     </value>
                 </item>
-                <item>
-                    <key> <string>right</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
               </dictionary>
             </value>
         </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_viewReportDialog.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_viewReportDialog.xml
index 3e0380fe7c..560dfbeb83 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_viewReportDialog.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_viewReportDialog.xml
@@ -67,7 +67,7 @@
             <key> <string>group_list</string> </key>
             <value>
               <list>
-                <string>Default</string>
+                <string>left</string>
               </list>
             </value>
         </item>
@@ -76,7 +76,7 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>Default</string> </key>
+                    <key>                 <string>left</string> </key>
                     <value>
                       <list>
                         <string>my_vault_report_type</string>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_viewVaultReport.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_viewVaultReport.xml
index 1950ae10d2..4f04994401 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_viewVaultReport.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_viewVaultReport.xml
@@ -67,9 +67,6 @@
             <key> <string>group_list</string> </key>
             <value>
               <list>
-                <string>left</string>
-                <string>right</string>
-                <string>center</string>
                 <string>bottom</string>
                 <string>hidden</string>
               </list>
@@ -80,39 +77,22 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>bottom</string> </key>
+                    <key>                 <string>bottom</string> </key>
                     <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>center</string> </key>
-                    <value>
-                      <list/>
+                      <list>
+                        <string>listbox</string>
+                      </list>
                     </value>
                 </item>
                 <item>
                     <key> <string>hidden</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>left</string> </key>
                     <value>
                       <list>
-                        <string>listbox</string>
                         <string>listbox_total_price</string>
                         <string>listbox_total_quantity</string>
                       </list>
                     </value>
                 </item>
-                <item>
-                    <key> <string>right</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
               </dictionary>
             </value>
         </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyCashModule_viewCurrencyCashList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyCashModule_viewCurrencyCashList.xml
index 9245ee3771..77d41cd7a5 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyCashModule_viewCurrencyCashList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyCashModule_viewCurrencyCashList.xml
@@ -67,7 +67,7 @@
             <key> <string>group_list</string> </key>
             <value>
               <list>
-                <string>Default</string>
+                <string>bottom</string>
               </list>
             </value>
         </item>
@@ -76,7 +76,7 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>Default</string> </key>
+                    <key>                 <string>bottom</string> </key>
                     <value>
                       <list>
                         <string>listbox</string>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyPurchase_getQuantity.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyPurchase_getQuantity.xml
index 894528f561..5a351fce53 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyPurchase_getQuantity.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyPurchase_getQuantity.xml
@@ -75,8 +75,10 @@ commission_price = context.getDiscount()\n
 if commission_ratio is not None and commission_ratio !=0 and commission_price is not None and commission_price !=0:\n
   return None\n
 if commission_ratio == 0 or commission_price == 0:\n
+  price = round(price,0)\n
   return price\n
 if commission_ratio is None and commission_price is None:\n
+  price = round(price,0)\n
   return price\n
 \n
 if commission_ratio is not None:\n
@@ -86,7 +88,7 @@ if commission_price is not None:\n
   commission_value = commission_price\n
 \n
 quantity = price - commission_value\n
-quantity = round(quantity-0.5,0)\n
+quantity = round(quantity,0)\n
 if quantity!=context.getQuantity():\n
   context.setQuantity(quantity)\n
 return quantity\n
@@ -148,9 +150,9 @@ return quantity\n
                             <string>commission_ratio</string>
                             <string>commission_price</string>
                             <string>None</string>
+                            <string>round</string>
                             <string>commission_value</string>
                             <string>quantity</string>
-                            <string>round</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencySale_getQuantity.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencySale_getQuantity.xml
index bcb130c511..71dc5db7cb 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencySale_getQuantity.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencySale_getQuantity.xml
@@ -75,8 +75,10 @@ commission_price = context.getDiscount()\n
 if commission_ratio is not None and commission_ratio !=0 and commission_price is not None and commission_price !=0:\n
   return None\n
 if commission_ratio == 0 or commission_price == 0:\n
+  price = round(price,0)\n
   return price\n
 if commission_ratio is None and commission_price is None:\n
+  price = round(price,0)\n
   return price\n
 \n
 if commission_ratio is not None:\n
@@ -86,7 +88,7 @@ if commission_price is not None:\n
   commission_value = commission_price\n
 \n
 quantity = price + commission_value\n
-quantity = round(quantity+0.5,0)\n
+quantity = round(quantity,0)\n
 if quantity!=context.getQuantity():\n
   context.setQuantity(quantity)\n
 return quantity\n
@@ -148,9 +150,9 @@ return quantity\n
                             <string>commission_ratio</string>
                             <string>commission_price</string>
                             <string>None</string>
+                            <string>round</string>
                             <string>commission_value</string>
                             <string>quantity</string>
-                            <string>round</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ERP5Banking_getExchangeValue.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ERP5Banking_getExchangeValue.xml
index 8156784c10..a08a090fa9 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ERP5Banking_getExchangeValue.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ERP5Banking_getExchangeValue.xml
@@ -82,7 +82,7 @@ if None in (rate, price):\n
 \n
 price = float(price)\n
 \n
-return rate * price\n
+return round(rate * price)\n
 
 
 ]]></string> </value>
@@ -140,6 +140,7 @@ return rate * price\n
                             <string>_getitem_</string>
                             <string>price</string>
                             <string>float</string>
+                            <string>round</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Folder_viewCashCurrencyList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Folder_viewCashCurrencyList.xml
index dc697a1387..c1293a570d 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Folder_viewCashCurrencyList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Folder_viewCashCurrencyList.xml
@@ -67,9 +67,6 @@
             <key> <string>group_list</string> </key>
             <value>
               <list>
-                <string>left</string>
-                <string>right</string>
-                <string>center</string>
                 <string>bottom</string>
               </list>
             </value>
@@ -79,31 +76,13 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>bottom</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>center</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>left</string> </key>
+                    <key>                 <string>bottom</string> </key>
                     <value>
                       <list>
                         <string>listbox</string>
                       </list>
                     </value>
                 </item>
-                <item>
-                    <key> <string>right</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
               </dictionary>
             </value>
         </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Folder_viewCashCurrencyListIn.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Folder_viewCashCurrencyListIn.xml
index b443a35f8f..686fd371a9 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Folder_viewCashCurrencyListIn.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Folder_viewCashCurrencyListIn.xml
@@ -67,9 +67,6 @@
             <key> <string>group_list</string> </key>
             <value>
               <list>
-                <string>left</string>
-                <string>right</string>
-                <string>center</string>
                 <string>bottom</string>
               </list>
             </value>
@@ -79,31 +76,13 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>bottom</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>center</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>left</string> </key>
+                    <key>                 <string>bottom</string> </key>
                     <value>
                       <list>
                         <string>listbox</string>
                       </list>
                     </value>
                 </item>
-                <item>
-                    <key> <string>right</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
               </dictionary>
             </value>
         </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Folder_viewCashCurrencyListOut.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Folder_viewCashCurrencyListOut.xml
index 773ff6ad99..c80ab4fa02 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Folder_viewCashCurrencyListOut.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Folder_viewCashCurrencyListOut.xml
@@ -67,9 +67,6 @@
             <key> <string>group_list</string> </key>
             <value>
               <list>
-                <string>left</string>
-                <string>right</string>
-                <string>center</string>
                 <string>bottom</string>
               </list>
             </value>
@@ -79,31 +76,13 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>bottom</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>center</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>left</string> </key>
+                    <key>                 <string>bottom</string> </key>
                     <value>
                       <list>
                         <string>listbox</string>
                       </list>
                     </value>
                 </item>
-                <item>
-                    <key> <string>right</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
               </dictionary>
             </value>
         </item>
-- 
2.30.9