diff --git a/bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.MonthlyRangeMovementGroup.py b/bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.MonthlyRangeMovementGroup.py index 3b4431689249446267db22674c0d300020a06f12..da3eaff978cbc61a056db0d29c9a75d182b26b06 100644 --- a/bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.MonthlyRangeMovementGroup.py +++ b/bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.MonthlyRangeMovementGroup.py @@ -27,6 +27,7 @@ ############################################################################## from erp5.component.document.MovementGroup import MovementGroup +from DateTime import DateTime from Products.ERP5Type.DateUtils import atTheEndOfPeriod @@ -48,7 +49,9 @@ class MonthlyRangeMovementGroup(MovementGroup): for property_name in self.getTestedPropertyList() or ('start_date', 'stop_date'): date = movement.getProperty(property_name, None) if date is not None: - end_of_month = atTheEndOfPeriod(date, 'month')-1 + # wrap atTheEndOfPeriod value with DateTime(value..strftime('%Y/%m/%d')) so that + # it returns a value with an appropriate time offset at that date. + end_of_month = DateTime((atTheEndOfPeriod(date, 'month')-0.5).strftime('%Y/%m/%d')) property_dict[property_name] = end_of_month return property_dict