Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

The New Delta Pre-Invoice Generation feature ensures that your invoicing process is accurate and up-to-date by comparing the latest invoiced amounts with new amounts and creating delta pre-invoice items for any differences. This feature handles various aspects of invoicing, including timesheet activities, flexible payment plans, packages, and invoice contacts, making your invoicing more efficient and reliable.

How it works

When delta invoicing is activated, the generation of pre-invoices is based on comparing the latest invoiced amounts with the new amounts, which include the changes. When you generate a new pre-invoice, the system will fetch the latest invoiced items and compare them with the new campaign amounts to identify any differences. The system will create delta pre-invoice items for any differences found between the latest invoiced amounts and the new amounts.

New Pre-Invoice Delta Fields and invoice items

Delta pre invoices are generated and invoice items are created when the delta optimization version is activated

The delta changes are made in the pre invoice of their respective period or if the period is closed for invoicing the adjustments are made in the next open period. The validation is in place when there are open pre invoices for in the period that has to be closed

When on Accounting Periods Object Invoicing Closed is marked as true a Validation runs to check if there are open pre-invoices assigned to this Accounting Period (Invoice__c.AccountingPeriod__c). If there’s no pre invoice assigned, it saves the changes to Accounting Period. And shows a message if there are open pre invoices

image-20240709-123855.png

Important information:

  1. If a media champaign is running for more than 2 month and there are already invoiced invoices for the first 2 months and the invoicing period is also closed the delta pre invoice will be created in the third month which is open but the accounting date of the adjustment happening in the invoice items from first 2 period will be their respective date from the first 2 month. This will be fixed in future release.

  2. When delta is enabled and there are pre invoices without the accounting period the preinvoice generation will assign an accounting period to all the preinvoices on the org. If the runtime of the campaign item is in future and accounting periods are not yet created, the accounting period will stay empty and when it is created it will be assigned it to the Preinvoice with the next preinvoice generation.

Financial Changes

Only financial changes are taken into consideration by the Pre invoice generation and the following items are being compared to evaluate if it is a financial change or not.

  • Invoice Item Amount Comparison:

    • comparison of invoice item amounts already invoiced with those that would be calculated by the next pre-invoice generation, for each specified payment interval (total, yearly, half-yearly, quarterly, monthly, weekly).

    • This comparison is done at the invoice item level, considering amounts B3, B2, B1, N1, N2, and N3

  • Invoicing Based on Linear Distribution vs. Actual Delivery

    • There are two types of invoicing: based on linear distribution (checkbox on CI) and based on actual delivery data (utilizing actual delivery from Revenue Schedules).

    • For linear distribution, amounts are calculated based on the runtime of the campaign item across payment intervals.

    • For actual delivery, amounts are calculated based on delivery data in Revenue Schedule, for billing categories such as CPM, CPC, vCPM, CPCV and Budget

      • Weekly payment interval is using Revenue Schedules Daily and has to be enabled through admin setting

  • Threshold Feature for Delta Invoice Generation:

    • With Delta we have implemented a threshold feature setting allowing users to define a minimum percentage change in calculated amounts that triggers the creation of a delta invoice item.

    • This setting should enable the system to decide whether a delta invoice item is to be created (e.g., a 10% threshold)

New Invoice item fields

The following new fields for delta invoicing are created which will calculate the outstanding amount on those based on changes done for Campaigns and what was already invoiced.

All Roll-ups share following condition:

We don’t roll-up the package header amounts since we already roll-up the package component amounts.

ItemRecordType__c != Packet

The delta roll-ups will only be done when the New VAT Logic is enabled in the Admin Settings. (Current Default setting)

Invoice Field API Name

Invoice Field Label

Invoice Item API Name + Logic

GrossAmountB3delta__c

Delta Gross Amount B3

GrossAmountB3delta__c

Additional Condition:
NonMedia__c == false

GrossAmountB2delta__c

Delta Gross Amount B2

GrossAmountB2delta__c

Additional Condition:
NonMedia__c == false

GrossAmountB1delta__c

