#11256 [main] Add setup option to restore Sales and Purchase Order quantities when posting returns
Added optional settings to control whether credit memo and invoice-correction operations restore quantities on originating sales and purchase orders, with both settings enabled by default to maintain current behavior.
- 99files
- 67AL files
- 12objects
Pull request · merged into main (BC30) on 2026-11-06 by JakovljevicDusan · 99 files (+4508 -752), 67 AL · feature · tier official · reviewed (checked by Opus)
What changed
- New setup fields added to Sales & Receivables Setup and Purchases & Payables Setup tables to control quantity restoration on corrective operations
- When enabled, existing quantity-restoration behavior is preserved; when disabled, quantities remain unchanged on originating orders
- Restoration-specific confirmations and warnings display only when the setting is enabled
- Prepayment deduction reversals proceed regardless of settings to maintain order consistency
- All existing and new companies default to enabled settings, and comprehensive test coverage includes both enabled and disabled scenarios
- Behaviour changes for users or extensions.
AL objects touched
- Codeunit 4781 “Contoso Purchase”, ContosoCoffeeDemoDataset: modified
- Codeunit 5269 “Contoso Sales Receivable Setup”, ContosoCoffeeDemoDataset: modified
- Codeunit 1313 “Correct Posted Purch. Invoice”, Base Application: modified
- Table 312 “Purchases & Payables Setup”, Base Application: modified
- Codeunit 1303 “Correct Posted Sales Invoice”, Base Application: modified
- Table 311 “Sales & Receivables Setup”, Base Application: modified
- Codeunit 104000 “Upgrade - BaseApp”, Base Application: modified
- Codeunit 9998 “Upgrade Tag Definitions”, Base Application: modified
- Codeunit 1325 “Cancel PstdPurchInv (Yes/No)”, Base Application: modified
- Page 460 “Purchases & Payables Setup”, Base Application: modified
- Codeunit 1323 “Cancel PstdSalesInv (Yes/No)”, Base Application: modified
- Page 459 “Sales & Receivables Setup”, Base Application: modified
src/Layers/APAC/BaseApp/Purchases/Setup/PurchasesPayablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/APAC/BaseApp/Sales/Setup/SalesReceivablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/CH/BaseApp/Sales/Setup/SalesReceivablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/DACH/BaseApp/Purchases/Setup/PurchasesPayablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/ES/BaseApp/Purchases/History/CorrectPostedPurchInvoice.Codeunit.al: modified, not in the BC30 snapshotsrc/Layers/ES/BaseApp/Purchases/Setup/PurchasesPayablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/ES/BaseApp/Sales/History/CorrectPostedSalesInvoice.Codeunit.al: modified, not in the BC30 snapshotsrc/Layers/ES/BaseApp/Sales/Setup/SalesReceivablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/FI/BaseApp/Purchases/Setup/PurchasesPayablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/FI/BaseApp/Sales/Setup/SalesReceivablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/GB/BaseApp/Purchases/Setup/PurchasesPayablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/GB/BaseApp/Sales/Setup/SalesReceivablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/IS/BaseApp/Sales/Setup/SalesReceivablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/IT/BaseApp/Purchases/Setup/PurchasesPayablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/IT/BaseApp/Sales/Setup/SalesReceivablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/NA/BaseApp/Purchases/Setup/PurchasesPayablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/NA/BaseApp/Sales/Setup/SalesReceivablesSetup.Table.al: modified, not in the BC30 snapshotsrc/Layers/NO/BaseApp/Purchases/Setup/PurchasesPayablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/NO/BaseApp/Sales/Setup/SalesReceivablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/RU/BaseApp/Purchases/Setup/PurchasesPayablesSetup.Page.al: modified, not in the BC30 snapshotsrc/Layers/RU/BaseApp/Sales/Setup/SalesReceivablesSetup.Page.al: modified, not in the BC30 snapshot
Context
- Work items: AB#648443, AB#649626
- Labels: AL: Apps (W1), Team: SCM
- Systems: purchasing, sales, platform
- From the description: “Adds settings to control whether existing credit-memo and invoice-correction flows restore quantities on originating sales and purchase orders”
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Make Journal Templates Mandatory [BE] — possibly related: touches Table 312 “Purchases & Payables Setup”
- Match Purchase Invoice Drafts to Purchase Orders — possibly related: touches Table 312 “Purchases & Payables Setup”
- Amend or cancel unpaid purchase invoices — possibly related: Correcting/canceling purchase invoices with this new setup option to restore order quantities. (model-linked)
- Correct or cancel a posted sales invoice — possibly related: Correcting/canceling sales invoices with this new setup option to restore order quantities. (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).