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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (+17 lines)
Lines 1328-1333 Link Here
1328
            });
1328
            });
1329
1329
1330
            $('.modal-save').click(function() {
1330
            $('.modal-save').click(function() {
1331
1332
                //We need to validate the item forms here - if one is opened with missing subfields at
1333
                //confirm, it would be submitted without this
1334
                var _alertString= _("Form not submitted because of the following problem(s)")+"\n";
1335
                _alertString +="-------------------------------------------------------------------\n\n";
1336
                var empty_mandatory_fields = 0;
1337
                $('div[id^="itemblock"]').each(function(){
1338
                    var item_form = $(this);
1339
                    var empty_item_mandatory = CheckMandatorySubfields(item_form);
1340
                    empty_mandatory_fields += empty_item_mandatory;
1341
                });
1342
                if (empty_mandatory_fields > 0) {
1343
                    _alertString +="\n- " + _("%s item mandatory fields empty").format(empty_mandatory_fields);
1344
                    alert(_alertString);
1345
                    return false;
1346
                }
1347
1331
                var saved_rows = save_row();
1348
                var saved_rows = save_row();
1332
                if(Object.keys(saved_rows).length) $('.save').prop('disabled', false);
1349
                if(Object.keys(saved_rows).length) $('.save').prop('disabled', false);
1333
                $("#order_edit").modal('hide');
1350
                $("#order_edit").modal('hide');
(-)a/koha-tmpl/intranet-tmpl/prog/js/additem.js (-2 / +15 lines)
Lines 1-7 Link Here
1
/* global __ */
1
/* global __ */
2
/* exported addItem checkCount showItem deleteItemBlock clearItemBlock check_additem */
2
/* exported addItem checkCount showItem deleteItemBlock clearItemBlock check_additem */
3
function addItem( node, unique_item_fields ) {
3
function addItem( node, unique_item_fields ) {
4
    var index = $(node).closest("div").attr('id');
4
    var item_form = $(node).closest("div");
5
    var index = item_form.attr("id");
6
7
    //We need to verify the item form before saving
8
    var empty_item_mandatory = CheckMandatorySubfields(item_form);
9
    if (empty_item_mandatory > 0) {
10
        var _alertString= _("Form not submitted because of the following problem(s)")+"\n";
11
12
        _alertString +="-------------------------------------------------------------------\n\n";
13
        _alertString +=
14
            "\n- " + _("%s item mandatory fields empty").format(empty_item_mandatory);
15
        alert(_alertString);
16
        return false;
17
    }
18
5
    var current_qty = parseInt($("#quantity").val());
19
    var current_qty = parseInt($("#quantity").val());
6
    var max_qty;
20
    var max_qty;
7
    if($("#quantity_to_receive").length != 0){
21
    if($("#quantity_to_receive").length != 0){
8
- 

Return to bug 34109