marketplacepos 2.3.0 → 2.3.1

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([[170],{2486:(k,T,i)=>{i.d(T,{j:()=>p});var g=i(5412),e=i(4650),t=i(6895),_=i(4006);function f(l,m){if(1&l){const o=e.EpF();e.TgZ(0,"li")(1,"mat-checkbox",8),e.NdJ("ngModelChange",function(C){const D=e.CHM(o).$implicit;return e.KtG(D.selected=C)}),e.TgZ(2,"div",9)(3,"h5",10),e._uU(4),e.qZA()()()()}if(2&l){const o=m.$implicit;e.xp6(1),e.Q6J("ngModel",o.selected),e.xp6(3),e.Oqu(o.Name)}}let p=(()=>{class l{constructor(o,d){this.data=o,this.dialogRef=d,this.selectedItems=this.data.selectedItems,this.channels=this.data.channels}ngOnInit(){}onOk(){this.dialogRef.close(this.channels)}onClose(){this.dialogRef.close()}}return l.\u0275fac=function(o){return new(o||l)(e.Y36(g.WI),e.Y36(g.so))},l.\u0275cmp=e.Xpm({type:l,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(o,d){1&o&&(e.TgZ(0,"h1",0),e._uU(1,"Update Inventory from POS to Channel"),e.qZA(),e._UZ(2,"hr"),e.TgZ(3,"mat-dialog-content",1)(4,"div")(5,"h6",2),e._uU(6),e._UZ(7,"br")(8,"br"),e._uU(9," Choose channels to update : "),e._UZ(10,"br")(11,"br"),e.qZA(),e.TgZ(12,"ul",3),e.YNc(13,f,5,2,"li",4),e.qZA()()(),e._UZ(14,"hr"),e.TgZ(15,"mat-dialog-actions",5)(16,"button",6),e.NdJ("click",function(){return d.onClose()}),e._uU(17,"Close"),e.qZA(),e.TgZ(18,"button",7),e.NdJ("click",function(){return d.onOk()}),e._uU(19,"Update"),e.qZA()()),2&o&&(e.xp6(6),e.hij("Updating ",null==d.selectedItems?null:d.selectedItems.length," items "),e.xp6(7),e.Q6J("ngForOf",d.channels))},dependencies:[t.sg,_.JJ,_.On,g.uh,g.xY,g.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}"]}),l})()},7398:(k,T,i)=>{i.d(T,{Z:()=>p,e:()=>f});var g=i(6895),e=i(8252),t=i(4650);function _(l,m){if(1&l&&(t.TgZ(0,"li",2)(1,"a",3),t._uU(2),t.qZA()()),2&l){const o=m.$implicit;t.xp6(1),t.s9C("routerLink",o.Url),t.xp6(1),t.hij(" ",o.Title," ")}}let f=(()=>{class l{}return l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=t.Xpm({type:l,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(o,d){1&o&&(t.TgZ(0,"ul",0),t.YNc(1,_,3,2,"li",1),t.qZA()),2&o&&(t.xp6(1),t.Q6J("ngForOf",d.Tabs))},dependencies:[g.sg,e.yS,e.Od]}),l})(),p=(()=>{class l{}return l.\u0275fac=function(o){return new(o||l)},l.\u0275mod=t.oAB({type:l}),l.\u0275inj=t.cJS({imports:[g.ez,e.Bz]}),l})()},5131:(k,T,i)=>{i.d(T,{j:()=>C});var g=i(5412),e=(()=>{return(r=e||(e={}))[r.Shopee=0]="Shopee",r[r.Tokopedia=1]="Tokopedia",r[r.WooCommerce=2]="WooCommerce",r[r.None=3]="None",r[r.KalCare=4]="KalCare",r[r.ShopeeV2=5]="ShopeeV2",r[r.Tiktok=6]="Tiktok",r[r.Lazada=7]="Lazada",e;var r})(),t=i(4650),_=i(6895),f=i(4006),p=i(1948),l=i(9549),m=i(4385),o=i(3238);function d(r,D){if(1&r&&(t.TgZ(0,"mat-option",14),t._UZ(1,"img",15),t._uU(2),t.qZA()),2&r){const u=D.$implicit;t.Q6J("value",u.ID),t.xp6(1),t.s9C("src",u.Img,t.LSH),t.xp6(1),t.hij(" ",u.Name,"")}}let C=(()=>{class r{constructor(u,c){this.dialogRef=u,this.data=c}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(u){let c=this.filterChannelById(u);c&&c.TypeID==e.Tokopedia?(this.data.filter.ScanFull=!0,this.isDisabledOptions=!0):(this.data.filter.ScanFull=!1,this.isDisabledOptions=!1)}filterChannelById(u){let c;return this.data.Channel&&(c=this.data.Channel.find(v=>v.ID==u)),c}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 r.\u0275fac=function(u){return new(u||r)(t.Y36(g.so),t.Y36(g.WI))},r.\u0275cmp=t.Xpm({type:r,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(u,c){1&u&&(t.TgZ(0,"h1",0),t._uU(1,"Scan Marketplace"),t.qZA(),t.TgZ(2,"mat-dialog-content",1)(3,"h5",2),t._uU(4,"Select a Channel"),t.qZA(),t.TgZ(5,"mat-form-field",3)(6,"mat-select",4),t.NdJ("ngModelChange",function(O){return c.data.filter.ChannelID=O})("ngModelChange",function(O){return c.onSelectChannel(O)}),t.YNc(7,d,3,3,"mat-option",5),t.qZA()(),t._UZ(8,"br"),t.TgZ(9,"div",6)(10,"h5",7),t._uU(11,"Scan Type"),t.qZA(),t.TgZ(12,"mat-radio-group",8),t.NdJ("ngModelChange",function(O){return c.data.filter.ScanFull=O}),t.TgZ(13,"mat-radio-button",9),t._uU(14," Full "),t.qZA(),t.TgZ(15,"mat-radio-button",10),t._uU(16," Active "),t.qZA()()()(),t.TgZ(17,"mat-dialog-actions",11)(18,"button",12),t.NdJ("click",function(){return c.close()}),t._uU(19,"Cancel"),t.qZA(),t.TgZ(20,"button",13),t.NdJ("click",function(){return c.submit()}),t._uU(21,"Scan"),t.qZA()()),2&u&&(t.xp6(6),t.Q6J("ngModel",c.data.filter.ChannelID),t.xp6(1),t.Q6J("ngForOf",c.data.Channel),t.xp6(2),t.Q6J("hidden",(null==c.data?null:c.data.hiddenRadioButton)||!(null!=c.data&&c.data.filter.ChannelID)),t.xp6(3),t.Q6J("ngModel",c.data.filter.ScanFull)("disabled",c.isDisabledOptions),t.xp6(1),t.Q6J("value",!0),t.xp6(2),t.Q6J("value",!1))},dependencies:[_.sg,f.JJ,f.On,g.uh,g.xY,g.H8,p.VQ,p.U0,l.KE,m.gD,o.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}"]}),r})()},1576:(k,T,i)=>{i.d(T,{k:()=>p});var g=i(5412),e=i(4650),t=i(4006),_=i(9549),f=i(4144);let p=(()=>{class l{constructor(o,d){this.dialogRef=o,this.item=d}ngOnInit(){this.selectedChannel=this.item.Variant.Channel.find(o=>o.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 l.\u0275fac=function(o){return new(o||l)(e.Y36(g.so),e.Y36(g.WI))},l.\u0275cmp=e.Xpm({type:l,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(o,d){1&o&&(e.TgZ(0,"h1",0),e._uU(1),e.qZA(),e.TgZ(2,"mat-dialog-content",1)(3,"mat-form-field")(4,"mat-label",2),e._uU(5,"Editing Data"),e.qZA(),e.TgZ(6,"input",3),e.NdJ("ngModelChange",function(r){return d.tempNum=r}),e.qZA()()(),e.TgZ(7,"mat-dialog-actions",4)(8,"button",5),e.NdJ("click",function(){return d.close()}),e._uU(9,"Cancel"),e.qZA(),e.TgZ(10,"button",6),e.NdJ("click",function(){return d.submit()}),e._uU(11,"Save"),e.qZA()()),2&o&&(e.xp6(1),e.HOy("",d.item.Name," ",d.item.Variant.Model," ",d.item.Table," in ",d.selectedChannel.Title,""),e.xp6(5),e.Q6J("ngModel",d.tempNum))},dependencies:[t.Fj,t.JJ,t.On,g.uh,g.xY,g.H8,_.KE,_.hX,f.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}"]}),l})()},455:(k,T,i)=>{i.d(T,{Rr:()=>v,rP:()=>A});var g=i(9643),e=i(4650),t=i(3238),_=i(2687),f=i(1281),p=i(4006);const l=["input"],m=function(a){return{enterDuration:a}},o=["*"],d=new e.OlP("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let C=0;const r={provide:p.JU,useExisting:(0,e.Gpc)(()=>v),multi:!0};class D{constructor(h,n){this.source=h,this.checked=n}}const u=(0,t.sb)((0,t.pj)((0,t.Kr)((0,t.Id)(class{constructor(a){this._elementRef=a}}))));let c=(()=>{class a extends u{constructor(n,s,b,M,E,I,P){super(n),this._focusMonitor=s,this._changeDetectorRef=b,this.defaults=E,this._onChange=Z=>{},this._onTouched=()=>{},this._required=!1,this._checked=!1,this.name=null,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.change=new e.vpe,this.toggleChange=new e.vpe,this.tabIndex=parseInt(M)||0,this.color=this.defaultColor=E.color||"accent",this._noopAnimations="NoopAnimations"===I,this.id=this._uniqueId=`${P}${++C}`}get required(){return this._required}set required(n){this._required=(0,f.Ig)(n)}get checked(){return this._checked}set checked(n){this._checked=(0,f.Ig)(n),this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(n=>{"keyboard"===n||"program"===n?this._focused=!0:n||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(n){this.checked=!!n}registerOnChange(n){this._onChange=n}registerOnTouched(n){this._onTouched=n}setDisabledState(n){this.disabled=n,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 a.\u0275fac=function(n){e.$Z()},a.\u0275dir=e.lG2({type:a,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:[e.qOj]}),a})(),v=(()=>{class a extends c{constructor(n,s,b,M,E,I){super(n,s,b,M,E,I,"mat-slide-toggle-")}_createChangeEvent(n){return new D(this,n)}_onChangeEvent(n){n.stopPropagation(),this.toggleChange.emit(),this.defaults.disableToggleValue?this._inputElement.nativeElement.checked=this.checked:(this.checked=this._inputElement.nativeElement.checked,this._emitChangeEvent())}_onInputClick(n){n.stopPropagation()}focus(n,s){s?this._focusMonitor.focusVia(this._inputElement,s,n):this._inputElement.nativeElement.focus(n)}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return a.\u0275fac=function(n){return new(n||a)(e.Y36(e.SBq),e.Y36(_.tE),e.Y36(e.sBO),e.$8M("tabindex"),e.Y36(d),e.Y36(e.QbO,8))},a.\u0275cmp=e.Xpm({type:a,selectors:[["mat-slide-toggle"]],viewQuery:function(n,s){if(1&n&&e.Gf(l,5),2&n){let b;e.iGM(b=e.CRH())&&(s._inputElement=b.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:13,hostBindings:function(n,s){2&n&&(e.Ikx("id",s.id),e.uIk("tabindex",null)("aria-label",null)("aria-labelledby",null)("name",null),e.ekj("mat-checked",s.checked)("mat-disabled",s.disabled)("mat-slide-toggle-label-before","before"==s.labelPosition)("_mat-animation-noopable",s._noopAnimations))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex"},exportAs:["matSlideToggle"],features:[e._Bn([r]),e.qOj],ngContentSelectors:o,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(n,s){if(1&n&&(e.F$t(),e.TgZ(0,"label",0,1)(2,"span",2)(3,"input",3,4),e.NdJ("change",function(M){return s._onChangeEvent(M)})("click",function(M){return s._onInputClick(M)}),e.qZA(),e.TgZ(5,"span",5),e._UZ(6,"span",6),e.TgZ(7,"span",7),e._UZ(8,"span",8),e.qZA()()(),e.TgZ(9,"span",9,10),e.NdJ("cdkObserveContent",function(){return s._onLabelTextChange()}),e.TgZ(11,"span",11),e._uU(12,"\xa0"),e.qZA(),e.Hsn(13),e.qZA()()),2&n){const b=e.MAs(1),M=e.MAs(10);e.uIk("for",s.inputId),e.xp6(2),e.ekj("mat-slide-toggle-bar-no-side-margin",!M.textContent||!M.textContent.trim()),e.xp6(1),e.Q6J("id",s.inputId)("required",s.required)("tabIndex",s.tabIndex)("checked",s.checked)("disabled",s.disabled),e.uIk("name",s.name)("aria-checked",s.checked)("aria-label",s.ariaLabel)("aria-labelledby",s.ariaLabelledby)("aria-describedby",s.ariaDescribedby),e.xp6(4),e.Q6J("matRippleTrigger",b)("matRippleDisabled",s.disableRipple||s.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",e.VKq(18,m,s._noopAnimations?0:150))}},dependencies:[t.wG,g.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}),a})(),y=(()=>{class a{}return a.\u0275fac=function(n){return new(n||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({}),a})(),A=(()=>{class a{}return a.\u0275fac=function(n){return new(n||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({imports:[y,t.si,t.BQ,g.Q8,y,t.BQ]}),a})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[231],{7398:(k,Z,s)=>{s.d(Z,{Z:()=>P,e:()=>t});var p=s(6895),C=s(8252),c=s(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:[p.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:[p.ez,C.Bz]}),u})()},5231:(k,Z,s)=>{s.r(Z),s.d(Z,{ProductModule:()=>_n});var p=s(6895),C=s(7398),c=s(4006),I=s(8252),t=s(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=s(5131),r=s(5412),y=s(3841);let w=(()=>{class e{constructor(n){this.LocalData=n}GetCategories(n,o,i){return new Promise(l=>{this.LocalData.getListByKey(n).then(g=>{null!=g?l(g):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 d=s(1318),v=s(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(d.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:[p.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",10),t._uU(3),t.qZA(),t.TgZ(4,"td",10),t._uU(5),t.qZA(),t.TgZ(6,"td",11)(7,"p",12),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",10),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",10),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",19)}function Q(e,a){1&e&&t._UZ(0,"img",20)}function V(e,a){1&e&&t._UZ(0,"img",21)}function Y(e,a){1&e&&t._UZ(0,"img",22)}function F(e,a){if(1&e&&(t.TgZ(0,"tr"),t.YNc(1,T,2,2,"td",13),t.YNc(2,J,2,2,"td",13),t.TgZ(3,"td",10),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",10),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",10),t._uU(10),t.qZA(),t.TgZ(11,"td",10)(12,"a",14),t.YNc(13,q,1,0,"img",15),t.YNc(14,Q,1,0,"img",16),t.YNc(15,V,1,0,"img",17),t.YNc(16,Y,1,0,"img",18),t.qZA()()()),2&e){const n=a.$implicit,o=a.index;t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(2),t.Oqu(t.lcZ(5,11,n.Inventory)),t.xp6(3),t.Oqu(t.lcZ(8,13,n.Price)),t.xp6(3),t.Oqu(n.Name),t.xp6(2),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",7),2&e){const n=t.oxw().$implicit;t.Q6J("ngForOf",null==n?null:n.Channel)}}function $(e,a){if(1&e&&(t.ynx(0),t.YNc(1,b,9,2,"ng-container",8),t.YNc(2,L,1,1,"ng-template",null,9,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 R=(()=>{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"],[1,"text-start","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,"VARIANT"),t.qZA(),t.TgZ(9,"th",5),t._uU(10,"SKU"),t.qZA(),t.TgZ(11,"th",5),t._uU(12,"INVENTORY"),t.qZA(),t.TgZ(13,"th",5),t._uU(14,"PRICE"),t.qZA(),t.TgZ(15,"th",6),t._uU(16,"NAME"),t.qZA(),t.TgZ(17,"th",5),t._uU(18,"CHANNEL"),t.qZA()()(),t.TgZ(19,"tbody"),t.YNc(20,$,4,2,"ng-container",7),t.qZA()()()),2&n&&(t.xp6(1),t.Oqu(o.title),t.xp6(19),t.Q6J("ngForOf",o.variants))},dependencies:[p.sg,p.O5,r.uh,r.xY,p.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=s(7185),N=s(266),O=s(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=a.$implicit,o=a.index,i=t.oxw(3).$implicit,l=t.oxw();t.xp6(2),t.Q6J("ngClass",t.VKq(4,tt,o!=l.sortVariant(null==i?null:i.Variants).length-1)),t.xp6(1),t.s9C("href",n.Url,t.LSH),t.xp6(1),t.Q6J("src",l.getChannelLogo(n),t.LSH),t.xp6(2),t.Oqu(n.Title)}}function et(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,nt,7,6,"li",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 ot(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,et,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>3)}}const it=function(){return{"no-title":"item?.Variants.length <= 1"}},at=function(e,a){return{"justify-content-between":e,"justify-content-end":a}};function lt(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,g=t.oxw();return t.KtG(g.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,ot,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,it)),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,at,(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 ct=(()=>{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(R,{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,g=i.categoryID,f=[];f.push(this.selectedItem.ID),this.uploadProduct(l,f,g)}})}openUploadBulkModal(){this.dialog.open(m,{width:"350px",data:{item:null,selectedItemMissingChannel:this.Channel}}).afterClosed().subscribe(n=>{if(n){let l=n.channelID,g=n.categoryID;var o=this.getSelected();if(o.length>0){var i=[];o.forEach(f=>i.push(f.ID)),this.uploadProduct(l,i,g)}}})}uploadProduct(n,o,i){this.http.post("/api/product/UploadToMarketplace",{ChannelID:n,Products:o,CategoryID:i||0}).subscribe(g=>{this.GetProducts();let f=this.Channel.find(hn=>hn.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(g=>g.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 g of l.Variants)n.push(g.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(d.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,lt,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:[p.mk,p.sg,p.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 rt(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",9)(7,"p",10),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 st(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 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.Code,"")}}function dt(e,a){1&e&&t._UZ(0,"img",17)}function gt(e,a){1&e&&t._UZ(0,"img",18)}function mt(e,a){1&e&&t._UZ(0,"img",19)}function ut(e,a){1&e&&t._UZ(0,"img",20)}function _t(e,a){if(1&e&&(t.TgZ(0,"tr"),t.YNc(1,st,2,2,"td",11),t.YNc(2,pt,2,2,"td",11),t.TgZ(3,"td",4),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",4),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",4),t._uU(10),t.qZA(),t.TgZ(11,"td",4)(12,"a",12),t.YNc(13,dt,1,0,"img",13),t.YNc(14,gt,1,0,"img",14),t.YNc(15,mt,1,0,"img",15),t.YNc(16,ut,1,0,"img",16),t.qZA()()()),2&e){const n=a.$implicit,o=a.index;t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(2),t.Oqu(t.lcZ(5,11,n.Inventory)),t.xp6(3),t.Oqu(t.lcZ(8,13,n.Price)),t.xp6(3),t.Oqu(n.Name),t.xp6(2),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 ht(e,a){if(1&e&&t.YNc(0,_t,17,15,"tr",6),2&e){const n=t.oxw().$implicit;t.Q6J("ngForOf",null==n?null:n.Channel)}}function ft(e,a){if(1&e&&(t.ynx(0),t.YNc(1,rt,9,2,"ng-container",7),t.YNc(2,ht,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 Ct=(()=>{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,"py-5","mt-4","mx-0"],[1,"table","border-bottom"],[1,"thead-light"],[1,"text-center"],[1,"text-start"],[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,"VARIANT"),t.qZA(),t.TgZ(9,"th",4),t._uU(10,"SKU"),t.qZA(),t.TgZ(11,"th",4),t._uU(12,"INVENTORY"),t.qZA(),t.TgZ(13,"th",4),t._uU(14,"PRICE"),t.qZA(),t.TgZ(15,"th",5),t._uU(16,"NAME"),t.qZA(),t.TgZ(17,"th",4),t._uU(18,"CHANNEL"),t.qZA()()(),t.TgZ(19,"tbody"),t.YNc(20,ft,4,2,"ng-container",6),t.qZA()()(),t._UZ(21,"hr")),2&n&&(t.xp6(1),t.Oqu(o.title),t.xp6(19),t.Q6J("ngForOf",o.variants))},dependencies:[p.sg,p.O5,r.uh,r.xY,p.JJ],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),e})();function xt(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 bt(e,a){1&e&&t._UZ(0,"img",25)}function It(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 Tt(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 Zt(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 Pt(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 vt(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 Ot(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 yt(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 Mt(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"div",29),t.YNc(2,Pt,2,1,"a",30),t.YNc(3,vt,2,1,"a",30),t.YNc(4,Ot,2,1,"a",30),t.YNc(5,yt,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 St=function(){return{"no-title":"item?.Variants.length <= 1"}};function wt(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,xt,1,1,"img",10),t.YNc(5,bt,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,g=t.oxw();return t.KtG(g.DialogVariant(l))}),t.TgZ(10,"h4",16),t._uU(11),t.qZA()()(),t.TgZ(12,"div",17)(13,"h4"),t.YNc(14,It,2,1,"span",18),t.qZA()()(),t.TgZ(15,"div",19)(16,"div",20),t.YNc(17,Tt,5,2,"div",21),t.YNc(18,Zt,5,2,"div",21),t.qZA()()()(),t.TgZ(19,"div",22),t.YNc(20,Mt,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,St)),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 Nt=(()=>{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(g=>-1!==g.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(Ct,{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(g=>g.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(d.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,wt,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:[p.mk,p.sg,p.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 Ut(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 Dt(e,a){1&e&&t._UZ(0,"img",17)}function kt(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 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.Title)}}function Jt(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"tbody")(1,"tr")(2,"td",10),t.YNc(3,Ut,1,1,"img",11),t.YNc(4,Dt,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,kt,2,1,"li",9),t.qZA()(),t.TgZ(15,"td")(16,"ul"),t.YNc(17,At,2,1,"li",9),t.qZA()(),t.TgZ(18,"td")(19,"button",14),t.NdJ("click",function(){const l=t.CHM(n).$implicit,g=t.oxw();return t.KtG(g.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(g=>(i=o.findIndex(f=>f.ChannelID===g.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(d.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,Jt,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:[p.sg,p.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=s(1948);let Qt=(()=>{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 Vt(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 Yt(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 Ft=(()=>{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,Vt,4,0,"a",4),t.YNc(9,Yt,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:[p.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=s(8796);function Lt(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 Rt(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 Et(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 Kt(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,Et,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 Gt(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 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.ChannelVariationSKU," ")}}function jt(e,a){if(1&e&&(t.TgZ(0,"tr")(1,"td",38),t.YNc(2,Gt,2,1,"ng-container",24),t.qZA(),t.TgZ(3,"td",39),t.YNc(4,Ht,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 Bt(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"div",34)(2,"table",35)(3,"tbody"),t.YNc(4,jt,5,8,"tr",37),t.qZA()()(),t.BQk()),2&e){const n=t.oxw().$implicit;t.xp6(4),t.Q6J("ngForOf",n.Variant)}}function Wt(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 zt(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 Xt(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 tn(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 nn(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 en(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 on(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"div",44),t.YNc(2,Xt,2,1,"a",45),t.YNc(3,tn,2,1,"a",45),t.YNc(4,nn,2,1,"a",45),t.YNc(5,en,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 an=function(e){return{itemTitle:e}};function ln(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,Lt,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,g=t.oxw();return t.KtG(g.showFullTitle(l))}),t.qZA()(),t.YNc(10,Rt,2,1,"div",21),t.qZA(),t.TgZ(11,"div",22)(12,"div",23),t.YNc(13,Kt,7,4,"ng-container",24),t.YNc(14,Bt,5,1,"ng-container",24),t.qZA()()()(),t.TgZ(15,"div",25)(16,"div",26),t.YNc(17,Wt,3,0,"button",27),t.YNc(18,zt,3,0,"ng-template",null,28,t.W1O),t.qZA(),t.TgZ(20,"div",29),t.YNc(21,on,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,an,!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 cn=(()=>{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(g=>null==g.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(Ft,{data:{type:this.dialogType,name:this.dialogName},width:"30%"})}openDownloadModal(){this.dialog.open(Qt,{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(d.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,ln,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:[p.mk,p.sg,p.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 rn(e,a){1&e&&t._UZ(0,"img",16)}function sn(e,a){1&e&&t._UZ(0,"img",17)}function pn(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 dn(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,rn,1,0,"img",10),t.YNc(6,sn,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,pn,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 gn=(()=>{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(d.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,dn,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:[p.sg,p.O5,c.JJ,c.On,O.p,U.w9,p.JJ]}),e})();var M=s(8063);const mn=[{path:"",component:P,children:[{path:"",redirectTo:"in-pos",pathMatch:"full"},{path:"in-pos",component:ct,canActivate:[M.a],data:{title:"Products in POS"}},{path:"sold-in-channel",component:Nt,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:cn,canActivate:[M.a],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:gn,canActivate:[M.a],data:{title:"Duplicate Sku in Channel"}}]}];let un=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[p.ez,I.Bz.forChild(mn)]}),e})(),_n=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[p.ez,C.Z,c.u5,I.Bz,un,N.AV,O.R,U.A0]}),e})()},5131:(k,Z,s)=>{s.d(Z,{j:()=>w});var p=s(5412),C=(()=>{return(d=C||(C={}))[d.Shopee=0]="Shopee",d[d.Tokopedia=1]="Tokopedia",d[d.WooCommerce=2]="WooCommerce",d[d.None=3]="None",d[d.KalCare=4]="KalCare",d[d.ShopeeV2=5]="ShopeeV2",d[d.Tiktok=6]="Tiktok",d[d.Lazada=7]="Lazada",C;var d})(),c=s(4650),I=s(6895),t=s(4006),P=s(1948),u=s(9549),h=s(4385),r=s(3238);function y(d,v){if(1&d&&(c.TgZ(0,"mat-option",14),c._UZ(1,"img",15),c._uU(2),c.qZA()),2&d){const _=v.$implicit;c.Q6J("value",_.ID),c.xp6(1),c.s9C("src",_.Img,c.LSH),c.xp6(1),c.hij(" ",_.Name,"")}}let w=(()=>{class d{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 d.\u0275fac=function(_){return new(_||d)(c.Y36(p.so),c.Y36(p.WI))},d.\u0275cmp=c.Xpm({type:d,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,p.uh,p.xY,p.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}"]}),d})()}}]);
@@ -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 N=(()=>{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,"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")(23,"tr",10)(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",11),e.qZA()(),e.TgZ(36,"app-mat-paginator-no-count",12),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 y(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,"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")(64,"tr",13)(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,y,9,7,"tr",14),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",16),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",17),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,"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")(25,"tr",11)(26,"th",12)(27,"input",13),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",14),e.qZA()(),e.TgZ(40,"app-mat-paginator-no-count",15),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",13),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,"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")(22,"tr",10)(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",11),e.qZA()(),e.TgZ(35,"app-mat-paginator-no-count",12),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",13),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,"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")(22,"tr",10)(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",11),e.qZA()(),e.TgZ(35,"app-mat-paginator-no-count",12),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",13),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,"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")(22,"tr",10)(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",11),e.qZA()(),e.TgZ(37,"app-mat-paginator-no-count",12),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",13),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,"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")(22,"tr",10)(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",11),e.qZA()(),e.TgZ(35,"app-mat-paginator-no-count",12),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",45),e.YNc(1,ie,2,1,"li",41),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",46),e._UZ(1,"i",47),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",42),e.YNc(18,oe,2,1,"ul",43),e.qZA(),e.TgZ(19,"td"),e.YNc(20,le,2,2,"span",44),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",30)(18,"tr"),e._UZ(19,"th",31),e.TgZ(20,"th",38),e._uU(21,"Number"),e.qZA(),e.TgZ(22,"th",39),e._uU(23),e.qZA(),e.TgZ(24,"th",40),e._uU(25,"Channel Status"),e.qZA(),e.TgZ(26,"th",40),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",41),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"],["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:N,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:(W,f,s)=>{s.r(f),s.d(f,{InventoryModule:()=>$});var c=s(6895),t=s(4650),u=s(8252),g=s(7398);let S=(()=>{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),D=s(2486),C=s(1318),I=s(7185),v=s(5412),d=s(7481);let Z=(()=>{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(D.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],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),o})();var w=s(1576),p=s(4006),m=s(8796),y=s(455);function M(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 N(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 R(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 A(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 P(o,l){1&o&&t._UZ(0,"img",51)}function U(o,l){if(1&o&&(t.ynx(0),t.TgZ(1,"td",43)(2,"div",44),t.YNc(3,R,1,1,"input",45),t.YNc(4,A,1,1,"img",46),t.YNc(5,P,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 k(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 J(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 F(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 Q=function(o){return{"bg-err":o}};function L(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,Q,(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 V(o,l){if(1&o&&(t.TgZ(0,"tr"),t.YNc(1,U,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,k,1,1,"input",41),t.qZA(),t.TgZ(8,"td",39),t.YNc(9,J,8,6,"span",31),t.YNc(10,F,3,3,"span",31),t.qZA(),t.YNc(11,L,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 q(o,l){if(1&o&&(t.TgZ(0,"tbody"),t.YNc(1,V,12,7,"tr",26),t.qZA()),2&o){const e=l.$implicit;t.xp6(1),t.Q6J("ngForOf",e.Variants)}}function O(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 K(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 B(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 Y(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 G(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,M,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,N,3,3,"ng-option",25),t.qZA()(),t._UZ(46,"th"),t.qZA()(),t.YNc(47,q,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,O,3,0,"span",30),t.YNc(54,K,3,3,"span",31),t._uU(55),t.qZA()(),t.TgZ(56,"div",32),t.YNc(57,B,3,0,"a",33),t.YNc(58,Y,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 H=(()=>{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(E=>{this.toastr.success(E.Data,"Success",{closeButton:!0,positionClass:"toast-bottom-right"});for(let x of this.data)if(x.ChannelItemID===e)for(let T of x.Variants)T.ChannelVariationID==a&&(T.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(w.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"],["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,G,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,y.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 b=s(8063);const j=[{path:"",component:S,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:Z,canActivate:[b.a],data:{title:"Inventory Comparison"}},{path:"bychannel",component:H,canActivate:[b.a],data:{title:"Inventory Comparison"}}]}];let z=(()=>{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(j)]}),o})(),$=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[c.ez,z,u.Bz,g.Z,p.u5,m.A0,y.rP,d.R]}),o})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[518],{6518:(Je,T,c)=>{c.r(T),c.d(T,{PriceModule:()=>we});var d=c(6895),I=c(7398),_=c(7481),f=c(8252),h=c(4006),C=c(8796),e=c(4650);let J=(()=>{class i{constructor(){this.priceTabs=[{Title:"Price Single Channel",Url:"/menu/price/SingleChannel"},{Title:"POS vs Channel Price",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}ngOnInit(){}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-price"]],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.priceTabs))},dependencies:[I.e,f.lC]}),i})();var S=c(5131),v=c(2486),u=c(9300),m=c(1318),x=c(7185),P=c(5412),b=c(1948);function N(i,l){if(1&i&&(e.TgZ(0,"mat-radio-button",3),e._uU(1),e.qZA()),2&i){const t=l.$implicit,n=l.index,o=e.oxw();e.Q6J("value",t.Key)("name",o.name)("title",o.tooltipsText[n]?o.tooltipsText[n]:""),e.xp6(1),e.hij(" ",t.Value,"")}}const F=function(i){return{"border-0":i}};let y=(()=>{class i{constructor(){this.modelChange=new e.vpe,this.border=!1,this.tooltipsText=[]}change(t){this.modelChange.emit(t)}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},decls:3,vars:5,consts:[[1,"form-control","h-100",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0)(1,"mat-radio-group",1),e.NdJ("ngModelChange",function(a){return n.change(a)}),e.YNc(2,N,2,4,"mat-radio-button",2),e.qZA()()),2&t&&(e.Q6J("ngClass",e.VKq(3,F,0==n.border)),e.xp6(1),e.Q6J("ngModel",n.model),e.xp6(1),e.Q6J("ngForOf",n.options))},dependencies:[d.mk,d.sg,b.VQ,b.U0,h.JJ,h.On],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]}),i})(),O=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.oAB({type:i}),i.\u0275inj=e.cJS({imports:[d.ez,b.Fk,h.u5]}),i})(),Q=(()=>{class i{constructor(t,n,o){this.http=t,this.toastr=n,this.dialog=o,this.loading=!1,this.LoaderChannel(),this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.filterModel=1,this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]}}ngOnInit(){}LoaderChannel(){this.http.post("/api/PriceLoader/LoadMultiple",{}).subscribe(t=>{this.Channel=t.Options.Channel,this.filter=t.Filter,this.Filter()})}openScanDialog(){this.dialog.open(S.j,{data:{filter:this.filter,Channel:this.Channel},width:"30%"}).afterClosed().subscribe(n=>{null!=n&&(this.filter=n.filter,this.RefreshChannel())})}RefreshChannel(){this.http.post("/api/product/ScanOptimized",{ID:this.filter.ID,ScanFull:this.filter.ScanFull}).subscribe(n=>{this.info=n.Data,this.Filter(),this.toastr.success("Successfully scanned from "+this.getChannelName(this.filter.ID),"Success")})}Filter(t){this.http.post("/api/Price/GetMultipleChannelComparison",{text:t,filterModel:this.filterModel,PageNumber:this.filter.PageNumber,RowCount:this.filter.RowCount}).subscribe(o=>{this.data=o.Data})}UpdatePrice(){let t=this.getSelected();if(t.length>0){let o=[];t.forEach(r=>o.push({ID:r.ID,Code:r.Code,Price:r.UnitPrice}));var n=[];for(let r of this.Channel)r.selected&&n.push(r.ID);let a={ListChannelID:n,ListPrice:o};this.http.post("/api/Price/UpdateChannel",a).subscribe(r=>{this.info=r.Data,this.Filter(),this.toastr.success("Successfully updated "+a.ListPrice.length+" items in "+a.ListChannelID.length+" channels","Success")})}}getSelected(){let t=Array();if(this.data){for(let n of this.data)for(let o of n.Variants)o.selected&&t.push(o);return t}return[]}hasSelection(){return!!this.data&&this.getSelected().length>0}UpdatePriceByVariant(t){let n={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:t.Price-0,VariantID:t.ID};this.http.post("/api/Price/UpdatePriceByID",n).subscribe(o=>{this.info=o.Data,this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") price in "+this.getChannelName(n.ID)+" to "+n.Price,"Success"),this.Filter()})}getChannelName(t){return this.Channel.find(o=>o.ID==t).Name}onUpdateItems(){const t=this.getSelected();this.dialog.open(v.j,{data:{selectedItems:t,channels:this.Channel},width:"40%"}).afterClosed().pipe((0,u.h)(n=>void 0!==n)).subscribe(n=>{this.Channel=n,this.UpdatePrice()})}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(m.O),e.Y36(x._W),e.Y36(P.uw))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-price-pos"]],decls:21,vars:12,consts:[[3,"Title","pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[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","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"hidden","click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","price",3,"data","channel","filter","onSubmit"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(a){return n.Filter(a)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Filter by"),e.qZA(),e.TgZ(6,"radio-options",2),e.NdJ("modelChange",function(a){return n.filterModel=a}),e.qZA()()()(),e.TgZ(7,"actions")(8,"div",3)(9,"div")(10,"button",4),e.NdJ("click",function(){return n.openScanDialog()}),e._UZ(11,"i",5),e._uU(12," Scan Channel "),e.qZA(),e.TgZ(13,"button",6),e.NdJ("click",function(){return n.onUpdateItems()}),e._UZ(14,"i",7),e._uU(15," Update "),e.qZA()()()(),e.TgZ(16,"content")(17,"div",8)(18,"div",9)(19,"div",10)(20,"app-table",11),e.NdJ("onSubmit",function(a){return n.UpdatePriceByVariant(a)}),e.qZA()()()()()()),2&t&&(e.Q6J("Title","Price Comparison")("pageData",n.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),e.xp6(6),e.Q6J("model",n.filterModel)("options",n.Options)("border",!1),e.xp6(7),e.Q6J("hidden",!n.hasSelection()),e.xp6(7),e.Q6J("data",n.data)("channel",n.Channel)("filter",n.filter))},dependencies:[_.p,y],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),i})();var U=c(6709);function R(i,l){if(1&i&&(e.TgZ(0,"th",33),e._uU(1),e.qZA()),2&i){const t=l.$implicit;e.xp6(1),e.Oqu(t.Name)}}function q(i,l){1&i&&(e.ynx(0),e.TgZ(1,"th",34),e._uU(2," Expected (POS) "),e.qZA(),e.TgZ(3,"th",34),e._uU(4," Channel "),e.qZA(),e.BQk())}function L(i,l){if(1&i&&e._UZ(0,"img",43),2&i){const t=e.oxw(3).$implicit;e.s9C("src",null==t?null:t.ImageUrl,e.LSH)}}function k(i,l){1&i&&e._UZ(0,"img",44)}const V=function(i){return{"border-bottom":i}};function $(i,l){if(1&i&&(e.ynx(0),e.TgZ(1,"td",38),e.YNc(2,L,1,1,"img",39),e.YNc(3,k,1,0,"ng-template",null,40,e.W1O),e.qZA(),e.TgZ(5,"td",41)(6,"h5",42),e._uU(7),e.qZA(),e._UZ(8,"br"),e.TgZ(9,"small"),e._uU(10),e.qZA()(),e.BQk()),2&i){const t=e.MAs(4),n=e.oxw().index,o=e.oxw().$implicit,a=e.oxw();e.xp6(1),e.Q6J("rowSpan",null==o?null:o.Variants.length)("ngClass",e.VKq(7,V,n+1==a.data.length)),e.xp6(1),e.Q6J("ngIf",null==o?null:o.ImageUrl)("ngIfElse",t),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,")")}}const E=function(i){return{"bg-err":i}};function Y(i,l){if(1&i&&(e.ynx(0),e.TgZ(1,"td",47),e._uU(2),e.ALo(3,"number"),e.qZA(),e.TgZ(4,"td",48)(5,"div",49)(6,"div",50),e._uU(7),e.ALo(8,"number"),e._UZ(9,"br"),e.qZA(),e.TgZ(10,"div",51)(11,"a",52),e._UZ(12,"i",53),e.qZA()()()(),e.BQk()),2&i){const t=l.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,4,t.PriceExpected)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(8,E,t.Price!=t.PriceExpected)),e.xp6(3),e.hij(" ",e.lcZ(8,6,t.Price)," "),e.xp6(4),e.Q6J("href",t.Url,e.LSH)}}function K(i,l){1&i&&(e.TgZ(0,"td",54),e._uU(1,"X"),e.qZA(),e.TgZ(2,"td",54),e._uU(3,"X"),e.qZA())}function j(i,l){if(1&i&&(e.ynx(0),e.YNc(1,Y,13,10,"ng-container",45),e.YNc(2,K,4,0,"ng-template",null,46,e.W1O),e.BQk()),2&i){const t=l.$implicit,n=e.MAs(3),o=e.oxw().$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",a.getItemFromChannel(o,t.ID))("ngIfElse",n)}}function B(i,l){if(1&i){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,$,11,9,"ng-container",35),e.TgZ(2,"td",36),e._uU(3),e.qZA(),e.TgZ(4,"td",36),e._uU(5),e.qZA(),e.TgZ(6,"td",37)(7,"input",18),e.NdJ("ngModelChange",function(o){const r=e.CHM(t).$implicit;return e.KtG(r.selected=o)}),e.qZA()(),e.YNc(8,j,4,2,"ng-container",19),e.qZA()}if(2&i){const t=l.$implicit,n=l.index,o=e.oxw(2);e.xp6(1),e.Q6J("ngIf",0==n),e.xp6(2),e.Oqu(null==t?null:t.Model),e.xp6(2),e.Oqu(null==t?null:t.Code),e.xp6(1),e.Q6J("hidden",o.filter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",t.selected),e.xp6(1),e.Q6J("ngForOf",o.Channel)}}function H(i,l){if(1&i&&(e.TgZ(0,"tbody"),e.YNc(1,B,9,6,"tr",19),e.qZA()),2&i){const t=l.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}function G(i,l){if(1&i){const t=e.EpF();e.TgZ(0,"li")(1,"mat-checkbox",55),e.NdJ("ngModelChange",function(o){const r=e.CHM(t).$implicit;return e.KtG(r.selected=o)}),e.TgZ(2,"div",3)(3,"h6",56),e._uU(4),e.qZA()()()()}if(2&i){const t=l.$implicit;e.xp6(1),e.Q6J("ngModel",t.selected),e.xp6(3),e.Oqu(t.Name)}}let X=(()=>{class i{constructor(t,n,o){this.http=t,this.toastr=n,this.dialog=o,this.filter={ChannelID:""},this.loading=!1,this.checkboxState=!1,this.LoaderChannel(),this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.filterModel=1,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]}}ngOnInit(){}LoaderChannel(){this.http.post("/api/PriceLoader/LoadMultiple",{}).subscribe(t=>{this.Channel=t.Options.Channel,this.filter=t.Filter,this.filter.HiddenIPOSInventory=!1,this.Filter()})}onCheckboxStateChange(){for(let t of this.data)for(let n of t.Variants)n.selected=this.checkboxState}getSelected(){let t=Array();if(this.data){for(let n of this.data)for(let o of n.Variants)o.selected&&t.push(o);return t}return[]}hasSelection(){return!!this.data&&this.getSelected().length>0}Filter(t){this.http.post("/api/Price/GetOutletPrice",{text:t,filterModel:this.filterModel,PageNumber:this.filter.PageNumber,RowCount:this.filter.RowCount}).subscribe(o=>{this.data=o.Data})}UpdatePrice(){let t=this.getSelected();if(t.length>0){let o=[];t.forEach(r=>o.push(r.ID));var n=[];for(let r of this.Channel)r.selected&&n.push(r.ID);let a={ListChannelID:n,ListID:o};this.http.post("/api/Price/UpdateChannelOutletPrice",a).subscribe(r=>{this.info=r.Data,this.Filter(),this.toastr.success("Successfully updated "+a.ListID.length+" items in "+a.ListChannelID.length+" channels","Success")})}}getItemFromChannel(t,n){return t.Channel.find(o=>o.ChannelID==n)}Actual(t){return t.Price}Expected(t){return t.PriceExpected}UpdatePriceByVariant(t,n,o,a){this.http.post("/api/Price/UpdatePriceByID",{ID:this.filter.ChannelID,ChannelItemID:t,ChannelVariantID:n,Price:o,VariantID:a}).subscribe(p=>{this.toastr.success(p.Data,"Success",{closeButton:!0,positionClass:"toast-bottom-right"});for(let s of this.data)if(s.ChannelItemID===t)for(let g of s.Variants)g.ChannelVariationID==n&&(g.Price=parseFloat(o))})}onUpdateItems(){const t=this.getSelected();this.dialog.open(v.j,{data:{selectedItems:t,channels:this.Channel},width:"40%"}).afterClosed().pipe((0,u.h)(n=>void 0!==n)).subscribe(n=>{this.Channel=n,this.UpdatePrice()})}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(m.O),e.Y36(x._W),e.Y36(P.uw))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-price-realtime"]],decls:58,vars:16,consts:[[3,"Title","pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"hidden","click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","5"],["scope","col","colspan","2","class","text-center border-bottom-0 border w-10 text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-20"],["scope","col",1,"text-start"],["scope","col",1,"text-start","w-10"],[3,"hidden"],["type","checkbox",3,"ngModel","ngModelChange"],[4,"ngFor","ngForOf"],["id","ModalScan","tabindex","-1","role","dialog","aria-labelledby","ModalScan","aria-hidden","true",1,"modal","pe-0","ps-5","ms-5"],[1,"modal-dialog","modal-dialog-centered","w-75"],[1,"modal-content","w-50"],[1,"modal-header"],["id","exampleModalLabel",1,"modal-title"],["type","button","data-dismiss","modal","aria-label","Close",1,"close"],["aria-hidden","true"],[1,"modal-body"],[1,"fw-light"],[1,"no-bullet"],[1,"modal-footer"],["type","button","data-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-success",3,"click"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","w-10","text-uppercase"],[1,"text-end","border-top-0","border","w-10"],[4,"ngIf"],[1,"text-start","border-bottom"],[1,"align-middle",3,"hidden"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img",3,"src",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-center","border-bottom",3,"rowSpan"],[1,"mb-0","item-name"],[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","border","pointer","cell-hover"],[1,"text-end","border","pointer","cell-hover",3,"ngClass"],[1,"row","justify-content-end","me-0"],[1,"col-8","px-0","text-center"],[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","border","text-end",2,"color","red"],[3,"ngModel","ngModelChange"],[1,"fw-light","me-2","my-auto"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(a){return n.Filter(a)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Filter by"),e.qZA(),e.TgZ(6,"radio-options",2),e.NdJ("modelChange",function(a){return n.filterModel=a}),e.qZA()()()(),e.TgZ(7,"actions")(8,"div",3)(9,"button",4),e.NdJ("click",function(){return n.onUpdateItems()}),e._UZ(10,"i",5),e._uU(11," Update "),e.qZA()()(),e.TgZ(12,"content")(13,"div",6)(14,"div",7)(15,"div",8)(16,"div",9)(17,"table",10)(18,"thead",11)(19,"tr"),e._UZ(20,"th",12),e.YNc(21,R,2,1,"th",13),e.qZA(),e.TgZ(22,"tr")(23,"th",14),e._uU(24,"Product"),e.qZA(),e.TgZ(25,"th",15),e._uU(26,"Variant"),e.qZA(),e.TgZ(27,"th",16),e._uU(28,"SKU"),e.qZA(),e.TgZ(29,"th",17)(30,"input",18),e.NdJ("ngModelChange",function(a){return n.checkboxState=a})("ngModelChange",function(){return n.onCheckboxStateChange()}),e.qZA()(),e.YNc(31,q,5,0,"ng-container",19),e.qZA()(),e.YNc(32,H,2,1,"tbody",19),e.qZA()()()()(),e.TgZ(33,"div",20)(34,"div",21)(35,"div",22)(36,"div",23)(37,"h5",24),e._uU(38,"Update Price from POS to Channel"),e.qZA(),e.TgZ(39,"button",25)(40,"span",26),e._uU(41,"\xd7"),e.qZA()()(),e.TgZ(42,"div",27)(43,"div")(44,"h6",28),e._uU(45),e._UZ(46,"br")(47,"br"),e._uU(48," Choose channels to update : "),e._UZ(49,"br")(50,"br"),e.qZA(),e.TgZ(51,"ul",29),e.YNc(52,G,5,2,"li",19),e.qZA()()(),e.TgZ(53,"div",30)(54,"button",31),e._uU(55,"Close"),e.qZA(),e.TgZ(56,"button",32),e.NdJ("click",function(){return n.UpdatePrice()}),e._uU(57,"Update"),e.qZA()()()()()()()),2&t&&(e.Q6J("Title","Price Comparison")("pageData",n.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),e.xp6(6),e.Q6J("model",n.filterModel)("options",n.Options)("border",!1),e.xp6(3),e.Q6J("hidden",!n.hasSelection()),e.xp6(12),e.Q6J("ngForOf",n.Channel),e.xp6(8),e.Q6J("hidden",n.filter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",n.checkboxState),e.xp6(1),e.Q6J("ngForOf",n.Channel),e.xp6(1),e.Q6J("ngForOf",n.data),e.xp6(13),e.hij("Updating ",n.getSelected().length," items "),e.xp6(7),e.Q6J("ngForOf",n.Channel))},dependencies:[d.mk,d.sg,d.O5,h.Wl,h.JJ,h.On,_.p,y,U.oG,d.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%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]}),i})();var A=c(8505),W=c(1576),z=c(1135),ee=c(4351),D=c(4004),te=c(4482),M=c(5403),ne=c(8421),ie=c(4671),oe=c(5032),ae=c(3269),re=c(5026),ce=c(4707),se=c(3099);let de=(()=>{class i{constructor(t){this.http=t,this.pagination$=new z.X(null),this.data$=this.pagination$.pipe((0,u.h)(n=>null!=n),(0,ee.b)(n=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(n)).pipe((0,D.U)(o=>o.Data))),function le(...i){const l=(0,ae.jO)(i);return(0,te.e)((t,n)=>{const o=i.length,a=new Array(o);let r=i.map(()=>!1),p=!1;for(let s=0;s<o;s++)(0,ne.Xf)(i[s]).subscribe((0,M.x)(n,g=>{a[s]=g,!p&&!r[s]&&(r[s]=!0,(p=r.every(ie.y))&&(r=null))},oe.Z));t.subscribe((0,M.x)(n,s=>{if(p){const g=[s,...a];n.next(l?l(...g):g)}}))})}(this.pagination$),(0,re.R)((n,o)=>{const[a,r]=n,[p]=o;return 1==r.PageNumber?[p,r]:[a.concat(p),r]}),(0,A.b)(([n,o])=>{this.setPageNumberFooter(o),this.setPaginationButtonState(o,n.length)}),(0,D.U)(([n])=>n),function pe(i,l,t){let n,o=!1;return i&&"object"==typeof i?({bufferSize:n=1/0,windowTime:l=1/0,refCount:o=!1,scheduler:t}=i):n=i??1/0,(0,se.B)({connector:()=>new ce.t(n,l,t),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}())}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this.footerPageNumber=t.PageNumber}setPaginationButtonState(t,n){this.disableNextButton=0==n||!(n<t.RowCount*t.PageNumber)}resetToFirstPage(t){t.PageNumber=1,this.pagination$.next(t),this.hideCount=!0,this.goToLastPage=!1}getAllData(t,n){t.RowCount=n,this.pagination$.next(t),this.goToLastPage=!0}}return i.\u0275fac=function(t){return new(t||i)(e.LFG(m.O))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();var w=c(455);function he(i,l){if(1&i){const t=e.EpF();e.TgZ(0,"actions")(1,"div",5)(2,"div")(3,"button",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().ngIf,a=e.oxw();return e.KtG(a.openScanDialog(o.Filter,o))}),e._UZ(4,"i",7),e._uU(5," Channel "),e.qZA(),e.TgZ(6,"button",8),e.NdJ("click",function(){const a=e.CHM(t).ngIf,r=e.oxw().ngIf,p=e.oxw();return e.KtG(p.updateStock(a,r.Filter))}),e._UZ(7,"i",9),e._uU(8," Update "),e.qZA()()(),e._UZ(9,"div")(10,"div"),e.qZA()}}function ge(i,l){if(1&i&&(e.TgZ(0,"ng-option",30),e._UZ(1,"img",31),e._uU(2),e.qZA()),2&i){const t=l.$implicit;e.Q6J("value",t.ID),e.xp6(1),e.s9C("src",t.Img,e.LSH),e.xp6(1),e.Oqu(t.Name)}}function _e(i,l){if(1&i){const t=e.EpF();e.TgZ(0,"input",41),e.NdJ("ngModelChange",function(o){e.CHM(t);const a=e.oxw(3).$implicit;return e.KtG(a.selected=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(3).$implicit,a=e.oxw().ngIf,r=e.oxw(2);return e.KtG(r.onCheckboxStateProduct(a,o.ID))}),e.qZA()}if(2&i){const t=e.oxw(3).$implicit;e.Q6J("ngModel",t.selected)}}function ue(i,l){if(1&i&&e._UZ(0,"img",42),2&i){const t=e.oxw(3).$implicit;e.s9C("src",t.ThumbnailUrl,e.LSH)}}function me(i,l){1&i&&e._UZ(0,"img",43)}function fe(i,l){if(1&i&&(e.ynx(0),e.TgZ(1,"td",35)(2,"div",36),e.YNc(3,_e,1,1,"input",37),e.YNc(4,ue,1,1,"img",38),e.YNc(5,me,1,0,"ng-template",null,39,e.W1O),e.qZA()(),e.TgZ(7,"td",35)(8,"span",40),e._uU(9),e.qZA(),e._UZ(10,"br"),e.TgZ(11,"small"),e._uU(12),e.qZA()(),e.BQk()),2&i){const t=e.MAs(6),n=e.oxw().$implicit,o=e.oxw().$implicit;e.xp6(1),e.Q6J("rowSpan",o.Variants.length),e.xp6(2),e.Q6J("ngIf",n.Inventory>=0||o.Variants.length>1),e.xp6(1),e.Q6J("ngIf",o.ThumbnailUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",o.Variants.length),e.xp6(2),e.Oqu(o.Name),e.xp6(3),e.hij("(",o.Category,")")}}function Ce(i,l){if(1&i){const t=e.EpF();e.TgZ(0,"input",44),e.NdJ("ngModelChange",function(o){e.CHM(t);const a=e.oxw().$implicit;return e.KtG(a.selected=o)}),e.qZA()}if(2&i){const t=e.oxw().$implicit;e.Q6J("ngModel",t.selected)}}const xe=function(i){return{"bg-err":i}};function Pe(i,l){if(1&i){const t=e.EpF();e.TgZ(0,"td",45)(1,"div",46)(2,"div",47),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,a=e.oxw().$implicit,r=e.oxw().ngIf,p=e.oxw().ngIf,s=e.oxw();return e.KtG(s.openTableDialog(a.Name,o,null==o?null:o.Channel[0].ChannelID,o.Channel[0].ChannelItemID,r,p))}),e._uU(3),e.ALo(4,"number"),e.qZA(),e.TgZ(5,"div",48)(6,"a",49),e._UZ(7,"i",50),e.qZA()()()()}if(2&i){const t=e.oxw().$implicit;e.Q6J("ngClass",e.VKq(5,xe,t.UnitPrice!=t.Channel[0].Price)),e.xp6(3),e.hij(" ",e.lcZ(4,3,t.Channel[0].Price)," "),e.xp6(3),e.Q6J("href",t.Channel[0].Url,e.LSH)}}function be(i,l){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,fe,13,7,"ng-container",4),e.TgZ(2,"td",17),e._uU(3),e.qZA(),e.TgZ(4,"td",18),e._uU(5),e.qZA(),e.TgZ(6,"td",32),e.YNc(7,Ce,1,1,"input",33),e.qZA(),e.TgZ(8,"td",18),e._uU(9),e.ALo(10,"number"),e.qZA(),e.YNc(11,Pe,8,7,"td",34),e.qZA()),2&i){const t=l.$implicit,n=l.index;e.xp6(1),e.Q6J("ngIf",0==n),e.xp6(2),e.Oqu(t.Model),e.xp6(2),e.hij(" ",t.Code," "),e.xp6(2),e.Q6J("ngIf",t.Inventory>=0),e.xp6(2),e.hij(" ",e.lcZ(10,6,t.UnitPrice)," "),e.xp6(2),e.Q6J("ngIf",t.Channel.length>0)}}function Ze(i,l){if(1&i&&(e.ynx(0),e.YNc(1,be,12,8,"tr",22),e.BQk()),2&i){const t=l.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}function Te(i,l){if(1&i){const t=e.EpF();e.TgZ(0,"span",51),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2).ngIf,a=e.oxw();return e.KtG(a.getAllDataCount(o.Filter))}),e.TgZ(1,"i",52),e._uU(2,"?"),e.qZA()()}}function Ie(i,l){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&i){const t=l.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Total))}}function Se(i,l){if(1&i){const t=e.EpF();e.TgZ(0,"a",53),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2).ngIf,a=e.oxw();return e.KtG(a.nextPage(o.Filter))}),e._UZ(1,"i",54),e._uU(2," Next"),e.qZA()}}function ve(i,l){if(1&i){const t=e.EpF();e.TgZ(0,"a",55),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2).ngIf,a=e.oxw();return e.KtG(a.getAllData(o.Filter))}),e._UZ(1,"i",56),e._uU(2," Last"),e.qZA()}}function ye(i,l){if(1&i){const t=e.EpF();e.TgZ(0,"content")(1,"div",10)(2,"div",11)(3,"table",12)(4,"thead",13)(5,"tr")(6,"th",14),e._uU(7," Product "),e.TgZ(8,"div")(9,"mat-slide-toggle",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const a=e.oxw(2);return e.KtG(a.toggleDifferentInventory=o)})("toggleChange",function(){e.CHM(t);const o=e.oxw().ngIf,a=e.oxw();return e.KtG(a.onToggleDifferentInventory(o))}),e.TgZ(10,"small",16),e._uU(11,"Filter Different Inventory"),e.qZA()()()(),e.TgZ(12,"th",17),e._uU(13,"Variant"),e.qZA(),e.TgZ(14,"th",18),e._uU(15,"SKU"),e.qZA(),e.TgZ(16,"th")(17,"input",19),e.NdJ("change",function(o){const r=e.CHM(t).ngIf,p=e.oxw(2);return e.KtG(p.onSelectAllSKU(o.target.checked,r))}),e.qZA()(),e.TgZ(18,"th",18),e._uU(19,"POS"),e.qZA(),e.TgZ(20,"th")(21,"ng-select",20),e.NdJ("ngModelChange",function(o){e.CHM(t);const a=e.oxw().ngIf;return e.KtG(a.Filter.ID=o)})("change",function(){e.CHM(t);const o=e.oxw().ngIf,a=e.oxw();return e.KtG(a.search(o.Filter))}),e.YNc(22,ge,3,3,"ng-option",21),e.qZA()(),e._UZ(23,"th"),e.qZA()(),e.TgZ(24,"tbody"),e.YNc(25,Ze,2,1,"ng-container",22),e.qZA()(),e.TgZ(26,"div",23)(27,"div",24)(28,"div",25),e._uU(29),e.ALo(30,"number"),e.YNc(31,Te,3,0,"span",26),e.YNc(32,Ie,3,3,"span",4),e.ALo(33,"async"),e._uU(34),e.qZA()(),e.TgZ(35,"div",27),e.YNc(36,Se,3,0,"a",28),e.YNc(37,ve,3,0,"a",29),e.qZA()()()()()}if(2&i){const t=l.ngIf,n=e.oxw().ngIf,o=e.oxw();e.xp6(9),e.Q6J("ngModel",o.toggleDifferentInventory),e.xp6(12),e.Q6J("clearable",!1)("ngModel",n.Filter.ID),e.xp6(1),e.Q6J("ngForOf",n.Options.Channel),e.xp6(3),e.Q6J("ngForOf",t),e.xp6(4),e.hij(" Showing 1 - ",e.lcZ(30,11,null==t?null:t.length)," of "),e.xp6(2),e.Q6J("ngIf",o.infP.hideCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(33,13,!o.infP.hideCount&&o.allDataCount$)),e.xp6(2),e.hij(" records ~ ",o.infP.footerPageNumber," Page "),e.xp6(2),e.Q6J("ngIf",o.infP.disableNextButton&&!o.infP.goToLastPage),e.xp6(1),e.Q6J("ngIf",o.infP.disableNextButton&&!o.infP.goToLastPage)}}function Ue(i,l){if(1&i){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("textChange",function(o){const r=e.CHM(t).ngIf;return e.KtG(r.Filter.text=o)})("onSubmit",function(){const a=e.CHM(t).ngIf,r=e.oxw();return e.KtG(r.search(a.Filter))}),e.TgZ(1,"filters")(2,"div",2)(3,"div")(4,"label"),e._uU(5,"Page Size"),e.qZA(),e.TgZ(6,"input",3),e.NdJ("ngModelChange",function(o){const r=e.CHM(t).ngIf;return e.KtG(r.Filter.RowCount=o)}),e.qZA()()()(),e.YNc(7,he,11,0,"actions",4),e.ALo(8,"async"),e.YNc(9,ye,38,15,"content",4),e.ALo(10,"async"),e.qZA()}if(2&i){const t=l.ngIf,n=e.oxw();e.Q6J("Title",n.pageTitle)("text",t.Filter.text),e.xp6(6),e.Q6J("ngModel",t.Filter.RowCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(8,5,n.infP.data$)),e.xp6(2),e.Q6J("ngIf",e.lcZ(10,7,n.infP.data$))}}let Ae=(()=>{class i{constructor(t,n,o,a){this.http=t,this.infPagination=n,this.toastr=o,this.dialog=a,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount"}get infP(){return this.infPagination}ngOnInit(){this.infP.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe((0,A.b)(t=>{this.infP.resetToFirstPage(t.Filter)}))}onToggleDifferentInventory(t){t.Filter.filterModel=this.toggleDifferentInventory?1:3,this.search(t.Filter)}onCheckboxStateProduct(t,n){let o=t.filter(a=>a.ID==n);o.length>0&&o[0].Variants.forEach(a=>a.selected=o[0].selected)}openScanDialog(t,n){this.dialog.open(S.j,{data:{filter:t,Channel:n.Options.Channel},width:"30%"}).afterClosed().pipe((0,u.h)(o=>o)).subscribe(o=>{this.refreshChannel(n)})}refreshChannel(t){let n={ID:t.Filter.ID,ScanFull:t.Filter.ScanFull};console.log(t,n),this.http.post("/api/product/ScanOptimized",n).subscribe(()=>{this.search(t.Filter),this.toastr.success("Successfully scanned from "+this.getChannelName(t.Options.Channel,n.ID),"Success")})}getChannelName(t,n){return t.find(a=>a.ID==n).Name}updateStock(t,n){let a=[];t.forEach(p=>p.Variants.filter(s=>s.selected)?.forEach(s=>{a.push({ID:s.ID,ChannelID:s.Channel[0].ChannelID,Code:s.Code,Price:s.UnitPrice})}));let r={ListChannelID:[n.ID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",r).subscribe(()=>{this.search(n),this.toastr.success("Successfully updated "+r.ListPrice.length+" variants in "+r.ListChannelID.length+" channels","Success")})}getSelectedProduct(t){return t.filter(n=>n.selected)}search(t){this.infP.resetToFirstPage(t)}getAllDataCount(t){this.infP.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,t)}nextPage(t){this.infP.onNextPage(t)}getAllData(t){this.http.post(`/API/${this.allDataCountEndpoint}`,t).subscribe({next:n=>{this.infP.getAllData(t,n.Total)}})}openTableDialog(t,n,o,a,r,p){this.dialog.open(W.k,{data:{Name:t,Variant:n,ChannelID:o,Table:"price",ChannelItemID:a}}).afterClosed().subscribe(g=>{null!=g&&this.updateItemAfterDialog(g,r,p)})}updateItemAfterDialog(t,n,o){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:parseFloat(t.Price),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(r=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+this.getChannelName(o.Options.Channel,a.ID)+" to "+a.Price,"Success")})}onSelectAllSKU(t,n){n.forEach(o=>o.Variants.forEach(a=>a.selected=t))}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(m.O),e.Y36(de),e.Y36(x._W),e.Y36(P.uw))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"Title","text","textChange","onSubmit",4,"ngIf"],[3,"Title","text","textChange","onSubmit"],["container",""],["type","number",3,"ngModel","ngModelChange"],[4,"ngIf"],[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,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center"],["name","differentInventory",3,"ngModel","ngModelChange","toggleChange"],[1,"font-weight-bold"],[1,"text-left"],[1,"text-right"],["type","checkbox",1,"me-3",3,"change"],["name","channelOption",3,"clearable","ngModel","ngModelChange","change"],[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,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor:pointer",3,"click",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"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[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-center"],["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"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"text-center",3,"ngClass"],[1,"row","justify-content-end","me-0"],[1,"col-8","px-0","text-center",2,"cursor","pointer",3,"click"],[1,"col-2","ps-0","text-left","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(t,n){1&t&&(e.YNc(0,Ue,11,9,"mainpanel",0),e.ALo(1,"async")),2&t&&e.Q6J("ngIf",e.lcZ(1,1,n.loader$))},dependencies:[d.mk,d.sg,d.O5,h.Fj,h.wV,h.Wl,h.JJ,h.On,_.p,C.w9,C.jq,w.Rr,d.Ov,d.JJ],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}"]}),i})();var Z=c(8063);const De=[{path:"",component:J,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:Q,canActivate:[Z.a],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:X,canActivate:[Z.a],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:Ae,canActivate:[Z.a],data:{title:"Price Single Channel Comparison"}}]}];let Me=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.oAB({type:i}),i.\u0275inj=e.cJS({imports:[d.ez,f.Bz.forChild(De)]}),i})(),we=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.oAB({type:i}),i.\u0275inj=e.cJS({imports:[d.ez,h.u5,I.Z,_.R,f.Bz,C.A0,Me,h.UX,w.rP,O,U.p9]}),i})()}}]);
@@ -1 +0,0 @@
1
- (()=>{"use strict";var e,v={},_={};function r(e){var n=_[e];if(void 0!==n)return n.exports;var t=_[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(n,t,f,c)=>{if(!t){var a=1/0;for(o=0;o<e.length;o++){for(var[t,f,c]=e[o],l=!0,i=0;i<t.length;i++)(!1&c||a>=c)&&Object.keys(r.O).every(u=>r.O[u](t[i]))?t.splice(i--,1):(l=!1,c<a&&(a=c));if(l){e.splice(o--,1);var b=f();void 0!==b&&(n=b)}}return n}c=c||0;for(var o=e.length;o>0&&e[o-1][2]>c;o--)e[o]=e[o-1];e[o]=[t,f,c]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},(()=>{var n,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;r.t=function(t,f){if(1&f&&(t=this(t)),8&f||"object"==typeof t&&t&&(4&f&&t.__esModule||16&f&&"function"==typeof t.then))return t;var c=Object.create(null);r.r(c);var o={};n=n||[null,e({}),e([]),e(e)];for(var a=2&f&&t;"object"==typeof a&&!~n.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(l=>o[l]=()=>t[l]);return o.default=()=>t,r.d(c,o),c}})(),r.d=(e,n)=>{for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,t)=>(r.f[t](e,n),n),[])),r.u=e=>(592===e?"common":e)+"."+{6:"fc79ecc0c0a33462",22:"738096d8317ec65b",46:"8652d978a45ce5ab",126:"cdcda87dcc3da677",170:"f2067bfd5ecb2a86",231:"adb8d56e26375a9c",285:"17f6cbef78acd327",472:"519965afdb7a160d",512:"eddb4675a9016de6",518:"aff0cf9876e146d2",585:"c93552ac67f4550c",592:"34d3e7dcd2b85c7a",616:"507588c0a5d7b9e1",717:"62ca448a74adc1c2",739:"82b92600f9519019",763:"42fa4c0d665819d3",767:"0ce42314dea8dfea",796:"3be8ad424aad7864"}[e]+".js",r.miniCssF=e=>{},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="pos-marketplace:";r.l=(t,f,c,o)=>{if(e[t])e[t].push(f);else{var a,l;if(void 0!==c)for(var i=document.getElementsByTagName("script"),b=0;b<i.length;b++){var d=i[b];if(d.getAttribute("src")==t||d.getAttribute("data-webpack")==n+c){a=d;break}}a||(l=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",n+c),a.src=r.tu(t)),e[t]=[f];var s=(g,u)=>{a.onerror=a.onload=null,clearTimeout(p);var m=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),m&&m.forEach(h=>h(u)),g)return g(u)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=s.bind(null,a.onerror),a.onload=s.bind(null,a.onload),l&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="https://cdn.jsdelivr.net/npm/marketplacepos@2.3.0/Marketplace/",(()=>{var e={666:0};r.f.j=(f,c)=>{var o=r.o(e,f)?e[f]:void 0;if(0!==o)if(o)c.push(o[2]);else if(666!=f){var a=new Promise((d,s)=>o=e[f]=[d,s]);c.push(o[2]=a);var l=r.p+r.u(f),i=new Error;r.l(l,d=>{if(r.o(e,f)&&(0!==(o=e[f])&&(e[f]=void 0),o)){var s=d&&("load"===d.type?"missing":d.type),p=d&&d.target&&d.target.src;i.message="Loading chunk "+f+" failed.\n("+s+": "+p+")",i.name="ChunkLoadError",i.type=s,i.request=p,o[1](i)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var n=(f,c)=>{var i,b,[o,a,l]=c,d=0;if(o.some(p=>0!==e[p])){for(i in a)r.o(a,i)&&(r.m[i]=a[i]);if(l)var s=l(r)}for(f&&f(c);d<o.length;d++)r.o(e,b=o[d])&&e[b]&&e[b][0](),e[b]=0;return r.O(s)},t=self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})()})();