The table below provides a comprehensive overview of all fields and relationships for the Invoice object in Maica. Please refer to the table below for detailed information.
Click here to view and download the complete Invoice Schema.
Validation Rules
The list below outlines the Validation Rules applied to the Invoice Object in Maica.
Please refer to the list below for more detailed information on each Validation Rule.
Funding Type Required When Invoice is Saved
This rule ensures that the Funding Type is populated when the Invoice is saved.
Validation Rule Detail
Rule Name
VAL_INVOICE_0001
Error Message
VAL_0001: Please ensure that the Funding Type is provided.
Error Location
Funding Type
Error Condition Formula
ISPICKVAL(maica_cc__Funding_Type__c, "")
Restrict Invoice Amount Change
This rule ensures that the Invoice Total Amount cannot be changed when a corresponding Stripe Invoice exists.
Validation Rule Detail
Rule Name
Restrict_Invoice_Amount_Change
Error Message
The Total Amount cannot be be updated as there is a corresponding Stripe Invoice
Please refer to the list below for more detailed information on each Trigger Handler.
Invoice Manage Claim Schedule
This trigger is designed to manage the claim schedule for invoices in Maica.
Detail
Load Order
1
Label
InvoiceManageClaimSchedule_MDTM
Execution, Logic & Outcome
Execution of Trigger Logic:
The trigger logic defined in the InvoiceManageClaimSchedule_MDTM class is executed when the trigger conditions are met. The class contains the code that manages the claim schedule process for invoices.
Trigger Conditions:
When a new invoice (maica__Invoice__c) is created.
When an existing invoice is updated.
Any specific field changes that are monitored by the trigger (defined in the handler class).
Logic Explanation
Initialisation:
When an invoice record is created or updated, the trigger is initialised. The InvoiceManageClaimSchedule_MDTM metadata type configuration is loaded, ensuring that the trigger is active (Active__c is true) and has the correct load order (Load_Order__c is 1.0).
Trigger Execution:
Upon initialisation, the trigger executes the logic defined in the InvoiceManageClaimSchedule_MDTM class.
The class methods perform the following steps:
Validation: The invoice data is validated to ensure it is complete and accurate.
Claim Scheduling: Based on the invoice details, claims are scheduled to reflect the payment plan and due dates.
Update: The invoice record is updated with the newly scheduled claim data.
Trigger Outcome:
Once executed, the trigger ensures that each invoice has its claim schedule managed correctly, according to the logic specified in the handler class. This helps maintain accurate claim schedule data for invoices.
Invoice Next Schedule Date
This trigger is designed to manage the next scheduled date for invoices in Maica. This ensures correct calculation of the next scheduled date for invoices, maintaining accurate scheduling data.
Detail
Load Order
1
Label
InvoiceNextScheduledDate_MDTM
Execution, Logic & Outcome
Execution of Trigger Logic:
The trigger logic defined in the InvoiceNextScheduledDate_MDTM class is executed when the trigger conditions are met. The class contains the code that manages the next scheduled date process for invoices.
Trigger Conditions:
When a new invoice (maica__Invoice__c) is created.
When an existing invoice is updated.
Any specific field changes that are monitored by the trigger (defined in the handler class).
Initialisation:
When an invoice record is created or updated, the trigger is initialised. The InvoiceNextScheduledDate_MDTM metadata type configuration is loaded, ensuring that the trigger is active (Active__c is true) and has the correct load order (Load_Order__c is 1.0).
Trigger Execution:
Upon initialisation, the trigger executes the logic defined in the InvoiceNextScheduledDate_MDTM class.
The class methods perform the following steps:
Validation: The invoice data is validated to ensure it is complete and accurate.
Date Calculation: Based on the invoice details, the next scheduled date is calculated to reflect the payment plan and due dates.
Update: The invoice record is updated with the newly calculated next scheduled date.
Trigger Outcome:
Once executed, the trigger ensures that each invoice has its next scheduled date calculated correctly, according to the logic specified in the handler class. This helps maintain accurate scheduling data for invoices.
Invoice Defaults
This trigger is designed to manage the default values for invoices in Maica.
Detail
Load Order
1
Label
InvoiceDefaults_MDTM
Execution, Logic & Outcome
Execution of Trigger Logic:
The trigger logic defined in the InvoiceDefaults_MDTM class is executed when the trigger conditions are met. The class contains the code that manages the setting of default values for invoices.
Trigger Conditions:
When a new invoice (maica__Invoice__c) is created.
When an existing invoice is updated.
Any specific field changes that are monitored by the trigger (defined in the handler class).
Logic Explanation
Initialisation:
When an invoice record is created or updated, the trigger is initialised. The InvoiceDefaults_MDTM metadata type configuration is loaded, ensuring that the trigger is active (Active__c is true) and has the correct load order (Load_Order__c is 1.0).
Trigger Execution:
Upon initialisation, the trigger executes the logic defined in the InvoiceDefaults_MDTM class.
The class methods perform the following steps:
Validation: The invoice data is validated to ensure it is complete and accurate.
Default Setting: Based on predefined criteria, default values such as payment terms, due dates, and invoice status are set.
Update: The invoice record is updated with the newly set default values.
Trigger Outcome:
Once executed, the trigger ensures that each invoice has its default values set correctly, according to the logic specified in the handler class. This helps maintain accurate and consistent data for invoices.
Invoice Rollup Expenditure
This trigger is designed to manage the rollup of expenditures for invoices in Maica.
Detail
Load Order
2
Label
InvoiceRollupExpenditure_MDTM
Execution, Logic & Outcome
Execution of Trigger Logic:
The trigger logic defined in the InvoiceRollupExpenditure_MDTM class is executed when the trigger conditions are met. The class contains the code that manages the rollup expenditure process for invoices.
Trigger Conditions:
When a new invoice (maica__Invoice__c) is created.
When an existing invoice is updated.
Any specific field changes that are monitored by the trigger (defined in the handler class).
Logic Explanation
Initialisation:
When an invoice record is created or updated, the trigger is initialised. The InvoiceRollupExpenditure_MDTM metadata type configuration is loaded, ensuring that the trigger is active (Active__c is true) and has the correct load order (Load_Order__c is 2.0).
Trigger Execution:
Upon initialisation, the trigger executes the logic defined in the InvoiceRollupExpenditure_MDTM class.
The class methods perform the following steps:
Validation: The expenditure data is validated to ensure it is complete and accurate.
Calculation: The total expenditure is calculated based on predefined criteria such as item type and financial rules.
Update: The invoice record is updated with the newly calculated rolled-up expenditure data.
Trigger Outcome:
Once executed, the trigger ensures that each invoice has its expenditures rolled up correctly, according to the logic specified in the handler class. This helps maintain accurate financial data for invoices.
Invoice Claim
This trigger is designed to manage the claim process for invoices in Maica. This ensures correct generation of claims for invoices, maintaining accurate claim data.
Detail
Load Order
10
Label
InvoiceClaim_MDTM
Execution, Logic & Outcome
Execution of Trigger Logic:
The trigger logic defined in the InvoiceClaim_MDTM class is executed when the trigger conditions are met. The class contains the code that manages the claim process for invoices.
Trigger Conditions:
When a new invoice (maica__Invoice__c) is created.
When an existing invoice is updated.
Any specific field changes that are monitored by the trigger (defined in the handler class).
Logic Explanation
Initialisation:
When an invoice record is created or updated, the trigger is initialised. The InvoiceClaim_MDTM metadata type configuration is loaded, ensuring that the trigger is active (Active__c is true) and has the correct load order (Load_Order__c is 10.0).
Trigger Execution:
Upon initialisation, the trigger executes the logic defined in the InvoiceClaim_MDTM class.
The class methods perform the following steps:
Validation: The invoice data is validated to ensure it is complete and accurate.
Claim Generation: Based on the invoice details, claims are generated to reflect the amounts and payment plans specified.
Update: The invoice record is updated with the newly generated claim data.
Trigger Outcome:
Once executed, the trigger ensures that each invoice has its claims processed correctly, according to the logic specified in the handler class. This helps maintain accurate claim data for invoices.