Skip to content

Port NAV Extract-ES-Cartera changes from bugs branch#9002

Open
Alexander-Ya wants to merge 28 commits into
mainfrom
bugs/Extract-ES-Cartera-module-to-object-extensions
Open

Port NAV Extract-ES-Cartera changes from bugs branch#9002
Alexander-Ya wants to merge 28 commits into
mainfrom
bugs/Extract-ES-Cartera-module-to-object-extensions

Conversation

@Alexander-Ya

@Alexander-Ya Alexander-Ya commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What & why

Linked work

Fixes AB#636627

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)

Risk & compatibility

@Alexander-Ya
Alexander-Ya requested a review from a team July 1, 2026 14:47
@Alexander-Ya Alexander-Ya added the Finance GitHub request for Finance area label Jul 1, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 1, 2026
@Alexander-Ya Alexander-Ya added the Delocalization Extracting from country layers and converting local functionality to app label Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 15 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Findings by domain

Findings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).

Domain Findings Knowledge-backed Agent Inline Fallback
Performance 4 4 0 4 0
Style 5 5 0 5 0

Totals: 9 knowledge-backed · 0 agent findings.

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as off-topic.

@github-actions

This comment was marked as off-topic.

@github-actions

This comment was marked as off-topic.

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 2

Recommendation: Request Changes

What this PR does

This PR extracts the Spanish Cartera code into src/Layers/ES/BaseApp/Local/Cartera, moves base table and page changes into extensions, and adds integration events on the Sales, Purchase, and journal posting objects so the Cartera code can run from event subscribers. Since round 1, one commit ("Add missing changes") propagates the new OnAfterTestDocumentNo publisher on GenJnlCheckLine from the W1 base into the country layers (APAC, CH, FI, FR, IT, NA, NL, NO, RU).

Correctness of the event wiring is good: the publishers the ES subscribers use (OnAfterProcessPostingLines and OnAfterCheckPostRestrictions on Sales-Post/Purch.-Post, and OnAfterTestDocumentNo on Gen. Jnl.-Check Line) are all added by this same PR in the in-repo BaseApp layers, and the round-2 propagation keeps the country layers consistent with W1. The blocking problem is not the event contract; it is that the ES app build does not compile at this head.

Status of previous suggestions
ID Title Status Note
S1 Confirm the BaseApp publishers first Withdrawn (reviewer error) The publishers are added by this PR in the in-repo BaseApp (src/Layers/W1/BaseApp plus country layers), so there is no external or unmerged BaseApp dependency. The round-1 check looked in the wrong location.
S2 Add coverage for the extraction flow Not addressed The PR still adds no test codeunit. The *Test.Report.al files are Cartera report objects, not automated tests.
S3 Fix the failed build/app-change check Not addressed Build Apps ES (Default) still reports FAILURE at the current head, so the ES app does not compile.
New observations (commits since round 1)

S4 - Publisher propagation to country layers
The new commit adds the OnAfterTestDocumentNo publisher on Gen. Jnl.-Check Line to the country layers to match the W1 base. This is consistent and not a blocker; just confirm every layer that hosts a Cartera subscriber also has the matching publisher so no layer build is left without the event.

Risk assessment and necessity

Risk: High. The diff touches Sales and Purchase posting, journal checks, customer/vendor ledger entries, payment methods, permissions, and pages across the W1 base and many country layers. The event contract itself now looks self-contained inside this PR, which lowers the earlier concern. The remaining risk is concentrated in the failing ES build: until the ES app compiles, the extracted behavior cannot be validated at all, and a broken layer build blocks the whole change.

Necessity: The linked work item AB#636627 is a Deliverable for extracting ES Cartera to object extensions, so the large scope is expected for that goal. The change is not mergeable yet because the ES app build fails; once it compiles, confirm that the existing ES Cartera tests still exercise the extracted objects (bill groups, payment orders, settlement, blocked-settlement checks), since this is sensitive posting logic that moved.


