From fb0e33cf86d74adfea0b215edc6914458b7e5a26 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Fri, 2 Jan 2009 15:27:18 +0000
Subject: [PATCH] Use start date to guess the year for which the reference will
 be computed, this allows testing reference generation for non-current year
 (start_date is verified to be the same as now in regular use). Remove an
 unneeded date cast in catalog parameters.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25003 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../counter_date_workflow/scripts/openAllCounter.xml          | 4 ++--
 bt5/erp5_banking_core/bt/revision                             | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

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 4e03667212..5ede8c928e 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
@@ -120,10 +120,10 @@ if listbox is not None:\n
 \n
 \n
 # Set a reference\n
-first_day_of_year = DateTime(now.year(), 1, 1)\n
+first_day_of_year = DateTime(start_date.year(), 1, 1)\n
 counter_date_list = [x.getObject() for x  in context.portal_catalog(\n
                                            portal_type=\'Counter Date\',site_uid=site_uid,\n
-                                           start_date={\'type\': \'date\', \'query\': first_day_of_year, \'range\': \'nlt\'},\n
+                                           start_date={\'query\': first_day_of_year, \'range\': \'nlt\'},\n
                                            sort_on=[(\'start_date\',\'descending\')],limit=1,\n
                                            simulation_state=(\'open\',\'closed\'))]\n
 previous_reference = None\n
diff --git a/bt5/erp5_banking_core/bt/revision b/bt5/erp5_banking_core/bt/revision
index d7b14a6c47..1e27e32d42 100644
--- a/bt5/erp5_banking_core/bt/revision
+++ b/bt5/erp5_banking_core/bt/revision
@@ -1 +1 @@
-476
\ No newline at end of file
+478
\ No newline at end of file
-- 
2.30.9