Skip to content

Add VAT rate resolution and VAT amount difference for E-Document purchases#8251

Open
ventselartur wants to merge 62 commits into
mainfrom
private/ventselartur/PayablesAgentVATSpike
Open

Add VAT rate resolution and VAT amount difference for E-Document purchases#8251
ventselartur wants to merge 62 commits into
mainfrom
private/ventselartur/PayablesAgentVATSpike

Conversation

@ventselartur
Copy link
Copy Markdown
Contributor

@ventselartur ventselartur commented May 20, 2026

Why

When importing e-documents for purchase processing, the system did not automatically resolve VAT Product Posting Groups from extracted VAT rates. Users had to manually identify and assign the correct VAT posting group for each line, which was error-prone and time-consuming. Additionally, rounding differences between the document's total VAT and the computed line-level VAT amounts were not reconciled, leading to posting discrepancies.

Summary

  • Added VAT Product Posting Group resolution during Prepare Draft — matches the extracted VAT rate against VAT Posting Setup entries (Normal VAT and Reverse Charge VAT only) for the vendor's VAT Bus. Posting Group
  • Added [BC] VAT Prod. Posting Group and [BC] VAT Rate Mismatch fields on E-Document Purchase Line with OnValidate/OnLookup support
  • Added VAT amount difference computation and application to purchase lines when finalizing drafts, respecting Allow VAT Difference and Max. VAT Difference Allowed settings
  • Added "Resolve VAT Group Purch EDoc" and "Apply VAT Diff. For Purch EDoc" toggles on Purchases & Payables Setup
  • Improved ADI handler to prefer the unambiguous taxRate field and properly disambiguate the tax field between percentage and monetary values
  • Added comprehensive test codeunit E-Doc Purch. VAT Tests covering resolution, mismatch detection, OnValidate behavior, and VAT calculation type filtering
  • Updated existing structured validation tests to reflect corrected VAT rate expectations

Fixes AB#619564

ventselartur and others added 30 commits March 29, 2026 21:28
…Line

Prefer TaxRate (string, unambiguous percentage) over Tax (currency,
ambiguous). Fall back to computing Tax/Amount*100 only when Tax
contains a monetary amount (no % in value_text).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds enum value 2 ("VAT Rate Mismatch") to E-Document Notification Type,
with parallel Add/Dismiss/Disable procedures in the notification codeunit
and an updated SendPurchaseDocumentDraftNotifications that fans out to both
notification types via SetFilter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Prepare Draft

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nvoice line

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…repare Draft

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces the notification banner approach with a persisted boolean
field and an inline warning column on the draft subform, following
the PO matching warning pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…racted rate

Instead of blindly clearing the mismatch flag when any posting group
is selected, look up the VAT Posting Setup and compare its VAT %
against the line's extracted VAT Rate. Only clear the warning when
the rates actually match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…date

Remove rounding tolerance — compare VAT % from setup against extracted
rate with exact equality. Zero-rate lines also go through the comparison
instead of being skipped.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The lookup opens the VAT Posting Setup page filtered by the vendor's
VAT Bus. Posting Group so the user only sees relevant combinations.
Selection runs through Validate to trigger mismatch re-evaluation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Full VAT and Sales Tax do not use VAT % for rate-based matching.
Filter FindVATProductPostingGroup, OnValidate, and OnLookup to
exclude those calculation types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…alidate

Tests cover: Full VAT and Sales Tax ignored during Prepare Draft,
Reverse Charge VAT resolved, OnValidate clears/keeps mismatch based
on rate comparison, mismatch set when clearing posting group, Full VAT
skips comparison, and zero-rate matching.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7 tasks covering: table field + triggers, Prepare Draft refactor,
subform warning column, notification removal, and 9 tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…. Posting Group

Field 111 [BC] VAT Rate Mismatch persists whether VAT resolution failed.
OnValidate re-evaluates mismatch by comparing VAT Posting Setup rate
against extracted rate, filtering to Normal/Reverse Charge VAT only.
OnLookup opens VAT Posting Setup filtered by vendor's bus posting group.
…re Draft

Replace HasUnresolvedVATLines + notification call with direct
[BC] VAT Rate Mismatch field assignment. Filter FindVATProductPostingGroup
to Normal VAT and Reverse Charge VAT calculation types only.
Per-line warning with Ambiguous styling, conditional visibility when
any line has a mismatch, and drill-down showing the extracted VAT rate.
Follows the PO matching warning pattern.
Notification replaced by persisted [BC] VAT Rate Mismatch field
and inline warning column on draft subform.
…notification

