Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

invoicing in Noi

All code snippets on this page (lines starting with >>>) are being tested as part of our development workflow. The following snippet initializes a demo project to use throughout this page.

>>> from lino_book.projects.noi1r.startup import *

Overview

A subscription generates one invoice per year or month. Each invoice for a same customer has the same amount. Working sessions generate service reports, which are just internal delivery notes, not invoices. Fillers monitor the time credit of customers and generate an invoice to buy new credit when needed. And the first invoice generator, lino_xl.lib.trading.InvoiceItem, is not used.

>>> rt.show(accounting.JournalsOverview)
**39 Sales invoices (SLS)**
**8 Subscription invoices (SUB)**
**55 Service reports (SRV)**
**5 Service Level Agreements (SLA)**
>>> rt.show('invoicing.Tasks')
...
===== ================================== ========== =========== =======================
 No.   Name                               Disabled   When        Status
----- ---------------------------------- ---------- ----------- -----------------------
 1     Make Service reports (SRV)         No         Every day   Scheduled to run asap
 2     Make Sales invoices (SLS)          No         Every day   Scheduled to run asap
 3     Make Subscription invoices (SUB)   No         Every day   Scheduled to run asap
===== ================================== ========== =========== =======================

These are the invoice generators in Noi:

>>> pprint(rt.models_by_base(invoicing.InvoiceGenerator))
[<class 'lino_xl.lib.storage.models.Filler'>,
 <class 'lino_xl.lib.subscriptions.models.SubscriptionPeriod'>,
 <class 'lino_xl.lib.trading.models.InvoiceItem'>,
 <class 'lino_xl.lib.working.models.Session'>]

Note that the reporting area should run one day before the default area.

  • Subscription invoices get created based on the subscription periods (which in turn get created as summary data of the actual subscriptions one per year or month).

  • Sales invoices get created based on service reports and storage fillers.

  • Service reports get created based on working sessions.

>>> rt.show('invoicing.FollowUpRules')
===== ====================================================== ===================== ================
 No.   Invoicing task                                         Invoice generator     Source journal
----- ------------------------------------------------------ --------------------- ----------------
 1     Invoicing task #1 (Make Service reports (SRV))         Working session
 2     Invoicing task #3 (Make Subscription invoices (SUB))   Subscription period
 3     Invoicing task #2 (Make Sales invoices (SLS))          Storage filler
 4     Invoicing task #2 (Make Sales invoices (SLS))          Sales invoice item
===== ====================================================== ===================== ================