[AI-PR-REVIEW] version=1 system=github pr=9002 round=2 by=alexei-dobriansky at=2026-07-02 lastSha=9c25985513c694b13930a150ee9f7d2deb3275dc suggestions=S1:withdrawn,S2:notaddressed,S3:notaddressed,S4:new parentRound=1

Comment thread src/Layers/ES/BaseApp/Local/Cartera/Purchases/Posting/CRTPurchPost.Codeunit.al Outdated
{
actions
{
addlast(reporting)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Accessibility} \quad \color{gray}{\texttt{\small Iteration\ 15}}$

The Small Business Owner role center originally placed the Cartera reporting block right after Customer - Due Payments, but this extension re-adds it with addlast(reporting), moving the Cartera reports away from the related due-payments actions.

Re-anchor the block after Customer - Due Payments to preserve the original layout.

Suggested change
addlast(reporting)
addafter("Customer - Due Payments")

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

$\textbf{🟠\ High\ Severity\ —\ Performance} \quad \color{gray}{\texttt{\small Iteration\ 15}}$

PostSettlementForPostedPmtOrder and PostSettlementForPostedBillGroup (new procedures added by this PR) call GenJournalLine.FindSet() on an unfiltered Gen.

Journal Line record. Neither caller applies SetRange/SetFilter before invoking these procedures, so each call iterates every visible journal line instead of only the settlement lines for the current posted payment order or bill group.

Knowledge:

Posting this finding as an issue comment because inline comment placement failed.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

Comment on lines +70 to +73
VendLedgEntry.SetFilter("Document Situation", '<>%1', VendLedgEntry."Document Situation"::" ");
VendLedgEntry.SetRange("Vendor No.", PurchHeader."Pay-to Vendor No.");
VendLedgEntry.SetRange(Open, true);
if VendLedgEntry.FindSet() then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟠\ High\ Severity\ —\ Performance} \quad \color{gray}{\texttt{\small Iteration\ 15}}$

The new Vendor Ledger Entry scan iterates a production-scale table and only reads a small subset of fields (Document Situation, Document Status, Document Type, Document No.), but it never calls SetLoadFields(...) before FindSet().

That makes each iteration materialize the full ledger-entry row unnecessarily; add SetLoadFields before the read.

Suggested change
VendLedgEntry.SetFilter("Document Situation", '<>%1', VendLedgEntry."Document Situation"::" ");
VendLedgEntry.SetRange("Vendor No.", PurchHeader."Pay-to Vendor No.");
VendLedgEntry.SetRange(Open, true);
if VendLedgEntry.FindSet() then
VendLedgEntry.SetFilter("Document Situation", '<>%1', VendLedgEntry."Document Situation"::" ");
VendLedgEntry.SetRange("Vendor No.", PurchHeader."Pay-to Vendor No.");
VendLedgEntry.SetRange(Open, true);
VendLedgEntry.SetLoadFields("Document Situation", "Document Status", "Document Type", "Document No.");
if VendLedgEntry.FindSet() then

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

CustLedgEntry.SetCurrentKey("Document No.", "Document Type", "Customer No.");
CustLedgEntry.SetFilter("Document Type", '%1|%2', CustLedgEntry."Document Type"::Invoice,
CustLedgEntry."Document Type"::Bill);
CustLedgEntry.SetFilter("Document Situation", '<>%1', CustLedgEntry."Document Situation"::" ");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟠\ High\ Severity\ —\ Performance} \quad \color{gray}{\texttt{\small Iteration\ 15}}$

The new Customer Ledger Entry scan iterates a production-scale table and only reads a small subset of fields (Document Situation, Document Status, Document Type, Document No.), but it never calls SetLoadFields(...) before reading rows.

That makes each iteration materialize the full ledger-entry row unnecessarily; add SetLoadFields before the read.