Rename and rewrite the mismatch test to assert [BC] VAT Rate Mismatch
boolean. Add mismatch=false assertion to the successful resolution test.
Full VAT and Sales Tax setups are excluded from resolution.
Reverse Charge VAT setups are matched successfully.
Covers: rate match clears mismatch, rate mismatch persists,
clearing group sets mismatch, Full VAT skips comparison,
zero-rate matching works.
Extract 10 VAT-related test procedures into new codeunit 139896
for better organization. No test logic changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ventselartur ventselartur requested a review from a team as a code owner May 20, 2026 13:52
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label May 20, 2026
LastReceiptNo := EDocLineByReceipt.ReceiptNo;
end;
EDocLineByReceipt.Close();
EDocPurchaseDocumentHelper.ApplyVATDifferenceToLines(PurchaseHeader, EDocumentPurchaseHeader);
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\ 1}}$

ApplyVATDifference called before invoice discount

ApplyVATDifferenceToLines is invoked before ApplyInvDiscBasedOnAmt (line 181), so every PurchaseLine."Inv. Discount Amount" is still 0 at distribution time. The subtraction PurchaseLine."Line Amount" - PurchaseLine."Inv. Discount Amount" in the helper is therefore dead code and the proportional basis always equals the gross line amount, ignoring document-level discounts.

Recommendation:

  • Move ApplyVATDifferenceToLines to after PurchCalcDiscByType.ApplyInvDiscBasedOnAmt so invoice-discount amounts are already populated on the purchase lines when the VAT difference is distributed.
Suggested change
EDocPurchaseDocumentHelper.ApplyVATDifferenceToLines(PurchaseHeader, EDocumentPurchaseHeader);
PurchaseHeader.Modify();
PurchCalcDiscByType.ApplyInvDiscBasedOnAmt(EDocumentPurchaseHeader."Total Discount", PurchaseHeader);
EDocPurchaseDocumentHelper.ApplyVATDifferenceToLines(PurchaseHeader, EDocumentPurchaseHeader);
exit(PurchaseHeader);

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

LineAmount := PurchaseLine."Line Amount" - PurchaseLine."Inv. Discount Amount";
if LineAmount <> 0 then begin
VATDiffForLine := VATDiffRemainder + EDocumentPurchaseHeader."Applied VAT Amount Diff." * LineAmount / TotalLineAmount;
PurchaseLine."VAT Difference" := Round(VATDiffForLine, Currency."Amount Rounding Precision");
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\ 1}}$

VAT Difference set without Validate, skips BC checks

PurchaseLine."VAT Difference" := Round(...) is a direct field assignment that bypasses the OnValidate trigger and BC's internal purchase-line recalculation logic. This can leave VAT-related totals on the header inconsistent and will not respect any line-level VAT difference constraints.

Recommendation:

  • Use PurchaseLine.Validate("VAT Difference", Round(VATDiffForLine, Currency."Amount Rounding Precision")) and then call PurchaseLine.Modify(true) to ensure all dependent fields are recalculated.
Suggested change
PurchaseLine."VAT Difference" := Round(VATDiffForLine, Currency."Amount Rounding Precision");
PurchaseLine.Validate("VAT Difference", Round(VATDiffForLine, Currency."Amount Rounding Precision"));
VATDiffRemainder := VATDiffForLine - PurchaseLine."VAT Difference";
PurchaseLine.Modify(true);

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

EDocPurchLine.SetRange("E-Document Entry No.", EDocEntryNo);
if EDocPurchLine.FindSet() then
repeat
TotalLineAmount += Round(EDocPurchLine.Quantity * EDocPurchLine."Unit Price" - EDocPurchLine."Total Discount");
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\ 1}}$

ComputeTotalLineAmount uses default Round precision

Round(EDocPurchLine.Quantity * EDocPurchLine."Unit Price" - EDocPurchLine."Total Discount") uses BC's default 2-decimal rounding, while ApplyVATDifferenceToLines distributes using Currency."Amount Rounding Precision". For currencies with non-standard precision (e.g. JPY=0, BHD=3), the denominator will differ from the actual purchase line amounts, causing the sum of distributed VAT differences to diverge from Applied VAT Amount Diff..

Recommendation:

  • Pass the currency's amount rounding precision into ComputeTotalLineAmount (or read it from the purchase header) and use it in the Round() call to stay consistent with ApplyVATDifferenceToLines.
