20160215 (Monday, 15 February 2016)¶
I did some changes to https://github.com/lsaffre/dblog after feedback from James who is starting to get his developer blog up and running (and published).
I continued to work on #701. A room, in Lino Voga, no longer
overrides __unicode__
to add the city name. This was just a stupid
idea of mine and irritating magic.
Repaired several tests which were failing with UnicodeErrors caused by
Hamza’s recent changes
in atelier
. Most notably the test_simple_doctests
method now must use
atelier.doctest_utf8
again.
After committing everything, the Lino test suite still broke on
Travis. Yes
of course, I must release atelier to PyPI so that the new
test_simple_doctests
method gets used.
But before doing this, I did yet another subtle change in
atelier
about docs_rsync_dest
. Because I guess that James will
soon stumble over this “design flaw”: until now it was not possible to
specify a template as the on in the example on
https://github.com/lsaffre/dblog
#777. Cannot reproduce it on my machine. I guess it is
related to the fact that on their site we use
WKHTMLTOPDF_CMD
to run it within xvfb-run. Maybe I must
set the html encoding in my generated temporay html file
(presence_sheet.html
).
Coverage¶
I had a voice session with Sandeep to introduce him to #463.
Current output (in atelier
) is:
$ inv invlib.cov
Running tests for 'atelier' within coverage...
.......
----------------------------------------------------------------------
Ran 7 tests in 1.346s
OK
Name Stmts Miss Cover
------------------------------------------------------------------------------------
atelier/invlib.py 336 332 1%
atelier/projects.py 118 116 2%
/virtualenvs/py27/lib/python2.7/site-packages/invoke/config.py 223 217 3%
------------------------------------------------------------------------------------
TOTAL
But these numbers are wrong, the percentage is not that low. It is
because coverage does not “see” the tests which are being run in a
subprocess. I seem to set the COVERAGE_PROCESS_START
variable, but for some reason this has no effect.
How Lino Voga generates invoices¶
The general functionality for automatically generating invoices is in
lino_cosi.lib.auto.sales
which extends
lino_xl.lib.trading
.
On the user-visible level it adds a CreateInvoice
action per partner, a
table InvoicesToCreate
to the main menu,
and a field invoiceable
per invoice item.
On the API level it defines the Invoiceable
mixin.
It also defines two utility functions get_invoiceables_for
and
create_invoice_for
.
Lino Voga uses this functionality by extending Enrolment
so that it inherits from
Invoiceable
. In
Lino Voga, enrolments are the things for which they write invoices.
An important new challenge appeared when I was in Belgium: they recently started to have a new invoicing method which they name “Abo-Kurse” (“Subscription courses”). #766 is to implement a first proof of concept. A subscription course does not end and start at a given date, the course itself is continously being given. Participants can start on any time of the year. They usually pay for 12 sessions in advance (the first invoice for that enrolment), and Lino must write a new invoice every 12 weeks.