# Invoice Scheduling

* The Provider Invoice Number is blank
* If you select Reflect Plan Dates, the invoices will be generated **going forward** based on the Plan Date Range
  * This essentially defines the period, or book ends, for which the batch should generate Invoices
  * The Maica batch creates Invoice records based on the Next\_Scheduled\_Date\_\_c on Invoice
    * This date is calculated by our logic in the relevant Maica trigger and gets populated with +1 month (for Monthly frequency) until it’s less than TODAY starting from the Schedule\_Start\_Date\_\_c
* Then Schedule\_Start\_Date\_\_c is the base for the calculation
  * In a loop we add 1 month to the Schedule\_Start\_Date\_\_c until it’s greater than or equals to TODAY then we set the Next\_Scheduled\_Date\_\_c with the value
  * Using the Plan Start Day (not Date) as the Anchor Date
* The screenshot below should help with all of this the Plan Start Date was **10/06/2021**
* See the mapping for reference:
  * Invoice.Schedule\_Start\_Date\_\_c = Invoice.Schedule\_Plan\_\_c.Start\_Date\_\_c
  * Invoice.Schedule\_End\_Date\_\_c  = Invoice.Schedule\_Plan\_\_c.End\_Date\_\_c
* Essentially, the invoice series will use the first invoice as a template and clone this based on the period, i.e. monthly
  * The Schedule Source Invoice is populated with this first Invoice record

CC: @Dmitry Lisovsky if I have missed anything!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kb.maica.com.au/ndis-management/invoice-management/invoice-scheduling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
