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

invoicing (Invoicing in Noi)

Side note: Code snippets (lines starting with >>>) in this document get tested as part of our development workflow. The following initialization snippet tells you which demo project is being used in this document.

>>> import lino
>>> lino.startup('lino_book.projects.noi1r.settings')
>>> from lino.api.doctest 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.   Author       Target journal                Invoice generators                    Logging level   Disabled   When        Status
----- ------------ ----------------------------- ------------------------------------- --------------- ---------- ----------- -----------------------
 1     Robin Rood   Service reports (SRV)         working.Session                       INFO            No         Every day   Scheduled to run asap
 2     Robin Rood   Sales invoices (SLS)          storage.Filler, trading.InvoiceItem   INFO            No         Every day   Scheduled to run asap
 3     Robin Rood   Subscription invoices (SUB)   subscriptions.SubscriptionPeriod      INFO            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
===== ====================================================== ===================== ================