---
id: object/codeunit/7000005-es
type: object
title: Codeunit 7000005 "Invoice-Split Payment" (ES)
summary: Codeunit 7000005 "Invoice-Split Payment" (ES) in the ES country layer (Microsoft.Finance.ReceivablesPayables). 15 public procedures, 15 events. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - es layer
versions:
  introduced: "29"
  last_changed: null
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: b3caead003f392c05160dc8ba5698711a603606d3a585f0c39a6ac796fac228d
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/ES/BaseApp/Local/Finance/ReceivablesPayables/InvoiceSplitPayment.Codeunit.al
    title: src/Layers/ES/BaseApp/Local/Finance/ReceivablesPayables/InvoiceSplitPayment.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations:
    - localization/es
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/10023
object_type: codeunit
object_id: 7000005
name: Invoice-Split Payment
namespace: Microsoft.Finance.ReceivablesPayables
app: Base Application
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
country: ES
counts:
  fields: 0
  procedures: 32
  events: 15
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
---

# Codeunit 7000005 "Invoice-Split Payment" (ES)

> Codeunit 7000005 "Invoice-Split Payment" (ES) in the ES country layer (Microsoft.Finance.ReceivablesPayables). 15 public procedures, 15 events. Introduced in BC29, still in BC30.

ES country layer · Microsoft.Finance.ReceivablesPayables · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/ES/BaseApp/Local/Finance/ReceivablesPayables/InvoiceSplitPayment.Codeunit.al) · facts from BC29

An object of the [ES localization](../../localizations/es.md), not part of W1.

## Events published

- `OnAfterSplitSalesInvCalculateAmounts(var GenJournalLine: Record "Gen. Journal Line"; var SalesHeader: Record "Sales Header"; var RemainingAmount: Decimal; var RemainingAmountLCY: Decimal; Installment: Record Installment; CurrDocNo: Integer; PaymentTerms: Record "Payment Terms")` (integration)
- `OnAfterSplitPurchInvCalculateAmounts(var GenJournalLine: Record "Gen. Journal Line"; var PurchaseHeader: Record "Purchase Header"; var RemainingAmount: Decimal; var RemainingAmountLCY: Decimal)` (integration)
- `OnBeforeSplitSalesInvCloseEntry(var GenJournalLine: Record "Gen. Journal Line"; SalesHeader: Record "Sales Header")` (integration)
- `OnBeforeSplitSalesInvCreateBills(var GenJournalLine: Record "Gen. Journal Line"; SalesHeader: Record "Sales Header"; Installment: Record Installment; CurrDocNo: Integer; PaymentTerms: Record "Payment Terms"; RemainingAmount: Decimal; RemainingAmountLCY: Decimal)` (integration)
- `OnBeforeSplitPurchInvCalculateAmounts(var GenJournalLine: Record "Gen. Journal Line"; var PurchaseHeader: Record "Purchase Header"; var TotalAmount: Decimal; var VATAmount: Decimal; var TotalAmountLCY: Decimal; var VATAmountLCY: Decimal)` (integration)
- `OnBeforeSplitPurchInvCloseEntry(var GenJournalLine: Record "Gen. Journal Line"; PurchaseHeader: Record "Purchase Header")` (integration)
- `OnBeforeSplitPurchInvCreateBills(var GenJournalLine: Record "Gen. Journal Line"; PurchaseHeader: Record "Purchase Header"; Installment: Record Installment; CurrDocNo: Integer; PaymentTerms: Record "Payment Terms"; RemainingAmount: Decimal; RemainingAmountLCY: Decimal)` (integration)
- `OnBeforeSplitServInvCloseEntry(var GenJournalLine: Record "Gen. Journal Line"; ServiceHeader: Record Microsoft.Service.Document."Service Header")` (integration, obsolete 27.0)
- `OnBeforeSplitServInvCreateBills(var GenJournalLine: Record "Gen. Journal Line"; ServiceHeader: Record Microsoft.Service.Document."Service Header")` (integration, obsolete 27.0)
- `OnSplitPurchInvOnBeforeCheckPaymentMethod(var PurchHeader: Record "Purchase Header"; var PaymentMethod: Record "Payment Method"; var PaymentTerms: Record "Payment Terms"; var IsHandled: Boolean)` (integration)
- `OnSplitSalesInvOnBeforeCheckPaymentMethod(var SalesHeader: Record "Sales Header"; var PaymentMethod: Record "Payment Method"; var PaymentTerms: Record "Payment Terms"; var IsHandled: Boolean)` (integration)
- `OnSplitSalesInvOnCreateBillsOnBeforePostGenJnlLine(var GenJournalLine: Record "Gen. Journal Line"; var SalesHeader: Record "Sales Header")` (integration)
- `OnSplitPurchInvOnCreateBillsOnBeforePostGenJnlLine(var GenJournalLine: Record "Gen. Journal Line"; PurchaseHeader: Record "Purchase Header")` (integration)
- `OnSplitServiceInvOnCreateBillsOnBeforePostGenJnlLine(var GenJournalLine: Record "Gen. Journal Line"; ServiceHeader: Record Microsoft.Service.Document."Service Header")` (integration, obsolete 27.0)
- `OnBeforeSplitPurchInv(var PurchHeader: Record "Purchase Header"; var VendLedgEntry: Record "Vendor Ledger Entry"; var IsHandled: Boolean)` (integration)