Suggested change
TotalLineAmount += Round(EDocPurchLine.Quantity * EDocPurchLine."Unit Price" - EDocPurchLine."Total Discount");
TotalLineAmount += Round(
EDocPurchLine.Quantity * EDocPurchLine."Unit Price" - EDocPurchLine."Total Discount",
Currency."Amount Rounding Precision");

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

if EDocumentPurchaseLine.FindSet() then
repeat
LineAmount := Round(EDocumentPurchaseLine.Quantity * EDocumentPurchaseLine."Unit Price" - EDocumentPurchaseLine."Total Discount");
LineVATAmount := Round(LineAmount * EDocumentPurchaseLine."VAT Rate" / 100);
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\ 1}}$

TotalLineVATAmount uses default Round, ignores currency precision

LineVATAmount := Round(LineAmount * EDocumentPurchaseLine."VAT Rate" / 100) applies the default 2-decimal rounding, independent of the document's currency. For currencies with fewer decimals (JPY) or more (BHD), the computed TotalLineVATAmount will diverge from the actual purchase line VAT amounts, generating a spurious or inflated Applied VAT Amount Diff..

Recommendation:

  • Retrieve the currency record for the e-document (or use the default amount rounding precision) and pass it as the second argument to Round().
Suggested change
LineVATAmount := Round(LineAmount * EDocumentPurchaseLine."VAT Rate" / 100);
LineVATAmount := Round(LineAmount * EDocumentPurchaseLine."VAT Rate" / 100, Currency."Amount Rounding Precision");

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

if (VATRate = 0) and (LineCount = 1) and
(EDocumentPurchaseHeader."Total VAT" > 0) and (EDocumentPurchaseHeader."Sub Total" > 0)
then
VATRate := Round((EDocumentPurchaseHeader."Total VAT" / EDocumentPurchaseHeader."Sub Total") * 100, 0.01);
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\ 1}}$

Single-line VAT rate fallback uses header-level Sub Total

For a single-line document where VAT Rate = 0, the fallback computes VATRate = ("Total VAT" / "Sub Total") * 100 from header fields. If the header Sub Total includes charges or differs from the individual line's base (e.g. due to header discounts, rounding, or fees), the computed rate will be wrong and an incorrect VAT Prod. Posting Group will be assigned.

Recommendation:

  • Prefer using the line's own Quantity * "Unit Price" - "Total Discount" as the denominator, falling back to the header Sub Total only when the line amount is zero.
Suggested change
VATRate := Round((EDocumentPurchaseHeader."Total VAT" / EDocumentPurchaseHeader."Sub Total") * 100, 0.01);
var LineBase: Decimal;
LineBase := EDocumentPurchaseLine.Quantity * EDocumentPurchaseLine."Unit Price" - EDocumentPurchaseLine."Total Discount";
if LineBase = 0 then
LineBase := EDocumentPurchaseHeader."Sub Total";
if LineBase > 0 then
VATRate := Round((EDocumentPurchaseHeader."Total VAT" / LineBase) * 100, 0.01);

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

if not Rec."[BC] VAT Rate Mismatch" then
exit;
EDocPurchDocHelper.SetNormalReverseChargeFilter(VATPostingSetup, VendVATBusPostingGroupCode);
VATPostingSetupRef.GetTable(VATPostingSetup);
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\ 1}}$

RecordRef.GetTable() called on unpositioned record

In LogVATRateMismatch, VATPostingSetupRef.GetTable(VATPostingSetup) is called after filters are applied but without FindFirst(). The RecordRef captures the table metadata but holds no actual row, so .SetReferenceSource() produces an invalid or empty drilldown link in the activity log.

Recommendation:

  • Either position the record with VATPostingSetup.FindFirst() before calling GetTable, or remove the reference source if no specific record is to be linked.
Suggested change
VATPostingSetupRef.GetTable(VATPostingSetup);
EDocPurchDocHelper.SetNormalReverseChargeFilter(VATPostingSetup, VendVATBusPostingGroupCode);
if VATPostingSetup.FindFirst() then begin
VATPostingSetupRef.GetTable(VATPostingSetup);
ActivityLog.SetReferenceSource(Page::"VAT Posting Setup", VATPostingSetupRef);
end;

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

if Rec."[BC] VAT Rate Mismatch" then
exit;
EDocPurchDocHelper.SetNormalReverseChargeFilter(VATPostingSetup, VendVATBusPostingGroupCode);
VATPostingSetupRef.GetTable(VATPostingSetup);
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\ 1}}$

LogVATRateResolved: same unpositioned RecordRef issue

