View | Details | Raw Unified | Return to bug 11373
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (+6 lines)
Lines 213-218 Patrons: Link Here
213
               yes: Allow only superlibrarians
213
               yes: Allow only superlibrarians
214
               no: Allow all permitted users
214
               no: Allow all permitted users
215
         - "to access/change superlibrarian privileges. Note: A permitted user needs to have the 'permissions' flag (if no superlibrarian)."
215
         - "to access/change superlibrarian privileges. Note: A permitted user needs to have the 'permissions' flag (if no superlibrarian)."
216
     -
217
         - pref: FineChange
218
           choices:
219
               yes: Enable
220
               no: Disable
221
         - fine change display when a user pays a fine.
216
    Privacy:
222
    Privacy:
217
     -
223
     -
218
         - Use the following URL
224
         - Use the following URL
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt (-2 / +88 lines)
Lines 98-108 Link Here
98
98
99
<ol>
99
<ol>
100
100
101
    [% IF Koha.Preference('FineChange') %]
102
    <li>
103
        <label for="paid">Amount paid: </label>
104
        <input name="paid" id="paid" value="[% amountoutstanding | $Price %]"/>
105
    </li>
106
    <li>
107
        <label for="collected">Collect from patron: </label>
108
        <input id="collected" value="[% amountoutstanding | $Price %]"/>
109
    </li>
110
    <li>
111
        <label>Change to give: </label>
112
        <input id="change" value="0.00" disabled/>
113
    </li>
114
    [% ELSE %]
101
    <li>
115
    <li>
102
        <label for="paid">Collect from patron: </label>
116
        <label for="paid">Collect from patron: </label>
103
            <!-- default to paying all -->
117
            <!-- default to paying all -->
104
        <input name="paid" id="paid" value="[% amountoutstanding | html %]" />
118
        <input name="paid" id="paid" value="[% amountoutstanding | html %]" />
105
    </li>
119
    </li>
120
    [% END %]
106
    [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %]
121
    [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %]
107
    [% IF payment_types %]
122
    [% IF payment_types %]
108
        <li>
123
        <li>
Lines 191-196 Link Here
191
            <span class="label">Total amount outstanding: </span>
206
            <span class="label">Total amount outstanding: </span>
192
            <span class="debit">[% total | format('%.2f') %]</span>
207
            <span class="debit">[% total | format('%.2f') %]</span>
193
        </li>
208
        </li>
209
    [% IF Koha.Preference('FineChange') %]
210
    <li>
211
        <label for="paid">Amount paid :</label>
212
        <input name="paid" id="paid" value="[% total | $Price %]"/>
213
    </li>
214
    <li>
215
        [% IF type == 'writeoff' %]
216
            <label for="collected">Writeoff amount: </label>
217
        [% ELSE %]
218
            <label for="collected">Collect from patron: </label>
219
        [% END %]
220
        <input id="collected" value="[% total | $Price %]"/>
221
    </li>
222
    <li>
223
        <label>Change to give: </label>
224
        <input id="change" value="0.00" disabled/>
225
    </li>
226
    [% ELSE %]
194
    <li>
227
    <li>
195
        [% IF type == 'writeoff' %]
228
        [% IF type == 'writeoff' %]
196
            <label for="paid">Writeoff amount: </label>
229
            <label for="paid">Writeoff amount: </label>
Lines 200-205 Link Here
200
        <!-- default to paying all -->
233
        <!-- default to paying all -->
201
        <input name="paid" id="paid" value="[% total | format('%.2f') %]" />
234
        <input name="paid" id="paid" value="[% total | format('%.2f') %]" />
202
    </li>
235
    </li>
236
    [% END %]
203
    [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %]
237
    [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %]
204
    [% IF payment_types %]
238
    [% IF payment_types %]
205
        <li>
239
        <li>
Lines 233-246 Link Here
233
</div>
267
</div>
234
</div>
268
</div>
235
269
270
<!-- Modal -->
271
<a class="hidden" href="#confirm_change_form" data-toggle="modal"></a>
272
<div id="confirm_change_form" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
273
    <div class="modal-dialog">
274
        <div class="modal-content">
275
            <div class="modal-header">
276
		<h3>Amount collected higher than paid</h3>
277
	    </div>
278
	    <div class="modal-body">
279
		<p>The amount collected from the patron is higher than the amount paid.</p>
280
                <p>The change to give is <b><span id="modal_change">0.00</span></b>.</p>
281
                <p>Do you still confirm the payment?</p>
282
	    </div>
283
	    <div class="modal-footer">
284
	        <button class="btn btn-default approve" id="modal_submit" type="button"><i class="fa fa-check"></i> Yes</button>
285
		<button class="btn btn-default deny cancel" href="#" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> No</button>
286
	    </div>
287
        </div>
288
    </div>
289
</div>
290
236
[% MACRO jsinclude BLOCK %]
291
[% MACRO jsinclude BLOCK %]
237
    [% INCLUDE 'str/members-menu.inc' %]
292
    [% INCLUDE 'str/members-menu.inc' %]
238
    [% Asset.js("js/members-menu.js") | $raw %]
293
    [% Asset.js("js/members-menu.js") | $raw %]
239
    <script type= "text/javascript">
294
    <script type= "text/javascript">
240
        $(document).ready(function() {
295
        $(document).ready(function() {
296
            var forms = $('#payindivfine, #payfine');
297
            var change = $('#change')[0];
298
241
            $('#payindivfine, #payfine').preventDoubleFormSubmit();
299
            $('#payindivfine, #payfine').preventDoubleFormSubmit();
242
            $("#paid").on("change",function(){
300
            $("#paid, #collected").on("change",function() {
243
                moneyFormat( this );
301
                moneyFormat( this );
302
                if (change != undefined) {
303
                    updateChangeValues();
304
                }
305
            });
306
307
            if (change != undefined) {
308
                forms.bind('submit', function(e) {
309
                    if (change.value > change.defaultValue) {
310
                        e.preventDefault();
311
                        $('a[href="#confirm_change_form"]').click();
312
                    }
313
                });
314
            }
315
316
            $('#modal_submit').click(function() {
317
                forms[0].submit();
244
            });
318
            });
245
        });
319
        });
246
320
Lines 310-315 Link Here
310
384
311
            textObj.value = dolAmount + "." + decAmount;
385
            textObj.value = dolAmount + "." + decAmount;
312
        }
386
        }
387
388
        function updateChangeValues() {
389
            var change = $('#change')[0];
390
            change.value = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100;
391
392
            if (change.value < 0) {
393
                change.value = change.defaultValue;
394
            } else {
395
                moneyFormat(change);
396
            }
397
398
            $('#modal_change').html(change.value);
399
        }
313
    </script>
400
    </script>
314
[% END %]
401
[% END %]
315
402
316
- 

Return to bug 11373