Suggested fix (apply manually — could not be anchored as a one-click suggestion):

            CustLedgEntry.SetFilter("Document Situation", '<>%1', CustLedgEntry."Document Situation"::" ");
            CustLedgEntry.SetRange("Customer No.", SalesHeader."Bill-to Customer No.");
            CustLedgEntry.SetRange(Open, true);
            CustLedgEntry.SetLoadFields("Document Situation", "Document Status", "Document Type", "Document No.");
            if CustLedgEntry.Find('-') then

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

PurchPost: Codeunit "Purch.-Post";
#endif
begin
if PaymentMethod.Get(PurchHeader."Payment Method Code") then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Performance} \quad \color{gray}{\texttt{\small Iteration\ 15}}$

PaymentMethod.Get(...) runs before the Invoice guard.

On non-invoice purchase postings this lookup is unused, so the branch pays an avoidable database round-trip. Move the cheap PurchHeader.Invoice guard ahead of the Get.

Suggested fix (apply manually — could not be anchored as a one-click suggestion):

        if PurchHeader.Invoice and PaymentMethod.Get(PurchHeader."Payment Method Code") then
            if (PaymentMethod."Create Bills" or PaymentMethod."Invoices to Cartera") and
               (not CarteraSetup.ReadPermission)
            then
                Error(CannotCreateCarteraDocErr);

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

#endif
begin
// Create Bills
if PaymentMethod.Get(SalesHeader."Payment Method Code") then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Performance} \quad \color{gray}{\texttt{\small Iteration\ 15}}$

PaymentMethod.Get(...) runs before the Invoice guard.

On non-invoice sales postings this lookup is unused, so the branch pays an avoidable database round-trip. Move the cheap SalesHeader.Invoice guard ahead of the Get.

Suggested fix (apply manually — could not be anchored as a one-click suggestion):

        if SalesHeader.Invoice and PaymentMethod.Get(SalesHeader."Payment Method Code") then
            if (PaymentMethod."Create Bills" or PaymentMethod."Invoices to Cartera") and
               (not CarteraSetup.ReadPermission)
            then
                Error(CannotCreateCarteraDocErr);

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

TotalVATAmount: Decimal;

Text1100000Err: Label 'The Bill Group does not exist.';
Text1100001Err: Label 'This Bill Group has already been printed. Proceed anyway?';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Style} \quad \color{gray}{\texttt{\small Iteration\ 15}}$

Text1100001Err and Text1100004Err are used in Confirm() prompts, so their Err suffix is misleading.

Per AA0074, confirmation text should use the Qst suffix to match how the label is consumed.

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

Text1100010Err: Label '%1 must be of a type that creates bills.', Comment = '%1=Field Name';
Text1100011Err: Label 'A grouped document cannot be settled from a journal. Remove it from its group or payment order and try again.';
Text1100012Err: Label 'cannot be filtered when posting recurring journals';
Text1100013Err: Label 'Do you want to post the journal lines and print the posting report?';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Style} \quad \color{gray}{\texttt{\small Iteration\ 15}}$

Labels Text1100013Err and Text1100014Err are passed to Confirm(), and Text1100016Err and Text1100017Err are passed to Message().

The Err suffix contradicts their actual usage; per AA0074, Confirm/StrMenu text should use Qst and Message text should use Msg.

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why


UntitledLbl: Label 'untitled';
CollExpensesLbl: Label 'CollExpenses';
OutOfRangeLbl: Label 'Out of Range';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Style} \quad \color{gray}{\texttt{\small Iteration\ 15}}$

OutOfRangeLbl is raised with Error(), so its Lbl suffix contradicts the way the text is consumed.

Per AA0074, text passed to Error() should use the Err suffix.

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why


Text1100000Err: Label 'No bills have been found that can be settled. \';
Text1100001Err: Label 'Please check that at least one open bill was selected.';
Text1100002Err: Label 'Related to Bill,Related to Bill Group';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Style} \quad \color{gray}{\texttt{\small Iteration\ 15}}$

Text1100002Err supplies the option text for StrMenu(), so the Err suffix does not match its actual use.

Per AA0074, labels consumed by Confirm/StrMenu should use the Qst suffix.

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

