---
title: "Codeunit 5477 Sales Invoice Aggregator, extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/points/
object: https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/
app: "Base Application"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
license: "Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/"
---

# Codeunit 5477 Sales Invoice Aggregator, extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/points/

60 procedures and triggers with a step in src/Layers/W1/BaseApp/Integration/Entity/SalesInvoiceAggregator.Codeunit.al, in source order, read from the text, not from a run.

## OnAfterInsertSalesHeader

[Line 49](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L49), local.

- [51](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L51) calls `CheckValidRecord`
- [51](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L51) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [54](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L54) calls `CheckUpdatesDisabled`
- [57](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L57) calls `InsertOrModifyFromSalesHeader`

## OnAfterModifySalesHeader

[Line 61](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L61), local.

- [63](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L63) calls `CheckValidRecord`
- [63](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L63) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [66](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L66) calls `IsBackgroundPosting`
- [69](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L69) calls `CheckUpdatesDisabled`
- [72](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L72) calls `InsertOrModifyFromSalesHeader`

## OnAfterDeleteSalesHeader

[Line 76](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L76), local.

- [80](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L80) calls `CheckValidRecord`
- [80](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L80) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [83](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L83) calls `CheckUpdatesDisabled`
- [86](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L86) calls `TransferRecordIDs`
- [91](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L91) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Delete

## OnAfterResetRecalculateInvoiceDisc

[Line 95](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L95), local.

- [97](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L97) calls `CheckValidRecord`
- [97](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L97) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [100](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L100) calls `CheckUpdatesDisabled`
- [103](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L103) calls `InsertOrModifyFromSalesHeader`

## OnAfterInsertSalesLine

[Line 107](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L107), local.

- [109](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L109) calls `CheckValidLineRecord`
- [112](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L112) calls `CheckUpdatesDisabled`
- [115](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L115) calls `ModifyTotalsSalesLine`

## OnAfterModifySalesLine

[Line 119](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L119), local.

- [121](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L121) calls `CheckValidLineRecord`
- [124](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L124) calls `CheckUpdatesDisabled`
- [127](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L127) calls `ModifyTotalsSalesLine`

## OnAfterDeleteSalesLine

[Line 131](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L131), local.

- [135](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L135) calls `CheckValidLineRecord`
- [138](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L138) calls `CheckUpdatesDisabled`
- [146](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L146) calls `ModifyTotalsSalesLine`
- [153](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L153) calls `BlankTotals`

## OnAfterInsertSalesInvoiceHeader

[Line 157](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L157), local.

- [159](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L159) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [162](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L162) calls `CheckUpdatesDisabled`
- [165](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L165) calls `InsertOrModifyFromSalesInvoiceHeader`

## OnAfterModifySalesInvoiceHeader

[Line 169](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L169), local.

- [171](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L171) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [174](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L174) calls `CheckUpdatesDisabled`
- [177](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L177) calls `InsertOrModifyFromSalesInvoiceHeader`

## OnAfterRenameSalesInvoiceHeader

[Line 181](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L181), local.

- [185](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L185) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [188](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L188) calls `CheckUpdatesDisabled`
- [194](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L194) calls [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) `SetIsRenameAllowed`
- [195](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L195) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Rename

## OnAfterDeleteSalesInvoiceHeader

[Line 199](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L199), local.

- [203](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L203) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [206](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L206) calls `CheckUpdatesDisabled`
- [212](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L212) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Delete

## OnAfterCalculateSalesDiscountOnSalesHeader

[Line 216](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L216), local.

- [218](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L218) calls `CheckValidRecord`
- [218](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L218) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [221](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L221) calls `CheckUpdatesDisabled`
- [224](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L224) calls `InsertOrModifyFromSalesHeader`

## OnAfterInsertCustomerLedgerEntry

[Line 228](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L228), local.

- [230](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L230) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [233](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L233) calls `SetStatusOptionFromCustLedgerEntry`

## OnAfterModifyCustomerLedgerEntry

[Line 237](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L237), local.

- [239](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L239) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [242](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L242) calls `SetStatusOptionFromCustLedgerEntry`

## OnAfterRenameCustomerLedgerEntry

[Line 246](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L246), local.

