#10462 [Shopify] Fix order edit retaining discount allocation for removed quantity
The Shopify connector now correctly adjusts line-level discount amounts when refunds reduce order line quantities, preventing over-discounting of the remaining quantity in sales documents.
- 3files
- 1AL files
- 1objects
Pull request · merged into main (BC30) on 2026-08-24 by onbuyuka · 3 files (+172 -0), 1 AL · fix · tier official · reviewed (checked by Opus)
What changed
- Fixed discount allocation calculation in refund processing to account for removed quantities
- Discount amount is now reduced proportionally with quantity reduction using unit price and subtotal derivation
- Added unit tests to verify discount reduction and quantity adjustment for discounted order lines
- Ensures line discount reconciles with order header discount after quantity refunds
- Only affects Shopify refund/return import when enabled
- Behaviour changes for users or extensions.
AL objects touched
- Codeunit 30161 “Shpfy Import Order”, Shopify: modified
Context
- Work items: AB#647146
- Labels: AL: Apps (W1), Team: Integrations
- Systems: integration
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).