Bugzilla – Attachment 120007 Details for
Bug 28168
Manual invoice form pre-fills Amount field with invalid number
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28168: leave the field empty if amount variable is empty
Bug-28168-leave-the-field-empty-if-amount-variable.patch (text/plain), 2.19 KB, created by
Martin Renvoize (ashimema)
on 2021-04-22 14:51:15 UTC
(
hide
)
Description:
Bug 28168: leave the field empty if amount variable is empty
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-04-22 14:51:15 UTC
Size:
2.19 KB
patch
obsolete
>From 514f6a274ef72f82dd02498135cdb6ff09050780 Mon Sep 17 00:00:00 2001 >From: Petro Vashchuk <stalkernoid@gmail.com> >Date: Wed, 21 Apr 2021 14:45:14 +0300 >Subject: [PATCH] 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> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >index 5e9e7a18bb..7849d763b8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >@@ -108,7 +108,7 @@ > <script> > var type_fees = {}; > [% FOREACH debit_type IN debit_types %] >- type_fees['[% debit_type.code | html %]'] = "[% debit_type.default_amount | $Price %]"; >+ type_fees['[% debit_type.code | html %]'] = "[% IF debit_type.default_amount %][% debit_type.default_amount | $Price %][% END %]"; > [% END %] > $(document).ready(function(){ > $('#maninvoice').preventDoubleFormSubmit(); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28168
:
119943
|
119945
| 120007