- [248](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L248) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [251](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L251) calls `SetStatusOptionFromCustLedgerEntry`

## OnAfterDeleteCustomerLedgerEntry

[Line 255](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L255), local.

- [257](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L257) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [260](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L260) calls `SetStatusOptionFromCustLedgerEntry`

## OnAfterInsertCancelledDocument

[Line 264](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L264), local.

- [266](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L266) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [269](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L269) calls `SetStatusOptionFromCancelledDocument`

## OnAfterModifyCancelledDocument

[Line 273](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L273), local.

- [275](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L275) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [278](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L278) calls `SetStatusOptionFromCancelledDocument`

## OnAfterRenameCancelledDocument

[Line 282](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L282), local.

- [284](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L284) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [287](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L287) calls `SetStatusOptionFromCancelledDocument`
- [288](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L288) calls `SetStatusOptionFromCancelledDocument`

## OnAfterDeleteCancelledDocument

[Line 292](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L292), local.

- [294](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L294) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [297](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L297) calls `SetStatusOptionFromCancelledDocument`

## OnBeforeSalesInvHeaderInsert

[Line 301](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L301), local.

- [307](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L307) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [310](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L310) calls `CheckUpdatesDisabled`
- [331](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L331) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Delete
- [334](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L334) calls [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) `GetIsRenameAllowed`
- [335](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L335) calls [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) `SetIsRenameAllowed`
- [336](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L336) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Rename
- [337](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L337) calls [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) `SetIsRenameAllowed`

## PropagateOnInsert

[Line 341](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L341).

