Creates invoices and purchase orders on behalf of whichever InvoicingApplication is currently active for the organisation, and builds a PaymentAddress from a shopping cart's captured address fields. Payment providers such as the manual payment app build up an InvoiceBean or PurchaseOrderBean and hand it to this service, which delegates persistence to the first active InvoicingApplication rather than persisting invoices itself.
Methods
newPurchaseOrderList()
Returns: PurchaseOrderBean
Creates a new, empty purchase order bean ready to have its fields populated.
newInvoiceList()
Returns: InvoiceBean
Creates a new, empty invoice bean ready to have its fields populated.
createInvoice(BaseEntity customer, BaseEntity vendor, InvoiceBean invoice)
Returns: void
Creates an invoice for the given customer and vendor, using the current Hibernate session.
| Parameter | Description |
|---|---|
customer | the entity being invoiced |
vendor | the entity issuing the invoice |
invoice | the invoice details to persist |
createPurchaseOrder(BaseEntity customer, BaseEntity vendor, PurchaseOrderBean purchaseOrder)
Returns: void
Creates a purchase order for the given customer and vendor, using the current organisation and Hibernate session.
| Parameter | Description |
|---|---|
customer | the entity the purchase order is for |
vendor | the entity fulfilling the purchase order |
purchaseOrder | the purchase order details to persist |
createPurchaseOrder(Organisation org, BaseEntity customer, BaseEntity vendor, PurchaseOrderBean purchaseOrderList)
Returns: void
Creates a purchase order for the given customer and vendor within the given organisation, using the current Hibernate session.
| Parameter | Description |
|---|---|
org | the organisation the purchase order belongs to |
customer | the entity the purchase order is for |
vendor | the entity fulfilling the purchase order |
purchaseOrderList | the purchase order details to persist |
generatePaymentAddress(Cart cart, PaymentAddressType addressType)
Returns: PaymentAddress
Builds a PaymentAddress from a shopping cart's captured address fields, tagged with the given address type.
| Parameter | Description |
|---|---|
cart | the cart whose address, contact and company fields are copied |
addressType | the type of address being generated, such as billing or delivery |