-
Notifications
You must be signed in to change notification settings - Fork 688
Description
🕮 Describe the issue
When using the Page 6630 "Sales Return Order" with the action "GetPostedDocumentLinesToReverse", the Payment Method Code field is not validated after getting the Sales Lines, resulting in missing 1 Customer Ledger Entry for Refund. We can already see the missing posting in "Posting Preview".
🔧 To Reproduce
- create a new sales return order
- select any customer with Posted Invoices. Note: Payment Method Code is still empty, which is fine.
- Choose any Document, you want to reverse.
- Payment method code is filled in.
- If we look on posting preview in Customer Ledger Entries, there is only 1 entry for Credit memo, 0 for Refund.
📣 Expected behavior
If you validate the Payment Method code manually and look at the preview, there are 2 Customer Ledger Entries, 1 for credit memo, 1 for refund.
Screenshots
Wrong Behaviour missing refund entry

Correct behaviour, after manual validate of Payment Method Code

Additional context
-
I analyzed the code but didn't find the right spot, where "Payment Method Code" is entered but not validated. The best guess is in codeunit 6620 "Copy Document Mgt.", function CopySalesInvLinesToDoc or deeper in code.
-
With a manual validate of the field "Payment Methode Code" the code in the Validate Trigger is run, guess this is missing.
"Bal. Account Type" := PaymentMethod."Bal. Account Type";
"Bal. Account No." := PaymentMethod."Bal. Account No."; -
I guess all copy functions of where of Posted Shipments, Invoices, Return Receipts or Credit Memo have the same wrong behavior.