From 935df1df98e6c5be6e9c16478c7b266124742267 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Wed, 22 Nov 2006 15:19:18 +0000
Subject: [PATCH] many small bug fixes

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11438 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_categories/cash_status.xml         |   4 +
 .../BankAccount_checkBalance.xml              |   2 +-
 .../BankAccount_checkRIBKey.xml               | 211 +++++++++++++
 .../Baobab_checkCounterDateOpen.xml           |  14 +-
 .../Base_checkBaobabSourceAndDestination.xml  |   3 +-
 .../erp5_banking_core/Base_sortItemList.xml   | 164 ++++++++++
 ...Delivery_generateCashDetailInputDialog.xml |   1 +
 .../CashDetail_checkResourceCategoryList.xml  | 180 +++++++++++
 .../erp5_banking_core/Coin_view.xml           |   3 +-
 .../Coin_view/my_emission_letter_list.xml     | 277 +++++++++++++++++
 .../CounterDate_getSiteCounterList.xml        |  17 +-
 .../CounterDate_viewOpenDialog.xml            |   1 +
 .../CounterDate_viewOpenDialog/listbox.xml    |  10 +-
 .../listbox_site.xml                          | 293 ++++++++++++++++++
 .../CounterModule_getVaultInventoryList.xml   |   2 +-
 .../CounterModule_getVaultTransactionList.xml |   7 +-
 .../CurrencyExchangeLine_view/listbox.xml     |   8 +-
 .../CurrencyExchange_getCurrencyList.xml      |  27 ++
 .../Delivery_getMovementList.xml              |   1 +
 .../check_workflow/states/archived.xml        |  20 ++
 .../scripts/openAllCounter.xml                |  27 +-
 bt5/erp5_banking_core/bt/revision             |   2 +-
 22 files changed, 1229 insertions(+), 45 deletions(-)
 create mode 100644 bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankAccount_checkRIBKey.xml
 create mode 100644 bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_sortItemList.xml
 create mode 100644 bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDetail_checkResourceCategoryList.xml
 create mode 100644 bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Coin_view/my_emission_letter_list.xml
 create mode 100644 bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_viewOpenDialog/listbox_site.xml

diff --git a/bt5/erp5_banking_core/CategoryTemplateItem/portal_categories/cash_status.xml b/bt5/erp5_banking_core/CategoryTemplateItem/portal_categories/cash_status.xml
index f982637061..35be860fe1 100644
--- a/bt5/erp5_banking_core/CategoryTemplateItem/portal_categories/cash_status.xml
+++ b/bt5/erp5_banking_core/CategoryTemplateItem/portal_categories/cash_status.xml
@@ -62,6 +62,10 @@
             <key> <string>id</string> </key>
             <value> <string>cash_status</string> </value>
         </item>
+        <item>
+            <key> <string>last_id</string> </key>
+            <value> <string>1</string> </value>
+        </item>
         <item>
             <key> <string>title</string> </key>
             <value>
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 4abc313452..4ad621577d 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
@@ -90,7 +90,7 @@ if resource is None :\n
 \n
 # Next, check the balance of the account\n
 # We must specify the resource !\n
