FinalizeInvoiceChain
Batch Chain Name | Batch Chain Alias | Apex Classes |
---|---|---|
FinalizeInvoiceChain | FINALIZEINVOICE | BatchExternalTaxRetrieverHelper BuildTransactionTablesBatchHelper SettleInvoicesBatchHelper BatchFinalizeInvoice BatchAssignBalancesHelper BatchExternalTaxRetrieverHelper CreateInstallmentsBatchHelper GetPaymentLinksBatchHelper BatchPdfGenerate TransactionCsvBatchRenderHelper AutoSendInvoiceBatchHelper |
The batch chain involves Apex classes for both batches and batch helpers. The helper classes include additional logic to determine which batches are actually required. Most of them include optimization logic, which skips batches that are not needed under the given conditions, especially when only a single invoice is finalized. JustOn Billing & Invoice Management applies the single invoice optimization when finalizing a single invoice from the invoice list view or from the invoice detail view.
Chain Item | Generated Batch | Description | General Conditions | Additional Conditions for Single Invoice |
---|---|---|---|---|
BatchExternalTaxRetrieverHelper | BatchExternalTaxRetriever | Retrieves tax information from an external tax provider | At least one business entity contains an external tax provider configuration | The business entity of the invoice contains an external tax provider configuration |
BuildTransactionTablesBatchHelper | BatchBuildTransactionTables | One batch per transaction table configuration in template | At least one active transaction table configuration in any template | |
BatchFinalizeTransactionTables | Finalization of the transaction table attachments | At least one active transaction table configuration in any template | ||
SettleInvoicesBatchHelper | BatchSettleInvoices | One batch for invoice settlement and one for credit settlement | The corresponding settlement is enabled in the global settings | The settlement enabled in the global settings matches the invoice balance, for example, enabled invoice settlement for a credit invoice |
BatchFinalizeInvoice | Finalize the invoice | |||
BatchAssignBalancesHelper | BatchAssignBalances | Automatic free account balance assignment | The custom field ON_NoAutoBalanceAssignment__c is not set and there are free account balances available |
|
BatchExternalTaxRetrieverHelper | BatchExternalTaxRetriever | Marks the retrieved tax data as final with the external tax provider | At least one business entity contains an external tax provider configuration | The business entity of the invoice contains an external tax provider configuration |
CreateInstallmentsBatchHelper | BatchCreateInstallments | Creates installments | There is an existing installment configuration | The invoice uses installments |
GetPaymentLinksBatchHelper | BatchGetEntryPaymentLinks | Create payment page links for all related entries | Active JustOn Cash Management integration and at least one active payment provider configuratin | The invoice is not a credit and the payment method is Online Payment |
BatchGetInvoicePaymentLinks | Create payment page link for an installment invoice | Active JustOn Cash Management integration and at least one active payment provider configuratin | The invoice is not a credit and the payment method is Online Payment |
|
BatchPdfGenerate | Create the invoice PDF | |||
TransactionCsvBatchRenderHelper | BatchTransactionCsvGenerate | One batch per transaction CSV table configuration in the template | At least one active transaction CSV table configuration for invoices is in scope | |
BatchTransactionCsvFinalize | Finalization of the transaction CSV table generation | At least one active transaction CSV table configuration for invoices is in scope | ||
AutoSendInvoiceBatchHelper | BatchInvoiceEmailQueue | Sets Email Status on invoices and statements to Queued |
The email auto send feature is enabled | |
BatchInvoiceEmail | Sends invoice and statement emails | The email auto send feature is enabled |
Note
If you use an external tax data provider, the FinalizeInvoiceChain must include the BatchExternalTaxRetrieverHelper as configured by default. In this case, you must not override the standard FinalizeInvoiceChain using a Custom Batch Chain setting.