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
| Property | Returns | Description |
|---|---|---|
| adminOrg | 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. |
| createdBy | Profile | The profile who recorded the payment. For a payment raised automatically this is whoever the process was running as. |
| createdDate | Date | When the payment record was entered into Kademi, which is not necessarily when the money changed hands. See getPaymentDate for that. |
| id | Long | The database-assigned unique identifier for this payment. |
| invoicePaymentLinks | 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. |
| paymentAmount | 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. |
| paymentDate | 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. |
| paymentTransaction | 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. |
| pointsDebit | 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. |
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.
| Parameter | Description |
|---|---|
invoice | the invoice to apply the payment to |
amount | the amount to apply; not currently used |
currentUser | the profile making the allocation; not currently used |
createdDate | the timestamp to record on the link |
getInvoicePaymentLinks()
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.