Delta Gross Amount B1

GrossAmountB1delta__c

Additional Condition:
NonMedia__c == false

InvoicedAmountNet1delta__c

Delta Invoiced Amount N1

InvoicedAmountNet1delta__c

Additional Condition:
NonMedia__c == false

InvoicedAmountNet2delta__c

Delta Invoiced Amount N2

InvoicedAmountNet2delta__c

Additional Condition:
NonMedia__c == false

InvoicedAmountNet3delta__c

Delta Invoiced Amount N3

InvoicedAmountNet3delta__c

Additional Condition:
NonMedia__c == false

NonMediaAmountdelta__c

Delta Non-Media Amount

InvoicedAmountNet3delta__c

Additional Condition:
NonMedia__c == true

DstAmountdelta__c

Delta DST Amount

DstAmountdelta__c

Additional Condition:
DstRelevant__c == true && DstExempt__c == false

NonTaxableAmountDstdelta__c

Delta Nontaxable Amount (DST)

Based on TaxableAmountType__c:
InvoicedAmountNet2delta__c
or
InvoicedAmountNet3delta__c

Additional Condition:
DstRelevant__c == false || DstExempt__c == true

TaxableAmountDstdelta__c

Delta Taxable Amount (DST)

Based on TaxableAmountType__c:
InvoicedAmountNet2delta__c
or
InvoicedAmountNet3delta__c

Additional Condition:
DstRelevant__c == true && DstExempt__c == false

VATAmount1delta__c

Delta VAT Amount (Type 1 (A))

VATAmountdelta__c

Additional Condition:
VATExempt__c == false && VATType__c = '1'

VATAmount1Bdelta__c

Delta VAT Amount (Type 1 (B))

VATAmountBdelta__c

Additional Condition:
VATExempt__c == false && VATType__c = '1'

VATAmount2delta__c

Delta VAT Amount (Type 2 (A))

VATAmountdelta__c

Additional Condition:
VATExempt__c == false && VATType__c = '2'

VATAmount2Bdelta__c

Delta VAT Amount (Type 2 (B))

VATAmountBdelta__c

Additional Condition:
VATExempt__c == false && VATType__c = '2'

TaxableAmountVatType1delta__c

Delta Taxable Amount (VAT Type 1)

Based on TaxableAmountType__c:
InvoicedAmountNet2delta__c + DstAmount__c
or
InvoicedAmountNet3delta__c + DstAmount__c

Additional Condition:
VATExempt__c == false && VATType__c == '1'

TaxableAmountVatType2delta__c

Delta Taxable Amount (VAT Type 2)

Based on TaxableAmountType__c:
InvoicedAmountNet2Pdelta__c + DstAmount__c
or
InvoicedAmountNet3delta__c + DstAmount__c

Additional Condition:
VATExempt__c == false && VATType__c == '2'

NonTaxableAmountTotaldelta__c

Delta Nontaxable Amount (VAT Total)

Based on TaxableAmountType__c:
InvoicedAmountNet2delta__c + DstAmount__c
or
InvoicedAmountNet3delta__c + DstAmount__c

Additional Condition:
VATExempt__c == true or TaxableAmountType__c not supported or VATType__c not supported

For Non delta/Normal Items the following fields are relevant

Those normal roll-up fields does not include the amounts of the technical reversal items.

All Roll-ups share already following condition:

We don’t roll-up the package header amounts since we already roll-up the package component amounts.

ItemRecordType__c != Packet

The roll-ups adjustments will only be done when the New VAT Logic is enabled in the Admin Settings. (This is the default since 8+ years)

The condition that need to be added to all of them is:

CreationType__c != 'Technical Reversal'

Technical reversal items will not be part of any roll-up.

Invoice Field API Name

Invoice Field Label

Invoice Item API Name + Logic

GrossAmountB3__c

(This is a salesforce roll-up field and needs to be changed in the field definition)

Gross Amount B3

GrossAmountB3__c

Additional Condition:
NonMedia__c == false

GrossAmountB2__c

