From 06fe8a95d06275365bced4d96561bd2afd81a9c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 28 Mar 2013 16:22:19 +0100
Subject: [PATCH] Fix getting the accounting period start date when the date
 passed is at a period boundary

---
 .../Base_getAccountingPeriodStartDateForSectionCategory.xml     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Base_getAccountingPeriodStartDateForSectionCategory.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Base_getAccountingPeriodStartDateForSectionCategory.xml
index 2a5918e779..c0cd0da48c 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Base_getAccountingPeriodStartDateForSectionCategory.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Base_getAccountingPeriodStartDateForSectionCategory.xml
@@ -73,7 +73,7 @@ def getAccountingPeriodStartDateForSectionCategory(section_category, date):\n
                                          \'started\', \'stopped\',\n
                                          \'closing\', \'delivered\'):\n
         continue\n
-      if ap.getStartDate() <= date <= ap.getStopDate():\n
+      if ap.getStartDate().earliestTime() <= date <= ap.getStopDate().latestTime():\n
         period_start_date = ap.getStartDate().earliestTime()\n
     if period_start_date:\n
       break\n
-- 
2.30.9