marketplacepos 2.3.1 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[185],{2486:(Z,v,s)=>{s.d(v,{j:()=>T});var e=s(5412),t=s(4650),i=s(6895),C=s(4006);function b(g,p){if(1&g){const c=t.EpF();t.TgZ(0,"li")(1,"mat-checkbox",8),t.NdJ("ngModelChange",function(M){const I=t.CHM(c).$implicit;return t.KtG(I.selected=M)}),t.TgZ(2,"div",9)(3,"h5",10),t._uU(4),t.qZA()()()()}if(2&g){const c=p.$implicit;t.xp6(1),t.Q6J("ngModel",c.selected),t.xp6(3),t.Oqu(c.Name)}}let T=(()=>{class g{constructor(c,m){this.data=c,this.dialogRef=m,this.selectedItems=this.data.selectedItems,this.channels=this.data.channels}ngOnInit(){}onOk(){this.dialogRef.close(this.channels)}onClose(){this.dialogRef.close()}}return g.\u0275fac=function(c){return new(c||g)(t.Y36(e.WI),t.Y36(e.so))},g.\u0275cmp=t.Xpm({type:g,selectors:[["app-modal-update-channels"]],decls:20,vars:2,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0"],[1,"fw-light"],[1,"no-bullet"],[4,"ngFor","ngForOf"],[1,"justify-content-end","mx-4"],["mat-button","",1,"btn","btn-light","mx-3",3,"click"],["mat-button","","data-cy","scan",1,"btn","btn-success","mx-3",3,"click"],[3,"ngModel","ngModelChange"],[1,"d-flex"],[1,"fw-light","me-2","my-auto"]],template:function(c,m){1&c&&(t.TgZ(0,"h1",0),t._uU(1,"Update Inventory from POS to Channel"),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"div")(5,"h6",2),t._uU(6),t._UZ(7,"br")(8,"br"),t._uU(9," Choose channels to update : "),t._UZ(10,"br")(11,"br"),t.qZA(),t.TgZ(12,"ul",3),t.YNc(13,b,5,2,"li",4),t.qZA()()(),t._UZ(14,"hr"),t.TgZ(15,"mat-dialog-actions",5)(16,"button",6),t.NdJ("click",function(){return m.onClose()}),t._uU(17,"Close"),t.qZA(),t.TgZ(18,"button",7),t.NdJ("click",function(){return m.onOk()}),t._uU(19,"Update"),t.qZA()()),2&c&&(t.xp6(6),t.hij("Updating ",null==m.selectedItems?null:m.selectedItems.length," items "),t.xp6(7),t.Q6J("ngForOf",m.channels))},dependencies:[i.sg,C.JJ,C.On,e.uh,e.xY,e.H8],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]}),g})()},7398:(Z,v,s)=>{s.d(v,{Z:()=>T,e:()=>b});var e=s(6895),t=s(8252),i=s(4650);function C(g,p){if(1&g&&(i.TgZ(0,"li",2)(1,"a",3),i._uU(2),i.qZA()()),2&g){const c=p.$implicit;i.xp6(1),i.s9C("routerLink",c.Url),i.xp6(1),i.hij(" ",c.Title," ")}}let b=(()=>{class g{}return g.\u0275fac=function(c){return new(c||g)},g.\u0275cmp=i.Xpm({type:g,selectors:[["nav-tab"]],inputs:{Tabs:"Tabs"},decls:2,vars:1,consts:[[1,"nav","navbar-nav","navbar-left","nav-tab-arrow"],["routerLinkActive","active","class","nav-item me-6",4,"ngFor","ngForOf"],["routerLinkActive","active",1,"nav-item","me-6"],[1,"nav-link","nav-link-arrow","mb-0",3,"routerLink"]],template:function(c,m){1&c&&(i.TgZ(0,"ul",0),i.YNc(1,C,3,2,"li",1),i.qZA()),2&c&&(i.xp6(1),i.Q6J("ngForOf",m.Tabs))},dependencies:[e.sg,t.yS,t.Od]}),g})(),T=(()=>{class g{}return g.\u0275fac=function(c){return new(c||g)},g.\u0275mod=i.oAB({type:g}),g.\u0275inj=i.cJS({imports:[e.ez,t.Bz]}),g})()},5131:(Z,v,s)=>{s.d(v,{j:()=>M});var e=s(5412),t=(()=>{return(_=t||(t={}))[_.Shopee=0]="Shopee",_[_.Tokopedia=1]="Tokopedia",_[_.WooCommerce=2]="WooCommerce",_[_.None=3]="None",_[_.KalCare=4]="KalCare",_[_.ShopeeV2=5]="ShopeeV2",_[_.Tiktok=6]="Tiktok",_[_.Lazada=7]="Lazada",t;var _})(),i=s(4650),C=s(6895),b=s(4006),T=s(1948),g=s(9549),p=s(4385),c=s(3238);function m(_,I){if(1&_&&(i.TgZ(0,"mat-option",14),i._UZ(1,"img",15),i._uU(2),i.qZA()),2&_){const f=I.$implicit;i.Q6J("value",f.ID),i.xp6(1),i.Q6J("src",f.Img,i.LSH),i.xp6(1),i.hij(" ",f.Name," ")}}let M=(()=>{class _{constructor(f,u){this.dialogRef=f,this.data=u}ngOnInit(){this.data.filter.mode=0,this.data.filter.sync=!0,this.data.filter.ScanFull=!0,this.data.Channel.length<2&&(this.data.filter.ChannelID=this.data.Channel[0].ID),this.notInPOS=this.data.notInPOS,null==this.notInPOS&&(this.notInPOS=!1)}onSelectChannel(f){let u=this.filterChannelById(f);u&&u.TypeID==t.Tokopedia?(this.data.filter.ScanFull=!0,this.isDisabledOptions=!0):(this.data.filter.ScanFull=!1,this.isDisabledOptions=!1)}filterChannelById(f){let u;return this.data.Channel&&(u=this.data.Channel.find(x=>x.ID==f)),u}submit(){this.data.filter.ScanFull?this.data.filter.ScanFull=!0:this.data.filter.ScanFull||(this.data.filter.ScanFull=!1),this.dialogRef.close(this.data)}close(){this.dialogRef.close()}}return _.\u0275fac=function(f){return new(f||_)(i.Y36(e.so),i.Y36(e.WI))},_.\u0275cmp=i.Xpm({type:_,selectors:[["app-scan-dialog"]],decls:22,vars:7,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0","border-top","border-bottom"],[1,"mb-3","fw-normal"],["appearance","outline"],["name","channelid","placeholder","Channel",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[3,"hidden"],[1,"mb-3","font-weight-normal"],["name","ScanFull",1,"form-control","h-100","pt-5","round",3,"ngModel","disabled","ngModelChange"],["data-toggle","tooltip","title","Full Scan Product",1,"me-5",3,"value"],["data-toggle","tooltip","title","Only Active Product",1,"me-5",3,"value"],[1,"justify-content-end","mx-4"],["mat-button","",1,"btn","btn-light","mx-3",3,"click"],["mat-button","","data-cy","scan",1,"btn","btn-success","mx-3",3,"click"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(f,u){1&f&&(i.TgZ(0,"h1",0),i._uU(1,"Scan Marketplace"),i.qZA(),i.TgZ(2,"mat-dialog-content",1)(3,"h5",2),i._uU(4,"Select a Channel"),i.qZA(),i.TgZ(5,"mat-form-field",3)(6,"mat-select",4),i.NdJ("ngModelChange",function(O){return u.data.filter.ChannelID=O})("ngModelChange",function(O){return u.onSelectChannel(O)}),i.YNc(7,m,3,3,"mat-option",5),i.qZA()(),i._UZ(8,"br"),i.TgZ(9,"div",6)(10,"h5",7),i._uU(11,"Scan Type"),i.qZA(),i.TgZ(12,"mat-radio-group",8),i.NdJ("ngModelChange",function(O){return u.data.filter.ScanFull=O}),i.TgZ(13,"mat-radio-button",9),i._uU(14," Full "),i.qZA(),i.TgZ(15,"mat-radio-button",10),i._uU(16," Active "),i.qZA()()()(),i.TgZ(17,"mat-dialog-actions",11)(18,"button",12),i.NdJ("click",function(){return u.close()}),i._uU(19,"Cancel"),i.qZA(),i.TgZ(20,"button",13),i.NdJ("click",function(){return u.submit()}),i._uU(21,"Scan"),i.qZA()()),2&f&&(i.xp6(6),i.Q6J("ngModel",u.data.filter.ChannelID),i.xp6(1),i.Q6J("ngForOf",u.data.Channel),i.xp6(2),i.Q6J("hidden",(null==u.data?null:u.data.hiddenRadioButton)||!(null!=u.data&&u.data.filter.ChannelID)),i.xp6(3),i.Q6J("ngModel",u.data.filter.ScanFull)("disabled",u.isDisabledOptions),i.xp6(1),i.Q6J("value",!0),i.xp6(2),i.Q6J("value",!1))},dependencies:[C.sg,b.JJ,b.On,e.uh,e.xY,e.H8,T.VQ,T.U0,g.KE,p.gD,c.ey],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]}),_})()},1576:(Z,v,s)=>{s.d(v,{k:()=>T});var e=s(5412),t=s(4650),i=s(4006),C=s(9549),b=s(4144);let T=(()=>{class g{constructor(c,m){this.dialogRef=c,this.item=m}ngOnInit(){this.selectedChannel=this.item.Variant.Channel.find(c=>c.ChannelID==this.item.ChannelID),this.selectedChannel.ID=this.item.Variant.ID,this.selectedChannel.Sku=this.item.Variant.Code,"inventory"==this.item.Table?this.tempNum=this.selectedChannel.Inventory:"price"==this.item.Table&&(this.tempNum=this.selectedChannel.Price),this.selectedChannel.ItemName=this.item.Name,this.selectedChannel.VarName=this.item.Variant.Model}submit(){"inventory"==this.item.Table?this.selectedChannel.Inventory=this.tempNum:"price"==this.item.Table&&(this.selectedChannel.Price=this.tempNum),this.dialogRef.close(this.selectedChannel)}close(){this.dialogRef.close()}}return g.\u0275fac=function(c){return new(c||g)(t.Y36(e.so),t.Y36(e.WI))},g.\u0275cmp=t.Xpm({type:g,selectors:[["app-table-dialog"]],decls:12,vars:5,consts:[["mat-dialog-title",""],[1,"editBody"],[1,"font-lg"],["matInput","","autoNum","",1,"font-lgr","py-3",3,"ngModel","ngModelChange"],[1,"justify-content-end"],["mat-button","",1,"btn","btn-light","mx-3",3,"click"],["mat-button","",1,"btn","btn-success","mx-3",3,"click"]],template:function(c,m){1&c&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t.TgZ(2,"mat-dialog-content",1)(3,"mat-form-field")(4,"mat-label",2),t._uU(5,"Editing Data"),t.qZA(),t.TgZ(6,"input",3),t.NdJ("ngModelChange",function(_){return m.tempNum=_}),t.qZA()()(),t.TgZ(7,"mat-dialog-actions",4)(8,"button",5),t.NdJ("click",function(){return m.close()}),t._uU(9,"Cancel"),t.qZA(),t.TgZ(10,"button",6),t.NdJ("click",function(){return m.submit()}),t._uU(11,"Save"),t.qZA()()),2&c&&(t.xp6(1),t.HOy("",m.item.Name," ",m.item.Variant.Model," ",m.item.Table," in ",m.selectedChannel.Title,""),t.xp6(5),t.Q6J("ngModel",m.tempNum))},dependencies:[i.Fj,i.JJ,i.On,e.uh,e.xY,e.H8,C.KE,C.hX,b.Nt],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-left:1rem;margin-right:1rem}.mat-dialog-content[_ngcontent-%COMP%]{padding-left:.5rem;padding-right:.5rem;margin-left:.5rem;margin-right:.5rem}.font-lg[_ngcontent-%COMP%]{font-size:large}.font-lgr[_ngcontent-%COMP%]{font-size:larger}"]}),g})()},7100:(Z,v,s)=>{s.d(v,{U:()=>d,a:()=>E});var e=s(4650),t=s(1576),i=s(6895),C=s(455),b=s(4006),T=s(5412);function g(a,l){if(1&a){const n=e.EpF();e.ynx(0),e._UZ(1,"br"),e.TgZ(2,"mat-slide-toggle",12),e.NdJ("toggleChange",function(){e.CHM(n);const r=e.oxw();return r.toggleStatus=!r.toggleStatus,e.KtG(r.onToggle())}),e.TgZ(3,"small",13),e._uU(4,"Filter Different Inventory"),e.qZA()(),e.BQk()}}function p(a,l){if(1&a&&(e.TgZ(0,"th",14),e._uU(1),e.qZA()),2&a){const n=l.$implicit;e.xp6(1),e.Oqu(n.Name)}}function c(a,l){if(1&a){const n=e.EpF();e.TgZ(0,"input",27),e.NdJ("ngModelChange",function(r){e.CHM(n);const h=e.oxw(3).$implicit;return e.KtG(h.selected=r)})("ngModelChange",function(){e.CHM(n);const r=e.oxw(3).$implicit,h=e.oxw();return e.KtG(h.onCheckboxStateProduct(r.ID))}),e.qZA()}if(2&a){const n=e.oxw(3).$implicit,o=e.oxw();e.Q6J("hidden",o.filter.HiddenIPOSInventory)("ngModel",n.selected)}}function m(a,l){if(1&a&&e._UZ(0,"img",28),2&a){const n=e.oxw(3).$implicit;e.s9C("src",null==n?null:n.ThumbnailUrl,e.LSH)}}function M(a,l){1&a&&e._UZ(0,"img",29)}function _(a,l){if(1&a&&(e.ynx(0),e.TgZ(1,"td",21)(2,"div",22),e.YNc(3,c,1,2,"input",23),e.YNc(4,m,1,1,"img",24),e.YNc(5,M,1,0,"ng-template",null,25,e.W1O),e.qZA()(),e.TgZ(7,"td",21)(8,"span",26),e._uU(9),e.qZA(),e._UZ(10,"br"),e.TgZ(11,"small"),e._uU(12),e.qZA()(),e.BQk()),2&a){const n=e.MAs(6),o=e.oxw(2).$implicit,r=e.oxw();e.xp6(1),e.Q6J("rowSpan",null==o?null:o.Variants.length),e.xp6(2),e.Q6J("ngIf",r.CountVariant(o.Variants)>=0),e.xp6(1),e.Q6J("ngIf",null==o?null:o.ThumbnailUrl)("ngIfElse",n),e.xp6(3),e.Q6J("rowSpan",null==o?null:o.Variants.length),e.xp6(2),e.Oqu(null==o?null:o.Name),e.xp6(3),e.hij("(",null==o?null:o.Category,")")}}function I(a,l){if(1&a){const n=e.EpF();e.TgZ(0,"input",8),e.NdJ("ngModelChange",function(r){e.CHM(n);const h=e.oxw().$implicit;return e.KtG(h.selected=r)}),e.qZA()}if(2&a){const n=e.oxw().$implicit;e.Q6J("ngModel",n.selected)}}const f=function(a){return{"bg-err":a}};function u(a,l){if(1&a){const n=e.EpF();e.ynx(0),e.TgZ(1,"td",32)(2,"div",33)(3,"div",34),e.NdJ("click",function(){e.CHM(n);const r=e.oxw().$implicit,h=e.oxw().$implicit,y=e.oxw().$implicit,D=e.oxw();return e.KtG(D.openTableDialog(y.Name,h,r.ID,y.ChannelItemID))}),e._uU(4),e.ALo(5,"number"),e._UZ(6,"br"),e.qZA(),e.TgZ(7,"div",35)(8,"a",36),e._UZ(9,"i",37),e.qZA()()()(),e.BQk()}if(2&a){const n=l.$implicit,o=e.oxw(2).$implicit,r=e.oxw(2);e.xp6(1),e.Q6J("ngClass",e.VKq(5,f,r.printPOS(o)!=r.printItem(n)&&!r.filter.HiddenIPOSInventory)),e.xp6(3),e.hij(" ",e.lcZ(5,3,r.printItem(n)),""),e.xp6(4),e.Q6J("href",n.Url,e.LSH)}}function x(a,l){1&a&&(e.TgZ(0,"td",38),e._uU(1,"X"),e.qZA())}function O(a,l){if(1&a&&(e.ynx(0),e.YNc(1,u,10,7,"ng-container",30),e.YNc(2,x,2,0,"ng-template",null,31,e.W1O),e.BQk()),2&a){const n=l.$implicit,o=e.MAs(3),r=e.oxw().$implicit,h=e.oxw(2);e.xp6(1),e.Q6J("ngIf",h.getItemFromChannel(r,n.ID))("ngIfElse",o)}}function k(a,l){if(1&a&&(e.TgZ(0,"tr"),e.YNc(1,_,13,7,"ng-container",4),e.TgZ(2,"td",15),e._uU(3),e.qZA(),e.TgZ(4,"td",15)(5,"div",16)(6,"div",17),e._uU(7),e.qZA()()(),e.TgZ(8,"td",18),e.YNc(9,I,1,1,"input",19),e.qZA(),e.TgZ(10,"td",20),e._uU(11),e.ALo(12,"number"),e.qZA(),e.YNc(13,O,4,2,"ng-container",11),e.qZA()),2&a){const n=l.$implicit,o=l.index,r=e.oxw(2);e.xp6(1),e.Q6J("ngIf",0==o),e.xp6(2),e.Oqu(null==n?null:n.Model),e.xp6(4),e.hij(" ",n.Code," "),e.xp6(1),e.Q6J("hidden",r.filter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngIf",r.printPOS(n)>=0||"price"==r.table),e.xp6(1),e.Q6J("hidden",r.filter.HiddenIPOSInventory),e.xp6(1),e.Oqu(e.lcZ(12,8,r.printPOS(n))),e.xp6(2),e.Q6J("ngForOf",r.channel)}}function S(a,l){if(1&a&&(e.TgZ(0,"tbody"),e.YNc(1,k,14,10,"tr",11),e.qZA()),2&a){const n=l.$implicit;e.xp6(1),e.Q6J("ngForOf",n.Variants)}}let E=(()=>{class a{constructor(n){this.dialog=n,this.onSubmit=new e.vpe,this.showProductToggle=!1,this.toggleStatus=!1,this.toggle=new e.vpe,this.checkboxState=!1}ngOnInit(){"inventory"==this.table?this.stockHeader="Stock":"price"==this.table&&(this.stockHeader="Price")}onCheckboxStateProduct(n){let o=this.data.filter(r=>r.ID==n);if(o.length>0)for(let r of o)for(let h of r.Variants)h.selected=r.selected}onCheckboxStateChange(){for(let n of this.data)for(let o of n.Variants)o.selected=this.checkboxState}getSelected(){return this.data?this.data.filter(n=>n.Variants.filter(o=>o.selected)):[]}hasSelection(){return!!this.data&&this.getSelected().length>0}getItemFromChannel(n,o){return n.Channel.find(r=>r.ChannelID==o)}printItem(n){return"inventory"==this.table?n.Inventory:"price"==this.table?n.Price:void 0}openTableDialog(n,o,r,h){this.dialog.open(t.k,{data:{Name:n,Variant:o,ChannelID:r,Table:this.table,ChannelItemID:h}}).afterClosed().subscribe(D=>{null!=D&&this.onSubmit.emit(D)})}printPOS(n){return"inventory"==this.table?n.Inventory?n.Inventory:0:"price"==this.table?n.UnitPrice:null}CountVariant(n){if("inventory"==this.table){let o=0;for(let r of n)o+=r.Inventory;return o}if("price"==this.table){let o=0;for(let r of n)o+=r.UnitPrice;return o}return null}onToggle(){this.toggle.emit(this.toggleStatus)}}return a.\u0275fac=function(n){return new(n||a)(e.Y36(T.uw))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-table"]],inputs:{filter:"filter",data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle"},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:17,vars:6,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-20"],[4,"ngIf"],["scope","col",1,"text-start"],["scope","col",1,"text-end","w-10"],[3,"hidden"],["type","checkbox",3,"ngModel","ngModelChange"],["scope","col",1,"text-end","w-10",3,"hidden"],["scope","col","class","text-center w-10 text-uppercase",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[3,"toggleChange"],[1,"fw-bold"],["scope","col",1,"text-center","w-10","text-uppercase"],[1,"text-start"],[1,"row","justify-content-start","me-0","gx-0"],[1,"col-8","px-0","text-wrapping"],[1,"align-middle",3,"hidden"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"text-end",3,"hidden"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center"],["type","checkbox","class","me-3",3,"hidden","ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img",3,"src",4,"ngIf","ngIfElse"],["elsePic",""],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"hidden","ngModel","ngModelChange"],[1,"border","rounded","w-img",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[4,"ngIf","ngIfElse"],["elseCol",""],[1,"text-end","p-0","pointer","cell-hover",3,"ngClass"],[1,"row","justify-content-end","me-0"],[1,"col-8","px-0","text-center",3,"click"],[1,"col-2","ps-0","text-start","align-self-center"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt"],[1,"table-white","text-end",2,"color","red"]],template:function(n,o){1&n&&(e.TgZ(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr")(4,"th",3),e._uU(5,"Product "),e.YNc(6,g,5,0,"ng-container",4),e.qZA(),e.TgZ(7,"th",5),e._uU(8,"Variant"),e.qZA(),e.TgZ(9,"th",6),e._uU(10,"SKU"),e.qZA(),e.TgZ(11,"th",7)(12,"input",8),e.NdJ("ngModelChange",function(h){return o.checkboxState=h})("ngModelChange",function(){return o.onCheckboxStateChange()}),e.qZA()(),e.TgZ(13,"th",9),e._uU(14,"POS"),e.qZA(),e.YNc(15,p,2,1,"th",10),e.qZA()(),e.YNc(16,S,2,1,"tbody",11),e.qZA()()),2&n&&(e.xp6(6),e.Q6J("ngIf",o.showProductToggle),e.xp6(5),e.Q6J("hidden",o.filter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",o.checkboxState),e.xp6(1),e.Q6J("hidden",o.filter.HiddenIPOSInventory),e.xp6(2),e.Q6J("ngForOf",o.channel),e.xp6(1),e.Q6J("ngForOf",o.data))},dependencies:[i.mk,i.sg,i.O5,b.Wl,b.JJ,b.On,C.Rr,i.JJ],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}"]}),a})(),d=(()=>{class a{}return a.\u0275fac=function(n){return new(n||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({imports:[i.ez,b.u5,C.rP]}),a})()},455:(Z,v,s)=>{s.d(v,{Rr:()=>x,rP:()=>E});var e=s(9643),t=s(4650),i=s(3238),C=s(2687),b=s(1281),T=s(4006);const g=["input"],p=function(d){return{enterDuration:d}},c=["*"],m=new t.OlP("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let M=0;const _={provide:T.JU,useExisting:(0,t.Gpc)(()=>x),multi:!0};class I{constructor(a,l){this.source=a,this.checked=l}}const f=(0,i.sb)((0,i.pj)((0,i.Kr)((0,i.Id)(class{constructor(d){this._elementRef=d}}))));let u=(()=>{class d extends f{constructor(l,n,o,r,h,y,D){super(l),this._focusMonitor=n,this._changeDetectorRef=o,this.defaults=h,this._onChange=P=>{},this._onTouched=()=>{},this._required=!1,this._checked=!1,this.name=null,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.change=new t.vpe,this.toggleChange=new t.vpe,this.tabIndex=parseInt(r)||0,this.color=this.defaultColor=h.color||"accent",this._noopAnimations="NoopAnimations"===y,this.id=this._uniqueId=`${D}${++M}`}get required(){return this._required}set required(l){this._required=(0,b.Ig)(l)}get checked(){return this._checked}set checked(l){this._checked=(0,b.Ig)(l),this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(l=>{"keyboard"===l||"program"===l?this._focused=!0:l||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(l){this.checked=!!l}registerOnChange(l){this._onChange=l}registerOnTouched(l){this._onTouched=l}setDisabledState(l){this.disabled=l,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}}return d.\u0275fac=function(l){t.$Z()},d.\u0275dir=t.lG2({type:d,inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"],required:"required",checked:"checked"},outputs:{change:"change",toggleChange:"toggleChange"},features:[t.qOj]}),d})(),x=(()=>{class d extends u{constructor(l,n,o,r,h,y){super(l,n,o,r,h,y,"mat-slide-toggle-")}_createChangeEvent(l){return new I(this,l)}_onChangeEvent(l){l.stopPropagation(),this.toggleChange.emit(),this.defaults.disableToggleValue?this._inputElement.nativeElement.checked=this.checked:(this.checked=this._inputElement.nativeElement.checked,this._emitChangeEvent())}_onInputClick(l){l.stopPropagation()}focus(l,n){n?this._focusMonitor.focusVia(this._inputElement,n,l):this._inputElement.nativeElement.focus(l)}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return d.\u0275fac=function(l){return new(l||d)(t.Y36(t.SBq),t.Y36(C.tE),t.Y36(t.sBO),t.$8M("tabindex"),t.Y36(m),t.Y36(t.QbO,8))},d.\u0275cmp=t.Xpm({type:d,selectors:[["mat-slide-toggle"]],viewQuery:function(l,n){if(1&l&&t.Gf(g,5),2&l){let o;t.iGM(o=t.CRH())&&(n._inputElement=o.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:13,hostBindings:function(l,n){2&l&&(t.Ikx("id",n.id),t.uIk("tabindex",null)("aria-label",null)("aria-labelledby",null)("name",null),t.ekj("mat-checked",n.checked)("mat-disabled",n.disabled)("mat-slide-toggle-label-before","before"==n.labelPosition)("_mat-animation-noopable",n._noopAnimations))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex"},exportAs:["matSlideToggle"],features:[t._Bn([_]),t.qOj],ngContentSelectors:c,decls:14,vars:20,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(l,n){if(1&l&&(t.F$t(),t.TgZ(0,"label",0,1)(2,"span",2)(3,"input",3,4),t.NdJ("change",function(r){return n._onChangeEvent(r)})("click",function(r){return n._onInputClick(r)}),t.qZA(),t.TgZ(5,"span",5),t._UZ(6,"span",6),t.TgZ(7,"span",7),t._UZ(8,"span",8),t.qZA()()(),t.TgZ(9,"span",9,10),t.NdJ("cdkObserveContent",function(){return n._onLabelTextChange()}),t.TgZ(11,"span",11),t._uU(12,"\xa0"),t.qZA(),t.Hsn(13),t.qZA()()),2&l){const o=t.MAs(1),r=t.MAs(10);t.uIk("for",n.inputId),t.xp6(2),t.ekj("mat-slide-toggle-bar-no-side-margin",!r.textContent||!r.textContent.trim()),t.xp6(1),t.Q6J("id",n.inputId)("required",n.required)("tabIndex",n.tabIndex)("checked",n.checked)("disabled",n.disabled),t.uIk("name",n.name)("aria-checked",n.checked)("aria-label",n.ariaLabel)("aria-labelledby",n.ariaLabelledby)("aria-describedby",n.ariaDescribedby),t.xp6(4),t.Q6J("matRippleTrigger",o)("matRippleDisabled",n.disableRipple||n.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",t.VKq(18,p,n._noopAnimations?0:150))}},dependencies:[i.wG,e.wD],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{-webkit-user-select:none;user-select:none;display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%;display:block}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}"],encapsulation:2,changeDetection:0}),d})(),S=(()=>{class d{}return d.\u0275fac=function(l){return new(l||d)},d.\u0275mod=t.oAB({type:d}),d.\u0275inj=t.cJS({}),d})(),E=(()=>{class d{}return d.\u0275fac=function(l){return new(l||d)},d.\u0275mod=t.oAB({type:d}),d.\u0275inj=t.cJS({imports:[S,i.si,i.BQ,e.Q8,S,i.BQ]}),d})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[231],{7398:(k,Z,p)=>{p.d(Z,{Z:()=>P,e:()=>t});var d=p(6895),C=p(8252),c=p(4650);function I(u,h){if(1&u&&(c.TgZ(0,"li",2)(1,"a",3),c._uU(2),c.qZA()()),2&u){const r=h.$implicit;c.xp6(1),c.s9C("routerLink",r.Url),c.xp6(1),c.hij(" ",r.Title," ")}}let t=(()=>{class u{}return u.\u0275fac=function(r){return new(r||u)},u.\u0275cmp=c.Xpm({type:u,selectors:[["nav-tab"]],inputs:{Tabs:"Tabs"},decls:2,vars:1,consts:[[1,"nav","navbar-nav","navbar-left","nav-tab-arrow"],["routerLinkActive","active","class","nav-item me-6",4,"ngFor","ngForOf"],["routerLinkActive","active",1,"nav-item","me-6"],[1,"nav-link","nav-link-arrow","mb-0",3,"routerLink"]],template:function(r,y){1&r&&(c.TgZ(0,"ul",0),c.YNc(1,I,3,2,"li",1),c.qZA()),2&r&&(c.xp6(1),c.Q6J("ngForOf",y.Tabs))},dependencies:[d.sg,C.yS,C.Od]}),u})(),P=(()=>{class u{}return u.\u0275fac=function(r){return new(r||u)},u.\u0275mod=c.oAB({type:u}),u.\u0275inj=c.cJS({imports:[d.ez,C.Bz]}),u})()},5231:(k,Z,p)=>{p.r(Z),p.d(Z,{ProductModule:()=>hn});var d=p(6895),C=p(7398),c=p(4006),I=p(8252),t=p(4650);let P=(()=>{class e{constructor(){this.productTabs=[{Title:"In POS",Url:"/menu/products/in-pos"},{Title:"Not in POS",Url:"/menu/products/not-in-pos"},{Title:"Sold in Channel",Url:"/menu/products/sold-in-channel"},{Title:"Not in Channel",Url:"/menu/products/not-in-channel"},{Title:"Duplicate SKU",Url:"/menu/products/duplicate-sku"}]}ngOnInit(){}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-products"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,o){1&n&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()()(),t._UZ(4,"router-outlet")),2&n&&(t.xp6(3),t.Q6J("Tabs",o.productTabs))},dependencies:[C.e,I.lC],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}"]}),e})();class u{}var h=p(5131),r=p(5412),y=p(3841);let w=(()=>{class e{constructor(n){this.LocalData=n}GetCategories(n,o,i){return new Promise(l=>{this.LocalData.getListByKey(n).then(s=>{null!=s?l(s):this.getCategoriesByTypeID(n,o,i).then(f=>{l(f)})})})}getCategoriesByTypeID(n,o,i){return new Promise(l=>{i.post("/api/Channel/getCategoriesByTypeID",{TypeID:n,ID:o}).subscribe(f=>{this.LocalData.saveList(f,n),l(f)})})}}return e.\u0275fac=function(n){return new(n||e)(t.LFG(y.F))},e.\u0275prov=t.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var g=p(1318),v=p(8966);function _(e,a){if(1&e){const n=t.EpF();t.ynx(0),t.TgZ(1,"h5",4),t._uU(2,"Category"),t.qZA(),t.TgZ(3,"app-select-search",10),t.NdJ("onSelect",function(i){t.CHM(n);const l=t.oxw();return t.KtG(l.onSelectCategory(i))}),t.qZA(),t.BQk()}if(2&e){const n=t.oxw();t.xp6(3),t.Q6J("appearance","outline")("batchSize",30)("data",n.options)("bindLabel","Value")("bindValue","Key")("placeholder","Select Category")}}let m=(()=>{class e{constructor(n,o,i,l){this.data=n,this.channelCategoriesService=o,this.http=i,this.dialogRef=l,this.item=n.item,this.selectItemMissingChannel=n.selectedItemMissingChannel,this.options=[],this.optionVisible=!1}onSelectItem(n){this.selectedChannelID=n;let o=this.selectItemMissingChannel.find(i=>i.ID==n);!o||1!==o.TypeID&&6!==o.TypeID?this.optionVisible=!1:this.channelCategoriesService.GetCategories(o.TypeID,o.ID,this.http).then(i=>{this.options=i,this.optionVisible=!0}).catch(i=>{console.error(i)})}onSelectCategory(n){this.selectedCategoryID=n}onClose(){this.dialogRef.close()}onSave(){this.selectedChannelID&&(this.selectedCategoryID||!this.optionVisible)&&this.dialogRef.close({channelID:this.selectedChannelID,categoryID:this.selectedCategoryID})}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(r.WI),t.Y36(w),t.Y36(g.O),t.Y36(r.so))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-uploadProductDialog"]],decls:16,vars:7,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0","border-top","border-bottom"],[1,"row"],[1,"col-12"],[1,"mb-3","fw-normal"],[3,"appearance","data","bindLabel","bindValue","placeholder","onSelect"],[4,"ngIf"],[1,"justify-content-end","mx-4"],["mat-button","",1,"btn","btn-light","mx-3",3,"click"],["mat-button","","data-cy","scan",1,"btn","btn-success","mx-3",3,"click"],[3,"appearance","batchSize","data","bindLabel","bindValue","placeholder","onSelect"]],template:function(n,o){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t.TgZ(2,"mat-dialog-content",1)(3,"div",2)(4,"div",3)(5,"h5",4),t._uU(6,"Channel :"),t.qZA(),t.TgZ(7,"app-select-search",5),t.NdJ("onSelect",function(l){return o.onSelectItem(l)}),t.qZA()()(),t.TgZ(8,"div",2)(9,"div",3),t.YNc(10,_,4,6,"ng-container",6),t.qZA()()(),t.TgZ(11,"mat-dialog-actions",7)(12,"button",8),t.NdJ("click",function(){return o.onClose()}),t._uU(13,"Cancel"),t.qZA(),t.TgZ(14,"button",9),t.NdJ("click",function(){return o.onSave()}),t._uU(15,"Upload"),t.qZA()()),2&n&&(t.xp6(1),t.hij("Upload ",null==o.item?null:o.item.Name,""),t.xp6(6),t.Q6J("appearance","outline")("data",o.selectItemMissingChannel)("bindLabel","Name")("bindValue","ID")("placeholder","Choose "),t.xp6(3),t.Q6J("ngIf",o.optionVisible))},dependencies:[d.O5,r.uh,r.xY,r.H8,v.h],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),e})();function b(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"tr")(2,"td",9),t._uU(3),t.qZA(),t.TgZ(4,"td",9),t._uU(5),t.qZA(),t.TgZ(6,"td",10)(7,"p",11),t._uU(8,"Product Not in Channel!"),t.qZA()()(),t.BQk()),2&e){const n=t.oxw().$implicit;t.xp6(3),t.hij(" ",null==n?null:n.Model,""),t.xp6(2),t.hij(" ",null==n?null:n.Code,"")}}function T(e,a){if(1&e&&(t.TgZ(0,"td",9),t._uU(1),t.qZA()),2&e){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Model,"")}}function J(e,a){if(1&e&&(t.TgZ(0,"td",9),t._uU(1),t.qZA()),2&e){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Code,"")}}function q(e,a){1&e&&t._UZ(0,"img",18)}function Q(e,a){1&e&&t._UZ(0,"img",19)}function V(e,a){1&e&&t._UZ(0,"img",20)}function Y(e,a){1&e&&t._UZ(0,"img",21)}function F(e,a){if(1&e&&(t.TgZ(0,"tr")(1,"td",9),t._uU(2),t.qZA(),t.YNc(3,T,2,2,"td",12),t.YNc(4,J,2,2,"td",12),t.TgZ(5,"td",9),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",9),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",9)(12,"a",13),t.YNc(13,q,1,0,"img",14),t.YNc(14,Q,1,0,"img",15),t.YNc(15,V,1,0,"img",16),t.YNc(16,Y,1,0,"img",17),t.qZA()()()),2&e){const n=a.$implicit,o=a.index;t.xp6(2),t.Oqu(n.Name),t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(2),t.Oqu(t.lcZ(7,11,n.Price)),t.xp6(3),t.Oqu(t.lcZ(10,13,n.Inventory)),t.xp6(3),t.s9C("href",n.Url,t.LSH),t.s9C("title",n.Title),t.xp6(1),t.Q6J("ngIf",1==n.TypeID),t.xp6(1),t.Q6J("ngIf",0==n.TypeID||5==n.TypeID),t.xp6(1),t.Q6J("ngIf",2==n.TypeID),t.xp6(1),t.Q6J("ngIf",6==n.TypeID)}}function L(e,a){if(1&e&&t.YNc(0,F,17,15,"tr",6),2&e){const n=t.oxw().$implicit;t.Q6J("ngForOf",null==n?null:n.Channel)}}function R(e,a){if(1&e&&(t.ynx(0),t.YNc(1,b,9,2,"ng-container",7),t.YNc(2,L,1,1,"ng-template",null,8,t.W1O),t.BQk()),2&e){const n=a.$implicit,o=t.MAs(3);t.xp6(1),t.Q6J("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",o)}}let $=(()=>{class e{constructor(n){this.data=n,this.variants=n.variants,this.title=n.title}ngOnInit(){}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(r.WI))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-modal-variant"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"pt-2","pb-3","text-center"],[1,"pb-5","mx-0"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"sticky-top"],[1,"text-center","sticky-top"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-center"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-center",4,"ngIf"],["target","_blank",3,"href","title"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"],["src","https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp"],["src","https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png"]],template:function(n,o){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"table",2)(5,"thead",3)(6,"tr",4)(7,"th",5),t._uU(8,"PRODUCT"),t.qZA(),t.TgZ(9,"th",5),t._uU(10,"VARIANT"),t.qZA(),t.TgZ(11,"th",5),t._uU(12,"SKU"),t.qZA(),t.TgZ(13,"th",5),t._uU(14,"PRICE"),t.qZA(),t.TgZ(15,"th",5),t._uU(16,"INVENTORY"),t.qZA(),t.TgZ(17,"th",5),t._uU(18,"CHANNEL"),t.qZA()()(),t.TgZ(19,"tbody"),t.YNc(20,R,4,2,"ng-container",6),t.qZA()()()),2&n&&(t.xp6(1),t.Oqu(o.title),t.xp6(19),t.Q6J("ngForOf",o.variants))},dependencies:[d.sg,d.O5,r.uh,r.xY,d.JJ],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0px}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important}"]}),e})();var x=(()=>{return(e=x||(x={})).SHOOPE="//res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",e.WOOCOMMERCE="//res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",e.TOKOPEDIA="//res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",e.TIKTOK="//res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",x;var e})(),S=p(7185),N=p(266),O=p(7481);function E(e,a){if(1&e&&t._UZ(0,"img",27),2&e){const n=t.oxw().$implicit;t.s9C("src",null==n?null:n.ThumbnailUrl,t.LSH)}}function K(e,a){1&e&&t._UZ(0,"img",28)}function G(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",29)(1,"input",30),t.NdJ("ngModelChange",function(i){t.CHM(n);const l=t.oxw().$implicit;return t.KtG(l.selected=i)}),t.qZA()()}if(2&e){const n=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",n.selected)}}function H(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"div",31)(2,"h4")(3,"span",32),t._uU(4),t.qZA()()(),t.BQk()),2&e){const n=t.oxw().$implicit;t.xp6(4),t.hij(" ",null==n?null:n.Variants.length,"")}}function j(e,a){if(1&e&&(t.TgZ(0,"div")(1,"span",33),t._uU(2),t.qZA(),t.TgZ(3,"span",33),t._uU(4),t.qZA()()),2&e){const n=t.oxw().$implicit;t.xp6(2),t.Oqu(null==n?null:n.Variants[0].Model),t.xp6(2),t.Oqu(null==n?null:n.Variants[0].Code)}}function B(e,a){if(1&e&&(t.TgZ(0,"div")(1,"span",34),t._uU(2),t.qZA(),t.TgZ(3,"span",33),t._uU(4),t.qZA(),t._UZ(5,"br"),t.qZA()),2&e){const n=t.oxw().$implicit;t.xp6(2),t.Oqu(null==n?null:n.Variants[0].Model),t.xp6(2),t.Oqu(null==n?null:n.Variants[0].Code)}}function W(e,a){if(1&e){const n=t.EpF();t.ynx(0),t.TgZ(1,"div",35)(2,"button",36),t.NdJ("click",function(){t.CHM(n);const i=t.oxw().$implicit,l=t.oxw();return t.KtG(l.openUploadModal(i))}),t._UZ(3,"i",5),t._uU(4," Upload"),t.qZA()(),t.BQk()}}function z(e,a){if(1&e&&(t.TgZ(0,"div",40)(1,"a",41),t._UZ(2,"img",42),t.qZA()()),2&e){const n=t.oxw().$implicit,o=t.oxw(3);t.xp6(1),t.s9C("href",n.Url,t.LSH),t.s9C("matTooltip",n.Title),t.xp6(1),t.Q6J("src",o.getChannelLogo(n),t.LSH)}}function X(e,a){if(1&e&&(t.ynx(0),t.YNc(1,z,3,3,"div",39),t.BQk()),2&e){const n=a.index;t.xp6(1),t.Q6J("ngIf",n<4)}}const tt=function(e){return{"border-bottom pb-2":e}};function nt(e,a){if(1&e&&(t.TgZ(0,"li")(1,"div",46)(2,"div",47)(3,"a",48),t._UZ(4,"img",49),t.TgZ(5,"span",50),t._uU(6),t.qZA()()()()()),2&e){const n=t.oxw(),o=n.index,i=n.$implicit,l=t.oxw(3).$implicit,s=t.oxw();t.xp6(2),t.Q6J("ngClass",t.VKq(4,tt,o!=s.sortVariant(null==l?null:l.Variants).length-1)),t.xp6(1),t.s9C("href",i.Url,t.LSH),t.xp6(1),t.Q6J("src",s.getChannelLogo(i),t.LSH),t.xp6(2),t.Oqu(i.Title)}}function et(e,a){if(1&e&&(t.ynx(0),t.YNc(1,nt,7,6,"li",23),t.BQk()),2&e){const n=a.index;t.xp6(1),t.Q6J("ngIf",n>3)}}function ot(e,a){if(1&e&&(t.TgZ(0,"div",40)(1,"div",43),t._UZ(2,"i",44),t.TgZ(3,"ul",45),t.YNc(4,et,2,1,"ng-container",38),t.qZA()()()),2&e){const n=t.oxw(2).$implicit,o=t.oxw();t.xp6(4),t.Q6J("ngForOf",o.sortVariant(null==n?null:n.Variants))}}function it(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"div",37),t.YNc(2,X,2,1,"ng-container",38),t.YNc(3,ot,5,1,"div",39),t.qZA(),t.BQk()),2&e){const n=t.oxw().$implicit,o=t.oxw();t.xp6(2),t.Q6J("ngForOf",o.sortVariant(null==n?null:n.Variants)),t.xp6(1),t.Q6J("ngIf",o.sortVariant(null==n?null:n.Variants).length>4)}}const at=function(){return{"no-title":"item?.Variants.length <= 1"}},lt=function(e,a){return{"justify-content-between":e,"justify-content-end":a}};function ct(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",12)(1,"div",13)(2,"div",14)(3,"div",15),t.YNc(4,E,1,1,"img",16),t.YNc(5,K,1,0,"img",17),t.qZA(),t.TgZ(6,"div",18)(7,"div",19)(8,"div",20)(9,"h4",21),t.NdJ("click",function(){const l=t.CHM(n).index,s=t.oxw();return t.KtG(s.DialogVariant(l))}),t._uU(10),t.qZA()(),t.YNc(11,G,2,1,"div",22),t.YNc(12,H,5,1,"ng-container",23),t.qZA(),t.TgZ(13,"div",24)(14,"div",25),t.YNc(15,j,5,2,"div",23),t.YNc(16,B,6,2,"div",23),t.qZA()()()(),t.TgZ(17,"div",26),t.YNc(18,W,5,0,"ng-container",23),t.YNc(19,it,4,2,"ng-container",23),t.qZA()()()}if(2&e){const n=a.$implicit,o=t.oxw();t.xp6(4),t.Q6J("ngIf",null==n?null:n.ImageUrl),t.xp6(1),t.Q6J("ngIf",!(null!=n&&n.ImageUrl)),t.xp6(4),t.Q6J("ngClass",t.DdM(11,at)),t.xp6(1),t.hij("",null==n?null:n.Name," "),t.xp6(1),t.Q6J("ngIf",(null==n?null:n.Channel.length)<o.Channel.length),t.xp6(1),t.Q6J("ngIf",(null==n?null:n.Variants.length)>1),t.xp6(3),t.Q6J("ngIf",(null==n?null:n.Variants.length)>1),t.xp6(1),t.Q6J("ngIf",1==(null==n?null:n.Variants.length)),t.xp6(1),t.Q6J("ngClass",t.WLB(12,lt,(null==n?null:n.Channel.length)<o.Channel.length,(null==n?null:n.Channel.length)==o.Channel.length)),t.xp6(1),t.Q6J("ngIf",(null==n?null:n.Channel.length)<o.Channel.length),t.xp6(1),t.Q6J("ngIf",(null==n?null:n.Channel.length)>0)}}let rt=(()=>{class e{constructor(n,o,i){this.http=n,this.toastr=o,this.dialog=i,this.filter=new u,this.total=0,this.loading=!1,this.syncupdatefull=!1,this.OptionVisible=!1,this.channelLogo=x,this.Load()}ngOnInit(){}Load(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.Channel=n.Options.Channel,this.filter.PageNumber=n.Filter.PageNumber,this.filter.RowCount=n.Filter.RowCount,this.filter.ChannelID=null,this.filter.sync=!0,this.TokopediaCategory=n.Options.Tokopedia,this.ShopeeCategory=n.Options.Shopee,this.GetProducts()})}GetProducts(){this.http.post("/api/product/GetInPOS",{PageNumber:this.filter.PageNumber,RowCount:this.filter.RowCount}).subscribe(o=>{this.data=o.Data,this.total=o.Total,this.paginationTotal=null==o.Total?this.filter.RowCount:o.Total.toString(),this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}SyncFast(){null!=this.filter.ChannelID?this.http.post("/api/product/ScanOptimized",{ID:this.filter.ChannelID,ScanFull:this.filter.ScanFull}).subscribe(o=>{this.GetProducts();let i=o.NotInPOS?o.NotInPOS.Product:0,l=o.InChannel?o.InChannel.Product:0;this.toastr.success(i+l+" found in "+this.getChannelName(this.filter.ChannelID)+"</br> ( "+l+" In POS + "+i+" Not In POS )","Scan Complete!",{timeOut:5e3,enableHtml:!0})}):this.toastr.error("Please Select Channel","Error")}SyncProductMap(){null!=this.filter.ChannelID?this.http.post("/api/product/SyncUpdateMap",{ID:this.filter.ChannelID}).subscribe(o=>{this.data=o.Data}).add(()=>{this.GetProducts()}):this.toastr.error("Please Select Channel","Error")}DialogVariant(n){this.dialogName=this.data[n].Name,this.variant=this.data[n].Variants,this.dialog.open($,{data:{title:this.data[n].Name,variants:this.data[n].Variants},width:"40%"})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.GetProducts()}SearchProduct(n){this.http.post("/api/product/GetInPOS",{Text:n}).subscribe(i=>{this.data=i.Data})}openUploadModal(n){let o;this.selectedItem=n,o=0==n.Channel.length?this.Channel:this.Channel.filter(i=>!n.Channel.some(l=>i.ID==l.ChannelID)),this.dialog.open(m,{width:"600px",data:{item:n,selectedItemMissingChannel:o}}).afterClosed().subscribe(i=>{if(i){let l=i.channelID,s=i.categoryID,f=[];f.push(this.selectedItem.ID),this.uploadProduct(l,f,s)}})}openUploadBulkModal(){this.dialog.open(m,{width:"350px",data:{item:null,selectedItemMissingChannel:this.Channel}}).afterClosed().subscribe(n=>{if(n){let l=n.channelID,s=n.categoryID;var o=this.getSelected();if(o.length>0){var i=[];o.forEach(f=>i.push(f.ID)),this.uploadProduct(l,i,s)}}})}uploadProduct(n,o,i){this.http.post("/api/product/UploadToMarketplace",{ChannelID:n,Products:o,CategoryID:i||0}).subscribe(s=>{this.GetProducts();let f=this.Channel.find(fn=>fn.ID==n);this.toastr.success(o.length>1?"Successfully uploaded "+o.length+" Product to channel "+f.Name:this.selectedItem.Name+" Successfully Created","Success")})}sortVariant(n){var o=[];for(let i of n)if(null!=i.Channel)for(let l of i.Channel)0==o.filter(s=>s.ChannelID==l.ChannelID).length&&o.push(l);return this.sortChannel(o)}sortChannel(n){return n.sort((o,i)=>o.TypeID<i.TypeID?1:o.TypeID===i.TypeID?0:-1)}openScanDialog(){this.dialog.open(h.j,{data:{filter:this.filter,Channel:this.Channel},width:"30%"}).afterClosed().subscribe(o=>{null!=o&&(this.filter=o.filter,this.filter.sync?this.SyncFast():this.filter.sync||this.SyncFast())})}openScanSingleDialog(){this.dialog.open(h.j,{data:{filter:this.filter,Channel:this.Channel.filter(o=>1==o.TypeID)},width:"30%"}).afterClosed().subscribe(o=>{null!=o&&this.ScanSingle()})}ScanSingle(){if(null!=this.filter.ChannelID){var n=[],o=this.getSelected();if(o.length>0)for(const l of o)for(let s of l.Variants)n.push(s.Code);this.http.post("/api/product/ScanSingle",{ID:this.filter.ChannelID,SKU:n}).subscribe(l=>{this.GetProducts(),l?this.toastr.success("Successfully Scan ","Success"):this.toastr.error("This product is not existed in Tokopedia ","Error")})}else this.toastr.error("Please Select Channel","Error")}getSelected(){return this.data?this.data.filter(n=>n.selected):[]}hasSelection(){return!!this.data&&this.getSelected().length>0}getChannelName(n){return this.Channel.find(i=>i.ID==n).Name}getChannelLogo(n){let o;switch(n.TypeID){case 0:case 5:o=x.SHOOPE;break;case 1:o=x.TOKOPEDIA;break;case 2:o=x.WOOCOMMERCE;break;case 6:o=x.TIKTOK}return o}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(g.O),t.Y36(S._W),t.Y36(r.uw))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-in-pos"]],decls:18,vars:7,consts:[["hideSearchDropdown","true","hideSearchDropdown","false",3,"Title","onSubmit"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"hidden","click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"hidden","click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"length","pageSize","pageIndex","page"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"card","product"],[1,"row","h-100","g-0","px-6"],[1,"col-auto","pe-xl-0"],["class","border rounded-lg mx-auto text-center mt-5","style","width: 82px;; ",3,"src",4,"ngIf"],["class"," text-center border rounded-lg mx-auto mt-5","style","width: 82px;;","src","//res.cloudinary.com/pos/image/upload/w_80/POS/Images/Icon/products_thumb.png",4,"ngIf"],[1,"col","mt-5","px-xl-0","px-0"],[1,"row","align-items-center","justify-content-start"],[1,"col-auto","pt-0","pe-4","max-w-xl"],[1,"text-start","itemTitle","pointer",3,"ngClass","click"],["class","col text-end gx-0",4,"ngIf"],[4,"ngIf"],[1,"row"],[1,"col-12"],[1,"row","mt-5","bottom-buttons",3,"ngClass"],[1,"border","rounded-lg","mx-auto","text-center","mt-5",2,"width","82px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_80/POS/Images/Icon/products_thumb.png",1,"text-center","border","rounded-lg","mx-auto","mt-5",2,"width","82px"],[1,"col","text-end","gx-0"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"col-auto","gx-0"],[1,"badge","rounded-pill","bg-warning","m-2","text-dark"],[1,"d-block","default"],[1,"d-none","default"],[1,"col-auto","mb-upload"],[1,"btn","btn-light","btn-sm",3,"click"],[1,"row","me-0","me-md-5","justify-content-end","align-items-center","gx-0","w-auto"],[4,"ngFor","ngForOf"],["class","col-auto px-1 px-md-3 mb-1 pb-3",4,"ngIf"],[1,"col-auto","px-1","px-md-3","mb-1","pb-3"],["target","_blank","data-placement","top",3,"href","matTooltip"],[3,"src"],[1,"btn-group"],["id","moreMenu","data-bs-toggle","dropdown",1,"fas","fa-ellipsis-h","fs-4","cursor-pointer"],["aria-labelledby","moreMenu",1,"dropdown-menu"],[1,"dropdown-item","py-2",2,"cursor","pointer"],[3,"ngClass"],["target","_blank",3,"href"],[1,"img-logo",3,"src"],[1,"ms-4"]],template:function(n,o){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return o.SearchProduct(l)}),t.TgZ(1,"actions")(2,"button",1),t.NdJ("click",function(){return o.openScanDialog()}),t._UZ(3,"i",2),t._uU(4," Scan Channel "),t.qZA(),t.TgZ(5,"button",3),t.NdJ("click",function(){return o.openScanSingleDialog()}),t._UZ(6,"i",2),t._uU(7," Scan Single Channel "),t.qZA(),t.TgZ(8,"button",4),t.NdJ("click",function(){return o.openUploadBulkModal()}),t._UZ(9,"i",5),t._uU(10," Upload Bulk"),t.qZA()(),t.TgZ(11,"content")(12,"div",6)(13,"div",7),t.YNc(14,ct,20,15,"div",8),t.qZA(),t.TgZ(15,"div",9)(16,"div",10)(17,"mat-paginator",11),t.NdJ("page",function(l){return o.changePage(l)}),t.qZA()()()()()()),2&n&&(t.Q6J("Title","In POS ("+o.total+")"),t.xp6(5),t.Q6J("hidden",!o.hasSelection()),t.xp6(3),t.Q6J("hidden",!o.hasSelection()),t.xp6(6),t.Q6J("ngForOf",o.data),t.xp6(3),t.Q6J("length",o.paginationTotal)("pageSize",o.paginationPageSize)("pageIndex",0==(null==o.filter?null:o.filter.PageNumber)?0:(null==o.filter?null:o.filter.PageNumber)-1))},dependencies:[d.mk,d.sg,d.O5,c.Wl,c.JJ,c.On,N.gM,O.p],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.img-logo[_ngcontent-%COMP%]{height:30px;width:30px}"]}),e})();function st(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"tr")(2,"td",4),t._uU(3),t.qZA(),t.TgZ(4,"td",4),t._uU(5),t.qZA(),t.TgZ(6,"td",8)(7,"p",9),t._uU(8,"Product Not in Channel!"),t.qZA()()(),t.BQk()),2&e){const n=t.oxw().$implicit;t.xp6(3),t.hij(" ",null==n?null:n.Model,""),t.xp6(2),t.hij(" ",null==n?null:n.Code,"")}}function pt(e,a){if(1&e&&(t.TgZ(0,"td",4),t._uU(1),t.qZA()),2&e){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Model,"")}}function dt(e,a){if(1&e&&(t.TgZ(0,"td",4),t._uU(1),t.qZA()),2&e){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Code,"")}}function gt(e,a){1&e&&t._UZ(0,"img",16)}function mt(e,a){1&e&&t._UZ(0,"img",17)}function ut(e,a){1&e&&t._UZ(0,"img",18)}function _t(e,a){1&e&&t._UZ(0,"img",19)}function ht(e,a){if(1&e&&(t.TgZ(0,"tr")(1,"td",4),t._uU(2),t.qZA(),t.YNc(3,pt,2,2,"td",10),t.YNc(4,dt,2,2,"td",10),t.TgZ(5,"td",4),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",4),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",4)(12,"a",11),t.YNc(13,gt,1,0,"img",12),t.YNc(14,mt,1,0,"img",13),t.YNc(15,ut,1,0,"img",14),t.YNc(16,_t,1,0,"img",15),t.qZA()()()),2&e){const n=a.$implicit,o=a.index;t.xp6(2),t.Oqu(n.Name),t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(2),t.Oqu(t.lcZ(7,11,n.Price)),t.xp6(3),t.Oqu(t.lcZ(10,13,n.Inventory)),t.xp6(3),t.s9C("href",n.Url,t.LSH),t.s9C("title",n.Title),t.xp6(1),t.Q6J("ngIf",1==n.TypeID),t.xp6(1),t.Q6J("ngIf",0==n.TypeID||5==n.TypeID),t.xp6(1),t.Q6J("ngIf",2==n.TypeID),t.xp6(1),t.Q6J("ngIf",6==n.TypeID)}}function ft(e,a){if(1&e&&t.YNc(0,ht,17,15,"tr",5),2&e){const n=t.oxw().$implicit;t.Q6J("ngForOf",null==n?null:n.Channel)}}function Ct(e,a){if(1&e&&(t.ynx(0),t.YNc(1,st,9,2,"ng-container",6),t.YNc(2,ft,1,1,"ng-template",null,7,t.W1O),t.BQk()),2&e){const n=a.$implicit,o=t.MAs(3);t.xp6(1),t.Q6J("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",o)}}let xt=(()=>{class e{constructor(n){this.data=n,this.title=n.title,this.variants=n.variants}ngOnInit(){}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(r.WI))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-modal-variant-list"]],decls:22,vars:2,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"pb-5","mx-0"],[1,"table","border-bottom"],[1,"thead-light"],[1,"text-center"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-center",4,"ngIf"],["target","_blank",3,"href","title"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"],["src","https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp"],["src","https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png"]],template:function(n,o){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"table",2)(5,"thead",3)(6,"tr")(7,"th",4),t._uU(8,"PRODUCT"),t.qZA(),t.TgZ(9,"th",4),t._uU(10,"VARIANT"),t.qZA(),t.TgZ(11,"th",4),t._uU(12,"SKU"),t.qZA(),t.TgZ(13,"th",4),t._uU(14,"PRICE"),t.qZA(),t.TgZ(15,"th",4),t._uU(16,"INVENTORY"),t.qZA(),t.TgZ(17,"th",4),t._uU(18,"CHANNEL"),t.qZA()()(),t.TgZ(19,"tbody"),t.YNc(20,Ct,4,2,"ng-container",5),t.qZA()()(),t._UZ(21,"hr")),2&n&&(t.xp6(1),t.Oqu(o.title),t.xp6(19),t.Q6J("ngForOf",o.variants))},dependencies:[d.sg,d.O5,r.uh,r.xY,d.JJ],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),e})();function bt(e,a){if(1&e&&t._UZ(0,"img",24),2&e){const n=t.oxw().$implicit;t.s9C("src",null==n?null:n.ImageUrl,t.LSH)}}function It(e,a){1&e&&t._UZ(0,"img",25)}function Tt(e,a){if(1&e&&(t.TgZ(0,"span",26),t._uU(1),t.qZA()),2&e){const n=t.oxw().$implicit;t.xp6(1),t.hij(" ",null==n?null:n.Variants.length,"")}}function Zt(e,a){if(1&e&&(t.TgZ(0,"div")(1,"span",27),t._uU(2),t.qZA(),t.TgZ(3,"span",27),t._uU(4),t.qZA()()),2&e){const n=t.oxw().$implicit;t.xp6(2),t.Oqu(null==n?null:n.Variants[0].Model),t.xp6(2),t.Oqu(null==n?null:n.Variants[0].Code)}}function Pt(e,a){if(1&e&&(t.TgZ(0,"div")(1,"span",28),t._uU(2),t.qZA(),t.TgZ(3,"span",27),t._uU(4),t.qZA()()),2&e){const n=t.oxw().$implicit;t.xp6(2),t.Oqu(null==n?null:n.Variants[0].Model),t.xp6(2),t.Oqu(null==n?null:n.Variants[0].Code)}}function vt(e,a){if(1&e&&(t.TgZ(0,"a",32),t._UZ(1,"img",33),t.qZA()),2&e){const n=t.oxw().$implicit;t.s9C("href",n.Url,t.LSH)}}function Ot(e,a){if(1&e&&(t.TgZ(0,"a",32),t._UZ(1,"img",34),t.qZA()),2&e){const n=t.oxw().$implicit;t.s9C("href",n.Url,t.LSH)}}function yt(e,a){if(1&e&&(t.TgZ(0,"a",32),t._UZ(1,"img",35),t.qZA()),2&e){const n=t.oxw().$implicit;t.s9C("href",n.Url,t.LSH)}}function Mt(e,a){if(1&e&&(t.TgZ(0,"a",36),t._UZ(1,"img",37),t.qZA()),2&e){const n=t.oxw().$implicit;t.s9C("href",n.Url,t.LSH),t.s9C("matTooltip",n.Title)}}function St(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"div",29),t.YNc(2,vt,2,1,"a",30),t.YNc(3,Ot,2,1,"a",30),t.YNc(4,yt,2,1,"a",30),t.YNc(5,Mt,2,2,"a",31),t.qZA(),t.BQk()),2&e){const n=a.$implicit;t.xp6(2),t.Q6J("ngIf",0==n.TypeID||5==n.TypeID),t.xp6(1),t.Q6J("ngIf",1==n.TypeID),t.xp6(1),t.Q6J("ngIf",2==n.TypeID),t.xp6(1),t.Q6J("ngIf",6==n.TypeID)}}const wt=function(){return{"no-title":"item?.Variants.length <= 1"}};function Nt(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",6)(1,"div",7)(2,"div",8)(3,"div",9),t.YNc(4,bt,1,1,"img",10),t.YNc(5,It,1,0,"img",11),t.qZA(),t.TgZ(6,"div",12)(7,"div",13)(8,"div",14)(9,"a",15),t.NdJ("click",function(){const l=t.CHM(n).index,s=t.oxw();return t.KtG(s.DialogVariant(l))}),t.TgZ(10,"h4",16),t._uU(11),t.qZA()()(),t.TgZ(12,"div",17)(13,"h4"),t.YNc(14,Tt,2,1,"span",18),t.qZA()()(),t.TgZ(15,"div",19)(16,"div",20),t.YNc(17,Zt,5,2,"div",21),t.YNc(18,Pt,5,2,"div",21),t.qZA()()()(),t.TgZ(19,"div",22),t.YNc(20,St,6,4,"ng-container",23),t.qZA()()()}if(2&e){const n=a.$implicit,o=t.oxw();t.xp6(4),t.Q6J("ngIf",null==n?null:n.ImageUrl),t.xp6(1),t.Q6J("ngIf",!(null!=n&&n.ImageUrl)),t.xp6(5),t.Q6J("ngClass",t.DdM(8,wt)),t.xp6(1),t.hij("",null==n?null:n.Name," "),t.xp6(3),t.Q6J("ngIf",(null==n?null:n.Variants.length)>1),t.xp6(3),t.Q6J("ngIf",(null==n?null:n.Variants.length)>1),t.xp6(1),t.Q6J("ngIf",1==(null==n?null:n.Variants.length)),t.xp6(2),t.Q6J("ngForOf",o.sortVariant(null==n?null:n.Variants))}}let Ut=(()=>{class e{constructor(n,o,i){this.http=n,this.dialog=o,this.toastr=i,this.filter=new u,this.loading=!1,this.syncupdatefull=!1,this.Load(),this.GetProducts()}ngOnInit(){}Load(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.Channel=n.Options.Channel,this.filter=n.Filter,this.filter.ChannelID=null,this.filter.sync=!1,this.filter.mode=1})}GetProducts(){this.http.post("/api/product/GetSoldInChannel",{}).subscribe(n=>{this.data=n.Data,this.temp=n.Data})}SearchProduct(n){if(""!=n){let i=this.temp.filter(l=>-1!==l.Name.toLowerCase().indexOf(n.toLowerCase()));if(0==i.length)for(let l of this.temp)l.Variants.filter(s=>-1!==s.Code.toLowerCase().indexOf(n.toLowerCase())).length>0&&i.push(l);this.data=i}else this.data=this.temp}SyncProduct(){null!==this.filter.ChannelID&&null!=this.filter.mode?this.http.post("/api/product/ScanOptimized",{ID:this.filter.ChannelID,ScanFull:this.filter.ScanFull}).subscribe(o=>{let i=o.NotInPOS?o.NotInPOS.Product:0,l=o.InChannel?o.InChannel.Product:0;this.toastr.success(i+l+" found in "+this.getChannelName(this.filter.ChannelID)+"</br> ( "+l+" In POS + "+i+" Not In POS )","Scan Complete!",{timeOut:5e3,enableHtml:!0})}).add(()=>{this.GetProducts()}):alert("Please select channel")}SyncProductMap(){this.http.post("/api/product/SyncUpdateMap",{ID:this.filter.ChannelID}).subscribe(o=>{this.data=o.Data}).add(()=>{this.GetProducts()})}DialogVariant(n){this.variant=this.data[n].Variants,this.dialogName=this.data[n].Name,this.dialog.open(xt,{data:{variants:this.variant,title:this.data[n].Name},width:"40%"})}sortVariant(n){var o=[];for(let i of n)if(null!=i.Channel)for(let l of i.Channel)0==o.filter(s=>s.ChannelID==l.ChannelID).length&&o.push(l);return this.sortChannel(o)}sortChannel(n){return n.sort((o,i)=>o.TypeID<i.TypeID?1:o.TypeID===i.TypeID?0:-1)}openScanDialog(){this.dialog.open(h.j,{data:{filter:this.filter,Channel:this.Channel},width:"40%"}).afterClosed().subscribe(o=>{null!=o&&(this.filter=o.filter,this.SyncProduct())})}getChannelName(n){return this.Channel.find(i=>i.ID==n).Name}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(g.O),t.Y36(r.uw),t.Y36(S._W))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-sold-in-channel"]],decls:9,vars:2,consts:[["hideSearchDropdown","false",3,"Title","onSubmit"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"card","product"],[1,"row","h-100","gx-0","px-6"],[1,"col-auto","pe-xl-0"],["class","border rounded-lg mx-auto text-center mt-5","style","width: 80px;max-height:80px; ",3,"src",4,"ngIf"],["class"," text-center border rounded-lg mx-auto mt-5","style","width: 80px;max-height:80px;","src","//res.cloudinary.com/pos/image/upload/w_80/POS/Images/Icon/products_thumb.png",4,"ngIf"],[1,"col","mt-5","px-xl-0"],[1,"row","align-items-center","justify-content-start"],[1,"col-auto","pt-0","pe-4","max-w-xl"],["role","button",1,"text-start",3,"click"],[1,"itemTitle",3,"ngClass"],[1,"col-auto","px-0"],["class","badge badge-pill bg-warning m-2",4,"ngIf"],[1,"row"],[1,"col-12"],[4,"ngIf"],[1,"row","bottom-buttons","me-0","me-md-5","justify-content-end"],[4,"ngFor","ngForOf"],[1,"border","rounded-lg","mx-auto","text-center","mt-5",2,"width","80px","max-height","80px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_80/POS/Images/Icon/products_thumb.png",1,"text-center","border","rounded-lg","mx-auto","mt-5",2,"width","80px","max-height","80px"],[1,"badge","badge-pill","bg-warning","m-2"],[1,"d-block","default"],[1,"d-none","default"],[1,"col-auto","px-1","px-md-3","mt-5","mb-1","pb-3"],["target","_blank",3,"href",4,"ngIf"],["target","_blank","data-placement","top",3,"href","matTooltip",4,"ngIf"],["target","_blank",3,"href"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp"],["target","_blank","data-placement","top",3,"href","matTooltip"],["src","https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png"]],template:function(n,o){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return o.SearchProduct(l)}),t.TgZ(1,"actions")(2,"button",1),t.NdJ("click",function(){return o.openScanDialog()}),t._UZ(3,"i",2),t._uU(4," Scan Channel "),t.qZA()(),t.TgZ(5,"content")(6,"div",3)(7,"div",4),t.YNc(8,Nt,21,9,"div",5),t.qZA()()()()),2&n&&(t.Q6J("Title","Sold in Channel ("+(o.data?o.data.length:"0")+")"),t.xp6(8),t.Q6J("ngForOf",o.data))},dependencies:[d.mk,d.sg,d.O5,N.gM,O.p],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}"]}),e})();function Dt(e,a){if(1&e&&t._UZ(0,"img",16),2&e){const n=t.oxw().$implicit;t.s9C("src",null==n?null:n.ImageUrl,t.LSH)}}function kt(e,a){1&e&&t._UZ(0,"img",17)}function At(e,a){if(1&e&&(t.TgZ(0,"li"),t._uU(1),t.qZA()),2&e){const n=a.$implicit;t.xp6(1),t.Oqu(null==n?null:n.Model)}}function Jt(e,a){if(1&e&&(t.TgZ(0,"li"),t._uU(1),t.qZA()),2&e){const n=a.$implicit;t.xp6(1),t.Oqu(null==n?null:n.Title)}}function qt(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"tbody")(1,"tr")(2,"td",10),t.YNc(3,Dt,1,1,"img",11),t.YNc(4,kt,1,0,"ng-template",null,12,t.W1O),t.TgZ(6,"h4",13),t._uU(7),t.qZA()(),t.TgZ(8,"td"),t._uU(9),t.qZA(),t.TgZ(10,"td"),t._uU(11),t.qZA(),t.TgZ(12,"td")(13,"ul"),t.YNc(14,At,2,1,"li",9),t.qZA()(),t.TgZ(15,"td")(16,"ul"),t.YNc(17,Jt,2,1,"li",9),t.qZA()(),t.TgZ(18,"td")(19,"button",14),t.NdJ("click",function(){const l=t.CHM(n).$implicit,s=t.oxw();return t.KtG(s.openUploadModal(l))}),t._UZ(20,"i",15),t._uU(21," Upload"),t.qZA()()()()}if(2&e){const n=a.$implicit,o=t.MAs(5);t.xp6(3),t.Q6J("ngIf",null==n?null:n.ImageUrl)("ngIfElse",o),t.xp6(4),t.Oqu(null==n?null:n.Name),t.xp6(2),t.Oqu(null==n?null:n.Category),t.xp6(2),t.Oqu(null==n?null:n.Code),t.xp6(3),t.Q6J("ngForOf",n.Variants),t.xp6(3),t.Q6J("ngForOf",n.Channel)}}let Qt=(()=>{class e{constructor(n,o,i){this.http=n,this.dialog=o,this.toastr=i,this.filter=new u,this.loading=!1,this.Load(),this.GetProducts()}ngOnInit(){}Load(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.Channel=n.Options.Channel,this.filter=n.Filter,this.filter.ChannelID=null,this.filter.sync=!0})}GetProducts(){this.http.post("/api/product/GetNotInChannel",{sync:!1}).subscribe(n=>{this.data=n.Data,this.temp=n.Data})}SearchProduct(n){this.data=""!=n?this.temp.filter(o=>-1!==o.Name.toLowerCase().indexOf(n.toLowerCase())):this.temp}SyncProduct(){this.http.post("/api/product/ScanNotinChannel",{ID:this.filter.ChannelID}).subscribe(o=>{let i=o.NotInChannel?o.NotInChannel.Product:0,l=o.InChannel?o.InChannel.Product:0;this.toastr.success(i+l+" found in "+this.getChannelName(this.filter.ChannelID)+"</br> ( "+l+" In POS + "+i+" Not In Channel )","Scan Complete!",{timeOut:5e3,enableHtml:!0})}).add(()=>{this.GetProducts()})}openScanDialog(){this.dialog.open(h.j,{data:{filter:this.filter,Channel:this.Channel,hiddenRadioButton:!0},width:"30%"}).afterClosed().subscribe(o=>{null!=o&&(this.filter=o.filter,this.SyncProduct())})}filterChannel(n){let i,o=n.Channel?n.Channel:[];return this.Channel.filter(s=>(i=o.findIndex(f=>f.ChannelID===s.ID),-1!==i))}openUploadModal(n){this.selectedItem=n;let o=this.filterChannel(n);this.dialog.open(m,{width:"350px",data:{item:n,selectedItemMissingChannel:o}}).afterClosed().subscribe(i=>{i&&this.uploadProduct(i.channelID,this.selectedItem.ID)})}uploadProduct(n,o){this.http.post("/api/product/UploadToMarketplace",{ChannelID:n,Products:[o]}).subscribe(l=>{this.GetProducts(),this.toastr.success("Successfully uploaded "+this.selectedItem.Name+" to "+this.getChannelName(n),"Success")})}getChannelName(n){return this.Channel.find(i=>i.ID==n).Name}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(g.O),t.Y36(r.uw),t.Y36(S._W))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-not-in-channel"]],decls:25,vars:2,consts:[["hideSearchDropdown","false",3,"Title","onSubmit"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"ms-5"],[4,"ngFor","ngForOf"],[1,"text-start"],["class","border rounded","style","width: 40px;",3,"src",4,"ngIf","ngIfElse"],["elsePic",""],[1,"ms-5","d-inline","fw-normal"],[1,"btn","btn-link","btn-sm",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"border","rounded",2,"width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"]],template:function(n,o){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return o.SearchProduct(l)}),t.TgZ(1,"actions")(2,"button",1),t.NdJ("click",function(){return o.openScanDialog()}),t._UZ(3,"i",2),t._uU(4," Scan Channel "),t.qZA()(),t.TgZ(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),t._uU(13,"Product"),t.qZA(),t.TgZ(14,"th"),t._uU(15,"Category"),t.qZA(),t.TgZ(16,"th"),t._uU(17,"SKU"),t.qZA(),t.TgZ(18,"th"),t._uU(19,"Variant"),t.qZA(),t.TgZ(20,"th"),t._uU(21,"Missing Channel"),t.qZA(),t.TgZ(22,"th"),t._uU(23,"Actions"),t.qZA()()(),t.YNc(24,qt,22,7,"tbody",9),t.qZA()()()()()()),2&n&&(t.Q6J("Title","Not in Channel ("+(o.data?o.data.length:"0")+")"),t.xp6(24),t.Q6J("ngForOf",o.data))},dependencies:[d.sg,d.O5,O.p],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}thead[_ngcontent-%COMP%]{position:sticky;top:0}"]}),e})();var A=p(1948);let Vt=(()=>{class e{constructor(n,o){this.data=n,this._dialogRef=o,this.downloadType=0}ngOnInit(){}submit(){this._dialogRef.close(this.downloadType)}close(){this._dialogRef.close()}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(r.WI),t.Y36(r.so))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-modal-download"]],decls:18,vars:4,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0"],[1,"mb-3","fw-normal"],[3,"ngModel","ngModelChange"],["data-toggle","tooltip","title","Download all products not in POS",1,"me-5",3,"value"],["data-toggle","tootip","title","Download only the selected product",1,"me-5","mt-3",3,"value","disabled"],[1,"justify-content-end","mx-4"],["mat-button","",1,"btn","btn-light","mx-3",3,"click"],["mat-button","","data-cy","scan",1,"btn","btn-success","mx-3",3,"click"]],template:function(n,o){1&n&&(t.TgZ(0,"h1",0),t._uU(1,"Download Products to POS"),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"h5",2),t._uU(5,"Choose download method :"),t.qZA(),t.TgZ(6,"mat-radio-group",3),t.NdJ("ngModelChange",function(l){return o.downloadType=l}),t.TgZ(7,"mat-radio-button",4),t._uU(8," All Products "),t.qZA(),t._UZ(9,"br"),t.TgZ(10,"mat-radio-button",5),t._uU(11," Selected Products "),t.qZA()()(),t._UZ(12,"hr"),t.TgZ(13,"mat-dialog-actions",6)(14,"button",7),t.NdJ("click",function(){return o.close()}),t._uU(15," Cancel "),t.qZA(),t.TgZ(16,"button",8),t.NdJ("click",function(){return o.submit()}),t._uU(17," Save "),t.qZA()()),2&n&&(t.xp6(6),t.Q6J("ngModel",o.downloadType),t.xp6(1),t.Q6J("value",0),t.xp6(3),t.Q6J("value",1)("disabled",!o.data.hasSelection))},dependencies:[c.JJ,c.On,r.uh,r.xY,r.H8,A.VQ,A.U0],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]}),e})();function Yt(e,a){1&e&&(t.TgZ(0,"a",6)(1,"b"),t._uU(2,"seller.shopee.co.id "),t.qZA(),t._UZ(3,"i",7),t.qZA())}function Ft(e,a){1&e&&(t.TgZ(0,"a",8)(1,"b"),t._uU(2,"seller.tokopedia.com "),t.qZA(),t._UZ(3,"i",7),t.qZA())}let Lt=(()=>{class e{constructor(n){this.data=n,this.dialogName=n.name,this.type=n.type}ngOnInit(){}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(r.WI))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-modal-instruction"]],decls:24,vars:3,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0"],[1,"me-5","mt-5","text-larger"],[1,"mb-5"],["href","http://seller.shopee.co.id","target","_blank",4,"ngIf"],["href","http://seller.tokopedia.com","target","_blank",4,"ngIf"],["href","http://seller.shopee.co.id","target","_blank"],[1,"fas","fa-sm","fa-external-link-alt"],["href","http://seller.tokopedia.com","target","_blank"]],template:function(n,o){1&n&&(t.TgZ(0,"h1",0),t._uU(1,"Download Products to POS"),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"ol",2)(5,"li",3),t._uU(6," Go to Seller Marketplace account"),t._UZ(7,"br"),t.YNc(8,Yt,4,0,"a",4),t.YNc(9,Ft,4,0,"a",5),t.qZA(),t.TgZ(10,"li",3),t._uU(11," Input SKU (Stock Keeping Unit) for "),t._UZ(12,"br"),t.TgZ(13,"b"),t._uU(14),t.qZA()(),t.TgZ(15,"li",3),t._uU(16,"Press "),t.TgZ(17,"b"),t._uU(18,'"Scan"'),t.qZA(),t._uU(19," channel again"),t.qZA(),t.TgZ(20,"li",3)(21,"b"),t._uU(22,'"Download"'),t.qZA(),t._uU(23," button will now be available"),t.qZA()()()),2&n&&(t.xp6(8),t.Q6J("ngIf",0==o.type),t.xp6(1),t.Q6J("ngIf",1==o.type),t.xp6(5),t.Oqu(o.dialogName))},dependencies:[d.O5,r.uh,r.xY],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.text-larger[_ngcontent-%COMP%]{font-size:larger}"]}),e})();var U=p(8796);function Rt(e,a){if(1&e&&t._UZ(0,"img",30),2&e){const n=t.oxw().$implicit;t.s9C("src",null==n?null:n.Image,t.LSH)}}function $t(e,a){1&e&&t._UZ(0,"img",31)}function Et(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",32)(1,"input",33),t.NdJ("ngModelChange",function(i){t.CHM(n);const l=t.oxw().$implicit;return t.KtG(l.selected=i)}),t.qZA()()}if(2&e){const n=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",n.selected)}}function Kt(e,a){if(1&e&&(t.ynx(0),t._uU(1),t.BQk()),2&e){const n=t.oxw(2).$implicit;t.xp6(1),t.hij(" ",n.ChannelItemSKU," ")}}const D=function(e){return{"border-0":e}};function Gt(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"div",34)(2,"table",35)(3,"tbody")(4,"tr")(5,"td",36),t.YNc(6,Kt,2,1,"ng-container",24),t.qZA()()()()(),t.BQk()),2&e){const n=t.oxw().$implicit;t.xp6(5),t.Q6J("ngClass",t.VKq(2,D,null==n.ChannelItemSKU)),t.xp6(1),t.Q6J("ngIf",null!=n.ChannelItemSKU)}}function Ht(e,a){if(1&e&&(t.ynx(0),t._uU(1),t.BQk()),2&e){const n=t.oxw().$implicit;t.xp6(1),t.hij(" ",n.Name," ")}}function jt(e,a){if(1&e&&(t.ynx(0),t._uU(1),t.BQk()),2&e){const n=t.oxw().$implicit;t.xp6(1),t.hij(" ",n.ChannelVariationSKU," ")}}function Bt(e,a){if(1&e&&(t.TgZ(0,"tr")(1,"td",38),t.YNc(2,Ht,2,1,"ng-container",24),t.qZA(),t.TgZ(3,"td",39),t.YNc(4,jt,2,1,"ng-container",24),t.qZA()()),2&e){const n=a.$implicit,o=t.oxw(2).$implicit;t.xp6(1),t.Q6J("ngClass",t.VKq(4,D,null==n.Name)),t.xp6(1),t.Q6J("ngIf",null!=n.Name&&o.Variant.length>1),t.xp6(1),t.Q6J("ngClass",t.VKq(6,D,null==n.ChannelVariationSKU)),t.xp6(1),t.Q6J("ngIf",null!=n.ChannelVariationSKU)}}function Wt(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"div",34)(2,"table",35)(3,"tbody"),t.YNc(4,Bt,5,8,"tr",37),t.qZA()()(),t.BQk()),2&e){const n=t.oxw().$implicit;t.xp6(4),t.Q6J("ngForOf",n.Variant)}}function zt(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",40),t.NdJ("click",function(){t.CHM(n);const i=t.oxw().$implicit,l=t.oxw();return t.KtG(l.RetrieveData(i))}),t._UZ(1,"i",41),t._uU(2," Download "),t.qZA()}}function Xt(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",42),t.NdJ("click",function(){t.CHM(n);const i=t.oxw().$implicit,l=t.oxw();return t.KtG(l.openInstruction(i))}),t._UZ(1,"i",43),t._uU(2," No SKU "),t.qZA()}}function tn(e,a){if(1&e&&(t.TgZ(0,"a",46),t._UZ(1,"img",47),t.qZA()),2&e){const n=t.oxw(2).$implicit;t.s9C("href",(null==n?null:n.Variant.length)>0?null==n||null==n.Variant[0]?null:n.Variant[0].URL:n.Url,t.LSH)}}function nn(e,a){if(1&e&&(t.TgZ(0,"a",46),t._UZ(1,"img",48),t.qZA()),2&e){const n=t.oxw(2).$implicit;t.s9C("href",(null==n?null:n.Variant.length)>0?null==n||null==n.Variant[0]?null:n.Variant[0].URL:n.Url,t.LSH)}}function en(e,a){if(1&e&&(t.TgZ(0,"a",46),t._UZ(1,"img",49),t.qZA()),2&e){const n=t.oxw(2).$implicit;t.s9C("href",(null==n?null:n.Variant.length)>0?null==n||null==n.Variant[0]?null:n.Variant[0].URL:n.Url,t.LSH)}}function on(e,a){if(1&e&&(t.TgZ(0,"a",46),t._UZ(1,"img",50),t.qZA()),2&e){const n=t.oxw(2).$implicit;t.s9C("href",(null==n?null:n.Variant.length)>0?null==n||null==n.Variant[0]?null:n.Variant[0].URL:n.Url,t.LSH)}}function an(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"div",44),t.YNc(2,tn,2,1,"a",45),t.YNc(3,nn,2,1,"a",45),t.YNc(4,en,2,1,"a",45),t.YNc(5,on,2,1,"a",45),t.qZA(),t.BQk()),2&e){const n=t.oxw(2);t.xp6(2),t.Q6J("ngIf",0==n.ch.TypeID),t.xp6(1),t.Q6J("ngIf",1==n.ch.TypeID),t.xp6(1),t.Q6J("ngIf",2==n.ch.TypeID),t.xp6(1),t.Q6J("ngIf",6==n.ch.TypeID)}}const ln=function(e){return{itemTitle:e}};function cn(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",11)(1,"div",12)(2,"div",13)(3,"div",14),t.YNc(4,Rt,1,1,"img",15),t.YNc(5,$t,1,0,"img",16),t.qZA(),t.TgZ(6,"div",17)(7,"div",18)(8,"div",19)(9,"h4",20),t.NdJ("click",function(){const l=t.CHM(n).$implicit,s=t.oxw();return t.KtG(s.showFullTitle(l))}),t.qZA()(),t.YNc(10,Et,2,1,"div",21),t.qZA(),t.TgZ(11,"div",22)(12,"div",23),t.YNc(13,Gt,7,4,"ng-container",24),t.YNc(14,Wt,5,1,"ng-container",24),t.qZA()()()(),t.TgZ(15,"div",25)(16,"div",26),t.YNc(17,zt,3,0,"button",27),t.YNc(18,Xt,3,0,"ng-template",null,28,t.W1O),t.qZA(),t.TgZ(20,"div",29),t.YNc(21,an,6,4,"ng-container",24),t.qZA()()()()}if(2&e){const n=a.$implicit,o=t.oxw();t.xp6(4),t.Q6J("ngIf",null==n?null:n.Image),t.xp6(1),t.Q6J("ngIf",!(null!=n&&n.Image)),t.xp6(4),t.Q6J("ngClass",t.VKq(9,ln,!n.fullTitle))("innerHTML",null==n?null:n.Name,t.oJD),t.xp6(1),t.Q6J("ngIf",n.upload),t.xp6(3),t.Q6J("ngIf",n.Variant.length<1),t.xp6(1),t.Q6J("ngIf",null!=n.Variant),t.xp6(3),t.Q6J("ngIf",n.upload),t.xp6(4),t.Q6J("ngIf",o.GetProductChannel(n))}}let rn=(()=>{class e{constructor(n,o,i){this.http=n,this.toastr=o,this.dialog=i,this.filter=new u,this.loading=!1,this.syncupdatefull=!1}ngOnInit(){this.Load()}Load(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.Channel=n.Options.Channel,this.filter=n.Filter,this.filter.ChannelID=null,this.filter.sync=!0,this.GetProducts()})}GetProducts(){this.http.post("/api/product/GetProductChannelNotPOS",{ID:this.filter.ChannelID}).subscribe(o=>{this.data=o.Data;for(let i of this.data)i.fullTitle=!1,i.upload=i.Variant.length>0?null==i.Variant.find(s=>null==s.ChannelVariationSKU):null!=i.ChannelItemSKU;this.originalData=o.Data})}SearchProduct(n){var o=this.originalData;null!=this.filter.ChannelID&&(o=o.filter(i=>i.ChannelID==this.filter.ChannelID)),null!=n&&""!=n&&(o=o.filter(i=>null!==i.Name&&i.Name.toLowerCase().includes(n.toLowerCase()))).length<1&&(o=this.originalData.filter(i=>null!==i.ChannelItemSKU&&i.ChannelItemSKU.includes(n))),this.data=o}GetProductChannel(n){return this.ch=this.Channel.find(o=>o.Name==n.Channel),!!this.ch}Refresh(){null!==this.filter.ChannelID&&null!=this.filter.mode?this.http.post("/api/product/ScanOptimized",{ID:this.filter.ChannelID,mode:this.filter.mode,ScanFull:this.filter.ScanFull}).subscribe(o=>{this.GetProducts();let i=o.NotInPOS?o.NotInPOS.Product:0;this.toastr.success(i+" found in "+this.getChannelName(this.filter.ChannelID)+"</br> ( "+i+" Not In POS )","Scan Complete!",{timeOut:5e3,enableHtml:!0})}):alert("Please select channel")}openScanDialog(){this.dialog.open(h.j,{data:{filter:this.filter,Channel:this.Channel,notInPOS:!0},width:"30%"}).afterClosed().subscribe(o=>{null!=o&&(this.filter=o.filter,this.Refresh())})}getSelected(){return this.data?this.data.filter(n=>n.selected):[]}hasSelection(){return!!this.data&&this.getSelected().length>0}RetrieveAllData(n=0){let o;if(0==n?o=this.data:1==n&&(o=this.getSelected()),o.length>0){let i=[];o.forEach(l=>i.push(l)),this.http.post("/api/product/DownloadMultipleProductFromChannel",i).subscribe(l=>{this.GetProducts(),this.toastr.success("Retrieved Product successfully!","Success")})}}RetrieveData(n){confirm("Are you sure you want to Retrieve product '"+n.Name+"' from '"+n.Channel+"' to POS?")&&this.http.post("/api/product/DownloadProductFromChannel",{ChannelItemID:n.ChannelItemID,ChannelID:n.ChannelID}).subscribe(i=>{this.GetProducts(),this.toastr.success("Retrieved Product successfully!","Success")})}getChannelName(n){return this.Channel.find(i=>i.ID==n).Name}openInstruction(n){this.dialogName=n.Name,this.GetProductChannel(n),this.dialogType=this.ch.TypeID,this.dialog.open(Lt,{data:{type:this.dialogType,name:this.dialogName},width:"30%"})}openDownloadModal(){this.dialog.open(Vt,{data:{hasSelection:this.hasSelection()},width:"30%"}).afterClosed().subscribe(o=>{null!=o&&this.RetrieveAllData(o)})}showFullTitle(n){n.fullTitle=!n.fullTitle}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(g.O),t.Y36(S._W),t.Y36(r.uw))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-not-in-pos"]],decls:19,vars:5,consts:[["textButton"," Search",3,"Title","onSubmit"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"card","product"],[1,"row","h-100","g-0","px-6"],[1,"col-auto","pe-xl-0"],["class","border rounded-lg mx-auto text-center mt-5","style","width: 80px; max-height: 80px",3,"src",4,"ngIf"],["class","text-center border rounded-lg mx-auto mt-5","style","width: 80px; max-height: 80px","src","//res.cloudinary.com/pos/image/upload/w_80/POS/Images/Icon/products_thumb.png",4,"ngIf"],[1,"col","mt-5","px-xl-0"],[1,"row","align-items-center","justify-content-start"],[1,"col-auto","pt-0","pe-4","max-w-xl","ms-3"],[1,"text-start",3,"ngClass","innerHTML","click"],["class","col text-end gx-0",4,"ngIf"],[1,"row","mb-auto"],[1,"col-12","mt-5"],[4,"ngIf"],[1,"row","mt-5","justify-content-between","bottom-buttons"],[1,"col-auto","mb-upload"],["class","btn btn-light btn-sm",3,"click",4,"ngIf"],["cantUpload",""],[1,"row","me-0","me-md-5","justify-content-end","w-auto","gx-0"],[1,"border","rounded-lg","mx-auto","text-center","mt-5",2,"width","80px","max-height","80px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_80/POS/Images/Icon/products_thumb.png",1,"text-center","border","rounded-lg","mx-auto","mt-5",2,"width","80px","max-height","80px"],[1,"col","text-end","gx-0"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"ps-3","my-3","table-responsive"],[1,"table","table-bordered"],[1,"text-larger",3,"ngClass"],[4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-larger","mx-auto",3,"ngClass"],[1,"btn","btn-light","btn-sm",3,"click"],["aria-hidden","true",1,"fa","fa-download"],[1,"btn","text-danger","bg-lightpink","btn-sm",3,"click"],["aria-hidden","true",1,"fas","fa-barcode"],[1,"col-auto","px-1","px-md-3","mb-1","pb-3"],["target","_blank",3,"href",4,"ngIf"],["target","_blank",3,"href"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp"],["src","https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png"]],template:function(n,o){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return o.SearchProduct(l)}),t.TgZ(1,"actions")(2,"button",1),t.NdJ("click",function(){return o.openScanDialog()}),t._UZ(3,"i",2),t._uU(4," Scan Channel "),t.qZA(),t.TgZ(5,"button",3),t.NdJ("click",function(){return o.openDownloadModal()}),t._UZ(6,"i",4),t._uU(7," Download "),t.qZA()(),t.TgZ(8,"filters")(9,"div",5)(10,"div",6)(11,"div")(12,"h6"),t._uU(13,"Channel"),t.qZA(),t.TgZ(14,"ng-select",7),t.NdJ("ngModelChange",function(l){return o.filter.ChannelID=l}),t.qZA()()()()(),t.TgZ(15,"content")(16,"div",8)(17,"div",9),t.YNc(18,cn,22,11,"div",10),t.qZA()()()()),2&n&&(t.Q6J("Title","Not in POS ("+(o.originalData?o.originalData.length:"0")+")"),t.xp6(14),t.Q6J("clearable",!0)("items",o.Channel)("ngModel",o.filter.ChannelID),t.xp6(4),t.Q6J("ngForOf",o.data))},dependencies:[d.mk,d.sg,d.O5,c.Wl,c.JJ,c.On,O.p,U.w9],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]}),e})();function sn(e,a){1&e&&t._UZ(0,"img",16)}function pn(e,a){1&e&&t._UZ(0,"img",17)}function dn(e,a){if(1&e&&(t.TgZ(0,"div",18)(1,"table",19)(2,"tr")(3,"td",20),t._UZ(4,"img",21),t.qZA(),t.TgZ(5,"td",22)(6,"a",23),t._uU(7),t.qZA(),t.TgZ(8,"div"),t._uU(9),t.ALo(10,"number"),t.qZA()()()()()),2&e){const n=a.$implicit;t.xp6(4),t.s9C("src",n.ImageURL,t.LSH),t.xp6(2),t.s9C("href",n.URL,t.LSH),t.xp6(1),t.Oqu(n.Name),t.xp6(2),t.hij("Rp. ",t.lcZ(10,4,n.Price),"")}}function gn(e,a){if(1&e&&(t.TgZ(0,"div",6)(1,"div",7)(2,"div",8)(3,"div",4)(4,"div",9),t.YNc(5,sn,1,0,"img",10),t.YNc(6,pn,1,0,"img",11),t.qZA(),t.TgZ(7,"div",12)(8,"h4"),t._uU(9),t.qZA()()()(),t.TgZ(10,"div",13)(11,"div",14),t.YNc(12,dn,11,6,"div",15),t.qZA()()()()),2&e){const n=a.$implicit;t.xp6(5),t.Q6J("ngIf",1==n.TypeID),t.xp6(1),t.Q6J("ngIf",0==n.TypeID),t.xp6(3),t.AsE("",null==n?null:n.SKU," (",null==n||null==n.Child?null:n.Child.length," Alies)"),t.xp6(3),t.Q6J("ngForOf",n.Child)}}let mn=(()=>{class e{constructor(n){this.http=n,this.filter={ChannelID:""},this.Load()}ngOnInit(){}Load(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.filter.ChannelID=null,this.Channel=n.Options.Channel,this.Get()})}SearchProduct(n){}Get(){this.http.post("/api/product/GetDuplicateSkuInChannel",this.filter).subscribe(n=>{this.data=n.Data})}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(g.O))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-duplicate-sku"]],decls:12,vars:5,consts:[["textButton"," Search",3,"Title","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-4",4,"ngFor","ngForOf"],[1,"col-md-4"],[1,"card"],[1,"card-header","border-bottom"],[1,"col-md-1","pb-2"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],[1,"col-10","text-center"],[1,"card-body"],[1,"row","g-0","p-5"],["class","col-md-12",4,"ngFor","ngForOf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"],[1,"col-md-12"],[1,"table"],[2,"width","100px"],[1,"img-thumbnail",3,"src"],[1,"text-start"],["target","_blank",3,"href"]],template:function(n,o){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(){return o.Get()}),t._UZ(1,"actions"),t.TgZ(2,"filters")(3,"div",1)(4,"div")(5,"h6"),t._uU(6,"Channel"),t.qZA(),t.TgZ(7,"ng-select",2),t.NdJ("ngModelChange",function(l){return o.filter.ChannelID=l}),t.qZA()()()(),t.TgZ(8,"content")(9,"div",3)(10,"div",4),t.YNc(11,gn,13,5,"div",5),t.qZA()()()()),2&n&&(t.Q6J("Title","Duplicate Sku ("+(o.data?o.data.length:"0")+")"),t.xp6(7),t.Q6J("clearable",!0)("items",o.Channel)("ngModel",o.filter.ChannelID),t.xp6(4),t.Q6J("ngForOf",o.data))},dependencies:[d.sg,d.O5,c.JJ,c.On,O.p,U.w9,d.JJ]}),e})();var M=p(8063);const un=[{path:"",component:P,children:[{path:"",redirectTo:"in-pos",pathMatch:"full"},{path:"in-pos",component:rt,canActivate:[M.a],data:{title:"Products in POS"}},{path:"sold-in-channel",component:Ut,canActivate:[M.a],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Qt,canActivate:[M.a],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:rn,canActivate:[M.a],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:mn,canActivate:[M.a],data:{title:"Duplicate Sku in Channel"}}]}];let _n=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[d.ez,I.Bz.forChild(un)]}),e})(),hn=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[d.ez,C.Z,c.u5,I.Bz,_n,N.AV,O.R,U.A0]}),e})()},5131:(k,Z,p)=>{p.d(Z,{j:()=>w});var d=p(5412),C=(()=>{return(g=C||(C={}))[g.Shopee=0]="Shopee",g[g.Tokopedia=1]="Tokopedia",g[g.WooCommerce=2]="WooCommerce",g[g.None=3]="None",g[g.KalCare=4]="KalCare",g[g.ShopeeV2=5]="ShopeeV2",g[g.Tiktok=6]="Tiktok",g[g.Lazada=7]="Lazada",C;var g})(),c=p(4650),I=p(6895),t=p(4006),P=p(1948),u=p(9549),h=p(4385),r=p(3238);function y(g,v){if(1&g&&(c.TgZ(0,"mat-option",14),c._UZ(1,"img",15),c._uU(2),c.qZA()),2&g){const _=v.$implicit;c.Q6J("value",_.ID),c.xp6(1),c.Q6J("src",_.Img,c.LSH),c.xp6(1),c.hij(" ",_.Name," ")}}let w=(()=>{class g{constructor(_,m){this.dialogRef=_,this.data=m}ngOnInit(){this.data.filter.mode=0,this.data.filter.sync=!0,this.data.filter.ScanFull=!0,this.data.Channel.length<2&&(this.data.filter.ChannelID=this.data.Channel[0].ID),this.notInPOS=this.data.notInPOS,null==this.notInPOS&&(this.notInPOS=!1)}onSelectChannel(_){let m=this.filterChannelById(_);m&&m.TypeID==C.Tokopedia?(this.data.filter.ScanFull=!0,this.isDisabledOptions=!0):(this.data.filter.ScanFull=!1,this.isDisabledOptions=!1)}filterChannelById(_){let m;return this.data.Channel&&(m=this.data.Channel.find(b=>b.ID==_)),m}submit(){this.data.filter.ScanFull?this.data.filter.ScanFull=!0:this.data.filter.ScanFull||(this.data.filter.ScanFull=!1),this.dialogRef.close(this.data)}close(){this.dialogRef.close()}}return g.\u0275fac=function(_){return new(_||g)(c.Y36(d.so),c.Y36(d.WI))},g.\u0275cmp=c.Xpm({type:g,selectors:[["app-scan-dialog"]],decls:22,vars:7,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0","border-top","border-bottom"],[1,"mb-3","fw-normal"],["appearance","outline"],["name","channelid","placeholder","Channel",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[3,"hidden"],[1,"mb-3","font-weight-normal"],["name","ScanFull",1,"form-control","h-100","pt-5","round",3,"ngModel","disabled","ngModelChange"],["data-toggle","tooltip","title","Full Scan Product",1,"me-5",3,"value"],["data-toggle","tooltip","title","Only Active Product",1,"me-5",3,"value"],[1,"justify-content-end","mx-4"],["mat-button","",1,"btn","btn-light","mx-3",3,"click"],["mat-button","","data-cy","scan",1,"btn","btn-success","mx-3",3,"click"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(_,m){1&_&&(c.TgZ(0,"h1",0),c._uU(1,"Scan Marketplace"),c.qZA(),c.TgZ(2,"mat-dialog-content",1)(3,"h5",2),c._uU(4,"Select a Channel"),c.qZA(),c.TgZ(5,"mat-form-field",3)(6,"mat-select",4),c.NdJ("ngModelChange",function(T){return m.data.filter.ChannelID=T})("ngModelChange",function(T){return m.onSelectChannel(T)}),c.YNc(7,y,3,3,"mat-option",5),c.qZA()(),c._UZ(8,"br"),c.TgZ(9,"div",6)(10,"h5",7),c._uU(11,"Scan Type"),c.qZA(),c.TgZ(12,"mat-radio-group",8),c.NdJ("ngModelChange",function(T){return m.data.filter.ScanFull=T}),c.TgZ(13,"mat-radio-button",9),c._uU(14," Full "),c.qZA(),c.TgZ(15,"mat-radio-button",10),c._uU(16," Active "),c.qZA()()()(),c.TgZ(17,"mat-dialog-actions",11)(18,"button",12),c.NdJ("click",function(){return m.close()}),c._uU(19,"Cancel"),c.qZA(),c.TgZ(20,"button",13),c.NdJ("click",function(){return m.submit()}),c._uU(21,"Scan"),c.qZA()()),2&_&&(c.xp6(6),c.Q6J("ngModel",m.data.filter.ChannelID),c.xp6(1),c.Q6J("ngForOf",m.data.Channel),c.xp6(2),c.Q6J("hidden",(null==m.data?null:m.data.hiddenRadioButton)||!(null!=m.data&&m.data.filter.ChannelID)),c.xp6(3),c.Q6J("ngModel",m.data.filter.ScanFull)("disabled",m.isDisabledOptions),c.xp6(1),c.Q6J("value",!0),c.xp6(2),c.Q6J("value",!1))},dependencies:[I.sg,t.JJ,t.On,d.uh,d.xY,d.H8,P.VQ,P.U0,u.KE,h.gD,r.ey],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]}),g})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[46],{7046:(_e,b,u)=>{u.r(b),u.d(b,{OrdersModule:()=>me});var r=u(6895),d=u(8252),e=u(4650),T=u(7398);let C=(()=>{class a{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new"},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship"},{Title:"3 - Shipped",Url:"/menu/Order/Shipped"},{Title:"4 - Completed",Url:"/menu/Order/Delivered"},{Title:"All",Url:"/menu/Order/All"},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled"},{Title:"Download",Url:"/menu/Order/Download"}]}ngOnInit(){}}return a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-orders"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,n){1&t&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&t&&(e.xp6(3),e.Q6J("Tabs",n.ObjectOrderTabs))},dependencies:[T.e,d.lC]}),a})();var h=u(1318),f=u(7185),s=u(4006),p=u(7481),g=u(8796);function v(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"span",10),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return i.getTotal(),e.KtG(i.hasClicked=!0)}),e.TgZ(1,"i",11),e._uU(2,"?"),e.qZA()()}}function O(a,o){if(1&a&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&a){const t=e.oxw();e.xp6(1),e.Oqu(e.lcZ(2,1,t.paginationTotal))}}let m=(()=>{class a{constructor(){this.get=new e.vpe,this.change=new e.vpe,this.next=new e.vpe,this.previous=new e.vpe,this.total=new e.vpe,this.hasClicked=!1}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.change.emit(this.filter)}getTotal(){this.total.emit()}PreviousPage(){this.previous.emit()}NextPage(){this.next.emit()}}return a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-mat-paginator-no-count"]],inputs:{filter:"filter",paginationTotal:"paginationTotal",totaldata:"totaldata"},outputs:{get:"get",change:"change",next:"next",previous:"previous",total:"total"},decls:13,vars:10,consts:[[1,"d-flex","justify-content-end","mt-5"],[1,"d-sm-block","collapse","mt-3","me-5"],[1,"text-dark","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","title","Load more for 500 variants",1,"btn","btn-outline-secondary","btn-sm","me-3","border-0",3,"disabled","click"],[1,"fas","fa-chevron-left"],["role","button","title","Load more for 500 variants",1,"btn","btn-outline-secondary","btn-sm","border-0",3,"disabled","click"],[1,"fas","fa-chevron-right"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2),e._uU(3),e.ALo(4,"number"),e.ALo(5,"number"),e.YNc(6,v,3,0,"span",3),e.YNc(7,O,3,3,"span",4),e.qZA()(),e.TgZ(8,"div",5)(9,"button",6),e.NdJ("click",function(){return n.PreviousPage()}),e._UZ(10,"i",7),e.qZA(),e.TgZ(11,"button",8),e.NdJ("click",function(){return n.NextPage()}),e._UZ(12,"i",9),e.qZA()()()),2&t&&(e.xp6(3),e.AsE(" Showing ",e.lcZ(4,6,n.filter.PageSize*(n.filter.PageNumber-1)+1)," - ",e.lcZ(5,8,n.filter.PageSize*(n.filter.PageNumber-1)+n.totaldata)," of "),e.xp6(3),e.Q6J("ngIf",!n.hasClicked),e.xp6(1),e.Q6J("ngIf",n.hasClicked),e.xp6(2),e.Q6J("disabled",1==n.filter.PageNumber),e.xp6(2),e.Q6J("disabled",n.filter.PageSize*(n.filter.PageNumber-1)+n.totaldata==n.paginationTotal||n.totaldata<n.filter.PageSize))},dependencies:[r.O5,r.JJ]}),a})(),A=(()=>{class a{}return a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({imports:[r.ez]}),a})();function P(a,o){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.ALo(9,"number"),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.ALo(12,"date"),e.qZA()()),2&a){const t=o.$implicit;e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(9,5,t.Amount)),e.xp6(3),e.Oqu(e.xi3(12,7,t.Created,"dd MMM yyyy HH:mm"))}}let y=(()=>{class a{constructor(t,n){this.http=t,this.toastr=n,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0,this.checkboxState=!1}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.Get()})}Get(t){this.http.post("api/orders/GetNewOrder",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(t){}UpdateDelivery(){let t=this.getSelected();if(t.length>0){let n=[];t.forEach(i=>n.push(i)),this.http.post("/api/Orders/UpdateStateDelivery",n).subscribe(i=>{this.toastr.success("Successfully updated","Success")})}}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Unsent",Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}onCheckboxStateProduct(t){let n=this.data.filter(i=>i.Number==t);if(n.length>0)for(let i of n)i.selected=i.selected}onCheckboxStateChange(){for(let t of this.data)t.selected=this.checkboxState}getSelected(){let t=[];if(this.data){for(let n of this.data)n.selected&&t.push(n);return t}return[]}hasSelection(){return!!this.data&&this.getSelected().length>0}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(h.O),e.Y36(f._W))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-new-order"]],decls:37,vars:11,consts:[["searchBoxPlaceHolder","Search Orders...",3,"Title","hideSearchBox","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.selectedOutlets=l}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()()()(),e._UZ(15,"actions"),e.TgZ(16,"content")(17,"div",5)(18,"div",6)(19,"div",7)(20,"div",8)(21,"table",9)(22,"thead",10)(23,"tr",11)(24,"th"),e._uU(25,"Outlet"),e.qZA(),e.TgZ(26,"th"),e._uU(27,"Order number"),e.qZA(),e.TgZ(28,"th"),e._uU(29,"Customer"),e.qZA(),e.TgZ(30,"th"),e._uU(31,"Amount"),e.qZA(),e.TgZ(32,"th"),e._uU(33,"Created On"),e.qZA()()(),e.TgZ(34,"tbody"),e.YNc(35,P,13,10,"tr",12),e.qZA()(),e.TgZ(36,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("Title","1 - New Order")("hideSearchBox",!0),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(21),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[r.sg,s.Fj,s.wV,s.JJ,s.On,p.p,g.w9,m,r.JJ,r.uU]}),a})();function N(a,o){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"number"),e.qZA()()),2&a){const t=o.$implicit;e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(5,3,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(8,5,t.Price))}}const S=function(){return["/menu/Order"]};let q=(()=>{class a{constructor(t,n){this.http=t,this.url=n,this.number=this.url.snapshot.queryParams.Number,this.outlet=this.url.snapshot.queryParams.Outlet}ngOnInit(){this.Load()}Load(){this.http.post("/api/orders/GetInvoiceDetail",{Number:this.number,Outlet:this.outlet}).subscribe(n=>{this.model=n})}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(h.O),e.Y36(d.gz))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-detail-order"]],decls:73,vars:20,consts:[[3,"Title","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-secondary","btn-fill","btn-lg","me-3",3,"routerLink"],[1,"container"],[1,"row"],[1,"col-4"],[1,"border","my-3","py-3","col-12"],[1,"row","m-2"],[1,"text-center"],[1,"col"],[1,"col-8"],[1,"text-center","my-3","py-3"],[1,"table-responsive"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"a",1),e._uU(3,"Back"),e.qZA()(),e.TgZ(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h3",7),e._uU(11,"Outlet Info"),e.qZA()(),e.TgZ(12,"div",3)(13,"div",8),e._uU(14," Outlet : "),e.qZA(),e.TgZ(15,"div",8),e._uU(16),e.qZA()(),e.TgZ(17,"div",3)(18,"div",8),e._uU(19," Date : "),e.qZA(),e.TgZ(20,"div",8),e._uU(21),e.ALo(22,"date"),e.qZA()(),e.TgZ(23,"div",3)(24,"div",8),e._uU(25," Status : "),e.qZA(),e.TgZ(26,"div",8),e._uU(27),e.qZA()(),e.TgZ(28,"div",3)(29,"div",8),e._uU(30," Tax Type : "),e.qZA(),e.TgZ(31,"div",8),e._uU(32),e.qZA()(),e.TgZ(33,"div",3)(34,"div",8),e._uU(35," Due Date : "),e.qZA(),e.TgZ(36,"div",8),e._uU(37),e.ALo(38,"date"),e.qZA()()(),e.TgZ(39,"div",5)(40,"div",6)(41,"h3",7),e._uU(42,"Customer Info"),e.qZA()(),e.TgZ(43,"div",3)(44,"div",8),e._uU(45," Name : "),e.qZA(),e.TgZ(46,"div",8),e._uU(47),e.qZA()(),e.TgZ(48,"div",3)(49,"div",8),e._uU(50," Email : "),e.qZA(),e.TgZ(51,"div",8),e._uU(52),e.qZA()(),e.TgZ(53,"div",3)(54,"div",8),e._uU(55," Mobile : "),e.qZA(),e.TgZ(56,"div",8),e._uU(57),e.qZA()()()(),e.TgZ(58,"div",9)(59,"h3",10),e._uU(60,"Products Sold"),e.qZA(),e.TgZ(61,"div",11)(62,"table",12)(63,"thead",13)(64,"tr",14)(65,"th"),e._uU(66,"Code"),e.qZA(),e.TgZ(67,"th"),e._uU(68,"Quantity"),e.qZA(),e.TgZ(69,"th"),e._uU(70,"Price"),e.qZA()()(),e.TgZ(71,"tbody"),e.YNc(72,N,9,7,"tr",15),e.qZA()()()()()()()()),2&t&&(e.Q6J("Title","Order #"+n.number)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(19,S)),e.xp6(14),e.hij(" ",n.model.Outlet," "),e.xp6(5),e.hij(" ",e.xi3(22,13,n.model.Date,"dd MMM yyyy")," "),e.xp6(6),e.hij(" ",n.model.Delivery," "),e.xp6(5),e.hij(" ",n.model.TaxType," "),e.xp6(5),e.hij(" ",e.xi3(38,16,n.model.DueDate,"dd MMM yyyy")," "),e.xp6(10),e.hij(" ",n.model.Customer.Name," "),e.xp6(5),e.hij(" ",n.model.Customer.Email," "),e.xp6(5),e.hij(" ",n.model.Customer.Mobile," "),e.xp6(15),e.Q6J("ngForOf",n.model.Variants))},dependencies:[r.sg,p.p,d.yS,r.JJ,r.uU]}),a})();const w=function(){return["/menu/Order/detail"]},M=function(a,o){return{Number:a,Outlet:o}};function D(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"tr")(1,"td")(2,"input",17),e.NdJ("ngModelChange",function(i){const Z=e.CHM(t).$implicit;return e.KtG(Z.selected=i)})("ngModelChange",function(){const l=e.CHM(t).$implicit,Z=e.oxw();return e.KtG(Z.onCheckboxStateProduct(l.Number))}),e.qZA()(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td")(6,"a",18),e._uU(7),e.qZA()(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.ALo(12,"number"),e.qZA(),e.TgZ(13,"td"),e._uU(14),e.ALo(15,"date"),e.qZA()()}if(2&a){const t=o.$implicit;e.xp6(2),e.Q6J("ngModel",t.selected),e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("routerLink",e.DdM(13,w))("queryParams",e.WLB(14,M,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(12,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(15,10,t.Created,"dd MMM yyyy HH:mm"))}}let U=(()=>{class a{constructor(t,n){this.http=t,this.toastr=n,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0,this.checkboxState=!1}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.Get()})}Get(t){this.http.post("api/orders/GetReadyToShip",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(t){}UpdateDelivery(){let t=this.getSelected();if(t.length>0){let n=[];t.forEach(i=>n.push(i)),this.http.post("/api/Orders/UpdateStateDelivery",n).subscribe(i=>{this.toastr.success("Successfully updated","Success")})}}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Paid",DeliveryState:"Unsent",Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}onCheckboxStateProduct(t){let n=this.data.filter(i=>i.Number==t);if(n.length>0)for(let i of n)i.selected=i.selected}onCheckboxStateChange(){for(let t of this.data)t.selected=this.checkboxState}getSelected(){let t=[];if(this.data){for(let n of this.data)n.selected&&t.push(n);return t}return[]}hasSelection(){return!!this.data&&this.getSelected().length>0}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(h.O),e.Y36(f._W))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-ready-to-ship"]],decls:41,vars:12,consts:[["searchBoxPlaceHolder","Search Ready To Ship...",3,"Title","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"hidden","click"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],["type","checkbox",3,"ngModel","ngModelChange"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.selectedOutlets=l}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()()()(),e.TgZ(15,"actions")(16,"button",5),e.NdJ("click",function(){return n.UpdateDelivery()}),e._uU(17," Dispatch "),e.qZA()(),e.TgZ(18,"content")(19,"div",6)(20,"div",7)(21,"div",8)(22,"div",9)(23,"table",10)(24,"thead",11)(25,"tr",12)(26,"th",13)(27,"input",14),e.NdJ("ngModelChange",function(l){return n.checkboxState=l})("ngModelChange",function(){return n.onCheckboxStateChange()}),e.qZA()(),e.TgZ(28,"th"),e._uU(29,"Outlet"),e.qZA(),e.TgZ(30,"th"),e._uU(31,"Order number"),e.qZA(),e.TgZ(32,"th"),e._uU(33,"Customer"),e.qZA(),e.TgZ(34,"th"),e._uU(35,"Amount"),e.qZA(),e.TgZ(36,"th"),e._uU(37,"Created On"),e.qZA()()(),e.TgZ(38,"tbody"),e.YNc(39,D,16,17,"tr",15),e.qZA()(),e.TgZ(40,"app-mat-paginator-no-count",16),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("Title","2 - Ready to Ship"),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(2),e.Q6J("hidden",!n.hasSelection()),e.xp6(11),e.Q6J("ngModel",n.checkboxState),e.xp6(12),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[r.sg,s.Fj,s.wV,s.Wl,s.JJ,s.On,p.p,d.yS,g.w9,m,r.JJ,r.uU]}),a})();const x=function(){return["/menu/Order/detail"]},J=function(a,o){return{Number:a,Outlet:o}};function Q(a,o){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",14),e._uU(5),e.qZA()(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA()()),2&a){const t=o.$implicit;e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("routerLink",e.DdM(12,x))("queryParams",e.WLB(13,J,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,7,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,9,t.Created,"dd MMM yyyy HH:mm"))}}let k=(()=>{class a{constructor(t){this.http=t,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.Get()})}Get(t){this.http.post("api/orders/GetShipped",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Sent",Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(h.O))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-shipped"]],decls:36,vars:10,consts:[["searchBoxPlaceHolder","Search Orders...",3,"Title","onSubmit"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.selectedOutlets=l}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA()()(),e.TgZ(33,"tbody"),e.YNc(34,Q,14,16,"tr",12),e.qZA()(),e.TgZ(35,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("Title","3 - Shipped"),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(20),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[r.sg,s.Fj,s.wV,s.JJ,s.On,p.p,d.yS,g.w9,m,r.JJ,r.uU]}),a})();const F=function(){return["/menu/Order/detail"]},I=function(a,o){return{Number:a,Outlet:o}};function L(a,o){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",14),e._uU(5),e.qZA()(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA()()),2&a){const t=o.$implicit;e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("routerLink",e.DdM(12,F))("queryParams",e.WLB(13,I,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,7,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,9,t.Created,"dd MMM yyyy HH:mm"))}}let G=(()=>{class a{constructor(t){this.http=t,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.Get()})}Get(t){this.http.post("api/orders/GetDelivered ",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Paid",DeliveryState:"Sent",Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(h.O))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-delivered"]],decls:36,vars:11,consts:[["searchBoxPlaceHolder","Search Orders...",3,"Title","hideSearchBox","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.selectedOutlets=l}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA()()(),e.TgZ(33,"tbody"),e.YNc(34,L,14,16,"tr",12),e.qZA()(),e.TgZ(35,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("Title","4 - Completed")("hideSearchBox",!0),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(20),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[r.sg,s.Fj,s.wV,s.JJ,s.On,p.p,d.yS,g.w9,m,r.JJ,r.uU]}),a})();const R=function(){return["/menu/Order/detail"]},z=function(a,o){return{Number:a,Outlet:o}};function Y(a,o){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",14),e._uU(5),e.qZA()(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._uU(15),e.qZA()()),2&a){const t=o.$implicit;e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("routerLink",e.DdM(13,R))("queryParams",e.WLB(14,z,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Oqu(t.State)}}let B=(()=>{class a{constructor(t){this.http=t,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.Get()})}Get(t){this.http.post("api/orders/GetAll ",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(t){this.filter=t,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!1,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(h.O))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-all-order"]],decls:38,vars:10,consts:[["searchBoxPlaceHolder","Search Orders...",3,"Title","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.selectedOutlets=l}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA(),e.TgZ(33,"th"),e._uU(34,"Status"),e.qZA()()(),e.TgZ(35,"tbody"),e.YNc(36,Y,16,17,"tr",12),e.qZA()(),e.TgZ(37,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("Title","All"),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(22),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[r.sg,s.Fj,s.wV,s.JJ,s.On,p.p,d.yS,g.w9,m,r.JJ,r.uU]}),a})();const H=function(){return["/menu/Order/detail"]},j=function(a,o){return{Number:a,Outlet:o}};function E(a,o){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",14),e._uU(5),e.qZA()(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA()()),2&a){const t=o.$implicit;e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("routerLink",e.DdM(12,H))("queryParams",e.WLB(13,j,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,7,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,9,t.Created,"dd MMM yyyy HH:mm"))}}let K=(()=>{class a{constructor(t){this.http=t,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.Get()})}Get(t){this.http.post("api/orders/GetCancelled ",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!0,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(h.O))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-cancelled"]],decls:36,vars:10,consts:[["searchBoxPlaceHolder","Search Orders...",3,"Title","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.selectedOutlets=l}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA()()(),e.TgZ(33,"tbody"),e.YNc(34,E,14,16,"tr",12),e.qZA()(),e.TgZ(35,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("Title","99 - Cancelled"),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(20),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[r.sg,s.Fj,s.wV,s.JJ,s.On,p.p,d.yS,g.w9,m,r.JJ,r.uU]}),a})();var _=u(9602);function $(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"button",8),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.preview())}),e._UZ(1,"i",9),e._uU(2," Preview"),e.qZA()}}function V(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"button",10),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.download())}),e._UZ(1,"i",11),e._uU(2," Download "),e.qZA()}}function W(a,o){if(1&a&&(e.TgZ(0,"ng-option",25),e._UZ(1,"img",26),e._uU(2),e.qZA()),2&a){const t=o.$implicit;e.Q6J("value",t.ID),e.xp6(1),e.s9C("src",t.Img,e.LSH),e.xp6(1),e.Oqu(t.Name)}}function X(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"div",12)(1,"div",13)(2,"div",12)(3,"div",14)(4,"div")(5,"label",15)(6,"h5"),e._uU(7,"Select a Channel"),e.qZA()(),e.TgZ(8,"ng-select",16),e.NdJ("ngModelChange",function(i){e.CHM(t);const l=e.oxw();return e.KtG(l.ChannelID=i)}),e.YNc(9,W,3,3,"ng-option",17),e.qZA()()()(),e.TgZ(10,"div",18)(11,"div",19)(12,"label",20)(13,"h5"),e._uU(14,"Enter date range "),e.TgZ(15,"small"),e._uU(16,"(Maximum two weeks)"),e.qZA()()()(),e.TgZ(17,"div",19)(18,"mat-date-range-input",21)(19,"input",22),e.NdJ("ngModelChange",function(i){e.CHM(t);const l=e.oxw();return e.KtG(l.startDate=i)})("click",function(){e.CHM(t);const i=e.MAs(22);return e.KtG(i.open())}),e.qZA(),e.TgZ(20,"input",23),e.NdJ("ngModelChange",function(i){e.CHM(t);const l=e.oxw();return e.KtG(l.endDate=i)})("click",function(){e.CHM(t);const i=e.MAs(22);return e.KtG(i.open())}),e.qZA()(),e._UZ(21,"mat-date-range-picker",null,24),e.qZA()()()()}if(2&a){const t=e.MAs(22),n=e.oxw();e.xp6(8),e.Q6J("clearable",!1)("ngModel",n.ChannelID),e.xp6(1),e.Q6J("ngForOf",n.Channel),e.xp6(9),e.Q6J("rangePicker",t),e.xp6(1),e.Q6J("ngModel",n.startDate),e.xp6(1),e.Q6J("ngModel",n.endDate)}}const ee=function(a){return{"over-due":a}};function te(a,o){if(1&a&&(e.TgZ(0,"tr",33)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA()()),2&a){const t=o.$implicit,n=o.index;e.Q6J("ngClass",e.VKq(5,ee,t.Exception)),e.xp6(2),e.Oqu(n+1),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Status),e.xp6(2),e.Oqu(t.Exception)}}function ne(a,o){if(1&a&&(e.TgZ(0,"div",27)(1,"div",28)(2,"table",29)(3,"thead",30)(4,"tr"),e._UZ(5,"th",31),e.TgZ(6,"th"),e._uU(7,"Order Number"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Status"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Exception"),e.qZA()()(),e.TgZ(12,"tbody"),e.YNc(13,te,9,7,"tr",32),e.qZA()()()()),2&a){const t=e.oxw();e.xp6(13),e.Q6J("ngForOf",t.infodownload)}}function ae(a,o){if(1&a&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",t.ActionString," ")}}function ie(a,o){if(1&a&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&a){const t=o.$implicit;e.xp6(1),e.Oqu(t)}}function oe(a,o){if(1&a&&(e.TgZ(0,"ul",46),e.YNc(1,ie,2,1,"li",42),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.ActionString)}}function le(a,o){if(1&a&&(e.TgZ(0,"span",47),e._UZ(1,"i",48),e.qZA()),2&a){const t=e.oxw().$implicit;e.hYB("title","Delivery : ",t.DeliveryState," \nPayment : ",t.PaymentState,"")}}const re=function(a,o){return{"over-due-today":a,"over-due":o}};function se(a,o){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.ALo(7,"date"),e.qZA(),e.TgZ(8,"td")(9,"span"),e._uU(10),e.qZA(),e._uU(11),e.qZA(),e.TgZ(12,"td",33)(13,"span"),e._uU(14),e.qZA(),e._uU(15),e.qZA(),e.TgZ(16,"td"),e.YNc(17,ae,2,1,"span",43),e.YNc(18,oe,2,1,"ul",44),e.qZA(),e.TgZ(19,"td"),e.YNc(20,le,2,2,"span",45),e.qZA()()),2&a){const t=o.$implicit,n=o.index;e.xp6(2),e.Oqu(n+1),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Oqu(e.xi3(7,11,t.Date,"dd MMM yyyy HH:mm:ss")),e.xp6(4),e.hij("",t.ChannelStatus," - "),e.xp6(1),e.Oqu(t.ChannelStatusDescription),e.xp6(1),e.Q6J("ngClass",e.WLB(14,re,t.Update,t.Create)),e.xp6(2),e.hij("",t.POSStatus," - "),e.xp6(1),e.Oqu(t.POSStatusDescription),e.xp6(2),e.Q6J("ngIf",1==t.ActionString.length),e.xp6(1),e.Q6J("ngIf",t.ActionString.length>1),e.xp6(2),e.Q6J("ngIf",99!=t.ChannelStatus&&99!=t.POSStatus)}}function ue(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"div",12)(1,"div",28)(2,"div",34)(3,"ul",35)(4,"li",36)(5,"button",37),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filter("all"))}),e._uU(6),e.qZA()(),e.TgZ(7,"li",36)(8,"button",37),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filter("sync"))}),e._uU(9),e.qZA()(),e.TgZ(10,"li",36)(11,"button",37),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filter("wrong"))}),e._uU(12),e.qZA()(),e.TgZ(13,"li",36)(14,"button",37),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filter("unsync"))}),e._uU(15),e.qZA()()()(),e.TgZ(16,"table",29)(17,"thead",38)(18,"tr"),e._UZ(19,"th",31),e.TgZ(20,"th",39),e._uU(21,"Number"),e.qZA(),e.TgZ(22,"th",40),e._uU(23),e.qZA(),e.TgZ(24,"th",41),e._uU(25,"Channel Status"),e.qZA(),e.TgZ(26,"th",41),e._uU(27,"POS Status"),e.qZA(),e.TgZ(28,"th"),e._uU(29,"Action"),e.qZA(),e._UZ(30,"th",31),e.qZA()(),e.TgZ(31,"tbody"),e.YNc(32,se,21,17,"tr",42),e.qZA()()()()}if(2&a){const t=e.oxw();e.xp6(5),e.Q6J("ngClass","all"==t.pillStatus?"btn-secondary text-white":"btn-outline-dark"),e.xp6(1),e.hij("All (",t.data.length,")"),e.xp6(2),e.Q6J("ngClass","sync"==t.pillStatus?"btn-success":"btn-outline-success"),e.xp6(1),e.hij("Existing (",t.data.length-t.updateQty-t.createQty,")"),e.xp6(2),e.Q6J("ngClass","wrong"==t.pillStatus?"btn-warning text-white":"btn-outline-warning"),e.xp6(1),e.hij("Wrong Status (",t.updateQty,")"),e.xp6(2),e.Q6J("ngClass","unsync"==t.pillStatus?"btn-danger":"btn-outline-danger"),e.xp6(1),e.hij("Missing (",t.createQty,")"),e.xp6(8),e.Oqu(0==t.getTypeID()?"Last Status Update":"Created Date"),e.xp6(9),e.Q6J("ngForOf",t.displayData)}}let de=(()=>{class a{constructor(t,n,i,l){this.http=t,this.toastr=n,this.datePipe=i,this.url=l,this.ispreview=!1,this.isresult=!1,this.PageTitle="Download to POS",this.pillStatus="all",this.filterfromDashboard=!1,this.downloadOrderData=[],this.filterfromDashboard=!1}ngOnInit(){this.maxDate=new Date,this.async=!0,this.loadChannel(),this.url.queryParams.subscribe(t=>{this.ChannelID=t.ChannelID,this.startDate=new Date(t.Date),this.endDate=new Date(t.Date),this.async=!1,this.filterfromDashboard=!0,this.LoadPreview()})}loadChannel(){this.http.post("/api/product/Load",{}).subscribe(t=>{this.Channel=t.Options.Channel})}getDayDiff(t,n){return(n.getTime()-t.getTime())/864e5}download(){this.callApi("Download")}LoadPreview(){this.async=!1,this.filterfromDashboard=!1,!isNaN(this.startDate)&&!isNaN(this.endDate)&&this.callApi("Preview")}preview(){this.async=!1,this.filterfromDashboard=!1,isNaN(this.startDate)||isNaN(this.endDate)?this.toastr.warning("please select a date and outlet","Information"):this.callApi("Preview")}getTypeID(){return this.Channel.find(n=>n.ID==this.ChannelID).TypeID??0}callApi(t){if(null==this.ChannelID&&this.filterfromDashboard)return void this.toastr.warning("Channel cannot be empty!","Failed");if(null==this.startDate||null==this.endDate)return void this.toastr.warning("Please enter both the start and end dates!","Failed");if(this.getDayDiff(this.startDate,this.endDate)>14)return void this.toastr.warning("Dates cannot be more than 14 days apart!","Failed");let n=null;n="Download"==t?{ID:this.ChannelID,From:this.startDate,To:this.endDate,Async:this.async,ListPreview:this.downloadOrderData}:{ID:this.ChannelID,From:this.startDate,To:this.endDate,Async:this.async},this.http.post("/api/Orders/"+t,n).subscribe(i=>{if(this.async)this.toastr.success("Download is successful","Success!"),this.new();else if(this.ispreview)this.infodownload=i.Body,this.data=null,this.isresult=!0,this.ispreview=!1,this.PageTitle="Result ("+this.datePipe.transform(this.startDate,"dd MMM yyyy")+" - "+this.datePipe.transform(this.endDate,"dd MMM yyyy)");else{if(0==i.length&&"Preview"==t)return void this.toastr.info("There is no orders from "+this.datePipe.transform(this.startDate,"dd MMM yyyy")+" to "+this.datePipe.transform(this.endDate,"dd MMM yyyy")+" !","No Orders!");this.updateQty=0,this.createQty=0,this.data=i,this.displayData=i,this.hasAction=this.data.some(l=>"Do Nothing"!=l.ActionString);for(let l of this.data)1===l.Action&&(l.Create=!0,l.Update=!1,this.createQty++),l.Action>1&&(l.Create=!1,l.Update=!0,this.updateQty++);this.ispreview=!0,this.isresult=!1,this.PageTitle="Preview ("+this.datePipe.transform(this.startDate,"dd MMM yyyy")+" - "+this.datePipe.transform(this.endDate,"dd MMM yyyy)")}"Preview"==t&&this.filterDownloadedOrder()})}filterDownloadedOrder(){let t=this.filterDataByStatus("unsync"),n=this.filterDataByStatus("wrong");this.downloadOrderData=[...t,...n]}new(){this.ispreview=!1,this.isresult=!1,this.data=null,this.infodownload=null,this.ChannelID=null,this.startDate=null,this.endDate=null,this.hasAction=!0,this.PageTitle="Download to POS"}filter(t){this.pillStatus=t,this.displayData=this.filterDataByStatus(t)}filterDataByStatus(t){let n=[];switch(t){case"all":n=this.data;break;case"sync":n=this.data.filter(i=>!i.Update&&!i.Create);break;case"wrong":n=this.data.filter(i=>i.Update);break;case"unsync":n=this.data.filter(i=>i.Create)}return n}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(h.O),e.Y36(f._W),e.Y36(r.uU),e.Y36(d.gz))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-download"]],decls:12,vars:8,consts:[[3,"Title","hideSearchBox","hideSearchDropdown"],["class","btn btn-success btn-fill btn-lg text-white",3,"click",4,"ngIf"],["class","btn btn-success btn-fill btn-lg text-white","type","button",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[1,"container-fluid","pt-5","mt-5"],["class","row",4,"ngIf"],["class","row mt-4",4,"ngIf"],[1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[1,"fas","fa-search"],["type","button",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],["aria-hidden","true",1,"fa","fa-download","me-2"],[1,"row"],[1,"col-6"],[1,"col"],["for","channelSelect"],[3,"clearable","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-1rem"],[1,"col-12"],["for","dates"],["id","dates",1,"form-control","rounded","dateRange","w-75",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModel","ngModelChange","click"],["matEndDate","","placeholder","End date",3,"ngModel","ngModelChange","click"],["picker",""],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"row","mt-4"],[1,"col-md-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],["width","1%"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"row","mx-1","mb-5"],[1,"nav","nav-pills"],[1,"nav-item","mx-3"],[1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],[1,"thead-light"],["width","25%"],["width","15%"],["width","10%"],[4,"ngFor","ngForOf"],[4,"ngIf"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0)(1,"actions"),e.YNc(2,$,3,0,"button",1),e.YNc(3,V,3,0,"button",2),e.TgZ(4,"button",3),e.NdJ("click",function(){return n.new()}),e._UZ(5,"i",4),e._uU(6," New "),e.qZA()(),e.TgZ(7,"content")(8,"div",5),e.YNc(9,X,23,6,"div",6),e.YNc(10,ne,14,1,"div",7),e.YNc(11,ue,33,10,"div",6),e.qZA()()()),2&t&&(e.Q6J("Title",n.PageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("ngIf",!n.ispreview&&!n.isresult),e.xp6(1),e.Q6J("ngIf",n.ispreview&&n.hasAction&&0!==n.downloadOrderData.length),e.xp6(6),e.Q6J("ngIf",!n.ispreview&&!n.isresult),e.xp6(1),e.Q6J("ngIf",n.isresult),e.xp6(1),e.Q6J("ngIf",n.ispreview))},dependencies:[r.mk,r.sg,r.O5,s.Fj,s.JJ,s.On,p.p,g.w9,g.jq,_.wx,_.zY,_.By,_._g,r.uU],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]}),a})();var c=u(8063);const pe=[{path:"",component:C,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:y,canActivate:[c.a],data:{title:"New Order"}},{path:"detail",component:q,canActivate:[c.a],data:{title:"Orders detail"}},{path:"ready_to_ship",component:U,canActivate:[c.a],data:{title:"Ready To Ship"}},{path:"Shipped",component:k,canActivate:[c.a],data:{title:"Shipped"}},{path:"Delivered",component:G,canActivate:[c.a],data:{title:"Delivered"}},{path:"All",component:B,canActivate:[c.a],data:{title:"All Order"}},{path:"Cancelled",component:K,canActivate:[c.a],data:{title:"Cancelled"}},{path:"Download",component:de,canActivate:[c.a],data:{title:"Download"}}]}];let ge=(()=>{class a{}return a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({imports:[r.ez,d.Bz.forChild(pe)]}),a})();var he=u(8739),ce=u(3238);let me=(()=>{class a{}return a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({imports:[r.ez,s.u5,ge,T.Z,p.R,he.TU,d.Bz,g.A0,_.FA,ce.XK,A]}),a})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[472],{1472:(X,f,s)=>{s.r(f),s.d(f,{InventoryModule:()=>E});var c=s(6895),t=s(4650),u=s(8252),g=s(7398);let D=(()=>{class o{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}ngOnInit(){}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(e,a){1&e&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()()(),t._UZ(4,"router-outlet")),2&e&&(t.xp6(3),t.Q6J("Tabs",a.inventoryTabs))},dependencies:[u.lC,g.e]}),o})();var _=s(5131),Z=s(2486),C=s(1318),I=s(7185),v=s(5412),d=s(7481),y=s(7100);let w=(()=>{class o{constructor(e,a,n){this.http=e,this.toastr=a,this.dialog=n,this.filter={ChannelID:""},this.loading=!1,this.LoaderChannel(),this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.filterModel=1,this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){}LoaderChannel(){this.http.post("/api/InventoryLoader/GetMultipleInventoryComparison",{}).subscribe(e=>{this.Channel=e.Options.Channel,this.filter=e.Filter,this.Filter()})}Filter(e){this.http.post("/api/Inventory/GetMultipleChannelComparison",{text:e,filterModel:this.filterModel,PageNumber:this.filter.PageNumber,RowCount:this.filter.PageSize}).subscribe(n=>{this.data=n.Data,this.tempdata=n.Data})}UpdateStock(){let e=this.getSelected();if(e.length>0){let n=[];e.forEach(r=>n.push({ID:r.ID,Code:r.Code,Inventory:r.Inventory}));var a=[];for(let r of this.Channel)r.selected&&a.push(r.ID);let i={ListChannelID:a,List:n};this.http.post("/api/Inventory/UpdateChannel",i).subscribe(r=>{this.info=r.Data,this.Filter(),this.toastr.success("Successfully updated "+i.List.length+" variants in "+i.ListChannelID.length+" channels","Success")})}}openScanDialog(){this.dialog.open(_.j,{data:{filter:this.filter,Channel:this.Channel},width:"30%"}).afterClosed().subscribe(a=>{null!=a&&(this.filter=a.filter,this.filter.sync?this.RefreshChannel():this.filter.sync||this.RefreshChannel())})}RefreshChannel(){let e={ID:this.filter.ChannelID,ScanFull:this.filter.ScanFull};this.http.post("/api/product/ScanOptimized",e).subscribe(a=>{this.info=a.Data,this.Filter(),this.toastr.success("Successfully scanned from "+this.getChannelName(e.ID),"Success")})}UpdateStockByVariant(e){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:parseFloat(e.Inventory),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(n=>{this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") inventory in "+this.getChannelName(a.ID)+" to "+a.NewQuantity,"Success");for(let i of this.data)if(i.ChannelItemID===e.ChannelItemID)for(let r of i.Variants)r.ChannelVariationID==e.ChannelVariantID&&(r.Stock=parseFloat(e.Inventory))})}getSelected(){let e=[];if(this.data){for(let a of this.data)for(let n of a.Variants)n.selected&&e.push(n);return e}return[]}hasSelection(){return!!this.data&&this.getSelected().length>0}getChannelName(e){return this.Channel.find(n=>n.ID==e).Name}onShowDifferenceStock(e){this.filterModel=e?3:1,this.Filter()}onUpdateItems(){const e=this.getSelected();this.dialog.open(Z.j,{data:{selectedItems:e,channels:this.Channel},width:"40%"}).afterClosed().subscribe(a=>{a&&(this.Channel=a,this.UpdateStock())})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(C.O),t.Y36(I._W),t.Y36(v.uw))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-inventory-pos"]],decls:15,vars:10,consts:[[3,"Title","pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],[1,"d-flex"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"hidden","click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"]],template:function(e,a){1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(i){return a.Filter(i)}),t.TgZ(1,"actions")(2,"div",1)(3,"div")(4,"button",2),t.NdJ("click",function(){return a.openScanDialog()}),t._UZ(5,"i",3),t._uU(6," Scan Channel "),t.qZA(),t.TgZ(7,"button",4),t.NdJ("click",function(){return a.onUpdateItems()}),t._UZ(8,"i",5),t._uU(9," Update "),t.qZA()()()(),t.TgZ(10,"content")(11,"div",6)(12,"div",7)(13,"div",8)(14,"app-table",9),t.NdJ("onToggle",function(i){return a.onShowDifferenceStock(i)})("onSubmit",function(i){return a.UpdateStockByVariant(i)}),t.qZA()()()()()()),2&e&&(t.Q6J("Title","Inventory Comparison")("pageData",a.pageData)("hideSearchBox",!1)("hideSearchDropdown",!0)("textButton","Search"),t.xp6(7),t.Q6J("hidden",!a.hasSelection()),t.xp6(7),t.Q6J("data",a.data)("channel",a.Channel)("showProductToggle",!0)("filter",a.filter))},dependencies:[d.p,y.a],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),o})();var M=s(1576),p=s(4006),m=s(8796),b=s(455);function N(o,l){1&o&&(t.TgZ(0,"div",35)(1,"span"),t._uU(2," showing only different stock, please press next to populate more data "),t.qZA()())}function R(o,l){if(1&o&&(t.TgZ(0,"ng-option",36),t._UZ(1,"img",37),t._uU(2),t.qZA()),2&o){const e=l.$implicit;t.Q6J("value",e.ID),t.xp6(1),t.s9C("src",e.Img,t.LSH),t.xp6(1),t.Oqu(e.Name)}}function A(o,l){if(1&o){const e=t.EpF();t.TgZ(0,"input",49),t.NdJ("ngModelChange",function(n){t.CHM(e);const i=t.oxw(3).$implicit;return t.KtG(i.selected=n)})("ngModelChange",function(){t.CHM(e);const n=t.oxw(3).$implicit,i=t.oxw(2);return t.KtG(i.onCheckboxStateProduct(n.ID))}),t.qZA()}if(2&o){const e=t.oxw(3).$implicit;t.Q6J("ngModel",e.selected)}}function P(o,l){if(1&o&&t._UZ(0,"img",50),2&o){const e=t.oxw(3).$implicit;t.s9C("src",null==e?null:e.ThumbnailUrl,t.LSH)}}function U(o,l){1&o&&t._UZ(0,"img",51)}function k(o,l){if(1&o&&(t.ynx(0),t.TgZ(1,"td",43)(2,"div",44),t.YNc(3,A,1,1,"input",45),t.YNc(4,P,1,1,"img",46),t.YNc(5,U,1,0,"ng-template",null,47,t.W1O),t.qZA()(),t.TgZ(7,"td",43)(8,"span",48),t._uU(9),t.qZA(),t._UZ(10,"br"),t.TgZ(11,"small"),t._uU(12),t.qZA()(),t.BQk()),2&o){const e=t.MAs(6),a=t.oxw().$implicit,n=t.oxw().$implicit;t.xp6(1),t.Q6J("rowSpan",null==n?null:n.Variants.length),t.xp6(2),t.Q6J("ngIf",(null==a?null:a.Inventory)>=0||n.Variants.length>1),t.xp6(1),t.Q6J("ngIf",null==n?null:n.ThumbnailUrl)("ngIfElse",e),t.xp6(3),t.Q6J("rowSpan",null==n?null:n.Variants.length),t.xp6(2),t.Oqu(null==n?null:n.Name),t.xp6(3),t.hij("(",null==n?null:n.Category,")")}}function J(o,l){if(1&o){const e=t.EpF();t.TgZ(0,"input",23),t.NdJ("ngModelChange",function(n){t.CHM(e);const i=t.oxw().$implicit;return t.KtG(i.selected=n)}),t.qZA()}if(2&o){const e=t.oxw().$implicit;t.Q6J("ngModel",e.selected)}}function F(o,l){if(1&o&&(t.TgZ(0,"span")(1,"span",52),t._uU(2),t.ALo(3,"number"),t.qZA(),t._uU(4," => "),t.TgZ(5,"span",53),t._uU(6),t.ALo(7,"number"),t.qZA()()),2&o){const e=t.oxw().$implicit;t.xp6(2),t.hij(" ",t.lcZ(3,2,e.I.Available),""),t.xp6(4),t.Oqu(t.lcZ(7,4,null==e?null:e.Inventory))}}function Q(o,l){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,null==e?null:e.Inventory)," ")}}const L=function(o){return{"bg-err":o}};function V(o,l){if(1&o){const e=t.EpF();t.TgZ(0,"td",54)(1,"div",55)(2,"div",56),t.NdJ("click",function(){t.CHM(e);const n=t.oxw().$implicit,i=t.oxw().$implicit,r=t.oxw(2);return t.KtG(r.openTableDialog(i.Name,n,null==n?null:n.Channel[0].ChannelID,i.ChannelItemID))}),t._uU(3),t.ALo(4,"number"),t.qZA(),t.TgZ(5,"div",57)(6,"a",58),t._UZ(7,"i",59),t.qZA()()()()}if(2&o){const e=t.oxw().$implicit;t.Q6J("ngClass",t.VKq(5,L,(null==e?null:e.Inventory)!=(null==e?null:e.Channel[0].Inventory))),t.xp6(3),t.hij(" ",t.lcZ(4,3,null==e?null:e.Channel[0].Inventory)," "),t.xp6(3),t.Q6J("href",null==e?null:e.Channel[0].Url,t.LSH)}}function q(o,l){if(1&o&&(t.TgZ(0,"tr"),t.YNc(1,k,13,7,"ng-container",31),t.TgZ(2,"td",38),t._uU(3),t.qZA(),t.TgZ(4,"td",39),t._uU(5),t.qZA(),t.TgZ(6,"td",40),t.YNc(7,J,1,1,"input",41),t.qZA(),t.TgZ(8,"td",39),t.YNc(9,F,8,6,"span",31),t.YNc(10,Q,3,3,"span",31),t.qZA(),t.YNc(11,V,8,7,"td",42),t.qZA()),2&o){const e=l.$implicit,a=l.index;t.xp6(1),t.Q6J("ngIf",0==a),t.xp6(2),t.Oqu(null==e?null:e.Model),t.xp6(2),t.hij(" ",null==e?null:e.Code," "),t.xp6(2),t.Q6J("ngIf",(null==e?null:e.Inventory)>=0),t.xp6(2),t.Q6J("ngIf",(null==e?null:e.Inventory)!=e.I.Available),t.xp6(1),t.Q6J("ngIf",(null==e?null:e.Inventory)==e.I.Available),t.xp6(1),t.Q6J("ngIf",null==e?null:e.Channel)}}function O(o,l){if(1&o&&(t.TgZ(0,"tbody"),t.YNc(1,q,12,7,"tr",26),t.qZA()),2&o){const e=l.$implicit;t.xp6(1),t.Q6J("ngForOf",e.Variants)}}function K(o,l){if(1&o){const e=t.EpF();t.TgZ(0,"span",60),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.StoreRowsCountAPIResult())}),t.TgZ(1,"i",61),t._uU(2,"?"),t.qZA()()}}function B(o,l){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.Oqu(t.lcZ(2,1,e.listTotal))}}function Y(o,l){if(1&o){const e=t.EpF();t.TgZ(0,"a",62),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.NextPage(!0))}),t._UZ(1,"i",63),t._uU(2," Next"),t.qZA()}}function G(o,l){if(1&o){const e=t.EpF();t.TgZ(0,"a",64),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.StoreRowsCountAPIResult(!0))}),t._UZ(1,"i",65),t._uU(2," Last"),t.qZA()}}function H(o,l){if(1&o){const e=t.EpF();t.TgZ(0,"mainpanel",1),t.NdJ("onSubmit",function(n){t.CHM(e);const i=t.oxw();return t.KtG(i.Filter(n,"search"))}),t.TgZ(1,"actions")(2,"div",2)(3,"div")(4,"button",3),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.openScanDialog())}),t._UZ(5,"i",4),t._uU(6," Scan Channel "),t.qZA(),t.TgZ(7,"button",5),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.UpdateStock())}),t._UZ(8,"i",6),t._uU(9," Update"),t.qZA()()()(),t.TgZ(10,"filters")(11,"div",2)(12,"div",7)(13,"div")(14,"label",8),t._uU(15,"PageNumber"),t.qZA(),t.TgZ(16,"input",9),t.NdJ("ngModelChange",function(n){t.CHM(e);const i=t.oxw();return t.KtG(i.filter.PageNumber=n)}),t.qZA()(),t.TgZ(17,"div")(18,"label",10),t._uU(19,"Page Size"),t.qZA(),t.TgZ(20,"input",11),t.NdJ("ngModelChange",function(n){t.CHM(e);const i=t.oxw();return t.KtG(i.filter.PageSize=n)}),t.qZA()()()()(),t.TgZ(21,"content")(22,"div",12)(23,"div",13)(24,"div",14),t.YNc(25,N,3,0,"div",15),t.TgZ(26,"table",16)(27,"thead",17)(28,"tr")(29,"th",18),t._uU(30,"Product "),t._UZ(31,"br"),t.TgZ(32,"mat-slide-toggle",19),t.NdJ("toggleChange",function(){t.CHM(e);const n=t.oxw();return n.showDifferenceStock=!n.showDifferenceStock,t.KtG(n.onShowDifferenceStock())}),t.TgZ(33,"small",20),t._uU(34,"Filter Different Inventory"),t.qZA()()(),t.TgZ(35,"th",21),t._uU(36,"Variant"),t.qZA(),t.TgZ(37,"th",22),t._uU(38,"SKU"),t.qZA(),t.TgZ(39,"th")(40,"input",23),t.NdJ("ngModelChange",function(n){t.CHM(e);const i=t.oxw();return t.KtG(i.checkboxState=n)})("ngModelChange",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onCheckboxStateChange())}),t.qZA()(),t.TgZ(41,"th",22),t._uU(42,"POS"),t.qZA(),t.TgZ(43,"th")(44,"ng-select",24),t.NdJ("change",function(){t.CHM(e);const n=t.oxw();return n.filter.PageSize=100,t.KtG(n.Filter(null,"search"))})("ngModelChange",function(n){t.CHM(e);const i=t.oxw();return t.KtG(i.filter.ChannelID=n)}),t.YNc(45,R,3,3,"ng-option",25),t.qZA()(),t._UZ(46,"th"),t.qZA()(),t.YNc(47,O,2,1,"tbody",26),t.qZA(),t.TgZ(48,"div",27)(49,"div",28)(50,"div",29),t._uU(51),t.ALo(52,"number"),t.YNc(53,K,3,0,"span",30),t.YNc(54,B,3,3,"span",31),t._uU(55),t.qZA()(),t.TgZ(56,"div",32),t.YNc(57,Y,3,0,"a",33),t.YNc(58,G,3,0,"a",34),t.qZA()()()()()()()}if(2&o){const e=t.oxw();t.Q6J("Title","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1)("textButton","Search"),t.xp6(7),t.Q6J("hidden",!e.hasSelection()),t.xp6(9),t.Q6J("ngModel",e.filter.PageNumber),t.xp6(4),t.Q6J("ngModel",e.filter.PageSize),t.xp6(5),t.Q6J("ngIf",3==e.filterModel&&!e.NonFull),t.xp6(15),t.Q6J("ngModel",e.checkboxState),t.xp6(4),t.Q6J("clearable",!1)("ngModel",e.filter.ChannelID),t.xp6(1),t.Q6J("ngForOf",e.Channel),t.xp6(2),t.Q6J("ngForOf",e.infiniteList),t.xp6(4),t.hij(" Showing 1 - ",t.lcZ(52,19,e.filter.PageSize*(e.filter.PageNumber-1)+e.data.length)," of "),t.xp6(2),t.Q6J("ngIf",e.hideCount),t.xp6(1),t.Q6J("ngIf",!e.hideCount),t.xp6(1),t.hij(" records ~ ",e.filter.PageNumber," Page "),t.xp6(2),t.Q6J("ngIf",e.nextPageDisabled&&!e.goToLast),t.xp6(1),t.Q6J("ngIf",e.nextPageDisabled&&!e.goToLast)}}let j=(()=>{class o{constructor(e,a,n){this.http=e,this.toastr=a,this.dialog=n,this.oldRowCount=-1,this.hideCount=!0,this.nextPageDisabled=!1,this.goToLast=!1,this.extendData=!1,this.filter={ChannelID:""},this.loading=!1,this.checkboxState=!1,this.showDifferenceStock=!1,this.NonFull=!1,this.LoaderChannel(),this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.filterModel=1,this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){}LoaderChannel(){this.http.post("/api/InventoryLoader/Load",{}).subscribe(e=>{this.Channel=e.Options.Channel,this.filter=e.Filter,this.Filter(),this.filter.IsMarketplaceAppActive||this.toastr.warning("Automatic inventory sync disabled.\n Please enable Dealpos X Marketplace Apps integration in POS Configuration","Warning")})}Filter(e,a){"search"===a&&(this.oldRowCount=this.filter.PageSize,this.goToLast=!1,this.extendData=!1,this.filter.PageNumber=1);const n={text:e,filterModel:this.filterModel,ID:this.filter.ChannelID,PageNumber:this.filter.PageNumber,RowCount:this.filter.PageSize};this.hideCount=!0,this.http.post("/api/Inventory/GetSingleChannelComparison",n).subscribe(i=>{this.data=i.Data,this.temp=i.Data,this.postFilter(i)})}UpdateStock(){let e=this.getSelected();if(e.length>0){let n=[];e.forEach(r=>n.push({ID:r.ID,Code:r.Code,Inventory:r.Inventory}));var a=[];a.push(this.filter.ChannelID);let i={ListChannelID:a,List:n};this.http.post("/api/Inventory/UpdateChannel",i).subscribe(r=>{this.info=r.Data,this.Filter(),this.toastr.success("Successfully updated "+i.List.length+" variants in "+i.ListChannelID.length+" channels","Success")})}}openScanDialog(){this.dialog.open(_.j,{data:{filter:this.filter,Channel:this.Channel},width:"30%"}).afterClosed().subscribe(a=>{null!=a&&(this.filter=a.filter,this.filter.sync?this.RefreshChannel():this.filter.sync||this.RefreshChannel())})}RefreshChannel(){let e={ID:this.filter.ChannelID,ScanFull:this.filter.ScanFull};this.http.post("/api/product/ScanOptimized",e).subscribe(a=>{this.info=a.Data,this.Filter(),this.toastr.success("Successfully scanned from "+this.getChannelName(e.ID),"Success")})}UpdateStockByVariant(e,a,n,i,r){this.http.post("/api/Inventory/UpdateQuantityByID",{ID:this.filter.ChannelID,ChannelItemID:e,ChannelVariantID:a,NewQuantity:n,VariantID:i,SKU:r}).subscribe(W=>{this.toastr.success(W.Data,"Success",{closeButton:!0,positionClass:"toast-bottom-right"});for(let T of this.data)if(T.ChannelItemID===e)for(let S of T.Variants)S.ChannelVariationID==a&&(S.Stock=n)})}onCheckboxStateProduct(e){let a=this.data.filter(n=>n.ID==e);if(a.length>0)for(let n of a)for(let i of n.Variants)i.Inventory>=0&&(i.selected=n.selected)}onCheckboxStateChange(){for(let e of this.data)for(let a of e.Variants)a.selected=this.checkboxState}getSelected(){let e=Array();return this.data&&this.data.forEach(a=>a.Variants.filter(n=>n.selected).forEach(n=>e.push(n))),e}hasSelection(){return!!this.data&&this.getSelected().length>0}getChannelName(e){return this.Channel.find(n=>n.ID==e).Name}openTableDialog(e,a,n,i){this.dialog.open(M.k,{data:{Name:e,Variant:a,ChannelID:n,Table:"inventory",ChannelItemID:i}}).afterClosed().subscribe(h=>{null!=h&&this.updateItemAfterDialog(h)})}updateItemAfterDialog(e){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:parseFloat(e.Inventory),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(n=>{this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") inventory in "+this.getChannelName(a.ID)+" to "+a.NewQuantity,"Success");for(let i of this.data)if(i.ChannelItemID===e.ChannelItemID)for(let r of i.Variants)r.ChannelVariationID==e.ChannelVariantID&&(r.Stock=e.Inventory)})}onShowDifferenceStock(){this.filterModel=this.showDifferenceStock?3:1,this.Filter()}StoreRowsCountAPIResult(e){this.http.post("api/Inventory/GetInventoryByChannelRowCount",{ID:this.filter.ChannelID,PageNumber:this.filter.PageNumber,RowCount:this.filter.RowCount}).subscribe(n=>{this.listTotal=n.Total,this.hideCount=!1,e&&(this.filter.PageSize=this.listTotal,this.goToLast=!0,this.filter.PageNumber=1,this.Filter())})}NextPage(e){this.filter.PageNumber=this.filter.PageNumber||1,this.filter.PageNumber+=1,this.extendData=e,this.Filter()}postFilter(e){this.extendData?(this.infiniteList=this.infiniteList.concat(e.Data),this.extendData=!1):this.infiniteList=e.Data,3==this.filterModel?0==e.Data.length?this.NonFull=!0:this.nextPageDisabled=!0:null!=e.Data.length&&(this.nextPageDisabled=!(e.Data.length<this.filter.PageSize))}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(C.O),t.Y36(I._W),t.Y36(v.uw))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-inventory-realtime"]],decls:1,vars:1,consts:[[3,"Title","pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],[3,"Title","pageData","hideSearchBox","textButton","onSubmit"],[1,"d-flex"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"hidden","click"],[1,"fas","fa-chevron-circle-up"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[3,"toggleChange"],[1,"fw-bold"],["scope","col",1,"text-start"],["scope","col",1,"text-end","w-10"],["type","checkbox",3,"ngModel","ngModelChange"],[3,"clearable","ngModel","change","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","font-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"text-start"],[1,"text-end"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["class","text-center",3,"ngClass",4,"ngIf"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-end"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img",3,"src",4,"ngIf","ngIfElse"],["elsePic",""],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"text-center",3,"ngClass"],[1,"row","justify-content-end","me-0"],[1,"col-8","px-0","text-center",3,"click"],[1,"col-2","ps-0","text-start","align-self-center"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,a){1&e&&t.YNc(0,H,59,21,"mainpanel",0),2&e&&t.Q6J("ngIf",a.data)},dependencies:[c.mk,c.sg,c.O5,p.Fj,p.wV,p.Wl,p.JJ,p.On,m.w9,m.jq,b.Rr,d.p,c.JJ],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]}),o})();var x=s(8063);const z=[{path:"",component:D,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:w,canActivate:[x.a],data:{title:"Inventory Comparison"}},{path:"bychannel",component:j,canActivate:[x.a],data:{title:"Inventory Comparison"}}]}];let $=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[c.ez,u.Bz.forChild(z)]}),o})(),E=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[c.ez,$,u.Bz,g.Z,p.u5,m.A0,b.rP,d.R,y.U]}),o})()}}]);