Product Switched To Alternate<\/div>")}function showInvalidSKUAlertMessage(){var n=$("#alertWindow");n.kendoWindow({width:"600px",modal:!0,title:"Website Message",visible:!1,actions:["Pin","Minimize","Maximize","Close"],position:{top:300}}).data("kendoWindow").refresh().open().content("
Error<\/div>")}function onInvSkuDeactivate(){location.reload()}$(document).ready(function(){function h(){clearTimeout(n);$("#scanInput").val().length>=u&&(r=!0,f())}function c(){t=null;i=null;o=null;s=null;f()}function l(){return(i-t)/$("#scanInput").val().length<15}function a(){return!l()&&r}function v(){(clearTimeout(n),!a()||$("#scanInput").val().length<3)||reportValues()}function f(){$("body").off("blur","#scanInput",h);$.ajax({cache:!1,type:"POST",url:"/en/BulkOrdering/AddFromScanner",data:{sku:$("#scanInput").val(),headerId:24},success:function(){$("#scanInput").val("");$("#scanInput").focus().select();gridRefresh()}})}var e,t,i,o,s,n,r,u;$("#excelExportForm").submit(function(){return displayAjaxLoading(!0),!0});$("#bulk-order-form").submit(function(){return displayAjaxLoading(!0),!0});e=$("#alertWindow");e.kendoWindow({width:"600px",title:"Website Message",visible:!1,actions:["Pin","Minimize","Maximize","Close"]}).data("kendoWindow").refresh();u=3;$("#scanInput").bind("paste",function(){var n=this;setTimeout(function(){$.ajax({cache:!1,type:"POST",url:"/en/BulkOrdering/AddFromScanner",data:{sku:$(n).val(),headerId:24},success:function(n){n.success==!1&&displayBarNotification(n.message,"error");$("#scanInput").val("");$("#scanInput").focus().select();gridRefresh()},error:function(n){alert(JSON.stringify(n))}})},0)});$("#scanInput").keypress(function(e){if(n&&clearTimeout(n),e.which==13)e.preventDefault(),$("#scanInput").val().length>=u&&(r=!0,f());else{if(i=performance.now(),s=e.which,r=!1,!t){o=e.which;t=i;$("body").on("blur","#scanInput",h)}n=setTimeout(v,500)}});$("#reset").click(function(n){n.preventDefault();c()});$("#product-grid").kendoGrid({dataSource:{type:"json",transport:{read:{url:"/en/BulkOrdering/BulkOrderingType2List?headerId=24",type:"POST",dataType:"json",data:additionalData},destroy:{url:"/en/BulkOrdering/BulkOrderingType2Delete",type:"POST",dataType:"json",data:additionalData},update:{url:"/en/BulkOrdering/BulkOrderingType2Update",type:"POST",dataType:"json",data:additionalData},create:{url:"/en/BulkOrdering/BulkOrderingType2Create?headerId=24",type:"POST",dataType:"json",success:function(){},error:function(n){alert(n.status)}}},schema:{data:"Data",total:"Total",errors:"Errors",model:{id:"Id",fields:{Id:{editable:!1,type:"number"},ProductId:{editable:!0,type:"number"},Sku:{editable:!0,type:"string"},ProductName:{editable:!0,type:"string"},Mpn:{editable:!0,type:"string",validation:{required:!1}},Gtin:{editable:!0,type:"string",validation:{required:!1}},Quantity:{type:"number",validation:{required:!0,min:1},defaultValue:1},UnitPriceExclTax:{editable:!1,type:"number"},LinePriceExclTax:{editable:!1,type:"number"},OldPrice:{editable:!1,type:"string"},Attributes:{editable:!1,type:"string"},HasOptions:{editable:!1,type:"boolean"},AttributesXml:{editable:!1,type:"string"},Availability:{editable:!1,type:"string"},UnitOfMeasure:{editable:!1,type:"string"},UnitOfMeasureLevel2:{editable:!1,type:"string"},UnitOfMeasureLevel2Multiplier:{editable:!1,type:"number"},UnitOfMeasureLevel3:{editable:!1,type:"string"},UnitOfMeasureLevel3Multiplier:{editable:!1,type:"number"}}}},requestEnd:function(n){(n.type=="create"||n.type=="update"||n.type=="destroy")&&(this.read(),gridRefresh());kendo.ui.progress($("#product-grid"),!1)},error:function(n){console.log(n);this.cancelChanges();kendo.ui.progress($("#product-grid"),!1)},pageSize:25,serverPaging:!0,serverFiltering:!0,serverSorting:!0,aggregate:[{field:"LinePriceExclTax",aggregate:"sum"}]},editable:{confirmation:"Are you sure you want to delete this item?",mode:"inline"},pageable:{refresh:!0,pageSizes:[25,50,100],messages:{display:"Showing {0}-{1} from {2} records",empty:"No Pages",page:"Page","of":"Of",itemsPerPage:"Items Per Page",first:"First",previous:"Previous",next:"Next",last:"Last",refresh:"Refresh",allPages:"All",morePages:"More Pages"}},scrollable:!0,toolbar:[{name:"create",text:"Add Product"}],edit:function(n){n.sender.columns.forEach(function(t,i){t.hideMeOnEdit&&n.container.find(".k-edit-label:eq("+i+"), .k-edit-field:eq( "+i+")").hide()});var t=n.container,i=t.find(".k-grid-update"),r=t.find(".k-grid-cancel");i.length>0&&i.text("Update");r.length>0&&r.text("Cancel")},dataBound:onDataBound,columns:[{field:"Sku",title:"Sku",editor:skuEditor,template:"#:Sku#"},{field:"ProductName",title:"Name",editor:productEditor},{field:"Mpn",title:"Mpn",editor:mpnEditor,template:"#:Mpn#"},{field:"Availability",title:"Availability",encoded:!1},{field:"Quantity",title:"Quantity",width:"120px",editor:quantityEditor,template:function(n){var t="
"+n.Quantity+"<\/span> ",i,r;return n.UnitOfMeasure!=null&&n.UnitOfMeasure!=""&&(t+=""+n.UnitOfMeasure+"<\/span>"),t+="<\/div>",n.UnitOfMeasureLevel2!=null&&n.UnitOfMeasureLevel2!==""&&n.UnitOfMeasureLevel2Multiplier!==0&&(i=App.Math.roundQty(n.Quantity/n.UnitOfMeasureLevel2Multiplier,0),t+=""+App.Math.roundQty(i,0)+"<\/span> "+n.UnitOfMeasureLevel2+"<\/span><\/div>"),n.UnitOfMeasureLevel3!=null&&n.UnitOfMeasureLevel3!==""&&n.UnitOfMeasureLevel3Multiplier!==0&&(r=App.Math.roundQty(n.Quantity/n.UnitOfMeasureLevel3Multiplier,0),t+=""+App.Math.roundQty(r,0)+"<\/span> "+n.UnitOfMeasureLevel3+"<\/span><\/div>"),t}},{field:"Attributes",title:"Options",headerAttributes:{style:"text-align:center"},attributes:{style:"text-align:center"},template:"#if(HasOptions && Attributes !=''){##=Attributes#