I am experiencing some inconsistent behaviour around the session date when importing Bank Statements using Electronic Reporting definitions and I'm hoping someone can shed some light on this? The Accounting Date on any manually created Bank Statement defaults to the session date, but on importing statements using an Electronic Reporting definition, this behaviour is not consistent.
- If I change the session date to July 1st 2023 by clicking the calendar on the home screen, then import, it ignores this session date and sets the Accounting Date on the statement to the literal current date. If I then go to check the session date and time afterwards using any UI method, it shows as July 1st 2023.
- If I change the session date under Common > Common > Session date and time, and tick the /cascade to business operations/ option, then do the import, it correctly sets the Accounting Date on the statement to July 1st 2023, as expected.
I have debugged and found that the value is set by Tables//BankStmtISOAccountStatement.initValue(), which defaults the Accounting Date like so:
this.AccountingDate = DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone());
Debugging this line, if I set the session date using method 1 above, this.AccountingDate gets the value of the literal date and time. With option 2, it changes to the session date. Therefore this is the root cause of the inconsistency, but I can't understand why this behaviour is occurring. DateTimeUtil::getSystemDate() effectively does not appear to get the session date correctly when it is set using the calendar on the Default Dashboard, but only in the context of an ER import. Does an ER import run under a different user context or something along those lines?
So far, I have tested and replicated this in 10.0.33 and 10.0.35