Thursday, October 12, 2017

I had a session for #2072 (a redesign of Lino Care without tickets, as a result after the first experimental year).

This is currently rather intuitive work because the project requirements are not very clear. Basic idea is to remove the tickets and to reduce the database to a catalog of helpers to be consulted by dedicated social workers.

  • delete care_de demo project because it was useless

  • rename lino_book.projects.care to lino_book.projects.anna

  • Misc changes in lino_xl.lib.faculties.

  • A lino_xl.lib.notes.Note is now lino_xl.lib.faculties.Feasible. Actually we don’t know whether they will one day and ask for having some kind of feasible

Lino’s first SEPA payment initiation

Today we had a historic event: Lydia and I submitted the real first payment order generated by a Lino application.

In a first attempt we got this error message from the bank:

Code[BOOD-KD,D90092]  ;0;1;Datatype error: Type:InvalidDatatypeValueExce

Not very helpful…

But when I ran lino.utils.xmlgen.sepa.validate over the file, I got:

$ python -m lino.utils.xmlgen.sepa.validate finan.PaymentOrder-616.xml
...
lxml.etree.DocumentInvalid: Element '{urn:iso:std:iso:20022:tech:xsd:pain.001.001.02}Id': [facet 'minLength'] The value has a length of '0'; this underruns the allowed minimum length of '1'., line 12

Aha, yes we simply didn’t have their VAT id filled in. After settings the vat_id of their lino.modlib.system.SiteConfig.site_company.

I did some optimizations to make it more fool-proof:

I extended the printing API by adding a method get_printable_context to BasePrintAction.

I used that new feature for lino_xl.lib.finan.WritePaymentsInitiation to add fill some template variables already there, together with some validation warnings; You must specify a site owner, Site owner has no national ID and Site owner has invalid ID {}.

The idea is that validation logic should come before parsing the pain_001.xml file if that leads to more useful error messages.

Somewhere I read that for <InitgPty> and <Dbtr> the <Nm> is enough, i.e. the <Id> and its children aren’t needed.

And then we now run lino_xl.lib.finan.validate.validate_pain001() for every generated file before returning it to the user. To be observed: I remember that some years ago we had problems when using lxml under multi-threaded mod_wsgi.

It’s clear that the gory details of payment orders will need testing and and updates with every new supported bank. But our first guinea pig was encourageingly easy to get done.