Bugzilla – Attachment 77585 Details for
Bug 11373
Add "change calculation" feature to the fine payment forms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11373: Follow-up after code review
Bug-11373-Follow-up-after-code-review.patch (text/plain), 7.18 KB, created by
Charles Farmer
on 2018-08-08 18:01:40 UTC
(
hide
)
Description:
Bug 11373: Follow-up after code review
Filename:
MIME Type:
Creator:
Charles Farmer
Created:
2018-08-08 18:01:40 UTC
Size:
7.18 KB
patch
obsolete
>From 1ac3d1d2a677f68a065e04da22ff20d3897726ab Mon Sep 17 00:00:00 2001 >From: Charles Farmer <charles.farmer@inLibro.com> >Date: Mon, 19 Feb 2018 15:58:05 -0500 >Subject: [PATCH] Bug 11373: Follow-up after code review > >--- > .../prog/en/modules/members/paycollect.tt | 43 +++++++++++----------- > members/paycollect.pl | 12 +++--- > 2 files changed, 28 insertions(+), 27 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >index ccc7772..3f7a453 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >@@ -1,5 +1,6 @@ > [% USE Asset %] > [% USE Koha %] >+[% USE Price %] > [% USE Branches %] > [% USE AuthorisedValues %] > [% USE Price %] >@@ -55,13 +56,13 @@ > <div class="tabs-container"> > [% IF (error_negative) %] > <div id="error_message" class="dialog alert"> >- <span>The amount paid can't be negative!</span> >+ The amount paid can't be negative. > </div> > [% END %] > > [% IF (error_collected_less) %] > <div id="error_message" class="dialog alert"> >- <span>The amount collected can't be lower than the amount paid!</span> >+ The amount collected can't be lower than the amount paid. > </div> > [% END %] > >@@ -102,15 +103,15 @@ > <th>Amount outstanding</th> > </tr></thead> > <tfoot> >- <td colspan="3">Total amount payable:</td><td>[% amountoutstanding | format('%.2f') %]</td> >+ <td colspan="3">Total amount payable:</td><td>[% amountoutstanding | $Price %]</td> > </tfoot> > <tbody><tr> > <td> > [% individual_description %] > </td> > <td>[% accounttype %]</td> >- <td class="debit">[% amount | format('%.2f') %]</td> >- <td class="debit">[% amountoutstanding | format('%.2f') %]</td> >+ <td class="debit">[% amount | $Price %]</td> >+ <td class="debit">[% amountoutstanding | $Price %]</td> > </tr></tbody> > </table> > >@@ -120,25 +121,25 @@ > <label for="paid">Amount paid:</label> > <input type="hidden" name="paid" id="paid" value="[% amount_paid %]" /> > <input type="hidden" name="collected" id="collected" value="[% amount_paid %]" /> >- [% amount_paid %] >+ [% amount_paid | $Price %] > </li> > <li> > <label>Collect from patron:</label> >- [% amount_collected %] >+ [% amount_collected | $Price %] > </li> > <li> > <label>Change to give back:</label> >- [% give_change %] >+ [% give_change | $Price %] > </li> > [% ELSE %] > <li> >- <label for="paid">Amount paid :</label> >- <input name="paid" id="paid" value="[% amountoutstanding | format('%.2f') %]" onchange="moneyFormat(document.payform.paid)"/> >- [% amount_paid %] >+ <label for="paid">Amount paid:</label> >+ <input name="paid" id="paid" value="[% amountoutstanding %]" onchange="moneyFormat(document.payform.paid)"/> >+ [% amount_paid | $Price %] > </li> > <li> > <label for="collected">Collect from patron:</label> >- <input name="collected" id="collected" value="[% amountoutstanding | format('%.2f') %]" onchange="moneyFormat(document.payform.collected)" /> >+ <input name="collected" id="collected" value="[% amountoutstanding %]" onchange="moneyFormat(document.payform.collected)" /> > </li> > [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] > [% IF payment_types %] >@@ -182,12 +183,12 @@ > <th>Amount</th> > <th>Amount outstanding</th> > </tr></thead> >- <tfoot><td colspan="3">Total amount outstanding:</td><td>[% amountoutstanding | format('%.2f') %]</td></tfoot> >+ <tfoot><td colspan="3">Total amount outstanding:</td><td>[% amountoutstanding | $Price %]</td></tfoot> > <tbody><tr> > <td>[% description %] [% title %]</td> > <td>[% accounttype %]</td> >- <td class="debit">[% amount | format('%.2f') %]</td> >- <td class="debit">[% amountoutstanding | format('%.2f') %]</td> >+ <td class="debit">[% amount | $Price %]</td> >+ <td class="debit">[% amountoutstanding | $Price %]</td> > </tr></tbody> > </table> > >@@ -227,27 +228,27 @@ > <ol> > <li> > <span class="label">Total amount outstanding: </span> >- <span class="debit">[% total | format('%.2f') %]</span> >+ <span class="debit">[% total | $Price %]</span> > </li> > [% IF ( give_change ) %] > <li> > <label for="paid">Amount paid:</label> > <input type="hidden" name="paid" id="paid" value="[% amount_paid %]" /> >- [% amount_paid %] >+ [% amount_paid | $Price %] > </li> > <li> > <label>Collected from patron:</label> > <input type="hidden" name="collected" id="collected" value="[% amount_paid %]" /> >- [% amount_collected %] >+ [% amount_collected | $Price %] > </li> > <li> > <label>Change to give back:</label> >- [% give_change %] >+ [% give_change | $Price %] > </li> > [% ELSE %] > <li> > <label for="paid">Amount paid :</label> >- <input name="paid" id="paid" value="[% total | format('%.2f') %]" onchange="moneyFormat(document.payform.paid)" /> >+ <input name="paid" id="paid" value="[% total %]" onchange="moneyFormat(document.payform.paid)" /> > </li> > <li> > [% IF type == 'writeoff' %] >@@ -256,7 +257,7 @@ > <label for="collected">Collect from patron: </label> > [% END %] > <!-- default to paying all --> >- <input name="collected" id="collected" value="[% total | format('%.2f') %]" onchange="moneyFormat(document.payform.collected)"/> >+ <input name="collected" id="collected" value="[% total %]" onchange="moneyFormat(document.payform.collected)"/> > </li> > [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] > [% IF payment_types %] >diff --git a/members/paycollect.pl b/members/paycollect.pl >index e4a5846..f809ba4 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -119,16 +119,16 @@ if ( $total_paid and $total_paid ne '0.00' ) { > } > elsif ($total_paid >= $total_due and $total_collected ne $total_paid) { > $template->param( >- amount_paid => sprintf('%.2f', $total_due), >- amount_collected => sprintf('%.2f', $total_collected), >- give_change => sprintf('%.2f',($total_collected-$total_due)) >+ amount_paid => $total_due, >+ amount_collected => $total_collected, >+ give_change => $total_collected-$total_due, > ); > } > elsif ($total_paid < $total_due and $total_collected ne $total_paid) { > $template->param( >- amount_paid => sprintf('%.2f', $total_paid), >- amount_collected => sprintf('%.2f', $total_collected), >- give_change => sprintf('%.2f',($total_collected-$total_paid)) >+ amount_paid => $total_paid, >+ amount_collected => $total_collected, >+ give_change => $total_collected-$total_paid, > ); > } else { > die "Wrong CSRF token" >-- >2.7.4
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 11373
:
23382
|
26103
|
26108
|
29757
|
29938
|
36875
|
36876
|
36877
|
60528
|
60529
|
61233
|
61234
|
67348
|
68296
|
70043
|
71975
|
71976
|
77584
|
77585
|
79122
|
79171
|
79188
|
79507
|
79509
|
79529
|
79530
|
79538
|
79549
|
79759
|
79944
|
79951
|
80414
|
80986
|
82420
|
82797
|
83804
|
83812
|
83813
|
84653
|
84654