Hi, we have an issue where items are being issued after the inventory is closed by accounting, so we get an error that inventory is closed.
To have them be able to work on the month-end night, I am trying to change the date the journal gets posted to the day after.
I do this with this code before posting the picking list :
DateTimeUtil::setSystemDateTime(DatetimeUtil::addDays(DateTimeUtil::utcNow(), 1));
However, I get an error about the ledgervoucher being null. In the Voucher posting code, I see this:
LedgerVoucherObject findLedgerVoucherObject( Voucher _voucher = lastVoucher, TransDate _accountingDate = lastTransDate, CurrentOperationsTax _postingLayer = lastPostingLayer) { ledgerVoucherList.find(_voucher, _accountingDate, _postingLayer); return ledgerVoucherList.item(); }
The lastTransDate is not tomorrow, it is today, and it seems to be causing the issue.
Is there anything I can do?