---
title: "Codeunit 70 Purch.-Calc.Discount"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/70-purch-calc-discount/
type: codeunit
id: 70
name: "Purch.-Calc.Discount"
app: "Base Application"
namespace: Microsoft.Purchases.Document
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/70-purch-calc-discount/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Codeunit 70 Purch.-Calc.Discount

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/70-purch-calc-discount/

| | |
| --- | --- |
| App | Base Application |
| Namespace | Microsoft.Purchases.Document |
| Versions | 17-28 |
| Source file | Purchases/Document/PurchCalcDiscount.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| CalculateInvoiceDiscount | (var Record Purchase Header, var Record Purchase Line) | - | public | 17-28 | - | - |
| CalculateIncDiscForHeader | (var Record Purchase Header) | - | public | 17-28 | - | - |
| CalculateInvoiceDiscountOnLine | (var Record Purchase Line) | - | public | 17-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnBeforeCalcPurchaseDiscount | (var Record Purchase Header, var Boolean, var Record Purchase Line, Boolean) | 17-21 | - | - |
| Integration event | OnAfterCalcPurchaseDiscount | (var Record Purchase Header) | 17-28 | - | - |
| Integration event | OnCalculateInvoiceDiscountOnBeforeCurrencyInitialize | (var Record Vendor Posting Group) | 17-28 | - | - |
| Integration event | OnBeforeGetVendInvDisc | (var Record Purchase Header, Date, Decimal, Decimal, Decimal, var Boolean, var Record Vendor Invoice Disc.) | 18-28 | - | - |
| Integration event | OnCalculateInvoiceDiscountOnAfterPurchLine2ValidateQuantity | (var Record Purchase Header, var Record Purchase Line, var Record Vendor Invoice Disc.) | 19-28 | - | - |
| Integration event | OnCalculateInvoiceDiscountOnBeforeCheckVendInvDiscServiceCharge | (var Record Vendor Invoice Disc., var Record Purchase Header, Date, Decimal) | 20-28 | - | - |
| Integration event | OnCalculateInvoiceDiscountOnbeforePurchLineInsert | (var Record Purchase Line, Record Purchase Header) | 20-28 | - | - |
| Integration event | OnCalculateIncDiscForHeaderOnBeforeCalculateInvoiceDiscount | (var Record Purchase Header, var Record Purchase Line, Boolean, var Boolean) | 21-28 | - | - |
| Integration event | OnCalculateInvoiceDiscountOnBeforeFindForCalcVATAmountLines | (var Record Purchase Header, var Record Purchase Line, Boolean) | 21-28 | - | - |
| Integration event | OnBeforeCalcPurchaseDiscount | (var Record Purchase Header, var Boolean, var Record Purchase Line, Boolean, var Record Purchase Line) | 22-28 | - | - |
| Integration event | OnCalculateInvoiceDiscountOnBeforeDeletePurchaseLine | (Boolean, var Record Purchase Line, var Boolean) | 22-28 | - | - |
| Integration event | OnOnRunOnBeforeUpdateHeader | (var Record Purchase Header, var Record Purchase Line) | 23-28 | - | - |

## Source

Symbols: Microsoft.BaseApplication.symbols.437dbf0e-84ff-417a-965d-ed2bb9650972, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-09-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at a66254c3b8b5bb1cea290dc8f9d097aec4381153.

Jonas Paprotka, 2026-09-20.
