]> git.koha-community.org Git - koha.git/commit
Bug 28168: leave the field empty if amount variable is empty
authorPetro Vashchuk <stalkernoid@gmail.com>
Wed, 21 Apr 2021 11:45:14 +0000 (14:45 +0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 23 Apr 2021 08:03:34 +0000 (10:03 +0200)
commit34575f1f1a063380c1e3f05dd300302bc42ac460
tree92f2cd70a1ea096efaf655128d941f1afdf5318c
parent01f0e04172432e28f37a94bf6df51a3fd6cdc960
Bug 28168: leave the field empty if amount variable is empty

Add "if" check to the template so that it uses the value of
"debit_type.default_amount" only if it's true, i.e. not null or 0.

The reason for this patch is there's requirement from librarians -
to have this field completely empty if it's 0, so they could paste the
amount (as they usually do) without the need to clear the field first.
And anyway if you try to save the form with 0.00 value,
it won't accept it saying "Debit amount passed is not positive" so
in my opinion there's no point to preset it with zeroes to begin with.

To reproduce:
    1) head to /cgi-bin/koha/members/maninvoice.pl?borrowernumber=XXXX
    and check that field "Amount" is prefilled with 0.00;
    2) apply patch;
    3) refresh page and ensure that field "Amount" is empty now;
    4) go to /cgi-bin/koha/admin/debit_types.pl and change default
    amount to some decimal amount;
    5) refresh manual invoice page again and ensure that "Amount"
    field is prefilled with that exact decimal number;

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt