-
Notifications
You must be signed in to change notification settings - Fork 458
[Master] - Bug 647253: [WHT] Inconsistency with the Payments #10545
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
base: main
Are you sure you want to change the base?
Changes from all commits
ba3cb0d
e2c12c0
83c66dc
d13fc08
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 |
|---|---|---|
|
|
@@ -78,6 +78,7 @@ codeunit 6785 "Withholding Tax Mgmt." | |
| WithholdingMinInvNotConsistentErr: Label 'You cannot post a transaction using different Withholding Tax minimum invoice amounts on lines.'; | ||
| DiffWithholdingPostGroupsErr: Label 'The Withholding Tax posting groups are different and thus the entries cannot be apply.'; | ||
| MissingRevenueTypeErr: Label 'The Withholding Tax Entry you are trying to process contains WHT Revenue Type `%1`. Please add this value to your Withholding Revenue Types and post again.', Comment = '%1 = Withholding Revenue Type'; | ||
| GenJnlTemplateNotFoundErr: Label 'A general journal template with Type Purchases does not exist.'; | ||
| MustbeNegativeLbl: Label 'must be positive.'; | ||
| OneLbl: Label 'ONE'; | ||
| TwoLbl: Label 'TWO'; | ||
|
|
@@ -4240,10 +4241,12 @@ codeunit 6785 "Withholding Tax Mgmt." | |
| if Source = Source::Vendor then | ||
| GenJnlTemplate.SetRange(Type, GenJnlTemplate.Type::Purchases); | ||
|
|
||
| if GenJnlTemplate.FindFirst() then | ||
| if GenJnlTemplate.FindFirst() then begin | ||
|
ViditGupta1277 marked this conversation as resolved.
ViditGupta1277 marked this conversation as resolved.
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. GenJnlTemplate.SetRange(Type, GenJnlTemplate.Type::Purchases) is only executed when Source = Source::Vendor; for any other Source value the SetRange is never applied, so the subsequent GenJnlTemplate.FindFirst() runs unfiltered against the whole Gen. Journal Template table. In that code path, the new else Error(GenJnlTemplateNotFoundErr) message 'A general journal template with Type Purchases does not exist.' is misleading: the check never actually verified a Purchases-type template exists, only that some template exists. Either apply an equivalent type-specific filter for the non-Vendor source before the FindFirst() check, or use a message that accurately reflects the unfiltered check performed in that branch. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.41.6
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 public procedure that posts withholding-tax payments now raises an unconditional Error when no Purchases-type Gen. Journal Template exists. Before this change, that path was a silent no-op, so existing extensions and normal WHT payment posting flows could succeed without that template. After upgrade, the same calls will start failing at runtime for existing customers/partners with that setup. Preserve the previous behavior for the existing call path, or move the new validation behind a separate compatibility-safe path instead of changing this existing contract in place. Agent judgement — not directly backed by a BCQuality knowledge article. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.41.6 |
||
| if GenJnlLine."Journal Template Name" <> GenJnlTemplate.Name then | ||
| if WithholdingTaxEntry2.Amount <> 0 then | ||
| InsertWithholdingTaxPostingBuffer(WithholdingTaxEntry2, GenJnlLine, 0, AmountWithDisc); | ||
| end else | ||
|
ViditGupta1277 marked this conversation as resolved.
|
||
| Error(GenJnlTemplateNotFoundErr); | ||
|
ViditGupta1277 marked this conversation as resolved.
ViditGupta1277 marked this conversation as resolved.
ViditGupta1277 marked this conversation as resolved.
|
||
| end; | ||
| until (WithholdingTaxEntry.Next() = 0); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.