Package org.killbill.billing.invoice.api
Interface Invoice
-
- All Superinterfaces:
Entity
- All Known Subinterfaces:
InvoiceFormatter
public interface Invoice extends Entity
-
-
Method Summary
-
Methods inherited from interface org.killbill.billing.util.entity.Entity
getCreatedDate, getId, getUpdatedDate
-
-
-
-
Method Detail
-
addInvoiceItem
boolean addInvoiceItem(InvoiceItem item)
- Parameters:
item- the invoice ietm to add- Returns:
- true if successful
-
addInvoiceItems
boolean addInvoiceItems(Collection<InvoiceItem> items)
- Parameters:
items- the list of items to add- Returns:
- true is successful
-
getInvoiceItems
List<InvoiceItem> getInvoiceItems()
- Returns:
- the list of items on that invoice
-
getTrackingIds
List<String> getTrackingIds()
- Returns:
- the list of usage tracking ids associated with this invoice
-
addTrackingIds
boolean addTrackingIds(Collection<String> trackingIds)
- Parameters:
trackingIds- the list of trackingIds- Returns:
- true is successful
-
getInvoiceItems
<T extends InvoiceItem> List<InvoiceItem> getInvoiceItems(Class<T> clazz)
- Type Parameters:
T- a InvoiceItem type- Parameters:
clazz- the filter class for the items- Returns:
- the list of invoice ietms on that invoice for that type
-
getNumberOfItems
int getNumberOfItems()
- Returns:
- the number of items on that invoice
-
addPayment
boolean addPayment(InvoicePayment payment)
- Parameters:
payment- the successful payment for that invoice- Returns:
- true if we were able to add the payment
-
addPayments
boolean addPayments(Collection<InvoicePayment> payments)
- Parameters:
payments- the list of payments to add on that invoice- Returns:
- true if we were able to add the payments
-
getPayments
List<InvoicePayment> getPayments()
- Returns:
- the list of payments associated with that invoice
-
getNumberOfPayments
int getNumberOfPayments()
- Returns:
- the number of payments on that invoice
-
getAccountId
UUID getAccountId()
- Returns:
- the accountId
-
getInvoiceNumber
Integer getInvoiceNumber()
- Returns:
- the invoice number
-
getInvoiceDate
org.joda.time.LocalDate getInvoiceDate()
- Returns:
- the day the invoice was generated, in the account timezone
-
getTargetDate
org.joda.time.LocalDate getTargetDate()
The target day is the latest day to consider for billing events.- Returns:
- the target day in the account timezone
-
getCurrency
Currency getCurrency()
- Returns:
- the currency associated with that invoice
-
getPaidAmount
BigDecimal getPaidAmount()
- Returns:
- the sum of all successful payment amounts for that invoice
-
getOriginalChargedAmount
BigDecimal getOriginalChargedAmount()
- Returns:
- the sum of all EXTERNAL_CHARGE, FIXED and RECURRING item amounts when the invoice was created
-
getChargedAmount
BigDecimal getChargedAmount()
- Returns:
- the sum of all charges (EXTERNAL_CHARGE, FIXED, RECURRING) and adjustments (item or invoice adjustment) amounts
-
getCreditedAmount
BigDecimal getCreditedAmount()
- Returns:
- the sum of all CBA_ADJ items
-
getRefundedAmount
BigDecimal getRefundedAmount()
- Returns:
- the sum of all refunds and chargebacks for payments associated with that invoice
-
getBalance
BigDecimal getBalance()
- Returns:
- the current balance on that invoice
-
isMigrationInvoice
boolean isMigrationInvoice()
- Returns:
- true if this is a migration invoice
-
getStatus
InvoiceStatus getStatus()
- Returns:
- the current status of the invoice
-
isParentInvoice
boolean isParentInvoice()
- Returns:
- true if this is a parent invoice
-
getParentAccountId
UUID getParentAccountId()
- Returns:
- the parent accountId or null
-
getParentInvoiceId
UUID getParentInvoiceId()
- Returns:
- the parent invoiceId or null
-
getGroupId
UUID getGroupId()
- Returns:
- the invoiceId by default or a unique ID for the N invoices that were generated as a result of an invoice run.
-
-