marketplacepos 2.3.2 → 2.3.5

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([[115],{7398:(w,x,r)=>{r.d(x,{Z:()=>Z,e:()=>t});var s=r(6895),g=r(8252),c=r(4650);function T(m,f){if(1&m&&(c.TgZ(0,"li",2)(1,"a",3),c._uU(2),c.qZA()()),2&m){const p=f.$implicit;c.xp6(1),c.s9C("routerLink",p.Url),c.xp6(1),c.hij(" ",p.Title," ")}}let t=(()=>{class m{}return m.\u0275fac=function(p){return new(p||m)},m.\u0275cmp=c.Xpm({type:m,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(p,M){1&p&&(c.TgZ(0,"ul",0),c.YNc(1,T,3,2,"li",1),c.qZA()),2&p&&(c.xp6(1),c.Q6J("ngForOf",M.Tabs))},dependencies:[s.sg,g.yS,g.Od]}),m})(),Z=(()=>{class m{}return m.\u0275fac=function(p){return new(p||m)},m.\u0275mod=c.oAB({type:m}),m.\u0275inj=c.cJS({imports:[s.ez,g.Bz]}),m})()},3115:(w,x,r)=>{r.r(x),r.d(x,{ProductModule:()=>ln});var s=r(6895),g=r(7398),c=r(4006),T=r(8252),t=r(4650);let Z=(()=>{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:[g.e,T.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 m{}var f=r(5241),p=r(5412),M=r(3841);let D=(()=>{class e{constructor(n){this.LocalData=n}GetCategories(n,o,i){return new Promise(l=>{this.LocalData.getListByKey(n).then(d=>{null!=d?l(d):this.getCategoriesByTypeID(n,o,i).then(C=>{l(C)})})})}getCategoriesByTypeID(n,o,i){return new Promise(l=>{i.post("/api/Channel/getCategoriesByTypeID",{TypeID:n,ID:o}).subscribe(C=>{this.LocalData.saveList(C,n),l(C)})})}}return e.\u0275fac=function(n){return new(n||e)(t.LFG(M.F))},e.\u0275prov=t.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var h=r(1318),v=r(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 u=(()=>{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(p.WI),t.Y36(D),t.Y36(h.O),t.Y36(p.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:[s.O5,p.uh,p.xY,p.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 I(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"tr")(2,"td",9),t._uU(3),t.qZA(),t.TgZ(4,"td",9),t._uU(5),t.qZA(),t.TgZ(6,"td",10)(7,"p",11),t._uU(8,"Product Not in Channel!"),t.qZA()()(),t.BQk()),2&e){const n=t.oxw().$implicit;t.xp6(3),t.hij(" ",null==n?null:n.Model,""),t.xp6(2),t.hij(" ",null==n?null:n.Code,"")}}function P(e,a){if(1&e&&(t.TgZ(0,"td",9),t._uU(1),t.qZA()),2&e){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Model,"")}}function q(e,a){if(1&e&&(t.TgZ(0,"td",9),t._uU(1),t.qZA()),2&e){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Code,"")}}function Q(e,a){1&e&&t._UZ(0,"img",18)}function V(e,a){1&e&&t._UZ(0,"img",19)}function F(e,a){1&e&&t._UZ(0,"img",20)}function Y(e,a){1&e&&t._UZ(0,"img",21)}function L(e,a){if(1&e&&(t.TgZ(0,"tr")(1,"td",9),t._uU(2),t.qZA(),t.YNc(3,P,2,2,"td",12),t.YNc(4,q,2,2,"td",12),t.TgZ(5,"td",9),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",9),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",9)(12,"a",13),t.YNc(13,Q,1,0,"img",14),t.YNc(14,V,1,0,"img",15),t.YNc(15,F,1,0,"img",16),t.YNc(16,Y,1,0,"img",17),t.qZA()()()),2&e){const n=a.$implicit,o=a.index;t.xp6(2),t.Oqu(n.Name),t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(2),t.Oqu(t.lcZ(7,11,n.Price)),t.xp6(3),t.Oqu(t.lcZ(10,13,n.Inventory)),t.xp6(3),t.s9C("href",n.Url,t.LSH),t.s9C("title",n.Title),t.xp6(1),t.Q6J("ngIf",1==n.TypeID),t.xp6(1),t.Q6J("ngIf",0==n.TypeID||5==n.TypeID),t.xp6(1),t.Q6J("ngIf",2==n.TypeID),t.xp6(1),t.Q6J("ngIf",6==n.TypeID)}}function E(e,a){if(1&e&&t.YNc(0,L,17,15,"tr",6),2&e){const n=t.oxw().$implicit;t.Q6J("ngForOf",null==n?null:n.Channel)}}function R(e,a){if(1&e&&(t.ynx(0),t.YNc(1,I,9,2,"ng-container",7),t.YNc(2,E,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 A=(()=>{class e{constructor(n){this.data=n,this.variants=n.variants,this.title=n.title}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(p.WI))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-modal-variant"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"pt-2","pb-3","text-center"],[1,"pb-5","mx-0"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"sticky-top"],[1,"text-center","sticky-top"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-center"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-center",4,"ngIf"],["target","_blank",3,"href","title"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"],["src","https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp"],["src","https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png"]],template:function(n,o){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"table",2)(5,"thead",3)(6,"tr",4)(7,"th",5),t._uU(8,"PRODUCT"),t.qZA(),t.TgZ(9,"th",5),t._uU(10,"VARIANT"),t.qZA(),t.TgZ(11,"th",5),t._uU(12,"SKU"),t.qZA(),t.TgZ(13,"th",5),t._uU(14,"PRICE"),t.qZA(),t.TgZ(15,"th",5),t._uU(16,"INVENTORY"),t.qZA(),t.TgZ(17,"th",5),t._uU(18,"CHANNEL"),t.qZA()()(),t.TgZ(19,"tbody"),t.YNc(20,R,4,2,"ng-container",6),t.qZA()()()),2&n&&(t.xp6(1),t.Oqu(o.title),t.xp6(19),t.Q6J("ngForOf",o.variants))},dependencies:[s.sg,s.O5,p.uh,p.xY,s.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 b=(()=>{return(e=b||(b={})).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",b;var e})(),y=r(7185),N=r(266),O=r(7481);function K(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",12),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.openScanDialog())}),t._UZ(1,"i",3),t._uU(2," Scan Channel "),t.qZA()}}function $(e,a){if(1&e&&t._UZ(0,"img",28),2&e){const n=t.oxw().$implicit;t.s9C("src",null==n?null:n.ThumbnailUrl,t.LSH)}}function B(e,a){1&e&&t._UZ(0,"img",29)}function G(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",30)(1,"input",31),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",32)(2,"h4")(3,"span",33),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",34),t._uU(2),t.qZA(),t.TgZ(3,"span",34),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 W(e,a){if(1&e&&(t.TgZ(0,"div")(1,"span",35),t._uU(2),t.qZA(),t.TgZ(3,"span",34),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 z(e,a){if(1&e){const n=t.EpF();t.ynx(0),t.TgZ(1,"div",36)(2,"button",37),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 X(e,a){if(1&e&&(t.TgZ(0,"div",41)(1,"a",42),t._UZ(2,"img",43),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 tt(e,a){if(1&e&&(t.ynx(0),t.YNc(1,X,3,3,"div",40),t.BQk()),2&e){const n=a.index;t.xp6(1),t.Q6J("ngIf",n<4)}}const nt=function(e){return{"border-bottom pb-2":e}};function et(e,a){if(1&e&&(t.TgZ(0,"li")(1,"div",47)(2,"div",48)(3,"a",49),t._UZ(4,"img",43),t.TgZ(5,"span",50),t._uU(6),t.qZA()()()()()),2&e){const n=t.oxw(),o=n.index,i=n.$implicit,l=t.oxw(3).$implicit,d=t.oxw();t.xp6(2),t.Q6J("ngClass",t.VKq(4,nt,o!=d.sortVariant(null==l?null:l.Variants).length-1)),t.xp6(1),t.s9C("href",i.Url,t.LSH),t.xp6(1),t.Q6J("src",d.getChannelLogo(i),t.LSH),t.xp6(2),t.Oqu(i.Title)}}function ot(e,a){if(1&e&&(t.ynx(0),t.YNc(1,et,7,6,"li",24),t.BQk()),2&e){const n=a.index;t.xp6(1),t.Q6J("ngIf",n>3)}}function it(e,a){if(1&e&&(t.TgZ(0,"div",41)(1,"div",44),t._UZ(2,"i",45),t.TgZ(3,"ul",46),t.YNc(4,ot,2,1,"ng-container",39),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 at(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"div",38),t.YNc(2,tt,2,1,"ng-container",39),t.YNc(3,it,5,1,"div",40),t.qZA(),t.BQk()),2&e){const n=t.oxw().$implicit,o=t.oxw();t.xp6(2),t.Q6J("ngForOf",o.sortVariant(null==n?null:n.Variants)),t.xp6(1),t.Q6J("ngIf",o.sortVariant(null==n?null:n.Variants).length>4)}}const lt=function(){return{"no-title":"item?.Variants.length <= 1"}},ct=function(e,a){return{"justify-content-between":e,"justify-content-end":a}};function rt(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",13)(1,"div",14)(2,"div",15)(3,"div",16),t.YNc(4,$,1,1,"img",17),t.YNc(5,B,1,0,"img",18),t.qZA(),t.TgZ(6,"div",19)(7,"div",20)(8,"div",21)(9,"h4",22),t.NdJ("click",function(){const l=t.CHM(n).index,d=t.oxw();return t.KtG(d.DialogVariant(l))}),t._uU(10),t.qZA()(),t.YNc(11,G,2,1,"div",23),t.YNc(12,H,5,1,"ng-container",24),t.qZA(),t.TgZ(13,"div",25)(14,"div",26),t.YNc(15,j,5,2,"div",24),t.YNc(16,W,6,2,"div",24),t.qZA()()()(),t.TgZ(17,"div",27),t.YNc(18,z,5,0,"ng-container",24),t.YNc(19,at,4,2,"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.ImageUrl),t.xp6(1),t.Q6J("ngIf",!(null!=n&&n.ImageUrl)),t.xp6(4),t.Q6J("ngClass",t.DdM(11,lt)),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,ct,(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 st=(()=>{class e{constructor(n,o,i){this.http=n,this.toastr=o,this.dialog=i,this.filter=new m,this.total=0,this.loading=!1,this.syncupdatefull=!1,this.OptionVisible=!1,this.channelLogo=b,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(A,{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(u,{width:"600px",data:{item:n,selectedItemMissingChannel:o}}).afterClosed().subscribe(i=>{if(i){let l=i.channelID,d=i.categoryID,C=[];C.push(this.selectedItem.ID),this.uploadProduct(l,C,d)}})}openUploadBulkModal(){this.dialog.open(u,{width:"350px",data:{item:null,selectedItemMissingChannel:this.Channel}}).afterClosed().subscribe(n=>{if(n){let l=n.channelID,d=n.categoryID;var o=this.getSelected();if(o.length>0){var i=[];o.forEach(C=>i.push(C.ID)),this.uploadProduct(l,i,d)}}})}uploadProduct(n,o,i){this.http.post("/api/product/UploadToMarketplace",{ChannelID:n,Products:o,CategoryID:i||0}).subscribe(d=>{this.GetProducts();let C=this.Channel.find(cn=>cn.ID==n);this.toastr.success(o.length>1?"Successfully uploaded "+o.length+" Product to channel "+C.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(d=>d.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(f.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(f.j,{data:{filter:this.filter,Channel:this.Channel.filter(o=>1==o.TypeID),isSingleChannel:this.hasSelection()},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 d of l.Variants)n.push(d.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=b.SHOOPE;break;case 1:o=b.TOKOPEDIA;break;case 2:o=b.WOOCOMMERCE;break;case 6:o=b.TIKTOK}return o}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(h.O),t.Y36(y._W),t.Y36(p.uw))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-in-pos"]],decls:16,vars:9,consts:[["hideSearchDropdown","true","hideSearchDropdown","false",3,"Title","onSubmit"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"hidden","click"],[1,"fas","fa-lg","fa-crosshairs"],[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"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[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"],[1,"img-logo",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,"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"),t.YNc(2,K,3,0,"button",1),t.TgZ(3,"button",2),t.NdJ("click",function(){return o.openScanSingleDialog()}),t._UZ(4,"i",3),t._uU(5),t.qZA(),t.TgZ(6,"button",4),t.NdJ("click",function(){return o.openUploadBulkModal()}),t._UZ(7,"i",5),t._uU(8," Upload Bulk"),t.qZA()(),t.TgZ(9,"content")(10,"div",6)(11,"div",7),t.YNc(12,rt,20,15,"div",8),t.qZA(),t.TgZ(13,"div",9)(14,"div",10)(15,"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(2),t.Q6J("ngIf",!o.hasSelection()),t.xp6(1),t.Q6J("hidden",!o.hasSelection()),t.xp6(2),t.hij(" Scan Selected Product (",o.getSelected().length,") "),t.xp6(1),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:[s.mk,s.sg,s.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 dt(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 pt(e,a){1&e&&t._UZ(0,"img",25)}function ut(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 gt(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 mt(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 _t(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 ht(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 ft(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 Ct(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 bt(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"div",29),t.YNc(2,_t,2,1,"a",30),t.YNc(3,ht,2,1,"a",30),t.YNc(4,ft,2,1,"a",30),t.YNc(5,Ct,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 xt=function(){return{"no-title":"item?.Variants.length <= 1"}};function It(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,dt,1,1,"img",10),t.YNc(5,pt,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,d=t.oxw();return t.KtG(d.DialogVariant(l))}),t.TgZ(10,"h4",16),t._uU(11),t.qZA()()(),t.TgZ(12,"div",17)(13,"h4"),t.YNc(14,ut,2,1,"span",18),t.qZA()()(),t.TgZ(15,"div",19)(16,"div",20),t.YNc(17,gt,5,2,"div",21),t.YNc(18,mt,5,2,"div",21),t.qZA()()()(),t.TgZ(19,"div",22),t.YNc(20,bt,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,xt)),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 Tt=(()=>{class e{constructor(n,o,i){this.http=n,this.dialog=o,this.toastr=i,this.filter=new m,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(d=>-1!==d.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(A,{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(d=>d.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(f.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(h.O),t.Y36(p.uw),t.Y36(y._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,It,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:[s.mk,s.sg,s.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 Pt(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 Zt(e,a){1&e&&t._UZ(0,"img",17)}function vt(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 Ot(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 Mt(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"tbody")(1,"tr")(2,"td",10),t.YNc(3,Pt,1,1,"img",11),t.YNc(4,Zt,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,vt,2,1,"li",9),t.qZA()(),t.TgZ(15,"td")(16,"ul"),t.YNc(17,Ot,2,1,"li",9),t.qZA()(),t.TgZ(18,"td")(19,"button",14),t.NdJ("click",function(){const l=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.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 St=(()=>{class e{constructor(n,o,i){this.http=n,this.dialog=o,this.toastr=i,this.filter=new m,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(f.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(d=>(i=o.findIndex(C=>C.ChannelID===d.ID),-1!==i))}openUploadModal(n){this.selectedItem=n;let o=this.filterChannel(n);this.dialog.open(u,{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(h.O),t.Y36(p.uw),t.Y36(y._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,Mt,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:[s.sg,s.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 J=r(1948);let yt=(()=>{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(p.WI),t.Y36(p.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,p.uh,p.xY,p.H8,J.VQ,J.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 wt(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 Dt(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 Nt=(()=>{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(p.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,wt,4,0,"a",4),t.YNc(9,Dt,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:[s.O5,p.uh,p.xY],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.text-larger[_ngcontent-%COMP%]{font-size:larger}"]}),e})();var U=r(8796);function Ut(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 kt(e,a){1&e&&t._UZ(0,"img",31)}function At(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 Jt(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 k=function(e){return{"border-0":e}};function qt(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,Jt,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,k,null==n.ChannelItemSKU)),t.xp6(1),t.Q6J("ngIf",null!=n.ChannelItemSKU)}}function Qt(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 Vt(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 Ft(e,a){if(1&e&&(t.TgZ(0,"tr")(1,"td",38),t.YNc(2,Qt,2,1,"ng-container",24),t.qZA(),t.TgZ(3,"td",39),t.YNc(4,Vt,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,k,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,k,null==n.ChannelVariationSKU)),t.xp6(1),t.Q6J("ngIf",null!=n.ChannelVariationSKU)}}function Yt(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"div",34)(2,"table",35)(3,"tbody"),t.YNc(4,Ft,5,8,"tr",37),t.qZA()()(),t.BQk()),2&e){const n=t.oxw().$implicit;t.xp6(4),t.Q6J("ngForOf",n.Variant)}}function Lt(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 Et(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 Rt(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 Kt(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 $t(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 Bt(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 Gt(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"div",44),t.YNc(2,Rt,2,1,"a",45),t.YNc(3,Kt,2,1,"a",45),t.YNc(4,$t,2,1,"a",45),t.YNc(5,Bt,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 Ht=function(e){return{itemTitle:e}};function jt(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,Ut,1,1,"img",15),t.YNc(5,kt,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,d=t.oxw();return t.KtG(d.showFullTitle(l))}),t.qZA()(),t.YNc(10,At,2,1,"div",21),t.qZA(),t.TgZ(11,"div",22)(12,"div",23),t.YNc(13,qt,7,4,"ng-container",24),t.YNc(14,Yt,5,1,"ng-container",24),t.qZA()()()(),t.TgZ(15,"div",25)(16,"div",26),t.YNc(17,Lt,3,0,"button",27),t.YNc(18,Et,3,0,"ng-template",null,28,t.W1O),t.qZA(),t.TgZ(20,"div",29),t.YNc(21,Gt,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,Ht,!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 Wt=(()=>{class e{constructor(n,o,i){this.http=n,this.toastr=o,this.dialog=i,this.filter=new m,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(d=>null==d.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(f.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(Nt,{data:{type:this.dialogType,name:this.dialogName},width:"30%"})}openDownloadModal(){this.dialog.open(yt,{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(h.O),t.Y36(y._W),t.Y36(p.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,jt,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:[s.mk,s.sg,s.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 zt(e,a){1&e&&t._UZ(0,"img",16)}function Xt(e,a){1&e&&t._UZ(0,"img",17)}function tn(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 nn(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,zt,1,0,"img",10),t.YNc(6,Xt,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,tn,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 en=(()=>{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(h.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,nn,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:[s.sg,s.O5,c.JJ,c.On,O.p,U.w9,s.JJ]}),e})();var S=r(8063);const on=[{path:"",component:Z,children:[{path:"",redirectTo:"in-pos",pathMatch:"full"},{path:"in-pos",component:st,canActivate:[S.a],data:{title:"Products in POS"}},{path:"sold-in-channel",component:Tt,canActivate:[S.a],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:St,canActivate:[S.a],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Wt,canActivate:[S.a],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:en,canActivate:[S.a],data:{title:"Duplicate Sku in Channel"}}]}];let an=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[s.ez,T.Bz.forChild(on)]}),e})(),ln=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[s.ez,g.Z,c.u5,T.Bz,an,N.AV,O.R,U.A0]}),e})()},5241:(w,x,r)=>{r.d(x,{j:()=>D});var s=r(5412),g=r(9694),c=r(4650),T=r(6895),t=r(4006),Z=r(1948),m=r(9549),f=r(4385),p=r(3238);function M(h,v){if(1&h&&(c.TgZ(0,"mat-option",14),c._UZ(1,"img",15),c._uU(2),c.qZA()),2&h){const _=v.$implicit;c.Q6J("value",_.ID),c.xp6(1),c.Q6J("src",_.Img,c.LSH),c.xp6(1),c.hij(" ",_.Name," ")}}let D=(()=>{class h{constructor(_,u){this.dialogRef=_,this.data=u}ngOnInit(){this.data.filter.mode=0,this.data.filter.sync=!0,this.data.filter.ScanFull=!0,this.isSingleChannel=void 0!==this.data.isSingleChannel&&this.data.isSingleChannel,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 u=this.filterChannelById(_);u&&u.TypeID==g.x.Tokopedia?(this.data.filter.ScanFull=!0,this.isDisabledOptions=!0):(this.data.filter.ScanFull=!1,this.isDisabledOptions=!1)}filterChannelById(_){let u;return this.data.Channel&&(u=this.data.Channel.find(I=>I.ID==_)),u}submit(){this.data.filter.ScanFull?this.data.filter.ScanFull=!0:this.data.filter.ScanFull||(this.data.filter.ScanFull=!1),this.dialogRef.close(this.data)}close(){this.dialogRef.close()}}return h.\u0275fac=function(_){return new(_||h)(c.Y36(s.so),c.Y36(s.WI))},h.\u0275cmp=c.Xpm({type:h,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){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(P){return u.data.filter.ChannelID=P})("ngModelChange",function(P){return u.onSelectChannel(P)}),c.YNc(7,M,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(P){return u.data.filter.ScanFull=P}),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 u.close()}),c._uU(19,"Cancel"),c.qZA(),c.TgZ(20,"button",13),c.NdJ("click",function(){return u.submit()}),c._uU(21,"Scan"),c.qZA()()),2&_&&(c.xp6(6),c.Q6J("ngModel",u.data.filter.ChannelID),c.xp6(1),c.Q6J("ngForOf",u.data.Channel),c.xp6(2),c.Q6J("hidden",(null==u.data?null:u.data.hiddenRadioButton)||!(null!=u.data&&u.data.filter.ChannelID)||u.isSingleChannel),c.xp6(3),c.Q6J("ngModel",u.data.filter.ScanFull)("disabled",u.isDisabledOptions),c.xp6(1),c.Q6J("value",!0),c.xp6(2),c.Q6J("value",!1))},dependencies:[T.sg,t.JJ,t.On,s.uh,s.xY,s.H8,Z.VQ,Z.U0,m.KE,f.gD,p.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}"]}),h})()},9694:(w,x,r)=>{r.d(x,{x:()=>s});var s=(()=>{return(g=s||(s={}))[g.Shopee=0]="Shopee",g[g.Tokopedia=1]="Tokopedia",g[g.WooCommerce=2]="WooCommerce",g[g.None=3]="None",g[g.KalCare=4]="KalCare",g[g.ShopeeV2=5]="ShopeeV2",g[g.Tiktok=6]="Tiktok",g[g.Lazada=7]="Lazada",s;var g})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[22],{22:(L,h,a)=>{a.r(h),a.d(h,{LoginModule:()=>I});var m=a(6895),l=a(4006),p=a(8252),t=a(4650),u=a(1318),_=a(7185),b=a(4810),C=a(8002);const x=["domainAutoFocus"],w=["passAutoFocus"];function v(o,s){1&o&&(t.TgZ(0,"p"),t._uU(1," Domain is required "),t.qZA())}function y(o,s){1&o&&(t.TgZ(0,"p"),t._uU(1," Please enter a valid dealpos domain "),t.qZA())}function M(o,s){if(1&o&&(t.TgZ(0,"div",38),t.YNc(1,v,2,0,"p",39),t.YNc(2,y,2,0,"p",39),t.qZA()),2&o){t.oxw();const e=t.MAs(18);t.xp6(1),t.Q6J("ngIf",e.errors.required),t.xp6(1),t.Q6J("ngIf",e.errors.pattern)}}function Z(o,s){1&o&&(t.TgZ(0,"p"),t._uU(1," Username is required "),t.qZA())}function P(o,s){if(1&o&&(t.TgZ(0,"div",38),t.YNc(1,Z,2,0,"p",39),t.qZA()),2&o){t.oxw();const e=t.MAs(24);t.xp6(1),t.Q6J("ngIf",e.errors.required)}}const T=function(o,s){return{"fa-eye":o,"fa-eye-slash":s}};function O(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"i",40),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.hideShowPassword())}),t.qZA()}if(2&o){const e=t.oxw();t.Q6J("ngClass",t.WLB(1,T,"eye-off"==e.passwordIcon,"eye"==e.passwordIcon))}}function A(o,s){1&o&&(t.TgZ(0,"p"),t._uU(1," Password is required "),t.qZA())}function k(o,s){if(1&o&&(t.TgZ(0,"div",38),t.YNc(1,A,2,0,"p",39),t.qZA()),2&o){t.oxw();const e=t.MAs(31);t.xp6(1),t.Q6J("ngIf",e.errors.required)}}function S(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"a",41),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.redirectForgetPass())}),t._uU(1,"Forgot Password?"),t.qZA()}}const U=[{path:"",component:(()=>{class o{constructor(e,n,i,r,c,g){this.http=e,this._router=n,this.elementRef=i,this.toastr=r,this.checkBrowser=c,this.konversi=g,this.login={Host:"",Username:"",Password:""},this.passwordType="password",this.passwordIcon="eye-off",this.getCookies();var d=JSON.parse(window.localStorage.getItem("user"));let f=new Date;null!=d&&(null!=d.expiredAt?window.localStorage.removeItem("user"):new Date(d.Token.expiredAt)>f&&this._router.navigate(["menu"]))}ngOnInit(){this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor="#dfeffc",this.browser=this.checkBrowser.getBrowserName()}ngOnDestroy(){this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor="white"}getCookies(){let e=localStorage.getItem("Authorization");if(null!=e){let n=JSON.parse(e);this.login.Host=n.Host,this.login.Username=n.Username}}setAutoFocusDomain(){this.domainElementRef.nativeElement.focus()}setAutoFocusPass(){this.passElementRef.nativeElement.focus()}DoLogin(){this.http.post("/api/token/Login",this.login).subscribe(e=>{if(null!=e.Token.access_token){window.localStorage.removeItem("user"),window.localStorage.setItem("user",JSON.stringify(e));let n="This user is lack of these following roles :",i=!0,r=!0,c=!0,g=!0,d=this.konversi.GetNamePOS();"True"!=d.Sell&&(i=!1,n=`${n} <br/> Sell Create`),"True"!=d.SellEditor&&(r=!1,n=`${n} <br/> Sell Editor`),"True"!=d.DelC&&(c=!1,n=`${n} <br/> Delivery Create`),"True"!=d.PayC&&(g=!1,n=`${n} <br/> Payment Create`),(!i||!r||!c||!g)&&this.toastr.warning(n,"Warning!",{enableHtml:!0}),window.localStorage.removeItem("Intercom"),window.localStorage.setItem("Intercom",JSON.stringify(e.IntercomWidget)),window.localStorage.removeItem("Authorization"),window.localStorage.setItem("Authorization",JSON.stringify({Host:this.login.Host,Username:this.login.Username})),this._router.navigate(e.Channel.length<1?["menu/channel"]:["menu"])}})}redirectForgetPass(){window.open(this.makeForgotPassLink(),"_blank")}makeForgotPassLink(){var e=this.login.Host;return"/"==e[e.length-1]&&(e=e.slice(0,-1)),e.includes("https://")||(e="https://"+e),e+"/ForgotPassword"}hideShowPassword(){this.passwordType="text"===this.passwordType?"password":"text",this.passwordIcon="eye-off"===this.passwordIcon?"eye":"eye-off"}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(u.O),t.Y36(p.F0),t.Y36(t.SBq),t.Y36(_._W),t.Y36(b.T),t.Y36(C.e))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-login"]],viewQuery:function(e,n){if(1&e&&(t.Gf(x,5),t.Gf(w,5)),2&e){let i;t.iGM(i=t.CRH())&&(n.domainElementRef=i.first),t.iGM(i=t.CRH())&&(n.passElementRef=i.first)}},decls:60,vars:9,consts:[[1,"container"],[1,"row","mt-md-0","align-self-center"],[1,"col-12","col-md-7","text-center"],[1,"big-display","robotoslab","d-none","d-sm-block"],["src","https://res.cloudinary.com/pos/image/upload/v1657855612/Apps/Login/Omnichannel.png","alt","integration-image",1,"img-fluid"],[1,"col-12","col-md-5","order-first","order-md-last","mt-12"],[1,"big-display","text-center","my-5","py-5","robotoslab","d-block","d-sm-none"],[1,"card"],[1,"card-body"],[1,"card-title"],[1,"ms-2","fw-normal","font-xl","robotoslab"],[1,"mt-10"],[1,"form-label-group"],["type","text","required","","name","Host","id","inputHost","placeholder","POS Domain (xyz.dealpos.com)","pattern","(https:\\/\\/)?\\w+.dealpos(.com|.net|.co.id)(\\/)?",1,"form-control","text-start",3,"ngModel","ngModelChange"],["domainAutoFocus","","domain","ngModel"],["for","inputHost",1,"text-start"],["class","text-danger",4,"ngIf"],["type","text","name","Username","id","inputUsername","placeholder","Username","required","",1,"form-control","text-start",3,"ngModel","ngModelChange"],["username","ngModel"],["for","inputUsername",1,"text-start"],[1,"form-label-group","mb-5","mb-sm-2"],["name","Password","id","inputPassword","placeholder","Password","required","",1,"form-control","text-start",3,"type","ngModel","ngModelChange"],["passAutoFocus","","password","ngModel"],["for","inputPassword",1,"text-start"],["class","passwordIcon fas fa-lg",3,"ngClass","click",4,"ngIf"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","col-lg-auto","order-first","order-lg-last"],["href","",3,"click",4,"ngIf"],[1,"col-12","col-lg-5","order-last","order-lg-last","text-end"],["data-cy","login","type","submit",1,"btn","btn-lg","btn-primary","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"col-12","d-block","d-md-none","text-center"],[1,"pt-1rem","me-3"],["target","_blank","href","https://www.dealpos.com"],["src","https://res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png","alt","dealpos-logo",1,"img-fluid"],["target","_blank","href","https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete",1,"pt-1rem","font-italic"],[1,"mx-5","pb-5","mb-5","d-none","d-md-block"],[1,"col-auto","d-inline-flex"],[1,"col-auto"],[1,"text-danger"],[4,"ngIf"],[1,"passwordIcon","fas","fa-lg",3,"ngClass","click"],["href","",3,"click"]],template:function(e,n){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),t._uU(4,"DealPOS Omnichannel"),t.qZA(),t._UZ(5,"img",4),t.qZA(),t.TgZ(6,"div",5)(7,"h1",6),t._uU(8,"DealPOS X Marketplace"),t.qZA(),t.TgZ(9,"div",7)(10,"div",8)(11,"div",9)(12,"h2",10),t._uU(13,"Sign in"),t.qZA()(),t.TgZ(14,"form",11)(15,"div",12)(16,"input",13,14),t.NdJ("ngModelChange",function(r){return n.login.Host=r}),t.qZA(),t.TgZ(19,"label",15),t._uU(20,"POS Domain (xyz.dealpos.com)"),t.qZA()(),t.YNc(21,M,3,2,"div",16),t.TgZ(22,"div",12)(23,"input",17,18),t.NdJ("ngModelChange",function(r){return n.login.Username=r}),t.qZA(),t.TgZ(25,"label",19),t._uU(26,"Username"),t.qZA()(),t.YNc(27,P,2,1,"div",16),t.TgZ(28,"div",20)(29,"input",21,22),t.NdJ("ngModelChange",function(r){return n.login.Password=r}),t.qZA(),t.TgZ(32,"label",23),t._uU(33,"Password"),t.qZA(),t.YNc(34,O,1,4,"i",24),t.qZA(),t.YNc(35,k,2,1,"div",16),t.TgZ(36,"div",25)(37,"div",26),t.YNc(38,S,2,0,"a",27),t.qZA(),t.TgZ(39,"div",28)(40,"button",29),t.NdJ("click",function(){return n.DoLogin()}),t._uU(41,"Log in"),t.qZA()()()()()()(),t.TgZ(42,"div",30)(43,"p",31),t._uU(44,"Powered by : "),t.qZA(),t.TgZ(45,"a",32),t._UZ(46,"img",33),t.qZA(),t._UZ(47,"br"),t.TgZ(48,"a",34),t._uU(49,"Version 2.3.1"),t.qZA()()()(),t.TgZ(50,"footer",35)(51,"div",25)(52,"div",36)(53,"p",31),t._uU(54,"Powered by : "),t.qZA(),t.TgZ(55,"a",32),t._UZ(56,"img",33),t.qZA()(),t.TgZ(57,"div",37)(58,"a",34),t._uU(59,"Version 2.3.1"),t.qZA()()()()),2&e){const i=t.MAs(18),r=t.MAs(24),c=t.MAs(31);t.xp6(16),t.Q6J("ngModel",n.login.Host),t.xp6(5),t.Q6J("ngIf",i.invalid&&(i.dirty||i.touched)),t.xp6(2),t.Q6J("ngModel",n.login.Username),t.xp6(4),t.Q6J("ngIf",r.invalid&&(r.dirty||r.touched)),t.xp6(2),t.Q6J("type",n.passwordType)("ngModel",n.login.Password),t.xp6(5),t.Q6J("ngIf",""!=n.login.Password&&"edge"!=n.browser),t.xp6(1),t.Q6J("ngIf",c.invalid&&(c.dirty||c.touched)),t.xp6(3),t.Q6J("ngIf",i.valid)}},dependencies:[m.mk,m.O5,l._Y,l.Fj,l.JJ,l.JL,l.Q7,l.c5,l.On,l.F],styles:[".container[_ngcontent-%COMP%]{position:absolute;max-width:100%}.card[_ngcontent-%COMP%]{margin-bottom:30px;padding-bottom:5px;padding-top:5px}.passwordIcon[_ngcontent-%COMP%]{top:1.5rem;right:.5rem;position:absolute;margin:0 auto!important;cursor:pointer}.big-display[_ngcontent-%COMP%]{font-size:2rem;font-weight:300;line-height:1.2}@media (min-width: 768px){.container[_ngcontent-%COMP%]{max-width:70%;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.big-display[_ngcontent-%COMP%]{font-size:3rem}}html[_ngcontent-%COMP%], body[_ngcontent-%COMP%]{height:100%}body[_ngcontent-%COMP%]{display:flex;align-items:center;padding-top:40px;padding-bottom:40px}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.pt-1rem[_ngcontent-%COMP%]{padding-top:1rem}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{color:#666}.font-xl[_ngcontent-%COMP%]{font-size:x-large}.font125rem[_ngcontent-%COMP%]{font-size:1.25rem}.robotoslab[_ngcontent-%COMP%]{font-family:Roboto Slab}"]}),o})(),data:{title:"Dealpos x Marketplace"}},{path:"shopee",component:(()=>{class o{constructor(e,n,i){this.route=e,this.http=n,this.service=i}ngOnInit(){this.route.queryParams.subscribe(e=>{this.shopID=e.shop_id,this.code=e.code})}addShopee(){let e={ShopID:Number(this.shopID),Code:this.code};this.http.post("/api/ChannelAdd/ShopeeV2",e).subscribe(i=>{this.service.navigate(["/menu/channel"])})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(p.gz),t.Y36(u.O),t.Y36(p.F0))},o.\u0275cmp=t.Xpm({type:o,selectors:[["shopee-authorized"]],decls:20,vars:1,consts:[[1,"container"],[1,"row","d-flex","justify-content-center"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-5",3,"click"],[1,"fas","fa-undo"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"i",5),t.TgZ(6,"div",6),t._uU(7,"Success !"),t.qZA()(),t.TgZ(8,"div",7)(9,"div"),t._uU(10,"You have successfully authorized "),t.qZA(),t.TgZ(11,"div"),t._uU(12,"DEALPOS to manage your Shopee"),t.qZA(),t.TgZ(13,"div"),t._uU(14," Your shopID is "),t.TgZ(15,"span",8),t._uU(16),t.qZA()(),t.TgZ(17,"button",9),t.NdJ("click",function(){return n.addShopee()}),t._UZ(18,"i",10),t._uU(19," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(n.shopID))},styles:[".container[_ngcontent-%COMP%]{position:absolute;max-width:100%}.card[_ngcontent-%COMP%]{margin-bottom:30px;padding-bottom:5px;padding-top:5px}.passwordIcon[_ngcontent-%COMP%]{top:1.5rem;right:.5rem;position:absolute;margin:0 auto!important;cursor:pointer}.big-display[_ngcontent-%COMP%]{font-size:2rem;font-weight:300;line-height:1.2}@media (min-width: 768px){.container[_ngcontent-%COMP%]{max-width:70%;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.big-display[_ngcontent-%COMP%]{font-size:3rem}}html[_ngcontent-%COMP%], body[_ngcontent-%COMP%]{height:100%}body[_ngcontent-%COMP%]{display:flex;align-items:center;padding-top:40px;padding-bottom:40px}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.pt-1rem[_ngcontent-%COMP%]{padding-top:1rem}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{color:#666}.font-xl[_ngcontent-%COMP%]{font-size:x-large}.font125rem[_ngcontent-%COMP%]{font-size:1.25rem}.robotoslab[_ngcontent-%COMP%]{font-family:Roboto Slab}.form-signin[_ngcontent-%COMP%]{max-width:600px}.card[_ngcontent-%COMP%]{font:100 14px/25px Roboto,Helvetica Neue,sans-serif;border-radius:13px;box-sizing:border-box}.text-shopee[_ngcontent-%COMP%]{color:#f53d2d}"]}),o})(),data:{title:"Success"}},{path:"tiktok",component:(()=>{class o{constructor(e,n,i){this.route=e,this.http=n,this.service=i}ngOnInit(){this.route.queryParams.subscribe(e=>{this.code=e.code,this.state=e.state})}addChannelTiktok(){this.http.post("/api/ChannelAdd/AddTiktok",{Code:this.code}).subscribe(n=>{this.service.navigate(["/menu/channel"])})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(p.gz),t.Y36(u.O),t.Y36(p.F0))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-tiktok"]],decls:24,vars:2,consts:[[1,"container"],[1,"row","d-flex","justify-content-center"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-5",3,"click"],[1,"fas","fa-undo"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"i",5),t.TgZ(6,"div",6),t._uU(7,"Success !"),t.qZA()(),t.TgZ(8,"div",7)(9,"div"),t._uU(10,"You have successfully authorized "),t.qZA(),t.TgZ(11,"div"),t._uU(12,"DEALPOS to manage your Tiktok"),t.qZA(),t.TgZ(13,"div"),t._uU(14," Your Code is "),t.TgZ(15,"span",8),t._uU(16),t.qZA()(),t.TgZ(17,"div"),t._uU(18," Your State is "),t.TgZ(19,"span",8),t._uU(20),t.qZA()(),t.TgZ(21,"button",9),t.NdJ("click",function(){return n.addChannelTiktok()}),t._UZ(22,"i",10),t._uU(23," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(n.code),t.xp6(4),t.Oqu(n.state))},styles:[".container[_ngcontent-%COMP%]{position:absolute;max-width:100%}.card[_ngcontent-%COMP%]{margin-bottom:30px;padding-bottom:5px;padding-top:5px}.passwordIcon[_ngcontent-%COMP%]{top:1.5rem;right:.5rem;position:absolute;margin:0 auto!important;cursor:pointer}.big-display[_ngcontent-%COMP%]{font-size:2rem;font-weight:300;line-height:1.2}@media (min-width: 768px){.container[_ngcontent-%COMP%]{max-width:70%;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.big-display[_ngcontent-%COMP%]{font-size:3rem}}html[_ngcontent-%COMP%], body[_ngcontent-%COMP%]{height:100%}body[_ngcontent-%COMP%]{display:flex;align-items:center;padding-top:40px;padding-bottom:40px}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.pt-1rem[_ngcontent-%COMP%]{padding-top:1rem}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{color:#666}.font-xl[_ngcontent-%COMP%]{font-size:x-large}.font125rem[_ngcontent-%COMP%]{font-size:1.25rem}.robotoslab[_ngcontent-%COMP%]{font-family:Roboto Slab}.form-signin[_ngcontent-%COMP%]{max-width:600px}.card[_ngcontent-%COMP%]{font:100 14px/25px Roboto,Helvetica Neue,sans-serif;border-radius:13px;box-sizing:border-box}.text-shopee[_ngcontent-%COMP%]{color:#f53d2d}"]}),o})(),data:{title:"Success"}}];let q=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[p.Bz.forChild(U),p.Bz]}),o})(),I=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[m.ez,l.u5,q]}),o})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[285],{4285:(W,_,s)=>{s.r(_),s.d(_,{ReportModule:()=>V});var p=s(6895),C=s(7398),e=s(4650),h=s(8252);let Z=(()=>{class n{constructor(){this.ReportTabs=[{Title:"1 - New Order",Url:"/menu/report/order"},{Title:"2 - Ready to Ship",Url:"/menu/report/invoice"},{Title:"3 - Shipped",Url:"/menu/report/delivery"},{Title:"4 - Completed",Url:"/menu/report/payment"}]}ngOnInit(){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-report"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,o){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",o.ReportTabs))},dependencies:[C.e,h.lC]}),n})();class u{}var O=s(1318);let g=(()=>{class n{constructor(t){this.http=t}GetLoader(){return new Promise((t,o)=>{this.http.post("/api/Report/GetLoader",{}).subscribe(a=>{t(a)})})}GetSyncOrder(t){return new Promise((o,a)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(t)).subscribe(i=>{o(i)})})}GetSyncInvoice(t){return new Promise((o,a)=>{this.http.post("/api/Report/Invoice",JSON.stringify(t)).subscribe(i=>{o(i)})})}GetSyncDelivery(t){return new Promise((o,a)=>{this.http.post("/api/Report/Delivery",JSON.stringify(t)).subscribe(i=>{o(i)})})}GetSyncPayment(t){return new Promise((o,a)=>{this.http.post("/api/Report/Payment",JSON.stringify(t)).subscribe(i=>{o(i)})})}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(O.O))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var c=s(7481),S=s(4006),w=s(8277),R=s(4859),f=s(3238),d=s(9602),v=s(9549),x=s(4144),M=s(5585);const P={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let T=(()=>{class n{constructor(){this.disabled=!1,this.widthClass="w-100",this.dateChange=new e.vpe}fromDateChange(t){let o=t.toDate();this.from=o}toDateChange(t){let o=t.toDate();this.to=o}onSelectDate(){this.dateChange.emit({from:this.from,to:this.to})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-datepicker-range"]],inputs:{placeholder:"placeholder",displayToggle:"displayToggle",date:"date",disabled:"disabled",minDate:"minDate",widthClass:"widthClass",from:"from",to:"to"},outputs:{dateChange:"dateChange"},features:[e._Bn([{provide:f._A,useClass:w.t7,deps:[f.Ad]},{provide:f.sG,useValue:P}])],decls:12,vars:7,consts:[["appearance","outline"],["id","dates",3,"min","rangePicker"],["matStartDate","","placeholder","Start date",3,"value","dateChange","click"],["matEndDate","","placeholder","End date",3,"value","dateChange","click"],["matPrefix","",3,"for"],["picker",""],["mat-button","","matDateRangePickerCancel",""],["mat-raised-button","","color","primary","matDateRangePickerApply","",3,"click"]],template:function(t,o){if(1&t){const a=e.EpF();e.TgZ(0,"mat-form-field",0)(1,"mat-date-range-input",1)(2,"input",2),e.NdJ("dateChange",function(m){return o.fromDateChange(m.value)})("click",function(){e.CHM(a);const m=e.MAs(6);return e.KtG(m.open())}),e.qZA(),e.TgZ(3,"input",3),e.NdJ("dateChange",function(m){return o.toDateChange(m.value)})("click",function(){e.CHM(a);const m=e.MAs(6);return e.KtG(m.open())}),e.qZA()(),e._UZ(4,"mat-datepicker-toggle",4),e.TgZ(5,"mat-date-range-picker",null,5)(7,"mat-date-range-picker-actions")(8,"button",6),e._uU(9,"Cancel"),e.qZA(),e.TgZ(10,"button",7),e.NdJ("click",function(){return o.onSelectDate()}),e._uU(11,"Search"),e.qZA()()()()}if(2&t){const a=e.MAs(6);e.Tol(o.widthClass),e.xp6(1),e.Q6J("min",o.minDate)("rangePicker",a),e.xp6(1),e.Q6J("value",o.from),e.xp6(1),e.Q6J("value",o.to),e.xp6(1),e.Q6J("for",a)}},dependencies:[d.nW,d.wx,d.zY,d.By,d._g,d.M5,d.dp,d.DK,v.KE,v.qo,R.lW],styles:["mat-date-range-input[_ngcontent-%COMP%]{font-size:.875rem}"]}),n})(),b=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[d.FA],imports:[f.XK,d.FA,v.lN,M.ZU,x.c,S.u5,R.ot]}),n})();var l=(()=>{return(n=l||(l={}))[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.CONFLICT=409]="CONFLICT",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",l;var n})();function A(n,r){if(1&n&&(e.TgZ(0,"th",6)(1,"div",7)(2,"h4"),e._uU(3),e.qZA(),e.TgZ(4,"small",8),e._uU(5),e.qZA()()()),2&n){const t=r.$implicit,o=e.oxw();e.xp6(3),e.Oqu(t),e.xp6(1),e.Tol(o.getTextBgColor(t)),e.xp6(1),e.Oqu(o.getHeaderStatusDesc(t))}}function F(n,r){if(1&n&&(e.TgZ(0,"a",10),e._UZ(1,"img",12),e.qZA()),2&n){const t=e.oxw().$implicit;e.s9C("href",t.Url,e.LSH)}}function N(n,r){if(1&n&&(e.TgZ(0,"a",10),e._UZ(1,"img",13),e.qZA()),2&n){const t=e.oxw().$implicit;e.s9C("href",t.Url,e.LSH)}}function k(n,r){if(1&n&&(e.TgZ(0,"a",10),e._UZ(1,"img",14),e.qZA()),2&n){const t=e.oxw().$implicit;e.s9C("href",t.Url,e.LSH)}}function J(n,r){if(1&n&&(e.TgZ(0,"a",10),e._UZ(1,"img",15),e.qZA()),2&n){const t=e.oxw().$implicit;e.s9C("href",t.Url,e.LSH)}}function I(n,r){if(1&n&&(e.TgZ(0,"a",10),e._UZ(1,"img",16),e.qZA()),2&n){const t=e.oxw().$implicit;e.s9C("href",t.Url,e.LSH)}}const U=function(){return["/menu/log/order"]},Y=function(n,r,t,o,a){return{responseCode:n,From:r,to:t,actionType:o,ChannelID:a}};function L(n,r){if(1&n&&(e.TgZ(0,"td",17)(1,"a",18),e._uU(2),e.qZA()()),2&n){const t=r.$implicit,o=e.oxw().$implicit,a=e.oxw();e.xp6(1),e.Q6J("routerLink",e.DdM(3,U))("queryParams",e.qbA(4,Y,t.Key,a.from,a.to,a.type,o.ChannelID)),e.xp6(1),e.hij(" ",t.Value," ")}}function Q(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e.YNc(2,F,2,1,"a",9),e.YNc(3,N,2,1,"a",9),e.YNc(4,k,2,1,"a",9),e.YNc(5,J,2,1,"a",9),e.YNc(6,I,2,1,"a",9),e.qZA(),e.TgZ(7,"td")(8,"div")(9,"a",10),e._uU(10),e.qZA()(),e.TgZ(11,"div"),e._uU(12),e.qZA()(),e.YNc(13,L,3,10,"td",11),e.qZA()),2&n){const t=r.$implicit;e.xp6(2),e.Q6J("ngIf",0==t.Type||5==t.Type),e.xp6(1),e.Q6J("ngIf",1==t.Type),e.xp6(1),e.Q6J("ngIf",2==t.Type),e.xp6(1),e.Q6J("ngIf",4==t.Type),e.xp6(1),e.Q6J("ngIf",6==t.Type),e.xp6(3),e.s9C("href",t.Url,e.LSH),e.xp6(1),e.Oqu(t.Name),e.xp6(2),e.Oqu(t.Url),e.xp6(1),e.Q6J("ngForOf",t.list)}}let y=(()=>{class n{constructor(){this.headerStatus=l}getHeaderStatusDesc(t){let o=null;switch(t){case l.BAD_REQUEST:o="BAD REQUEST";break;case l.CONFLICT:o="CONFLICT";break;case l.INTERNAL_SERVER_ERROR:o="INTERNAL SERVER ERROR";break;default:o="OK"}return o}getTextBgColor(t){let o=null;switch(t){case l.OK:o="bg-success";break;case l.INTERNAL_SERVER_ERROR:o="bg-danger";break;default:o="bg-warning"}return o}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-table-report"]],inputs:{header:"header",result:"result",from:"from",to:"to",type:"type"},decls:9,vars:2,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","3%"],["class","text-start","style","width: 5%;",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"text-start",2,"width","5%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href",4,"ngIf"],["target","_blank",3,"href"],["class","text-start",4,"ngFor","ngForOf"],["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/v1639725279/icons/marketplace_icons/kalcare.png"],["src","https://res.cloudinary.com/pos/image/upload/w_40/v1645761611/icons/Marketplace%20logo/tiktok.png"],[1,"text-start"],[1,"h3","text-primary","fw-bold",3,"routerLink","queryParams"]],template:function(t,o){1&t&&(e.TgZ(0,"table",0)(1,"thead",1)(2,"tr"),e._UZ(3,"th",2),e.TgZ(4,"th",3),e._uU(5,"Name"),e.qZA(),e.YNc(6,A,6,4,"th",4),e.qZA()(),e.TgZ(7,"tbody"),e.YNc(8,Q,14,9,"tr",5),e.qZA()()),2&t&&(e.xp6(6),e.Q6J("ngForOf",o.header),e.xp6(2),e.Q6J("ngForOf",o.result))},dependencies:[p.sg,p.O5,h.yS],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]}),n})();function E(n,r){if(1&n&&(e.TgZ(0,"div",5)(1,"div",6),e._UZ(2,"app-table-report",7),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("result",t.result)("header",t.header)("from",t.from)("to",t.to)("type",0)}}let G=(()=>{class n{constructor(t,o){this.http=t,this.datePipe=o,this.model=new u,this.PageTitle="New Order";let a=new Date;this.maxDate=a,this.minDate=this.addDays(a,6),this.model.From=a,this.model.To=a,this.updatePageTitle()}updatePageTitle(){const t=this.datePipe.transform(this.model.From,"dd MMM"),o=this.datePipe.transform(this.model.To,"dd MMM yyyy");this.PageTitle=`New Order (${t} - ${o})`}addDays(t,o){const a=new Date(Number(t));return a.setDate(t.getDate()-o),a}getDayDiff(t,o){return(o.getTime()-t.getTime())/864e5}ngOnInit(){this.Load()}Load(){this.http.GetLoader().then(t=>{this.model=t,this.from=this.model.From.toString(),this.to=this.model.To.toString(),this.http.GetSyncOrder(this.model).then(o=>{this.header=o.Header,this.result=o.Body})})}GetData(t){this.model.From=t.from,this.model.To=t.to,this.updatePageTitle(),this.http.GetSyncOrder(this.model).then(o=>{this.header=o.Header,this.result=o.Body,this.from=this.model.From.toJSON(),this.to=this.model.To.toJSON()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(g),e.Y36(p.uU))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-sales-order"]],decls:7,vars:7,consts:[[3,"Title","hideSearchBox","hideSearchDropdown"],[1,"filterDate"],[3,"minDate","from","to","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,o){1&t&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),e.NdJ("dateChange",function(i){return o.GetData(i)}),e.qZA()()(),e.TgZ(4,"content")(5,"div",3),e.YNc(6,E,3,5,"div",4),e.qZA()()()),2&t&&(e.Q6J("Title",o.PageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(3),e.Q6J("minDate",o.minDate)("from",o.model.From)("to",o.model.To),e.xp6(3),e.Q6J("ngIf",o.result))},dependencies:[p.O5,c.p,T,y],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),n})();function B(n,r){if(1&n&&(e.TgZ(0,"div",5)(1,"div",6),e._UZ(2,"app-table-report",7),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("result",t.result)("header",t.header)("from",t.from)("to",t.to)("type",1)}}let q=(()=>{class n{constructor(t,o){this.http=t,this.datePipe=o,this.model=new u,this.PageTitle="Ready to Ship";let a=new Date;this.maxDate=a,this.minDate=this.addDays(a,6),this.model.From=a,this.model.To=a,this.updatePageTitle()}updatePageTitle(){const t=this.datePipe.transform(this.model.From,"dd MMM"),o=this.datePipe.transform(this.model.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${t} - ${o})`}addDays(t,o){const a=new Date(Number(t));return a.setDate(t.getDate()-o),a}getDayDiff(t,o){return(o.getTime()-t.getTime())/864e5}ngOnInit(){this.Load()}Load(){this.http.GetLoader().then(t=>{this.model=t,this.from=this.model.From.toString(),this.to=this.model.To.toString(),this.http.GetSyncInvoice(this.model).then(o=>{this.header=o.Header,this.result=o.Body})})}GetData(t){this.model.From=t.from,this.model.To=t.to,this.updatePageTitle(),this.http.GetSyncInvoice(this.model).then(o=>{this.header=o.Header,this.result=o.Body,this.from=this.model.From.toJSON(),this.to=this.model.To.toJSON()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(g),e.Y36(p.uU))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-invoice"]],decls:7,vars:7,consts:[[3,"Title","hideSearchBox","hideSearchDropdown"],[1,"filterDate"],[3,"minDate","from","to","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,o){1&t&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),e.NdJ("dateChange",function(i){return o.GetData(i)}),e.qZA()()(),e.TgZ(4,"content")(5,"div",3),e.YNc(6,B,3,5,"div",4),e.qZA()()()),2&t&&(e.Q6J("Title",o.PageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(3),e.Q6J("minDate",o.minDate)("from",o.model.From)("to",o.model.To),e.xp6(3),e.Q6J("ngIf",o.result))},dependencies:[p.O5,c.p,T,y],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),n})();function $(n,r){if(1&n&&(e.TgZ(0,"div",5)(1,"div",6),e._UZ(2,"app-table-report",7),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("result",t.result)("header",t.header)("from",t.from)("to",t.to)("type",3)}}let H=(()=>{class n{constructor(t,o){this.http=t,this.datePipe=o,this.model=new u;let a=new Date;this.maxDate=a,this.minDate=this.addDays(a,6),this.model.From=a,this.model.To=a,this.updatePageTitle()}updatePageTitle(){const t=this.datePipe.transform(this.model.From,"dd MMM"),o=this.datePipe.transform(this.model.To,"dd MMM yyyy");this.PageTitle=`Shipped (${t} - ${o})`}addDays(t,o){const a=new Date(Number(t));return a.setDate(t.getDate()-o),a}getDayDiff(t,o){return(o.getTime()-t.getTime())/864e5}ngOnInit(){this.Load()}Load(){this.http.GetLoader().then(t=>{this.model=t,this.from=this.model.From.toString(),this.to=this.model.To.toString(),this.http.GetSyncDelivery(this.model).then(o=>{this.header=o.Header,this.result=o.Body})})}GetData(t){this.model.From=t.from,this.model.To=t.to,this.updatePageTitle(),this.http.GetSyncDelivery(this.model).then(o=>{this.header=o.Header,this.result=o.Body,this.from=this.model.From.toJSON(),this.to=this.model.To.toJSON()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(g),e.Y36(p.uU))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-delivery"]],decls:7,vars:7,consts:[[3,"Title","hideSearchBox","hideSearchDropdown"],[1,"filterDate"],[3,"minDate","from","to","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,o){1&t&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),e.NdJ("dateChange",function(i){return o.GetData(i)}),e.qZA()()(),e.TgZ(4,"content")(5,"div",3),e.YNc(6,$,3,5,"div",4),e.qZA()()()),2&t&&(e.Q6J("Title",o.PageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(3),e.Q6J("minDate",o.minDate)("from",o.model.From)("to",o.model.To),e.xp6(3),e.Q6J("ngIf",o.result))},dependencies:[p.O5,c.p,T,y],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),n})();function K(n,r){if(1&n&&(e.TgZ(0,"div",5)(1,"div",6),e._UZ(2,"app-table-report",7),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("result",t.result)("header",t.header)("from",t.from)("to",t.to)("type",4)}}let j=(()=>{class n{constructor(t,o){this.http=t,this.datePipe=o,this.model=new u,this.PageTitle="Completed";let a=new Date;this.minDate=this.addDays(a,6),this.model.From=a,this.model.To=a,this.updatePageTitle()}updatePageTitle(){const t=this.datePipe.transform(this.model.From,"dd MMM"),o=this.datePipe.transform(this.model.To,"dd MMM yyyy");this.PageTitle=`Completed (${t} - ${o})`}addDays(t,o){const a=new Date(Number(t));return a.setDate(t.getDate()-o),a}getDayDiff(t,o){return(o.getTime()-t.getTime())/864e5}ngOnInit(){this.Load()}Load(){this.http.GetLoader().then(t=>{this.model=t,this.from=this.model.From.toString(),this.to=this.model.To.toString(),this.http.GetSyncPayment(this.model).then(o=>{this.header=o.Header,this.result=o.Body})})}GetData(t){this.model.From=t.from,this.model.To=t.to,this.updatePageTitle(),this.http.GetSyncPayment(this.model).then(o=>{this.header=o.Header,this.result=o.Body,this.from=this.model.From.toJSON(),this.to=this.model.To.toJSON()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(g),e.Y36(p.uU))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-payment"]],decls:7,vars:7,consts:[[3,"Title","hideSearchBox","hideSearchDropdown"],[1,"filterDate"],[3,"minDate","from","to","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,o){1&t&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),e.NdJ("dateChange",function(i){return o.GetData(i)}),e.qZA()()(),e.TgZ(4,"content")(5,"div",3),e.YNc(6,K,3,5,"div",4),e.qZA()()()),2&t&&(e.Q6J("Title",o.PageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(3),e.Q6J("minDate",o.minDate)("from",o.model.From)("to",o.model.To),e.xp6(3),e.Q6J("ngIf",o.result))},dependencies:[p.O5,c.p,T,y],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),n})();var D=s(8063);const z=[{path:"",component:Z,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:G,canActivate:[D.a],data:{title:"Sync Order"}},{path:"invoice",component:q,canActivate:[D.a],data:{title:"Sync Invoice"}},{path:"delivery",component:H,canActivate:[D.a],data:{title:"Sync Delivery"}},{path:"payment",component:j,canActivate:[D.a],data:{title:"Sync Payment"}}]}];let X=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[p.ez,h.Bz.forChild(z)]}),n})(),V=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[p.ez,C.Z,X,S.u5,c.R,b,h.Bz]}),n})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[46],{7046:(C,f,d)=>{d.r(f),d.d(f,{OrdersModule:()=>be});var r=d(6895),u=d(8252),e=d(4650),T=d(7398);let v=(()=>{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,u.lC]}),a})();var h=d(1318),Z=d(7185),s=d(4006),p=d(7481),g=d(8796);function O(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 A(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,O,3,0,"span",3),e.YNc(7,A,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})(),P=(()=>{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 N(a,o){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.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 S=(()=>{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(Z._W))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-new-order"]],decls:37,vars:11,consts:[["searchBoxPlaceHolder","Search Orders...",3,"Title","hideSearchBox","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.selectedOutlets=l}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()()()(),e._UZ(15,"actions"),e.TgZ(16,"content")(17,"div",5)(18,"div",6)(19,"div",7)(20,"div",8)(21,"table",9)(22,"thead",10)(23,"tr",11)(24,"th"),e._uU(25,"Outlet"),e.qZA(),e.TgZ(26,"th"),e._uU(27,"Order number"),e.qZA(),e.TgZ(28,"th"),e._uU(29,"Customer"),e.qZA(),e.TgZ(30,"th"),e._uU(31,"Amount"),e.qZA(),e.TgZ(32,"th"),e._uU(33,"Created On"),e.qZA()()(),e.TgZ(34,"tbody"),e.YNc(35,N,13,10,"tr",12),e.qZA()(),e.TgZ(36,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("Title","1 - New Order")("hideSearchBox",!0),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(21),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[r.sg,s.Fj,s.wV,s.JJ,s.On,p.p,g.w9,m,r.JJ,r.uU]}),a})();function 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 q=function(){return["/menu/Order"]};let w=(()=>{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(u.gz))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-detail-order"]],decls:73,vars:20,consts:[[3,"Title","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-secondary","btn-fill","btn-lg","me-3",3,"routerLink"],[1,"container"],[1,"row"],[1,"col-4"],[1,"border","my-3","py-3","col-12"],[1,"row","m-2"],[1,"text-center"],[1,"col"],[1,"col-8"],[1,"text-center","my-3","py-3"],[1,"table-responsive"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"a",1),e._uU(3,"Back"),e.qZA()(),e.TgZ(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h3",7),e._uU(11,"Outlet Info"),e.qZA()(),e.TgZ(12,"div",3)(13,"div",8),e._uU(14," Outlet : "),e.qZA(),e.TgZ(15,"div",8),e._uU(16),e.qZA()(),e.TgZ(17,"div",3)(18,"div",8),e._uU(19," Date : "),e.qZA(),e.TgZ(20,"div",8),e._uU(21),e.ALo(22,"date"),e.qZA()(),e.TgZ(23,"div",3)(24,"div",8),e._uU(25," Status : "),e.qZA(),e.TgZ(26,"div",8),e._uU(27),e.qZA()(),e.TgZ(28,"div",3)(29,"div",8),e._uU(30," Tax Type : "),e.qZA(),e.TgZ(31,"div",8),e._uU(32),e.qZA()(),e.TgZ(33,"div",3)(34,"div",8),e._uU(35," Due Date : "),e.qZA(),e.TgZ(36,"div",8),e._uU(37),e.ALo(38,"date"),e.qZA()()(),e.TgZ(39,"div",5)(40,"div",6)(41,"h3",7),e._uU(42,"Customer Info"),e.qZA()(),e.TgZ(43,"div",3)(44,"div",8),e._uU(45," Name : "),e.qZA(),e.TgZ(46,"div",8),e._uU(47),e.qZA()(),e.TgZ(48,"div",3)(49,"div",8),e._uU(50," Email : "),e.qZA(),e.TgZ(51,"div",8),e._uU(52),e.qZA()(),e.TgZ(53,"div",3)(54,"div",8),e._uU(55," Mobile : "),e.qZA(),e.TgZ(56,"div",8),e._uU(57),e.qZA()()()(),e.TgZ(58,"div",9)(59,"h3",10),e._uU(60,"Products Sold"),e.qZA(),e.TgZ(61,"div",11)(62,"table",12)(63,"thead",13)(64,"tr",14)(65,"th"),e._uU(66,"Code"),e.qZA(),e.TgZ(67,"th"),e._uU(68,"Quantity"),e.qZA(),e.TgZ(69,"th"),e._uU(70,"Price"),e.qZA()()(),e.TgZ(71,"tbody"),e.YNc(72,y,9,7,"tr",15),e.qZA()()()()()()()()),2&t&&(e.Q6J("Title","Order #"+n.number)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(19,q)),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,u.yS,r.JJ,r.uU]}),a})();const M=function(){return["/menu/Order/detail"]},D=function(a,o){return{Number:a,Outlet:o}};function U(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"tr")(1,"td")(2,"input",17),e.NdJ("ngModelChange",function(i){const b=e.CHM(t).$implicit;return e.KtG(b.selected=i)})("ngModelChange",function(){const l=e.CHM(t).$implicit,b=e.oxw();return e.KtG(b.onCheckboxStateProduct(l.Number))}),e.qZA()(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td")(6,"a",18),e._uU(7),e.qZA()(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.ALo(12,"number"),e.qZA(),e.TgZ(13,"td"),e._uU(14),e.ALo(15,"date"),e.qZA()()}if(2&a){const t=o.$implicit;e.xp6(2),e.Q6J("ngModel",t.selected),e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("routerLink",e.DdM(13,M))("queryParams",e.WLB(14,D,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 x=(()=>{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(Z._W))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-ready-to-ship"]],decls:41,vars:12,consts:[["searchBoxPlaceHolder","Search Ready To Ship...",3,"Title","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"hidden","click"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],["type","checkbox",3,"ngModel","ngModelChange"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.selectedOutlets=l}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()()()(),e.TgZ(15,"actions")(16,"button",5),e.NdJ("click",function(){return n.UpdateDelivery()}),e._uU(17," Dispatch "),e.qZA()(),e.TgZ(18,"content")(19,"div",6)(20,"div",7)(21,"div",8)(22,"div",9)(23,"table",10)(24,"thead",11)(25,"tr",12)(26,"th",13)(27,"input",14),e.NdJ("ngModelChange",function(l){return n.checkboxState=l})("ngModelChange",function(){return n.onCheckboxStateChange()}),e.qZA()(),e.TgZ(28,"th"),e._uU(29,"Outlet"),e.qZA(),e.TgZ(30,"th"),e._uU(31,"Order number"),e.qZA(),e.TgZ(32,"th"),e._uU(33,"Customer"),e.qZA(),e.TgZ(34,"th"),e._uU(35,"Amount"),e.qZA(),e.TgZ(36,"th"),e._uU(37,"Created On"),e.qZA()()(),e.TgZ(38,"tbody"),e.YNc(39,U,16,17,"tr",15),e.qZA()(),e.TgZ(40,"app-mat-paginator-no-count",16),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("Title","2 - Ready to Ship"),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(2),e.Q6J("hidden",!n.hasSelection()),e.xp6(11),e.Q6J("ngModel",n.checkboxState),e.xp6(12),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[r.sg,s.Fj,s.wV,s.Wl,s.JJ,s.On,p.p,u.yS,g.w9,m,r.JJ,r.uU]}),a})();const J=function(){return["/menu/Order/detail"]},k=function(a,o){return{Number:a,Outlet:o}};function Q(a,o){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",14),e._uU(5),e.qZA()(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA()()),2&a){const t=o.$implicit;e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("routerLink",e.DdM(12,J))("queryParams",e.WLB(13,k,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 I=(()=>{class a{constructor(t){this.http=t,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.Get()})}Get(t){this.http.post("api/orders/GetShipped",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Sent",Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(h.O))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-shipped"]],decls:36,vars:10,consts:[["searchBoxPlaceHolder","Search Orders...",3,"Title","onSubmit"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.selectedOutlets=l}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA()()(),e.TgZ(33,"tbody"),e.YNc(34,Q,14,16,"tr",12),e.qZA()(),e.TgZ(35,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("Title","3 - Shipped"),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(20),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[r.sg,s.Fj,s.wV,s.JJ,s.On,p.p,u.yS,g.w9,m,r.JJ,r.uU]}),a})();const F=function(){return["/menu/Order/detail"]},L=function(a,o){return{Number:a,Outlet:o}};function G(a,o){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",14),e._uU(5),e.qZA()(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA()()),2&a){const t=o.$implicit;e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("routerLink",e.DdM(12,F))("queryParams",e.WLB(13,L,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 R=(()=>{class a{constructor(t){this.http=t,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.Get()})}Get(t){this.http.post("api/orders/GetDelivered ",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Paid",DeliveryState:"Sent",Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(h.O))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-delivered"]],decls:36,vars:11,consts:[["searchBoxPlaceHolder","Search Orders...",3,"Title","hideSearchBox","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.selectedOutlets=l}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA()()(),e.TgZ(33,"tbody"),e.YNc(34,G,14,16,"tr",12),e.qZA()(),e.TgZ(35,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("Title","4 - Completed")("hideSearchBox",!0),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(20),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[r.sg,s.Fj,s.wV,s.JJ,s.On,p.p,u.yS,g.w9,m,r.JJ,r.uU]}),a})();const z=function(){return["/menu/Order/detail"]},Y=function(a,o){return{Number:a,Outlet:o}};function B(a,o){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",14),e._uU(5),e.qZA()(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._uU(15),e.qZA()()),2&a){const t=o.$implicit;e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("routerLink",e.DdM(13,z))("queryParams",e.WLB(14,Y,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 H=(()=>{class a{constructor(t){this.http=t,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.Get()})}Get(t){this.http.post("api/orders/GetAll ",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(t){this.filter=t,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!1,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(h.O))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-all-order"]],decls:38,vars:10,consts:[["searchBoxPlaceHolder","Search Orders...",3,"Title","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.selectedOutlets=l}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA(),e.TgZ(33,"th"),e._uU(34,"Status"),e.qZA()()(),e.TgZ(35,"tbody"),e.YNc(36,B,16,17,"tr",12),e.qZA()(),e.TgZ(37,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("Title","All"),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(22),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[r.sg,s.Fj,s.wV,s.JJ,s.On,p.p,u.yS,g.w9,m,r.JJ,r.uU]}),a})();const j=function(){return["/menu/Order/detail"]},E=function(a,o){return{Number:a,Outlet:o}};function K(a,o){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",14),e._uU(5),e.qZA()(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA()()),2&a){const t=o.$implicit;e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("routerLink",e.DdM(12,j))("queryParams",e.WLB(13,E,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 V=(()=>{class a{constructor(t){this.http=t,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.Get()})}Get(t){this.http.post("api/orders/GetCancelled ",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!0,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(h.O))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-cancelled"]],decls:36,vars:10,consts:[["searchBoxPlaceHolder","Search Orders...",3,"Title","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.selectedOutlets=l}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA()()(),e.TgZ(33,"tbody"),e.YNc(34,K,14,16,"tr",12),e.qZA()(),e.TgZ(35,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("Title","99 - Cancelled"),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(20),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[r.sg,s.Fj,s.wV,s.JJ,s.On,p.p,u.yS,g.w9,m,r.JJ,r.uU]}),a})();var $=d(9694),_=d(9602);function W(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 X(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 ee(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 te(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,ee,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 ne=function(a){return{"over-due":a}};function ae(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,ne,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 ie(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,ae,9,7,"tr",32),e.qZA()()()()),2&a){const t=e.oxw();e.xp6(13),e.Q6J("ngForOf",t.infodownload)}}function oe(a,o){if(1&a&&(e.TgZ(0,"th",43),e._uU(1),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Oqu(0==t.getTypeID()?"Last Status Update":"Created Date")}}function le(a,o){if(1&a&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"date"),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,t.Date,"dd MMM yyyy HH:mm:ss"))}}function re(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 se(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 ue(a,o){if(1&a&&(e.TgZ(0,"ul",47),e.YNc(1,se,2,1,"li",42),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.ActionString)}}function de(a,o){if(1&a&&(e.TgZ(0,"span",48),e._UZ(1,"i",49),e.qZA()),2&a){const t=e.oxw().$implicit;e.hYB("title","Delivery : ",t.DeliveryState," \nPayment : ",t.PaymentState,"")}}const pe=function(a,o){return{"over-due-today":a,"over-due":o}};function ge(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.YNc(5,le,3,4,"td",44),e.TgZ(6,"td")(7,"span"),e._uU(8),e.qZA(),e._uU(9),e.qZA(),e.TgZ(10,"td",33)(11,"span"),e._uU(12),e.qZA(),e._uU(13),e.qZA(),e.TgZ(14,"td"),e.YNc(15,re,2,1,"span",44),e.YNc(16,ue,2,1,"ul",45),e.qZA(),e.TgZ(17,"td"),e.YNc(18,de,2,2,"span",46),e.qZA()()),2&a){const t=o.$implicit,n=o.index,i=e.oxw(2);e.xp6(2),e.Oqu(n+1),e.xp6(2),e.Oqu(t.Number),e.xp6(1),e.Q6J("ngIf",i.getTypeID()!=i.channelType.ShopeeV2),e.xp6(3),e.hij("",t.ChannelStatus," - "),e.xp6(1),e.Oqu(t.ChannelStatusDescription),e.xp6(1),e.Q6J("ngClass",e.WLB(11,pe,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 he(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"div",12)(1,"div",28)(2,"div",34)(3,"ul",35)(4,"li",36)(5,"button",37),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filter("all"))}),e._uU(6),e.qZA()(),e.TgZ(7,"li",36)(8,"button",37),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filter("sync"))}),e._uU(9),e.qZA()(),e.TgZ(10,"li",36)(11,"button",37),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filter("wrong"))}),e._uU(12),e.qZA()(),e.TgZ(13,"li",36)(14,"button",37),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filter("unsync"))}),e._uU(15),e.qZA()()()(),e.TgZ(16,"table",29)(17,"thead",38)(18,"tr"),e._UZ(19,"th",31),e.TgZ(20,"th",39),e._uU(21,"Number"),e.qZA(),e.YNc(22,oe,2,1,"th",40),e.TgZ(23,"th",41),e._uU(24,"Channel Status"),e.qZA(),e.TgZ(25,"th",41),e._uU(26,"POS Status"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Action"),e.qZA(),e._UZ(29,"th",31),e.qZA()(),e.TgZ(30,"tbody"),e.YNc(31,ge,19,14,"tr",42),e.qZA()()()()}if(2&a){const t=e.oxw();e.xp6(5),e.Q6J("ngClass","all"==t.pillStatus?"btn-secondary text-white":"btn-outline-dark"),e.xp6(1),e.hij("All (",t.data.length,")"),e.xp6(2),e.Q6J("ngClass","sync"==t.pillStatus?"btn-success":"btn-outline-success"),e.xp6(1),e.hij("Existing (",t.data.length-t.updateQty-t.createQty,")"),e.xp6(2),e.Q6J("ngClass","wrong"==t.pillStatus?"btn-warning text-white":"btn-outline-warning"),e.xp6(1),e.hij("Wrong Status (",t.updateQty,")"),e.xp6(2),e.Q6J("ngClass","unsync"==t.pillStatus?"btn-danger":"btn-outline-danger"),e.xp6(1),e.hij("Missing (",t.createQty,")"),e.xp6(7),e.Q6J("ngIf",t.getTypeID()!=t.channelType.ShopeeV2),e.xp6(9),e.Q6J("ngForOf",t.displayData)}}let ce=(()=>{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.channelType=$.x,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(Z._W),e.Y36(r.uU),e.Y36(u.gz))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-download"]],decls:12,vars:8,consts:[[3,"Title","hideSearchBox","hideSearchDropdown"],["class","btn btn-success btn-fill btn-lg text-white",3,"click",4,"ngIf"],["class","btn btn-success btn-fill btn-lg text-white","type","button",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[1,"container-fluid","pt-5","mt-5"],["class","row",4,"ngIf"],["class","row mt-4",4,"ngIf"],[1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[1,"fas","fa-search"],["type","button",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],["aria-hidden","true",1,"fa","fa-download","me-2"],[1,"row"],[1,"col-6"],[1,"col"],["for","channelSelect"],[3,"clearable","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-1rem"],[1,"col-12"],["for","dates"],["id","dates",1,"form-control","rounded","dateRange","w-75",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModel","ngModelChange","click"],["matEndDate","","placeholder","End date",3,"ngModel","ngModelChange","click"],["picker",""],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"row","mt-4"],[1,"col-md-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],["width","1%"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"row","mx-1","mb-5"],[1,"nav","nav-pills"],[1,"nav-item","mx-3"],[1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],[1,"thead-light"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngFor","ngForOf"],["width","15%"],[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,W,3,0,"button",1),e.YNc(3,X,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,te,23,6,"div",6),e.YNc(10,ie,14,1,"div",7),e.YNc(11,he,32,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=d(8063);const me=[{path:"",component:v,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:S,canActivate:[c.a],data:{title:"New Order"}},{path:"detail",component:w,canActivate:[c.a],data:{title:"Orders detail"}},{path:"ready_to_ship",component:x,canActivate:[c.a],data:{title:"Ready To Ship"}},{path:"Shipped",component:I,canActivate:[c.a],data:{title:"Shipped"}},{path:"Delivered",component:R,canActivate:[c.a],data:{title:"Delivered"}},{path:"All",component:H,canActivate:[c.a],data:{title:"All Order"}},{path:"Cancelled",component:V,canActivate:[c.a],data:{title:"Cancelled"}},{path:"Download",component:ce,canActivate:[c.a],data:{title:"Download"}}]}];let _e=(()=>{class a{}return a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({imports:[r.ez,u.Bz.forChild(me)]}),a})();var fe=d(8739),Ze=d(3238);let be=(()=>{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,_e,T.Z,p.R,fe.TU,u.Bz,g.A0,_.FA,Ze.XK,P]}),a})()},9694:(C,f,d)=>{d.d(f,{x:()=>r});var r=(()=>{return(u=r||(r={}))[u.Shopee=0]="Shopee",u[u.Tokopedia=1]="Tokopedia",u[u.WooCommerce=2]="WooCommerce",u[u.None=3]="None",u[u.KalCare=4]="KalCare",u[u.ShopeeV2=5]="ShopeeV2",u[u.Tiktok=6]="Tiktok",u[u.Lazada=7]="Lazada",r;var u})()}}]);