Closed MattiLE closed 2 years ago
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
Hi Al-team, in the function CreatePrepaymentLines from Codeunit Sales-Post a GLAcc record is read. Which record is read can be changed via the function GetSalesPrepmtAccount.
GLAcc.Get(GenPostingSetup.GetSalesPrepmtAccount);
Normally, the "Sales Prepayment Account" G/L account is returned in the GetSalesPrepmtAccount function. The function uses the Handled Pattern to change the return value.
A few lines later in the CreatePrepaymentLines function a new TempPrepmtSalesLine is to be written where the "No." field is validated.
TempPrepmtSalesLine.Validate("No.", GenPostingSetup."Sales Prepayments Account");
Here, the field "Sales Prepayments Account" from the table GenPostingSetup is now used directly. My suggestion is to now simply use the G/L account read above for this assignment.Here is the complete code snippet: