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 1327-1332 Link Here
1327
            });
1327
            });
1328
1328
1329
            $('.modal-save').click(function() {
1329
            $('.modal-save').click(function() {
1330
1331
                //We need to validate the item forms here - if one is opened with missing subfields at
1332
                //confirm, it would be submitted without this
1333
                var _alertString= _("Form not submitted because of the following problem(s)")+"\n";
1334
                _alertString +="-------------------------------------------------------------------\n\n";
1335
                var empty_mandatory_fields = 0;
1336
                $('div[id^="itemblock"]').each(function(){
1337
                    var item_form = $(this);
1338
                    var empty_item_mandatory = CheckMandatorySubfields(item_form);
1339
                    empty_mandatory_fields += empty_item_mandatory;
1340
                });
1341
                if (empty_mandatory_fields > 0) {
1342
                    _alertString +="\n- " + _("%s item mandatory fields empty").format(empty_mandatory_fields);
1343
                    alert(_alertString);
1344
                    return false;
1345
                }
1346
1330
                var saved_rows = save_row();
1347
                var saved_rows = save_row();
1331
                if(Object.keys(saved_rows).length) $('.save').prop('disabled', false);
1348
                if(Object.keys(saved_rows).length) $('.save').prop('disabled', false);
1332
                $("#order_edit").modal('hide');
1349
                $("#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