code change · fixAL Developmentofficial - Microsoftreviewed - checked by Opus

#11380 Honor explicit 0% discounts in Sales and Purchase price lists

Fixed price calculation to honor explicit 0% discounts in Sales and Purchase price lists by distinguishing discount declarations from incidental zero amounts, allowing specific zero-discount lines to override generic positive discounts.

Pull request · merged into main (BC30) on 2026-10-08 by attilatoury · 3 files (+603 -4), 1 AL · fix · tier official · reviewed (checked by Opus)

What changed

  • A line declares a discount when amount type is Discount or discount percentage is positive
  • Explicit 0% can win through existing specificity rules; 0% in Price & Discount remains incidental
  • Candidate acceptance happens before OnAfterIsBetterLine event, preserving subscriber vetoes
  • At equal specificity, highest eligible discount still wins; explicit zero is not unconditional veto
  • Covers Sales and Purchase price lists with variant and currency specificity; affects Shopify product price calculator
  • Behaviour changes for users or extensions.

AL objects touched

Also merged into

  • #12844 into releases/29.x on 2026-10-22

Context

  • Work items: AB#649151
  • Labels: AL: Apps (W1), Ownership: Manual, Team: SCM
  • Systems: development

No source states these links: they share an object, a model read them, or a person found the same subject.

  • Set up prices and discounts — possibly related: Documents setting up sales and purchase prices and discounts in price lists (model-linked)

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).