Purchase Invoices (PIN)
The pin submodule of acc owns the purchase invoice header (PurchaseInvoice), its lines, and the type reference data. Each PurchaseInvoiceLine rolls up the matched PurchaseLiability rows of acc.lia into a single line and links to the journal entry that posts it. The submodule depends on acc.doc for the document scaffolding, acc.lia for the matched liabilities, acc.gld for the line ledger account, acc.jrn for the journal entry, acc.vat for the VAT code, acc.pmt for payment allocations, acc.bas for terms and currency rate, and com.par/com.org/com.fin/com.log/cat.itm for the line content.
Concepts
Purchase InvoiceThe header of an inbound supplier invoice, identified by its document code. Goes through
Draft→Confirmedlifecycle; once confirmed, no edits except payment allocation.Purchase Invoice LineOne line of the invoice. Carries amounts excl./incl. VAT in foreign and internal currency, the VAT code and percentage, and the journal entry the line was posted as. A line aggregates the
PurchaseLiabilityrows it covers.Purchase Invoice TypeA reference type that names the invoice variant (e.g. "standard", "credit note") and pins the number series and default terms-of-invoice for it.
Invoice Base TypeWhether the invoice header is a debit invoice or a credit note.
Entities
Purchase Invoice Type (PurchaseInvoiceType)
A reference type for purchase invoice variants.
| Field | Description |
|---|---|
| Business key (up to 4 characters). |
| Human-readable name. |
| Whether invoices of this type are debit invoices or credit notes — see Invoice Base Types below. |
| Number series used to allocate document codes. |
| Default terms of invoice. |
Invoice Base Types (InvoiceBaseType)
| Code | Name | Meaning |
|---|---|---|
| Debit Invoice | Standard invoice (we owe the supplier). |
| Credit Note | Credit note (the supplier owes us). |
Purchase Invoice (PurchaseInvoice)
The invoice header.
| Field | Description |
|---|---|
| Business key — the document code. |
| Human-readable description. |
| The invoice type (drives number series and terms defaults). |
| Invoice currency and conversion rate. |
| Invoice date. |
| Owning department. |
| The supplier. |
| Terms applied to the invoice. |
| Derived from |
| Whether all lines have been matched to liabilities. Default |
| Lifecycle flag. |
| Derived status — see Invoice Statuses below. |
| Derived due date. |
| Sum of the line amounts (excl. VAT) in foreign / internal currency. |
| Sum of line VAT amounts. |
| Cumulative paid amount (incl. VAT). |
| Outstanding amount. |
| The contained lines and the payment-allocation rows that match this invoice. |
A validation rule enforces that the supplier’s company equals the department’s company.
Invoice Statuses (InvoiceStatus)
| Code | Name | Meaning |
|---|---|---|
| Draft | Editable; not yet confirmed. |
| Confirmed | Locked; payable. |
Purchase Invoice Line (PurchaseInvoiceLine)
One line of a purchase invoice.
| Field | Description |
|---|---|
| Owning invoice (composite business key with |
| Line number. |
| The product item (final). |
| Line description (final). |
| VAT code (final). |
| Optional VAT percentage applied (final). |
| Amount excluding VAT in foreign / internal currency (final). |
| VAT amount in foreign / internal currency (final). |
| Amount including VAT in foreign / internal currency (final). |
| The journal entry that posts the line (operational). |
| The ledger account the line posts to (operational). |
| The liabilities the line covers. |
| Sum of the matched liability amounts; differences are tracked as variances on the liability rows. |
Functionality
Confirm / unconfirm
The confirm and confirmUndo write actions on PurchaseInvoice flip the invoice between Draft and Confirmed. PurchaseInvoiceActionWriter is the action handler dispatched by the framework. Confirming triggers downstream posting (the matching journal entry is created via acc.jrn); unconfirming reverses that.
Public API
ACC_PIN_QueryApi and ACC_PIN_CommandApi
This submodule does not provide query- or command-API classes. Other modules read invoices through the standard generated readers and trigger confirm/unconfirm through the entity action handler (PurchaseInvoiceActionWriter).
ViewModel actions
| Action | User-visible effect |
|---|---|
| Locks a draft invoice and posts the matching journal entry. |
| Reverts a confirmed invoice back to draft and rolls back the journal entry. |