## Procedures

- `SplitSalesInv(var SalesHeader: Record "Sales Header"; var CustLedgEntry: Record "Cust. Ledger Entry"; var Window: Dialog; SourceCode: Code[10]; GenJnlLineExtDocNo: Code[35]; GenJnlLineDocNo: Code[20]; VATAmount: Decimal; HideProgressWindow: Boolean)`
- `SplitPurchInv(var PurchHeader: Record "Purchase Header"; var VendLedgEntry: Record "Vendor Ledger Entry"; var Window: Dialog; SourceCode: Code[10]; GenJnlLineExtDocNo: Code[35]; GenJnlLineDocNo: Code[20]; VATAmount: Decimal)`
- `RoundReceivableAmt(Amount: Decimal): Decimal`
- `RoundReceivableAmtLCY(Amount: Decimal): Decimal`
- `RoundPayableAmt(Amount: Decimal): Decimal`
- `RoundPayableAmtLCY(Amount: Decimal): Decimal`
- `FindCustVATSetup(var VATSetup: Record "VAT Posting Setup"; SalesHeader2: Record "Sales Header")`
- `FindVendVATSetup(var VATSetup: Record "VAT Posting Setup"; PurchHeader2: Record "Purchase Header")`
- `SplitServiceInv(var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var CustLedgEntry: Record "Cust. Ledger Entry"; var Window: Dialog; SourceCode: Code[10]; GenJnlLineExtDocNo: Code[35]; GenJnlLineDocNo: Code[20]; VATAmount: Decimal)` (obsolete 27.0: Moved to codeunit ServInvoiceSplitPayment)
- `FindCustVATSetupServ(var VATSetup: Record "VAT Posting Setup"; ServiceHeader2: Record Microsoft.Service.Document."Service Header")` (obsolete 27.0: Moved to codeunit ServInvoiceSplitPayment)
- `CalculateDate(DateFormulaText: Code[20]; DueDate: Date): Date`
- `CheckDueDate(NewDueDate: Date; InitialDocumentDate: Date; MaxNoOfDays: Integer): Boolean`
- `RunOnBeforeSplitServInvCloseEntry(var GenJournalLine: Record "Gen. Journal Line"; ServiceHeader: Record Microsoft.Service.Document."Service Header")` (internal)
- `RunOnBeforeSplitServInvCreateBills(var GenJournalLine: Record "Gen. Journal Line"; ServiceHeader: Record Microsoft.Service.Document."Service Header")` (internal)
- `RunOnSplitServiceInvOnCreateBillsOnBeforePostGenJnlLine(var GenJournalLine: Record "Gen. Journal Line"; ServiceHeader: Record Microsoft.Service.Document."Service Header")` (internal)

Plus 2 local procedures.

## Triggers

OnRun

## Recent changes

- 2026-08-07 [#10023 [Master]-Customer Ledger Bill Entries display default Customer Posting Group instead of Alternative Customer Posting Group set on Sales Documents in the Spanish version.](../../changes/bcapps/10023.md) (main, BC30, fix)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

## Deprecations

- procedure RunOnBeforeSplitServInvCloseEntry: guarded (#if not CLEAN27)
- procedure RunOnBeforeSplitServInvCreateBills: guarded (#if not CLEAN27)
- procedure RunOnSplitServiceInvOnCreateBillsOnBeforePostGenJnlLine: guarded (#if not CLEAN27)
- procedure FindCustVATSetupServ: Pending 27.0 (#if not CLEAN27), "Moved to codeunit ServInvoiceSplitPayment"
- procedure OnBeforeSplitServInvCloseEntry: Pending 27.0 (#if not CLEAN27), "Moved to codeunit ServInvoiceSplitPayment"
- procedure OnBeforeSplitServInvCreateBills: Pending 27.0 (#if not CLEAN27), "Moved to codeunit ServInvoiceSplitPayment"
- procedure OnSplitServiceInvOnCreateBillsOnBeforePostGenJnlLine: Pending 27.0 (#if not CLEAN27), "Moved to codeunit ServInvoiceSplitPayment"
- procedure SplitServiceInv: Pending 27.0 (#if not CLEAN27), "Moved to codeunit ServInvoiceSplitPayment"

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Invoice-Split Payment")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.

A ES country object, not part of W1: the default corpus does not have it; `bcatlas_list_countries` shows which countries the atlas has.
