A payment intended to be applied to invoices. Note that one payment can apply to many invoices. These are linked with InvoicePaymentLink which specifies the amount of the payment is for each linked invoice

Group: Database Entities

Implements: Serializable


Properties

PropertyReturnsDescription
adminOrgOrganisationThe account, ie the top level administrative organisation, this payment belongs to. Always set, and every lookup of a payment is scoped by it.
createdByProfileThe profile who recorded the payment. For a payment raised automatically this is whoever the process was running as.
createdDateDateWhen the payment record was entered into Kademi, which is not necessarily when the money changed hands. See getPaymentDate for that.
idLongThe database-assigned unique identifier for this payment.
invoicePaymentLinksList<InvoicePaymentLink>The links recording how much of this payment was applied to each invoice. This runs a query on every call rather than reading a mapped collection, so hold the result rather than calling it in a loop.
paymentAmountBigDecimalThe total amount paid, in the account's currency. One payment can be spread over several invoices, so this is not necessarily the amount applied to any one of them; see the invoice payment links for that breakdown.
paymentDateDateThe date the money was actually paid. This is the date used for reconciliation, as opposed to createdDate which is when the record was keyed in.
paymentTransactionPaymentTransactionThe gateway transaction that settled this payment, when it was taken through a payment provider. Optional; if neither this nor the points debit is set the payment was entered manually.
pointsDebitPointsDebitThe points debit that funded this payment, when the customer paid with points rather than money. Optional; if neither this nor the payment transaction is set the payment was entered manually.

Methods

getId() · getAdminOrg() · getCreatedBy() · getCreatedDate() · getPointsDebit() · getPaymentTransaction() · getPaymentAmount() · getPaymentDate() · addInvoice(Invoice invoice, BigDecimal amount, Profile currentUser, Date createdDate) · getInvoicePaymentLinks()

getId()

Returns: Long

The database-assigned unique identifier for this payment.

getAdminOrg()

Returns: Organisation

The account, ie the top level administrative organisation, this payment belongs to. Always set, and every lookup of a payment is scoped by it.

getCreatedBy()

Returns: Profile

The profile who recorded the payment. For a payment raised automatically this is whoever the process was running as.

getCreatedDate()

Returns: Date

When the payment record was entered into Kademi, which is not necessarily when the money changed hands. See getPaymentDate for that.

getPointsDebit()

Returns: PointsDebit

The points debit that funded this payment, when the customer paid with points rather than money. Optional; if neither this nor the payment transaction is set the payment was entered manually.

getPaymentTransaction()

Returns: PaymentTransaction

The gateway transaction that settled this payment, when it was taken through a payment provider. Optional; if neither this nor the points debit is set the payment was entered manually.

getPaymentAmount()

Returns: BigDecimal

The total amount paid, in the account's currency. One payment can be spread over several invoices, so this is not necessarily the amount applied to any one of them; see the invoice payment links for that breakdown.

getPaymentDate()

Returns: Date

The date the money was actually paid. This is the date used for reconciliation, as opposed to createdDate which is when the record was keyed in.

addInvoice(Invoice invoice, BigDecimal amount, Profile currentUser, Date createdDate)

Returns: InvoicePaymentLink

Applies this payment to an invoice by creating and saving an InvoicePaymentLink between the two. Note that the link is written with this payment's own paymentAmount and createdBy rather than the amount and currentUser arguments, so passing a partial amount will not currently limit what is applied.

ParameterDescription
invoicethe invoice to apply the payment to
amountthe amount to apply; not currently used
currentUserthe profile making the allocation; not currently used
createdDatethe timestamp to record on the link

Returns: List<InvoicePaymentLink>

The links recording how much of this payment was applied to each invoice. This runs a query on every call rather than reading a mapped collection, so hold the result rather than calling it in a loop.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.