-account_balance = resource.getFutureInventory(payment=payment, resource=resource.getRelativeUrl(),src__=src__)\n
+account_balance = resource.getAvailableInventory(payment=payment, resource=resource.getRelativeUrl(),src__=src__)\n
 if src__ :\n
   return account_balance \n
 \n
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankAccount_checkRIBKey.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankAccount_checkRIBKey.xml
new file mode 100644
index 0000000000..53ab8df3e7
--- /dev/null
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankAccount_checkRIBKey.xml
@@ -0,0 +1,211 @@
+<?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>d = {}\n
+d[\'A\'] = d[\'J\'] = \'1\'\n
+d[\'B\'] = d[\'K\'] = d[\'S\'] = \'2\'\n
+d[\'C\'] = d[\'L\'] = d[\'T\'] = \'3\'\n
+d[\'D\'] = d[\'M\'] = d[\'U\'] = \'4\'\n
+d[\'E\'] = d[\'N\'] = d[\'V\'] = \'5\'\n
+d[\'F\'] = d[\'O\'] = d[\'W\'] = \'6\'\n
+d[\'G\'] = d[\'P\'] = d[\'X\'] = \'7\'\n
+d[\'H\'] = d[\'Q\'] = d[\'Y\'] = \'8\'\n
+d[\'I\'] = d[\'R\'] = d[\'Z\'] = \'9\'\n
+\n
+old_rib = account_nb[-2:]\n
+\n
+new_account_nb = ""\n
+for nb in list(account_nb)[:-2]:\n
+  if d.has_key(nb):\n
+    new_account_nb += d[nb]\n
+  else:\n
+    new_account_nb += nb\n
+\n
+new_account_nb += "00"\n
+new_account_nb = long(new_account_nb)\n
+rib = 97 - new_account_nb % 97\n
+\n
+return (str(rib) == str(old_rib))\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>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>account_nb</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>account_nb</string>
+                            <string>d</string>
+                            <string>_write_</string>
+                            <string>_getitem_</string>
+                            <string>old_rib</string>
+                            <string>new_account_nb</string>
+                            <string>_getiter_</string>
+                            <string>list</string>
+                            <string>nb</string>
+                            <string>_getattr_</string>
+                            <string>long</string>
+                            <string>rib</string>
+                            <string>str</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>BankAccount_checkRIBKey</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/Baobab_checkCounterDateOpen.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_checkCounterDateOpen.xml
index 4dee7f202f..95bcb62d17 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
@@ -91,12 +91,7 @@ if site is None:\n
 #context.log(\'Baobab_checkCounterDateOpen\', \'get site for vault %s\' %(site))\n
 site = context.Baobab_getVaultSite(site)\n
 \n
-kw = {"portal_type" : \'Counter Date\', "start_date" : str(date), "site_id" : site.getId(), "simulation_state" : "open"}\n
-#context.log(\'Baobab_checkCounterDateOpen\', \'kw = %s\' %(kw,))\n
-counter_date_list = [x.getObject() for x in context.portal_catalog(**kw)]\n
-#context.log(\'Baobab_checkCounterDateOpen\', \'counter_date_list = %s, requete = %s\' %(counter_date_list, context.portal_catalog(src__=1, **kw)))\n
-\n
-if len(counter_date_list) == 0:\n
+if context.portal_catalog.countResults(portal_type=\'Counter Date\', start_date=str(date), site_id=site.getId(), simulation_state="open")[0][0] == 0:\n
   return 0\n
 else:\n
   return 1\n
@@ -172,13 +167,6 @@ else:\n
                             <string>len</string>
                             <string>_getitem_</string>
                             <string>str</string>
-                            <string>kw</string>
-                            <string>append</string>
-                            <string>$append0</string>
-                            <string>_getiter_</string>
-                            <string>_apply_</string>
-                            <string>x</string>
-                            <string>counter_date_list</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_checkBaobabSourceAndDestination.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_checkBaobabSourceAndDestination.xml
index c6d2fd5aa4..e8625fcce5 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_checkBaobabSourceAndDestination.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_checkBaobabSourceAndDestination.xml
@@ -80,10 +80,11 @@ for object in object_to_check_list:\n
 \n
   for node_url in (baobab_source,baobab_destination):\n
     if node_url is not None:\n
-      context.log(\'node_url\', node_url)\n
+      #context.log(\'node_url\', node_url)\n
       try:\n
         node = context.portal_categories.restrictedTraverse(node_url)\n
       except KeyError:\n
+        context.log(\'Error on \', (context.getRelativeUrl(),node_url))\n
         msg = Message(domain=\'ui\',message=\'Sorry, wrong source or destination\')\n
         raise ValidationFailed, (msg,)\n
 </string> </value>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_sortItemList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_sortItemList.xml
new file mode 100644
index 0000000000..e615225bac
--- /dev/null
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_sortItemList.xml
@@ -0,0 +1,164 @@
+<?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>def sort_title(a,b):\n
+  return cmp(a[0],b[0])\n
+\n
+begin = []\n
+if keep_first:\n
+  begin.append(my_list[0])\n
+  my_list = my_list[1:]\n
+my_list.sort(sort_title)\n
+return begin + my_list\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>my_list,keep_first=0,**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>2</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>my_list</string>
+                            <string>keep_first</string>
+                            <string>kw</string>
+                            <string>sort_title</string>
+                            <string>begin</string>
+                            <string>_getattr_</string>
+                            <string>_getitem_</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>Base_sortItemList</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDelivery_generateCashDetailInputDialog.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDelivery_generateCashDetailInputDialog.xml
index 25de1b0fd7..cbacc8e7c9 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDelivery_generateCashDetailInputDialog.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDelivery_generateCashDetailInputDialog.xml
@@ -307,6 +307,7 @@ if listbox is None:\n
 \n
 \n
 else :\n
+\n
   # we want to update the listbox\n
   cash_status_list          = kw[\'cash_status_list\']\n
   emission_letter_list      = kw[\'emission_letter_list\']\n
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDetail_checkResourceCategoryList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDetail_checkResourceCategoryList.xml
new file mode 100644
index 0000000000..b359fef40c
--- /dev/null
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDetail_checkResourceCategoryList.xml
@@ -0,0 +1,180 @@
+<?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>def getResourceVariationCategory():\n
+  pass\n
+\n
+if variation != \'variation/not_defined\' and variation.lstrip(\'variation/\') not in resource_object.getVariationList():\n
+  variation_not_defined = 1\n
+  break\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>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>resource_object, variation, emission_letter</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple>
+                <string>\'break\' outside loop (/baobab/portal_skins/erp5_banking_core/CashDetail_checkResourceCategoryList, 6)</string>
+              </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/>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>CashDetail_checkResourceCategoryList</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/Coin_view.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Coin_view.xml
index ca89e1bba1..71945e2212 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Coin_view.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Coin_view.xml
@@ -81,8 +81,8 @@
                     <value>
                       <list>
                         <string>my_translated_title</string>
-                        <string>my_variation_list</string>
                         <string>my_base_price</string>
+                        <string>my_variation_list</string>
                       </list>
                     </value>
                 </item>
@@ -91,6 +91,7 @@
                     <value>
                       <list>
                         <string>my_price_currency</string>
+                        <string>my_emission_letter_list</string>
                       </list>
                     </value>
                 </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Coin_view/my_emission_letter_list.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Coin_view/my_emission_letter_list.xml
new file mode 100644
index 0000000000..b2535fe0b8
--- /dev/null
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Coin_view/my_emission_letter_list.xml
@@ -0,0 +1,277 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.StandardFields</string>
+          <string>MultiCheckBoxField</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_emission_letter_list</string> </value>
+        </item>
+        <item>
+            <key> <string>message_values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>external_validator_failed</string> </key>
+                    <value> <string>The input failed the external validator.</string> </value>
+                </item>
+                <item>
+                    <key> <string>required_not_found</string> </key>
+                    <value> <string>Input is required but no input given.</string> </value>
+                </item>
+                <item>
+                    <key> <string>unknown_selection</string> </key>
+                    <value> <string>You selected an item that was not in the list.</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>orientation</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>view_separator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>orientation</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>view_separator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value>
+                      <list/>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value>
+                      <list/>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>orientation</string> </key>
+                    <value> <string>vertical</string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Emission Letters</string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>view_separator</string> </key>
+                    <value> <string encoding="cdata"><![CDATA[
+
+<br />
+
+]]></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.TALESField</string>
+          <string>TALESMethod</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>python: here.portal_categories.emission_letter.getCategoryChildTitleOrIdItemList()[1:]</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_getSiteCounterList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_getSiteCounterList.xml
index 7c71f4bfc4..1bb887da51 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_getSiteCounterList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_getSiteCounterList.xml
@@ -73,17 +73,7 @@
 site = context.Baobab_getVaultSite(vault=context.getSiteValue())\n
 counter_list = [x.getObject() for x in context.portal_catalog(portal_type="Counter", site_uid = site.getUid())]\n
 \n
-object_list = []\n
-i = 0\n
-for counter in counter_list:\n
-  line = newTempBase(context, \'tmp_open_%s\' %(str(i)))\n
-  line.edit(name=counter.getTitle(),\n
-            path = counter.getPath())\n
-  line.setUid(\'new_%s\' % counter.getPath())\n
-  object_list.append(line)\n
-  i += 1                                  \n
-\n
-return object_list\n
+return counter_list\n
 </string> </value>
         </item>
         <item>
@@ -143,11 +133,6 @@ return object_list\n
                             <string>_getiter_</string>
                             <string>x</string>
                             <string>counter_list</string>
-                            <string>object_list</string>
-                            <string>i</string>
-                            <string>counter</string>
-                            <string>str</string>
-                            <string>line</string>
                           </tuple>
                         </value>
                     </item>
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 7e78041194..2a14db0394 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
@@ -99,6 +99,7 @@
                     <value>
                       <list>
                         <string>listbox_choice</string>
+                        <string>listbox_site</string>
                       </list>
                     </value>
                 </item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_viewOpenDialog/listbox.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_viewOpenDialog/listbox.xml
index b610bc1fb4..710d80fae4 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_viewOpenDialog/listbox.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_viewOpenDialog/listbox.xml
@@ -338,12 +338,12 @@
                     <value>
                       <list>
                         <tuple>
-                          <string>name</string>
+                          <string>title</string>
                           <string>Name</string>
                         </tuple>
                         <tuple>
-                          <string>path</string>
-                          <string>Path</string>
+                          <string>site</string>
+                          <string>Site</string>
                         </tuple>
                         <tuple>
                           <string>choice</string>
@@ -506,11 +506,11 @@
                     <value>
                       <list>
                         <tuple>
-                          <string>name</string>
+                          <string>title</string>
 <string></string>
                         </tuple>
                         <tuple>
-                          <string>path</string>
+                          <string>site</string>
 <string></string>
                         </tuple>
                       </list>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_viewOpenDialog/listbox_site.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_viewOpenDialog/listbox_site.xml
new file mode 100644
index 0000000000..388164ae49
--- /dev/null
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterDate_viewOpenDialog/listbox_site.xml
@@ -0,0 +1,293 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.StandardFields</string>
+          <string>StringField</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>listbox_site</string> </value>
+        </item>
+        <item>
+            <key> <string>message_values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>external_validator_failed</string> </key>
+                    <value> <string>The input failed the external validator.</string> </value>
+                </item>
+                <item>
+                    <key> <string>required_not_found</string> </key>
+                    <value> <string>Input is required but no input given.</string> </value>
+                </item>
+                <item>
+                    <key> <string>too_long</string> </key>
+                    <value> <string>Too much input was given.</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <int>20</int> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Site</string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.TALESField</string>
+          <string>TALESMethod</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>python: here.Baobab_getStrippedPath(object=cell, site=1)</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultInventoryList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultInventoryList.xml
index 85404d5c2f..8153016524 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultInventoryList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultInventoryList.xml
@@ -89,7 +89,7 @@
     if result != 0:\n
       return result\n
 \n
-    result = cmp(a.date,b.date)\n
+    result = cmp(getattr(a,\'date\',None),getattr(b,\'date\',None))\n
     return result\n
 \n
   currency_cash_list.sort(sortLines)\n
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 069a14805b..8f667e61e3 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
@@ -114,6 +114,8 @@ if kw.has_key("explanation_portal_type"):\n
   inventory_kw[\'explanation_portal_type\'] = kw[\'explanation_portal_type\']\n
 \n
 if at_date is not None:\n
+  # XXX this make sure we look at the end of the day\n
+  at_date = at_date + 0.99\n
   inventory_kw[\'at_date\'] = at_date\n
 \n
 \n
@@ -219,8 +221,9 @@ for resource in resource_dict.keys():\n
     except KeyError:\n
       resource_in_vault = {\'quantity\' : 0,\'total_price\' : 0}\n
     tmp_dict.update({\'total_quantity\' : resource_in_vault[\'quantity\'],\n
-        \'total_price\' : resource_in_vault[\'total_price\'],\n
-        \'date\':resource_in_vault[\'date\']})\n
+        \'total_price\' : resource_in_vault[\'total_price\'],})\n
+    if vault_report_type==\'history\':\n
+      tmp_dict.update({\'date\':resource_in_vault[\'date\']})\n
     general_total_price += resource_in_vault[\'total_price\']\n
   context.log(\'total_quantity\',tmp_dict[\'total_quantity\'])\n
   context.log(\'total_price\',tmp_dict[\'total_price\'])\n
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyExchangeLine_view/listbox.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyExchangeLine_view/listbox.xml
index a7ec250bd2..13c10d034b 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyExchangeLine_view/listbox.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyExchangeLine_view/listbox.xml
@@ -437,6 +437,10 @@
                       <list/>
                     </value>
                 </item>
+                <item>
+                    <key> <string>page_template</string> </key>
+                    <value> <string></string> </value>
+                </item>
                 <item>
                     <key> <string>portal_types</string> </key>
                     <value>
@@ -469,7 +473,7 @@
                 </item>
                 <item>
                     <key> <string>selection_name</string> </key>
-                    <value> <string></string> </value>
+                    <value> <string>currency_exchange_line_selection</string> </value>
                 </item>
                 <item>
                     <key> <string>sort</string> </key>
@@ -523,7 +527,7 @@
       <dictionary>
         <item>
             <key> <string>method_name</string> </key>
-            <value> <string>objectValues</string> </value>
+            <value> <string>contentValues</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyExchange_getCurrencyList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyExchange_getCurrencyList.xml
index b967723548..e4c3c16ddd 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyExchange_getCurrencyList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyExchange_getCurrencyList.xml
@@ -87,6 +87,12 @@ return getCurrencyList()\n
               <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>
@@ -161,4 +167,25 @@ return getCurrencyList()\n
       </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/Delivery_getMovementList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Delivery_getMovementList.xml
index daae01e1f7..53933e3284 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Delivery_getMovementList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Delivery_getMovementList.xml
@@ -80,6 +80,7 @@ if len(portal_type) != 2:\n
   return context.getMovementList(portal_type=portal_type)\n
 \n
 line_list = context.objectValues(portal_type=portal_type[0])\n
+#context.log(\'line_list\', line_list)\n
 invert = 0\n
 if len(line_list) == 0:\n
   # try with the second portal type\n
diff --git a/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/check_workflow/states/archived.xml b/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/check_workflow/states/archived.xml
index 6f7a3ad1d8..ebc199598e 100644
--- a/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/check_workflow/states/archived.xml
+++ b/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/check_workflow/states/archived.xml
@@ -24,10 +24,30 @@
               <none/>
             </value>
         </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
         <item>
             <key> <string>id</string> </key>
             <value> <string>archived</string> </value>
         </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Archived (Check)</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>
diff --git a/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/counter_date_workflow/scripts/openAllCounter.xml b/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/counter_date_workflow/scripts/openAllCounter.xml
index 9d24ba4ebe..31a82c7b7c 100644
--- a/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/counter_date_workflow/scripts/openAllCounter.xml
+++ b/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/counter_date_workflow/scripts/openAllCounter.xml
@@ -68,7 +68,21 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>listbox = state_change.kwargs.get(\'listbox\')\n
+            <value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
+from Products.ERP5Type.Message import Message\n
+\n
+listbox = state_change.kwargs.get(\'listbox\')\n
+\n
+# First make sure we can open a counter date only\n
+# if the date defined on the document is the current date\n
+counter_date = state_change[\'object\']\n
+start_date = counter_date.getStartDate()\n
+from DateTime import DateTime\n
+now = DateTime()\n
+\n
+if now.Date() != start_date.Date():\n
+  msg = Message(domain=\'ui\',message="Sorry, the date is not today")\n
+  raise ValidationFailed (msg,)\n
 \n
 for line in listbox:\n
   if line["choice"] == "open":\n
@@ -125,11 +139,20 @@ for line in listbox:\n
                             <string>state_change</string>
                             <string>args</string>
                             <string>kw</string>
+                            <string>Products.DCWorkflow.DCWorkflow</string>
+                            <string>ValidationFailed</string>
+                            <string>Products.ERP5Type.Message</string>
+                            <string>Message</string>
                             <string>_getattr_</string>
                             <string>listbox</string>
+                            <string>_getitem_</string>
+                            <string>counter_date</string>
+                            <string>start_date</string>
+                            <string>DateTime</string>
+                            <string>now</string>
+                            <string>msg</string>
                             <string>_getiter_</string>
                             <string>line</string>
-                            <string>_getitem_</string>
                             <string>context</string>
                             <string>counter</string>
                           </tuple>
diff --git a/bt5/erp5_banking_core/bt/revision b/bt5/erp5_banking_core/bt/revision
index 7003e7fe1f..eebd1d10b6 100644
--- a/bt5/erp5_banking_core/bt/revision
+++ b/bt5/erp5_banking_core/bt/revision
@@ -1 +1 @@
-51
\ No newline at end of file
+61
\ No newline at end of file
-- 
2.30.9