SourceCodeSetup: Record "Source Code Setup";
CarteraReportSelection: Record "Cartera Report Selections";
Text1100001: Label 'Cartera Journal';
CARJNLTok: Label 'CARJNL';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Style} \quad \color{gray}{\texttt{\small Iteration\ 15}}$

CARJNLTok is a source-code token, not natural-language UI text.

Tokens like this should be declared with Locked = true so translation cannot rewrite the value.

Suggested change
CARJNLTok: Label 'CARJNL';
CARJNLTok: Label 'CARJNL', Locked = true;

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 4

Recommendation: Request Changes

What this PR does

This PR extracts Spanish Cartera code into src/Layers/ES/BaseApp/Local/Cartera and keeps the required BaseApp hooks in the in-repo W1 and country layers. Since round 3, the new commits mainly fix compile problems, adjust event subscribers, rename the company initialization object back, and repair the ES and IT app builds.

The in-repo publisher check still resolves for the new subscribers I sampled, including OnInsertVATOnAfterAssignVATEntryFields and OnAfterCheckInitialDocumentType. The ES and IT app build jobs now pass at the current head. The PR is still not ready because no real test codeunit was added for the sensitive Cartera extraction, and the current PR status still has failing unit-test jobs.

Status of previous suggestions
ID Title Status Author response
S1 Confirm the BaseApp publishers first Withdrawn Still withdrawn. The publishers are in this PR under src/Layers/**/BaseApp, and I did not find new evidence of a missing external publisher.
S2 Add coverage for the extraction flow Not addressed No author reply found after round 3. The PR still only changes PaymentOrderTest.Report.al and BillGroupTest.Report.al by name, and the diff/branch search found no added Subtype = Test, [Test], or TestPermissions markers under the ES Cartera extraction.
S3 Fix the failed build/app-change check Addressed No author reply found after round 3. Build Apps ES (Default), Build Apps ES (Clean), Build Apps IT (Default), and Build Apps IT (Clean) are SUCCESS at 2cfad94a4cca0710074eed2657ccb1ebd4236ffd.
S4 Publisher propagation to country layers Addressed No author reply found after round 3. The round-4 publisher/subscriber checks resolve in the in-repo W1 and country BaseApp layers.
New observations (commits since round 3)

S5 - Current unit-test checks still fail
The current status rollup still has Build Unit Tests (ES) (LegacyTestsBucket1) and Build Unit Tests (CA) (LegacyTestsBucket1) as FAILURE, plus the aggregate PR status check. The ES job shows a VAT setup test failing with the Cartera bank-account currency error, and the CA job shows sales-tax/document-total failures. Please get the current PR status green before merge.

Risk assessment and necessity

Risk: High. The extraction touches posting-adjacent Cartera behavior, VAT entry data, ledger application, reversal, Navigate, and country-layer BaseApp hooks. A regression here can change posted amounts, blocked validations, or ledger navigation, and the current failing unit-test jobs show the branch is not yet proven safe.

Necessity: AB#636627 is a Deliverable for extracting ES Cartera, so the broad extraction is expected. The change remains necessary, but it needs a green PR status and real automated coverage for the moved posting and Cartera flows before merge.


[AI-PR-REVIEW] version=1 system=github pr=9002 round=4 by=alexei-dobriansky at=2026-07-06 lastSha=2cfad94a4cca0710074eed2657ccb1ebd4236ffd suggestions=S1:withdrawn,S2:notaddressed,S3:addressed,S4:addressed,S5:new parentRound=3

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 5

Recommendation: Request Changes

What this PR does

This PR extracts Spanish Cartera code into src/Layers/ES/BaseApp/Local/Cartera and keeps the required hooks in the in-repo W1 and country BaseApp layers. Since the prior review point, the commits mainly propagate posting/application events, fix compile errors, adjust Cartera subscribers, and restore the ES/IT app builds.

The sampled event wiring still lines up: OnInsertVATOnAfterAssignVATEntryFields now exposes VAT Posting Setup, and the Cartera/SII subscribers use it after the VAT entry fields are assigned. The new apply/unapply hooks also let Cartera keep its blank initial-document-type validation outside the base apply code. The final 2cfad94a commit only changes the company initialization object/file name back to Company-Initialize Cartera, so I do not see a behavior change there.

Status of previous suggestions
ID Title Status Author response
S1 Confirm the BaseApp publishers first Withdrawn Still withdrawn. The publishers are in this PR under src/Layers/**/BaseApp, and I did not find new evidence of a missing external publisher.
S2 Add coverage for the extraction flow Not addressed No author reply found after round 4. A branch search still finds no Subtype = Test, [Test], or TestPermissions markers under the ES Cartera extraction.
S3 Fix the failed build/app-change check Addressed No author reply found after round 4. Build Apps ES (Default/Clean) and Build Apps IT (Default/Clean) are still SUCCESS at the current head.
S4 Publisher propagation to country layers Addressed No author reply found after round 4. The sampled publishers and subscribers still resolve in the in-repo W1 and country BaseApp layers.
S5 Current unit-test checks still fail Not addressed No author reply found after round 4. The current PR checks still fail Build Unit Tests (ES) (LegacyTestsBucket1), Build Unit Tests (CA) (LegacyTestsBucket1), and the aggregate PR status check.
New observations (commits since round 4)

S6 - Payable unapply error text is reversed
Document-Post now raises Text1100103Err + Text1100104Err in UpdateUnAppliedPayableDoc. Keep the old order, Text1100104Err + Text1100103Err, so the %1 placeholder is filled in the right sentence and the message stays readable.

Risk assessment and necessity

Risk: High. The extraction touches posting-adjacent Cartera behavior, VAT entry data, ledger application, reversal, Navigate, and country-layer BaseApp hooks. A regression here can change posted amounts, blocked validations, or ledger navigation, and the current failing unit-test jobs still show the branch is not proven safe.

Necessity: AB#636627 is a Deliverable for extracting ES Cartera, so the broad slice is expected and the direction is still justified. The PR still needs green checks and real automated coverage for the moved Cartera posting flows before merge.


[AI-PR-REVIEW] version=1 system=github pr=9002 round=5 by=alexei-dobriansky at=2026-07-09T23:10:04Z lastSha=2cfad94a4cca0710074eed2657ccb1ebd4236ffd suggestions=S1:withdrawn,S2:notaddressed,S3:addressed,S4:addressed,S5:notaddressed,S6:new parentRound=4

Comment on lines +50 to +59
keys
{
key(Key7000000; "Bill No.")
{
}
key(Key7000001; "Document Situation", "Document Status")
{
SumIndexFields = "Remaining Amount (LCY) stats.", "Amount (LCY) stats.";
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Data\ Modeling}$

The ES Cartera split moves Cust. Ledger Entry additions into CRTCustLedgerEntry.TableExt.al, but the extension only recreates keys on Bill No. and Document Situation/Document Status. The same diff still contains SetCurrentKey("Customer No.", "Document Type", "Document Situation", "Document Status") in the moved statistics pages and SetCurrentKey("Applies-to ID", "Document Type", "Document Situation", "Document Status") in CRTCustEntryApplyPostedEnt.Codeunit.al. Restore those composite keys on the tableextension so the moved Cartera flows keep the key shapes they still request.

Suggested change
keys
{
key(Key7000000; "Bill No.")
{
}
key(Key7000001; "Document Situation", "Document Status")
{
SumIndexFields = "Remaining Amount (LCY) stats.", "Amount (LCY) stats.";
}
}
keys
{
key(Key7000000; "Bill No.")
{
}
key(Key7000001; "Document Situation", "Document Status")
{
SumIndexFields = "Remaining Amount (LCY) stats.", "Amount (LCY) stats.";
}
key(Key7000002; "Customer No.", "Document Type", "Document Situation", "Document Status")
{
SumIndexFields = "Remaining Amount (LCY) stats.", "Amount (LCY) stats.";
}
key(Key7000003; "Applies-to ID", "Document Type", "Document Situation", "Document Status")
{
}
}

Agent judgement — not directly backed by a BCQuality knowledge article.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.12.4

@@ -9778,7 +9778,7 @@ codeunit 12 "Gen. Jnl.-Post Line"
end;

[IntegrationEvent(false, false)]
local procedure OnInsertVATOnAfterAssignVATEntryFields(GenJnlLine: Record "Gen. Journal Line"; var VATEntry: Record "VAT Entry"; CurrExchRate: Record "Currency Exchange Rate")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟠\ High\ Severity\ —\ Events}$

