-
Notifications
You must be signed in to change notification settings - Fork 412
[Master]-]Withholding Tax Entries are not generated at payment because the Withholding Tax. Prod. Posting Group field gets not transferred to the payment line #9375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
87105ec
c83343d
46ca7ba
7d3200e
b98b4a8
015bc39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1683,6 +1683,36 @@ codeunit 6786 "Withholding Tax Jnl Subscriber" | |
| PostUnrealizedWHT(GenJournalLine, GenJnlPostLine); | ||
| end; | ||
|
|
||
|
|
||
| [EventSubscriber(ObjectType::Page, Page::"Create Payment", OnBeforeUpdateGnlJnlLineDimensionsFromVendorPayment, '', false, false)] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AssignWHTPostingGroupOnCreatePayment only subscribes to Page "Create Payment"'s OnBeforeUpdateGnlJnlLineDimensionsFromVendorPayment event, so the Wthldg.Tax Prod. Post. Group is copied to the payment line only when a payment is created via the Vendor Ledger Entries "Create Payment" action. The very similar OnBeforeUpdateGnlJnlLineDimensionsFromVendorPaymentBuffer event, raised by the Suggest Vendor Payments report/batch job in every localization layer (W1, NA, IT, RU, CH, ES, APAC, FI), has no corresponding subscriber added in this PR. Payment lines generated by Suggest Vendor Payments will therefore still have a blank Wthldg. Tax Prod. Post. Group, leaving the exact bug this PR fixes unresolved for that entry point. Recommendation:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
||
| local procedure AssignWHTPostingGroupOnCreatePayment(var GenJournalLine: Record "Gen. Journal Line"; TempVendorPaymentBuffer: Record "Vendor Payment Buffer" temporary) | ||
| var | ||
| VendorLedgerEntry: Record "Vendor Ledger Entry"; | ||
| WithholdingTaxEntry: Record "Withholding Tax Entry"; | ||
| begin | ||
| if CheckWithholdingTaxDisabled() then | ||
| exit; | ||
|
|
||
| if GenJournalLine."Applies-to ID" = '' then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The guard
|
||
| exit; | ||
|
|
||
| if TempVendorPaymentBuffer."Vendor Ledg. Entry No." = 0 then | ||
| exit; | ||
|
|
||
| VendorLedgerEntry.SetLoadFields("Document No.", "Vendor No."); | ||
| VendorLedgerEntry.Get(TempVendorPaymentBuffer."Vendor Ledg. Entry No."); | ||
|
|
||
| WithholdingTaxEntry.SetLoadFields("Wthldg. Tax Prod. Post. Group"); | ||
| WithholdingTaxEntry.SetRange("Document No.", VendorLedgerEntry."Document No."); | ||
| WithholdingTaxEntry.SetRange("Transaction Type", WithholdingTaxEntry."Transaction Type"::Purchase); | ||
| WithholdingTaxEntry.SetRange("Document Type", WithholdingTaxEntry."Document Type"::Invoice); | ||
| WithholdingTaxEntry.SetRange("Bill-to/Pay-to No.", VendorLedgerEntry."Vendor No."); | ||
|
neeleshsinghal marked this conversation as resolved.
|
||
| if not WithholdingTaxEntry.FindFirst() then | ||
| exit; | ||
|
|
||
| GenJournalLine."Wthldg. Tax Prod. Post. Group" := WithholdingTaxEntry."Wthldg. Tax Prod. Post. Group"; | ||
| end; | ||
|
|
||
| local procedure PostUnrealizedWHT(var GenJnlLine: Record "Gen. Journal Line"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line") | ||
| var | ||
| GenJournalLineWHT: Record "Gen. Journal Line"; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.