marketplacepos 2.5.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/Marketplace/117.4367f8afe2698e0a.js +1 -0
  2. package/Marketplace/{162.380fb02c77fa6ec0.js → 162.1e1c36c1ada2acc3.js} +1 -1
  3. package/Marketplace/{174.d9e54ac6a8d68fed.js → 174.fb88c636b62288f3.js} +1 -1
  4. package/Marketplace/{180.bfed0f08b5cdbbde.js → 180.dbbf0c10ee5511ad.js} +1 -1
  5. package/Marketplace/{25.5e00713dbd080b64.js → 25.6dd4d4cee1f4f83c.js} +1 -1
  6. package/Marketplace/291.304a30789207d7b4.js +1 -0
  7. package/Marketplace/{360.4fa1f449dc516500.js → 360.9a9cbdee19ee7208.js} +1 -1
  8. package/Marketplace/397.5ae6b1775c69cdc2.js +1 -0
  9. package/Marketplace/3rdpartylicenses.txt +63 -0
  10. package/Marketplace/{463.7140b32660c473a4.js → 463.20f700792417e3ee.js} +1 -1
  11. package/Marketplace/{512.96a1a3c8c51a8727.js → 512.945d0618102b5e2d.js} +1 -1
  12. package/Marketplace/545.4cff8354a6569325.js +1 -0
  13. package/Marketplace/585.41532f91419a22f2.js +1 -0
  14. package/Marketplace/{616.fb179a9605c3e98c.js → 616.f27780a637620732.js} +1 -1
  15. package/Marketplace/663.dc31188909c42de4.js +1 -0
  16. package/Marketplace/{716.65e3e9a36c3e8be6.js → 716.8753639575454fc2.js} +1 -1
  17. package/Marketplace/{717.ea775a267d795788.js → 717.de25d206cb2de0f8.js} +1 -1
  18. package/Marketplace/{739.82b92600f9519019.js → 739.8a763e7ab64fe945.js} +1 -1
  19. package/Marketplace/{832.6082371d3ebb95a0.js → 832.886dc486c5a4ff32.js} +1 -1
  20. package/Marketplace/{874.472e0cd7c75127ca.js → 874.89ed6b644dee8914.js} +1 -1
  21. package/Marketplace/index.html +2 -2
  22. package/Marketplace/main.82c99b5c79f1fd9c.js +1 -0
  23. package/Marketplace/runtime.de37a7d67f4eed9c.js +1 -0
  24. package/package.json +1 -1
  25. package/Marketplace/32.9c83cc1dfc19e37d.js +0 -1
  26. package/Marketplace/369.9e98af5ff042d408.js +0 -1
  27. package/Marketplace/397.017f0dd05d9d37c5.js +0 -1
  28. package/Marketplace/585.9e916b668a91cc94.js +0 -1
  29. package/Marketplace/6.fc79ecc0c0a33462.js +0 -1
  30. package/Marketplace/main.5d7fbf88ea2e3736.js +0 -1
  31. package/Marketplace/runtime.7fbde9d6c7315628.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[117],{4117:(D,m,s)=>{s.r(m),s.d(m,{LoginModule:()=>F});var p=s(6895),c=s(4006),t=s(4650),d=s(6806),l=s(1318);let b=(()=>{class o{constructor(e,i,n){this.route=e,this.http=i,this.service=n}ngOnInit(){this.route.queryParams.subscribe(e=>{this.code=e.code})}addChannelLazada(){this.http.post("/api/ChannelAdd/AddLazada",{Code:this.code}).subscribe(i=>{this.service.navigate(["/menu/channel"])})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(d.gz),t.Y36(l.O),t.Y36(d.F0))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-lazada"]],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,i){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 Lazada"),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,"button",9),t.NdJ("click",function(){return i.addChannelLazada()}),t._UZ(18,"i",10),t._uU(19," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(i.code))}}),o})();var x=s(3154),u=s(7185);let C=(()=>{class o{constructor(){}getBrowserName(){const e=window.navigator.userAgent.toLowerCase();switch(!0){case e.indexOf("edge")>-1||e.indexOf("edg")>-1:return"edge";case e.indexOf("opr")>-1:return"opera";case e.indexOf("chrome")>-1:return"chrome";case e.indexOf("trident")>-1:return"ie";case e.indexOf("firefox")>-1:return"firefox";case e.indexOf("safari")>-1:return"safari";default:return"other"}}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var f=s(8505),v=s(8996),h=s(4004),w=s(3900),Z=s(3942),M=s(8002),y=s(7899);let A=(()=>{class o{constructor(e,i,n,a){this.httpService=e,this.tokenDecodeService=i,this.toastrService=n,this.afAuth=a}login(e){return this.httpService.post("/api/token/Login",e).pipe((0,f.b)(i=>{this.setLocalStorage(i,e.Host,e.Username),this.validateRole()}))}loginWithGoogle(e,i){e.preventDefault();const n=new Z.Z.auth.GoogleAuthProvider;return n.setCustomParameters({prompt:"select_account"}),(0,v.D)(this.afAuth.signInWithPopup(n)).pipe((0,h.U)(a=>a.credential),(0,h.U)(a=>a.idToken),(0,w.w)(a=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:a,Host:i}))),(0,f.b)(a=>{this.setLocalStorage(a,i,null),this.validateRole()}))}setLocalStorage(e,i,n){localStorage.setItem("user",JSON.stringify(e)),localStorage.setItem("Authorization",JSON.stringify({Host:i,username:n})),localStorage.setItem("Intercom",JSON.stringify(e.IntercomWidget))}validateRole(){let e="This user is lack of these following roles :",i=this.tokenDecodeService.GetRoles(),n=i.includes("Sell"),a=i.includes("SellEditor"),g=i.includes("DelC"),_=i.includes("PayC");n||(e=`${e} <br/> Sell Create`),a||(e=`${e} <br/> Sell Editor`),g||(e=`${e} <br/> Delivery Create`),_||(e=`${e} <br/> Payment Create`),(!n||!a||!g||!_)&&this.toastrService.warning(e,"Warning!",{enableHtml:!0})}logout(){this.clearLocalStorage()}isActiveToken(){let e=JSON.parse(window.localStorage.getItem("user")),i=new Date;return null!=e&&(i<new Date(e.Token.expiredAt)||(this.clearLocalStorage(),!1))}clearLocalStorage(){localStorage.removeItem("Intercom"),localStorage.removeItem("Authorization"),localStorage.removeItem("user")}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(l.O),t.LFG(M.e),t.LFG(u._W),t.LFG(y.zQ))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();const O=["domainAutoFocus"],T=["passAutoFocus"];function S(o,r){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",18)(2,"div",19)(3,"div",20)(4,"h2",21),t._uU(5,"Sign in"),t.qZA(),t.TgZ(6,"div",22)(7,"div",23)(8,"div",24)(9,"span",25),t._UZ(10,"i",26),t.qZA(),t.TgZ(11,"input",27,28),t.NdJ("ngModelChange",function(n){t.CHM(e);const a=t.oxw();return t.KtG(a.subdomain=n)}),t.qZA()()(),t.TgZ(13,"select",29),t.NdJ("ngModelChange",function(n){t.CHM(e);const a=t.oxw();return t.KtG(a.domain=n)}),t.TgZ(14,"option",30),t._uU(15,".dealpos.co.id"),t.qZA(),t.TgZ(16,"option",31),t._uU(17,".dealpos.net"),t.qZA(),t.TgZ(18,"option",32),t._uU(19,".dealpos.com"),t.qZA()()()(),t.TgZ(20,"div",33)(21,"button",34),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onNextState())}),t._uU(22," Next "),t.qZA()()()(),t.BQk()}if(2&o){const e=t.oxw();t.xp6(11),t.Q6J("ngModel",e.subdomain),t.xp6(2),t.Q6J("ngModel",e.domain)}}function P(o,r){1&o&&(t.TgZ(0,"p"),t._uU(1," Username is required "),t.qZA())}function k(o,r){if(1&o&&(t.TgZ(0,"div",58),t.YNc(1,P,2,0,"p",59),t.qZA()),2&o){t.oxw();const e=t.MAs(13);t.xp6(1),t.Q6J("ngIf",e.errors.required)}}const L=function(o,r){return{"fa-eye":o,"fa-eye-slash":r}};function U(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"i",60),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.hideShowPassword())}),t.qZA()}if(2&o){const e=t.oxw(2);t.Q6J("ngClass",t.WLB(1,L,"eye-off"==e.passwordIcon,"eye"==e.passwordIcon))}}function z(o,r){1&o&&(t.TgZ(0,"p"),t._uU(1," Password is required "),t.qZA())}function I(o,r){if(1&o&&(t.TgZ(0,"div",58),t.YNc(1,z,2,0,"p",59),t.qZA()),2&o){t.oxw();const e=t.MAs(20);t.xp6(1),t.Q6J("ngIf",e.errors.required)}}function q(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",18)(1,"div",19)(2,"div",35)(3,"h2",21),t._uU(4,"Sign in"),t.qZA(),t.TgZ(5,"div",36),t._uU(6," to "),t.TgZ(7,"h6",37),t._uU(8),t.qZA(),t.TgZ(9,"i",38),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onEditDomain())}),t.qZA()()(),t.TgZ(10,"form",39)(11,"div",40)(12,"input",41,42),t.NdJ("ngModelChange",function(n){t.CHM(e);const a=t.oxw();return t.KtG(a.username=n)}),t.qZA(),t.TgZ(14,"label",43),t._uU(15,"Username"),t.qZA(),t.YNc(16,k,2,1,"div",44),t.qZA(),t.TgZ(17,"div",45)(18,"input",46,47),t.NdJ("ngModelChange",function(n){t.CHM(e);const a=t.oxw();return t.KtG(a.password=n)}),t.qZA(),t.TgZ(21,"label",48),t._uU(22,"Password"),t.qZA(),t.YNc(23,U,1,4,"i",49),t.YNc(24,I,2,1,"div",44),t.qZA(),t.TgZ(25,"div",50)(26,"a",51),t._uU(27,"Forgot Password?"),t.qZA()(),t.TgZ(28,"div",52)(29,"button",53),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onLogin())}),t._uU(30," Log in "),t.qZA()(),t.TgZ(31,"div",54),t._UZ(32,"hr"),t.TgZ(33,"span",55),t._uU(34,"or"),t.qZA(),t._UZ(35,"hr"),t.qZA(),t.TgZ(36,"div")(37,"button",56),t.NdJ("click",function(n){t.CHM(e);const a=t.oxw();return t.KtG(a.onLoginByGoogle(n))}),t._UZ(38,"i",57),t._uU(39," Sign In with Google "),t.qZA()()()()()}if(2&o){const e=t.MAs(13),i=t.MAs(20),n=t.oxw();t.xp6(8),t.AsE(" (",n.subdomain,"",n.domain,") "),t.xp6(4),t.Q6J("ngModel",n.username),t.xp6(4),t.Q6J("ngIf",e.invalid&&(e.dirty||e.touched)),t.xp6(2),t.Q6J("type",n.passwordType)("ngModel",n.password),t.xp6(5),t.Q6J("ngIf",""!=n.password&&"edge"!=n.browser),t.xp6(1),t.Q6J("ngIf",i.invalid&&(i.dirty||i.touched)),t.xp6(2),t.Q6J("href","https://"+n.subdomain+n.domain+"/ForgotPassword",t.LSH)}}const N=[{path:"",component:(()=>{class o{constructor(e,i,n,a,g){this._router=e,this.elementRef=i,this.toastr=n,this.checkBrowser=a,this.authService=g,this.domain=".dealpos.co.id",this.loginState="FORM_DOMAIN",this.passwordType="password",this.passwordIcon="eye-off"}ngOnInit(){this.initLogin(),this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor="#dfeffc",this.browser=this.checkBrowser.getBrowserName()}ngAfterViewInit(){this.setAutoFocusDomain()}initLogin(){this.authService.isActiveToken()&&this._router.navigate(["menu"])}onNextState(){x.g.IsEmpty(this.subdomain)?this.toastr.warning("Account Domain is required","Warning"):(this.parseSubdomain(),this.loginState="FORM_AUTH")}parseSubdomain(){let e=this.subdomain.indexOf(".dealpos");-1!=e&&(this.subdomain=this.subdomain.substring(0,e))}onEditDomain(){this.loginState="FORM_DOMAIN"}onLogin(){this.authService.login({Host:`${this.subdomain}${this.domain}`,Username:this.username,Password:this.password}).subscribe(i=>{this.onSuccessLogin(i)})}onLoginByGoogle(e){this.authService.loginWithGoogle(e,`${this.subdomain}${this.domain}`).subscribe(n=>{this.onSuccessLogin(n)})}onSuccessLogin(e){this._router.navigate(e.Channel.length<1?["menu/channel"]:["menu"])}setAutoFocusDomain(){this.domainElementRef.nativeElement.focus()}hideShowPassword(){this.passwordType="text"===this.passwordType?"password":"text",this.passwordIcon="eye-off"===this.passwordIcon?"eye":"eye-off"}ngOnDestroy(){this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor="white"}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(d.F0),t.Y36(t.SBq),t.Y36(u._W),t.Y36(C),t.Y36(A))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-login"]],viewQuery:function(e,i){if(1&e&&(t.Gf(O,5),t.Gf(T,5)),2&e){let n;t.iGM(n=t.CRH())&&(i.domainElementRef=n.first),t.iGM(n=t.CRH())&&(i.passElementRef=n.first)}},decls:30,vars:2,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"],[4,"ngIf","ngIfElse"],["USR_PASS",""],[1,"col-12","d-block","d-md-none","text-center"],[1,"pt-8","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-8","font-italic"],[1,"mx-5","pb-5","mb-5","d-none","d-md-block"],[1,"row","justify-content-between","align-items-center"],[1,"col-auto","d-inline-flex"],[1,"col-auto"],[1,"card"],[1,"card-body","p-8"],[1,"card-title"],[1,"fw-normal","font-xl","robotoslab"],[1,"d-flex","align-items-center","mt-6"],[1,"mt-7","w-75","rounded-end-0"],[1,"input-group","mb-3"],["id","basic-addon1",1,"input-group-text","border-end-0","rounded-start"],[1,"fa-solid","fa-cloud"],["type","text","required","","name","Host","id","inputHost","placeholder","Store Address",1,"form-control","text-start","subdomain-input","border-start-0",2,"padding-left","0px",3,"ngModel","ngModelChange"],["domainAutoFocus",""],[1,"form-select","form-control","border-start-0","mt-4","rounded-end","rounded-start-0","domain-option",3,"ngModel","ngModelChange"],["selected","","value",".dealpos.co.id"],["value",".dealpos.net"],["value",".dealpos.com"],[1,"w-100","mt-10"],["data-cy","next","type","submit",1,"btn","btn-lg","btn-primary","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"card-title","d-flex","align-items-center"],[1,"pt-2","ms-2"],[1,"fw-bold","me-2","robotoslab","d-inline-block","text-primary"],[1,"fa-solid","fa-edit","link-primary","fs-5","pointer",3,"click"],[1,"mt-10"],[1,"form-label-group"],["type","text","name","Username","id","inputUsername","placeholder","Username","required","",1,"form-control","text-start",3,"ngModel","ngModelChange"],["usernameCtrl","ngModel"],["for","inputUsername",1,"text-start"],["class","text-danger",4,"ngIf"],[1,"form-label-group","mb-5","mb-sm-1"],["name","Password","id","inputPassword","placeholder","Password","required","",1,"form-control","text-start",3,"type","ngModel","ngModelChange"],["passAutoFocus","","passwordCtrl","ngModel"],["for","inputPassword",1,"text-start"],["class","passwordIcon fas fa-lg",3,"ngClass","click",4,"ngIf"],[1,"text-end","mt-3"],[3,"href"],[1,"w-100","mt-8"],["data-cy","login","type","submit",1,"btn","btn-lg","btn-primary","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"divider","d-flex","align-items-center","justify-content-center"],[1,"mx-4","text-muted"],[1,"btn","btn-social-login","text-primary","w-100","fw-bold",3,"click"],[1,"fa-brands","fa-google"],[1,"text-danger"],[4,"ngIf"],[1,"passwordIcon","fas","fa-lg",3,"ngClass","click"]],template:function(e,i){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 Omnichannel "),t.qZA(),t.YNc(9,S,23,2,"ng-container",7),t.YNc(10,q,40,9,"ng-template",null,8,t.W1O),t.qZA(),t.TgZ(12,"div",9)(13,"p",10),t._uU(14,"Powered by :"),t.qZA(),t.TgZ(15,"a",11),t._UZ(16,"img",12),t.qZA(),t._UZ(17,"br"),t.TgZ(18,"a",13),t._uU(19,"Version 2.5.1"),t.qZA()()()(),t.TgZ(20,"footer",14)(21,"div",15)(22,"div",16)(23,"p",10),t._uU(24,"Powered by :"),t.qZA(),t.TgZ(25,"a",11),t._UZ(26,"img",12),t.qZA()(),t.TgZ(27,"div",17)(28,"a",13),t._uU(29,"Version 2.5.1"),t.qZA()()()()),2&e){const n=t.MAs(11);t.xp6(9),t.Q6J("ngIf","FORM_DOMAIN"==i.loginState)("ngIfElse",n)}},dependencies:[p.mk,p.O5,c._Y,c.YN,c.Kr,c.Fj,c.EJ,c.JJ,c.JL,c.Q7,c.On,c.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.8rem;right:.8rem;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}}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.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}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%]{border:1px solid var(--bs-primary)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.domain-option[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df;width:10rem}.subdomain-input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df}.form-select[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important;box-shadow:none!important}"]}),o})(),data:{title:"Dealpos x Marketplace"}},{path:"shopee",component:(()=>{class o{constructor(e,i,n){this.route=e,this.http=i,this.service=n}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(n=>{this.service.navigate(["/menu/channel"])})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(d.gz),t.Y36(l.O),t.Y36(d.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,i){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 i.addShopee()}),t._UZ(18,"i",10),t._uU(19," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(i.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.8rem;right:.8rem;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}}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.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}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%]{border:1px solid var(--bs-primary)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.domain-option[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df;width:10rem}.subdomain-input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df}.form-select[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important;box-shadow:none!important}.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,i,n){this.route=e,this.http=i,this.service=n}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(i=>{this.service.navigate(["/menu/channel"])})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(d.gz),t.Y36(l.O),t.Y36(d.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,i){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 i.addChannelTiktok()}),t._UZ(22,"i",10),t._uU(23," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(i.code),t.xp6(4),t.Oqu(i.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.8rem;right:.8rem;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}}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.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}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%]{border:1px solid var(--bs-primary)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.domain-option[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df;width:10rem}.subdomain-input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df}.form-select[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important;box-shadow:none!important}.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:"lazada",component:b,data:{title:"Success"}}];let Y=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[d.Bz.forChild(N),d.Bz]}),o})();var J=s(8796);let F=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[p.ez,c.u5,Y,J.A0]}),o})()}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[162],{9162:(In,x,s)=>{s.r(x),s.d(x,{InventoryModule:()=>yn});var c=s(6895),n=s(4650),d=s(8252),v=s(7398);let D=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,i){1&t&&(n.TgZ(0,"nav",0)(1,"div",1)(2,"div"),n._UZ(3,"nav-tab",2),n.qZA()()(),n._UZ(4,"router-outlet")),2&t&&(n.xp6(3),n.Q6J("Tabs",i.inventoryTabs))},dependencies:[d.lC,v.e]}),e})();var y=s(8231),P=s(6304),I=s(8505),m=s(9300),u=s(3154),g=s(8705),S=s(1318),b=s(7185),T=s(5412),Z=s(7287),A=s(6082),C=s(7481),F=s(488);function U(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",17),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(3);return n.KtG(a.openScanDialog())}),n._UZ(1,"i",18),n._uU(2," Scan Channel "),n.qZA()}}function J(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",19),n.NdJ("click",function(){n.CHM(t);const a=n.oxw().ngIf,o=n.oxw(2);return n.KtG(o.onUpdateItems(a))}),n._UZ(1,"i",20),n._uU(2," Update "),n.qZA()}}function k(e,l){if(1&e&&(n.TgZ(0,"actions")(1,"div",14)(2,"div"),n.YNc(3,U,3,0,"button",15),n.YNc(4,J,3,0,"button",16),n.qZA()()()),2&e){const t=l.ngIf,i=n.oxw(2);n.xp6(3),n.Q6J("ngIf",!i.productService.hasSelectionVariant(t)),n.xp6(1),n.Q6J("ngIf",i.productService.hasSelectionVariant(t))}}function L(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"app-table",21),n.NdJ("onToggle",function(a){n.CHM(t);const o=n.oxw(2);return n.KtG(o.onShowDifferenceStock(a))})("onSubmit",function(a){const r=n.CHM(t).ngIf,p=n.oxw(2);return n.KtG(p.updateStockByVariant(a,r))}),n.qZA()}if(2&e){const t=l.ngIf,i=n.oxw(2);n.Q6J("data",t)("channel",i.channelOptions)("showProductToggle",!0)("filter",i.searchFilter)}}function O(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"span",22),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.getRowCount())}),n.TgZ(1,"i",23),n._uU(2,"?"),n.qZA()()}}function Q(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=l.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,t))}}function Y(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",24),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.nextPage())}),n._UZ(1,"i",25),n._uU(2," Next"),n.qZA()}}function E(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",26),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.getAllData())}),n._UZ(1,"i",27),n._uU(2," Last"),n.qZA()}}function q(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.onSearch(a))}),n.YNc(1,k,5,2,"actions",2),n.ALo(2,"async"),n.TgZ(3,"content")(4,"div",3)(5,"div",4)(6,"div",5),n.YNc(7,L,1,4,"app-table",6),n.ALo(8,"async"),n.ynx(9),n.TgZ(10,"div",7)(11,"div",8)(12,"div",9),n._uU(13),n.ALo(14,"number"),n.ALo(15,"async"),n.YNc(16,O,3,0,"span",10),n.YNc(17,Q,3,3,"span",2),n.ALo(18,"async"),n._uU(19),n.qZA()(),n.TgZ(20,"div",11),n.YNc(21,Y,3,0,"a",12),n.YNc(22,E,3,0,"a",13),n.qZA()(),n.BQk(),n.qZA()()()()()}if(2&e){const t=n.oxw();let i;n.Q6J("pageData",t.pageData)("hideSearchBox",!1)("hideSearchDropdown",!0)("textButton","Search"),n.xp6(1),n.Q6J("ngIf",n.lcZ(2,12,t.paginationService.data$)),n.xp6(6),n.Q6J("ngIf",n.lcZ(8,14,t.paginationService.data$)),n.xp6(6),n.hij(" Showing 1 - ",n.lcZ(14,16,null==(i=n.lcZ(15,18,t.paginationService.data$))?null:i.length)," of "),n.xp6(3),n.Q6J("ngIf",t.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(18,20,!t.paginationService.hideCount&&t.allDataCount$)),n.xp6(2),n.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),n.xp6(2),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}let V=(()=>{class e{constructor(t,i,a,o,r){this.http=t,this.toastr=i,this.dialog=a,this.paginationService=o,this.productService=r,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe((0,I.b)(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,filterModel:g.v.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.resetToFirstPage(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(t,i){let a=this.productService.selectedVariantProduct(t);if(a.length>0){let r=a.map(h=>({ID:h.ID,Code:h.Code,Inventory:h.Inventory})),p={ListChannelID:i.filter(h=>h.selected).map(h=>h.ID),List:r};this.http.post("/api/Inventory/UpdateChannel",p).subscribe(h=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+p.List.length+" variants in "+p.ListChannelID.length+" channels","Success")})}}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(y.j,{data:{filter:t,channelOptions:this.channelOptions},width:"40%"}).afterClosed().pipe((0,m.h)(a=>u.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,i,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=u.g.GuidEMpty})}updateStockByVariant(t,i){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(o=>{let r=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+r.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(t){this.searchFilter.filterModel=t?g.v.DIFFERENCE:g.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}onUpdateItems(t){const i=this.productService.selectedVariantProduct(t);this.dialog.open(P.j,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"40%"}).afterClosed().pipe((0,m.h)(a=>u.g.IsNotEmpty(a))).subscribe(a=>{this.updateStock(t,a)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,{text:this.searchFilter.text})}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}}return e.\u0275fac=function(t){return new(t||e)(n.Y36(S.O),n.Y36(b._W),n.Y36(T.uw),n.Y36(Z.b),n.Y36(A.M))},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(t,i){1&t&&(n.YNc(0,q,23,22,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,i.loader$))},dependencies:[c.O5,C.p,F.a,c.Ov,c.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),e})();var $=s(7945),H=s(1739),_=s(4006),f=s(8796),w=s(455),M=s(266);function K(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",33),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2).ngIf,o=n.oxw();return n.KtG(o.openScanDialog(a))}),n._UZ(1,"i",34),n._uU(2," Scan Channel "),n.qZA()}}function G(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",35),n.NdJ("click",function(){n.CHM(t);const a=n.oxw().ngIf,o=n.oxw(2);return n.KtG(o.updateStock(a))}),n._UZ(1,"i",36),n._uU(2," Update"),n.qZA()}}function R(e,l){if(1&e&&(n.TgZ(0,"div"),n.YNc(1,K,3,0,"button",31),n.YNc(2,G,3,0,"button",32),n.qZA()),2&e){const t=l.ngIf,i=n.oxw(2);n.xp6(1),n.Q6J("ngIf",!i.productService.hasSelectionVariant(t)),n.xp6(1),n.Q6J("ngIf",i.productService.hasSelectionVariant(t))}}function B(e,l){1&e&&(n.TgZ(0,"div",37)(1,"span"),n._uU(2," showing only different stock, please press next to populate more data "),n.qZA()())}function j(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"th")(1,"input",38),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw(2);return n.KtG(o.checkboxState=a)})("ngModelChange",function(){const o=n.CHM(t).ngIf,r=n.oxw(2);return n.KtG(r.onCheckboxStateChange(o))}),n.qZA()()}if(2&e){const t=n.oxw(2);n.xp6(1),n.Q6J("ngModel",t.checkboxState)}}function z(e,l){if(1&e&&(n.TgZ(0,"ng-option",39),n._UZ(1,"img",40),n._uU(2),n.qZA()),2&e){const t=l.$implicit;n.Q6J("value",t.ID),n.xp6(1),n.s9C("src",t.Img,n.LSH),n.xp6(1),n.hij("",t.Name," ")}}function W(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"input",64),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw(3).$implicit;return n.KtG(o.selected=a)})("ngModelChange",function(){n.CHM(t);const a=n.oxw(3).$implicit,o=n.oxw(2);return n.KtG(o.onCheckboxStateProduct(a))}),n.qZA()}if(2&e){const t=n.oxw(3).$implicit;n.Q6J("ngModel",t.selected)}}function X(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"img",65),n.NdJ("click",function(a){n.CHM(t);const o=n.oxw(3).$implicit,r=n.oxw(2);return n.KtG(r.onZoomImage(a,null==o?null:o.ImageUrl))}),n.qZA()}if(2&e){const t=n.oxw(3).$implicit;n.s9C("src",null==t?null:t.ThumbnailUrl,n.LSH)}}function nn(e,l){1&e&&n._UZ(0,"img",66)}function tn(e,l){if(1&e&&(n.ynx(0),n.TgZ(1,"td",55)(2,"div",56),n.YNc(3,W,1,1,"input",57),n.YNc(4,X,1,1,"img",58),n.YNc(5,nn,1,0,"ng-template",null,59,n.W1O),n.qZA()(),n.TgZ(7,"td",60)(8,"span",61),n._uU(9),n.qZA(),n._UZ(10,"br"),n.TgZ(11,"div",62),n._UZ(12,"i",63),n.TgZ(13,"small"),n._uU(14),n.qZA()()(),n.BQk()),2&e){const t=n.MAs(6),i=n.oxw().$implicit,a=n.oxw().$implicit;n.xp6(1),n.Q6J("rowSpan",null==a?null:a.Variants.length),n.xp6(2),n.Q6J("ngIf",(null==i?null:i.Inventory)>=0||a.Variants.length>1),n.xp6(1),n.Q6J("ngIf",null==a?null:a.ThumbnailUrl)("ngIfElse",t),n.xp6(3),n.Q6J("rowSpan",null==a?null:a.Variants.length),n.xp6(2),n.Oqu(null==a?null:a.Name),n.xp6(5),n.hij("(",null==a?null:a.Category,")")}}function en(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"input",38),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw().$implicit;return n.KtG(o.selected=a)}),n.qZA()}if(2&e){const t=n.oxw().$implicit;n.Q6J("ngModel",t.selected)}}function an(e,l){if(1&e&&(n.TgZ(0,"span")(1,"span",67),n._uU(2),n.ALo(3,"number"),n.qZA(),n._uU(4," => "),n.TgZ(5,"span",68),n._uU(6),n.ALo(7,"number"),n.qZA()()),2&e){const t=n.oxw().$implicit;n.xp6(2),n.hij(" ",n.lcZ(3,2,null==t||null==t.I?null:t.I.Available),""),n.xp6(4),n.Oqu(n.lcZ(7,4,null==t?null:t.Inventory))}}function on(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=n.oxw().$implicit;n.xp6(1),n.hij(" ",n.lcZ(2,1,null==t?null:t.Inventory)," ")}}const ln=function(e){return{"bg-gradient-warning":e}};function rn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"td",69)(1,"div",70)(2,"div",71),n.NdJ("click",function(){n.CHM(t);const a=n.oxw().$implicit,o=n.oxw(),r=o.$implicit,p=o.ngForOf,h=n.oxw(2);return n.KtG(h.openTableDialog(r,a,p))}),n.TgZ(3,"span"),n._uU(4),n.ALo(5,"number"),n.qZA()()()()}if(2&e){const t=n.oxw().$implicit;n.Q6J("ngClass",n.VKq(4,ln,(null==t?null:t.Inventory)!=(null==t||null==t.Channel[0]?null:t.Channel[0].Inventory))),n.xp6(4),n.hij(" ",n.lcZ(5,2,null==t||null==t.Channel[0]?null:t.Channel[0].Inventory)," ")}}function sn(e,l){1&e&&(n.ynx(0),n._uU(1," - "),n.BQk())}function cn(e,l){if(1&e&&(n.TgZ(0,"span",72),n.ALo(1,"date"),n._uU(2),n.ALo(3,"date"),n.qZA()),2&e){const t=n.oxw().$implicit;n.Q6J("matTooltip",n.xi3(1,2,null==t||null==t.Channel[0]?null:t.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),n.xp6(2),n.hij(" ",n.xi3(3,5,null==t||null==t.Channel[0]?null:t.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function pn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"tr"),n.YNc(1,tn,15,7,"ng-container",3),n.TgZ(2,"td",41),n._uU(3),n.qZA(),n.TgZ(4,"td",42)(5,"div",43)(6,"span"),n._uU(7),n.qZA(),n.TgZ(8,"span",44)(9,"a",45),n._UZ(10,"i",46),n.qZA()()()(),n.TgZ(11,"td",47),n.YNc(12,en,1,1,"input",48),n.qZA(),n.TgZ(13,"td",42),n.YNc(14,an,8,6,"span",3),n.YNc(15,on,3,3,"span",3),n.qZA(),n.YNc(16,rn,6,6,"td",49),n.TgZ(17,"td",23),n.YNc(18,sn,2,0,"ng-container",50),n.YNc(19,cn,4,8,"ng-template",null,51,n.W1O),n.qZA(),n.TgZ(21,"td")(22,"div",10)(23,"div",52)(24,"a",45),n._UZ(25,"i",46),n.qZA(),n._uU(26," \xa0\xa0 "),n.TgZ(27,"span",53),n.NdJ("click",function(){const o=n.CHM(t).$implicit,r=n.oxw(3);return n.KtG(r.refreshInventory(null==o||null==o.Channel[0]?null:o.Channel[0].ChannelItemID,null==o||null==o.Channel[0]?null:o.Channel[0].ChannelVariationID,null==o||null==o.Channel[0]?null:o.Channel[0].ChannelID,null==o?null:o.ID))}),n._UZ(28,"i",54),n.qZA()()()()()}if(2&e){const t=l.$implicit,i=l.index,a=n.MAs(20),o=n.oxw(3);n.xp6(1),n.Q6J("ngIf",0==i),n.xp6(2),n.Oqu(null==t?null:t.Model),n.xp6(4),n.Oqu(null==t?null:t.Code),n.xp6(2),n.Q6J("href","https://"+o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),n.LSH),n.xp6(3),n.Q6J("ngIf",(null==t?null:t.Inventory)>=0),n.xp6(2),n.Q6J("ngIf",(null==t?null:t.Inventory)!=(null==t||null==t.I?null:t.I.Available)),n.xp6(1),n.Q6J("ngIf",(null==t?null:t.Inventory)==(null==t||null==t.I?null:t.I.Available)),n.xp6(1),n.Q6J("ngIf",null==t?null:t.Channel),n.xp6(2),n.Q6J("ngIf",(null==t||null==t.Channel[0]?null:t.Channel[0].LastInventorySync)==o.minDate)("ngIfElse",a),n.xp6(6),n.Q6J("href",null==t||null==t.Channel[0]?null:t.Channel[0].Url,n.LSH)}}function hn(e,l){if(1&e&&(n.TgZ(0,"tbody"),n.YNc(1,pn,29,11,"tr",25),n.qZA()),2&e){const t=l.$implicit;n.xp6(1),n.Q6J("ngForOf",t.Variants)}}function un(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"span",73),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.getRowCount())}),n.TgZ(1,"i",74),n._uU(2,"?"),n.qZA()()}}function _n(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=l.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,null==t?null:t.Total))}}function gn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",78),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(3);return n.KtG(a.onNextPage())}),n._UZ(1,"i",79),n._uU(2," Next"),n.qZA()}}function mn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",80),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(3);return n.KtG(a.onLastPage())}),n._UZ(1,"i",81),n._uU(2," Last"),n.qZA()}}function dn(e,l){if(1&e&&(n.TgZ(0,"div",75),n.YNc(1,gn,3,0,"a",76),n.YNc(2,mn,3,0,"a",77),n.qZA()),2&e){const t=n.oxw(2);n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Cn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.onSearch(a))}),n.TgZ(1,"actions")(2,"div",2),n.YNc(3,R,3,2,"div",3),n.ALo(4,"async"),n.qZA()(),n.TgZ(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),n._uU(10,"PageNumber"),n.qZA(),n.TgZ(11,"input",6),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.PageNumber=a)}),n.qZA()(),n.TgZ(12,"div")(13,"label",7),n._uU(14,"Page Size"),n.qZA(),n.TgZ(15,"input",8),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.RowCount=a)}),n.qZA()()()()(),n.TgZ(16,"content")(17,"div",9)(18,"div",10)(19,"div",11),n.YNc(20,B,3,0,"div",12),n.TgZ(21,"table",13)(22,"thead",14)(23,"tr")(24,"th",15),n._uU(25,"Product "),n._UZ(26,"br"),n.TgZ(27,"mat-slide-toggle",16),n.NdJ("toggleChange",function(){n.CHM(t);const a=n.oxw();return a.showDifferenceStock=!a.showDifferenceStock,n.KtG(a.onShowDifferenceStock())}),n.TgZ(28,"small",17),n._uU(29,"Filter Different Inventory"),n.qZA()()(),n.TgZ(30,"th",18),n._uU(31,"Variant"),n.qZA(),n.TgZ(32,"th",19),n._uU(33,"SKU"),n.qZA(),n.YNc(34,j,2,1,"th",3),n.ALo(35,"async"),n.TgZ(36,"th",20),n._uU(37,"POS"),n.qZA(),n.TgZ(38,"th")(39,"ng-select",21),n.NdJ("change",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.onFilterChannel(a))})("ngModelChange",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.ChannelID=a)}),n.YNc(40,z,3,3,"ng-option",22),n.qZA()(),n.TgZ(41,"th",23),n._uU(42,"Last Sync"),n.qZA(),n._UZ(43,"th",24),n.qZA()(),n.YNc(44,hn,2,1,"tbody",25),n.ALo(45,"async"),n.qZA(),n.TgZ(46,"div",26)(47,"div",27)(48,"div",28),n._uU(49),n.ALo(50,"number"),n.ALo(51,"async"),n.YNc(52,un,3,0,"span",29),n.YNc(53,_n,3,3,"span",3),n.ALo(54,"async"),n._uU(55),n.qZA()(),n.YNc(56,dn,3,2,"div",30),n.ALo(57,"async"),n.qZA()()()()()()}if(2&e){const t=l.ngIf,i=n.oxw();let a,o;n.Q6J("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),n.xp6(3),n.Q6J("ngIf",n.lcZ(4,17,i.paginationService.data$)),n.xp6(8),n.Q6J("ngModel",i.searchFilter.PageNumber),n.xp6(4),n.Q6J("ngModel",i.searchFilter.RowCount),n.xp6(5),n.Q6J("ngIf",3==(null==i.searchFilter?null:i.searchFilter.filterModel)),n.xp6(14),n.Q6J("ngIf",n.lcZ(35,19,i.paginationService.data$)),n.xp6(5),n.Q6J("clearable",!1)("ngModel",i.searchFilter.ChannelID),n.xp6(1),n.Q6J("ngForOf",t.Options.Channel),n.xp6(4),n.Q6J("ngForOf",n.lcZ(45,21,i.paginationService.data$)),n.xp6(5),n.hij(" Showing 1 - ",n.lcZ(50,23,null==(a=n.lcZ(51,25,i.paginationService.data$))?null:a.length)," of "),n.xp6(3),n.Q6J("ngIf",i.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(54,27,!i.paginationService.hideCount&&i.rowCount$)),n.xp6(2),n.hij(" records ~ ",i.paginationService.footerPageNumber," Page "),n.xp6(1),n.Q6J("ngIf",(null==(o=n.lcZ(57,29,i.paginationService.data$))?null:o.length)>0)}}let fn=(()=>{class e{constructor(t,i,a,o,r,p){this.http=t,this.toastr=i,this.dialog=a,this.paginationService=o,this.productService=r,this.biggerPictureService=p,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=u.g.MinDate,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]},this.hostName=r.getHostName()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe((0,I.b)(t=>{this.channelOptions=t.Options.Channel,this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.paginationService.resetToFirstPage(this.searchFilter),t.Filter.IsMarketplaceAppActive||this.toastr.warning("Automatic inventory sync disabled.\n Please enable Dealpos X Marketplace Apps integration in POS Configuration","Warning")}))}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}onFilterChannel(t){this.searchFilter.ChannelID=t,this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(t){const i=this.productService.selectedVariantProduct(t);if(i.length>0){let a=i.map(r=>({ID:r.ID,Code:r.Code,Inventory:r.Inventory})),o={ListChannelID:[this.searchFilter.ChannelID],List:a};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(r=>{this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success"),this.checkboxState=!1})}}openScanDialog(t){const i=JSON.parse(JSON.stringify(this.searchFilter));i.ChannelID=u.g.GuidEMpty,this.dialog.open(y.j,{data:{filter:i,channelOptions:t.Options.Channel},width:"40%"}).afterClosed().pipe((0,m.h)(o=>u.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scannALl(t)})}scannALl(t){const i=this.productService.findChannelById(this.searchFilter.ChannelID,t.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(a=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.searchFilter.ScanFull=!1,this.initPageLoader(),this.toastr.success("Successfully scanned from "+i?.Name,"Success"))})}refreshInventory(t,i,a,o){this.http.post("/api/Inventory/RefreshInventoryChannel",{ChannelItemID:t,ChannelVariationID:i,ChannelID:a,VariantID:o}).subscribe(p=>{this.toastr.success("Successfully updated","Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}onCheckboxStateProduct(t){t.Variants=t.Variants.map(i=>(i.Inventory>=0&&(i.selected=t.selected),i))}onCheckboxStateChange(t){t=t.map(i=>(i.Variants=i.Variants.map(a=>(a.selected=this.checkboxState,a)),i))}openTableDialog(t,i,a){this.dialog.open($.k,{data:{Name:t.Name,Variant:i,ChannelID:i?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:t.ChannelItemID}}).afterClosed().pipe((0,m.h)(r=>u.g.IsNotEmpty(r))).subscribe(r=>{this.updateItemAfterDialog(r,a)})}updateItemAfterDialog(t,i){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};const o=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(r=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+o?.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(){this.searchFilter.filterModel=this.showDifferenceStock?g.v.DIFFERENCE:g.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){const t={ChannelID:this.searchFilter.ChannelID,PageNumber:1,text:this.searchFilter.text};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,t)}onLastPage(){this.http.post(`${this.rowCountApi}`,{ChannelID:this.searchFilter.ChannelID,PageNumber:1}).subscribe({next:i=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,i.Total)}})}onZoomImage(t,i){this.biggerPictureService.openBiggerPicture(t,i)}ngOnDestroy(){this.paginationService.destroy()}}return e.\u0275fac=function(t){return new(t||e)(n.Y36(S.O),n.Y36(b._W),n.Y36(T.uw),n.Y36(Z.b),n.Y36(A.M),n.Y36(H.k))},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-single-channel-comparison"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],[1,"fw-bold"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[3,"clearable","ngModel","change","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"text-center"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"text-start"],[1,"text-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[4,"ngIf","ngIfElse"],["SYNCDATE",""],[1,"col-12","ps-0","d-flex","justify-content-between"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"text-end",3,"ngClass"],[1,"row","justify-content-end","me-0"],[1,"col-12","pe-12","text-end",3,"click"],["matTooltipShowDelay","500",3,"matTooltip"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(t,i){1&t&&(n.YNc(0,Cn,58,31,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,i.loader$))},dependencies:[c.mk,c.sg,c.O5,_.Fj,_.wV,_.Wl,_.JJ,_.On,f.w9,f.jq,w.Rr,C.p,M.gM,c.Ov,c.JJ,c.uU],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]}),e})();var N=s(8063);const xn=[{path:"",component:D,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:V,canActivate:[N.a],data:{title:"Inventory Comparison"}},{path:"bychannel",component:fn,canActivate:[N.a],data:{title:"Inventory Comparison"}}]}];let vn=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=n.oAB({type:e}),e.\u0275inj=n.cJS({imports:[c.ez,d.Bz.forChild(xn)]}),e})(),yn=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=n.oAB({type:e}),e.\u0275inj=n.cJS({imports:[c.ez,vn,d.Bz,v.Z,_.u5,f.A0,w.rP,C.R,F.U,M.AV]}),e})()}}]);
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[162],{9162:(In,x,s)=>{s.r(x),s.d(x,{InventoryModule:()=>yn});var c=s(6895),n=s(4650),d=s(6806),v=s(7398);let D=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,i){1&t&&(n.TgZ(0,"nav",0)(1,"div",1)(2,"div"),n._UZ(3,"nav-tab",2),n.qZA()()(),n._UZ(4,"router-outlet")),2&t&&(n.xp6(3),n.Q6J("Tabs",i.inventoryTabs))},dependencies:[d.lC,v.e]}),e})();var y=s(8231),P=s(6304),I=s(8505),m=s(9300),u=s(3154),g=s(8705),S=s(1318),b=s(7185),T=s(5412),Z=s(9425),A=s(6082),C=s(7481),F=s(488);function U(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",17),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(3);return n.KtG(a.openScanDialog())}),n._UZ(1,"i",18),n._uU(2," Scan Channel "),n.qZA()}}function J(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",19),n.NdJ("click",function(){n.CHM(t);const a=n.oxw().ngIf,o=n.oxw(2);return n.KtG(o.onUpdateItems(a))}),n._UZ(1,"i",20),n._uU(2," Update "),n.qZA()}}function k(e,l){if(1&e&&(n.TgZ(0,"actions")(1,"div",14)(2,"div"),n.YNc(3,U,3,0,"button",15),n.YNc(4,J,3,0,"button",16),n.qZA()()()),2&e){const t=l.ngIf,i=n.oxw(2);n.xp6(3),n.Q6J("ngIf",!i.productService.hasSelectionVariant(t)),n.xp6(1),n.Q6J("ngIf",i.productService.hasSelectionVariant(t))}}function L(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"app-table",21),n.NdJ("onToggle",function(a){n.CHM(t);const o=n.oxw(2);return n.KtG(o.onShowDifferenceStock(a))})("onSubmit",function(a){const r=n.CHM(t).ngIf,p=n.oxw(2);return n.KtG(p.updateStockByVariant(a,r))}),n.qZA()}if(2&e){const t=l.ngIf,i=n.oxw(2);n.Q6J("data",t)("channel",i.channelOptions)("showProductToggle",!0)("filter",i.searchFilter)}}function O(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"span",22),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.getRowCount())}),n.TgZ(1,"i",23),n._uU(2,"?"),n.qZA()()}}function Q(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=l.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,t))}}function Y(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",24),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.nextPage())}),n._UZ(1,"i",25),n._uU(2," Next"),n.qZA()}}function E(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",26),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.getAllData())}),n._UZ(1,"i",27),n._uU(2," Last"),n.qZA()}}function q(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.onSearch(a))}),n.YNc(1,k,5,2,"actions",2),n.ALo(2,"async"),n.TgZ(3,"content")(4,"div",3)(5,"div",4)(6,"div",5),n.YNc(7,L,1,4,"app-table",6),n.ALo(8,"async"),n.ynx(9),n.TgZ(10,"div",7)(11,"div",8)(12,"div",9),n._uU(13),n.ALo(14,"number"),n.ALo(15,"async"),n.YNc(16,O,3,0,"span",10),n.YNc(17,Q,3,3,"span",2),n.ALo(18,"async"),n._uU(19),n.qZA()(),n.TgZ(20,"div",11),n.YNc(21,Y,3,0,"a",12),n.YNc(22,E,3,0,"a",13),n.qZA()(),n.BQk(),n.qZA()()()()()}if(2&e){const t=n.oxw();let i;n.Q6J("pageData",t.pageData)("hideSearchBox",!1)("hideSearchDropdown",!0)("textButton","Search"),n.xp6(1),n.Q6J("ngIf",n.lcZ(2,12,t.paginationService.data$)),n.xp6(6),n.Q6J("ngIf",n.lcZ(8,14,t.paginationService.data$)),n.xp6(6),n.hij(" Showing 1 - ",n.lcZ(14,16,null==(i=n.lcZ(15,18,t.paginationService.data$))?null:i.length)," of "),n.xp6(3),n.Q6J("ngIf",t.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(18,20,!t.paginationService.hideCount&&t.allDataCount$)),n.xp6(2),n.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),n.xp6(2),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}let V=(()=>{class e{constructor(t,i,a,o,r){this.http=t,this.toastr=i,this.dialog=a,this.paginationService=o,this.productService=r,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe((0,I.b)(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,filterModel:g.v.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.resetToFirstPage(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(t,i){let a=this.productService.selectedVariantProduct(t);if(a.length>0){let r=a.map(h=>({ID:h.ID,Code:h.Code,Inventory:h.Inventory})),p={ListChannelID:i.filter(h=>h.selected).map(h=>h.ID),List:r};this.http.post("/api/Inventory/UpdateChannel",p).subscribe(h=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+p.List.length+" variants in "+p.ListChannelID.length+" channels","Success")})}}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(y.j,{data:{filter:t,channelOptions:this.channelOptions},width:"40%"}).afterClosed().pipe((0,m.h)(a=>u.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,i,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=u.g.GuidEMpty})}updateStockByVariant(t,i){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(o=>{let r=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+r.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(t){this.searchFilter.filterModel=t?g.v.DIFFERENCE:g.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}onUpdateItems(t){const i=this.productService.selectedVariantProduct(t);this.dialog.open(P.j,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"40%"}).afterClosed().pipe((0,m.h)(a=>u.g.IsNotEmpty(a))).subscribe(a=>{this.updateStock(t,a)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,{text:this.searchFilter.text})}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}}return e.\u0275fac=function(t){return new(t||e)(n.Y36(S.O),n.Y36(b._W),n.Y36(T.uw),n.Y36(Z.b),n.Y36(A.M))},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(t,i){1&t&&(n.YNc(0,q,23,22,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,i.loader$))},dependencies:[c.O5,C.p,F.a,c.Ov,c.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),e})();var $=s(7945),H=s(1739),_=s(4006),f=s(8796),w=s(455),M=s(266);function K(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",33),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2).ngIf,o=n.oxw();return n.KtG(o.openScanDialog(a))}),n._UZ(1,"i",34),n._uU(2," Scan Channel "),n.qZA()}}function G(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",35),n.NdJ("click",function(){n.CHM(t);const a=n.oxw().ngIf,o=n.oxw(2);return n.KtG(o.updateStock(a))}),n._UZ(1,"i",36),n._uU(2," Update"),n.qZA()}}function R(e,l){if(1&e&&(n.TgZ(0,"div"),n.YNc(1,K,3,0,"button",31),n.YNc(2,G,3,0,"button",32),n.qZA()),2&e){const t=l.ngIf,i=n.oxw(2);n.xp6(1),n.Q6J("ngIf",!i.productService.hasSelectionVariant(t)),n.xp6(1),n.Q6J("ngIf",i.productService.hasSelectionVariant(t))}}function B(e,l){1&e&&(n.TgZ(0,"div",37)(1,"span"),n._uU(2," showing only different stock, please press next to populate more data "),n.qZA()())}function j(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"th")(1,"input",38),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw(2);return n.KtG(o.checkboxState=a)})("ngModelChange",function(){const o=n.CHM(t).ngIf,r=n.oxw(2);return n.KtG(r.onCheckboxStateChange(o))}),n.qZA()()}if(2&e){const t=n.oxw(2);n.xp6(1),n.Q6J("ngModel",t.checkboxState)}}function z(e,l){if(1&e&&(n.TgZ(0,"ng-option",39),n._UZ(1,"img",40),n._uU(2),n.qZA()),2&e){const t=l.$implicit;n.Q6J("value",t.ID),n.xp6(1),n.s9C("src",t.Img,n.LSH),n.xp6(1),n.hij("",t.Name," ")}}function W(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"input",64),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw(3).$implicit;return n.KtG(o.selected=a)})("ngModelChange",function(){n.CHM(t);const a=n.oxw(3).$implicit,o=n.oxw(2);return n.KtG(o.onCheckboxStateProduct(a))}),n.qZA()}if(2&e){const t=n.oxw(3).$implicit;n.Q6J("ngModel",t.selected)}}function X(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"img",65),n.NdJ("click",function(a){n.CHM(t);const o=n.oxw(3).$implicit,r=n.oxw(2);return n.KtG(r.onZoomImage(a,null==o?null:o.ImageUrl))}),n.qZA()}if(2&e){const t=n.oxw(3).$implicit;n.s9C("src",null==t?null:t.ThumbnailUrl,n.LSH)}}function nn(e,l){1&e&&n._UZ(0,"img",66)}function tn(e,l){if(1&e&&(n.ynx(0),n.TgZ(1,"td",55)(2,"div",56),n.YNc(3,W,1,1,"input",57),n.YNc(4,X,1,1,"img",58),n.YNc(5,nn,1,0,"ng-template",null,59,n.W1O),n.qZA()(),n.TgZ(7,"td",60)(8,"span",61),n._uU(9),n.qZA(),n._UZ(10,"br"),n.TgZ(11,"div",62),n._UZ(12,"i",63),n.TgZ(13,"small"),n._uU(14),n.qZA()()(),n.BQk()),2&e){const t=n.MAs(6),i=n.oxw().$implicit,a=n.oxw().$implicit;n.xp6(1),n.Q6J("rowSpan",null==a?null:a.Variants.length),n.xp6(2),n.Q6J("ngIf",(null==i?null:i.Inventory)>=0||a.Variants.length>1),n.xp6(1),n.Q6J("ngIf",null==a?null:a.ThumbnailUrl)("ngIfElse",t),n.xp6(3),n.Q6J("rowSpan",null==a?null:a.Variants.length),n.xp6(2),n.Oqu(null==a?null:a.Name),n.xp6(5),n.hij("(",null==a?null:a.Category,")")}}function en(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"input",38),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw().$implicit;return n.KtG(o.selected=a)}),n.qZA()}if(2&e){const t=n.oxw().$implicit;n.Q6J("ngModel",t.selected)}}function an(e,l){if(1&e&&(n.TgZ(0,"span")(1,"span",67),n._uU(2),n.ALo(3,"number"),n.qZA(),n._uU(4," => "),n.TgZ(5,"span",68),n._uU(6),n.ALo(7,"number"),n.qZA()()),2&e){const t=n.oxw().$implicit;n.xp6(2),n.hij(" ",n.lcZ(3,2,null==t||null==t.I?null:t.I.Available),""),n.xp6(4),n.Oqu(n.lcZ(7,4,null==t?null:t.Inventory))}}function on(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=n.oxw().$implicit;n.xp6(1),n.hij(" ",n.lcZ(2,1,null==t?null:t.Inventory)," ")}}const ln=function(e){return{"bg-gradient-warning":e}};function rn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"td",69)(1,"div",70)(2,"div",71),n.NdJ("click",function(){n.CHM(t);const a=n.oxw().$implicit,o=n.oxw(),r=o.$implicit,p=o.ngForOf,h=n.oxw(2);return n.KtG(h.openTableDialog(r,a,p))}),n.TgZ(3,"span"),n._uU(4),n.ALo(5,"number"),n.qZA()()()()}if(2&e){const t=n.oxw().$implicit;n.Q6J("ngClass",n.VKq(4,ln,(null==t?null:t.Inventory)!=(null==t||null==t.Channel[0]?null:t.Channel[0].Inventory))),n.xp6(4),n.hij(" ",n.lcZ(5,2,null==t||null==t.Channel[0]?null:t.Channel[0].Inventory)," ")}}function sn(e,l){1&e&&(n.ynx(0),n._uU(1," - "),n.BQk())}function cn(e,l){if(1&e&&(n.TgZ(0,"span",72),n.ALo(1,"date"),n._uU(2),n.ALo(3,"date"),n.qZA()),2&e){const t=n.oxw().$implicit;n.Q6J("matTooltip",n.xi3(1,2,null==t||null==t.Channel[0]?null:t.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),n.xp6(2),n.hij(" ",n.xi3(3,5,null==t||null==t.Channel[0]?null:t.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function pn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"tr"),n.YNc(1,tn,15,7,"ng-container",3),n.TgZ(2,"td",41),n._uU(3),n.qZA(),n.TgZ(4,"td",42)(5,"div",43)(6,"span"),n._uU(7),n.qZA(),n.TgZ(8,"span",44)(9,"a",45),n._UZ(10,"i",46),n.qZA()()()(),n.TgZ(11,"td",47),n.YNc(12,en,1,1,"input",48),n.qZA(),n.TgZ(13,"td",42),n.YNc(14,an,8,6,"span",3),n.YNc(15,on,3,3,"span",3),n.qZA(),n.YNc(16,rn,6,6,"td",49),n.TgZ(17,"td",23),n.YNc(18,sn,2,0,"ng-container",50),n.YNc(19,cn,4,8,"ng-template",null,51,n.W1O),n.qZA(),n.TgZ(21,"td")(22,"div",10)(23,"div",52)(24,"a",45),n._UZ(25,"i",46),n.qZA(),n._uU(26," \xa0\xa0 "),n.TgZ(27,"span",53),n.NdJ("click",function(){const o=n.CHM(t).$implicit,r=n.oxw(3);return n.KtG(r.refreshInventory(null==o||null==o.Channel[0]?null:o.Channel[0].ChannelItemID,null==o||null==o.Channel[0]?null:o.Channel[0].ChannelVariationID,null==o||null==o.Channel[0]?null:o.Channel[0].ChannelID,null==o?null:o.ID))}),n._UZ(28,"i",54),n.qZA()()()()()}if(2&e){const t=l.$implicit,i=l.index,a=n.MAs(20),o=n.oxw(3);n.xp6(1),n.Q6J("ngIf",0==i),n.xp6(2),n.Oqu(null==t?null:t.Model),n.xp6(4),n.Oqu(null==t?null:t.Code),n.xp6(2),n.Q6J("href","https://"+o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),n.LSH),n.xp6(3),n.Q6J("ngIf",(null==t?null:t.Inventory)>=0),n.xp6(2),n.Q6J("ngIf",(null==t?null:t.Inventory)!=(null==t||null==t.I?null:t.I.Available)),n.xp6(1),n.Q6J("ngIf",(null==t?null:t.Inventory)==(null==t||null==t.I?null:t.I.Available)),n.xp6(1),n.Q6J("ngIf",null==t?null:t.Channel),n.xp6(2),n.Q6J("ngIf",(null==t||null==t.Channel[0]?null:t.Channel[0].LastInventorySync)==o.minDate)("ngIfElse",a),n.xp6(6),n.Q6J("href",null==t||null==t.Channel[0]?null:t.Channel[0].Url,n.LSH)}}function hn(e,l){if(1&e&&(n.TgZ(0,"tbody"),n.YNc(1,pn,29,11,"tr",25),n.qZA()),2&e){const t=l.$implicit;n.xp6(1),n.Q6J("ngForOf",t.Variants)}}function un(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"span",73),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.getRowCount())}),n.TgZ(1,"i",74),n._uU(2,"?"),n.qZA()()}}function _n(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=l.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,null==t?null:t.Total))}}function gn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",78),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(3);return n.KtG(a.onNextPage())}),n._UZ(1,"i",79),n._uU(2," Next"),n.qZA()}}function mn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",80),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(3);return n.KtG(a.onLastPage())}),n._UZ(1,"i",81),n._uU(2," Last"),n.qZA()}}function dn(e,l){if(1&e&&(n.TgZ(0,"div",75),n.YNc(1,gn,3,0,"a",76),n.YNc(2,mn,3,0,"a",77),n.qZA()),2&e){const t=n.oxw(2);n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Cn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.onSearch(a))}),n.TgZ(1,"actions")(2,"div",2),n.YNc(3,R,3,2,"div",3),n.ALo(4,"async"),n.qZA()(),n.TgZ(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),n._uU(10,"PageNumber"),n.qZA(),n.TgZ(11,"input",6),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.PageNumber=a)}),n.qZA()(),n.TgZ(12,"div")(13,"label",7),n._uU(14,"Page Size"),n.qZA(),n.TgZ(15,"input",8),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.RowCount=a)}),n.qZA()()()()(),n.TgZ(16,"content")(17,"div",9)(18,"div",10)(19,"div",11),n.YNc(20,B,3,0,"div",12),n.TgZ(21,"table",13)(22,"thead",14)(23,"tr")(24,"th",15),n._uU(25,"Product "),n._UZ(26,"br"),n.TgZ(27,"mat-slide-toggle",16),n.NdJ("toggleChange",function(){n.CHM(t);const a=n.oxw();return a.showDifferenceStock=!a.showDifferenceStock,n.KtG(a.onShowDifferenceStock())}),n.TgZ(28,"small",17),n._uU(29,"Filter Different Inventory"),n.qZA()()(),n.TgZ(30,"th",18),n._uU(31,"Variant"),n.qZA(),n.TgZ(32,"th",19),n._uU(33,"SKU"),n.qZA(),n.YNc(34,j,2,1,"th",3),n.ALo(35,"async"),n.TgZ(36,"th",20),n._uU(37,"POS"),n.qZA(),n.TgZ(38,"th")(39,"ng-select",21),n.NdJ("change",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.onFilterChannel(a))})("ngModelChange",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.ChannelID=a)}),n.YNc(40,z,3,3,"ng-option",22),n.qZA()(),n.TgZ(41,"th",23),n._uU(42,"Last Sync"),n.qZA(),n._UZ(43,"th",24),n.qZA()(),n.YNc(44,hn,2,1,"tbody",25),n.ALo(45,"async"),n.qZA(),n.TgZ(46,"div",26)(47,"div",27)(48,"div",28),n._uU(49),n.ALo(50,"number"),n.ALo(51,"async"),n.YNc(52,un,3,0,"span",29),n.YNc(53,_n,3,3,"span",3),n.ALo(54,"async"),n._uU(55),n.qZA()(),n.YNc(56,dn,3,2,"div",30),n.ALo(57,"async"),n.qZA()()()()()()}if(2&e){const t=l.ngIf,i=n.oxw();let a,o;n.Q6J("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),n.xp6(3),n.Q6J("ngIf",n.lcZ(4,17,i.paginationService.data$)),n.xp6(8),n.Q6J("ngModel",i.searchFilter.PageNumber),n.xp6(4),n.Q6J("ngModel",i.searchFilter.RowCount),n.xp6(5),n.Q6J("ngIf",3==(null==i.searchFilter?null:i.searchFilter.filterModel)),n.xp6(14),n.Q6J("ngIf",n.lcZ(35,19,i.paginationService.data$)),n.xp6(5),n.Q6J("clearable",!1)("ngModel",i.searchFilter.ChannelID),n.xp6(1),n.Q6J("ngForOf",t.Options.Channel),n.xp6(4),n.Q6J("ngForOf",n.lcZ(45,21,i.paginationService.data$)),n.xp6(5),n.hij(" Showing 1 - ",n.lcZ(50,23,null==(a=n.lcZ(51,25,i.paginationService.data$))?null:a.length)," of "),n.xp6(3),n.Q6J("ngIf",i.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(54,27,!i.paginationService.hideCount&&i.rowCount$)),n.xp6(2),n.hij(" records ~ ",i.paginationService.footerPageNumber," Page "),n.xp6(1),n.Q6J("ngIf",(null==(o=n.lcZ(57,29,i.paginationService.data$))?null:o.length)>0)}}let fn=(()=>{class e{constructor(t,i,a,o,r,p){this.http=t,this.toastr=i,this.dialog=a,this.paginationService=o,this.productService=r,this.biggerPictureService=p,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=u.g.MinDate,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]},this.hostName=r.getHostName()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe((0,I.b)(t=>{this.channelOptions=t.Options.Channel,this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.paginationService.resetToFirstPage(this.searchFilter),t.Filter.IsMarketplaceAppActive||this.toastr.warning("Automatic inventory sync disabled.\n Please enable Dealpos X Marketplace Apps integration in POS Configuration","Warning")}))}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}onFilterChannel(t){this.searchFilter.ChannelID=t,this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(t){const i=this.productService.selectedVariantProduct(t);if(i.length>0){let a=i.map(r=>({ID:r.ID,Code:r.Code,Inventory:r.Inventory})),o={ListChannelID:[this.searchFilter.ChannelID],List:a};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(r=>{this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success"),this.checkboxState=!1})}}openScanDialog(t){const i=JSON.parse(JSON.stringify(this.searchFilter));i.ChannelID=u.g.GuidEMpty,this.dialog.open(y.j,{data:{filter:i,channelOptions:t.Options.Channel},width:"40%"}).afterClosed().pipe((0,m.h)(o=>u.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scannALl(t)})}scannALl(t){const i=this.productService.findChannelById(this.searchFilter.ChannelID,t.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(a=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.searchFilter.ScanFull=!1,this.initPageLoader(),this.toastr.success("Successfully scanned from "+i?.Name,"Success"))})}refreshInventory(t,i,a,o){this.http.post("/api/Inventory/RefreshInventoryChannel",{ChannelItemID:t,ChannelVariationID:i,ChannelID:a,VariantID:o}).subscribe(p=>{this.toastr.success("Successfully updated","Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}onCheckboxStateProduct(t){t.Variants=t.Variants.map(i=>(i.Inventory>=0&&(i.selected=t.selected),i))}onCheckboxStateChange(t){t=t.map(i=>(i.Variants=i.Variants.map(a=>(a.selected=this.checkboxState,a)),i))}openTableDialog(t,i,a){this.dialog.open($.k,{data:{Name:t.Name,Variant:i,ChannelID:i?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:t.ChannelItemID}}).afterClosed().pipe((0,m.h)(r=>u.g.IsNotEmpty(r))).subscribe(r=>{this.updateItemAfterDialog(r,a)})}updateItemAfterDialog(t,i){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};const o=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(r=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+o?.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(){this.searchFilter.filterModel=this.showDifferenceStock?g.v.DIFFERENCE:g.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){const t={ChannelID:this.searchFilter.ChannelID,PageNumber:1,text:this.searchFilter.text};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,t)}onLastPage(){this.http.post(`${this.rowCountApi}`,{ChannelID:this.searchFilter.ChannelID,PageNumber:1}).subscribe({next:i=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,i.Total)}})}onZoomImage(t,i){this.biggerPictureService.openBiggerPicture(t,i)}ngOnDestroy(){this.paginationService.destroy()}}return e.\u0275fac=function(t){return new(t||e)(n.Y36(S.O),n.Y36(b._W),n.Y36(T.uw),n.Y36(Z.b),n.Y36(A.M),n.Y36(H.k))},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-single-channel-comparison"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],[1,"fw-bold"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[3,"clearable","ngModel","change","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"text-center"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"text-start"],[1,"text-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[4,"ngIf","ngIfElse"],["SYNCDATE",""],[1,"col-12","ps-0","d-flex","justify-content-between"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"text-end",3,"ngClass"],[1,"row","justify-content-end","me-0"],[1,"col-12","pe-12","text-end",3,"click"],["matTooltipShowDelay","500",3,"matTooltip"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(t,i){1&t&&(n.YNc(0,Cn,58,31,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,i.loader$))},dependencies:[c.mk,c.sg,c.O5,_.Fj,_.wV,_.Wl,_.JJ,_.On,f.w9,f.jq,w.Rr,C.p,M.gM,c.Ov,c.JJ,c.uU],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]}),e})();var N=s(8063);const xn=[{path:"",component:D,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:V,canActivate:[N.a],data:{title:"Inventory Comparison"}},{path:"bychannel",component:fn,canActivate:[N.a],data:{title:"Inventory Comparison"}}]}];let vn=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=n.oAB({type:e}),e.\u0275inj=n.cJS({imports:[c.ez,d.Bz.forChild(xn)]}),e})(),yn=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=n.oAB({type:e}),e.\u0275inj=n.cJS({imports:[c.ez,vn,d.Bz,v.Z,_.u5,f.A0,w.rP,C.R,F.U,M.AV]}),e})()}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[174],{6174:(Q,y,s)=>{s.r(y),s.d(y,{OrderModule:()=>M});var l=s(6895),t=s(4650),C=s(7398),m=s(8252);const v=function(){return["/menu/report/product-statistic/channel"]};let S=(()=>{class o{constructor(){this.reportTabs=[{Title:"1 - New Order",Url:"/menu/report/order/sync-order"},{Title:"2 - Ready to Ship",Url:"/menu/report/order/invoice"},{Title:"3 - Shipped",Url:"/menu/report/order/delivery"},{Title:"4 - Completed",Url:"/menu/report/order/payment"}]}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-order"]],decls:18,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"],[1,"dropdown","dropstart","me-4"],["role","button","data-bs-toggle","dropdown","id","dropdownMenuButton1","aria-expanded","false",1,"text-dark"],[1,"fas","fa-bars","fa-lg"],["aria-labelledby","dropdownMenuButton1",1,"dropdown-menu","report"],[1,"dropdown-header","text-dark","fw-normal",2,"font-size",".875rem !important"],[1,"dropdown-divider"],[1,"dropdown-item",3,"routerLink"],[1,"fa-regular","fa-file","me-2"]],template:function(e,r){1&e&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA(),t.TgZ(4,"div",3)(5,"a",4),t._UZ(6,"i",5),t.qZA(),t.TgZ(7,"ul",6)(8,"li")(9,"h5",7),t._uU(10,"Product Report"),t.qZA()(),t.TgZ(11,"li"),t._UZ(12,"hr",8),t.qZA(),t.TgZ(13,"li")(14,"a",9),t._UZ(15,"i",10),t._uU(16,"Product Statistic"),t.qZA()()()()()(),t._UZ(17,"router-outlet")),2&e&&(t.xp6(3),t.Q6J("Tabs",r.reportTabs),t.xp6(11),t.Q6J("routerLink",t.DdM(2,v)))},dependencies:[C.e,m.lC,m.yS],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]}),o})();var p=s(3154);class f{}var _=s(1318);let u=(()=>{class o{constructor(e){this.http=e}GetLoader(){return new Promise((e,r)=>{this.http.post("/api/Report/GetLoader",{}).subscribe(i=>{e(i)})})}GetSyncOrder(e){return new Promise((r,i)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(a=>{r(a)})})}GetSyncInvoice(e){return new Promise((r,i)=>{this.http.post("/api/Report/Invoice",JSON.stringify(e)).subscribe(a=>{r(a)})})}GetSyncDelivery(e){return new Promise((r,i)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(a=>{r(a)})})}GetSyncPayment(e){return new Promise((r,i)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(a=>{r(a)})})}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(_.O))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var h=s(7481),c=s(5171),d=(()=>{return(o=d||(d={}))[o.OK=200]="OK",o[o.BAD_REQUEST=400]="BAD_REQUEST",o[o.CONFLICT=409]="CONFLICT",o[o.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",d;var o})();function O(o,n){if(1&o&&(t.TgZ(0,"th",9)(1,"div",10)(2,"h4"),t._uU(3),t.qZA(),t.TgZ(4,"small",11),t._uU(5),t.qZA()()()),2&o){const e=n.$implicit,r=t.oxw();t.xp6(3),t.Oqu(e),t.xp6(1),t.Tol(r.getTextBgColor(e)),t.xp6(1),t.Oqu(r.getHeaderStatusDesc(e))}}const D=function(){return["/menu/log/order"]},P=function(o,n,e,r,i){return{responseCode:o,From:n,to:e,actionType:r,ChannelID:i}};function Z(o,n){if(1&o&&(t.TgZ(0,"td",14)(1,"a",15),t._uU(2),t.qZA()()),2&o){const e=n.$implicit,r=t.oxw().$implicit,i=t.oxw();t.xp6(1),t.Q6J("routerLink",t.DdM(3,D))("queryParams",t.qbA(4,P,e.Key,i.from,i.to,i.type,r.ChannelID)),t.xp6(1),t.hij(" ",e.Value," ")}}function x(o,n){if(1&o&&(t.TgZ(0,"tr")(1,"td")(2,"a",12),t._UZ(3,"img",13),t.qZA()(),t.TgZ(4,"td")(5,"div")(6,"a",12),t._uU(7),t.qZA()(),t.TgZ(8,"div"),t._uU(9),t.qZA()(),t.YNc(10,Z,3,10,"td",8),t.qZA()),2&o){const e=n.$implicit,r=t.oxw();t.xp6(2),t.s9C("href",e.Url,t.LSH),t.xp6(1),t.Q6J("src",r.getChannelLogo(e.Type),t.LSH),t.xp6(3),t.s9C("href",e.Url,t.LSH),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Url),t.xp6(1),t.Q6J("ngForOf",e.list)}}function F(o,n){if(1&o&&(t.TgZ(0,"td",14)(1,"div",16),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&o){const e=n.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.total))}}let g=(()=>{class o{constructor(){this.headerStatus=d,this.listCalculationStatusCode=[]}ngOnChanges(e){e.result&&this.calculateStatusCode()}getHeaderStatusDesc(e){let r=null;switch(e){case d.BAD_REQUEST:r="BAD REQUEST";break;case d.CONFLICT:r="CONFLICT";break;case d.INTERNAL_SERVER_ERROR:r="INTERNAL SERVER ERROR";break;default:r="OK"}return r}getTextBgColor(e){let r=null;switch(e){case d.OK:r="bg-success";break;case d.INTERNAL_SERVER_ERROR:r="bg-danger";break;default:r="bg-warning"}return r}getChannelLogo(e){return p.g.getChannelLogoByTypeId(e)}calculateStatusCode(){if(this.listCalculationStatusCode=[],this.result){let e,r;this.concatStatusCode().forEach(i=>{e=this.listCalculationStatusCode.findIndex(a=>a.status==i.Key),r=-1!==e,r?this.listCalculationStatusCode[e].total+=i.Value:this.listCalculationStatusCode=[...this.listCalculationStatusCode,{status:i.Key,total:i.Value}]})}}concatStatusCode(){return this.result.map(e=>e.list).reduce((e,r)=>[...e,...r])}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-table-report"]],inputs:{header:"header",result:"result",from:"from",to:"to",type:"type"},features:[t.TTD],decls:15,vars:3,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],["class","text-start","style","width: 10%;",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],["colspan","2"],[1,"text-center","h3","fw-bold"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(e,r){1&e&&(t.TgZ(0,"table",0)(1,"thead",1)(2,"tr"),t._UZ(3,"th",2),t.TgZ(4,"th",3),t._uU(5,"Channel"),t.qZA(),t.YNc(6,O,6,4,"th",4),t.qZA()(),t.TgZ(7,"tbody"),t.YNc(8,x,11,6,"tr",5),t.qZA(),t.TgZ(9,"tfoot")(10,"tr")(11,"td",6)(12,"div",7),t._uU(13,"Total"),t.qZA()(),t.YNc(14,F,4,3,"td",8),t.qZA()()()),2&e&&(t.xp6(6),t.Q6J("ngForOf",r.header),t.xp6(2),t.Q6J("ngForOf",r.result),t.xp6(6),t.Q6J("ngForOf",r.listCalculationStatusCode))},dependencies:[l.sg,m.yS,l.JJ],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]}),o})();function w(o,n){if(1&o&&(t.TgZ(0,"div",5)(1,"div",6),t._UZ(2,"app-table-report",7),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("result",e.result)("header",e.header)("from",e.from)("to",e.to)("type",0)}}let R=(()=>{class o{constructor(e,r){this.http=e,this.datePipe=r,this.filter=new f,this.pageTitle="New Order";let i=new Date;this.maxDate=i,this.minDate=p.g.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){const e=p.g.formatTitleForFromDate(this.filter.From,this.filter.To),r=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${r} - ${i})`}initPageLoader(){this.http.GetLoader().then(e=>{this.filter=e,this.from=this.filter.From.toString(),this.to=this.filter.To.toString(),this.http.GetSyncOrder(this.filter).then(r=>{this.header=r.Header,this.result=r.Body})})}getChannelLogs(e){this.filter.From=e.from,this.filter.To=e.to,this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(r=>{this.header=r.Header,this.result=r.Body,this.from=this.filter.From.toJSON(),this.to=this.filter.To.toJSON()})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(u),t.Y36(l.uU))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-sales-order"]],decls:7,vars:7,consts:[[3,"headerTitle","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(e,r){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),t.NdJ("dateChange",function(a){return r.getChannelLogs(a)}),t.qZA()()(),t.TgZ(4,"content")(5,"div",3),t.YNc(6,w,3,5,"div",4),t.qZA()()()),2&e&&(t.Q6J("headerTitle",r.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(3),t.Q6J("minDate",r.minDate)("from",r.filter.From)("to",r.filter.To),t.xp6(3),t.Q6J("ngIf",r.result))},dependencies:[l.O5,h.p,c.Pg,g],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),o})();var T=s(8063);function b(o,n){if(1&o&&(t.TgZ(0,"div",5)(1,"div",6),t._UZ(2,"app-table-report",7),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("result",e.result)("header",e.header)("from",e.from)("to",e.to)("type",1)}}let A=(()=>{class o{constructor(e,r){this.http=e,this.datePipe=r,this.filter=new f,this.PageTitle="Ready to Ship";let i=new Date;this.maxDate=i,this.minDate=p.g.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){const e=p.g.formatTitleForFromDate(this.filter.From,this.filter.To),r=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${r} - ${i})`}initPageLoader(){this.http.GetLoader().then(e=>{this.filter=e,this.from=this.filter.From.toString(),this.to=this.filter.To.toString(),this.http.GetSyncInvoice(this.filter).then(r=>{this.header=r.Header,this.result=r.Body})})}getChannelLogs(e){this.filter.From=e.from,this.filter.To=e.to,this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(r=>{this.header=r.Header,this.result=r.Body,this.from=this.filter.From.toJSON(),this.to=this.filter.To.toJSON()})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(u),t.Y36(l.uU))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-invoice"]],decls:7,vars:7,consts:[[3,"headerTitle","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(e,r){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),t.NdJ("dateChange",function(a){return r.getChannelLogs(a)}),t.qZA()()(),t.TgZ(4,"content")(5,"div",3),t.YNc(6,b,3,5,"div",4),t.qZA()()()),2&e&&(t.Q6J("headerTitle",r.PageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(3),t.Q6J("minDate",r.minDate)("from",r.filter.From)("to",r.filter.To),t.xp6(3),t.Q6J("ngIf",r.result))},dependencies:[l.O5,h.p,c.Pg,g],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),o})();function J(o,n){if(1&o&&(t.TgZ(0,"div",5)(1,"div",6),t._UZ(2,"app-table-report",7),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("result",e.result)("header",e.header)("from",e.from)("to",e.to)("type",3)}}let L=(()=>{class o{constructor(e,r){this.http=e,this.datePipe=r,this.filter=new f;let i=new Date;this.maxDate=i,this.minDate=p.g.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){const e=p.g.formatTitleForFromDate(this.filter.From,this.filter.To),r=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${r} - ${i})`}initPageLoader(){this.http.GetLoader().then(e=>{this.filter=e,this.from=this.filter.From.toString(),this.to=this.filter.To.toString(),this.http.GetSyncDelivery(this.filter).then(r=>{this.header=r.Header,this.result=r.Body})})}getChannelLogs(e){this.filter.From=e.from,this.filter.To=e.to,this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(r=>{this.header=r.Header,this.result=r.Body,this.from=this.filter.From.toJSON(),this.to=this.filter.To.toJSON()})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(u),t.Y36(l.uU))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-delivery"]],decls:7,vars:7,consts:[[3,"headerTitle","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(e,r){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),t.NdJ("dateChange",function(a){return r.getChannelLogs(a)}),t.qZA()()(),t.TgZ(4,"content")(5,"div",3),t.YNc(6,J,3,5,"div",4),t.qZA()()()),2&e&&(t.Q6J("headerTitle",r.PageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(3),t.Q6J("minDate",r.minDate)("from",r.filter.From)("to",r.filter.To),t.xp6(3),t.Q6J("ngIf",r.result))},dependencies:[l.O5,h.p,c.Pg,g],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),o})();function N(o,n){if(1&o&&(t.TgZ(0,"div",5)(1,"div",6),t._UZ(2,"app-table-report",7),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("result",e.result)("header",e.header)("from",e.from)("to",e.to)("type",4)}}let I=(()=>{class o{constructor(e,r){this.http=e,this.datePipe=r,this.filter=new f,this.PageTitle="Completed";let i=new Date;this.minDate=p.g.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){const e=p.g.formatTitleForFromDate(this.filter.From,this.filter.To),r=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${r} - ${i})`}initPageLoader(){this.http.GetLoader().then(e=>{this.filter=e,this.from=this.filter.From.toString(),this.to=this.filter.To.toString(),this.http.GetSyncPayment(this.filter).then(r=>{this.header=r.Header,this.result=r.Body})})}getChannelLogs(e){this.filter.From=e.from,this.filter.To=e.to,this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(r=>{this.header=r.Header,this.result=r.Body,this.from=this.filter.From.toJSON(),this.to=this.filter.To.toJSON()})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(u),t.Y36(l.uU))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-payment"]],decls:7,vars:7,consts:[[3,"headerTitle","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(e,r){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),t.NdJ("dateChange",function(a){return r.getChannelLogs(a)}),t.qZA()()(),t.TgZ(4,"content")(5,"div",3),t.YNc(6,N,3,5,"div",4),t.qZA()()()),2&e&&(t.Q6J("headerTitle",r.PageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(3),t.Q6J("minDate",r.minDate)("from",r.filter.From)("to",r.filter.To),t.xp6(3),t.Q6J("ngIf",r.result))},dependencies:[l.O5,h.p,c.Pg,g],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),o})();var U=s(4006);const E=[{path:"",component:S,children:[{path:"",redirectTo:"sync-order",pathMatch:"full"},{path:"sync-order",component:R,canActivate:[T.a],data:{title:"Sync Order"}},{path:"invoice",component:A,canActivate:[T.a],data:{title:"Sync Invoice"}},{path:"delivery",component:L,canActivate:[T.a],data:{title:"Sync Delivery"}},{path:"payment",component:I,canActivate:[T.a],data:{title:"Sync Payment"}}]}];let M=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[l.ez,C.Z,U.u5,h.R,c.v,m.Bz.forChild(E)]}),o})()}}]);
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[174],{6174:(Q,y,s)=>{s.r(y),s.d(y,{OrderModule:()=>M});var l=s(6895),t=s(4650),C=s(7398),m=s(6806);const v=function(){return["/menu/report/product-statistic/channel"]};let S=(()=>{class o{constructor(){this.reportTabs=[{Title:"1 - New Order",Url:"/menu/report/order/sync-order"},{Title:"2 - Ready to Ship",Url:"/menu/report/order/invoice"},{Title:"3 - Shipped",Url:"/menu/report/order/delivery"},{Title:"4 - Completed",Url:"/menu/report/order/payment"}]}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-order"]],decls:18,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"],[1,"dropdown","dropstart","me-4"],["role","button","data-bs-toggle","dropdown","id","dropdownMenuButton1","aria-expanded","false",1,"text-dark"],[1,"fas","fa-bars","fa-lg"],["aria-labelledby","dropdownMenuButton1",1,"dropdown-menu","report"],[1,"dropdown-header","text-dark","fw-normal",2,"font-size",".875rem !important"],[1,"dropdown-divider"],[1,"dropdown-item",3,"routerLink"],[1,"fa-regular","fa-file","me-2"]],template:function(e,r){1&e&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA(),t.TgZ(4,"div",3)(5,"a",4),t._UZ(6,"i",5),t.qZA(),t.TgZ(7,"ul",6)(8,"li")(9,"h5",7),t._uU(10,"Product Report"),t.qZA()(),t.TgZ(11,"li"),t._UZ(12,"hr",8),t.qZA(),t.TgZ(13,"li")(14,"a",9),t._UZ(15,"i",10),t._uU(16,"Product Statistic"),t.qZA()()()()()(),t._UZ(17,"router-outlet")),2&e&&(t.xp6(3),t.Q6J("Tabs",r.reportTabs),t.xp6(11),t.Q6J("routerLink",t.DdM(2,v)))},dependencies:[C.e,m.lC,m.yS],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]}),o})();var p=s(3154);class f{}var _=s(1318);let u=(()=>{class o{constructor(e){this.http=e}GetLoader(){return new Promise((e,r)=>{this.http.post("/api/Report/GetLoader",{}).subscribe(i=>{e(i)})})}GetSyncOrder(e){return new Promise((r,i)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(a=>{r(a)})})}GetSyncInvoice(e){return new Promise((r,i)=>{this.http.post("/api/Report/Invoice",JSON.stringify(e)).subscribe(a=>{r(a)})})}GetSyncDelivery(e){return new Promise((r,i)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(a=>{r(a)})})}GetSyncPayment(e){return new Promise((r,i)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(a=>{r(a)})})}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(_.O))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var h=s(7481),c=s(5171),d=(()=>{return(o=d||(d={}))[o.OK=200]="OK",o[o.BAD_REQUEST=400]="BAD_REQUEST",o[o.CONFLICT=409]="CONFLICT",o[o.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",d;var o})();function O(o,n){if(1&o&&(t.TgZ(0,"th",9)(1,"div",10)(2,"h4"),t._uU(3),t.qZA(),t.TgZ(4,"small",11),t._uU(5),t.qZA()()()),2&o){const e=n.$implicit,r=t.oxw();t.xp6(3),t.Oqu(e),t.xp6(1),t.Tol(r.getTextBgColor(e)),t.xp6(1),t.Oqu(r.getHeaderStatusDesc(e))}}const D=function(){return["/menu/log/order"]},P=function(o,n,e,r,i){return{responseCode:o,From:n,to:e,actionType:r,ChannelID:i}};function Z(o,n){if(1&o&&(t.TgZ(0,"td",14)(1,"a",15),t._uU(2),t.qZA()()),2&o){const e=n.$implicit,r=t.oxw().$implicit,i=t.oxw();t.xp6(1),t.Q6J("routerLink",t.DdM(3,D))("queryParams",t.qbA(4,P,e.Key,i.from,i.to,i.type,r.ChannelID)),t.xp6(1),t.hij(" ",e.Value," ")}}function x(o,n){if(1&o&&(t.TgZ(0,"tr")(1,"td")(2,"a",12),t._UZ(3,"img",13),t.qZA()(),t.TgZ(4,"td")(5,"div")(6,"a",12),t._uU(7),t.qZA()(),t.TgZ(8,"div"),t._uU(9),t.qZA()(),t.YNc(10,Z,3,10,"td",8),t.qZA()),2&o){const e=n.$implicit,r=t.oxw();t.xp6(2),t.s9C("href",e.Url,t.LSH),t.xp6(1),t.Q6J("src",r.getChannelLogo(e.Type),t.LSH),t.xp6(3),t.s9C("href",e.Url,t.LSH),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Url),t.xp6(1),t.Q6J("ngForOf",e.list)}}function F(o,n){if(1&o&&(t.TgZ(0,"td",14)(1,"div",16),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&o){const e=n.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.total))}}let g=(()=>{class o{constructor(){this.headerStatus=d,this.listCalculationStatusCode=[]}ngOnChanges(e){e.result&&this.calculateStatusCode()}getHeaderStatusDesc(e){let r=null;switch(e){case d.BAD_REQUEST:r="BAD REQUEST";break;case d.CONFLICT:r="CONFLICT";break;case d.INTERNAL_SERVER_ERROR:r="INTERNAL SERVER ERROR";break;default:r="OK"}return r}getTextBgColor(e){let r=null;switch(e){case d.OK:r="bg-success";break;case d.INTERNAL_SERVER_ERROR:r="bg-danger";break;default:r="bg-warning"}return r}getChannelLogo(e){return p.g.getChannelLogoByTypeId(e)}calculateStatusCode(){if(this.listCalculationStatusCode=[],this.result){let e,r;this.concatStatusCode().forEach(i=>{e=this.listCalculationStatusCode.findIndex(a=>a.status==i.Key),r=-1!==e,r?this.listCalculationStatusCode[e].total+=i.Value:this.listCalculationStatusCode=[...this.listCalculationStatusCode,{status:i.Key,total:i.Value}]})}}concatStatusCode(){return this.result.map(e=>e.list).reduce((e,r)=>[...e,...r])}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-table-report"]],inputs:{header:"header",result:"result",from:"from",to:"to",type:"type"},features:[t.TTD],decls:15,vars:3,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],["class","text-start","style","width: 10%;",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],["colspan","2"],[1,"text-center","h3","fw-bold"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(e,r){1&e&&(t.TgZ(0,"table",0)(1,"thead",1)(2,"tr"),t._UZ(3,"th",2),t.TgZ(4,"th",3),t._uU(5,"Channel"),t.qZA(),t.YNc(6,O,6,4,"th",4),t.qZA()(),t.TgZ(7,"tbody"),t.YNc(8,x,11,6,"tr",5),t.qZA(),t.TgZ(9,"tfoot")(10,"tr")(11,"td",6)(12,"div",7),t._uU(13,"Total"),t.qZA()(),t.YNc(14,F,4,3,"td",8),t.qZA()()()),2&e&&(t.xp6(6),t.Q6J("ngForOf",r.header),t.xp6(2),t.Q6J("ngForOf",r.result),t.xp6(6),t.Q6J("ngForOf",r.listCalculationStatusCode))},dependencies:[l.sg,m.yS,l.JJ],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]}),o})();function w(o,n){if(1&o&&(t.TgZ(0,"div",5)(1,"div",6),t._UZ(2,"app-table-report",7),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("result",e.result)("header",e.header)("from",e.from)("to",e.to)("type",0)}}let R=(()=>{class o{constructor(e,r){this.http=e,this.datePipe=r,this.filter=new f,this.pageTitle="New Order";let i=new Date;this.maxDate=i,this.minDate=p.g.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){const e=p.g.formatTitleForFromDate(this.filter.From,this.filter.To),r=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${r} - ${i})`}initPageLoader(){this.http.GetLoader().then(e=>{this.filter=e,this.from=this.filter.From.toString(),this.to=this.filter.To.toString(),this.http.GetSyncOrder(this.filter).then(r=>{this.header=r.Header,this.result=r.Body})})}getChannelLogs(e){this.filter.From=e.from,this.filter.To=e.to,this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(r=>{this.header=r.Header,this.result=r.Body,this.from=this.filter.From.toJSON(),this.to=this.filter.To.toJSON()})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(u),t.Y36(l.uU))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-sales-order"]],decls:7,vars:7,consts:[[3,"headerTitle","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(e,r){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),t.NdJ("dateChange",function(a){return r.getChannelLogs(a)}),t.qZA()()(),t.TgZ(4,"content")(5,"div",3),t.YNc(6,w,3,5,"div",4),t.qZA()()()),2&e&&(t.Q6J("headerTitle",r.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(3),t.Q6J("minDate",r.minDate)("from",r.filter.From)("to",r.filter.To),t.xp6(3),t.Q6J("ngIf",r.result))},dependencies:[l.O5,h.p,c.Pg,g],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),o})();var T=s(8063);function b(o,n){if(1&o&&(t.TgZ(0,"div",5)(1,"div",6),t._UZ(2,"app-table-report",7),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("result",e.result)("header",e.header)("from",e.from)("to",e.to)("type",1)}}let A=(()=>{class o{constructor(e,r){this.http=e,this.datePipe=r,this.filter=new f,this.PageTitle="Ready to Ship";let i=new Date;this.maxDate=i,this.minDate=p.g.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){const e=p.g.formatTitleForFromDate(this.filter.From,this.filter.To),r=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${r} - ${i})`}initPageLoader(){this.http.GetLoader().then(e=>{this.filter=e,this.from=this.filter.From.toString(),this.to=this.filter.To.toString(),this.http.GetSyncInvoice(this.filter).then(r=>{this.header=r.Header,this.result=r.Body})})}getChannelLogs(e){this.filter.From=e.from,this.filter.To=e.to,this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(r=>{this.header=r.Header,this.result=r.Body,this.from=this.filter.From.toJSON(),this.to=this.filter.To.toJSON()})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(u),t.Y36(l.uU))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-invoice"]],decls:7,vars:7,consts:[[3,"headerTitle","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(e,r){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),t.NdJ("dateChange",function(a){return r.getChannelLogs(a)}),t.qZA()()(),t.TgZ(4,"content")(5,"div",3),t.YNc(6,b,3,5,"div",4),t.qZA()()()),2&e&&(t.Q6J("headerTitle",r.PageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(3),t.Q6J("minDate",r.minDate)("from",r.filter.From)("to",r.filter.To),t.xp6(3),t.Q6J("ngIf",r.result))},dependencies:[l.O5,h.p,c.Pg,g],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),o})();function J(o,n){if(1&o&&(t.TgZ(0,"div",5)(1,"div",6),t._UZ(2,"app-table-report",7),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("result",e.result)("header",e.header)("from",e.from)("to",e.to)("type",3)}}let L=(()=>{class o{constructor(e,r){this.http=e,this.datePipe=r,this.filter=new f;let i=new Date;this.maxDate=i,this.minDate=p.g.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){const e=p.g.formatTitleForFromDate(this.filter.From,this.filter.To),r=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${r} - ${i})`}initPageLoader(){this.http.GetLoader().then(e=>{this.filter=e,this.from=this.filter.From.toString(),this.to=this.filter.To.toString(),this.http.GetSyncDelivery(this.filter).then(r=>{this.header=r.Header,this.result=r.Body})})}getChannelLogs(e){this.filter.From=e.from,this.filter.To=e.to,this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(r=>{this.header=r.Header,this.result=r.Body,this.from=this.filter.From.toJSON(),this.to=this.filter.To.toJSON()})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(u),t.Y36(l.uU))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-delivery"]],decls:7,vars:7,consts:[[3,"headerTitle","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(e,r){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),t.NdJ("dateChange",function(a){return r.getChannelLogs(a)}),t.qZA()()(),t.TgZ(4,"content")(5,"div",3),t.YNc(6,J,3,5,"div",4),t.qZA()()()),2&e&&(t.Q6J("headerTitle",r.PageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(3),t.Q6J("minDate",r.minDate)("from",r.filter.From)("to",r.filter.To),t.xp6(3),t.Q6J("ngIf",r.result))},dependencies:[l.O5,h.p,c.Pg,g],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),o})();function N(o,n){if(1&o&&(t.TgZ(0,"div",5)(1,"div",6),t._UZ(2,"app-table-report",7),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("result",e.result)("header",e.header)("from",e.from)("to",e.to)("type",4)}}let I=(()=>{class o{constructor(e,r){this.http=e,this.datePipe=r,this.filter=new f,this.PageTitle="Completed";let i=new Date;this.minDate=p.g.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){const e=p.g.formatTitleForFromDate(this.filter.From,this.filter.To),r=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${r} - ${i})`}initPageLoader(){this.http.GetLoader().then(e=>{this.filter=e,this.from=this.filter.From.toString(),this.to=this.filter.To.toString(),this.http.GetSyncPayment(this.filter).then(r=>{this.header=r.Header,this.result=r.Body})})}getChannelLogs(e){this.filter.From=e.from,this.filter.To=e.to,this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(r=>{this.header=r.Header,this.result=r.Body,this.from=this.filter.From.toJSON(),this.to=this.filter.To.toJSON()})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(u),t.Y36(l.uU))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-payment"]],decls:7,vars:7,consts:[[3,"headerTitle","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(e,r){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),t.NdJ("dateChange",function(a){return r.getChannelLogs(a)}),t.qZA()()(),t.TgZ(4,"content")(5,"div",3),t.YNc(6,N,3,5,"div",4),t.qZA()()()),2&e&&(t.Q6J("headerTitle",r.PageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(3),t.Q6J("minDate",r.minDate)("from",r.filter.From)("to",r.filter.To),t.xp6(3),t.Q6J("ngIf",r.result))},dependencies:[l.O5,h.p,c.Pg,g],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),o})();var U=s(4006);const E=[{path:"",component:S,children:[{path:"",redirectTo:"sync-order",pathMatch:"full"},{path:"sync-order",component:R,canActivate:[T.a],data:{title:"Sync Order"}},{path:"invoice",component:A,canActivate:[T.a],data:{title:"Sync Invoice"}},{path:"delivery",component:L,canActivate:[T.a],data:{title:"Sync Delivery"}},{path:"payment",component:I,canActivate:[T.a],data:{title:"Sync Payment"}}]}];let M=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[l.ez,C.Z,U.u5,h.R,c.v,m.Bz.forChild(E)]}),o})()}}]);