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

How Lino Tera generates invoices

In Lino Tera every meeting with a therapist is basically invoiceable. Unlike in e.g. in Lino Voga they are invoiced afterwards, not in advance.

General functionality for automatically generating invoices is defined in lino_xl.lib.invoicing.

Lines starting with >>> in this document are code snippets that get tested as part of our development workflow.

>>> from lino import startup
>>> startup('lino_book.projects.lydia.settings.doctests')
>>> from lino.api.doctest import *

Overview

For individual and family therapies the meetings themselves (Event) are invoiceable while for group therapies every individual presence (Guest) of a meeting is invoiceable.

The invoice generator is either the therapy (for individual and family therapies) or the enrolment (for group therapies).

>>> rt.models_by_base(rt.models.invoicing.InvoiceGenerator)
[<class 'lino_tera.lib.courses.models.Course'>, <class 'lino_tera.lib.courses.models.Enrolment'>, <class 'lino_xl.lib.trading.models.InvoiceItem'>]

Lino Tera uses this functionality by extending the models Course and Enrolment so that they inherit from InvoiceGenerator.

>>> dd.plugins.accounting.start_year
2015

Therapies