- [348](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L348) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [359](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L359) calls [Codeunit 10 Type Helper](https://jonas-paprotka.de/ref/codeunit/10-type-helper/) `TransferFieldsWithValidate`
- [365](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L365) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `CopySellToAddressToBillToAddress`
- [366](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L366) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `SetDefaultPaymentServices`
- [367](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L367) calls `SetShortcutDimensions`
- [368](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L368) writes [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) Modify(true)

## PropagateOnModify

[Line 374](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L374).

- [376](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L376) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [380](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L380) calls `PropagateOnModifyToSalesInvoiceHeader`
- [382](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L382) calls `PropagateOnModifyToSalesHeader`

## PropagateOnModifyToSalesInvoiceHeader

[Line 385](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L385), local.

- [391](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L391) calls `ChangeOnlyContainsWhitelistedFields`
- [395](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L395) calls [Codeunit 10 Type Helper](https://jonas-paprotka.de/ref/codeunit/10-type-helper/) `TransferFieldsWithValidate`
- [397](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L397) writes [Table 112 Sales Invoice Header](https://jonas-paprotka.de/ref/table/112-sales-invoice-header/) Modify(true)
- [398](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L398) runs [Codeunit 1409 Sales Inv. Header - Edit](https://jonas-paprotka.de/ref/codeunit/1409-sales-inv-header-edit/)

## PropagateOnModifyToSalesHeader

[Line 402](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L402), local.

- [415](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L415) calls [Codeunit 10 Type Helper](https://jonas-paprotka.de/ref/codeunit/10-type-helper/) `TransferFieldsWithValidate`
- [418](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L418) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `CopySellToAddressToBillToAddress`
- [421](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L421) writes [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) Modify(true)
- [423](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L423) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `SetDefaultPaymentServices`
- [424](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L424) writes [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) Insert(true)

## PropagateOnDelete

[Line 449](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L449).

- [455](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L455) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [460](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L460) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `CleanAggregateWithoutParent`
- [466](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L466) writes [Table 112 Sales Invoice Header](https://jonas-paprotka.de/ref/table/112-sales-invoice-header/) Delete(true)
- [469](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L469) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `CleanAggregateWithoutParent`
- [473](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L473) writes [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) Delete(true)

## UpdateAggregateTableRecords

[Line 477](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L477).

- [488](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L488) calls `InsertOrModifyFromSalesHeader`
- [489](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L489) calls [Codeunit 9994 API Data Upgrade](https://jonas-paprotka.de/ref/codeunit/9994-api-data-upgrade/) `CountRecordsAndCommit`
- [494](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L494) calls `InsertOrModifyFromSalesInvoiceHeader`
- [495](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L495) calls [Codeunit 9994 API Data Upgrade](https://jonas-paprotka.de/ref/codeunit/9994-api-data-upgrade/) `CountRecordsAndCommit`
- [502](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L502) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Delete(true)
- [503](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L503) calls [Codeunit 9994 API Data Upgrade](https://jonas-paprotka.de/ref/codeunit/9994-api-data-upgrade/) `CountRecordsAndCommit`
- [511](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L511) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Delete(true)
- [512](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L512) calls [Codeunit 9994 API Data Upgrade](https://jonas-paprotka.de/ref/codeunit/9994-api-data-upgrade/) `CountRecordsAndCommit`

## InsertOrModifyFromSalesHeader

[Line 536](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L536), local.

- [557](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L557) calls `AssignTotalsFromSalesHeader`
- [558](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L558) calls [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) `UpdateReferencedRecordIds`
- [561](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L561) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Modify(true)
- [563](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L563) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Insert(true)

## InsertOrModifyFromSalesInvoiceHeader

[Line 566](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L566), local.

- [574](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L574) calls `GetSalesInvoiceHeaderId`
- [577](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L577) calls `SetStatusOptionFromSalesInvoiceHeader`
- [578](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L578) calls `AssignTotalsFromSalesInvoiceHeader`
- [579](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L579) calls [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) `UpdateReferencedRecordIds`
- [582](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L582) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Modify(true)
- [584](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L584) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Insert(true)

## SetStatusOptionFromSalesInvoiceHeader

[Line 587](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L587), local.

- [592](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L592) raises `OnBeforeSetStatusOptionFromSalesInvoiceHeader`, IsHandled

## SetStatusOptionFromCustLedgerEntry

[Line 615](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L615), local.

- [620](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L620) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [623](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L623) calls `CheckUpdatesDisabled`
- [634](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L634) calls `UpdateStatusIfChanged`

## SetStatusOptionFromCancelledDocument

[Line 638](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L638), local.

- [643](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L643) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [646](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L646) calls `CheckUpdatesDisabled`
- [660](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L660) calls `UpdateStatusIfChanged`

## SetTaxGroupIdAndCode

[Line 663](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L663).

- [669](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L669) calls [Table 98 General Ledger Setup](https://jonas-paprotka.de/ref/table/98-general-ledger-setup/) `UseVat`

## UpdateUnitOfMeasure

[Line 688](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L688).

- [694](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L694) calls [Codeunit 5470 Graph Collection Mgt - Item](https://jonas-paprotka.de/ref/codeunit/5470-graph-collection-mgt-item/) `UpdateOrCreateItemUnitOfMeasureFromSalesDocument`
- [697](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L697) writes [Table 27 Item](https://jonas-paprotka.de/ref/table/27-item/) Modify(true)

## UpdateStatusIfChanged

[Line 700](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L700), local.

- [710](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L710) calls `SetStatusOptionFromSalesInvoiceHeader`
- [712](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L712) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Modify(true)

## AssignTotalsFromSalesHeader

[Line 715](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L715), local.

- [723](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L723) calls `BlankTotals`
- [727](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L727) calls `AssignTotalsFromSalesLine`

## AssignTotalsFromSalesInvoiceHeader

[Line 730](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L730), local.

- [737](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L737) calls `BlankTotals`
- [741](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L741) calls `AssignTotalsFromSalesInvoiceLine`

## AssignTotalsFromSalesLine

[Line 744](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L744), local.

- [756](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L756) calls [Codeunit 57 Document Totals](https://jonas-paprotka.de/ref/codeunit/57-document-totals/) `CalculateSalesTotals`

## AssignTotalsFromSalesInvoiceLine

[Line 765](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L765), local.

- [780](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L780) calls [Codeunit 57 Document Totals](https://jonas-paprotka.de/ref/codeunit/57-document-totals/) `CalculatePostedSalesInvoiceTotals`

## BlankTotals

[Line 792](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L792), local.

- [799](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L799) calls `CheckUpdatesDisabled`
- [807](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L807) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Modify

## CheckUpdatesDisabled

[Line 822](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L822), local.

- [827](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L827) calls [Codeunit 5532 Disable Aggregate Table Update](https://jonas-paprotka.de/ref/codeunit/5532-disable-aggregate-table-update/) `OnGetAggregateTablesUpdateEnabled`

## ModifyTotalsSalesLine

[Line 835](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L835), local.

- [849](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L849) calls `CheckUpdatesDisabled`
- [852](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L852) calls `AssignTotalsFromSalesLine`
- [853](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L853) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Modify(true)

## TransferSalesInvoiceLineAggregateToSalesLine

[Line 856](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L856), local.

- [865](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L865) calls [Codeunit 10 Type Helper](https://jonas-paprotka.de/ref/codeunit/10-type-helper/) `TransferFieldsWithValidate`

## TransferRecordIDs

[Line 869](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L869), local.

- [877](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L877) raises `OnBeforeTransferRecordIDs`, IsHandled
- [892](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L892) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Delete(true)
- [895](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L895) calls [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) `GetIsRenameAllowed`
- [896](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L896) calls [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) `SetIsRenameAllowed`
- [897](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L897) writes [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) Rename
- [898](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L898) calls [Table 5475 Sales Invoice Entity Aggregate](https://jonas-paprotka.de/ref/table/5475-sales-invoice-entity-aggregate/) `SetIsRenameAllowed`
- [902](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L902) writes [Table 112 Sales Invoice Header](https://jonas-paprotka.de/ref/table/112-sales-invoice-header/) Modify(true)

## RedistributeInvoiceDiscounts

[Line 905](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L905).

- [916](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L916) runs [Codeunit 56 Sales - Calc Discount By Type](https://jonas-paprotka.de/ref/codeunit/56-sales-calc-discount-by-type/)

## LoadLines

[Line 921](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L921).

- [933](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L933) calls `LoadSalesInvoiceLines`
- [935](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L935) calls `LoadSalesLines`

## LoadSalesInvoiceLines

[Line 938](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L938), local.

- [950](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L950) calls `GetIdFromDocumentIdAndSequence`
- [952](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L952) calls `SetTaxGroupIdAndCode`
- [959](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L959) calls [Table 113 Sales Invoice Line](https://jonas-paprotka.de/ref/table/113-sales-invoice-line/) `GetCurrencyCode`
- [961](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L961) calls [Table 5476 Sales Invoice Line Aggregate](https://jonas-paprotka.de/ref/table/5476-sales-invoice-line-aggregate/) `SetDiscountValue`
- [962](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L962) calls [Table 5476 Sales Invoice Line Aggregate](https://jonas-paprotka.de/ref/table/5476-sales-invoice-line-aggregate/) `UpdateReferencedRecordIds`
- [963](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L963) calls `UpdateLineAmountsFromSalesInvoiceLine`
- [964](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L964) calls [Codeunit 5477 Sales Invoice Aggregator](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/) `SetItemVariantId`
- [965](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L965) writes [Table 5476 Sales Invoice Line Aggregate](https://jonas-paprotka.de/ref/table/5476-sales-invoice-line-aggregate/) Insert(true)

## LoadSalesLines

[Line 969](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L969), local.

- [978](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L978) calls `TransferFromSalesLine`
- [979](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L979) writes [Table 5476 Sales Invoice Line Aggregate](https://jonas-paprotka.de/ref/table/5476-sales-invoice-line-aggregate/) Insert(true)

## TransferFromSalesLine

[Line 983](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L983), local.

- [985](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L985) calls `TransferFromSalesLineToAggregateLine`

## TransferFromSalesLineToAggregateLine

[Line 989](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L989).

- [995](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L995) calls `GetIdFromDocumentIdAndSequence`
- [998](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L998) calls `SetTaxGroupIdAndCode`
- [1006](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1006) calls [Table 5476 Sales Invoice Line Aggregate](https://jonas-paprotka.de/ref/table/5476-sales-invoice-line-aggregate/) `SetDiscountValue`
- [1007](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1007) calls [Table 5476 Sales Invoice Line Aggregate](https://jonas-paprotka.de/ref/table/5476-sales-invoice-line-aggregate/) `UpdateReferencedRecordIds`
- [1008](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1008) calls `UpdateLineAmountsFromSalesLine`
- [1009](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1009) calls [Codeunit 5477 Sales Invoice Aggregator](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/) `SetItemVariantId`

## PropagateInsertLine

[Line 1012](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1012).

- [1018](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1018) calls `VerifyCRUDIsPossibleForLine`
- [1036](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1036) calls `TransferSalesInvoiceLineAggregateToSalesLine`
- [1037](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1037) writes [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) Insert(true)
- [1040](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1040) calls `RedistributeInvoiceDiscounts`
- [1043](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1043) calls `TransferFromSalesLine`

## PropagateModifyLine

[Line 1046](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1046).

- [1051](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1051) calls `VerifyCRUDIsPossibleForLine`
- [1056](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1056) calls `TransferSalesInvoiceLineAggregateToSalesLine`
- [1058](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1058) writes [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) Modify(true)
- [1061](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1061) calls `RedistributeInvoiceDiscounts`
- [1064](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1064) calls `TransferFromSalesLine`

## PropagateDeleteLine

[Line 1067](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1067).

- [1072](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1072) calls `VerifyCRUDIsPossibleForLine`
- [1075](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1075) writes [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) Delete(true)
- [1077](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1077) calls `RedistributeInvoiceDiscounts`

## PropagateMultipleLinesUpdate

[Line 1081](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1081).

- [1089](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1089) calls `VerifyCRUDIsPossibleForLine`
- [1090](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1090) calls [Codeunit 5506 Graph Mgt - Sales Quote Buffer](https://jonas-paprotka.de/ref/codeunit/5506-graph-mgt-sales-quote-buffer/) `GetFieldSetBufferWithAllFieldsSet`
- [1095](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1095) writes [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) DeleteAll(true)
- [1099](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1099) calls `LoadLines`
- [1107](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1107) calls `PropagateDeleteLine`
- [1117](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1117) calls `PropagateInsertLine`
- [1119](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1119) calls `PropagateModifyLine`

## UpdateLineAmountsFromSalesLine

[Line 1152](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1152), local.

- [1154](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1154) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `GetLineAmountExclVAT`
- [1155](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1155) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `GetLineAmountInclVAT`
- [1158](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1158) calls `UpdateInvoiceDiscountAmount`

## UpdateLineAmountsFromSalesInvoiceLine

[Line 1161](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1161), local.

- [1163](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1163) calls [Table 113 Sales Invoice Line](https://jonas-paprotka.de/ref/table/113-sales-invoice-line/) `GetLineAmountExclVAT`
- [1164](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1164) calls [Table 113 Sales Invoice Line](https://jonas-paprotka.de/ref/table/113-sales-invoice-line/) `GetLineAmountInclVAT`
- [1167](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1167) calls `UpdateInvoiceDiscountAmount`

## FixInvoicesCreatedFromOrders

[Line 1185](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1185).

- [1194](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1194) writes [Table 112 Sales Invoice Header](https://jonas-paprotka.de/ref/table/112-sales-invoice-header/) ModifyAll
- [1195](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1195) calls [Codeunit 9999 Upgrade Tag](https://jonas-paprotka.de/ref/codeunit/9999-upgrade-tag/) `HasUpgradeTag`
- [1195](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1195) calls [Codeunit 9998 Upgrade Tag Definitions](https://jonas-paprotka.de/ref/codeunit/9998-upgrade-tag-definitions/) `GetFixAPISalesInvoicesCreatedFromOrders`
- [1196](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1196) calls [Codeunit 9999 Upgrade Tag](https://jonas-paprotka.de/ref/codeunit/9999-upgrade-tag/) `SetUpgradeTag`
- [1196](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1196) calls [Codeunit 9998 Upgrade Tag Definitions](https://jonas-paprotka.de/ref/codeunit/9998-upgrade-tag-definitions/) `GetFixAPISalesInvoicesCreatedFromOrders`

## CheckValidLineRecord

[Line 1199](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1199), local.

- [1204](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1204) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`

## SetShortcutDimensions

[Line 1213](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1213), local.

- [1218](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1218) validates [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `Shortcut Dimension 1 Code`
- [1221](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1221) validates [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `Shortcut Dimension 2 Code`

## GetIdFromDocumentIdAndSequence

[Line 1225](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1225).

- [1229](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/source/#L1229) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `StripBrackets`

## Source

AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