Identical to the LogVATRateMismatch problem: VATPostingSetupRef.GetTable(VATPostingSetup) is called after setting filters but before any FindFirst(), yielding a RecordRef with no current record and an invalid activity-log reference link.

Recommendation:

  • Call VATPostingSetup.FindFirst() before VATPostingSetupRef.GetTable(VATPostingSetup) and guard with an if block, or pass the specific resolved record as a parameter.
Suggested change
VATPostingSetupRef.GetTable(VATPostingSetup);
EDocPurchDocHelper.SetNormalReverseChargeFilter(VATPostingSetup, VendVATBusPostingGroupCode);
if VATPostingSetup.FindFirst() then begin
VATPostingSetupRef.GetTable(VATPostingSetup);
ActivityLog.SetReferenceSource(Page::"VAT Posting Setup", VATPostingSetupRef);
end;

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

// Strip common non-numeric prefixes/suffixes: "VAT 20%", "20%", "20.0%", "20"
CleanedText := TaxRateText.Replace('%', '').Trim();
// Remove common prefixes like "VAT ", "Tax ", etc.
if CleanedText.StartsWith('VAT ') 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\ 1}}$

ParsePercentageFromText prefix stripping is case-sensitive

CleanedText.StartsWith('VAT ') and StartsWith('Tax ') are case-sensitive in AL. Common real-world patterns like "vat 20%", "Vat 20%", or "tax 20%" will not match, causing Evaluate() to fail and returning -1, which silently falls through to the ambiguous tax monetary-amount field instead of the unambiguous taxRate field.

Recommendation:

  • Convert the cleaned text to uppercase before the prefix checks, or use LowerCase() comparisons.
Suggested change
if CleanedText.StartsWith('VAT ') then
CleanedText := UpperCase(TaxRateText.Replace('%', '').Trim());
if CleanedText.StartsWith('VAT ') then
CleanedText := CopyStr(CleanedText, 5).Trim();
if CleanedText.StartsWith('TAX ') then
CleanedText := CopyStr(CleanedText, 5).Trim();
if Evaluate(ParsedValue, CleanedText) then
exit(ParsedValue);
exit(-1);

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

DataClassification = CustomerContent;
InitValue = true;
}
field(6104; "Resolve VAT Group Purch EDoc"; Boolean)
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\ —\ Security} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

Resolve VAT Group defaults false, Apply VAT Diff defaults true

After upgrade, existing tenants will have "Apply VAT Diff. For Purch EDoc" = true (explicit InitValue = true) but "Resolve VAT Group Purch EDoc" = false (no InitValue). VAT differences will be redistributed across lines that still carry the BC-default VAT Prod. Posting Group rather than the e-document-matched one, potentially resulting in incorrect VAT postings.

Recommendation:

  • Either add InitValue = true to "Resolve VAT Group Purch EDoc" to match the paired field's default, or set InitValue = false on "Apply VAT Diff. For Purch EDoc" so both features are opt-in together.
Suggested change
field(6104; "Resolve VAT Group Purch EDoc"; Boolean)
field(6104; "Resolve VAT Group Purch EDoc"; Boolean)
{
Caption = 'Resolve VAT Product Group for Purch. E-Doc.';
DataClassification = CustomerContent;
InitValue = true;
}

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

Copy link
Copy Markdown

@sorenfriisalexandersen sorenfriisalexandersen left a comment

Choose a reason for hiding this comment

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

Added a suggestion for tooltip

@github-actions github-actions Bot added this to the Version 29.0 milestone May 20, 2026
@microsoft-github-policy-service
Copy link
Copy Markdown

@ventselartur please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"
Contributor License Agreement

Contribution License Agreement

This Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
and conveys certain license rights to Microsoft Corporation and its affiliates (“Microsoft”) for Your
contributions to Microsoft open source projects. This Agreement is effective as of the latest signature
date below.

  1. Definitions.
    “Code” means the computer software code, whether in human-readable or machine-executable form,
    that is delivered by You to Microsoft under this Agreement.
    “Project” means any of the projects owned or managed by Microsoft and offered under a license
    approved by the Open Source Initiative (www.opensource.org).
    “Submit” is the act of uploading, submitting, transmitting, or distributing code or other content to any
    Project, including but not limited to communication on electronic mailing lists, source code control
    systems, and issue tracking systems that are managed by, or on behalf of, the Project for the purpose of
    discussing and improving that Project, but excluding communication that is conspicuously marked or
    otherwise designated in writing by You as “Not a Submission.”
    “Submission” means the Code and any other copyrightable material Submitted by You, including any
    associated comments and documentation.
  2. Your Submission. You must agree to the terms of this Agreement before making a Submission to any
    Project. This Agreement covers any and all Submissions that You, now or in the future (except as
    described in Section 4 below), Submit to any Project.
  3. Originality of Work. You represent that each of Your Submissions is entirely Your original work.
    Should You wish to Submit materials that are not Your original work, You may Submit them separately
    to the Project if You (a) retain all copyright and license information that was in the materials as You
    received them, (b) in the description accompanying Your Submission, include the phrase “Submission
    containing materials of a third party:” followed by the names of the third party and any licenses or other
    restrictions of which You are aware, and (c) follow any other instructions in the Project’s written
    guidelines concerning Submissions.
  4. Your Employer. References to “employer” in this Agreement include Your employer or anyone else
    for whom You are acting in making Your Submission, e.g. as a contractor, vendor, or agent. If Your
    Submission is made in the course of Your work for an employer or Your employer has intellectual
    property rights in Your Submission by contract or applicable law, You must secure permission from Your
    employer to make the Submission before signing this Agreement. In that case, the term “You” in this
    Agreement will refer to You and the employer collectively. If You change employers in the future and
    desire to Submit additional Submissions for the new employer, then You agree to sign a new Agreement
    and secure permission from the new employer before Submitting those Submissions.
  5. Licenses.
  • Copyright License. You grant Microsoft, and those who receive the Submission directly or
    indirectly from Microsoft, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license in the
    Submission to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute
    the Submission and such derivative works, and to sublicense any or all of the foregoing rights to third
    parties.
  • Patent License. You grant Microsoft, and those who receive the Submission directly or
    indirectly from Microsoft, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license under
    Your patent claims that are necessarily infringed by the Submission or the combination of the
    Submission with the Project to which it was Submitted to make, have made, use, offer to sell, sell and
    import or otherwise dispose of the Submission alone or with the Project.
  • Other Rights Reserved. Each party reserves all rights not expressly granted in this Agreement.
    No additional licenses or rights whatsoever (including, without limitation, any implied licenses) are
    granted by implication, exhaustion, estoppel or otherwise.
  1. Representations and Warranties. You represent that You are legally entitled to grant the above
    licenses. You represent that each of Your Submissions is entirely Your original work (except as You may
    have disclosed under Section 3). You represent that You have secured permission from Your employer to
    make the Submission in cases where Your Submission is made in the course of Your work for Your
    employer or Your employer has intellectual property rights in Your Submission by contract or applicable
    law. If You are signing this Agreement on behalf of Your employer, You represent and warrant that You
    have the necessary authority to bind the listed employer to the obligations contained in this Agreement.
    You are not expected to provide support for Your Submission, unless You choose to do so. UNLESS
    REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, AND EXCEPT FOR THE WARRANTIES
    EXPRESSLY STATED IN SECTIONS 3, 4, AND 6, THE SUBMISSION PROVIDED UNDER THIS AGREEMENT IS
    PROVIDED WITHOUT WARRANTY OF ANY KIND, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY OF
    NONINFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
  2. Notice to Microsoft. You agree to notify Microsoft in writing of any facts or circumstances of which
    You later become aware that would make Your representations in this Agreement inaccurate in any
    respect.
  3. Information about Submissions. You agree that contributions to Projects and information about
    contributions may be maintained indefinitely and disclosed publicly, including Your name and other
    information that You submit with Your Submission.
  4. Governing Law/Jurisdiction. This Agreement is governed by the laws of the State of Washington, and
    the parties consent to exclusive jurisdiction and venue in the federal courts sitting in King County,
    Washington, unless no federal subject matter jurisdiction exists, in which case the parties consent to
    exclusive jurisdiction and venue in the Superior Court of King County, Washington. The parties waive all
    defenses of lack of personal jurisdiction and forum non-conveniens.
  5. Entire Agreement/Assignment. This Agreement is the entire agreement between the parties, and
    supersedes any and all prior agreements, understandings or communications, written or oral, between
    the parties relating to the subject matter hereof. This Agreement may be assigned by Microsoft.

Copy link
Copy Markdown
Contributor

@Groenbech96 Groenbech96 left a comment

Choose a reason for hiding this comment

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

I would consider not putting this on the table.
You can compute this easily, and arguably it will be more correct to not store a value, but always compute it (Stale values....)

VATAmountDiff := EDocumentPurchaseHeader."Total VAT" - TotalLineVATAmount;

My suggestion would be to have a set of functions that compute this diff, and then use those where needed.

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

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants