Commit fcbbd3f8 authored by Jérome Perrin's avatar Jérome Perrin

accounting: fix a bug when closing accounting period the same day as daylight saving time switch

parent 5fac6732
...@@ -116,9 +116,14 @@ if group_value is not None:\n ...@@ -116,9 +116,14 @@ if group_value is not None:\n
section_list.extend(getDependantSectionList(group_value, section))\n section_list.extend(getDependantSectionList(group_value, section))\n
\n \n
def createBalanceTransaction(section):\n def createBalanceTransaction(section):\n
balance_date = at_date + 1\n
# We discard hours, minutes and seconds and at the same time, make sure the date\n
# is in its "normal timezone". For example, when at_date is the day of a dailight saving\n
# time switch, we want this date to be in the new timezone.\n
balance_date = DateTime(balance_date.year(), balance_date.month(), balance_date.day())\n
return portal.accounting_module.newContent(\n return portal.accounting_module.newContent(\n
portal_type=\'Balance Transaction\',\n portal_type=\'Balance Transaction\',\n
start_date=(at_date + 1).earliestTime(),\n start_date=balance_date,\n
title=context.getTitle() or Base_translateString(\'Balance Transaction\'),\n title=context.getTitle() or Base_translateString(\'Balance Transaction\'),\n
destination_section_value=section,\n destination_section_value=section,\n
resource=section_currency,\n resource=section_currency,\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment