Theres a customization done in above procedure which is in Sales-Post codeunit.
Sales-Post>>PostSalesLine>> InsertPrepmtAdjInvPostingBuf
This is a copy of the standard Sales-Post codeunit.
I upgraded the code to BC14 to BC24 and I cannot find the same procedure there as it is deprecated. which is as below
How to do the same customization in BC24 code?