Payments and Allocations (PMT)

The pmt submodule of acc owns the payment stream — money in or money out — together with the per-invoice allocations that distribute a payment across one or more invoices. A Payment can be linked to a BankStatementLine for bank-reconciled flows or stand on its own (cash). A PaymentAllocation carries the amount allocated to a sales- or purchase-invoice line, plus any discount or write-off amount captured against a write-off ledger account. The submodule depends on acc.bnk for bank account / statement line, acc.jrn for the journal entry created on confirm, acc.sin and acc.pin for the invoices being paid, acc.gld for the write-off account, acc.doc for the matched document line, and com.par / com.org / com.fin / com.log for partner/department/currency.

Concepts

Payment

A single money movement (incoming or outgoing) entered against a partner. Goes through DraftConfirmed; on confirm a journal entry is created via acc.jrn and the allocations are settled against the invoices.

Payment Type

Whether the payment is incoming (we receive money) or outgoing (we pay).

Payment Method

Whether the payment moves through a bank account or cash.

Payment Allocation

A line of the payment that allocates an amount to a single invoice. Captures the allocated amount in foreign and internal currency, plus any discount taken or write-off booked.

Entities

PMT entities

Payment (Payment)

A single money movement.

FieldDescription

documentCode

Business key — the document code (final).

paymentType

Incoming or outgoing — see Payment Types below (final).

paymentMethod

Bank or cash — see Payment Methods below (final).

department

Owning department (final).

company

Owning company, derived from the department (operational, internal).

partner

The counter-party.

paymentDate

Payment date.

description

Free-form description.

currency / currencyRate

Payment currency and conversion rate.

referenceExt

Optional external reference.

bankAccount

Optional bank account (for bank payments).

journal

The journal the payment posts to.

bankStatementLine

Optional originating bank-statement line.

journalEntry

The journal entry created on confirm.

confirmed

Lifecycle flag.

biPaymentStatus

Derived status — see Payment Statuses below.

biTotalAmountExt / biTotalAmountInt

Sum of allocations in foreign / internal currency (operational).

allocations

The per-invoice allocations.

A validation rule enforces that the journal entry’s partner equals the payment’s partner.

Payment Types (PaymentType)

CodeNameMeaning

IN

Incoming

Money received from the partner.

OUT

Outgoing

Money paid to the partner.

Payment Methods (PaymentMethod)

CodeNameMeaning

BNK

Bank

Payment through a bank account.

CSH

Cash

Cash payment.

Payment Statuses (PaymentStatus)

CodeNameMeaning

DR

Draft

Editable; not yet confirmed.

CF

Confirmed

Locked; journal entry has been created.

Payment Allocation (PaymentAllocation)

A single allocation of part of a payment to one invoice.

FieldDescription

payment

Owning payment (composite business key with lineNumber).

lineNumber

Line ordinal within the payment (final).

documentLine

The matched document line (the invoice line).

salesInvoice

Optional convenience reference to the sales invoice (for queries).

purchaseInvoice

Optional convenience reference to the purchase invoice (for queries).

allocatedAmountExt

Amount allocated in the payment currency.

allocatedAmountInt

Amount allocated in the internal currency.

discountAmountExt

Optional discount taken on this invoice (foreign currency).

writeOffAmountExt

Optional write-off booked on this invoice (foreign currency).

writeOffLedgerAccount

Optional ledger account the write-off is booked to.

Functionality

Confirm / unconfirm

The confirm and confirmUndo write actions on Payment flip the payment between Draft and Confirmed. Confirming creates the matching JournalEntry through acc.jrn and settles the allocations against the linked invoices; unconfirming reverses both.

Public API

ACC_PMT_QueryApi and ACC_PMT_CommandApi

This submodule does not provide query- or command-API classes. Other modules read payments and allocations through the standard generated readers and trigger confirm/unconfirm through the entity action handler (PaymentActionWriter).

ViewModel actions

ActionUser-visible effect

confirm (on Payment)

Locks a draft payment, creates the journal entry, and settles the allocations.

confirmUndo (on Payment)

Reverts a confirmed payment back to draft and rolls back the journal entry.