The ImportBankStatement Process does not create a working instance of MBankStatement. The field dateAcct is not set but it is mandatory and so the save() method does not work.
I wonder how this code has ever worked. Perhaps it is broken with but I do not really see how this worked before.
For me this works better. I am a bit confused because I do still not understand how this bug could be introduced. I am sure this worked for Jorg JAnke.
Thomas, could you please test this different approach?
You're right that was broken by - thanks for the finding
C_BankStatement.DateAcct didn't exist before
now - your patch just fixes the import - but this fix is more generic
I think you approach makes it much more robust for all code parts that use the MBankStatement.
But it does not solve the importer issue well. In the old code the real posted accounting date was the date that came from the statement line. So the accounting date of the bank statement was in real never used. It seems that for this reason it was never set anywhere in the importer. So it stays at the value your constructor gives it: System.currentTimeMillis(). We still need to change the importer too!
For the import we need a way to set this value like we did before with the line's acctDate. So to have a behaviour like before we should set the value that was before set to line.setDateAcct() now also to statement.setDateAcct().
So I propose to add
instead of my old patch.
Thanks for your perfect patch.
I tested it and it works for me. I will close this issue now.