Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

  1. Creation of Invoice Contacts:

    • New Invoice Contacts are created from Campaign Contacts if they do not already exist.

  2. Updating Invoice Contacts:

    • Existing Invoice Contacts are updated based on changes in the corresponding Campaign Contacts.

  3. Deletion of Invoice Contacts:

    • Invoice Contacts that are no longer needed (e.g., when a Campaign Contact is deleted) are removed.

  4. Field Mapping:

    • Campaign Contact fields are mapped to Invoice Contact fields using default mappings.

    • Users can override default mappings with custom settings.

Configuration

  1. 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

  1. Access Custom Settings:

    • Navigate to the custom settings section within the software.

    • Locate the Mapping BA settings.

  2. Override Default Mappings:

    • Leave the source field blank to override a default mapping.

    • Set the target Invoice Contact field as needed.

  3. 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

  1. 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.

  2. Invoice Contacts Not Updated:

    • Check if the Campaign Contacts have the latest information.

    • Ensure there are no conflicts in the custom field mappings.

  3. 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.

  1. Handling Reviewed Status:

    • Reviewed pre-invoices are not updated, similar to invoiced invoices.

    • Draft pre-invoices can be updated or reassigned as needed.

  2. 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.

  3. 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 - Parameters action = CreateInvoices, parameter = [media campaign id] or FlowInvocableProcess.cls - request action = 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

MediaCampaign__c.PaymentInterval__c
==
null

First encountered media campaign with at least one of those fields not set will throw an error

Missing fields: Payment Interval, Payment Start, ...

(field label list depends on which fields are not set)

MediaCampaign__c.PaymentStart__c
==
null

MediaCampaign__c.PaymentDueDate__c
==
null

MediaCampaign__c.Campaign_Start_Date__c
==
null

MediaCampaign__c.Campaign_End_Date__c
==
null

MediaCampaign__c.PaymentInterval__c
==
'weekly (1 week)'

AND

EnableCustomFiscalPeriods__c
==
true

First encountered weekly media campaign with fiscal periods enabled will throw an error

Payment interval weekly (1 week) is not supported when fiscal periods are activated.

Campaign Item Validations

Condition

Handling

Error Message

Campaign_Item__c.BillMe__c
==
false

items without bill me set will be ignored

/

PacketItem__r.BillMe__c
==
false

package components with bill me set will be ignored if the related package header doesn’t have bill me set

Note

Package are not supported at all yet in the delta pre-invoice generation, so no need to test this yet.

/

MediaCampaign__c.PaymentInterval__c
==
'weekly (1 week)'

AND

Campaign_Item__c.Billing_category__c
==
Budget'

First encountered budget item related to a weekly media campaign will throw an error

New
Pre-invoice generation is not supported for the Budget billing category with a weekly payment interval.

Info

Using the media campaign button with standard pre-invoice generation:
Weekly invoicing is not supported for Media Buying.

Info

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>>