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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt (-2 / +15 lines)
Lines 253-266 Link Here
253
        var zero_formatted = "[% 0 | $Price %]";
253
        var zero_formatted = "[% 0 | $Price %]";
254
        change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100;
254
        change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100;
255
        if (change.innerHTML <= 0) {
255
        if (change.innerHTML <= 0) {
256
            var paid = $('#paid')[0];
257
            moneyFormat(paid);
258
            $('#collected').rules( "add", { min: Number(paid.value) });
259
            $("#payForm").valid()
256
            change.innerHTML = zero_formatted;
260
            change.innerHTML = zero_formatted;
261
            $(':input[name="change"]').val(zero_formatted);
257
        } else {
262
        } else {
258
            change.value = change.innerHTML;
263
            change.value = change.innerHTML;
259
            moneyFormat(change);
264
            moneyFormat(change);
260
            change.innerHTML = change.value;
265
            change.innerHTML = change.value;
266
            $(':input[name="change"]').val(change.value);
261
        }
267
        }
262
268
263
        $(':input[name="change"]').val(change.value);
264
        $('#modal_change').html(change.innerHTML);
269
        $('#modal_change').html(change.innerHTML);
265
    }
270
    }
266
271
Lines 363-368 Link Here
363
            $('#payForm').submit();
368
            $('#payForm').submit();
364
        });
369
        });
365
370
371
        $( "#payForm" ).validate({
372
            rules: {
373
                paid: { required: true },
374
                collected: {
375
                    required: true
376
                }
377
            }
378
        });
379
366
        $('#payForm').submit(function(e){
380
        $('#payForm').submit(function(e){
367
            if (change != undefined && change.innerHTML > 0.00 && !checked) {
381
            if (change != undefined && change.innerHTML > 0.00 && !checked) {
368
                e.preventDefault();
382
                e.preventDefault();
369
- 

Return to bug 24519