Skip to content

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
microsoft:mainfrom
pri-kise:feature/prices-incl-vat-knowledge
Open

Kilian Seizinger (pri-kise) wants to merge 3 commits into
microsoft:mainfrom
pri-kise:feature/prices-incl-vat-knowledge

Conversation

@pri-kise

@pri-kise Kilian Seizinger (pri-kise) commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #151

LLMs (and people) often treat Unit Price, Direct Unit Cost and Line Amount as net amounts. Whether they include VAT depends on the header's Prices 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.md plus .good.al / .bad.al
    • Follow the header flag: Unit Price, Direct Unit Cost, Line Amount, line/invoice discount amounts, Prepmt. Line Amount, Prepmt. Amt. Inv., Prepmt Amt to Deduct, Prepmt Amt Deducted
    • Always net: Amount, VAT Base Amount, Prepayment Amount. Always gross: Amount Including VAT, Prepmt. Amt. Incl. VAT, Prepmt. Amount Inv. Incl. VAT
    • Rule: only combine fields from the same group
    • Misleading name: CalculateOutstandingAmountExclTax (Sales/Purchase Line) is based on Line Amount, so it includes VAT on a Prices Including VAT document. BaseApp is correct because it only combines it with Prepmt. Line Amount, but extension code that treats it as net is wrong.
    • Service Line uses the same caption switch and UpdateVATAmounts split
    • The standard price calculation already converts Price List Line prices to the document's setting, so don't convert them again
  • al-data-modeling-review.md: scope, search terms, and a rule that picks the article, including when not to report
  • evaluation/review-fixtures.json: article registered

…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

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.

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.
@pri-kise Kilian Seizinger (pri-kise) changed the title Frist draft for Prices Incl. VAT Data Modelling Prices Incl. VAT Data Modelling Oct 1, 2026
@pri-kise Kilian Seizinger (pri-kise) changed the title Prices Incl. VAT Data Modelling knowledge(data-modeling): Prices Including VAT decides the basis of sales/purchase/service line amounts Oct 1, 2026
@pri-kise
Kilian Seizinger (pri-kise) marked this pull request as ready for review October 1, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Knowledge - Prices Incl. Vat and Influence on the content of price/amount fields

2 participants