Adds financial payment functionality to a website or organisation: invoicing, quoting, purchase orders and proposal preparation. Registers as "paymentApp" and contributes menu entries, a settings page, invoice and line item table uploaders, search indexers for transaction documents and line items, and journey builder goal nodes fired when a quote is sent or accepted. The nested AccountingRole grants organisation-level access to the payment resources it manages.
Implements: MenuApplication, BrowsableApplication, ChildPageApplication, ComponentApplication, TemplatingApplication, JourneyBuilderApplication, DependentApplication, FieldProviderApplication, SettingsApplication, InvoicingApplication, TableUploadApplication, SearchableApplication
Properties
| Property | Returns | Description |
|---|---|---|
| andIncrementInvoiceCounter | long | Reads and atomically increments the shared invoice counter, for use in generating the next invoice number. Each call returns a new value. |
| andIncrementPurchaseOrderCounter | long | Reads and atomically increments the shared purchase order counter, for use in generating the next purchase order number. Each call returns a new value. |
| andIncrementQuoteCounter | long | Reads and atomically increments the shared quote counter, for use in generating the next quote number. Each call returns a new value. |
| config | AppConfig | The application configuration used to read and write this app's per-organisation settings, such as the invoice, quote and purchase order expressions and the store name. |
| extraFieldsSetting | String | The raw, newline-separated extra field definitions configured for the current tenant organisation, in the "name=value" format written by the payment settings page. |
| instanceId | String | Unique key this application is registered under in the application manager, and how it is accessed from templates and scripts (for example applications.paymentApp). Always returns the literal value "paymentApp". |
| invoiceExpression | String | The invoice number expression configured for the current tenant organisation. Falls back to the default expression if none is configured. |
| legacy | boolean | |
| purchaseOrderExpression | String | The purchase order number expression configured for the current tenant organisation. Falls back to the default expression if none is configured. |
| quoteExpression | String | The quote number expression configured for the current tenant organisation. Falls back to the default expression if none is configured. |
| roles | List<Role> | The roles this application contributes to the platform's role registry - a single-element list containing the AccountingRole instance shared by this class. |
| storeNameSetting | String | The catalogue store used for payment line items in the current tenant organisation, as configured on the payment settings page. |
Methods
getInstanceId() · getRoles() · countNewQuotes(Date from, Date to) · countAcceptedQuotes(Date from, Date to) · countNewProposals(Date from, Date to) · getProposalById(long proposalId) · getStoreNameSetting() · getExtraFieldsSetting() · extraFieldMap() · extraFields() · getStoreNameSetting(Organisation org) · getInvoiceExpression(Organisation org) · getQuoteExpression(Organisation org) · getPurchaseOrderExpression(Organisation org) · getQuoteExpression() · getInvoiceExpression() · getPurchaseOrderExpression() · getAndIncrementInvoiceCounter() · getAndIncrementQuoteCounter() · getAndIncrementPurchaseOrderCounter() · getConfig()
getInstanceId()
Returns: String
Unique key this application is registered under in the application manager, and how it is accessed from templates and scripts (for example applications.paymentApp). Always returns the literal value "paymentApp".
getRoles()
Returns: List<Role>
The roles this application contributes to the platform's role registry - a single-element list containing the AccountingRole instance shared by this class.
countNewQuotes(Date from, Date to)
Returns: Integer
Counts quotes created within the current organisation between the given dates that are still in the NEW status. When from or to is null the platform's default reporting start or finish date is used instead.
| Parameter | Description |
|---|---|
from | the earliest creation date to include, or null to use the default reporting start date |
to | the latest creation date to include, or null to use the default reporting finish date |
countAcceptedQuotes(Date from, Date to)
Returns: Integer
Counts quotes created within the current organisation between the given dates that are in the ACCEPTED status. When from or to is null the platform's default reporting start or finish date is used instead.
| Parameter | Description |
|---|---|
from | the earliest creation date to include, or null to use the default reporting start date |
to | the latest creation date to include, or null to use the default reporting finish date |
countNewProposals(Date from, Date to)
Returns: Integer
Counts proposals created within the current organisation between the given dates that are in the CREATED status. When from or to is null the platform's default reporting start or finish date is used instead.
| Parameter | Description |
|---|---|
from | the earliest creation date to include, or null to use the default reporting start date |
to | the latest creation date to include, or null to use the default reporting finish date |
getProposalById(long proposalId)
Returns: Proposal
Looks up a proposal by its database id, scoped to the current user's home administration organisation.
| Parameter | Description |
|---|---|
proposalId | the id of the proposal to find |
getStoreNameSetting()
Returns: String
The catalogue store used for payment line items in the current tenant organisation, as configured on the payment settings page.
getExtraFieldsSetting()
Returns: String
The raw, newline-separated extra field definitions configured for the current tenant organisation, in the "name=value" format written by the payment settings page.
extraFieldMap()
Returns: Map<String,String>
Parses the current tenant organisation's raw extra field configuration into a map of field name to value, skipping entries with a blank value. The map preserves the order the fields were defined in.
extraFields()
Returns: List<ExtraField>
Builds the current tenant organisation's extra fields as parsed ExtraField beans, derived from extraFieldMap. Entries that fail to parse are omitted.
getStoreNameSetting(Organisation org)
Returns: String
The catalogue store used for payment line items in the given organisation, as configured on the payment settings page.
| Parameter | Description |
|---|---|
org | the organisation to read the setting for |
getInvoiceExpression(Organisation org)
Returns: String
The invoice number expression configured for the given organisation, used to generate invoice numbers such as "INV-00001". Falls back to the default expression if none is configured.
| Parameter | Description |
|---|---|
org | the organisation to read the setting for |
getQuoteExpression(Organisation org)
Returns: String
The quote number expression configured for the given organisation, used to generate quote numbers such as "QUO-00001". Falls back to the default expression if none is configured.
| Parameter | Description |
|---|---|
org | the organisation to read the setting for |
getPurchaseOrderExpression(Organisation org)
Returns: String
The purchase order number expression configured for the given organisation, used to generate purchase order numbers such as "PO-00001". Falls back to the default expression if none is configured.
| Parameter | Description |
|---|---|
org | the organisation to read the setting for |
getQuoteExpression()
Returns: String
The quote number expression configured for the current tenant organisation. Falls back to the default expression if none is configured.
getInvoiceExpression()
Returns: String
The invoice number expression configured for the current tenant organisation. Falls back to the default expression if none is configured.
getPurchaseOrderExpression()
Returns: String
The purchase order number expression configured for the current tenant organisation. Falls back to the default expression if none is configured.
getAndIncrementInvoiceCounter()
Returns: long
Reads and atomically increments the shared invoice counter, for use in generating the next invoice number. Each call returns a new value.
getAndIncrementQuoteCounter()
Returns: long
Reads and atomically increments the shared quote counter, for use in generating the next quote number. Each call returns a new value.
getAndIncrementPurchaseOrderCounter()
Returns: long
Reads and atomically increments the shared purchase order counter, for use in generating the next purchase order number. Each call returns a new value.
getConfig()
Returns: AppConfig
The application configuration used to read and write this app's per-organisation settings, such as the invoice, quote and purchase order expressions and the store name.