---
title: "Codeunit 66 Purch - Calc Disc. By Type"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/66-purch-calc-disc-by-type/
type: codeunit
id: 66
name: "Purch - Calc Disc. By Type"
app: "Base Application"
namespace: Microsoft.Purchases.Document
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/66-purch-calc-disc-by-type/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 66 Purch - Calc Disc. By Type

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/66-purch-calc-disc-by-type/

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

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| ApplyDefaultInvoiceDiscount | (Decimal, var Record Purchase Header) | - | public | 17-28 | - | - |
| ApplyInvDiscBasedOnAmt | (Decimal, var Record Purchase Header) | - | public | 17-28 | - | - |
| GetVendInvoiceDiscountPct | (Record Purchase Line) | Decimal | public | 17-28 | - | - |
| ShouldRedistributeInvoiceDiscountAmount | (Record Purchase Header) | Boolean | public | 17-28 | - | - |
| ResetRecalculateInvoiceDisc | (Record Purchase Header) | - | public | 17-28 | - | - |
| InvoiceDiscIsAllowed | (Code[20]) | Boolean | public | 17-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAfterResetRecalculateInvoiceDisc | (var Record Purchase Header) | 17-28 | - | - |
| Integration event | OnBeforeApplyDefaultInvoiceDiscount | (var Record Purchase Header, var Boolean, Decimal) | 17-28 | - | - |
| Integration event | OnBeforeShouldRedistributeInvoiceDiscountAmount | (var Record Purchase Header, var Boolean) | 17-28 | - | - |
| Integration event | OnAfterInvoiceDiscIsAllowed | (Code[20], var Boolean) | 20-28 | - | - |
| Integration event | OnResetRecalculateInvoiceDiscOnAfterSetLoadFields | (var Record Purchase Line) | 22-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.