(This is a salesforce roll-up field and needs to be changed in the field definition)

Gross Amount B2

GrossAmountB2__c

Additional Condition:
NonMedia__c == false

GrossAmountB1__c

(This is a salesforce roll-up field and needs to be changed in the field definition)

Gross Amount B1

GrossAmountB1__c

Additional Condition:
NonMedia__c == false

InvoicedAmountNet1__c

(This is a salesforce roll-up field and needs to be changed in the field definition)

Invoiced Amount N1

InvoicedAmountNet1__c

Additional Condition:
NonMedia__c == false

InvoicedAmountNet2__c

(This is a salesforce roll-up field and needs to be changed in the field definition)

Invoiced Amount N2

InvoicedAmountNet2__c

Additional Condition:
NonMedia__c == false

InvoicedAmountNet3__c

(This is a salesforce roll-up field and needs to be changed in the field definition)

Invoiced Amount N3

InvoicedAmountNet3__c

Additional Condition:
NonMedia__c == false

NonMediaAmount__c

(This is a salesforce roll-up field and needs to be changed in the field definition)

Non-Media Amount

InvoicedAmountNet3__c

Additional Condition:
NonMedia__c == true

DstAmount__c

(This is calculated in the InvoiceItemTrigger.cls and needs to be changed there)

DST Amount

DstAmount__c

Additional Condition:
DstRelevant__c == true && DstExempt__c == false

NonTaxableAmountDst__c

(This is calculated in the InvoiceItemTrigger.cls and needs to be changed there)

Nontaxable Amount (DST)

Based on TaxableAmountType__c:
InvoicedAmountNet2__c
or
InvoicedAmountNet3__c

Additional Condition:
DstRelevant__c == false || DstExempt__c == true

TaxableAmountDst__c

(This is calculated in the InvoiceItemTrigger.cls and needs to be changed there)

Taxable Amount (DST)

Based on TaxableAmountType__c:
InvoicedAmountNet2__c
or
InvoicedAmountNet3__c

Additional Condition:
DstRelevant__c == true && DstExempt__c == false

VATAmount1__c

(This is a salesforce roll-up field and needs to be changed in the field definition)

VAT Amount (Type 1 (A))

VATAmount__c

Additional Condition:
VATExempt__c == false && VATType__c = '1'

VATAmount1B__c

(This is a salesforce roll-up field and needs to be changed in the field definition)

VAT Amount (Type 1 (B))

VATAmountB__c

Additional Condition:
VATExempt__c == false && VATType__c = '1'

VATAmount2__c

(This is a salesforce roll-up field and needs to be changed in the field definition)

VAT Amount (Type 2 (A))

VATAmount__c

Additional Condition:
VATExempt__c == false && VATType__c = '2'

VATAmount2B__c

(This is a salesforce roll-up field and needs to be changed in the field definition)

VAT Amount (Type 2 (B))

VATAmountB__c

Additional Condition:
VATExempt__c == false && VATType__c = '2'

TaxableAmountVatType1__c

(This is calculated in the InvoiceItemTrigger.cls and needs to be changed there)

Taxable Amount (VAT Type 1)

Based on TaxableAmountType__c:
InvoicedAmountNet2__c + DstAmount__c
or
InvoicedAmountNet3__c + DstAmount__c

Additional Condition:
VATExempt__c == false && VATType__c == '1'

TaxableAmountVatType2__c

(This is calculated in the InvoiceItemTrigger.cls and needs to be changed there)

Taxable Amount (VAT Type 2)

Based on TaxableAmountType__c:
InvoicedAmountNet2__c + DstAmount__c
or
InvoicedAmountNet3__c + DstAmount__c

Additional Condition:
VATExempt__c == false && VATType__c == '2'

NonTaxableAmountTotal__c

(This is calculated in the InvoiceItemTrigger.cls and needs to be changed there)

Nontaxable Amount (VAT Total)

Based on TaxableAmountType__c:
InvoicedAmountNet2__c + DstAmount__c
or
InvoicedAmountNet3__c + DstAmount__c

Additional Condition:
VATExempt__c == true or TaxableAmountType__c not supported or VATType__c not supporte

The general amount calculation is described here: 4.2.6.2 Amount Calculation and Discounts

Referenced Invoice Number

A new invoice item field has been created to be able to store a relation to an invoice item that is necessary for the delta invoicing solution.

  • API Name: PositionReference__c

  • Type: Lookup(Invoice Item)

  • Child Relationship Name: PositionReferences

  • Description / Help Text: Part of the delta invoicing solution. References to the related invoice item.

image-20240709-111600.png

Invoice Item Creation Type

A new picklist field has been created so as to identify an invoice item's creation type CreationType__c.

Definition: This field indicates the type of creation for this invoice item.

This field is preset automatically and should not be changed by the user.

Following are the picklist value

  • None: This creation type is same as the related invoice item. Nothing will change when it comes to displaying this item

  • Technical Reversal - This is the negative clone of the previous version

image-20240709-093015.png
  • Delta Adjustment - This is new version of the Invoice item after the change. This item would display the new Delta fields

image-20240709-093215.png

Assigning Accounting Periods

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.

Pre Invoice Status

The Delta Pre-Invoice Generation process now includes pre-invoices with status "Reviewed." This ensures that reviewed pre-invoices are treated according to specific rules to prevent unwanted creation of additional delta pre-invoices.

  1. Functionality of Status “Reviewed”:

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

Batch Job Processing with Delta

When the delta invoicing is enabled on the Admin settings the new delta pre invoice generation is called during the following batch processes:

  • LWC pre-invoice generation wizard

  • Visual force 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

Rounding of during delta preinvoice generation

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

Validations relevant to Pre invoice Generation

Following validations are in place for Media champaign and Champaign items for when pre invoice generation is triggered

Media Champaign Conditions

 Error Message

MediaCampaign__c.PaymentInterval__c
==
null

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

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

Champaign item Condition

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

Package are not supported yet in the delta pre-invoice generation.

/

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

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

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

Important: Customers can change unlimited invoicing to true/false when the campaign items are partially or fully invoiced for the purpose of delta invoicing.

The visualforce page on Preinvoice generation button on the Media Campaign has been deactivated when Delta is enabled on the admin settings

<<Add UI>>

Important Information:

  1. “Update delivery data” button has been removed from the Invoice object and this action of updating the delivered quantity is included in the PreInvoice generation and Pre-invoice update stage is included in the old billing run

  2. When the pre invoices are generated for the media champaign with weekly payment interval when the Admin Setting “Enable calculation of Revenue Schedules Daily“ is disabled it will create Pre-Invoices with a 0 as invoice item InvoicedQuantity__c and QuantityDelivered__c. Kindly report if it give a null pointer error.

  3. If the campaign item is changed/edited without optimizer the changes will not be reflected automatically in the pre invoices and the run pre invoices button has to be triggered to have the change reflected in pre-invoice. With optimizer the pre-invoice gets updated automatically

Threshold Feature

OUT OF SCOPE FOR DELTA VERSION I

The threshold feature allows users to define a minimum percentage change in the calculated amounts which triggers the creation of a delta invoice item.

Assigning Timesheet Activities

If your campaign item is supposed to be invoice-based on the timesheet activities, you need to ensure that your ADspec has a CPH billing category and that your campaign item should have Linear Distribution checked as false and Time Tracking should be true.

The change in the Delta release is that users do not need to press “Update delivered quantity” on the Invoice, since the revenue schedule data is updated automatically in the preinvoice generation.

When the timesheet activity-based campaign item is adjusted and with the delta invoicing, we can have multiple invoice items for the same campaign item with the same InvoiceItemStartDate__c and InvoiceItemEndDate__c. We assign the “latest“ invoice item to the timesheet activity. The latest invoice item is always the one that gets created or updated.

Flexible Payment Plans

With the enhancements in the last version, we enabled the possibility to edit or delete the Flexible payment plans that are not related to the Invoiced Invoice item. To achieve this we have a relationship between Flexible Payment Plan and PreInvoice/Invoice Item to be more transparent about which of those records belong to each other. One Flexible Payment Plan can only have one Preinvoice/Invoice Item related to it. This relation is generated by the Preinvoice generation and can not be set or changed manually.

When an Invoice/invoice item is canceled we do not remove the relation, however, next preinvoice generation will relate the new correct preInvoice item to the flexible payment plan. When the Campaign Item is canceled the relation stays.

The Pre-Invoice Generation validates if the total of all Flexible Payment Plans matches the amount of the Campaign Item. When the total amount or percentage does not match, Preinvoice generation will show the error.

Flexible Payment Plan invoice items will never create technical reversal or delta invoice items. If the campaign item amount changes for those campaign items, new flexible payment plans are created by the user to cover the remaining.

In the Beta I version Flexible payment plan-related pre-invoice items are merged with normal and/or delta pre-invoice items when those have matching accounting periods.

(warning) Preinvoice generation will not be automatically triggered by the optimizing version activation and should be called after the Flexible payment plan is adjusted.

We strongly suggest using the standard Salesforce features to track the change history of the Flexible Payment plans to see which users have performed the change.

A Flexible Payment Plan Invoice Items have always following (additional) field setting logic

Field

Value

Notes

DistributionRatio__c

See Notes

Is calculated based on related Flexible Payment Plan and related Campaign Item

for PercentageAmount__c != null
PercentageAmount__c / 100

for Amount__c != null
Amount__c / Campaign Item Amount

Which “Campaign Item Amount” is used can be configured in the Admin Settings.
Default is Amount_net_net__c

FlexiblePaymentAmount__c

A “Campaign Item Amount”

Which “Campaign Item Amount” is used can be configured in the Admin Settings.
Default is Amount_net_net__c

LinearDistribution__c

false

 

DeliveryAutoImport__c

false

 

DistributionUnit__c

Amount

 

InvoiceItemAccountingDate__c

InvoiceDate__c of related Flexible Payment Plan

 

InvoiceItemAccountingEndDate__c

Campaign_End_Date__c of related Media Campaign

 

InvoiceItemStartDate__c

from_Date__c of related Campaign Item

 

InvoiceItemEndDate__c

until_Date__c of related Campaign Item

 

CreationType__c

Flexible Payment Plan

 

Amount-based Flexible Payment Plan

When the amount-based FPP-related campaign item is optimized or adjusted, the user needs to adjust the amounts in the NOT invoiced Flexible payment plan or add a new one to get the amount matching to the Campaign item.

Percentage-based Flexible Payment Plan

When Percentage based FPP related campaign item is optimized or adjusted, ADvendio will recalculate % of the existing Flexible Payment plan, to represent the ratio or invoiced, where the user needs to adjust the % in the NOT invoiced Flexible Payment plan or add a new one to get 100% of FPP.

We have adjusted the Flexible payment plan field PercentageAmount up to 5 numbers and 2 decimals

Publication Dates Additions

Flexible Payment Plans created by selected Publication Dates are created as percentage-based flexible payment plans.

In cases of adding more selected publication dates, it does not recalculate the % for invoiced or reviewed Flexible Payment Plans because the amount of the campaign item has not changed. Only adjust open Flexible Payment Plans linearly based on the outstanding %.

We also do not allow the deletion of Selected Publication Dates with a relationship to a Flexible Payment Plan where a related Invoice item is invoiced.

Deleting a publication date related to a flexible payment plan that relates to a reviewed pre-invoice item, will delete the related flexible payment plan and the next pre-invoice generation will delete the reviewed pre-invoice.

Invoice at Start / End of Runtime Additions

Flexible Payment Plans created by the Invoice at the Start / End of Runtime Checkboxes are created as percentage-based flexible payment plans.

Managing Packages

OUT of scope for Delta Beta version I

Handling Invoice Contacts

The system creates and updates invoice contacts based on the configured campaign contacts. If any contacts are no longer needed, they will be deleted.

  • No labels