G/L budget amounts are imported into the wrong periods
Modified on: Tue, Dec 13, 2016 at 9:37 AM
|When you import a G/L budget from Excel, the amounts are imported into the wrong periods in the North American version of Microsoft Dynamics NAV 2013. For example, January amounts are imported into December, February amounts are imported into January, etc.
This problem is caused by the way the .net variable DateTimeHelper.FromOADate(Decimal) function handles time zones.
Refer to https://mbs2.microsoft.com/Knowledgebase/kbdisplay.aspx?WTNTZSMNWUKNTMMYVWQXNRNXTVKNSKYVSSYWTSMSMUQSNKWW
- Add the line of code in bold to the ParseCellValue function in table 370 - Excel Buffer:
IF ((STRPOS(FormatString,'y') <> 0) OR
(STRPOS(FormatString,'m') <> 0) OR
(STRPOS(FormatString,'d') <> 0)) AND
(STRPOS(FormatString,'Red') = 0)
// Excel Date is stored in OATime format
Decimal += 0.5; // Add time offset to help FromOADate select the correct date.
DateTime := DateTimeHelper.FromOADate(Decimal);
"Cell Type" := "Cell Type"::Date;
"Cell Value as Text" := FORMAT(DT2DATE(DateTime));
Did you find it helpful?
Sorry we couldn't be helpful. Help us improve this article with your feedback.