Bug 26734: Convert printfeercpt/printinvoice to use GetPreparedLetter
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 14 Oct 2020 10:58:26 +0000 (11:58 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 27 Apr 2021 14:23:49 +0000 (16:23 +0200)
commitcff7ed4fd3358b079283b57a8946a05b87542a4d
treefe87b8a6a416c9bb22f9acf9f7890cd7a2a9ad42
parent90d8667cf9bd8fa7ca2032080162f16967405f8a
Bug 26734: Convert printfeercpt/printinvoice to use GetPreparedLetter

This patch updates C4::Letters to allow use of existing koha template
includes from notices, then updates the printfeercpt and printinvoice
slip print option to use GetPreparedLetter rather than calling getletter
directly.

As part of this work, we also add credits and debits handling to the
_parseletter_sth and _get_tt_params routines in C4::Letters to allow for
recognisable variable names in the notice template.

Test plan
1/ Update the ACCOUNT_CREDIT and ACCOUNT_DEBIT notices to use
'accounts.inc' include for account descriptions
1a/ Add `[% PROCESS 'accounts.inc' %]` to the top of the notice
1b/ Replace manual account descriptions with `[% PROCESS
account_type_description account=credit %]`
2/ Print one of each slip and check that descriptions are properly
substituted
3/ Clone the notice to another language
4/ Print the in the other language and note the translated descriptions
are properly substituted.
5/ Signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Letters.pm
C4/Templates.pm
koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt
members/printfeercpt.pl
members/printinvoice.pl