PaymentInput
RequestA payment to record, and the document it settles.
Sent in requests. Its values are closed: anything not listed is refused.
Attributes
12Money in (a customer pays a sales invoice, a supplier refunds a purchase) or out (a purchase invoice is paid, a customer is refunded). Named, never implied by a sign.
One of incoming, outgoing
The money that moved, positive, in currency. In the document's currency it is at most what is still due on the document and equals the allocation's amount.
How it was paid: bank_transfer posts to the bank account's ledger account, cash to the organization's default cash account.
One of bank_transfer, cash
The one document this payment settles.
3 attributes of each item
Currency of amount, the money that moved (ISO 4217): that of the bank or cash account. Defaults to the document's currency.
For bank_transfer: the bank account it moved on; defaults to the organization's default bank account. Not sent with cash.
An imported transaction (origin: import, posted by no document) that already books this payment: the payment is linked to it and nothing is posted. Its receivable (sales) or payable (purchase) lines must carry the amount in the payment's direction beyond the payments already linked to it in that direction (400 PAYMENT_TRANSACTION_NOT_LINKABLE otherwise).
Details
It is already linked (409 PAYMENT_TRANSACTION_LINKED) when those payments cover all it carries in that direction, or when a payment of this invoice is linked to it. A linked payment may be a refund (direction against the document's) and may settle a credit note. On an invoice brought over too (origin import or opening) the linked payment is recorded whatever the invoice's approval state: it records money that already moved and pays nothing out. A live invoice's payment, linked or not, needs its approval (APPROVAL_*). A caller holding ledger:write and invoices:write can record history that never passes approval; approval guards money going out, not booked history. On a document in another currency the payment is in the book currency (amount the euros that moved, the allocation what it settled) or in the document's (the journal's bank lines are then the euros), and is the transaction's only payment. Its rate and book figures are the app's own settlement when the journal booked exactly that (its receivable or payable the book value released, its bank the euros), else read off the journal; refused (400 PAYMENT_TRANSACTION_NOT_LINKABLE) when the journal cannot be read as the payment's booking.