@@ -, +, @@ present and uniqueness enforced --- koha-tmpl/intranet-tmpl/prog/en/js/additem.js | 44 +++++++++++++++++++--- .../prog/en/modules/acqui/neworderempty.tt | 10 ++++- 2 files changed, 47 insertions(+), 7 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/js/additem.js +++ a/koha-tmpl/intranet-tmpl/prog/en/js/additem.js @@ -35,9 +35,23 @@ function addMulti( count, node, unique_item_fields){ var current_qty = parseInt( $('#quantity').val(), 10 ); $("#procModal").modal('show'); $("#" + index).hide(); + var cur_barc = $("#"+index + " #subfieldp input[name='field_value']").val() + if ( cur_barc != '' && unique_item_fields.indexOf('barcode')>-1 ){ + tmp_uif = unique_item_fields.replace("barcode",''); + unique_item_fields=tmp_uif; + } + else { cur_barc=''} + for(var i=0;i-1 ){ + if ( incrementBarcode(barcode) != undefined ) { + addMulti( count, node, unique_item_fields); + } + else { $("#incrementBarcodeModal").modal('show');} + } + else { addMulti( count, node, unique_item_fields); } } } @@ -72,7 +106,7 @@ function showItem(index) { $(this).show(); } else { if ( $("#items_list table").find('tr[idblock="' + $(this).attr('id') + '"]').length == 0 ) { - $(this).remove(); + $(this).remove(); } else { $(this).hide(); } @@ -180,7 +214,7 @@ function cloneItemBlock(index, unique_item_fields, callback) { buttonPlus += ''; buttonPlus += ''; buttonPlus += ''; - buttonPlus +=''; + buttonPlus +=''; buttonPlus += ""; $(clone).append(buttonPlus); /* Copy values from the original block (input) */ --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -651,7 +651,8 @@ $(document).ready(function() [% IF UniqueItemFields %]