From 3fb7cb840584c5c568c30a8a4fc2b902a6b3a662 Mon Sep 17 00:00:00 2001 From: v-shikhverma Date: Wed, 12 Aug 2026 16:18:59 +0530 Subject: [PATCH 1/4] Initial Commit --- .../BaseApp/Sales/Document/SalesLine.Table.al | 4 ++- .../Prepayment/ERMPrepayment.Codeunit.al | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/Layers/W1/BaseApp/Sales/Document/SalesLine.Table.al b/src/Layers/W1/BaseApp/Sales/Document/SalesLine.Table.al index d0bd2255b09..4681450986e 100644 --- a/src/Layers/W1/BaseApp/Sales/Document/SalesLine.Table.al +++ b/src/Layers/W1/BaseApp/Sales/Document/SalesLine.Table.al @@ -5702,7 +5702,9 @@ table 37 "Sales Line" if IsHandled then exit; - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/W1/Tests/Prepayment/ERMPrepayment.Codeunit.al b/src/Layers/W1/Tests/Prepayment/ERMPrepayment.Codeunit.al index 81e5773a63e..2dc3e4e3af0 100644 --- a/src/Layers/W1/Tests/Prepayment/ERMPrepayment.Codeunit.al +++ b/src/Layers/W1/Tests/Prepayment/ERMPrepayment.Codeunit.al @@ -4162,6 +4162,31 @@ TearDownVATPostingSetup(SalesHeader."VAT Bus. Posting Group"); end; + [Test] + [Scope('OnPrem')] + procedure CannotReduceSalesOrderQuantityToInvoicedQuantityAfterPrepayment() + var + SalesHeader: Record "Sales Header"; + SalesLine: Record "Sales Line"; + begin + // [SCENARIO 646136] Reduce Sales Order quantity after prepayment and partial invoicing + + // [GIVEN] Posted 50% Prepayment Invoice for Sales Order + InitSalesPrepaymentScenario(SalesHeader, SalesLine, false, 50, ''); + LibrarySales.PostSalesPrepaymentInvoice(SalesHeader); + + // [GIVEN] Order is partially shipped and invoiced + PostPartialSalesInvoice(SalesHeader, SalesLine); + LibrarySales.ReopenSalesDocument(SalesHeader); + SalesLine.Find(); + + // [WHEN] Reduce Quantity to the invoiced quantity + asserterror SalesLine.Validate(Quantity, SalesLine."Quantity Invoiced"); + + // [THEN] Error occurs because the posted prepayment exceeds the new line amount + Assert.ExpectedError(SalesLine.FieldCaption("Prepmt. Line Amount")); + end; + local procedure Initialize() var LibraryERMCountryData: Codeunit "Library - ERM Country Data"; From 91da96b542d6a7ae8db3b7053d8af16bc497ce4a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 12 Aug 2026 11:05:06 +0000 Subject: [PATCH 2/4] Propagate SalesLine prepayment fix and test to country layers (miapp) Co-authored-by: Shikhverma <241284522+Shikhverma@users.noreply.github.com> --- .../BaseApp/Sales/Document/SalesLine.Table.al | 4 ++- .../BaseApp/Sales/Document/SalesLine.Table.al | 4 ++- .../BaseApp/Sales/Document/SalesLine.Table.al | 4 ++- .../BaseApp/Sales/Document/SalesLine.Table.al | 4 ++- .../BaseApp/Sales/Document/SalesLine.Table.al | 4 ++- .../BaseApp/Sales/Document/SalesLine.Table.al | 4 ++- .../BaseApp/Sales/Document/SalesLine.Table.al | 4 ++- .../BaseApp/Sales/Document/SalesLine.Table.al | 4 ++- .../BaseApp/Sales/Document/SalesLine.Table.al | 4 ++- .../BaseApp/Sales/Document/SalesLine.Table.al | 4 ++- .../Prepayment/ERMPrepayment.Codeunit.al | 25 +++++++++++++++++++ .../BaseApp/Sales/Document/SalesLine.Table.al | 4 ++- .../Prepayment/ERMPrepayment.Codeunit.al | 4 +-- 13 files changed, 60 insertions(+), 13 deletions(-) diff --git a/src/Layers/APAC/BaseApp/Sales/Document/SalesLine.Table.al b/src/Layers/APAC/BaseApp/Sales/Document/SalesLine.Table.al index 6a8cceb95cd..7697ba899e9 100644 --- a/src/Layers/APAC/BaseApp/Sales/Document/SalesLine.Table.al +++ b/src/Layers/APAC/BaseApp/Sales/Document/SalesLine.Table.al @@ -5792,7 +5792,9 @@ table 37 "Sales Line" if IsHandled then exit; - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/BE/BaseApp/Sales/Document/SalesLine.Table.al b/src/Layers/BE/BaseApp/Sales/Document/SalesLine.Table.al index c2adc8f304b..10dcb917c1a 100644 --- a/src/Layers/BE/BaseApp/Sales/Document/SalesLine.Table.al +++ b/src/Layers/BE/BaseApp/Sales/Document/SalesLine.Table.al @@ -5703,7 +5703,9 @@ table 37 "Sales Line" if IsHandled then exit; - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/CH/BaseApp/Sales/Document/SalesLine.Table.al b/src/Layers/CH/BaseApp/Sales/Document/SalesLine.Table.al index df52d3d5c52..141e9a7ad11 100644 --- a/src/Layers/CH/BaseApp/Sales/Document/SalesLine.Table.al +++ b/src/Layers/CH/BaseApp/Sales/Document/SalesLine.Table.al @@ -5813,7 +5813,9 @@ table 37 "Sales Line" if IsHandled then exit; - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/ES/BaseApp/Sales/Document/SalesLine.Table.al b/src/Layers/ES/BaseApp/Sales/Document/SalesLine.Table.al index 9fd3bd7a430..36e50a319a1 100644 --- a/src/Layers/ES/BaseApp/Sales/Document/SalesLine.Table.al +++ b/src/Layers/ES/BaseApp/Sales/Document/SalesLine.Table.al @@ -5727,7 +5727,9 @@ table 37 "Sales Line" if IsHandled then exit; - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/FI/BaseApp/Sales/Document/SalesLine.Table.al b/src/Layers/FI/BaseApp/Sales/Document/SalesLine.Table.al index 0f99542d5f4..21dad81ee51 100644 --- a/src/Layers/FI/BaseApp/Sales/Document/SalesLine.Table.al +++ b/src/Layers/FI/BaseApp/Sales/Document/SalesLine.Table.al @@ -5714,7 +5714,9 @@ table 37 "Sales Line" if IsHandled then exit; - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/GB/BaseApp/Sales/Document/SalesLine.Table.al b/src/Layers/GB/BaseApp/Sales/Document/SalesLine.Table.al index 14db1a27b04..414f4bab85f 100644 --- a/src/Layers/GB/BaseApp/Sales/Document/SalesLine.Table.al +++ b/src/Layers/GB/BaseApp/Sales/Document/SalesLine.Table.al @@ -5766,7 +5766,9 @@ table 37 "Sales Line" if IsHandled then exit; - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/IT/BaseApp/Sales/Document/SalesLine.Table.al b/src/Layers/IT/BaseApp/Sales/Document/SalesLine.Table.al index 234afaa5480..73b04beb0e3 100644 --- a/src/Layers/IT/BaseApp/Sales/Document/SalesLine.Table.al +++ b/src/Layers/IT/BaseApp/Sales/Document/SalesLine.Table.al @@ -5815,7 +5815,9 @@ table 37 "Sales Line" if IsHandled then exit; - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/NA/BaseApp/Sales/Document/SalesLine.Table.al b/src/Layers/NA/BaseApp/Sales/Document/SalesLine.Table.al index 8b6b4b325fd..acf95f09ec1 100644 --- a/src/Layers/NA/BaseApp/Sales/Document/SalesLine.Table.al +++ b/src/Layers/NA/BaseApp/Sales/Document/SalesLine.Table.al @@ -5802,7 +5802,9 @@ table 37 "Sales Line" if IsHandled then exit; - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/NO/BaseApp/Sales/Document/SalesLine.Table.al b/src/Layers/NO/BaseApp/Sales/Document/SalesLine.Table.al index 7d98790392f..a95442b0ae5 100644 --- a/src/Layers/NO/BaseApp/Sales/Document/SalesLine.Table.al +++ b/src/Layers/NO/BaseApp/Sales/Document/SalesLine.Table.al @@ -5751,7 +5751,9 @@ table 37 "Sales Line" if IsHandled then exit; - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/RU/BaseApp/Sales/Document/SalesLine.Table.al b/src/Layers/RU/BaseApp/Sales/Document/SalesLine.Table.al index 81a986f1f71..d7acedfdda0 100644 --- a/src/Layers/RU/BaseApp/Sales/Document/SalesLine.Table.al +++ b/src/Layers/RU/BaseApp/Sales/Document/SalesLine.Table.al @@ -5866,7 +5866,9 @@ table 37 "Sales Line" if IsHandled then exit; - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/RU/Tests/Prepayment/ERMPrepayment.Codeunit.al b/src/Layers/RU/Tests/Prepayment/ERMPrepayment.Codeunit.al index 99c6d9c4d36..45d265ca97a 100644 --- a/src/Layers/RU/Tests/Prepayment/ERMPrepayment.Codeunit.al +++ b/src/Layers/RU/Tests/Prepayment/ERMPrepayment.Codeunit.al @@ -4369,6 +4369,31 @@ NotificationLifecycleMgt.RecallAllNotifications(); end; + [Test] + [Scope('OnPrem')] + procedure CannotReduceSalesOrderQuantityToInvoicedQuantityAfterPrepayment() + var + SalesHeader: Record "Sales Header"; + SalesLine: Record "Sales Line"; + begin + // [SCENARIO 646136] Reduce Sales Order quantity after prepayment and partial invoicing + + // [GIVEN] Posted 50% Prepayment Invoice for Sales Order + InitSalesPrepaymentScenario(SalesHeader, SalesLine, false, 50, ''); + LibrarySales.PostSalesPrepaymentInvoice(SalesHeader); + + // [GIVEN] Order is partially shipped and invoiced + PostPartialSalesInvoice(SalesHeader, SalesLine); + LibrarySales.ReopenSalesDocument(SalesHeader); + SalesLine.Find(); + + // [WHEN] Reduce Quantity to the invoiced quantity + asserterror SalesLine.Validate(Quantity, SalesLine."Quantity Invoiced"); + + // [THEN] Error occurs because the posted prepayment exceeds the new line amount + Assert.ExpectedError(SalesLine.FieldCaption("Prepmt. Line Amount")); + end; + local procedure Initialize() var LibraryERMCountryData: Codeunit "Library - ERM Country Data"; diff --git a/src/Layers/SE/BaseApp/Sales/Document/SalesLine.Table.al b/src/Layers/SE/BaseApp/Sales/Document/SalesLine.Table.al index 0f99542d5f4..21dad81ee51 100644 --- a/src/Layers/SE/BaseApp/Sales/Document/SalesLine.Table.al +++ b/src/Layers/SE/BaseApp/Sales/Document/SalesLine.Table.al @@ -5714,7 +5714,9 @@ table 37 "Sales Line" if IsHandled then exit; - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Shipped Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/W1/Tests/Prepayment/ERMPrepayment.Codeunit.al b/src/Layers/W1/Tests/Prepayment/ERMPrepayment.Codeunit.al index 2dc3e4e3af0..4614190b73f 100644 --- a/src/Layers/W1/Tests/Prepayment/ERMPrepayment.Codeunit.al +++ b/src/Layers/W1/Tests/Prepayment/ERMPrepayment.Codeunit.al @@ -4170,11 +4170,11 @@ SalesLine: Record "Sales Line"; begin // [SCENARIO 646136] Reduce Sales Order quantity after prepayment and partial invoicing - + // [GIVEN] Posted 50% Prepayment Invoice for Sales Order InitSalesPrepaymentScenario(SalesHeader, SalesLine, false, 50, ''); LibrarySales.PostSalesPrepaymentInvoice(SalesHeader); - + // [GIVEN] Order is partially shipped and invoiced PostPartialSalesInvoice(SalesHeader, SalesLine); LibrarySales.ReopenSalesDocument(SalesHeader); From 693344fdf74834f65524a097d8359748c641e3fc Mon Sep 17 00:00:00 2001 From: v-shikhverma Date: Fri, 14 Aug 2026 17:12:14 +0530 Subject: [PATCH 3/4] Fix Purchase side --- .../Purchases/Document/PurchaseLine.Table.al | 4 +++- .../Prepayment/ERMPrepayment.Codeunit.al | 24 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al index 50f69c7b5ec..8fba492d5ee 100644 --- a/src/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al +++ b/src/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al @@ -9462,7 +9462,9 @@ table 39 "Purchase Line" var OutstandingAmountExclTax: Decimal; begin - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/W1/Tests/Prepayment/ERMPrepayment.Codeunit.al b/src/Layers/W1/Tests/Prepayment/ERMPrepayment.Codeunit.al index 2dc3e4e3af0..66a5b054791 100644 --- a/src/Layers/W1/Tests/Prepayment/ERMPrepayment.Codeunit.al +++ b/src/Layers/W1/Tests/Prepayment/ERMPrepayment.Codeunit.al @@ -2619,6 +2619,30 @@ Assert.ExpectedTestFieldError(PurchaseLine.FieldCaption("Prepmt. Amt. Inv."), ''); end; + [Test] + [Scope('OnPrem')] + procedure CannotReducePurchaseOrderQuantityToInvoicedQuantityAfterPrepayment() + var + PurchaseHeader: Record "Purchase Header"; + PurchaseLine: Record "Purchase Line"; + begin + // [SCENARIO 646136] Reduce Purchase Order quantity after prepayment and partial invoicing + // [GIVEN] Posted 50% Prepayment Invoice for Purchase Order + InitPurchasePrepaymentScenario(PurchaseHeader, PurchaseLine, false, 50, ''); + LibraryPurchase.PostPurchasePrepaymentInvoice(PurchaseHeader); + + // [GIVEN] Order is partially received and invoiced + PostPartialPurchaseInvoice(PurchaseHeader, PurchaseLine); + LibraryPurchase.ReopenPurchaseDocument(PurchaseHeader); + PurchaseLine.Find(); + + // [WHEN] Reduce Quantity to the invoiced quantity + asserterror PurchaseLine.Validate(Quantity, PurchaseLine."Quantity Invoiced"); + + // [THEN] Error occurs because the posted prepayment exceeds the new line amount + Assert.ExpectedError(PurchaseLine.FieldCaption("Prepmt. Line Amount")); + end; + [Test] [Scope('OnPrem')] procedure DeletePurchaseOrderAfterPrepaymentCrMemo() From 236ac434c149587e19a9922a9e209c18ee0614d6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 15 Aug 2026 15:29:54 +0000 Subject: [PATCH 4/4] Propagate purchase prepayment fix to country layers Co-authored-by: Shikhverma <241284522+Shikhverma@users.noreply.github.com> --- .../APAC/BaseApp/Purchases/Document/PurchaseLine.Table.al | 4 +++- .../BE/BaseApp/Purchases/Document/PurchaseLine.Table.al | 4 +++- .../CH/BaseApp/Purchases/Document/PurchaseLine.Table.al | 4 +++- .../DACH/BaseApp/Purchases/Document/PurchaseLine.Table.al | 4 +++- .../ES/BaseApp/Purchases/Document/PurchaseLine.Table.al | 4 +++- .../FI/BaseApp/Purchases/Document/PurchaseLine.Table.al | 4 +++- .../GB/BaseApp/Purchases/Document/PurchaseLine.Table.al | 4 +++- .../IT/BaseApp/Purchases/Document/PurchaseLine.Table.al | 4 +++- .../NA/BaseApp/Purchases/Document/PurchaseLine.Table.al | 4 +++- .../NL/BaseApp/Purchases/Document/PurchaseLine.Table.al | 4 +++- .../NO/BaseApp/Purchases/Document/PurchaseLine.Table.al | 4 +++- .../RU/BaseApp/Purchases/Document/PurchaseLine.Table.al | 4 +++- .../SE/BaseApp/Purchases/Document/PurchaseLine.Table.al | 4 +++- 13 files changed, 39 insertions(+), 13 deletions(-) diff --git a/src/Layers/APAC/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/APAC/BaseApp/Purchases/Document/PurchaseLine.Table.al index 55a133d9cb2..00d6d1da764 100644 --- a/src/Layers/APAC/BaseApp/Purchases/Document/PurchaseLine.Table.al +++ b/src/Layers/APAC/BaseApp/Purchases/Document/PurchaseLine.Table.al @@ -10096,7 +10096,9 @@ table 39 "Purchase Line" IsHandled: Boolean; OutstandingAmountExclTax: Decimal; begin - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/BE/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/BE/BaseApp/Purchases/Document/PurchaseLine.Table.al index 975ff0551ce..519a6241a0c 100644 --- a/src/Layers/BE/BaseApp/Purchases/Document/PurchaseLine.Table.al +++ b/src/Layers/BE/BaseApp/Purchases/Document/PurchaseLine.Table.al @@ -9586,7 +9586,9 @@ table 39 "Purchase Line" var OutstandingAmountExclTax: Decimal; begin - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/CH/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/CH/BaseApp/Purchases/Document/PurchaseLine.Table.al index c21a4d1b247..9f2b9b62d73 100644 --- a/src/Layers/CH/BaseApp/Purchases/Document/PurchaseLine.Table.al +++ b/src/Layers/CH/BaseApp/Purchases/Document/PurchaseLine.Table.al @@ -9481,7 +9481,9 @@ table 39 "Purchase Line" var OutstandingAmountExclTax: Decimal; begin - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/DACH/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/DACH/BaseApp/Purchases/Document/PurchaseLine.Table.al index 4374e3065d3..dd72d98010d 100644 --- a/src/Layers/DACH/BaseApp/Purchases/Document/PurchaseLine.Table.al +++ b/src/Layers/DACH/BaseApp/Purchases/Document/PurchaseLine.Table.al @@ -9480,7 +9480,9 @@ table 39 "Purchase Line" var OutstandingAmountExclTax: Decimal; begin - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/ES/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/ES/BaseApp/Purchases/Document/PurchaseLine.Table.al index 122ca9f8d5b..463da279c14 100644 --- a/src/Layers/ES/BaseApp/Purchases/Document/PurchaseLine.Table.al +++ b/src/Layers/ES/BaseApp/Purchases/Document/PurchaseLine.Table.al @@ -9499,7 +9499,9 @@ table 39 "Purchase Line" var OutstandingAmountExclTax: Decimal; begin - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/FI/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/FI/BaseApp/Purchases/Document/PurchaseLine.Table.al index 4e4803a0464..3e86b01bd5d 100644 --- a/src/Layers/FI/BaseApp/Purchases/Document/PurchaseLine.Table.al +++ b/src/Layers/FI/BaseApp/Purchases/Document/PurchaseLine.Table.al @@ -9473,7 +9473,9 @@ table 39 "Purchase Line" var OutstandingAmountExclTax: Decimal; begin - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/GB/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/GB/BaseApp/Purchases/Document/PurchaseLine.Table.al index 5e92ea16eaa..43ad64ab290 100644 --- a/src/Layers/GB/BaseApp/Purchases/Document/PurchaseLine.Table.al +++ b/src/Layers/GB/BaseApp/Purchases/Document/PurchaseLine.Table.al @@ -9524,7 +9524,9 @@ table 39 "Purchase Line" var OutstandingAmountExclTax: Decimal; begin - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/IT/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/IT/BaseApp/Purchases/Document/PurchaseLine.Table.al index 3203bdd061f..35f88e6f295 100644 --- a/src/Layers/IT/BaseApp/Purchases/Document/PurchaseLine.Table.al +++ b/src/Layers/IT/BaseApp/Purchases/Document/PurchaseLine.Table.al @@ -9759,7 +9759,9 @@ table 39 "Purchase Line" var OutstandingAmountExclTax: Decimal; begin - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/NA/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/NA/BaseApp/Purchases/Document/PurchaseLine.Table.al index 3d697b6f03c..c1bfb74a735 100644 --- a/src/Layers/NA/BaseApp/Purchases/Document/PurchaseLine.Table.al +++ b/src/Layers/NA/BaseApp/Purchases/Document/PurchaseLine.Table.al @@ -9802,7 +9802,9 @@ table 39 "Purchase Line" var OutstandingAmountExclTax: Decimal; begin - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/NL/BaseApp/Purchases/Document/PurchaseLine.Table.al index 866e6da4f29..49ff1b8afc4 100644 --- a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseLine.Table.al +++ b/src/Layers/NL/BaseApp/Purchases/Document/PurchaseLine.Table.al @@ -9467,7 +9467,9 @@ table 39 "Purchase Line" var OutstandingAmountExclTax: Decimal; begin - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/NO/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/NO/BaseApp/Purchases/Document/PurchaseLine.Table.al index db7ef034d77..a3f1417a679 100644 --- a/src/Layers/NO/BaseApp/Purchases/Document/PurchaseLine.Table.al +++ b/src/Layers/NO/BaseApp/Purchases/Document/PurchaseLine.Table.al @@ -9494,7 +9494,9 @@ table 39 "Purchase Line" var OutstandingAmountExclTax: Decimal; begin - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/RU/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/RU/BaseApp/Purchases/Document/PurchaseLine.Table.al index 291ed35a6ca..362acfe37df 100644 --- a/src/Layers/RU/BaseApp/Purchases/Document/PurchaseLine.Table.al +++ b/src/Layers/RU/BaseApp/Purchases/Document/PurchaseLine.Table.al @@ -9717,7 +9717,9 @@ table 39 "Purchase Line" var OutstandingAmountExclTax: Decimal; begin - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then exit; diff --git a/src/Layers/SE/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/SE/BaseApp/Purchases/Document/PurchaseLine.Table.al index 4e4803a0464..3e86b01bd5d 100644 --- a/src/Layers/SE/BaseApp/Purchases/Document/PurchaseLine.Table.al +++ b/src/Layers/SE/BaseApp/Purchases/Document/PurchaseLine.Table.al @@ -9473,7 +9473,9 @@ table 39 "Purchase Line" var OutstandingAmountExclTax: Decimal; begin - if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then + if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) and + (Rec.Quantity = xRec.Quantity) + then if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then exit;