OnInsertVATOnAfterAssignVATEntryFields is a shipped local integration event, so its existing parameters are still a subscriber contract. This change correctly adds VATPostingSetup, but it also changes the existing GenJnlLine parameter from by-value to var, which is subscriber-breaking even on a local publisher.

Suggested fix (apply manually — could not be anchored as a one-click suggestion):

    local procedure OnInsertVATOnAfterAssignVATEntryFields(GenJnlLine: Record "Gen. Journal Line"; var VATEntry: Record "VAT Entry"; CurrExchRate: Record "Currency Exchange Rate"; var VATPostingSetup: Record "VAT Posting Setup")

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.12.4

/// <summary>
/// Event raised by OnSumSalesLines2OnAfterDivideAmount.
/// </summary>
/// <param name="OldSalesLine"></param>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Events}$

This PR adds many event XML doc tags with empty parameter descriptions, for example /// <param name="OldSalesLine"></param> here. The same pattern repeats throughout the canonical W1 posting codeunits (498 added empty <param> tags in SalesPost.Codeunit.al and 281 in PurchPost.Codeunit.al) and in the ES/FR/APAC localization copies spot-checked. Empty tags do not explain the subscriber-facing contract; replace them with real parameter descriptions or omit the tag until it can be documented properly.

Agent judgement — not directly backed by a BCQuality knowledge article.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.12.4

@@ -580,6 +581,13 @@ table 25 "Vendor Ledger Entry"
{
Caption = 'Prepayment';
}
field(91; "Payment Terms Code"; Code[10])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟠\ High\ Severity\ —\ Privacy}$

The new Payment Terms Code Normal field is missing a DataClassification property, so it falls back to ToBeClassified; table-level DataClassification = CustomerContent does not satisfy AS0016. The same omission is repeated in 11 localization copies of VendorLedgerEntry.Table.al.

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.12.4

@@ -853,6 +854,13 @@ table 21 "Cust. Ledger Entry"
Caption = 'Prepayment';
ToolTip = 'Specifies if the related payment is a prepayment.';
}
field(91; "Payment Terms Code"; Code[10])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟠\ High\ Severity\ —\ Privacy}$

The new Payment Terms Code Normal field is missing a DataClassification property, so it falls back to ToBeClassified; table-level DataClassification = CustomerContent does not satisfy AS0016. The same omission is repeated in 10 localization copies of CustLedgerEntry.Table.al.

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.12.4

@@ -325,6 +325,10 @@ codeunit 90 "Purch.-Post"
OnRunOnBeforeMakeInventoryAdjustment(PurchHeader, GenJnlPostLine, ItemJnlPostLine, PreviewMode, PurchRcptHeader, PurchInvHeader, IsHandled);
if not IsHandled then
MakeInventoryAdjustment();

Clear(GenJnlPostLine);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Testing}$

This PR adds new posting-path behavior in W1 Purch.-Post/Sales-Post by clearing GenJnlPostLine and introducing OnAfterProcessPostingLines, and the same pattern is replicated into the 9 other changed PurchPost copies and 11 other changed SalesPost copies. The diff contains no Test*.Codeunit.al or other test changes, so add regression tests that post purchase and sales documents through the new hook and verify subscribers observe the intended state after GenJnlPostLine is cleared.

Agent judgement — not directly backed by a BCQuality knowledge article.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.12.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Delocalization Extracting from country layers and converting local functionality to app Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants