LogoLogo
Maica's Homepage
Admin Guide
Admin Guide
  • Welcome to Maica Administration
  • Getting Started
    • Check your Salesforce Hosting
    • Licence Agreement
    • The Maica Release Process
    • Find your Maica Edition
    • The Implementation Process
  • Data
    • Data Objects
      • Agreement Item
      • Appointment
      • Availability
      • Booking Item
      • Checklist
      • Client Note
      • Connection
      • Contact
      • Delivery Activity
      • Funding
      • Funding Item
      • Invoice
      • Invoice Line Item
      • Location
      • Log
      • Payment Request
      • Preference
      • Price List
      • Price List Entry
      • Resource
      • Resource Participant
      • Service Agreement
      • Service Agreement Leave
      • Service Agreement Statement
      • Service Booking
      • Shift
      • Support Category
      • Support Item
      • Timesheet
      • Timesheet Entry
      • Unavailability
    • Permission Sets
    • Reference Data
      • Reference Data Template
      • Import Template
    • Data Import Utility
      • NDIS Support Catalogue
      • Data Import Flows
  • System Processes
    • Billing Invoice Generation
    • Timesheet Generation
    • Recurring Schedules
    • Travel Claiming and Expenses
    • Public Holiday Configuration
    • Configuring Maica Components
      • Appointment Services
      • Support Items
      • Support Categories
      • Overnight and 24 Hour Availability
  • Enable Maica Actions
  • Scheduled Jobs
  • Maica Timezone Management
  • Integrations
    • Create a Site
    • Xero Integration
      • Support Item Configuration
    • Stripe Integration
    • NDIS Notifications
  • Settings
    • Renewal Management
    • Claim Management
      • NDIS
        • Handle BPR Results & Remittance Files
        • BPR File Import Flows
      • Aged Care
    • Invoice Management
    • Support Item Management
    • Integration Management
      • NDIS Integration
      • Stripe Integration
      • Xero Integration
    • Connections Management
      • General Settings
      • Reciprocal Settings
    • General Settings
    • Planner Management
    • Rostering Management
    • Service Management
    • Timesheet Management
    • Validation Management
    • Travel Management
    • Billing Management
    • Maps Management
    • Participant Notes
Powered by GitBook

Further Maica Resources

  • Homepage
  • Features
  • FAQs
On this page
  • Fields & Relationships
  • Validation Rules
  • Funding Type Required When Invoice is Saved
  • Restrict Invoice Amount Change
  • Automation
  • Flows
  • Cancel Invoice
  • Invoice Status Management
  • Trigger Handlers
  • Invoice Manage Claim Schedule
  • Invoice Next Schedule Date
  • Invoice Defaults
  • Invoice Rollup Expenditure
  • Invoice Claim

Was this helpful?

Export as PDF
  1. Data
  2. Data Objects

Invoice

An Invoice represents the financial component following an instance of Service Delivery.

PreviousFunding ItemNextInvoice Line Item

Last updated 8 months ago

Was this helpful?

Fields & Relationships

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.

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

Error Location

Top of Page

Error Condition Formula
AND(
    NOT(ISBLANK(maica__Stripe_Invoice_ID__c)),
    ISCHANGED(maica__Total_Amount__c)
)

Automation

Flows

The list below outlines the Flows applied to the Invoice Object in Maica.

Please refer to the list below for more detailed information on each Flow.

Cancel Invoice

This flow is designed to cancel an invoice by updating its status to "Cancelled."

Flow Detail

Flow Label

Maica - Cancel Invoice

API Name

maica__Maica_Cancel_Invoice

Type

Screen Flow

Flow Summary

This flow is designed to cancel an invoice by updating its status to "Cancelled".

  • Retrieves an invoice.

  • Checks the invoice status.

  • Allows the user to confirm cancellation.

  • Updates the invoice status to "Cancelled".

  • Notifies the user of successful cancellation.

Flow Description
  1. Start (Record-Triggered Flow):

    • Object: Invoice__c

    • Trigger: When the invoice record is updated or created.

    • Input Variable: recordId

  2. Get Invoice (Record Lookup):

    • Filters: Retrieves the invoice record where the Id matches recordId.

    • Connector: Proceeds to check the invoice status.

  3. Invoice Status (Decision):

    • Conditions: Checks if the invoice status is "Cancelled".

    • If "Cancelled": Displays the "Invoice Cancelled" screen.

    • If not "Cancelled": Proceeds to the "Cancel Invoice" screen.

  4. Cancel Invoice (Screen):

    • Displays a confirmation message asking the user to confirm the cancellation of the invoice.

    • Connector: Proceeds to set the invoice as cancelled upon confirmation.

  5. Set Invoice Cancelled (Assignment):

    • Sets the Cancelled__c field of the invoice to true.

    • Connector: Proceeds to update the invoice.

  6. Update Invoice (Record Update):

    • Updates the invoice record with the cancelled status.

    • Connector: Proceeds to display the "Invoice Cancelled" screen.

  7. Invoice Cancelled (Screen):

    • Displays a message confirming that the invoice has been cancelled.

Invoice Status Management

This flow evaluates and updates the status of an invoice based on its payment details and other related conditions.

Flow Detail

Flow Label

Maica - Invoice Status Management

API Name

maica__Invoice_Status_Management

Type

Autolaunched Flow

Flow Summary

This flow ensures that the invoice status is accurately updated based on the payment details and other conditions.

  • Starts on invoice creation or update.

  • Evaluates the status based on various conditions.

  • Assigns the appropriate status (Cancelled, Not Paid, Partially Paid, Fully Paid).

Flow Description
  1. Start (Record-Triggered Flow):

    • The flow begins when an invoice is created or updated.

    • It is triggered before the record is saved.

  2. Status Evaluation (Decision):

    • The flow checks the status of the invoice based on various conditions:

      • If the invoice is cancelled, it proceeds to set the status to "Cancelled".

      • If all line items are not paid, it proceeds to set the status to "Not Paid".

      • If the invoice is partially paid and managed by an agency, it checks further conditions and then sets the status to "Partially Paid".

      • If the invoice is fully paid and managed by an agency, it checks further conditions and then sets the status to "Fully Paid".

      • For non-agency managed invoices, it similarly checks and sets the status to "Partially Paid" or "Fully Paid" based on payment details.

  3. Set Cancelled (Assignment):

    • Sets the invoice status to "Cancelled".

  4. Set Not Paid Status (Assignment):

    • Sets the invoice status to "Not Paid".

  5. Set Partially Paid Status (Assignment):

    • Sets the invoice status to "Partially Paid".

  6. Set Fully Paid Status (Assignment):

    • Sets the invoice status to "Fully Paid".

Trigger Handlers

The table below outlines the Trigger Handlers applied to the Invoice Object in Maica and their Load Order.

Trigger Handler
Load Order

1

1

1

2

10

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

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

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

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

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

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

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

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

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

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

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

Click to view and download the complete Invoice Schema.

here
InvoiceManageClaimSchedule_MDTM
InvoiceNextScheduledDate_MDTM
InvoiceDefaults_MDTM
InvoiceRollupExpenditure_MDTM
InvoiceClaim_MDTM
Invoice Schema