Thursday, October 3, 2019

PyPI release for Lino Avanti and upgraded their preview site.

‘PaymentOrder’ object has no attribute ‘your_ref’

I worked on #3236 (‘PaymentOrder’ object has no attribute ‘your_ref’)

Reproducible in lino_book.projects.cosi_ee. Select organization “Garage Mergelsberg”, go to the Accounting tab and click on “19 open movements (758.68 €)”.

I added a method Voucher.get_movement_description() which is extended by lino_xl.lib.sepa.Payable to also show the lino_xl.lib.sepa.Payable.your_ref field (unless it is empty).

I saw a problem in the demo data which led to the discovery of a bug:

Payment Orders were also suggesting negative payments (e.g. open sales invoices). The filter condition was not enough. I added a new filter parameter ExpectedMovements.same_dc and have it used by lino_xl.lib.finan.SuggestionsByPaymentOrder. I had to change the signature of the get_due_movements() function because the new condition caused a TypeError: get_due_movements() got multiple values for argument 'dc'. I opened a ticket for this: #3251.

Also at least one more thing to show in a demo: the quick search field in booking suggestions (e.g. SuggestionsByPaymentOrder) now works. This was #3215.

Payment orders weren’t cleared by bank statement in the demo_bookings fixture. Code change: Whether a payment order generates individual counter entries (one per partner) no longer depends on Account.needs_partner but on whether the journal has a partner or not (whether Journal.partner is empty or not).

TODO: remove Account.needs_partner and replace all usages to use Account.clearable instead. The two fields are now synonyms. Their difference has indeed always been mysterious…

More issues and observations to meditate:

  • Consider a creditor for which a payment order has been registered, but that payment order is still pending (not yet cleared by a bank statement). Lino currently shows these creditors as debtors. Lino should know that being negative in certain accounts shouldn’t count for the Debtors and Creditors report.

  • Some organizations are strictly speaking “creditors”, but we are not used to show them in the list of creditors: e.g. banks and tax offices.

  • #3236 is fixed, but the Movements.description field and Voucher.get_movement_description() is probably not finished, maybe they don’t always show enough information, or too much.

PS: I committed above changes only the next day because the test suites required revision.