Invoices¶
What are invoices?¶
The rated document that is produced at the contract scope is an invoice. The amount, or total, for an invoice is calculated by adding up each line item. Invoice based pricing can only be accomplished within this scope. For example, calculating something like tax must have the full context of every line item to be accurate.
Why are invoices important?¶
Most use cases for an invoice lie within business administration. The invoice total ultimately is what’s used in a financial transaction. In some countries the invoice is even considered a legal document. Specifically within billing, an invoice is a key component within collecting funds which is often the end goal for a business.
From a reporting perspective invoices have less benefits. By definition the other documents add up to the parent invoice, which leaves utility at this scope. So in many cases invoices can be substituted for rated events or line items.
How are invoices modeled?¶
Invoices are a grouping of line items from a contract over a specific time range. The invoice_delivery
is also a grouping factor given each type is treated differently within accrual and cash accounting. This means that if there are two products on a contract with different invoice delivery types two invoices will be generated.
Within the Wikipedia example, the first month a customer is created their platform fee and the usage products will be owed in the same period. This can be seen the customer “Papergirl” where two invoices are created with the started_at
date.
products.id |
products.name |
line_items.quantity |
line_items.amount |
line_items.status |
line_items.contract_id |
line_items.invoice_delivery |
line_items.started_at |
line_items.ended_at |
---|---|---|---|---|---|---|---|---|
1 |
Updates |
2.0 |
0.2 |
FINALIZED |
Papergirl_contract |
ARREARS |
2023-11-06 07:23:49 |
2023-12-01 00:00:00 |
2 |
Creates |
400.0 |
20.0 |
FINALIZED |
Papergirl_contract |
ARREARS |
2023-11-06 07:23:49 |
2023-12-01 00:00:00 |
3 |
Platform fee |
1.0 |
1000.0 |
FINALIZED |
Papergirl_contract |
ADVANCED |
2023-11-06 07:23:49 |
2024-11-01 00:00:00 |
invoices.total |
invoices.status |
invoices.contract_id |
invoices.invoice_delivery |
invoices.started_at |
invoices.ended_at |
---|---|---|---|---|---|
1000.0 |
FINALIZED |
Papergirl_contract |
ADVANCED |
2023-11-06 07:23:49 |
2024-11-01 00:00:00 |
20.2 |
FINALIZED |
Papergirl_contract |
ARREARS |
2023-11-06 07:23:49 |
2023-12-01 00:00:00 |