knowledge(data-modeling): Prices Including VAT decides the basis of sales/purchase/service line amounts - #203
Open
Kilian Seizinger (pri-kise) wants to merge 3 commits into
Conversation
…helper in Prices Including VAT article Extend the community article on sales/purchase line prices following the header's Prices Including VAT: - Group the line fields: fields that follow the header flag (Unit Price, Direct Unit Cost, Line Amount, discounts, Prepmt. Line Amount, Prepmt. Amt. Inv., Prepmt Amt to Deduct, Prepmt Amt Deducted) versus fields with a fixed basis (Amount, VAT Base Amount, Prepayment Amount are net; Amount Including VAT, Prepmt. Amt. Incl. VAT, Prepmt. Amount Inv. Incl. VAT are gross). - Add the rule to combine only fields of the same group, with BaseApp's UpdatePrepmtAmounts as the correct example. - Add the misleading-name case: CalculateOutstandingAmountExclTax on Sales Line and Purchase Line is based on Line Amount and includes VAT on a Prices Including VAT document. BaseApp pairs it only with Prepmt. Line Amount (same basis); extension code that treats it as net is wrong. - Mention that Service Line uses the same caption switch and UpdateVATAmounts split for Unit Price and Line Amount. - Samples: add GetOutstandingNetAmount (bad: trusts the helper's name; good: takes the uninvoiced share of Amount). - al-data-modeling-review: widen the scope and the worklist rule to service lines, the extra prepayment fields and CalculateOutstandingAmountExclTax, and exclude code that only combines fields of the same group. Verified against BCApps W1 BaseApp (SalesLine, PurchaseLine, ServiceLine, SalesHeader, Sales Line CaptionClass Mgmt). Refs microsoft#151
Jesper Schulz-Wedde (JesperSchulz)
requested changes
Oct 1, 2026
Jesper Schulz-Wedde (JesperSchulz)
left a comment
Contributor
There was a problem hiding this comment.
Reviewed draft head dda13d5150e811c7d8da21246e393e626276cea6. One ownership-contract blocker remains: the article and companions are under community/knowledge/data-modeling, but data-modeling is a Microsoft-owned domain consumed by microsoft/skills/review/al-data-modeling-review.md. docs/contributing.md explicitly forbids using Community as a staging layer for Microsoft-owned domains. Please move all three files to microsoft/knowledge/data-modeling/; the slug-based evaluation entry can remain unchanged. The currently action_required validation workflows should then be approved and run.
…oft layer data-modeling is a Microsoft-owned review domain consumed by microsoft/skills/review/al-data-modeling-review.md, and docs/contributing.md does not allow Community as a staging layer for such domains. Move the article and its .good.al/.bad.al samples to microsoft/knowledge/data-modeling/. Content is unchanged; the slug-based evaluation entry stays as is.
Kilian Seizinger (pri-kise)
marked this pull request as ready for review
October 1, 2026 13:15
Kilian Seizinger (pri-kise)
requested a review
from Jesper Schulz-Wedde (JesperSchulz)
October 1, 2026 13:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #151
LLMs (and people) often treat
Unit Price,Direct Unit CostandLine Amountas net amounts. Whether they include VAT depends on the header'sPrices Including VAT. This PR adds a knowledge article that sorts the line fields into those that follow the header flag and those with a fixed basis.Added
microsoft/knowledge/data-modeling/document-line-prices-follow-prices-including-vat.mdplus.good.al/.bad.alUnit Price,Direct Unit Cost,Line Amount, line/invoice discount amounts,Prepmt. Line Amount,Prepmt. Amt. Inv.,Prepmt Amt to Deduct,Prepmt Amt DeductedAmount,VAT Base Amount,Prepayment Amount. Always gross:Amount Including VAT,Prepmt. Amt. Incl. VAT,Prepmt. Amount Inv. Incl. VATCalculateOutstandingAmountExclTax(Sales/Purchase Line) is based onLine Amount, so it includes VAT on a Prices Including VAT document. BaseApp is correct because it only combines it withPrepmt. Line Amount, but extension code that treats it as net is wrong.UpdateVATAmountssplitPrice List Lineprices to the document's setting, so don't convert them againal-data-modeling-review.md: scope, search terms, and a rule that picks the article, including when not to reportevaluation/review-fixtures.json: article registered