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 245-258 Link Here
245
        var change = $('#change')[0];
245
        var change = $('#change')[0];
246
        change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100;
246
        change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100;
247
        if (change.innerHTML <= 0) {
247
        if (change.innerHTML <= 0) {
248
            var paid = $('#paid')[0];
249
            moneyFormat(paid);
250
            $('#collected').rules( "add", { min: Number(paid.value) });
251
            $("#payForm").valid()
248
            change.innerHTML = "0.00";
252
            change.innerHTML = "0.00";
253
            $(':input[name="change"]').val('0.00');
249
        } else {
254
        } else {
250
            change.value = change.innerHTML;
255
            change.value = change.innerHTML;
251
            moneyFormat(change);
256
            moneyFormat(change);
252
            change.innerHTML = change.value;
257
            change.innerHTML = change.value;
258
            $(':input[name="change"]').val(change.value);
253
        }
259
        }
254
260
255
        $(':input[name="change"]').val(change.value);
256
        $('#modal_change').html(change.innerHTML);
261
        $('#modal_change').html(change.innerHTML);
257
    }
262
    }
258
263
Lines 358-363 Link Here
358
            $('#payForm').submit();
363
            $('#payForm').submit();
359
        });
364
        });
360
365
366
        $( "#payForm" ).validate({
367
            rules: {
368
                paid: { required: true },
369
                collected: {
370
                    required: true
371
                }
372
            }
373
        });
374
361
        $('#payForm').submit(function(e){
375
        $('#payForm').submit(function(e){
362
            if (change != undefined && change.innerHTML > 0.00 && !checked) {
376
            if (change != undefined && change.innerHTML > 0.00 && !checked) {
363
                e.preventDefault();
377
                e.preventDefault();
364
- 

Return to bug 24519