The Delta Pre-Invoice Generation process is designed to create, update, and delete Invoice Contacts based on configured Campaign Contacts. This process ensures that each Pre-Invoice contains accurate and up-to-date invoicing information, similar to the Standard Pre-Invoice Generation process.
Key Features
Creation of Invoice Contacts:
New Invoice Contacts are created from Campaign Contacts if they do not already exist.
Updating Invoice Contacts:
Existing Invoice Contacts are updated based on changes in the corresponding Campaign Contacts.
Deletion of Invoice Contacts:
Invoice Contacts that are no longer needed (e.g., when a Campaign Contact is deleted) are removed.
Field Mapping:
Campaign Contact fields are mapped to Invoice Contact fields using default mappings.
Users can override default mappings with custom settings.
Configuration
Field Mapping Configuration:
Default field mappings are hard-coded but can be overridden using custom settings.
To override, leave the source field blank and set only the target field in the custom settings.
Custom Field Mapping
Access Custom Settings:
Navigate to the custom settings section within the software.
Locate the Mapping BA settings.
Override Default Mappings:
Leave the source field blank to override a default mapping.
Set the target Invoice Contact field as needed.
Adding New Field Mappings:
Add new field mappings by specifying both source and target fields in the custom settings.
Ensure new mappings are saved and validated.
Common Issues and Solutions
Invoice Contacts Not Created:
Ensure Campaign Contacts are correctly configured and linked to the appropriate campaigns.
Verify that the Delta Pre-Invoice Generation process was triggered successfully.
Invoice Contacts Not Updated:
Check if the Campaign Contacts have the latest information.
Ensure there are no conflicts in the custom field mappings.
Invoice Contacts Not Deleted:
Confirm that the Campaign Contacts have been removed if the corresponding Invoice Contacts are not needed.
Verify that the Delta Pre-Invoice Generation process is configured to handle deletions.
The Delta Pre-Invoice Generation process ensures that all pre-invoices have an assigned accounting period. If accounting periods are not yet created when the pre-invoices are generated, the accounting period field will remain empty and will be updated during the next pre-invoice generation once the accounting periods are created.
The Delta Pre-Invoice Generation process now includes functionality to handle pre-invoices with the status of "Reviewed." This ensures that reviewed pre-invoices are treated according to specific rules to prevent unwanted creation of additional delta pre-invoices.
Handling Reviewed Status:
Reviewed pre-invoices are not updated, similar to invoiced invoices.
Draft pre-invoices can be updated or reassigned as needed.
Resetting Status to Draft:
If any amounts (B3 → N3) change or new pre-invoice items match a reviewed pre-invoice, the status is reset to Draft.
Prevents creation of unnecessary additional delta pre-invoices.
Invoice Assignment Rules:
Ensures that pre-invoice assignments are managed efficiently without creating duplicate pre-invoices.
When the delta invoicing is enabled on the Admin settings the new delta preinvoice generation is called during the following processes:
Batch Job
LWC pre-invoice generation wizard
VF pre-invoice generation wizard
Scheduled Pre-Invoice Batch Job
the global invocable method that calls the batch job →
GenerateInvoiceBatch.doGenerateInvoice
(can be called from everywhere, custom apex code and flows)the end campaign item feature for items based on actuals (triggered my the media campaign trigger)
the end campaign item feature for items based on linear distribution (triggered by the end campaign item feature)
the
FlowInvocableProcess
for flow executions (“CreateInvoicesBatchJob
")the optimizer activation triggered Process Builder flow →
ProcessCompleteEventOptimizingVersion.flow
Instant Execution
the global invocable call
WebServiceCenter.cls
- Parametersaction = CreateInvoices
,parameter = [media campaign id]
orFlowInvocableProcess.cls
- requestaction
=CreateInvoices
(can be called from everywhere, custom apex code and flows)the self service component →
flowInvoiceGenerator
the
FlowInvocableProcess
for flow executions (“CreateInvoices
")
All the following values during the Pre-Invoice Generation are rounded off before the invoice items are saved to the database.
InvoiceAmount__c
GrossAmountB3__c
GrossAmountB2__c
GrossAmountB1__c
InvoicedAmountNet1__c
InvoicedAmountNet2__c
InvoicedAmountNet3__c
InvoiceSurchargeB3Abs__c
InvoiceSurchargeB2Abs__c
RateDiscount1AbsCustom__c
RateDiscount2AbsCustom__c
RateDiscount3AbsCustom__c
RateDiscount4AbsCustom__c
InvoicedQuantity__c
SalesPrice__c
The flexible payment plan for delta work exactly the same way as that of version 2.170
The delta preinvoice are assigned to the flexible payment plan and percentage is recalculated if the campaign item amount has changed.
Following validations are in place media champaign and chapaign items for the purpose of delta invoicing
Condition | CHandling | Error Message |
---|---|---|
| First encountered media campaign with at least one of those fields not set will throw an error |
(field label list depends on which fields are not set) |
| ||
| ||
| ||
| ||
AND
| First encountered weekly media campaign with fiscal periods enabled will throw an error |
|
Campaign Item Validations
Condition | Handling | Error Message |
---|---|---|
| items without bill me set will be ignored | / |
| package components with bill me set will be ignored if the related package header doesn’t have bill me set Package are not supported at all yet in the delta pre-invoice generation, so no need to test this yet. | / |
AND
| First encountered budget item related to a weekly media campaign will throw an error | New Using the media campaign button with standard pre-invoice generation: |
The visualforce page on Preinvoice generation button
on the Media Campaign has been deactivated when Delta is enabled on the admin settings so that we do not need to update this button to run Delta preinvoice when Delta is enabled.
<<Add UI>>