marketplacepos 5.23.2 → 5.23.3

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 (35) hide show
  1. package/Marketplace/{chunk-BZRNWRNQ.js → chunk-34TLEUU2.js} +1 -1
  2. package/Marketplace/{chunk-L32MP5SV.js → chunk-3BZVV6EY.js} +1 -1
  3. package/Marketplace/{chunk-2WM7INKE.js → chunk-6FCBKFKP.js} +1 -1
  4. package/Marketplace/{chunk-5EXWONQA.js → chunk-7SQIQSVI.js} +1 -1
  5. package/Marketplace/{chunk-QOXKKOQR.js → chunk-B2BYNHZI.js} +1 -1
  6. package/Marketplace/{chunk-6Q7QUFQF.js → chunk-B4PBQXNI.js} +1 -1
  7. package/Marketplace/{chunk-DEVPZYZE.js → chunk-BTYAH2DF.js} +1 -1
  8. package/Marketplace/{chunk-PI43TV2E.js → chunk-BYIUHHHB.js} +1 -1
  9. package/Marketplace/{chunk-2CWDRMDM.js → chunk-DCYEUYES.js} +1 -1
  10. package/Marketplace/{chunk-YUD5V3CX.js → chunk-DZDVYL2Y.js} +1 -1
  11. package/Marketplace/{chunk-IGFH3I2Q.js → chunk-EDPYVTYS.js} +1 -1
  12. package/Marketplace/{chunk-4VLMUJCJ.js → chunk-H5S7FCYS.js} +1 -1
  13. package/Marketplace/{chunk-N42NBU7H.js → chunk-H633B3ZV.js} +1 -1
  14. package/Marketplace/{chunk-V3Y24MFH.js → chunk-IWOG47LM.js} +1 -1
  15. package/Marketplace/{chunk-SOMWT4EH.js → chunk-JOZ6Q3P7.js} +1 -1
  16. package/Marketplace/{chunk-PIYTJ72R.js → chunk-K3ACYL44.js} +1 -1
  17. package/Marketplace/{chunk-ZW5474RV.js → chunk-L4LECXTE.js} +1 -1
  18. package/Marketplace/{chunk-U3DBD7XW.js → chunk-L7SRGROH.js} +1 -1
  19. package/Marketplace/{chunk-5LYPKDXR.js → chunk-MPPCCWWI.js} +1 -1
  20. package/Marketplace/{chunk-KND7LPV4.js → chunk-NYS5GU74.js} +1 -1
  21. package/Marketplace/{chunk-45PZFPDF.js → chunk-O2FYE4D4.js} +1 -1
  22. package/Marketplace/{chunk-XK4HMSGP.js → chunk-OEFEXY4H.js} +1 -1
  23. package/Marketplace/{chunk-IXOQP7X2.js → chunk-OKY3QH5J.js} +1 -1
  24. package/Marketplace/{chunk-7RVLYX62.js → chunk-OR7RKCYW.js} +1 -1
  25. package/Marketplace/{chunk-3CBPXMVO.js → chunk-OZD5VJPG.js} +1 -1
  26. package/Marketplace/{chunk-UQO7JWNO.js → chunk-PEMOWODA.js} +2 -2
  27. package/Marketplace/{chunk-JXK6S447.js → chunk-PGJIL3YW.js} +1 -1
  28. package/Marketplace/{chunk-5NL2NJQD.js → chunk-PRR2LNJN.js} +1 -1
  29. package/Marketplace/{chunk-65BKWRKW.js → chunk-QMZKIDTF.js} +1 -1
  30. package/Marketplace/{chunk-DZYIIL7M.js → chunk-UQOKPS2D.js} +1 -1
  31. package/Marketplace/{chunk-QNPDRUSV.js → chunk-VZC27UNN.js} +1 -1
  32. package/Marketplace/{chunk-KH4JRZIJ.js → chunk-XFCUEB7M.js} +1 -1
  33. package/Marketplace/index.html +2 -2
  34. package/Marketplace/{main-AWRC6ATH.js → main-UOXLRNRL.js} +1 -1
  35. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
- import{a as ve,b as Ie,c as Ge}from"./chunk-YC44HHHF.js";import{a as Q}from"./chunk-J5D7PMX5.js";import"./chunk-6U6JR5K6.js";import"./chunk-B2TH5YJH.js";import{a as $e}from"./chunk-BVIRHZTZ.js";import{a as le,b as pe,c as wt}from"./chunk-ILVEM7H5.js";import{a as se}from"./chunk-RENQ3YZH.js";import{b as At}from"./chunk-AMSVLO4N.js";import"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import{a as Wt,b as Bt,c as zt,d as Gt,e as jt,f as Ht,g as Ut}from"./chunk-TPGBOTD4.js";import"./chunk-4LFFAE2I.js";import{a as Tt,b as Dt}from"./chunk-N3TTJVBG.js";import"./chunk-MY4B7K3R.js";import"./chunk-46AOM3SM.js";import{a as Yt,b as qt}from"./chunk-JXTGH22T.js";import"./chunk-OULUJ2IO.js";import{a as me,b as vt}from"./chunk-LB6JFX4H.js";import{f as Ot,g as kt,h as Lt,i as Vt,j as Ft}from"./chunk-FGPSBTFS.js";import"./chunk-GCKSYCMI.js";import{a as Mt}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import{a as X}from"./chunk-5JOW2QWK.js";import{b as Rt}from"./chunk-WT6W7RAQ.js";import{b as Nt}from"./chunk-BQ7NR3ET.js";import{a as Et,b as Pt,c as It}from"./chunk-UMNGKENU.js";import{a as oe}from"./chunk-5EXWONQA.js";import"./chunk-FMV4LYKN.js";import"./chunk-HCDKYABV.js";import{a as ae,b as re,c as ht,d as $,e as _t}from"./chunk-CCXKODFV.js";import{f as de,i as J}from"./chunk-IGFH3I2Q.js";import{b as xe,e as B}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{b as St,d as we,e as Ct,f as yt,g as bt,m as H,n as xt}from"./chunk-BO4PPSB5.js";import{t as ut,u as ft}from"./chunk-HUUFOAKH.js";import{P as gt}from"./chunk-E5GGIVK7.js";import{b as ze,c as K,h as G,m as j,o as ne,y as ct}from"./chunk-BSN7ZAXG.js";import{b as I,c as N}from"./chunk-64G3XLI6.js";import{m as We,n as dt,p as q,r as Be}from"./chunk-OVEJFFL6.js";import{$b as w,B as et,Bd as Y,Ca as nt,Cd as be,Da as _,Ea as g,Eb as u,Fa as qe,G as tt,Ga as Ke,Gb as d,Gc as P,Hc as O,Ic as A,Jc as z,Nb as Je,Sb as i,Tb as a,Ub as S,Vb as D,Wb as E,Yb as M,Z as ge,aa as it,bc as c,ea as Ve,ec as rt,fc as ot,gb as L,ja as Fe,jb as l,ka as Ae,kb as T,mc as k,nc as p,oa as ue,oc as f,pc as v,rc as y,sc as b,sd as st,ta as V,tc as x,ua as Re,uc as lt,ud as R,v as U,vc as pt,vd as W,wc as te,xb as at,xc as mt,yc as ie,yd as ye,zd as F}from"./chunk-PQDPS2ID.js";import{a as Qe,b as Ze}from"./chunk-GNOSNGXM.js";var Kt=(()=>{let m=class m{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[$e.downloadOrder]},{Title:"Log",Url:"/menu/Order/Download_Order_Log",Permissions:[$e.downloadOrder]}]}ngOnInit(){}};m.\u0275fac=function(t){return new(t||m)},m.\u0275cmp=V({type:m,selectors:[["app-orders"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(t,n){t&1&&(i(0,"nav",0)(1,"div",1)(2,"div"),S(3,"nav-tab",2),a()()(),S(4,"router-outlet")),t&2&&(l(3),d("Tabs",n.ObjectOrderTabs)("usePermissions",!0))},dependencies:[Tt,dt]});let r=m;return r})();var je=(()=>{let m=class m{constructor(e,t){this.http=e,this.toastr=t}acceptTokopediaOrders(e){return this.http.post("/api/Orders/AcceptOrderTokopedia",e).pipe(Ve(t=>{this.tokopediaAcceptOrderHandler(t)}))}tokopediaAcceptOrderHandler(e){let t=e.filter(h=>h.Status==!1),n=e.filter(h=>h.Status==!0);if(t.length==0&&n.length>0){let h=`<ol>${this.generateSuccessMessage(n)}</ol>`;this.toastr.success(h,"Success",{enableHtml:!0})}else if(t.length>0&&n.length>0){let h=`<ol>
1
+ import{a as ve,b as Ie,c as Ge}from"./chunk-YC44HHHF.js";import{a as Q}from"./chunk-J5D7PMX5.js";import"./chunk-6U6JR5K6.js";import"./chunk-B2TH5YJH.js";import{a as $e}from"./chunk-BVIRHZTZ.js";import{a as le,b as pe,c as wt}from"./chunk-ILVEM7H5.js";import{a as se}from"./chunk-RENQ3YZH.js";import{b as At}from"./chunk-AMSVLO4N.js";import"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import{a as Wt,b as Bt,c as zt,d as Gt,e as jt,f as Ht,g as Ut}from"./chunk-TPGBOTD4.js";import"./chunk-4LFFAE2I.js";import{a as Tt,b as Dt}from"./chunk-N3TTJVBG.js";import"./chunk-MY4B7K3R.js";import"./chunk-46AOM3SM.js";import{a as Yt,b as qt}from"./chunk-JXTGH22T.js";import"./chunk-OULUJ2IO.js";import{a as me,b as vt}from"./chunk-LB6JFX4H.js";import{f as Ot,g as kt,h as Lt,i as Vt,j as Ft}from"./chunk-FGPSBTFS.js";import"./chunk-GCKSYCMI.js";import{a as Mt}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import{a as X}from"./chunk-5JOW2QWK.js";import{b as Rt}from"./chunk-WT6W7RAQ.js";import{b as Nt}from"./chunk-BQ7NR3ET.js";import{a as Et,b as Pt,c as It}from"./chunk-UMNGKENU.js";import{a as oe}from"./chunk-7SQIQSVI.js";import"./chunk-FMV4LYKN.js";import"./chunk-HCDKYABV.js";import{a as ae,b as re,c as ht,d as $,e as _t}from"./chunk-CCXKODFV.js";import{f as de,i as J}from"./chunk-EDPYVTYS.js";import{b as xe,e as B}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{b as St,d as we,e as Ct,f as yt,g as bt,m as H,n as xt}from"./chunk-BO4PPSB5.js";import{t as ut,u as ft}from"./chunk-HUUFOAKH.js";import{P as gt}from"./chunk-E5GGIVK7.js";import{b as ze,c as K,h as G,m as j,o as ne,y as ct}from"./chunk-BSN7ZAXG.js";import{b as I,c as N}from"./chunk-64G3XLI6.js";import{m as We,n as dt,p as q,r as Be}from"./chunk-OVEJFFL6.js";import{$b as w,B as et,Bd as Y,Ca as nt,Cd as be,Da as _,Ea as g,Eb as u,Fa as qe,G as tt,Ga as Ke,Gb as d,Gc as P,Hc as O,Ic as A,Jc as z,Nb as Je,Sb as i,Tb as a,Ub as S,Vb as D,Wb as E,Yb as M,Z as ge,aa as it,bc as c,ea as Ve,ec as rt,fc as ot,gb as L,ja as Fe,jb as l,ka as Ae,kb as T,mc as k,nc as p,oa as ue,oc as f,pc as v,rc as y,sc as b,sd as st,ta as V,tc as x,ua as Re,uc as lt,ud as R,v as U,vc as pt,vd as W,wc as te,xb as at,xc as mt,yc as ie,yd as ye,zd as F}from"./chunk-PQDPS2ID.js";import{a as Qe,b as Ze}from"./chunk-GNOSNGXM.js";var Kt=(()=>{let m=class m{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[$e.downloadOrder]},{Title:"Log",Url:"/menu/Order/Download_Order_Log",Permissions:[$e.downloadOrder]}]}ngOnInit(){}};m.\u0275fac=function(t){return new(t||m)},m.\u0275cmp=V({type:m,selectors:[["app-orders"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(t,n){t&1&&(i(0,"nav",0)(1,"div",1)(2,"div"),S(3,"nav-tab",2),a()()(),S(4,"router-outlet")),t&2&&(l(3),d("Tabs",n.ObjectOrderTabs)("usePermissions",!0))},dependencies:[Tt,dt]});let r=m;return r})();var je=(()=>{let m=class m{constructor(e,t){this.http=e,this.toastr=t}acceptTokopediaOrders(e){return this.http.post("/api/Orders/AcceptOrderTokopedia",e).pipe(Ve(t=>{this.tokopediaAcceptOrderHandler(t)}))}tokopediaAcceptOrderHandler(e){let t=e.filter(h=>h.Status==!1),n=e.filter(h=>h.Status==!0);if(t.length==0&&n.length>0){let h=`<ol>${this.generateSuccessMessage(n)}</ol>`;this.toastr.success(h,"Success",{enableHtml:!0})}else if(t.length>0&&n.length>0){let h=`<ol>
2
2
  ${this.generateSuccessMessage(n)}
3
3
  ${this.generateErrorMessage(t)}
4
4
  </ol>`;this.toastr.warning(h,"Warning",{enableHtml:!0})}else{let h=`<ol>${this.generateErrorMessage(t)}</ol>`;this.toastr.error(h,"Error",{enableHtml:!0})}}generateSuccessMessage(e){let t="";return e.forEach(n=>{t+=`<li><b>${n.OrderNumber}</b> was successfully Accept</li>`}),t}generateErrorMessage(e){let t="";return e.forEach(n=>{t+=`<li><b>${n.OrderNumber}</b> ${n.Message}</li>`}),t}};m.\u0275fac=function(t){return new(t||m)(ue(B),ue(xe))},m.\u0275prov=Fe({token:m,factory:m.\u0275fac});let r=m;return r})();function pi(r,m){if(r&1){let o=M();D(0),i(1,"button",20),w("click",function(){_(o);let t=c().ngIf,n=c();return g(n.onAcceptOrder(t))}),S(2,"i",21),p(3," Accept "),a(),E()}}function mi(r,m){if(r&1&&(D(0),u(1,pi,4,0,"ng-container",3),E()),r&2){let o=c();l(),d("ngIf",o.isTokopediaAvailable&&o.isTokopediaSelected)}}function si(r,m){if(r&1&&(i(0,"span",22),S(1,"img",23),a(),p(2)),r&2){let o=m.item;l(),d("src",o==null?null:o.Img,L),l(),v(" ",o.Name," ")}}function di(r,m){if(r&1){let o=M();D(0),i(1,"th",35)(2,"input",36),x("ngModelChange",function(t){_(o);let n=c(3);return b(n.isCheckAll,t)||(n.isCheckAll=t),g(t)}),w("ngModelChange",function(){_(o);let t=c(2).ngIf,n=c();return g(n.onSelectAllOrderData(t))}),a()(),E()}if(r&2){let o=c(3);l(2),y("ngModel",o.isCheckAll)}}function ci(r,m){if(r&1){let o=M();D(0),i(1,"input",36),x("ngModelChange",function(t){_(o);let n=c(2).$implicit;return b(n.selected,t)||(n.selected=t),g(t)}),w("ngModelChange",function(){_(o);let t=c(4).ngIf,n=c();return g(n.onSelectOrderData(t))}),a(),E()}if(r&2){let o=c(2).$implicit;l(),y("ngModel",o.selected)}}function hi(r,m){if(r&1&&(D(0),i(1,"td"),u(2,ci,2,1,"ng-container",3),a(),E()),r&2){let o=c().$implicit,e=c(3);l(2),d("ngIf",o.Type==e.tokopediaType)}}function _i(r,m){if(r&1&&(D(0),i(1,"span"),p(2),a(),E()),r&2){let o=c().$implicit;l(2),f(o.Number)}}function gi(r,m){if(r&1&&(i(0,"a",38),p(1),a()),r&2){let o=c().$implicit,e=c(3);d("href",e.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+o.ID,L),l(),f(o.Number)}}function ui(r,m){if(r&1&&(i(0,"tr"),u(1,hi,3,1,"ng-container",3),i(2,"td"),p(3),a(),i(4,"td"),u(5,_i,3,1,"ng-container",24)(6,gi,2,2,"ng-template",null,1,z),a(),i(8,"td"),p(9),a(),i(10,"td"),p(11),P(12,"date"),a(),i(13,"td"),S(14,"app-channel-logo",37),a()()),r&2){let o=m.$implicit,e=k(7),t=c(3);l(),d("ngIf",t.isTokopediaAvailable),l(2),f(o.Outlet),l(2),d("ngIf",o.ID==t.guidEmpty)("ngIfElse",e),l(4),f(o.Customer),l(2),f(A(12,7,o.Created,"dd MMM yyyy HH:mm")),l(3),d("typeId",o.Type)}}function fi(r,m){if(r&1){let o=M();D(0),i(1,"div",25)(2,"table",26),w("matSortChange",function(t){_(o);let n=c(2);return g(n.onSort(t))}),i(3,"thead",27)(4,"tr",28),u(5,di,3,1,"ng-container",3),i(6,"th",29),p(7,"Outlet"),a(),i(8,"th",30),p(9,"Order number"),a(),i(10,"th"),p(11,"Customer"),a(),i(12,"th",31),p(13," Created On "),a(),i(14,"th",32),p(15,"Channel"),a()()(),i(16,"tbody"),u(17,ui,15,10,"tr",33),a()(),i(18,"app-mat-paginator-no-count",34),P(19,"async"),P(20,"async"),w("total",function(){_(o);let t=c(2);return g(t.getPaginatonTotal())})("next",function(){_(o);let t=c(2);return g(t.onNextPage())})("previous",function(){_(o);let t=c(2);return g(t.onPreviousPage())}),a()(),E()}if(r&2){let o,e=c().ngIf,t=c();l(5),d("ngIf",t.isTokopediaAvailable&&e),l(12),d("ngForOf",e),l(),d("filter",t.filter)("totaldata",(o=O(19,5,t.newOrdersData$))==null?null:o.length)("paginationTotal",O(20,7,t.paginationTotal$))}}function Si(r,m){if(r&1&&(D(0),u(1,fi,21,9,"ng-container",24),E()),r&2){let o=m.ngIf;c();let e=k(36);l(),d("ngIf",(o==null?null:o.length)>0)("ngIfElse",e)}}function Ci(r,m){r&1&&(i(0,"div",39),S(1,"app-empty-state"),a())}var $t=(()=>{let m=class m{constructor(e,t,n,h){this.localDataService=e,this.orderService=t,this.acceptOrderService=n,this.authService=h,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=N.GuidEMpty,this.tokopediaType=I.Tokopedia,this.isTokopediaSelected=!1,this.isTokopediaAvailable=!1,this.isCheckAll=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initLoadPage()}initLoadPage(){this.orderService.loadInitialPage().subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.getNewOrders()})}getNewOrders(){let e={PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.sourceObs$=this.orderService.getNewOrders(e).pipe(ge()),this.newOrdersData$=this.sourceObs$.pipe(Ve(t=>{t.filter(h=>h.Type==I.Tokopedia).length>0&&(this.isTokopediaAvailable=!0)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID,this.filter.From,this.filter.To).pipe(ge())}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getNewOrders()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getNewOrders()}onSelectOrderData(e){this.isTokopediaSelected=!1,e.filter(n=>n.selected).length>0&&(this.isTokopediaSelected=!0)}onSelectAllOrderData(e){e=e.map(t=>(t.Type==I.Tokopedia&&(t.selected=this.isCheckAll),t)),this.onSelectOrderData(e)}onAcceptOrder(e){let t=this.getSelectedTokopediaOrders(e);this.acceptOrderService.acceptTokopediaOrders(t).subscribe(n=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(e){return e.filter(n=>n.selected).map(n=>n.Number)}onSort(e){if(e.direction==""){this.newOrdersData$=this.sourceObs$;return}if(e.active=="created"){let t=e.direction=="asc";this.newOrdersData$=this.newOrdersData$.pipe(U(n=>(n=n.sort((h,C)=>N.compare(h.Created,C.Created,t)),n)))}}};m.\u0275fac=function(t){return new(t||m)(T(de),T(ve),T(je),T(J))},m.\u0275cmp=V({type:m,selectors:[["app-new-order"]],decls:37,vars:15,consts:[["EMPTY_STATE",""],["NOT_EMPTY",""],["headerTitle","1 - New Order","searchBoxPlaceHolder","Search Orders...",3,"onSubmit","hideSearchBox"],[4,"ngIf"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-check"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[2,"width","5px"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"typeId"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(t,n){if(t&1){let h=M();i(0,"mainpanel",2),w("onSubmit",function(){return _(h),g(n.getNewOrders())}),i(1,"actions"),u(2,mi,2,1,"ng-container",3),P(3,"async"),i(4,"a",4),S(5,"i",5),i(6,"span"),p(7,"Visit our Fulfillment Display System"),a()()(),i(8,"filters")(9,"div")(10,"label",6),p(11,"Channel"),a(),i(12,"ng-select",7),x("ngModelChange",function(s){return _(h),b(n.filter.ListChannelID,s)||(n.filter.ListChannelID=s),g(s)}),u(13,si,3,2,"ng-template",8),a()(),i(14,"div",9)(15,"label",10),p(16,"Page Number"),a(),i(17,"input",11),x("ngModelChange",function(s){return _(h),b(n.filter.PageNumber,s)||(n.filter.PageNumber=s),g(s)}),a()(),i(18,"div",9)(19,"label",10),p(20,"Page Size"),a(),i(21,"input",12),x("ngModelChange",function(s){return _(h),b(n.filter.PageSize,s)||(n.filter.PageSize=s),g(s)}),a()(),i(22,"div",9)(23,"label",13),p(24,"From/To"),a(),i(25,"div",14)(26,"datepicker",15),x("dateChange",function(s){return _(h),b(n.filter.From,s)||(n.filter.From=s),g(s)}),a()(),i(27,"div")(28,"datepicker",16),x("dateChange",function(s){return _(h),b(n.filter.To,s)||(n.filter.To=s),g(s)}),a()()()(),i(29,"content")(30,"div",17)(31,"div",18)(32,"div",19),u(33,Si,2,2,"ng-container",3),P(34,"async"),u(35,Ci,2,0,"ng-template",null,0,z),a()()()()()}t&2&&(d("hideSearchBox",!0),l(2),d("ngIf",O(3,11,n.newOrdersData$)),l(10),d("clearable",!0)("multiple",!0)("items",n.channelOptions),y("ngModel",n.filter.ListChannelID),l(5),y("ngModel",n.filter.PageNumber),l(4),y("ngModel",n.filter.PageSize),l(5),y("date",n.filter.From),l(2),y("date",n.filter.To),l(5),d("ngIf",O(34,13,n.newOrdersData$)))},dependencies:[R,W,K,ne,ze,G,j,H,$,ae,re,X,me,se,le,pe,Q,ye,F]});let r=m;return r})();var yi=()=>["/menu/Order"];function bi(r,m){if(r&1&&(i(0,"tr")(1,"td"),p(2),a(),i(3,"td"),p(4),P(5,"number"),a(),i(6,"td"),p(7),P(8,"number"),a()()),r&2){let o=m.$implicit;l(2),f(o.Code),l(2),f(O(5,3,o.Quantity)),l(3),f(O(8,5,o.Price))}}function xi(r,m){if(r&1&&(i(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),p(5,"Outlet Info"),a()(),i(6,"div",4)(7,"div",9),p(8," Outlet : "),a(),i(9,"div",9),p(10),a()(),i(11,"div",4)(12,"div",9),p(13," Date : "),a(),i(14,"div",9),p(15),P(16,"date"),a()(),i(17,"div",4)(18,"div",9),p(19," Status : "),a(),i(20,"div",9),p(21),a()(),i(22,"div",4)(23,"div",9),p(24," Tax Type : "),a(),i(25,"div",9),p(26),a()(),i(27,"div",4)(28,"div",9),p(29," Due Date : "),a(),i(30,"div",9),p(31),P(32,"date"),a()()(),i(33,"div",6)(34,"div",7)(35,"h3",8),p(36,"Customer Info"),a()(),i(37,"div",4)(38,"div",9),p(39," Name : "),a(),i(40,"div",9),p(41),a()(),i(42,"div",4)(43,"div",9),p(44," Email : "),a(),i(45,"div",9),p(46),a()(),i(47,"div",4)(48,"div",9),p(49," Mobile : "),a(),i(50,"div",9),p(51),a()()()(),i(52,"div",10)(53,"h3",11),p(54,"Products Sold"),a(),i(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),p(60,"Code"),a(),i(61,"th"),p(62,"Quantity"),a(),i(63,"th"),p(64,"Price"),a()()(),i(65,"tbody"),u(66,bi,9,7,"tr",16),a()()()()()),r&2){let o=c();l(10),v(" ",o.model.Outlet," "),l(5),v(" ",A(16,9,o.model.Date,"dd MMM yyyy")," "),l(6),v(" ",o.model.Delivery," "),l(5),v(" ",o.model.TaxType," "),l(5),v(" ",A(32,12,o.model.DueDate,"dd MMM yyyy")," "),l(10),v(" ",o.model.Customer.Name," "),l(5),v(" ",o.model.Customer.Email," "),l(5),v(" ",o.model.Customer.Mobile," "),l(15),d("ngForOf",o.model.Variants)}}var Xt=(()=>{let m=class m{constructor(e,t){this.http=e,this.url=t,this.number=this.url.snapshot.queryParams.Number,this.outlet=this.url.snapshot.queryParams.Outlet}ngOnInit(){this.Load()}Load(){var e={Number:this.number,Outlet:this.outlet};this.http.post("/api/orders/GetInvoiceDetail",e).subscribe(t=>{this.model=t})}};m.\u0275fac=function(t){return new(t||m)(T(B),T(We))},m.\u0275cmp=V({type:m,selectors:[["app-detail-order"]],decls:7,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-secondary","btn-fill","btn-lg","me-3",3,"routerLink"],[1,"container"],["class","row",4,"ngIf"],[1,"row"],[1,"col-4"],[1,"border","my-3","py-3","col-12"],[1,"row","m-2"],[1,"text-center"],[1,"col"],[1,"col-8"],[1,"text-center","my-3","py-3"],[1,"table-responsive"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"]],template:function(t,n){t&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),p(3,"Back"),a()(),i(4,"content")(5,"div",2),u(6,xi,67,15,"div",3),a()()()),t&2&&(d("headerTitle","Order #"+n.number)("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),d("routerLink",te(5,yi)),l(4),d("ngIf",n.model))},dependencies:[R,W,H,q,Y,F]});let r=m;return r})();var Qt=(()=>{let m=class m{constructor(e){this.dialogRef=e,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}};m.\u0275fac=function(t){return new(t||m)(T(St))},m.\u0275cmp=V({type:m,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],[1,"text-center","mb-4","fw-bold","mt-6"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModelChange","ngModel"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(t,n){t&1&&(i(0,"div",0)(1,"h2",1),p(2,"Cetak label pesanan"),a(),i(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),p(7,"Kamu akan mencetak label yang berisi detail pesanan"),a(),i(8,"div",5)(9,"mat-checkbox",6),x("ngModelChange",function(C){return b(n.tandaiSudahDicetak,C)||(n.tandaiSudahDicetak=C),C}),a(),i(10,"span",7),p(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),a()()()()(),i(12,"mat-dialog-actions",8)(13,"button",9),w("click",function(){return n.onCancel()}),p(14,"Cancel"),a(),i(15,"button",10),w("click",function(){return n.onPrint()}),p(16,"Cetak Pesanan"),a()()()),t&2&&(l(9),y("ngModel",n.tandaiSudahDicetak))},dependencies:[G,j,Yt,yt,Ct]});let r=m;return r})();var Ue=(()=>{let m=class m{constructor(e,t,n){this.http=e,this.toastr=t,this.dialog=n}getTokopediaShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/Tokopedia/Multiple",{Orders:e}).pipe(U(t=>(t=t.map(n=>(n.ChannelType=I.Tokopedia,n)),t)))}getTiktokShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/TIktok/Multiple",{Orders:e}).pipe(U(t=>(t=t.map(n=>(n.ChannelType=I.Tiktok,n)),t)))}getShopeeShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/shopee/Multiple",{Orders:e}).pipe(U(t=>(t=t.map(n=>(n.ChannelType=I.Shopee,n)),t)))}getLazadaShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/lazada/Multiple",{Orders:e}).pipe(U(t=>(t=t.map(n=>(n.ChannelType=I.Lazada,n)),t)))}printShippingLabelTokopedia(e){let t={OrderNumber:e,Printed:!0};this.dialog.open(Qt).afterClosed().pipe(tt(n=>n!==void 0),it(n=>(t.Printed=n,this.http.post("api/v1/Shippinglabel/Tokopedia",t)))).subscribe(n=>{let h=window.open("about:blank","_blank");h.document.write(n.File),h.document.close()})}printShippingLabelTiktok(e,t){let n={ShopID:t,OrderNumber:e};this.http.post("api/v1/Shippinglabel/Tiktok",n).subscribe(h=>{h.data!=null?window.open(h.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print")})}printShippingLabelShopee(e,t){let n={ShopID:t,OrderNumber:e};this.http.post("api/v1/Shippinglabel/shopee/DownloadShipping",n).subscribe(h=>{var C=Uint8Array.from(atob(h.File),Pe=>Pe.charCodeAt(0)),s=new Blob([C],{type:"octet/stream"});N.openDownloadFile(s,`${e}.pdf`)})}printShippingLabelLazada(e,t){let n={ShopID:t,OrderNumber:e};this.http.post("api/v1/Shippinglabel/Lazada/DownloadShipping",n).subscribe(h=>{h.result.data!=null?window.open(h.result.data.pdf_url,"_blank"):this.toastr.error(h.message,"Cannot Print")})}};m.\u0275fac=function(t){return new(t||m)(ue(B),ue(xe),ue(we))},m.\u0275prov=Fe({token:m,factory:m.\u0275fac,providedIn:"root"});let r=m;return r})();var ce=function(r){return r.SPX="https://res.cloudinary.com/pos/image/upload/v1698216798/APP/Print%20Shipping%20Label/SPX_Logo.png",r.SICEPAT="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/SiCepat_Logo.png",r.JNT="https://res.cloudinary.com/pos/image/upload/v1698216792/APP/Print%20Shipping%20Label/J_T_Logo.png",r.ANTERAJA="https://res.cloudinary.com/pos/image/upload/v1698218271/APP/Print%20Shipping%20Label/anteraja_Logo.png",r.JNE="https://res.cloudinary.com/pos/image/upload/v1698216791/APP/Print%20Shipping%20Label/JNE_Logo.png",r.GRAB="https://res.cloudinary.com/pos/image/upload/v1698216794/APP/Print%20Shipping%20Label/GrabExpress_Logo.png",r.GOSEND="https://res.cloudinary.com/pos/image/upload/v1698218375/APP/Print%20Shipping%20Label/Gosend_Logo.png",r.LAZADA_EXPRESS="https://res.cloudinary.com/pos/image/upload/v1698914677/icons/Marketplace%20logo/lazada-Logistics.png",r}(ce||{});var Ee=function(r){return r.TOKOPEDIA="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/Tokopedia_Logo.png",r.SHOPEE="https://res.cloudinary.com/pos/image/upload/v1698219243/APP/Print%20Shipping%20Label/shopee-logo.png",r.LAZADA="https://res.cloudinary.com/pos/image/upload/v1698912333/icons/Marketplace%20logo/Lazada_icon.png",r.TIKTOK="https://res.cloudinary.com/pos/image/upload/v1645761565/icons/Marketplace%20logo/tiktok-logo.png",r}(Ee||{});function vi(r,m){if(r&1&&(D(0),i(1,"div",36)(2,"div",12)(3,"div",37),p(4),a()(),i(5,"div",12)(6,"div",37),p(7),a()()(),E()),r&2){let o=c();l(4),v(" ",o.recipient==null?null:o.recipient.City," "),l(3),v(" ",o.recipient==null?null:o.recipient.District," ")}}function Ti(r,m){if(r&1&&(D(0),i(1,"div")(2,"span",15),p(3,"Berat: "),a(),i(4,"span",18),p(5),a()(),E()),r&2){let o=c();l(5),v("",o.shippingLabel==null?null:o.shippingLabel.Weight," gr")}}function Di(r,m){if(r&1&&(D(0),i(1,"div",38)(2,"span",14),p(3,"Batas Kirim:"),a(),i(4,"span",18),p(5),P(6,"date"),a()(),E()),r&2){let o=c();l(5),f(A(6,1,o.logistic==null?null:o.logistic.Batas_kirim,"dd-MM-yyy"))}}function Ei(r,m){if(r&1&&(D(0),i(1,"div",38)(2,"span",14),p(3,"No.Pesanan:"),a(),i(4,"span",18),p(5),a()(),E()),r&2){let o=c();l(5),f(o.shippingLabel==null?null:o.shippingLabel.OrderNumber)}}function Pi(r,m){if(r&1&&(i(0,"tr")(1,"td",39),p(2),a(),i(3,"td"),p(4),a(),i(5,"td"),p(6),a(),i(7,"td"),p(8),P(9,"number"),a()()),r&2){let o=m.$implicit,e=m.index;l(2),f(e+1),l(2),f(o.Product_Name),l(2),f(o.SKU),l(2),f(O(9,4,o.Quantity))}}var Ye=(()=>{let m=class m{constructor(){this.minDate=N.MinDate,this.channelType=I}ngOnChanges(e){e.shippingLabel&&e.shippingLabel.currentValue&&(this.initShippingLabel(),this.getShippingLogo(),this.getChannelLogo())}ngAfterViewInit(){this.initBarcodeConfig()}getChannelLogo(){switch(this.shippingLabel.ChannelType){case I.Tokopedia:this.marketplaceLogo=Ee.TOKOPEDIA;break;case I.Shopee:this.marketplaceLogo=Ee.SHOPEE;break;case I.Lazada:this.marketplaceLogo=Ee.LAZADA;break;case I.Tiktok:this.marketplaceLogo=Ee.TIKTOK;break}}getShippingLogo(){let e=this.shippingLabel.Logistic.Logistic_Name;e=e?.toLowerCase(),e.includes("anteraja")?this.shippingLogo=ce.ANTERAJA:e.includes("grabexpress")?this.shippingLogo=ce.GRAB:e.includes("jne")?this.shippingLogo=ce.JNE:e.includes("gosend")?this.shippingLogo=ce.GOSEND:e.includes("j&t")?this.shippingLogo=ce.JNT:e.includes("sicepat")?this.shippingLogo=ce.SICEPAT:e.includes("spx")?this.shippingLogo=ce.SPX:e.includes("lex")&&(this.shippingLogo=ce.LAZADA_EXPRESS)}initShippingLabel(){this.recipient=this.shippingLabel.Recipient,this.store=this.shippingLabel.Store,this.products=this.shippingLabel.Products,this.logistic=this.shippingLabel.Logistic}initBarcodeConfig(){if(N.IsNotEmpty(this.logistic?.Resi_Number)){let e=this.logistic?.Resi_Number;JsBarcode(`#RESI${this.id}`,this.logistic?.Resi_Number,{displayValue:!1,width:e.length>15?1:1.5,height:40})}N.IsNotEmpty(this.shippingLabel?.OrderNumber)&&JsBarcode(`#NO${this.id}`,this.shippingLabel?.OrderNumber,{displayValue:!1,width:this.shippingLabel?.OrderNumber.length>15?.5:1,height:40})}};m.\u0275fac=function(t){return new(t||m)},m.\u0275cmp=V({type:m,selectors:[["app-shipping-label"]],inputs:{shippingLabel:"shippingLabel",id:"id"},standalone:!0,features:[nt,pt],decls:87,vars:20,consts:[[1,"label-container"],[2,"border","1px solid","padding","12px"],[1,"row","mb-2"],[1,"col-12"],[1,"d-flex","align-items-center","justify-content-between"],["width","105px",1,"border-0",3,"src"],[1,"mb-4"],[1,"row","mb-1"],[1,"text-center","fw-bold","border","p-2","fs-5","border-dark"],[1,"me-2"],[1,"col-12","text-center"],[3,"id"],[1,"col-6"],[1,"d-flex"],[1,"fw-bold","fs-6","me-1"],[1,"fw-bold","fs-6"],[1,"mt-2"],[1,"mb-0","fs-6",2,"max-width","200px","word-wrap","break-word"],[1,"fs-6"],[1,"fs-6",2,"word-wrap","break-word","max-width","160px"],[4,"ngIf"],[1,"row","px-6"],[1,"col-5","border","border-dark","border-end-0","text-center","p-2"],[1,"col-7","border","border-dark","p-2","text-center","fs-6"],[1,"fst-italic"],[1,"row"],[1,"col-5","pt-4",2,"padding-right","0px"],[1,"d-flex","justify-content-between"],[1,"col-7","text-center"],[1,"mt-1",3,"id"],[1,"table","table-sm","fs-6"],[1,"text-center",2,"width","5px"],[2,"width","150px"],[2,"width","50px"],[2,"width","25px"],[4,"ngFor","ngForOf"],[1,"row","mb-4"],[1,"text-center","fw-bold","border","p-2","fs-6","border-dark","text-uppercase"],[1,"mt-4"],[1,"text-center"]],template:function(t,n){t&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),S(6,"img",5),a(),i(7,"div")(8,"h4"),p(9),a()(),i(10,"div"),S(11,"img",5),a()()()(),i(12,"div",6),S(13,"hr"),a(),i(14,"div",7)(15,"div",3)(16,"div",8)(17,"span",9),p(18),a(),i(19,"span"),p(20),a()()()(),i(21,"div",7)(22,"div",10),qe(),S(23,"svg",11),a()(),Ke(),i(24,"div",6),S(25,"hr"),a(),i(26,"div",2)(27,"div",12)(28,"div",13)(29,"div",14),p(30,"Penerima: "),a(),i(31,"div",15),p(32),a()(),i(33,"div",16)(34,"span",15),p(35,"Alamat Pengiriman:"),a(),i(36,"div",17),p(37),a()()(),i(38,"div",12)(39,"div",13)(40,"div",14),p(41,"Pengirim: "),a(),i(42,"div")(43,"div",15),p(44),a(),i(45,"div",18),p(46),a(),i(47,"div",19),p(48),a()()(),S(49,"div"),a()(),u(50,vi,8,2,"ng-container",20),i(51,"div",21)(52,"div",22)(53,"div",15),p(54,"CASHLESS"),a()(),i(55,"div",23)(56,"small",24),p(57,"Penjual tidak perlu membayar ongkos kirim ke kurir"),a()()(),i(58,"div",25)(59,"div",26)(60,"div",27),u(61,Ti,6,1,"ng-container",20),i(62,"div")(63,"span",15),p(64,"COD: "),a(),i(65,"span",18),p(66),P(67,"number"),a()()(),u(68,Di,7,4,"ng-container",20)(69,Ei,6,1,"ng-container",20),a(),i(70,"div",28),qe(),S(71,"svg",29),a()()(),Ke(),i(72,"div",25)(73,"div",3)(74,"table",30)(75,"thead")(76,"tr")(77,"th",31),p(78,"No."),a(),i(79,"th",32),p(80,"Nama Produk"),a(),i(81,"th",33),p(82,"SKU"),a(),i(83,"th",34),p(84,"Qty"),a()()(),i(85,"tbody"),u(86,Pi,10,6,"tr",35),a()()()()()),t&2&&(l(6),d("src",n.marketplaceLogo,L),l(3),f(n.logistic==null?null:n.logistic.Service),l(2),d("src",n.shippingLogo,L),l(7),v(" ",(n.shippingLabel==null?null:n.shippingLabel.ChannelType)==(n.channelType==null?null:n.channelType.Tokopedia)?"Kode Booking: ":"No. Resi: "," "),l(2),f(n.logistic==null?null:n.logistic.Resi_Number),l(3),d("id","RESI"+n.id),l(9),f(n.recipient==null?null:n.recipient.Name),l(5),v(" ",n.recipient==null?null:n.recipient.Address," "),l(7),f(n.store==null?null:n.store.Name),l(2),f(n.store==null?null:n.store.Phone),l(2),v(" ",n.store==null?null:n.store.Address," "),l(2),d("ngIf",(n.recipient==null?null:n.recipient.City)&&(n.recipient==null?null:n.recipient.District)),l(11),d("ngIf",n.shippingLabel==null?null:n.shippingLabel.Weight),l(5),v("Rp. ",n.shippingLabel!=null&&n.shippingLabel.IsCOD?O(67,18,n.shippingLabel==null||n.shippingLabel.SummaryPrice==null?null:n.shippingLabel.SummaryPrice.Total):0,""),l(2),d("ngIf",(n.logistic==null?null:n.logistic.Batas_kirim)&&(n.logistic==null?null:n.logistic.Batas_kirim)!==n.minDate),l(),d("ngIf",n.shippingLabel==null?null:n.shippingLabel.OrderNumber),l(2),d("id","NO"+n.id),l(15),d("ngForOf",n.products))},dependencies:[be,R,W,Y,F],styles:[".table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border:none!important}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-transform:capitalize;padding:4px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:none!important;padding:2px 2px 2px 5px!important;font-size:10px}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.4509803922)}.label-container[_ngcontent-%COMP%]{width:465px;float:left}hr[_ngcontent-%COMP%]{opacity:.8;margin:0}"]});let r=m;return r})();var Ni=()=>["/menu/Order/detail"],Mi=(r,m)=>({Number:r,Outlet:m});function Oi(r,m){if(r&1){let o=M();D(0),i(1,"button",21),w("click",function(){_(o);let t=c();return g(t.onPrintMultipleShippingLabel())}),S(2,"i",22),i(3,"span"),p(4,"Print Shipping Label"),a()(),E()}}function ki(r,m){if(r&1&&(i(0,"span",23),S(1,"img",24),a(),p(2)),r&2){let o=m.item;l(),d("src",o==null?null:o.Img,L)("alt",o.Name),l(),v(" ",o.Name," ")}}function Li(r,m){if(r&1){let o=M();D(0),i(1,"input",31),x("ngModelChange",function(t){_(o);let n=c().$implicit;return b(n.Selected,t)||(n.Selected=t),g(t)}),w("ngModelChange",function(){_(o);let t=c(3).ngIf,n=c();return g(n.onSelectReadyToShip(t))}),a(),E()}if(r&2){let o=c().$implicit;l(),y("ngModel",o.Selected)}}function Vi(r,m){if(r&1&&(i(0,"a",44),p(1),a()),r&2){let o=c().$implicit;d("routerLink",te(3,Ni))("queryParams",ie(4,Mi,o.Number,o.Outlet)),l(),f(o.Number)}}function Fi(r,m){if(r&1&&(i(0,"a",45),p(1),a()),r&2){let o=c().$implicit,e=c(3);d("href",e.domain+o.ID,L),l(),f(o.Number)}}function Ai(r,m){if(r&1){let o=M();i(0,"a",46),w("click",function(){_(o);let t=c().$implicit,n=c(3);return g(n.onPrintShippingLabel(t.Number,t.ShopID,t.TypeID))}),S(1,"i",47),a()}}function Ri(r,m){if(r&1&&(i(0,"tr")(1,"td"),u(2,Li,2,1,"ng-container",4),a(),i(3,"td"),p(4),a(),i(5,"td"),u(6,Vi,2,7,"a",39)(7,Fi,2,2,"a",40),a(),i(8,"td"),p(9),a(),i(10,"td"),p(11),P(12,"number"),a(),i(13,"td"),p(14),P(15,"date"),a(),i(16,"td"),S(17,"app-channel-logo",41),a(),i(18,"td",42),u(19,Ai,2,0,"a",43),a()()),r&2){let o=m.$implicit,e=c(3);l(2),d("ngIf",o.TypeID==e.channelType.Shopee||o.TypeID==e.channelType.Tokopedia||o.TypeID==e.channelType.Tiktok),l(2),f(o.Outlet),l(2),d("ngIf",e.guidEmpty==o.ID),l(),d("ngIf",e.guidEmpty!=o.ID),l(2),f(o.Customer),l(2),f(O(12,9,o.Amount)),l(3),f(A(15,11,o.Date,"dd MMM yyyy")),l(3),d("typeId",o.TypeID),l(2),d("ngIf",o.TypeID==e.channelType.Shopee||o.TypeID==e.channelType.Tokopedia||o.TypeID==e.channelType.Tiktok||o.TypeID==e.channelType.Lazada)}}function Wi(r,m){if(r&1){let o=M();D(0),i(1,"div",26)(2,"table",27),w("matSortChange",function(t){_(o);let n=c(2);return g(n.onSort(t))}),i(3,"thead",28)(4,"tr",29)(5,"th",30)(6,"input",31),x("ngModelChange",function(t){_(o);let n=c(2);return b(n.isCheckAll,t)||(n.isCheckAll=t),g(t)}),w("ngModelChange",function(){_(o);let t=c().ngIf,n=c();return g(n.onSelectAllReadyToShip(t))}),a()(),i(7,"th",32),p(8,"Outlet"),a(),i(9,"th",33),p(10,"Order number"),a(),i(11,"th"),p(12,"Customer"),a(),i(13,"th",34),p(14,"Amount"),a(),i(15,"th",35),p(16,"Date"),a(),i(17,"th",36),p(18,"Channel"),a(),S(19,"th",37),a()(),i(20,"tbody"),u(21,Ri,20,14,"tr",20),a()(),i(22,"app-mat-paginator-no-count",38),P(23,"async"),P(24,"async"),w("total",function(){_(o);let t=c(2);return g(t.getRowCount())})("next",function(){_(o);let t=c(2);return g(t.NextPage())})("previous",function(){_(o);let t=c(2);return g(t.PreviousPage())}),a()(),E()}if(r&2){let o,e=c().ngIf,t=c();l(6),y("ngModel",t.isCheckAll),l(15),d("ngForOf",e),l(),d("filter",t.filter)("totaldata",(o=O(23,5,t.readyToShip$))==null?null:o.length)("paginationTotal",O(24,7,t.paginationTotal$))}}function Bi(r,m){if(r&1&&(D(0),u(1,Wi,25,9,"ng-container",25),E()),r&2){let o=m.ngIf;c();let e=k(35);l(),d("ngIf",o.length>0)("ngIfElse",e)}}function zi(r,m){r&1&&(i(0,"div",48),S(1,"app-empty-state"),a())}function Gi(r,m){r&1&&(D(0),i(1,"div",50),p(2,"\xA0"),a(),E())}function ji(r,m){if(r&1&&(D(0),S(1,"app-shipping-label",49),u(2,Gi,3,0,"ng-container",4),E()),r&2){let o=m.$implicit,e=m.index,t=c();l(),d("shippingLabel",o)("id",e),l(),d("ngIf",e!==(t.shippingLabels==null?null:t.shippingLabels.length)-1)}}var Zt=(()=>{let m=class m{constructor(e,t,n,h,C,s){this.http=e,this.localDataService=t,this.dialog=n,this.shippingLabelService=h,this.datePipe=C,this.authService=s,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.channelType=I,this.guidEmpty=N.GuidEMpty,this.selectedReadyToShip=[],this.isCheckAll=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.getReadyToShip()})}getReadyToShip(e){var t={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.sourceObs$=this.http.post("api/orders/GetReadyToShip",t).pipe(U(n=>n.Data),ge(1)),this.readyToShip$=this.sourceObs$}onPrintMultipleShippingLabel(){let e=this.filterReadyToShipByChannel(this.selectedReadyToShip,I.Tokopedia),t=this.filterReadyToShipByChannel(this.selectedReadyToShip,I.Shopee),n=this.filterReadyToShipByChannel(this.selectedReadyToShip,I.Tiktok),h=[];e.length>0&&h.push(this.shippingLabelService.getTokopediaShippingLabel(this.shippingLabelPayload(e))),t.length>0&&h.push(this.shippingLabelService.getShopeeShippingLabel(this.shippingLabelPayload(t))),n.length>0&&h.push(this.shippingLabelService.getTiktokShippingLabel(this.shippingLabelPayload(n))),et(h).pipe(U(C=>C.reduce((s,Pe)=>s.concat(Pe),[]))).subscribe({next:C=>{this.shippingLabels=C,this.printShippingLabel()}})}filterReadyToShipByChannel(e,t){return e.filter(n=>n.TypeID==t)}shippingLabelPayload(e){return e.map(t=>({ShopID:t.ShopID,OrderNumber:t.Number}))}printShippingLabel(){setTimeout(()=>{this.setPdfname(),window.print()},500)}onPrintShippingLabel(e,t,n){switch(n){case I.Tokopedia:this.shippingLabelService.printShippingLabelTokopedia(e);break;case I.Tiktok:this.shippingLabelService.printShippingLabelTiktok(e,t);break;case I.Shopee:this.shippingLabelService.printShippingLabelShopee(e,t);break;case I.Lazada:this.shippingLabelService.printShippingLabelLazada(e,t);break}}setPdfname(){if(this.selectedReadyToShip.length>1){let e=new Date,t=this.datePipe.transform(e,"dd-MM-yyyy"),n=this.datePipe.transform(e,"HH-mm");document.title=`ShippingLabel_${t}_${n}`}else{let e=this.selectedReadyToShip[0].Number;document.title=`ShippingLabel_${e}`}}getSelectedReadyToShip(e){return e.filter(t=>t.Selected)}getRowCount(){var e={PaymentState:"Unpaid",DeliveryState:"Unsent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.paginationTotal$=this.http.post("api/orders/GetRowCount",e).pipe(U(t=>t?.Total))}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getReadyToShip()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getReadyToShip()}onSort(e){if(e.direction==""){this.readyToShip$=this.sourceObs$;return}if(e.active=="date"){let t=e.direction=="asc";this.readyToShip$=this.readyToShip$.pipe(U(n=>n.sort((h,C)=>N.compare(h.Date,C.Date,t))))}}onSelectReadyToShip(e){this.selectedReadyToShip=this.getSelectedReadyToShip(e)}onSelectAllReadyToShip(e){e=e.map(t=>((t.TypeID==I.Tokopedia||t.TypeID==I.Shopee||t.TypeID==I.Lazada)&&(t.Selected=this.isCheckAll),t)),this.selectedReadyToShip=this.getSelectedReadyToShip(e)}};m.\u0275fac=function(t){return new(t||m)(T(B),T(de),T(we),T(Ue),T(F),T(J))},m.\u0275cmp=V({type:m,selectors:[["app-ready-to-ship"]],decls:38,vars:13,consts:[["EMPTY_STATE",""],["headerTitle","2 - Ready to Ship","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],[1,"print_containers"],[4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","date",2,"width","130px"],[2,"width","114px"],[2,"width","10px"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"shippingLabel","id"],[1,"page-break"]],template:function(t,n){if(t&1){let h=M();i(0,"mainpanel",1),w("onSubmit",function(s){return _(h),g(n.getReadyToShip(s))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),p(5,"Visit our Fulfillment Display System"),a()(),u(6,Oi,5,0,"ng-container",4),a(),i(7,"filters")(8,"div")(9,"label",5),p(10,"Channel"),a(),i(11,"ng-select",6),x("ngModelChange",function(s){return _(h),b(n.filter.ListChannelID,s)||(n.filter.ListChannelID=s),g(s)}),u(12,ki,3,3,"ng-template",7),a()(),i(13,"div",8)(14,"label",9),p(15,"Page Number"),a(),i(16,"input",10),x("ngModelChange",function(s){return _(h),b(n.filter.PageNumber,s)||(n.filter.PageNumber=s),g(s)}),a()(),i(17,"div",8)(18,"label",9),p(19,"Page Size"),a(),i(20,"input",11),x("ngModelChange",function(s){return _(h),b(n.filter.PageSize,s)||(n.filter.PageSize=s),g(s)}),a()(),i(21,"div",8)(22,"label",12),p(23,"From/To"),a(),i(24,"div",13)(25,"datepicker",14),x("dateChange",function(s){return _(h),b(n.filter.From,s)||(n.filter.From=s),g(s)}),a()(),i(26,"div")(27,"datepicker",15),x("dateChange",function(s){return _(h),b(n.filter.To,s)||(n.filter.To=s),g(s)}),a()()()(),i(28,"content")(29,"div",16)(30,"div",17)(31,"div",18),u(32,Bi,2,2,"ng-container",4),P(33,"async"),u(34,zi,2,0,"ng-template",null,0,z),a()()()()(),i(36,"div",19),u(37,ji,3,3,"ng-container",20),a()}t&2&&(l(6),d("ngIf",n.selectedReadyToShip.length>0),l(5),d("clearable",!0)("multiple",!0)("items",n.channelOptions),y("ngModel",n.filter.ListChannelID),l(5),y("ngModel",n.filter.PageNumber),l(4),y("ngModel",n.filter.PageSize),l(5),y("date",n.filter.From),l(2),y("date",n.filter.To),l(5),d("ngIf",O(33,11,n.readyToShip$)),l(5),d("ngForOf",n.shippingLabels))},dependencies:[R,W,K,ne,ze,G,j,H,q,$,ae,re,X,me,se,le,pe,Q,Ye,ye,Y,F],styles:[".print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block}}@media print{.page-break[_ngcontent-%COMP%]{page-break-after:always}}"]});let r=m;return r})();var Hi=()=>["/menu/Order/detail"],Ui=(r,m)=>({Number:r,Outlet:m});function Yi(r,m){if(r&1&&(i(0,"span",19),S(1,"img",20),a(),p(2)),r&2){let o=m.item;l(),d("src",o==null?null:o.Img,L)("alt",o.Name),l(),v(" ",o.Name," ")}}function qi(r,m){if(r&1&&(i(0,"a",35),p(1),a()),r&2){let o=c().$implicit;d("routerLink",te(3,Hi))("queryParams",ie(4,Ui,o.Number,o.Outlet)),l(),f(o.Number)}}function Ki(r,m){if(r&1&&(i(0,"a",36),p(1),a()),r&2){let o=c().$implicit,e=c(2);d("href",e.domain+o.ID,L),l(),f(o.Number)}}function Ji(r,m){if(r&1&&(i(0,"tr")(1,"td"),p(2),a(),i(3,"td"),u(4,qi,2,7,"a",32)(5,Ki,2,2,"a",33),a(),i(6,"td"),p(7),a(),i(8,"td"),p(9),P(10,"number"),a(),i(11,"td"),p(12),P(13,"date"),a(),i(14,"td"),S(15,"app-channel-logo",34),a()()),r&2){let o=m.$implicit,e=c(2);l(2),f(o.Outlet),l(2),d("ngIf",e.hasGuidEmpty(o.ID)),l(),d("ngIf",!e.hasGuidEmpty(o.ID)),l(2),f(o.Customer),l(2),f(O(10,7,o.Amount)),l(3),f(A(13,9,o.Created,"dd MMM yyyy HH:mm")),l(3),d("typeId",o.TypeID)}}function $i(r,m){if(r&1){let o=M();D(0),i(1,"div",21)(2,"table",22),w("matSortChange",function(t){_(o);let n=c();return g(n.onSort(t))}),i(3,"thead",23)(4,"tr",24)(5,"th",25),p(6,"Outlet"),a(),i(7,"th",26),p(8,"Order number"),a(),i(9,"th"),p(10,"Customer"),a(),i(11,"th",27),p(12,"Amount"),a(),i(13,"th",28),p(14," Created On "),a(),i(15,"th",29),p(16,"Channel"),a()()(),i(17,"tbody"),u(18,Ji,16,12,"tr",30),a()(),i(19,"app-mat-paginator-no-count",31),w("total",function(){_(o);let t=c();return g(t.StoreRowsCountAPIResult())})("next",function(){_(o);let t=c();return g(t.NextPage())})("previous",function(){_(o);let t=c();return g(t.PreviousPage())}),a()(),E()}if(r&2){let o=c();l(18),d("ngForOf",o.data),l(),d("filter",o.filter)("totaldata",o.totaldata)("paginationTotal",o.paginationTotal)}}function Xi(r,m){r&1&&(i(0,"div",37),S(1,"app-empty-state"),a())}var ei=(()=>{let m=class m{constructor(e,t,n){this.http=e,this.localDataService=t,this.authService=n,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=I,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}hasGuidEmpty(e){return e==N.GuidEMpty}Get(e){var t={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetShipped",t).subscribe(n=>{this.data=n.Data,this.sourceData=[...n.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"Unpaid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let t=e.direction=="asc";this.data=this.data.sort((n,h)=>N.compare(n.Created,h.Created,t))}}};m.\u0275fac=function(t){return new(t||m)(T(B),T(de),T(J))},m.\u0275cmp=V({type:m,selectors:[["app-shipped"]],decls:34,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","3 - Shipped","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(t,n){if(t&1){let h=M();i(0,"mainpanel",1),w("onSubmit",function(s){return _(h),g(n.Get(s))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),p(5,"Visit our Fulfillment Display System"),a()()(),i(6,"filters")(7,"div")(8,"label",4),p(9,"Channel"),a(),i(10,"ng-select",5),x("ngModelChange",function(s){return _(h),b(n.filter.ListChannelID,s)||(n.filter.ListChannelID=s),g(s)}),u(11,Yi,3,3,"ng-template",6),a()(),i(12,"div",7)(13,"label",8),p(14,"Page Number"),a(),i(15,"input",9),x("ngModelChange",function(s){return _(h),b(n.filter.PageNumber,s)||(n.filter.PageNumber=s),g(s)}),a()(),i(16,"div",7)(17,"label",8),p(18,"Page Size"),a(),i(19,"input",10),x("ngModelChange",function(s){return _(h),b(n.filter.PageSize,s)||(n.filter.PageSize=s),g(s)}),a()(),i(20,"div",7)(21,"label",11),p(22,"From/To"),a(),i(23,"div",12)(24,"datepicker",13),x("dateChange",function(s){return _(h),b(n.filter.From,s)||(n.filter.From=s),g(s)}),a()(),i(25,"div")(26,"datepicker",14),x("dateChange",function(s){return _(h),b(n.filter.To,s)||(n.filter.To=s),g(s)}),a()()()(),i(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),u(31,$i,20,4,"ng-container",18)(32,Xi,2,0,"ng-template",null,0,z),a()()()()()}if(t&2){let h=k(33);l(10),d("clearable",!0)("multiple",!0)("items",n.channelOptions),y("ngModel",n.filter.ListChannelID),l(5),y("ngModel",n.filter.PageNumber),l(4),y("ngModel",n.filter.PageSize),l(5),y("date",n.filter.From),l(2),y("date",n.filter.To),l(5),d("ngIf",n.data&&n.data.length>0)("ngIfElse",h)}},dependencies:[R,W,K,ne,G,j,H,q,$,ae,re,X,me,se,le,pe,Q,Y,F]});let r=m;return r})();var Qi=()=>["/menu/Order/detail"],Zi=(r,m)=>({Number:r,Outlet:m});function en(r,m){if(r&1&&(i(0,"span",19),S(1,"img",20),a(),p(2)),r&2){let o=m.item;l(),d("src",o==null?null:o.Img,L)("alt",o.Name),l(),v(" ",o.Name," ")}}function tn(r,m){if(r&1&&(i(0,"a",35),p(1),a()),r&2){let o=c().$implicit;d("routerLink",te(3,Qi))("queryParams",ie(4,Zi,o.Number,o.Outlet)),l(),f(o.Number)}}function nn(r,m){if(r&1&&(i(0,"a",36),p(1),a()),r&2){let o=c().$implicit,e=c(2);d("href",e.customerInfoUrl+o.ID,L),l(),f(o.Number)}}function an(r,m){if(r&1&&(i(0,"tr")(1,"td"),p(2),a(),i(3,"td"),u(4,tn,2,7,"a",32)(5,nn,2,2,"a",33),a(),i(6,"td"),p(7),a(),i(8,"td"),p(9),P(10,"number"),a(),i(11,"td"),p(12),P(13,"date"),a(),i(14,"td"),S(15,"app-channel-logo",34),a()()),r&2){let o=m.$implicit,e=c(2);l(2),f(o.Outlet),l(2),d("ngIf",e.hasGuidEmpty(o.ID)),l(),d("ngIf",!e.hasGuidEmpty(o.ID)),l(2),f(o.Customer),l(2),f(O(10,7,o.Amount)),l(3),f(A(13,9,o.Created,"dd MMM yyyy HH:mm")),l(3),d("typeId",o.TypeID)}}function rn(r,m){if(r&1){let o=M();D(0),i(1,"div",21)(2,"table",22),w("matSortChange",function(t){_(o);let n=c();return g(n.onSort(t))}),i(3,"thead",23)(4,"tr",24)(5,"th",25),p(6,"Outlet"),a(),i(7,"th",26),p(8,"Order number"),a(),i(9,"th"),p(10,"Customer"),a(),i(11,"th",27),p(12,"Amount"),a(),i(13,"th",28),p(14," Created On "),a(),i(15,"th",29),p(16,"Channel"),a()()(),i(17,"tbody"),u(18,an,16,12,"tr",30),a()(),i(19,"app-mat-paginator-no-count",31),w("total",function(){_(o);let t=c();return g(t.StoreRowsCountAPIResult())})("next",function(){_(o);let t=c();return g(t.NextPage())})("previous",function(){_(o);let t=c();return g(t.PreviousPage())}),a()(),E()}if(r&2){let o=c();l(18),d("ngForOf",o.data),l(),d("filter",o.filter)("totaldata",o.totaldata)("paginationTotal",o.paginationTotal)}}function on(r,m){r&1&&(i(0,"div",37),S(1,"app-empty-state"),a())}var ti=(()=>{let m=class m{constructor(e,t){this.http=e,this.authService=t,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=I,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==N.GuidEMpty}getChannelLogo(e){return N.getChannelLogoByTypeId(e)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.customerInfoUrl=`${this.authService.getDomain()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var t={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetDelivered ",t).subscribe(n=>{this.data=n.Data,this.sourceData=[...n.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"Paid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let t=e.direction=="asc";this.data=this.data.sort((n,h)=>N.compare(n.Created,h.Created,t))}}};m.\u0275fac=function(t){return new(t||m)(T(B),T(J))},m.\u0275cmp=V({type:m,selectors:[["app-delivered"]],decls:34,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","4 - Completed","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(t,n){if(t&1){let h=M();i(0,"mainpanel",1),w("onSubmit",function(s){return _(h),g(n.Get(s))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),p(5,"Visit our Fulfillment Display System"),a()()(),i(6,"filters")(7,"div")(8,"label",4),p(9,"Channel"),a(),i(10,"ng-select",5),x("ngModelChange",function(s){return _(h),b(n.filter.ListChannelID,s)||(n.filter.ListChannelID=s),g(s)}),u(11,en,3,3,"ng-template",6),a()(),i(12,"div",7)(13,"label",8),p(14,"Page Number"),a(),i(15,"input",9),x("ngModelChange",function(s){return _(h),b(n.filter.PageNumber,s)||(n.filter.PageNumber=s),g(s)}),a()(),i(16,"div",7)(17,"label",8),p(18,"Page Size"),a(),i(19,"input",10),x("ngModelChange",function(s){return _(h),b(n.filter.PageSize,s)||(n.filter.PageSize=s),g(s)}),a()(),i(20,"div",7)(21,"label",11),p(22,"From/To"),a(),i(23,"div",12)(24,"datepicker",13),x("dateChange",function(s){return _(h),b(n.filter.From,s)||(n.filter.From=s),g(s)}),a()(),i(25,"div")(26,"datepicker",14),x("dateChange",function(s){return _(h),b(n.filter.To,s)||(n.filter.To=s),g(s)}),a()()()(),i(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),u(31,rn,20,4,"ng-container",18)(32,on,2,0,"ng-template",null,0,z),a()()()()()}if(t&2){let h=k(33);l(10),d("clearable",!0)("multiple",!0)("items",n.channelOptions),y("ngModel",n.filter.ListChannelID),l(5),y("ngModel",n.filter.PageNumber),l(4),y("ngModel",n.filter.PageSize),l(5),y("date",n.filter.From),l(2),y("date",n.filter.To),l(5),d("ngIf",n.data&&n.data.length>0)("ngIfElse",h)}},dependencies:[R,W,K,ne,G,j,H,q,$,ae,re,X,me,se,le,pe,Q,Y,F]});let r=m;return r})();var ln=()=>["/menu/Order/detail"],pn=(r,m)=>({Number:r,Outlet:m});function mn(r,m){if(r&1&&(i(0,"span",21),S(1,"img",22),a(),p(2)),r&2){let o=m.item;l(),d("src",o==null?null:o.Img,L)("alt",o.Name),l(),v(" ",o.Name," ")}}function sn(r,m){if(r&1&&(i(0,"a",38),p(1),a()),r&2){let o=c().$implicit;d("routerLink",te(3,ln))("queryParams",ie(4,pn,o.Number,o.Outlet)),l(),f(o.Number)}}function dn(r,m){if(r&1&&(i(0,"a",39),p(1),a()),r&2){let o=c().$implicit,e=c(2);d("href",e.domain+o.ID,L),l(),f(o.Number)}}function cn(r,m){if(r&1&&(i(0,"tr")(1,"td"),p(2),a(),i(3,"td"),u(4,sn,2,7,"a",35)(5,dn,2,2,"a",36),a(),i(6,"td"),p(7),a(),i(8,"td"),p(9),P(10,"number"),a(),i(11,"td"),p(12),P(13,"date"),a(),i(14,"td"),p(15),a(),i(16,"td"),S(17,"app-channel-logo",37),a()()),r&2){let o=m.$implicit,e=c(2);l(2),f(o.Outlet),l(2),d("ngIf",e.hasGuidEmpty(o.ID)),l(),d("ngIf",!e.hasGuidEmpty(o.ID)),l(2),f(o.Customer),l(2),f(O(10,8,o.Amount)),l(3),f(A(13,10,o.Created,"dd MMM yyyy HH:mm")),l(3),f(o.State),l(2),d("typeId",o.TypeID)}}function hn(r,m){if(r&1){let o=M();D(0),i(1,"div",23)(2,"table",24),w("matSortChange",function(t){_(o);let n=c();return g(n.onSort(t))}),i(3,"thead",25)(4,"tr",26)(5,"th",27),p(6,"Outlet"),a(),i(7,"th",28),p(8,"Order number"),a(),i(9,"th"),p(10,"Customer"),a(),i(11,"th",29),p(12,"Amount"),a(),i(13,"th",30),p(14," Created On "),a(),i(15,"th",31),p(16,"Status"),a(),i(17,"th",32),p(18,"Channel"),a()()(),i(19,"tbody"),u(20,cn,18,13,"tr",33),a()(),i(21,"app-mat-paginator-no-count",34),w("total",function(){_(o);let t=c();return g(t.StoreRowsCountAPIResult())})("next",function(){_(o);let t=c();return g(t.NextPage())})("previous",function(){_(o);let t=c();return g(t.PreviousPage())}),a()(),E()}if(r&2){let o=c();l(20),d("ngForOf",o.data),l(),d("filter",o.filter)("totaldata",o.totaldata)("paginationTotal",o.paginationTotal)}}function _n(r,m){r&1&&(i(0,"div",40),S(1,"app-empty-state"),a())}var ii=(()=>{let m=class m{constructor(e,t,n,h){this.http=e,this.localDataService=t,this.authService=n,this.dialog=h,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==N.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var t={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetAll",t).subscribe(n=>{this.data=n.Data,this.sourceData=[...n.Data],this.totaldata=this.data.length})}openExportDialog(){this.dialog.open(At,{data:{title:"Export Order All",pageNumber:this.filter.PageNumber,rowCount:this.filter.PageSize,filterExport:this.filter,getRowCountApi:"orders/GetRowCount",exportApi:"orders/GetExportAll"}}).afterClosed().subscribe()}changePage(e){this.filter=e,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"",DeliveryState:"",Bin:!1,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let t=e.direction=="asc";this.data=this.data.sort((n,h)=>N.compare(n.Created,h.Created,t))}}};m.\u0275fac=function(t){return new(t||m)(T(B),T(de),T(J),T(we))},m.\u0275cmp=V({type:m,selectors:[["app-all-order"]],decls:38,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","All","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","135px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(t,n){if(t&1){let h=M();i(0,"mainpanel",1),w("onSubmit",function(s){return _(h),g(n.Get(s))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),p(5,"Visit our Fulfillment Display System"),a()(),i(6,"button",4),w("click",function(){return _(h),g(n.openExportDialog())}),S(7,"i",5),i(8,"span"),p(9,"Export"),a()()(),i(10,"filters")(11,"div")(12,"label",6),p(13,"Channel"),a(),i(14,"ng-select",7),x("ngModelChange",function(s){return _(h),b(n.filter.ListChannelID,s)||(n.filter.ListChannelID=s),g(s)}),u(15,mn,3,3,"ng-template",8),a()(),i(16,"div",9)(17,"label",10),p(18,"Page Number"),a(),i(19,"input",11),x("ngModelChange",function(s){return _(h),b(n.filter.PageNumber,s)||(n.filter.PageNumber=s),g(s)}),a()(),i(20,"div",9)(21,"label",10),p(22,"Page Size"),a(),i(23,"input",12),x("ngModelChange",function(s){return _(h),b(n.filter.PageSize,s)||(n.filter.PageSize=s),g(s)}),a()(),i(24,"div",9)(25,"label",13),p(26,"From/To"),a(),i(27,"div",14)(28,"datepicker",15),x("dateChange",function(s){return _(h),b(n.filter.From,s)||(n.filter.From=s),g(s)}),a()(),i(29,"div")(30,"datepicker",16),x("dateChange",function(s){return _(h),b(n.filter.To,s)||(n.filter.To=s),g(s)}),a()()()(),i(31,"content")(32,"div",17)(33,"div",18)(34,"div",19),u(35,hn,22,4,"ng-container",20)(36,_n,2,0,"ng-template",null,0,z),a()()()()()}if(t&2){let h=k(37);l(14),d("clearable",!0)("multiple",!0)("items",n.channelOptions),y("ngModel",n.filter.ListChannelID),l(5),y("ngModel",n.filter.PageNumber),l(4),y("ngModel",n.filter.PageSize),l(5),y("date",n.filter.From),l(2),y("date",n.filter.To),l(5),d("ngIf",n.data&&n.data.length>0)("ngIfElse",h)}},dependencies:[R,W,K,ne,G,j,H,q,$,ae,re,X,me,se,le,pe,Q,Y,F]});let r=m;return r})();var gn=()=>["/menu/Order/detail"],un=(r,m)=>({Number:r,Outlet:m});function fn(r,m){if(r&1&&(i(0,"span",20),S(1,"img",21),a(),p(2)),r&2){let o=m.item;l(),d("src",o==null?null:o.Img,L)("alt",o.Name),l(),v(" ",o.Name," ")}}function Sn(r,m){if(r&1&&(i(0,"a",36),p(1),a()),r&2){let o=c().$implicit;d("routerLink",te(3,gn))("queryParams",ie(4,un,o.Number,o.Outlet)),l(),f(o.Number)}}function Cn(r,m){if(r&1&&(i(0,"a",37),p(1),a()),r&2){let o=c().$implicit,e=c(2);d("href",e.domain+o.ID,L),l(),f(o.Number)}}function yn(r,m){if(r&1&&(i(0,"tr")(1,"td"),p(2),a(),i(3,"td"),u(4,Sn,2,7,"a",33)(5,Cn,2,2,"a",34),a(),i(6,"td"),p(7),a(),i(8,"td"),p(9),P(10,"number"),a(),i(11,"td"),p(12),P(13,"date"),a(),i(14,"td"),S(15,"app-channel-logo",35),a()()),r&2){let o=m.$implicit,e=c(2);l(2),f(o.Outlet),l(2),d("ngIf",e.hasGuidEmpty(o.ID)),l(),d("ngIf",!e.hasGuidEmpty(o.ID)),l(2),f(o.Customer),l(2),f(O(10,7,o.Amount)),l(3),f(A(13,9,o.Created,"dd MMM yyyy HH:mm")),l(3),d("typeId",o.TypeID)}}function bn(r,m){if(r&1){let o=M();D(0),i(1,"div",22)(2,"table",23),w("matSortChange",function(t){_(o);let n=c();return g(n.onSort(t))}),i(3,"thead",24)(4,"tr",25)(5,"th",26),p(6,"Outlet"),a(),i(7,"th",27),p(8,"Order number"),a(),i(9,"th"),p(10,"Customer"),a(),i(11,"th",28),p(12,"Amount"),a(),i(13,"th",29),p(14," Created On "),a(),i(15,"th",30),p(16,"Channel"),a()()(),i(17,"tbody"),u(18,yn,16,12,"tr",31),a()(),i(19,"app-mat-paginator-no-count",32),w("total",function(){_(o);let t=c();return g(t.StoreRowsCountAPIResult())})("next",function(){_(o);let t=c();return g(t.NextPage())})("previous",function(){_(o);let t=c();return g(t.PreviousPage())}),a()(),E()}if(r&2){let o=c();l(18),d("ngForOf",o.data),l(),d("filter",o.filter)("totaldata",o.totaldata)("paginationTotal",o.paginationTotal)}}function xn(r,m){r&1&&(i(0,"div",38),S(1,"app-empty-state"),a())}var ni=(()=>{let m=class m{constructor(e,t,n){this.http=e,this.localDataService=t,this.authService=n,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],Note:"",From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==N.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var t={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,Note:this.filter.Note,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetCancelled ",t).subscribe(n=>{this.data=n.Data,this.sourceData=[...n.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"",DeliveryState:"",Bin:!0,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}getChannelLogo(e){return N.getChannelLogoByTypeId(e)}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let t=e.direction=="asc";this.data=this.data.sort((n,h)=>N.compare(n.Created,h.Created,t))}}};m.\u0275fac=function(t){return new(t||m)(T(B),T(de),T(J))},m.\u0275cmp=V({type:m,selectors:[["app-cancelled"]],decls:38,vars:11,consts:[["EMPTY_STATE",""],["headerTitle","99 - Cancelled","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","Note",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(t,n){if(t&1){let h=M();i(0,"mainpanel",1),w("onSubmit",function(s){return _(h),g(n.Get(s))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),p(5,"Visit our Fulfillment Display System"),a()()(),i(6,"filters")(7,"div")(8,"label",4),p(9,"Channel"),a(),i(10,"ng-select",5),x("ngModelChange",function(s){return _(h),b(n.filter.ListChannelID,s)||(n.filter.ListChannelID=s),g(s)}),u(11,fn,3,3,"ng-template",6),a()(),i(12,"div",7)(13,"label",8),p(14,"Page Number"),a(),i(15,"input",9),x("ngModelChange",function(s){return _(h),b(n.filter.PageNumber,s)||(n.filter.PageNumber=s),g(s)}),a()(),i(16,"div",7)(17,"label",8),p(18,"Page Size"),a(),i(19,"input",10),x("ngModelChange",function(s){return _(h),b(n.filter.PageSize,s)||(n.filter.PageSize=s),g(s)}),a()(),i(20,"div",7)(21,"label",8),p(22,"Note"),a(),i(23,"input",11),x("ngModelChange",function(s){return _(h),b(n.filter.Note,s)||(n.filter.Note=s),g(s)}),a()(),i(24,"div",7)(25,"label",12),p(26,"From/To"),a(),i(27,"div",13)(28,"datepicker",14),x("dateChange",function(s){return _(h),b(n.filter.From,s)||(n.filter.From=s),g(s)}),a()(),i(29,"div")(30,"datepicker",15),x("dateChange",function(s){return _(h),b(n.filter.To,s)||(n.filter.To=s),g(s)}),a()()()(),i(31,"content")(32,"div",16)(33,"div",17)(34,"div",18),u(35,bn,20,4,"ng-container",19)(36,xn,2,0,"ng-template",null,0,z),a()()()()()}if(t&2){let h=k(37);l(10),d("clearable",!0)("multiple",!0)("items",n.channelOptions),y("ngModel",n.filter.ListChannelID),l(5),y("ngModel",n.filter.PageNumber),l(4),y("ngModel",n.filter.PageSize),l(4),y("ngModel",n.filter.Note),l(5),y("date",n.filter.From),l(2),y("date",n.filter.To),l(5),d("ngIf",n.data&&n.data.length>0)("ngIfElse",h)}},dependencies:[R,W,K,ne,G,j,H,q,$,ae,re,X,me,se,le,pe,Q,Y,F]});let r=m;return r})();var wn=(r,m)=>({"over-due-today":r,"over-due":m}),vn=r=>({"over-due":r});function Tn(r,m){r&1&&(D(0),i(1,"a",19),p(2," Download V2 "),a(),E())}function Dn(r,m){if(r&1){let o=M();D(0),i(1,"div",20)(2,"button",21),w("click",function(){_(o),c();let t=k(12);return g(t.previous())}),p(3," Back "),a(),i(4,"button",22),w("click",function(){_(o);let t=c(),n=k(12);return g(t.onNext(n))}),p(5," Next "),a()(),E()}if(r&2){let o=c();l(4),d("disabled",o.checkDisabledNextFilter())}}function En(r,m){if(r&1){let o=M();D(0),i(1,"button",23),w("click",function(){_(o);let t=c(),n=k(12);return g(t.onNext(n))}),p(2," Next "),a(),E()}if(r&2){let o=c();l(),d("disabled",o.checkDisabledNextFilter())}}function Pn(r,m){if(r&1){let o=M();D(0),i(1,"button",24),w("click",function(){_(o);let t=c(),n=k(12);return g(t.onNew(n))}),S(2,"i",25),p(3," New "),a(),E()}}function In(r,m){r&1&&(S(0,"i",26),i(1,"span"),p(2,"Filter"),a())}function Nn(r,m){if(r&1&&(i(0,"ng-option",36),S(1,"img",37),p(2),a()),r&2){let o=m.$implicit;d("value",o.ID),l(),d("src",o==null?null:o.Img,L),l(),v("",o.Name," ")}}function Mn(r,m){if(r&1){let o=M();i(0,"div",32)(1,"div",28)(2,"h5"),p(3,"Type"),a(),i(4,"p",29),p(5," Select Type want to download "),a()(),i(6,"div",28)(7,"div",38)(8,"div")(9,"mat-radio-group",39),x("ngModelChange",function(t){_(o);let n=c(2);return b(n.downloadType,t)||(n.downloadType=t),g(t)}),i(10,"mat-radio-button",40),p(11," Orders "),a(),i(12,"mat-radio-button",41),p(13," Disbursement "),a()()()(),i(14,"div",42)(15,"div",43),S(16,"i",44),a(),i(17,"p",45),p(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(r&2){let o=c(2);l(9),y("ngModel",o.downloadType),l(),d("value",!1),l(2),d("value",!0)}}function On(r,m){r&1&&(i(0,"p",29),p(1," Select Disbursement date "),i(2,"span",46),p(3,"(payment date / order complete date)"),a(),p(4," of the channel you want to download (Max 1 Week). "),a())}function kn(r,m){r&1&&(i(0,"p",29),p(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function Ln(r,m){if(r&1){let o=M();D(0),i(1,"div",47)(2,"app-timepicker",48),x("timeChange",function(t){_(o);let n=c(2);return b(n.timeFrom,t)||(n.timeFrom=t),g(t)}),a(),i(3,"span",49),p(4,"-"),a(),i(5,"app-timepicker",48),x("timeChange",function(t){_(o);let n=c(2);return b(n.timeTo,t)||(n.timeTo=t),g(t)}),a()(),E()}if(r&2){let o=c(2);l(2),y("time",o.timeFrom),l(3),y("time",o.timeTo)}}function Vn(r,m){if(r&1){let o=M();i(0,"div",27)(1,"div",8)(2,"div",7)(3,"div",28)(4,"h5"),p(5,"Select a Channel"),a(),i(6,"p",29),p(7," Select Channel want to download order "),a()(),i(8,"div",28)(9,"ng-select",30),x("ngModelChange",function(t){_(o);let n=c();return b(n.channelID,t)||(n.channelID=t),g(t)}),w("ngModelChange",function(){_(o);let t=c();return g(t.onSelectChannel())}),u(10,Nn,3,3,"ng-option",31),a()()(),u(11,Mn,19,3,"div",32),P(12,"async"),i(13,"div",32)(14,"div",28)(15,"h5"),p(16,"Date Range"),a(),u(17,On,5,0,"p",29)(18,kn,2,0,"p",29),a(),i(19,"div",28)(20,"div",8)(21,"mat-date-range-input",33)(22,"input",34),x("ngModelChange",function(t){_(o);let n=c();return b(n.startDate,t)||(n.startDate=t),g(t)}),w("click",function(){_(o);let t=k(25);return g(t.open())}),a(),i(23,"input",35),x("ngModelChange",function(t){_(o);let n=c();return b(n.endDate,t)||(n.endDate=t),g(t)}),w("click",function(){_(o);let t=k(25);return g(t.open())})("ngModelChange",function(){_(o);let t=c();return g(t.onFilterDateChange())}),a()(),S(24,"mat-date-range-picker",null,1),a(),u(26,Ln,6,2,"ng-container",5),a()()()()}if(r&2){let o,e=k(25),t=c();l(9),d("clearable",!1),y("ngModel",t.channelID),l(),d("ngForOf",t.channelOptions),l(),Je((o=O(12,9,t.channelDetail$))!=null&&o.ServiceFeeWriteOff?11:-1),l(6),Je(t.downloadType()&&(t.currentChannel==null?null:t.currentChannel.TypeID)==t.channelType.Tokopedia?17:18),l(4),d("rangePicker",e),l(),y("ngModel",t.startDate),l(),y("ngModel",t.endDate),l(3),d("ngIf",t.showTimePicker)}}function Fn(r,m){r&1&&(S(0,"i",50),i(1,"span"),p(2,"Preview"),a())}function An(r,m){if(r&1&&(i(0,"th",72),p(1),a()),r&2){let o=c(3);l(),v(" ",o.currentChannel?"Created Date":"Last Status Update"," ")}}function Rn(r,m){if(r&1&&(i(0,"td"),p(1),P(2,"date"),a()),r&2){let o=c().$implicit;l(),v(" ",A(2,1,o.Date,"dd MMM yyyy HH:mm:ss")," ")}}function Wn(r,m){if(r&1&&(i(0,"span"),p(1),a()),r&2){let o=c().$implicit;l(),v(" ",o.ActionString," ")}}function Bn(r,m){if(r&1&&(i(0,"li"),p(1),a()),r&2){let o=m.$implicit;l(),v(" ",o," ")}}function zn(r,m){if(r&1&&(i(0,"ul",77),u(1,Bn,2,1,"li",73),a()),r&2){let o=c().$implicit;l(),d("ngForOf",o.ActionString)}}function Gn(r,m){if(r&1&&(i(0,"span",78),S(1,"i",79),a()),r&2){let o=c().$implicit;ot("title","Delivery : ",o.DeliveryState,`
5
5
  Payment : `,o.PaymentState,"")}}function jn(r,m){if(r&1&&(i(0,"tr")(1,"td"),p(2),a(),i(3,"td"),p(4),a(),u(5,Rn,3,4,"td",5),i(6,"td")(7,"span"),p(8),a(),p(9),a(),i(10,"td",74)(11,"span"),p(12),a(),p(13),a(),i(14,"td"),u(15,Wn,2,1,"span",5)(16,zn,2,1,"ul",75),a(),i(17,"td"),u(18,Gn,2,3,"span",76),a()()),r&2){let o=m.$implicit,e=m.index,t=c(4);l(2),f(e+1),l(2),f(o.Number),l(),d("ngIf",(t.currentChannel==null?null:t.currentChannel.TypeID)!=t.channelType.Shopee&&(t.currentChannel==null?null:t.currentChannel.TypeID)!==t.channelType.Tiktok),l(3),v("",o.ChannelStatus," - "),l(),v("",o.ChannelStatusDescription," "),l(),d("ngClass",ie(12,wn,(o==null?null:o.Action)==t.actionPreviewOrder.Update,(o==null?null:o.Action)==t.actionPreviewOrder.New))("matTooltip",o.POSStatus==91||o.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),l(2),v("",o.POSStatus," - "),l(),v("",o.POSStatusDescription," "),l(2),d("ngIf",o.ActionString.length==1),l(),d("ngIf",o.ActionString.length>1),l(2),d("ngIf",o.ChannelStatus!=99&&o.POSStatus!=99)}}function Hn(r,m){if(r&1&&(D(0),u(1,jn,19,15,"tr",73),E()),r&2){let o=c(3);l(),d("ngForOf",o.displayedPreviewData)}}function Un(r,m){r&1&&(i(0,"tr",80)(1,"td",81)(2,"div",82),S(3,"i",83),a(),i(4,"h4",84),p(5," There is no order to processed "),a()()())}function Yn(r,m){if(r&1){let o=M();i(0,"div",52)(1,"div",53)(2,"div",54)(3,"div",55)(4,"div")(5,"ul",56)(6,"li",57)(7,"button",58),w("click",function(){_(o);let t=c(2);return g(t.filterPreviewData(t.previewStatus.ALL))}),p(8),a()(),i(9,"li",59)(10,"button",60),w("click",function(){_(o);let t=c(2);return g(t.filterPreviewData(t.previewStatus.SYNC))}),p(11),a()(),i(12,"li",59)(13,"button",61),w("click",function(){_(o);let t=c(2);return g(t.filterPreviewData(t.previewStatus.WRONG))}),p(14),a()(),i(15,"li",59)(16,"button",62),w("click",function(){_(o);let t=c(2);return g(t.filterPreviewData(t.previewStatus.UNSYNC))}),p(17),a()()()(),i(18,"div")(19,"button",63),w("click",function(){_(o);let t=c(2);return g(t.exportOrders())}),S(20,"i",64),i(21,"span"),p(22,"Export"),a()()()()(),i(23,"table",65)(24,"thead",66)(25,"tr"),S(26,"th",67),i(27,"th",68),p(28,"Number"),a(),u(29,An,2,1,"th",69),i(30,"th",70),p(31,"Channel Status"),a(),i(32,"th",70),p(33,"POS Status"),a(),i(34,"th"),p(35,"Action"),a(),S(36,"th",67),a()(),i(37,"tbody"),u(38,Hn,2,1,"ng-container",71)(39,Un,6,0,"ng-template",null,2,z),a()()()()}if(r&2){let o=k(40),e=c(2);l(7),d("ngClass",e.pillStatus=="all"?"btn-secondary text-white":"btn-outline-dark"),l(),v(" All (",e.allData,") "),l(2),d("ngClass",e.pillStatus=="sync"?"btn-success":"btn-outline-success"),l(),v(" Existing (",e.syncData,") "),l(2),d("ngClass",e.pillStatus=="wrong"?"btn-warning text-white":"btn-outline-warning"),l(),v(" Wrong Status (",e.wrongData,") "),l(2),d("ngClass",e.pillStatus=="unsync"?"btn-danger":"btn-outline-danger"),l(),v(" Missing (",e.unsyncData,") "),l(12),d("ngIf",(e.currentChannel==null?null:e.currentChannel.TypeID)!=e.channelType.Shopee&&(e.currentChannel==null?null:e.currentChannel.TypeID)!==e.channelType.Tiktok),l(9),d("ngIf",e.displayedPreviewData.length>0)("ngIfElse",o)}}function qn(r,m){if(r&1&&u(0,Yn,41,11,"div",51),r&2){let o=c();d("ngIf",o.currentState=="preview")}}function Kn(r,m){r&1&&(S(0,"i",85),i(1,"span"),p(2,"Finish"),a())}function Jn(r,m){if(r&1&&(i(0,"tr",87)(1,"td"),p(2),a(),i(3,"td"),p(4),a(),i(5,"td"),p(6),a(),i(7,"td"),p(8),a()()),r&2){let o=m.$implicit,e=m.index;d("ngClass",mt(5,vn,o.Exception)),l(2),f(e+1),l(2),f(o.Number),l(2),f(o.Status),l(2),f(o.Exception)}}function $n(r,m){if(r&1&&(D(0),u(1,Jn,9,7,"tr",86),E()),r&2){let o=c(3);l(),d("ngForOf",o.downloadData)}}function Xn(r,m){r&1&&(i(0,"tr",80)(1,"td",81)(2,"div",82),S(3,"i",83),a(),i(4,"h4",84),p(5," There is no order to processed "),a()()())}function Qn(r,m){if(r&1&&(i(0,"div",52)(1,"div",53)(2,"table",65)(3,"thead",66)(4,"tr"),S(5,"th",67),i(6,"th"),p(7,"Order Number"),a(),i(8,"th"),p(9,"Status"),a(),i(10,"th"),p(11,"Exception"),a()()(),i(12,"tbody"),u(13,$n,2,1,"ng-container",71)(14,Xn,6,0,"ng-template",null,3,z),a()()()()),r&2){let o=k(15),e=c(2);l(13),d("ngIf",(e.downloadData==null?null:e.downloadData.length)>0)("ngIfElse",o)}}function Zn(r,m){if(r&1&&u(0,Qn,16,2,"div",51),r&2){let o=c();d("ngIf",o.currentState=="finish")}}function ea(r,m){r&1&&(i(0,"h6"),p(1,"1"),a())}function ta(r,m){r&1&&(i(0,"h6"),p(1,"2"),a())}function ia(r,m){r&1&&(i(0,"h6"),p(1,"3"),a())}var ee=function(r){return r.ALL="all",r.SYNC="sync",r.WRONG="wrong",r.UNSYNC="unsync",r}(ee||{}),ai=(()=>{let m=class m{constructor(e,t,n,h,C,s,Pe){this.http=e,this.toastr=t,this.datePipe=n,this.url=h,this.productService=C,this.orderService=s,this.authService=Pe,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=I,this.previewStatus=ee,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=Ie,this.cacheKey="",this.showTimePicker=!1,this.downloadType=at(!1),this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initTimeFilter(),this.url.queryParams.subscribe(e=>{this.channelID=e.ChannelID,this.startDate=new Date(e.Date),this.endDate=new Date(e.Date)})}initTimeFilter(){this.timeFrom="00:00",this.timeTo="23:59"}onDownload(e){let t={ID:this.channelID,From:this.startDate,To:this.endDate,ListPreview:this.downloadedPreviewData,IsDisbursement:this.downloadType(),cacheKey:this.cacheKey};this.http.post("/api/Orders/Download",t).subscribe(n=>{this.downloadData=n.Body,this.onStepperNext(e)})}onPreview(e){if(!this.validateDatePreview())return;let t={ID:this.channelID,From:this.startDate,To:this.endDate,IsDisbursement:this.downloadType()};this.showTimePicker&&(t=Ze(Qe({},t),{TimeFrom:this.timeFrom+":00",TimeTo:this.timeTo+":00"})),this.http.post("/api/Orders/Preview",t).subscribe(n=>{if(n.Data.length==0){this.toastrEmptyPreview();return}this.cacheKey=n.cacheKey,this.previewData=n.Data,this.groupingPreviewData(),this.filterPreviewData(ee.ALL),this.initLengthStatusData(),this.onStepperNext(e)})}toastrEmptyPreview(){let e=this.datePipe.transform(this.startDate,"dd MMM yyyy"),t=this.datePipe.transform(this.endDate,"dd MMM yyyy"),n=this.showTimePicker?this.timeFrom+":00":"",h=this.showTimePicker?this.timeTo+":00":"";this.toastr.info(`There is no orders from ${e} ${n} to ${t} ${h}!`,"No Orders!")}validateDatePreview(){let e=!0;return this.downloadType()==!0?N.getDaysDiff(this.startDate,this.endDate)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Failed"),e=!1):N.getDaysDiff(this.startDate,this.endDate)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),e=!1),e}onSelectChannel(){this.currentChannel=this.channelOptions.find(e=>e.ID==this.channelID),this.initGetChannelDetail()}initGetChannelDetail(){this.currentChannel.TypeID==I.Tokopedia?this.channelDetail$=this.http.post("/api/ChannelLoader/GetChannelView",{ID:this.currentChannel.ID}).pipe(U(e=>e?.Model),ge(1)):this.channelDetail$=null}setPageTitle(e){this.pageTitle=`
6
6
  ${e} (${this.getDateTitle()})
7
7
  `}getDateTitle(){let e=N.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),t=this.datePipe.transform(this.startDate,e),n=this.datePipe.transform(this.endDate,"dd MMM yyyy");return`${e==null?"":t+"-"} ${n}`}onNew(e){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",this.channelDetail$=null,e.reset()}groupingPreviewData(){let e=this.filterDataByStatus(ee.UNSYNC),t=this.filterDataByStatus(ee.WRONG),n=[];this.currentChannel.TypeID==I.Tokopedia&&(n=this.filterDataByStatus(ee.SYNC)),this.downloadedPreviewData=[...n,...e,...t]}filterDataByStatus(e){let t=[];switch(e){case ee.ALL:t=this.previewData;break;case ee.SYNC:t=this.previewData.filter(n=>n.Action==Ie.DoNothing);break;case ee.WRONG:t=this.previewData.filter(n=>n.Action==Ie.Update);break;case ee.UNSYNC:t=this.previewData.filter(n=>n.Action==Ie.New);break}return t}filterPreviewData(e){this.pillStatus=e,this.displayedPreviewData=this.filterDataByStatus(e)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(ee.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(ee.SYNC).length,this.unsyncData=this.filterDataByStatus(ee.UNSYNC).length}getTypeID(){var e=this.channelOptions.find(t=>t.ID==this.channelID)?.TypeID;return e??0}onStepperChange(e){this.currentState=e.selectedStep.state}onStepperNext(e){e.selected.completed=!0,e.next()}onNext(e){switch(this.currentState){case"filter":this.onPreview(e);break;case"preview":this.onDownload(e);break}}stepChange(e){switch(e?.selectedStep?.state){case"filter":this.pageTitle="Download To POS",this.resetPreviewData();break;case"preview":let t=this.productService.findChannelById(this.channelID,this.channelOptions);this.setPageTitle(`Preview ${t?.Name}`);break;case"finish":this.setPageTitle("Download");break}}resetPreviewData(){this.displayedPreviewData=[],this.previewData=[],this.initLengthStatusData()}checkDisabledNextFilter(){let e=!N.isValidDate(this.startDate)||!N.isValidDate(this.endDate),t=N.IsEmpty(this.channelID);return e||t}exportOrders(){let e={ID:this.channelID,From:this.startDate,To:this.endDate},t=`Orders ${this.getDateTitle()}`;this.orderService.exportOrders(e,t).subscribe()}onFilterDateChange(){let e=1;this.startDate&&this.endDate&&(e=N.getDaysDiff(this.startDate,this.endDate)),this.showTimePicker=e==0}};m.\u0275fac=function(t){return new(t||m)(T(B),T(xe),T(F),T(We),T(Mt),T(ve),T(J))},m.\u0275cmp=V({type:m,selectors:[["app-download"]],features:[lt([{provide:Wt,useValue:{displayDefaultIndicatorType:!1}}])],decls:25,vars:13,consts:[["stepper",""],["picker",""],["EMPTY",""],["EMPTY_DOWNLOAD",""],[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["linear","",1,"w-100","stepper-download",3,"selectionChange","ngClass"],["state","filter",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","preview",3,"editable","completed"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],["routerLink","/menu/Order/Download",1,"btn","btn-outline-secondary","btn-fill","me-3"],[1,"btn-group","me-3"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","bg-success","text-white",3,"click","disabled"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"click","disabled"],[1,"btn","btn-outline-secondary","btn-fill",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[1,"fa-solid","fa-filter","me-3"],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[1,"mt-8"],[3,"timeChange","time"],[1,"mx-4"],[1,"fa-solid","fa-file","me-3"],["class","row pt-2",4,"ngIf"],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["width","15%"],[4,"ngFor","ngForOf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"]],template:function(t,n){if(t&1){let h=M();i(0,"mainpanel",4)(1,"actions"),u(2,Tn,3,0,"ng-container",5)(3,Dn,6,1,"ng-container",5)(4,En,3,1,"ng-container",5)(5,Pn,4,0,"ng-container",5),a(),i(6,"content")(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"mat-stepper",10,0),w("selectionChange",function(s){return _(h),g(n.stepChange(s))})("selectionChange",function(s){return _(h),g(n.onStepperChange(s))}),i(13,"mat-step",11),u(14,In,3,0,"ng-template",12)(15,Vn,27,11,"ng-template",13),a(),i(16,"mat-step",14),u(17,Fn,3,0,"ng-template",12)(18,qn,1,1,"ng-template",13),a(),i(19,"mat-step",15),u(20,Kn,3,0,"ng-template",12)(21,Zn,1,1,"ng-template",13),a(),u(22,ea,2,0,"ng-template",16)(23,ta,2,0,"ng-template",17)(24,ia,2,0,"ng-template",18),a()()()()()()()}if(t&2){let h=k(12);d("headerTitle",n.pageTitle)("description",n.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),d("ngIf",n.currentState=="filter"),l(),d("ngIf",n.currentState=="preview"),l(),d("ngIf",n.currentState=="filter"),l(),d("ngIf",n.currentState=="finish"),l(6),rt("ngClass","last-edited-step-"+h.selectedIndex),l(2),d("editable",n.currentState!="finish")("completed",!1),l(3),d("editable",n.currentState!="finish")("completed",!1)}},dependencies:[st,R,W,K,G,j,H,q,$,ht,Lt,Ot,kt,Vt,jt,Bt,Ht,zt,Gt,ut,Ge,Et,Pt,ye,F],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.vertical-radio{display:flex;flex-direction:column;margin:15px 0}.mt-1rem{margin-top:1rem}.dateRange{padding-top:.8rem;padding-bottom:.8rem}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}.form-label-group.radio.download-type{height:45.5938px!important;border-radius:.375rem!important}
8
- `],encapsulation:2});let r=m;return r})();var na=[{path:"",component:Kt,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:$t,canActivate:[oe],data:{title:"New Order"}},{path:"detail",component:Xt,canActivate:[oe],data:{title:"Orders detail"}},{path:"ready_to_ship",component:Zt,canActivate:[oe],data:{title:"Ready To Ship"}},{path:"Shipped",component:ei,canActivate:[oe],data:{title:"Shipped"}},{path:"Delivered",component:ti,canActivate:[oe],data:{title:"Delivered"}},{path:"All",component:ii,canActivate:[oe],data:{title:"All Order"}},{path:"Cancelled",component:ni,canActivate:[oe],data:{title:"Cancelled"}},{path:"Download/V1",component:ai,canActivate:[oe],data:{title:"Download V1"}},{path:"Download",loadComponent(){return import("./chunk-KND7LPV4.js").then(r=>r.DownloadV2Component)},canActivate:[oe],data:{title:"Download"}},{path:"Download_Order_Log",loadComponent:()=>import("./chunk-L32MP5SV.js").then(r=>r.DownloadOrderLogComponent),canActivate:[oe],data:{title:"Download Order Log"}},{path:"Download_Order_Log/Detail",loadComponent:()=>import("./chunk-OKR5PVTL.js").then(r=>r.DownloadOrderDetailComponent),canActivate:[oe],data:{title:"Download Order Log Detail"}}]}],ri=(()=>{let m=class m{};m.\u0275fac=function(t){return new(t||m)},m.\u0275mod=Re({type:m}),m.\u0275inj=Ae({imports:[be,Be.forChild(na)]});let r=m;return r})();var mo=(()=>{let m=class m{};m.\u0275fac=function(t){return new(t||m)},m.\u0275mod=Re({type:m}),m.\u0275inj=Ae({providers:[ve,je,Ue],imports:[be,ct,ri,Dt,xt,Rt,Be,_t,Ft,gt,X,Ut,ft,vt,qt,bt,Nt,wt,Q,Ye,Ge,It]});let r=m;return r})();export{mo as OrdersModule};
8
+ `],encapsulation:2});let r=m;return r})();var na=[{path:"",component:Kt,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:$t,canActivate:[oe],data:{title:"New Order"}},{path:"detail",component:Xt,canActivate:[oe],data:{title:"Orders detail"}},{path:"ready_to_ship",component:Zt,canActivate:[oe],data:{title:"Ready To Ship"}},{path:"Shipped",component:ei,canActivate:[oe],data:{title:"Shipped"}},{path:"Delivered",component:ti,canActivate:[oe],data:{title:"Delivered"}},{path:"All",component:ii,canActivate:[oe],data:{title:"All Order"}},{path:"Cancelled",component:ni,canActivate:[oe],data:{title:"Cancelled"}},{path:"Download/V1",component:ai,canActivate:[oe],data:{title:"Download V1"}},{path:"Download",loadComponent(){return import("./chunk-NYS5GU74.js").then(r=>r.DownloadV2Component)},canActivate:[oe],data:{title:"Download"}},{path:"Download_Order_Log",loadComponent:()=>import("./chunk-3BZVV6EY.js").then(r=>r.DownloadOrderLogComponent),canActivate:[oe],data:{title:"Download Order Log"}},{path:"Download_Order_Log/Detail",loadComponent:()=>import("./chunk-OKR5PVTL.js").then(r=>r.DownloadOrderDetailComponent),canActivate:[oe],data:{title:"Download Order Log Detail"}}]}],ri=(()=>{let m=class m{};m.\u0275fac=function(t){return new(t||m)},m.\u0275mod=Re({type:m}),m.\u0275inj=Ae({imports:[be,Be.forChild(na)]});let r=m;return r})();var mo=(()=>{let m=class m{};m.\u0275fac=function(t){return new(t||m)},m.\u0275mod=Re({type:m}),m.\u0275inj=Ae({providers:[ve,je,Ue],imports:[be,ct,ri,Dt,xt,Rt,Be,_t,Ft,gt,X,Ut,ft,vt,qt,bt,Nt,wt,Q,Ye,Ge,It]});let r=m;return r})();export{mo as OrdersModule};
@@ -1 +1 @@
1
- import"./chunk-5NL2NJQD.js";import{a as Ue}from"./chunk-7LZ5ZSXM.js";import{a as X}from"./chunk-XHAXYWZ7.js";import{a as Ae,b as We,c as te}from"./chunk-B5PFUQJP.js";import{a as xe}from"./chunk-BVIRHZTZ.js";import{a as $e}from"./chunk-6UBPPQKL.js";import{a as Ne}from"./chunk-7KG3DC5J.js";import{b as Re}from"./chunk-AMSVLO4N.js";import{a as Le}from"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-JXTGH22T.js";import"./chunk-GCKSYCMI.js";import{a as ke}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import{a as De,b as Oe,c as Ve}from"./chunk-UMNGKENU.js";import{a as Be}from"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{a as ye,b as Ie,d as we,e as Fe}from"./chunk-CCXKODFV.js";import{i as K}from"./chunk-IGFH3I2Q.js";import{b as Pe,e as be}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as Me,m as Ee,n as Te}from"./chunk-BO4PPSB5.js";import{t as H,u as J}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{a as Ce,b as fe,h as k,m as B,y as L}from"./chunk-BSN7ZAXG.js";import{c as G,e as Se,f as ve}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as g,Bd as he,Cd as N,Da as C,Ea as f,Eb as u,G as Z,Gb as s,Gc as y,Hc as T,Ic as de,Jb as ce,Jc as ee,Ma as Y,Nb as W,Ob as R,Pa as re,Qb as $,Rb as U,Sb as r,Tb as l,Ub as P,Vb as I,Wb as w,Yb as b,Z as q,bc as m,ea as ae,ec as se,gb as S,jb as c,kb as v,mc as Q,nc as p,oc as me,pa as A,pc as x,rc as F,sc as M,sd as _e,ta as D,tc as E,uc as j,ud as z,v as oe,vc as O,vd as ue,xb as le,xc as V,yc as pe,yd as ge}from"./chunk-PQDPS2ID.js";import{a as ne,b as ie}from"./chunk-GNOSNGXM.js";var qe=(n,a)=>({color:n,"font-weight":a});function Ye(n,a){if(n&1&&(r(0,"mat-radio-button",2),p(1),l()),n&2){let i=a.$implicit,o=a.index,e=m();ce(pe(7,qe,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),c(),x("",i.Value," ")}}var Ge=(()=>{let a=class a{constructor(){this.disabled=!1,this.modelChange=new re,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(o){this.modelChange.emit(o)}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[O],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,t){e&1&&(r(0,"mat-radio-group",0),g("ngModelChange",function(_){return t.change(_)}),u(1,Ye,2,10,"mat-radio-button",1),l()),e&2&&(s("disabled",t.disabled)("ngModel",t.model),c(),s("ngForOf",t.options))},dependencies:[N,z,Ve,De,Oe,L,k,B,J,H],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]});let n=a;return n})();function Qe(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l()),n&2){let i=a.item;c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," ")}}function et(n,a){if(n&1){let i=b();r(0,"span",6),g("click",function(){C(i);let e=m(),t=e.item,d=e.clear;return f(d(t))}),p(1,"x"),l()}}function tt(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l(),u(4,et,2,0,"span",5)),n&2){let i=a.item,o=m();c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," "),c(),W(o.clearable()?4:-1)}}var Ke=(()=>{let a=class a{constructor(){this.authService=A(K),this.multiple=Y(!1),this.clearable=Y(!0),this.options=this.authService.getChannels(),this.onChange=o=>{}}onChannelChange(o){this.onChange(o)}writeValue(o){this.selectedChannels=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},standalone:!0,features:[j([{provide:Ce,multi:!0,useExisting:a}]),O],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(e,t){e&1&&(r(0,"ng-select",0),E("ngModelChange",function(_){return M(t.selectedChannels,_)||(t.selectedChannels=_),_}),g("ngModelChange",function(_){return t.onChannelChange(_)}),u(1,Qe,4,2,"ng-template",1)(2,tt,5,3,"ng-template",2),l()),e&2&&(s("clearable",t.clearable())("items",t.options),F("ngModel",t.selectedChannels),s("multiple",t.multiple()))},dependencies:[N,Fe,we,ye,Ie,L,k,B]});let n=a;return n})();var He=n=>[n],nt=n=>({"text-decoration-line-through":n}),it=n=>({"border-bottom":n}),ot=n=>({"bg-gradient-warning":n});function at(n,a){if(n&1){let i=b();I(0),r(1,"div")(2,"label",21),p(3,"Channel"),l(),r(4,"channel-select-options",22),E("ngModelChange",function(e){C(i);let t=m();return M(t.searchFilter.ListChannelID,e)||(t.searchFilter.ListChannelID=e),f(e)}),l()(),r(5,"div",23)(6,"label",24),p(7,"Filter by"),l(),r(8,"lib-radio-options",25),E("modelChange",function(e){C(i);let t=m();return M(t.searchFilter.filterModel,e)||(t.searchFilter.filterModel=e),f(e)}),l()(),w()}if(n&2){let i=m();c(4),s("multiple",!0),F("ngModel",i.searchFilter.ListChannelID),c(4),F("model",i.searchFilter.filterModel),s("options",i.filterTypeOptions)}}function rt(n,a){if(n&1){let i=b();r(0,"button",27),g("click",function(){C(i);let e=m().ngIf,t=m();return f(t.onUpdateItems(e))}),P(1,"i",28),p(2," Update "),l()}}function lt(n,a){if(n&1&&(I(0),r(1,"div",4),u(2,rt,3,0,"button",26),l(),w()),n&2){let i=a.ngIf,o=m();c(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function ct(n,a){if(n&1&&(r(0,"th",15)(1,"div",29),P(2,"img",30),r(3,"div",31),p(4),y(5,"stringLimit"),l()()()),n&2){let i=a.$implicit;c(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),c(),s("src",i==null?null:i.Img,S),c(2),x(" ",de(5,3,i.Name,20)," ")}}function st(n,a){if(n&1){let i=b();r(0,"th")(1,"input",32),E("ngModelChange",function(e){C(i);let t=m();return M(t.checkboxState,e)||(t.checkboxState=e),f(e)}),g("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),l()()}if(n&2){let i=m();c(),F("ngModel",i.checkboxState)}}function mt(n,a){n&1&&(r(0,"th",33)(1,"span"),p(2,"Expected"),l(),r(3,"span",34),p(4,"(POS)"),l()(),r(5,"th",33),p(6,"Channel"),l())}function pt(n,a){if(n&1){let i=b();r(0,"img",47),g("click",function(e){C(i);let t=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,t==null?null:t.ImageUrl))}),l()}if(n&2){let i=m(3).$implicit;se("src",i==null?null:i.ImageUrl,S)}}function dt(n,a){n&1&&P(0,"img",48)}function _t(n,a){if(n&1&&(r(0,"small",46),p(1),l()),n&2){let i=m(3).$implicit;c(),x("(",i==null?null:i.Category,")")}}function ut(n,a){if(n&1&&(I(0),r(1,"td",42),u(2,pt,1,1,"img",43)(3,dt,1,0,"ng-template",null,0,ee),l(),r(5,"td",44)(6,"h5",45),p(7),l(),u(8,_t,2,1,"small",46),l(),w()),n&2){let i=Q(4),o=m().$index,e=m().$implicit,t=m().ngIf;c(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",V(7,it,o+1==t.length)),c(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),c(3),s("rowSpan",e==null?null:e.Variants.length),c(2),me(e==null?null:e.Name),c(),W(e!=null&&e.Category?8:-1)}}function gt(n,a){if(n&1){let i=b();r(0,"td",49)(1,"input",32),E("ngModelChange",function(e){C(i);let t=m().$implicit;return M(t.selected,e)||(t.selected=e),f(e)}),l()()}if(n&2){let i=m().$implicit;c(),F("ngModel",i.selected)}}function ht(n,a){if(n&1){let i=b();I(0),r(1,"td",51),p(2),y(3,"number"),l(),r(4,"td",52),g("click",function(){let e=C(i).$implicit,t=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(t,d,e))}),r(5,"div",53)(6,"div",54),p(7),y(8,"number"),l(),r(9,"a",55),g("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),P(10,"i",40),l()()(),w()}if(n&2){let i=a.$implicit;c(2),x(" ",T(3,4,i.PriceExpected)," "),c(2),s("ngClass",V(8,ot,i.Price!=i.PriceExpected)),c(3),x(" ",T(8,6,i.Price)," "),c(2),s("href",i.Url,S)}}function Ct(n,a){n&1&&(r(0,"td",56),p(1," X "),l(),r(2,"td",56),p(3," X "),l())}function ft(n,a){if(n&1&&(I(0),u(1,ht,11,10,"ng-container",50)(2,Ct,4,0,"ng-template",null,1,ee),w()),n&2){let i=a.$implicit,o=Q(3),e=m().$implicit,t=m(3);c(),s("ngIf",t.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function xt(n,a){if(n&1&&(r(0,"tr"),u(1,ut,9,9,"ng-container",3),r(2,"td",35),p(3),l(),r(4,"td",36)(5,"div",37)(6,"div",38),p(7),l(),r(8,"div",31)(9,"a",39),P(10,"i",40),l()()()(),u(11,gt,2,1,"ng-template",19)(12,ft,4,2,"ng-container",41),l()),n&2){let i=a.$implicit,o=a.$index,e=m(3);c(),s("ngIf",o==0),c(2),x(" ",i==null?null:i.Model," "),c(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),c(2),s("ngClass",V(8,nt,i.Discontinued)),c(),x(" ",i==null?null:i.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),S),c(2),s("ngxPermissionsOnly",V(10,He,e.rolePriceEdit)),c(),s("ngForOf",e.channels())}}function Pt(n,a){if(n&1&&(r(0,"tbody"),$(1,xt,13,12,"tr",null,R),l()),n&2){let i=a.$implicit;c(),U(i.Variants)}}function bt(n,a){if(n&1&&(I(0),$(1,Pt,3,0,"tbody",null,R),w()),n&2){let i=a.ngIf;c(),U(i)}}var xn=(()=>{let a=class a{constructor(o,e,t,d,_,h,Je){this.http=o,this.toastr=e,this.dialog=t,this.productService=d,this.authService=_,this.biggerPictureService=h,this.paginationService=Je,this.infinitePagination=A(te),this.searchFilter=new Ne,this.checkboxState=!1,this.rolePriceEdit=xe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=le([]),this.filterTypeOptions=[{Key:X.ALL,Value:"All"},{Key:X.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let o=this.searchFilter.ListChannelID,e=[];G.IsEmpty(o)||o?.length==0?e=this.channelOptions:e=this.channelOptions.filter(t=>o.findIndex(d=>d==t.ID)>-1),this.channels.update(()=>e)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(q(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(ae(o=>{this.searchFilter=o.Filter,this.searchFilter.filterModel=X.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),q(1))}onSelectAllData(){this.data$=this.data$.pipe(oe(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(t=>(t.selected=this.checkboxState,t))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e=ie(ne({},this.searchFilter),{text:o,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let t=e.map(h=>h.ID),_={ListChannelID:this.channelOptions.filter(h=>h.selected).map(h=>h.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:h=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:h=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(t=>t.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Ue,{data:{title:"Updating Price",selectedItems:e,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(Z(t=>G.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(o)})}openTableDialog(o,e,t){let d=JSON.parse(JSON.stringify(o));this.dialog.open(Ae,{data:{Name:e.Name,Variant:d,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(Z(h=>G.IsNotEmpty(h))).subscribe(h=>{this.updateProductPrice(h,t)})}updateProductPrice(o,e){let t={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(d=>{e.Price=t.Price;let _=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Re,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};a.\u0275fac=function(e){return new(e||a)(v(be),v(Pe),v(Me),v(ke),v(K),v(Be),v($e))},a.\u0275cmp=D({type:a,selectors:[["app-custom-channel-price"]],standalone:!0,features:[j([te]),O],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(e,t){e&1&&(r(0,"mainpanel",2),g("onSubmit",function(_){return t.onFilter(_)}),r(1,"filters"),u(2,at,9,4,"ng-container",3),y(3,"async"),l(),r(4,"actions")(5,"div",4),u(6,lt,3,1,"ng-container",3),y(7,"async"),r(8,"button",5),g("click",function(){return t.openExportDialog()}),P(9,"i",6),r(10,"span"),p(11,"Export"),l()()()(),r(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),P(20,"th",14),$(21,ct,6,6,"th",15,R),l(),r(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),l()(),r(27,"th",17),p(28,"Variant"),l(),r(29,"th",18),p(30,"SKU"),l(),u(31,st,2,1,"ng-template",19),$(32,mt,7,0,null,null,R),l()(),u(34,bt,3,0,"ng-container",3),y(35,"async"),l(),r(36,"infinite-paginator",20),y(37,"async"),g("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),l()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),c(2),s("ngIf",T(3,13,t.loader$)),c(4),s("ngIf",T(7,15,t.data$)),c(15),U(t.channels()),c(10),s("ngxPermissionsOnly",V(21,He,t.rolePriceEdit)),c(),U(t.channels()),c(2),s("ngIf",T(35,17,t.data$)),c(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",T(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[N,_e,z,ue,ge,he,Te,Ee,L,fe,k,B,We,Ge,J,H,Le,ve,Se,Ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let n=a;return n})();export{xn as CustomChannelPriceComponent};
1
+ import"./chunk-PRR2LNJN.js";import{a as Ue}from"./chunk-7LZ5ZSXM.js";import{a as X}from"./chunk-XHAXYWZ7.js";import{a as Ae,b as We,c as te}from"./chunk-B5PFUQJP.js";import{a as xe}from"./chunk-BVIRHZTZ.js";import{a as $e}from"./chunk-6UBPPQKL.js";import{a as Ne}from"./chunk-7KG3DC5J.js";import{b as Re}from"./chunk-AMSVLO4N.js";import{a as Le}from"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-JXTGH22T.js";import"./chunk-GCKSYCMI.js";import{a as ke}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import{a as De,b as Oe,c as Ve}from"./chunk-UMNGKENU.js";import{a as Be}from"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{a as ye,b as Ie,d as we,e as Fe}from"./chunk-CCXKODFV.js";import{i as K}from"./chunk-EDPYVTYS.js";import{b as Pe,e as be}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as Me,m as Ee,n as Te}from"./chunk-BO4PPSB5.js";import{t as H,u as J}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{a as Ce,b as fe,h as k,m as B,y as L}from"./chunk-BSN7ZAXG.js";import{c as G,e as Se,f as ve}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as g,Bd as he,Cd as N,Da as C,Ea as f,Eb as u,G as Z,Gb as s,Gc as y,Hc as T,Ic as de,Jb as ce,Jc as ee,Ma as Y,Nb as W,Ob as R,Pa as re,Qb as $,Rb as U,Sb as r,Tb as l,Ub as P,Vb as I,Wb as w,Yb as b,Z as q,bc as m,ea as ae,ec as se,gb as S,jb as c,kb as v,mc as Q,nc as p,oc as me,pa as A,pc as x,rc as F,sc as M,sd as _e,ta as D,tc as E,uc as j,ud as z,v as oe,vc as O,vd as ue,xb as le,xc as V,yc as pe,yd as ge}from"./chunk-PQDPS2ID.js";import{a as ne,b as ie}from"./chunk-GNOSNGXM.js";var qe=(n,a)=>({color:n,"font-weight":a});function Ye(n,a){if(n&1&&(r(0,"mat-radio-button",2),p(1),l()),n&2){let i=a.$implicit,o=a.index,e=m();ce(pe(7,qe,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),c(),x("",i.Value," ")}}var Ge=(()=>{let a=class a{constructor(){this.disabled=!1,this.modelChange=new re,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(o){this.modelChange.emit(o)}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[O],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,t){e&1&&(r(0,"mat-radio-group",0),g("ngModelChange",function(_){return t.change(_)}),u(1,Ye,2,10,"mat-radio-button",1),l()),e&2&&(s("disabled",t.disabled)("ngModel",t.model),c(),s("ngForOf",t.options))},dependencies:[N,z,Ve,De,Oe,L,k,B,J,H],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]});let n=a;return n})();function Qe(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l()),n&2){let i=a.item;c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," ")}}function et(n,a){if(n&1){let i=b();r(0,"span",6),g("click",function(){C(i);let e=m(),t=e.item,d=e.clear;return f(d(t))}),p(1,"x"),l()}}function tt(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l(),u(4,et,2,0,"span",5)),n&2){let i=a.item,o=m();c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," "),c(),W(o.clearable()?4:-1)}}var Ke=(()=>{let a=class a{constructor(){this.authService=A(K),this.multiple=Y(!1),this.clearable=Y(!0),this.options=this.authService.getChannels(),this.onChange=o=>{}}onChannelChange(o){this.onChange(o)}writeValue(o){this.selectedChannels=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},standalone:!0,features:[j([{provide:Ce,multi:!0,useExisting:a}]),O],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(e,t){e&1&&(r(0,"ng-select",0),E("ngModelChange",function(_){return M(t.selectedChannels,_)||(t.selectedChannels=_),_}),g("ngModelChange",function(_){return t.onChannelChange(_)}),u(1,Qe,4,2,"ng-template",1)(2,tt,5,3,"ng-template",2),l()),e&2&&(s("clearable",t.clearable())("items",t.options),F("ngModel",t.selectedChannels),s("multiple",t.multiple()))},dependencies:[N,Fe,we,ye,Ie,L,k,B]});let n=a;return n})();var He=n=>[n],nt=n=>({"text-decoration-line-through":n}),it=n=>({"border-bottom":n}),ot=n=>({"bg-gradient-warning":n});function at(n,a){if(n&1){let i=b();I(0),r(1,"div")(2,"label",21),p(3,"Channel"),l(),r(4,"channel-select-options",22),E("ngModelChange",function(e){C(i);let t=m();return M(t.searchFilter.ListChannelID,e)||(t.searchFilter.ListChannelID=e),f(e)}),l()(),r(5,"div",23)(6,"label",24),p(7,"Filter by"),l(),r(8,"lib-radio-options",25),E("modelChange",function(e){C(i);let t=m();return M(t.searchFilter.filterModel,e)||(t.searchFilter.filterModel=e),f(e)}),l()(),w()}if(n&2){let i=m();c(4),s("multiple",!0),F("ngModel",i.searchFilter.ListChannelID),c(4),F("model",i.searchFilter.filterModel),s("options",i.filterTypeOptions)}}function rt(n,a){if(n&1){let i=b();r(0,"button",27),g("click",function(){C(i);let e=m().ngIf,t=m();return f(t.onUpdateItems(e))}),P(1,"i",28),p(2," Update "),l()}}function lt(n,a){if(n&1&&(I(0),r(1,"div",4),u(2,rt,3,0,"button",26),l(),w()),n&2){let i=a.ngIf,o=m();c(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function ct(n,a){if(n&1&&(r(0,"th",15)(1,"div",29),P(2,"img",30),r(3,"div",31),p(4),y(5,"stringLimit"),l()()()),n&2){let i=a.$implicit;c(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),c(),s("src",i==null?null:i.Img,S),c(2),x(" ",de(5,3,i.Name,20)," ")}}function st(n,a){if(n&1){let i=b();r(0,"th")(1,"input",32),E("ngModelChange",function(e){C(i);let t=m();return M(t.checkboxState,e)||(t.checkboxState=e),f(e)}),g("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),l()()}if(n&2){let i=m();c(),F("ngModel",i.checkboxState)}}function mt(n,a){n&1&&(r(0,"th",33)(1,"span"),p(2,"Expected"),l(),r(3,"span",34),p(4,"(POS)"),l()(),r(5,"th",33),p(6,"Channel"),l())}function pt(n,a){if(n&1){let i=b();r(0,"img",47),g("click",function(e){C(i);let t=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,t==null?null:t.ImageUrl))}),l()}if(n&2){let i=m(3).$implicit;se("src",i==null?null:i.ImageUrl,S)}}function dt(n,a){n&1&&P(0,"img",48)}function _t(n,a){if(n&1&&(r(0,"small",46),p(1),l()),n&2){let i=m(3).$implicit;c(),x("(",i==null?null:i.Category,")")}}function ut(n,a){if(n&1&&(I(0),r(1,"td",42),u(2,pt,1,1,"img",43)(3,dt,1,0,"ng-template",null,0,ee),l(),r(5,"td",44)(6,"h5",45),p(7),l(),u(8,_t,2,1,"small",46),l(),w()),n&2){let i=Q(4),o=m().$index,e=m().$implicit,t=m().ngIf;c(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",V(7,it,o+1==t.length)),c(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),c(3),s("rowSpan",e==null?null:e.Variants.length),c(2),me(e==null?null:e.Name),c(),W(e!=null&&e.Category?8:-1)}}function gt(n,a){if(n&1){let i=b();r(0,"td",49)(1,"input",32),E("ngModelChange",function(e){C(i);let t=m().$implicit;return M(t.selected,e)||(t.selected=e),f(e)}),l()()}if(n&2){let i=m().$implicit;c(),F("ngModel",i.selected)}}function ht(n,a){if(n&1){let i=b();I(0),r(1,"td",51),p(2),y(3,"number"),l(),r(4,"td",52),g("click",function(){let e=C(i).$implicit,t=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(t,d,e))}),r(5,"div",53)(6,"div",54),p(7),y(8,"number"),l(),r(9,"a",55),g("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),P(10,"i",40),l()()(),w()}if(n&2){let i=a.$implicit;c(2),x(" ",T(3,4,i.PriceExpected)," "),c(2),s("ngClass",V(8,ot,i.Price!=i.PriceExpected)),c(3),x(" ",T(8,6,i.Price)," "),c(2),s("href",i.Url,S)}}function Ct(n,a){n&1&&(r(0,"td",56),p(1," X "),l(),r(2,"td",56),p(3," X "),l())}function ft(n,a){if(n&1&&(I(0),u(1,ht,11,10,"ng-container",50)(2,Ct,4,0,"ng-template",null,1,ee),w()),n&2){let i=a.$implicit,o=Q(3),e=m().$implicit,t=m(3);c(),s("ngIf",t.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function xt(n,a){if(n&1&&(r(0,"tr"),u(1,ut,9,9,"ng-container",3),r(2,"td",35),p(3),l(),r(4,"td",36)(5,"div",37)(6,"div",38),p(7),l(),r(8,"div",31)(9,"a",39),P(10,"i",40),l()()()(),u(11,gt,2,1,"ng-template",19)(12,ft,4,2,"ng-container",41),l()),n&2){let i=a.$implicit,o=a.$index,e=m(3);c(),s("ngIf",o==0),c(2),x(" ",i==null?null:i.Model," "),c(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),c(2),s("ngClass",V(8,nt,i.Discontinued)),c(),x(" ",i==null?null:i.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),S),c(2),s("ngxPermissionsOnly",V(10,He,e.rolePriceEdit)),c(),s("ngForOf",e.channels())}}function Pt(n,a){if(n&1&&(r(0,"tbody"),$(1,xt,13,12,"tr",null,R),l()),n&2){let i=a.$implicit;c(),U(i.Variants)}}function bt(n,a){if(n&1&&(I(0),$(1,Pt,3,0,"tbody",null,R),w()),n&2){let i=a.ngIf;c(),U(i)}}var xn=(()=>{let a=class a{constructor(o,e,t,d,_,h,Je){this.http=o,this.toastr=e,this.dialog=t,this.productService=d,this.authService=_,this.biggerPictureService=h,this.paginationService=Je,this.infinitePagination=A(te),this.searchFilter=new Ne,this.checkboxState=!1,this.rolePriceEdit=xe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=le([]),this.filterTypeOptions=[{Key:X.ALL,Value:"All"},{Key:X.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let o=this.searchFilter.ListChannelID,e=[];G.IsEmpty(o)||o?.length==0?e=this.channelOptions:e=this.channelOptions.filter(t=>o.findIndex(d=>d==t.ID)>-1),this.channels.update(()=>e)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(q(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(ae(o=>{this.searchFilter=o.Filter,this.searchFilter.filterModel=X.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),q(1))}onSelectAllData(){this.data$=this.data$.pipe(oe(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(t=>(t.selected=this.checkboxState,t))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e=ie(ne({},this.searchFilter),{text:o,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let t=e.map(h=>h.ID),_={ListChannelID:this.channelOptions.filter(h=>h.selected).map(h=>h.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:h=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:h=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(t=>t.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Ue,{data:{title:"Updating Price",selectedItems:e,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(Z(t=>G.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(o)})}openTableDialog(o,e,t){let d=JSON.parse(JSON.stringify(o));this.dialog.open(Ae,{data:{Name:e.Name,Variant:d,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(Z(h=>G.IsNotEmpty(h))).subscribe(h=>{this.updateProductPrice(h,t)})}updateProductPrice(o,e){let t={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(d=>{e.Price=t.Price;let _=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Re,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};a.\u0275fac=function(e){return new(e||a)(v(be),v(Pe),v(Me),v(ke),v(K),v(Be),v($e))},a.\u0275cmp=D({type:a,selectors:[["app-custom-channel-price"]],standalone:!0,features:[j([te]),O],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(e,t){e&1&&(r(0,"mainpanel",2),g("onSubmit",function(_){return t.onFilter(_)}),r(1,"filters"),u(2,at,9,4,"ng-container",3),y(3,"async"),l(),r(4,"actions")(5,"div",4),u(6,lt,3,1,"ng-container",3),y(7,"async"),r(8,"button",5),g("click",function(){return t.openExportDialog()}),P(9,"i",6),r(10,"span"),p(11,"Export"),l()()()(),r(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),P(20,"th",14),$(21,ct,6,6,"th",15,R),l(),r(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),l()(),r(27,"th",17),p(28,"Variant"),l(),r(29,"th",18),p(30,"SKU"),l(),u(31,st,2,1,"ng-template",19),$(32,mt,7,0,null,null,R),l()(),u(34,bt,3,0,"ng-container",3),y(35,"async"),l(),r(36,"infinite-paginator",20),y(37,"async"),g("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),l()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),c(2),s("ngIf",T(3,13,t.loader$)),c(4),s("ngIf",T(7,15,t.data$)),c(15),U(t.channels()),c(10),s("ngxPermissionsOnly",V(21,He,t.rolePriceEdit)),c(),U(t.channels()),c(2),s("ngIf",T(35,17,t.data$)),c(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",T(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[N,_e,z,ue,ge,he,Te,Ee,L,fe,k,B,We,Ge,J,H,Le,ve,Se,Ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let n=a;return n})();export{xn as CustomChannelPriceComponent};
@@ -1 +1 @@
1
- import{a as he}from"./chunk-B5PFUQJP.js";import{a as oe}from"./chunk-BVIRHZTZ.js";import{a as fe}from"./chunk-N6IHFFFZ.js";import{a as xe,b as Ce}from"./chunk-PD4CUVAW.js";import{c as ue}from"./chunk-ADRVUMMW.js";import{a as ge}from"./chunk-XFTUE2ST.js";import{g as de}from"./chunk-HCDKYABV.js";import{i as ce}from"./chunk-IGFH3I2Q.js";import{d as pe,g as se}from"./chunk-BO4PPSB5.js";import{t as _e,u as me}from"./chunk-HUUFOAKH.js";import{b as ee,h as te,m as ne,y as ie}from"./chunk-BSN7ZAXG.js";import{c as re,e as le,f as ae}from"./chunk-64G3XLI6.js";import{$b as T,Bd as J,Cd as Q,Da as g,Ea as u,Eb as p,Gb as m,Gc as $,Hc as j,Ic as q,Jc as w,Ma as B,Nb as v,Ob as E,Pa as U,Qb as M,Rb as V,Sb as c,Tb as _,Ub as I,Vb as C,Wb as f,Xb as R,Yb as h,bc as r,ca as z,ec as H,f as W,gb as S,jb as a,kb as P,mc as b,nc as s,oc as k,pc as y,rc as O,sc as D,sd as K,ta as A,tc as N,ud as X,vc as Z,vd as Y,xc as x,xd as G}from"./chunk-PQDPS2ID.js";var L=e=>[e],Te=e=>({"text-decoration-line-through":e}),be=e=>({"ms-10":e}),ye=e=>({"text-danger":e}),Se=e=>({"bg-gradient-warning":e});function ve(e,l){if(e&1){let n=h();c(0,"mat-slide-toggle",13),T("toggleChange",function(){g(n);let t=r();return t.toggleStatus=!t.toggleStatus,u(t.onToggle())}),c(1,"small",14),s(2),_()()}if(e&2){let n=r();a(2),y(" ",n.productToggleTitle?n.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Ie(e,l){if(e&1){let n=h();c(0,"th")(1,"input",16),N("ngModelChange",function(t){g(n);let o=r(2);return D(o.checkboxState,t)||(o.checkboxState=t),u(t)}),T("ngModelChange",function(){g(n);let t=r(2);return u(t.onCheckboxStateChange())}),_()()}if(e&2){let n=r(2);a(),O("ngModel",n.checkboxState)}}function we(e,l){if(e&1&&(p(0,Ie,2,1,"ng-template",15),c(1,"th",11),s(2,"POS"),_()),e&2){let n=r();m("ngxPermissionsOnly",x(1,L,n.rolePriceEdit))}}function Fe(e,l){if(e&1&&(C(0),c(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),c(5,"div",21),s(6),$(7,"stringLimit"),_()()()(),f()),e&2){let n=l.$implicit;a(3),m("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),a(),m("src",n==null?null:n.Img,S),a(2),y(" ",q(7,3,n.Name,20)," ")}}function Pe(e,l){e&1&&R(0)}function Ee(e,l){if(e&1&&(C(0),p(1,Pe,1,0,"ng-container",33),f()),e&2){r();let n=b(7);a(),m("ngTemplateOutlet",n)}}function Me(e,l){e&1&&R(0)}function Ve(e,l){if(e&1&&p(0,Me,1,0,"ng-container",33),e&2){r(2);let n=b(7);m("ngTemplateOutlet",n)}}function ke(e,l){if(e&1&&p(0,Ve,1,1,"ng-template",15),e&2){let n=r(4);m("ngxPermissionsOnly",x(1,L,n.rolePriceEdit))}}function Oe(e,l){if(e&1){let n=h();C(0),c(1,"input",34),N("ngModelChange",function(t){g(n);let o=r(4).$implicit;return D(o.selected,t)||(o.selected=t),u(t)}),T("ngModelChange",function(){g(n);let t=r(4).$implicit,o=r();return u(o.onCheckboxStateProduct(t.ID))}),_(),f()}if(e&2){let n=r(4).$implicit;a(),O("ngModel",n.selected),m("disabled",!(n!=null&&n.Category))}}function De(e,l){if(e&1&&p(0,Oe,2,2,"ng-container",22),e&2){let n=r(3).$implicit;m("ngIf",(n==null||n.Variants==null?null:n.Variants.length)>1)}}function Ne(e,l){if(e&1){let n=h();C(0),c(1,"img",35),T("click",function(t){g(n);let o=r(3).$implicit,d=r();return u(d.onZoomImage(t,o==null?null:o.ImageUrl))}),_(),f()}if(e&2){let n=r(3).$implicit;a(),H("src",n==null?null:n.ThumbnailUrl,S)}}function $e(e,l){e&1&&I(0,"img",36)}function Be(e,l){if(e&1&&(C(0),c(1,"td",28)(2,"div",29),p(3,Ee,2,1,"ng-container",30)(4,ke,1,3,"ng-template",null,0,w)(6,De,1,1,"ng-template",null,1,w),c(8,"div",26),p(9,Ne,2,1,"ng-container",30)(10,$e,1,0,"ng-template",null,2,w),_()()(),c(12,"td",31)(13,"div"),s(14),_(),c(15,"small",32),s(16),_()(),f()),e&2){let n=b(5),i=b(11),t=r(2).$implicit,o=r();a(),m("rowSpan",t==null?null:t.Variants.length),a(2),m("ngIf",o.table=="inventory")("ngIfElse",n),a(5),m("ngClass",x(10,be,(t==null||t.Variants==null?null:t.Variants.length)<=1)),a(),m("ngIf",t==null?null:t.ThumbnailUrl)("ngIfElse",i),a(3),m("rowSpan",t==null?null:t.Variants.length),a(2),k(t==null?null:t.Name),a(),m("ngClass",x(12,ye,!(t!=null&&t.Category))),a(),y("(",t!=null&&t.Category?t==null?null:t.Category:"Not Found In POS",")")}}function Ue(e,l){if(e&1&&(c(0,"a",27),I(1,"i",37),_()),e&2){let n=r().$implicit,i=r(2);m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),S)}}function Re(e,l){if(e&1){let n=h();c(0,"input",40),N("ngModelChange",function(t){g(n);let o=r(3).$implicit;return D(o.selected,t)||(o.selected=t),u(t)}),_()}if(e&2){let n=r(3).$implicit,i=r().$implicit;O("ngModel",n.selected),m("disabled",!(i!=null&&i.Category))}}function je(e,l){if(e&1&&(c(0,"td",38),p(1,Re,1,2,"input",39),_()),e&2){let n=r(2).$implicit,i=r(2);a(),m("ngIf",i.printPOS(n)>=0||i.table=="price")}}function Le(e,l){if(e&1&&(p(0,je,2,1,"ng-template",15),c(1,"td",24),s(2),$(3,"number"),_()),e&2){let n=r().$implicit,i=r(2);m("ngxPermissionsOnly",x(4,L,i.rolePriceEdit)),a(2),k(j(3,2,i.printPOS(n)))}}function We(e,l){if(e&1){let n=h();C(0),c(1,"td",41),T("click",function(){g(n);let t=r().$implicit,o=r().$implicit,d=r().$implicit,F=r();return u(F.openTableDialog(d.Name,o,t.ID,d.ChannelItemID))}),c(2,"div",29)(3,"div",42),s(4),$(5,"number"),_(),c(6,"a",43),T("click",function(t){return g(n),u(t==null?null:t.stopPropagation())}),I(7,"i",37),_()()(),f()}if(e&2){let n=l.$implicit,i=r(2).$implicit,t=r(2);a(),m("ngClass",x(5,Se,t.printPOS(i)!=t.printItem(n)&&t.hiddenIPOSInventory()==!1)),a(3),y(" ",j(5,3,t.printItem(n))," "),a(2),m("href",n.Url,S)}}function ze(e,l){e&1&&(c(0,"td",44)(1,"div",29)(2,"span"),s(3,"X"),_()()())}function Ae(e,l){if(e&1&&p(0,We,8,7,"ng-container",30)(1,ze,4,0,"ng-template",null,3,w),e&2){let n=l.$implicit,i=b(2),t=r().$implicit,o=r(2);m("ngIf",o.getItemFromChannel(t,n))("ngIfElse",i)}}function He(e,l){if(e&1&&(c(0,"tr"),p(1,Be,17,14,"ng-container",22),c(2,"td",23),s(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),c(8,"div",21),p(9,Ue,2,1,"a",27),_()()(),p(10,Le,4,6),M(11,Ae,3,2,null,null,E),_()),e&2){let n=l.$implicit,i=l.$index,t=r().$implicit,o=r();a(),m("ngIf",i==0),a(2),k(n==null?null:n.Model),a(2),m("matTooltip",n.Discontinued?o.discontinuedVariantMsg:""),a(),m("ngClass",x(7,Te,n.Discontinued)),a(),y(" ",n.Code," "),a(2),v(t.Category?9:-1),a(),v(o.hiddenIPOSInventory()==!1?10:-1),a(),V(o.channel)}}function Ze(e,l){if(e&1&&(c(0,"tbody"),M(1,He,13,9,"tr",null,E),_()),e&2){let n=l.$implicit;a(),V(n.Variants)}}var bt=(()=>{let l=class l{constructor(i,t,o){this.dialog=i,this.biggerPictureService=t,this.authService=o,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=oe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new U,this.destroy$=new W,this.toggle=new U,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(i){let t=this.data.filter(o=>o.ID==i);t.length>0&&(t=t.map(o=>(o.Variants=o.Variants.map(d=>(d.selected=o.selected,d)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t)),i))}getItemFromChannel(i,t){return i.Channel.find(d=>re.IsNotEmpty(t.LocationID)?d.LocationID==t.LocationID:d.ChannelID==t.ID)}printItem(i){if(this.table=="inventory")return i.Inventory;if(this.table=="price")return i.Price}openTableDialog(i,t,o,d){this.dialog.open(he,{data:{Name:i,Variant:t,ChannelID:o,Table:this.table,ChannelItemID:d}}).afterClosed().pipe(z(this.destroy$)).subscribe(F=>{F!=null&&this.onSubmit.emit(F)})}printPOS(i){return this.table=="inventory"?i.Inventory?i.Inventory:0:this.table=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,t){this.biggerPictureService.openBiggerPicture(i,t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(t){return new(t||l)(P(pe),P(ge),P(ce))},l.\u0275cmp=A({type:l,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},standalone:!0,features:[Z],decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(t,o){t&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,ve,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),s(10,"Variant"),_(),c(11,"th",11),s(12,"SKU"),_(),p(13,we,3,3)(14,Fe,8,6,"ng-container",12),_()(),M(15,Ze,3,0,"tbody",null,E),_()()),t&2&&(a(8),v(o.showProductToggle?8:-1),a(5),v(o.hiddenIPOSInventory()==!1?13:-1),a(),m("ngForOf",o.channel),a(),V(o.data))},dependencies:[Q,K,X,Y,G,J,ie,ee,te,ne,Ce,xe,se,de,ue,ae,le,me,_e,fe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]});let e=l;return e})();export{bt as a};
1
+ import{a as he}from"./chunk-B5PFUQJP.js";import{a as oe}from"./chunk-BVIRHZTZ.js";import{a as fe}from"./chunk-N6IHFFFZ.js";import{a as xe,b as Ce}from"./chunk-PD4CUVAW.js";import{c as ue}from"./chunk-ADRVUMMW.js";import{a as ge}from"./chunk-XFTUE2ST.js";import{g as de}from"./chunk-HCDKYABV.js";import{i as ce}from"./chunk-EDPYVTYS.js";import{d as pe,g as se}from"./chunk-BO4PPSB5.js";import{t as _e,u as me}from"./chunk-HUUFOAKH.js";import{b as ee,h as te,m as ne,y as ie}from"./chunk-BSN7ZAXG.js";import{c as re,e as le,f as ae}from"./chunk-64G3XLI6.js";import{$b as T,Bd as J,Cd as Q,Da as g,Ea as u,Eb as p,Gb as m,Gc as $,Hc as j,Ic as q,Jc as w,Ma as B,Nb as v,Ob as E,Pa as U,Qb as M,Rb as V,Sb as c,Tb as _,Ub as I,Vb as C,Wb as f,Xb as R,Yb as h,bc as r,ca as z,ec as H,f as W,gb as S,jb as a,kb as P,mc as b,nc as s,oc as k,pc as y,rc as O,sc as D,sd as K,ta as A,tc as N,ud as X,vc as Z,vd as Y,xc as x,xd as G}from"./chunk-PQDPS2ID.js";var L=e=>[e],Te=e=>({"text-decoration-line-through":e}),be=e=>({"ms-10":e}),ye=e=>({"text-danger":e}),Se=e=>({"bg-gradient-warning":e});function ve(e,l){if(e&1){let n=h();c(0,"mat-slide-toggle",13),T("toggleChange",function(){g(n);let t=r();return t.toggleStatus=!t.toggleStatus,u(t.onToggle())}),c(1,"small",14),s(2),_()()}if(e&2){let n=r();a(2),y(" ",n.productToggleTitle?n.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Ie(e,l){if(e&1){let n=h();c(0,"th")(1,"input",16),N("ngModelChange",function(t){g(n);let o=r(2);return D(o.checkboxState,t)||(o.checkboxState=t),u(t)}),T("ngModelChange",function(){g(n);let t=r(2);return u(t.onCheckboxStateChange())}),_()()}if(e&2){let n=r(2);a(),O("ngModel",n.checkboxState)}}function we(e,l){if(e&1&&(p(0,Ie,2,1,"ng-template",15),c(1,"th",11),s(2,"POS"),_()),e&2){let n=r();m("ngxPermissionsOnly",x(1,L,n.rolePriceEdit))}}function Fe(e,l){if(e&1&&(C(0),c(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),c(5,"div",21),s(6),$(7,"stringLimit"),_()()()(),f()),e&2){let n=l.$implicit;a(3),m("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),a(),m("src",n==null?null:n.Img,S),a(2),y(" ",q(7,3,n.Name,20)," ")}}function Pe(e,l){e&1&&R(0)}function Ee(e,l){if(e&1&&(C(0),p(1,Pe,1,0,"ng-container",33),f()),e&2){r();let n=b(7);a(),m("ngTemplateOutlet",n)}}function Me(e,l){e&1&&R(0)}function Ve(e,l){if(e&1&&p(0,Me,1,0,"ng-container",33),e&2){r(2);let n=b(7);m("ngTemplateOutlet",n)}}function ke(e,l){if(e&1&&p(0,Ve,1,1,"ng-template",15),e&2){let n=r(4);m("ngxPermissionsOnly",x(1,L,n.rolePriceEdit))}}function Oe(e,l){if(e&1){let n=h();C(0),c(1,"input",34),N("ngModelChange",function(t){g(n);let o=r(4).$implicit;return D(o.selected,t)||(o.selected=t),u(t)}),T("ngModelChange",function(){g(n);let t=r(4).$implicit,o=r();return u(o.onCheckboxStateProduct(t.ID))}),_(),f()}if(e&2){let n=r(4).$implicit;a(),O("ngModel",n.selected),m("disabled",!(n!=null&&n.Category))}}function De(e,l){if(e&1&&p(0,Oe,2,2,"ng-container",22),e&2){let n=r(3).$implicit;m("ngIf",(n==null||n.Variants==null?null:n.Variants.length)>1)}}function Ne(e,l){if(e&1){let n=h();C(0),c(1,"img",35),T("click",function(t){g(n);let o=r(3).$implicit,d=r();return u(d.onZoomImage(t,o==null?null:o.ImageUrl))}),_(),f()}if(e&2){let n=r(3).$implicit;a(),H("src",n==null?null:n.ThumbnailUrl,S)}}function $e(e,l){e&1&&I(0,"img",36)}function Be(e,l){if(e&1&&(C(0),c(1,"td",28)(2,"div",29),p(3,Ee,2,1,"ng-container",30)(4,ke,1,3,"ng-template",null,0,w)(6,De,1,1,"ng-template",null,1,w),c(8,"div",26),p(9,Ne,2,1,"ng-container",30)(10,$e,1,0,"ng-template",null,2,w),_()()(),c(12,"td",31)(13,"div"),s(14),_(),c(15,"small",32),s(16),_()(),f()),e&2){let n=b(5),i=b(11),t=r(2).$implicit,o=r();a(),m("rowSpan",t==null?null:t.Variants.length),a(2),m("ngIf",o.table=="inventory")("ngIfElse",n),a(5),m("ngClass",x(10,be,(t==null||t.Variants==null?null:t.Variants.length)<=1)),a(),m("ngIf",t==null?null:t.ThumbnailUrl)("ngIfElse",i),a(3),m("rowSpan",t==null?null:t.Variants.length),a(2),k(t==null?null:t.Name),a(),m("ngClass",x(12,ye,!(t!=null&&t.Category))),a(),y("(",t!=null&&t.Category?t==null?null:t.Category:"Not Found In POS",")")}}function Ue(e,l){if(e&1&&(c(0,"a",27),I(1,"i",37),_()),e&2){let n=r().$implicit,i=r(2);m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),S)}}function Re(e,l){if(e&1){let n=h();c(0,"input",40),N("ngModelChange",function(t){g(n);let o=r(3).$implicit;return D(o.selected,t)||(o.selected=t),u(t)}),_()}if(e&2){let n=r(3).$implicit,i=r().$implicit;O("ngModel",n.selected),m("disabled",!(i!=null&&i.Category))}}function je(e,l){if(e&1&&(c(0,"td",38),p(1,Re,1,2,"input",39),_()),e&2){let n=r(2).$implicit,i=r(2);a(),m("ngIf",i.printPOS(n)>=0||i.table=="price")}}function Le(e,l){if(e&1&&(p(0,je,2,1,"ng-template",15),c(1,"td",24),s(2),$(3,"number"),_()),e&2){let n=r().$implicit,i=r(2);m("ngxPermissionsOnly",x(4,L,i.rolePriceEdit)),a(2),k(j(3,2,i.printPOS(n)))}}function We(e,l){if(e&1){let n=h();C(0),c(1,"td",41),T("click",function(){g(n);let t=r().$implicit,o=r().$implicit,d=r().$implicit,F=r();return u(F.openTableDialog(d.Name,o,t.ID,d.ChannelItemID))}),c(2,"div",29)(3,"div",42),s(4),$(5,"number"),_(),c(6,"a",43),T("click",function(t){return g(n),u(t==null?null:t.stopPropagation())}),I(7,"i",37),_()()(),f()}if(e&2){let n=l.$implicit,i=r(2).$implicit,t=r(2);a(),m("ngClass",x(5,Se,t.printPOS(i)!=t.printItem(n)&&t.hiddenIPOSInventory()==!1)),a(3),y(" ",j(5,3,t.printItem(n))," "),a(2),m("href",n.Url,S)}}function ze(e,l){e&1&&(c(0,"td",44)(1,"div",29)(2,"span"),s(3,"X"),_()()())}function Ae(e,l){if(e&1&&p(0,We,8,7,"ng-container",30)(1,ze,4,0,"ng-template",null,3,w),e&2){let n=l.$implicit,i=b(2),t=r().$implicit,o=r(2);m("ngIf",o.getItemFromChannel(t,n))("ngIfElse",i)}}function He(e,l){if(e&1&&(c(0,"tr"),p(1,Be,17,14,"ng-container",22),c(2,"td",23),s(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),c(8,"div",21),p(9,Ue,2,1,"a",27),_()()(),p(10,Le,4,6),M(11,Ae,3,2,null,null,E),_()),e&2){let n=l.$implicit,i=l.$index,t=r().$implicit,o=r();a(),m("ngIf",i==0),a(2),k(n==null?null:n.Model),a(2),m("matTooltip",n.Discontinued?o.discontinuedVariantMsg:""),a(),m("ngClass",x(7,Te,n.Discontinued)),a(),y(" ",n.Code," "),a(2),v(t.Category?9:-1),a(),v(o.hiddenIPOSInventory()==!1?10:-1),a(),V(o.channel)}}function Ze(e,l){if(e&1&&(c(0,"tbody"),M(1,He,13,9,"tr",null,E),_()),e&2){let n=l.$implicit;a(),V(n.Variants)}}var bt=(()=>{let l=class l{constructor(i,t,o){this.dialog=i,this.biggerPictureService=t,this.authService=o,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=oe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new U,this.destroy$=new W,this.toggle=new U,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(i){let t=this.data.filter(o=>o.ID==i);t.length>0&&(t=t.map(o=>(o.Variants=o.Variants.map(d=>(d.selected=o.selected,d)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t)),i))}getItemFromChannel(i,t){return i.Channel.find(d=>re.IsNotEmpty(t.LocationID)?d.LocationID==t.LocationID:d.ChannelID==t.ID)}printItem(i){if(this.table=="inventory")return i.Inventory;if(this.table=="price")return i.Price}openTableDialog(i,t,o,d){this.dialog.open(he,{data:{Name:i,Variant:t,ChannelID:o,Table:this.table,ChannelItemID:d}}).afterClosed().pipe(z(this.destroy$)).subscribe(F=>{F!=null&&this.onSubmit.emit(F)})}printPOS(i){return this.table=="inventory"?i.Inventory?i.Inventory:0:this.table=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,t){this.biggerPictureService.openBiggerPicture(i,t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(t){return new(t||l)(P(pe),P(ge),P(ce))},l.\u0275cmp=A({type:l,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},standalone:!0,features:[Z],decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(t,o){t&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,ve,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),s(10,"Variant"),_(),c(11,"th",11),s(12,"SKU"),_(),p(13,we,3,3)(14,Fe,8,6,"ng-container",12),_()(),M(15,Ze,3,0,"tbody",null,E),_()()),t&2&&(a(8),v(o.showProductToggle?8:-1),a(5),v(o.hiddenIPOSInventory()==!1?13:-1),a(),m("ngForOf",o.channel),a(),V(o.data))},dependencies:[Q,K,X,Y,G,J,ie,ee,te,ne,Ce,xe,se,de,ue,ae,le,me,_e,fe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]});let e=l;return e})();export{bt as a};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-GPE5CZJG.js";import{a as E}from"./chunk-ZFQW5CVZ.js";import{g as w,i as T}from"./chunk-IGFH3I2Q.js";import{b as D,e as u}from"./chunk-4SAJUEHO.js";import{b as a,c as g}from"./chunk-64G3XLI6.js";import{o as j}from"./chunk-OVEJFFL6.js";import{B as I,G as C,J as l,g as b,ja as s,pa as p,q as d,v as A,xb as U}from"./chunk-PQDPS2ID.js";var x=(()=>{let o=class o{constructor(){this.httpService=p(u)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(l(r=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(r=>({value_id:r.value_id,name:r.name}))})),t}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var H=(()=>{let o=class o{constructor(){this.httpService=p(u)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(l(r=>d(null)))}generateAttribute(t){let e;return t.map(r=>(r.type=="PRODUCT_PROPERTY"?e={id:r.id,name:r.name,type:r.type,values:r.values}:e={id:r.id,name:r.values[0].id,type:r.type},e))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var z=(()=>{let o=class o{constructor(){this.httpService=p(u)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var R=(()=>{let o=class o{constructor(){this.httpService=p(u)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var v=class{};var S=class{};var G=(()=>{let o=class o{constructor(){this.httpService=p(u)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var O=(()=>{let o=class o{constructor(){this.httpService=p(u)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var N=(()=>{let o=class o{constructor(){this.httpService=p(u)}uploadProduct(t){return this.httpService.post(w.UploadPlugoProduct,t).pipe(l(e=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Bt=(()=>{let o=class o{constructor(){this.authService=p(T),this.productService=p(E),this.shoppeUploadService=p(x),this.tiktokUploadService=p(H),this.lazadaUploadService=p(z),this.tokopediaUploadService=p(G),this.wooUploadService=p(R),this.shopifyUploadService=p(O),this.plugoUploadService=p(N),this.toastrHandlingService=p(F),this.toastr=p(D),this.router=p(j),this.httpService=p(u),this._selectedProduct=new b(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(C(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return U(t.map(r=>{let c=new v;return c.id=r.ID,c.name=r.Name,c.type=r.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(r=>r.selected&&g.IsNotEmpty(r.categoryId)||r.selected&&(r.type==a.Shopify||r.type==a.Plugo));if(e.length>0){let r=this.generateDataForUpload(e);this.uploadProduct(r)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);I(e).pipe(A(r=>{let c=[];return r.forEach(m=>{c=[...c,...m]}),c})).subscribe({next:(r=[])=>{g.IsNotEmpty(r)&&this.toastrHandlingService.showToastrUploadMultiple(r),this.hasSuccessRes(r)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(r=>{r?.Response.Success_list?.length>0&&g.IsNotEmpty(r)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],r=[],c=[],m=[],y=[],P=[],k=[];t.forEach(n=>{switch(n.ChannelType){case a.Shopee:r.push(n);break;case a.Tiktok:e.push(n);break;case a.Lazada:c.push(n);break;case a.Tokopedia:m.push(n);break;case a.WooCommerce:y.push(n);break;case a.Shopify:P.push(n);break;case a.Plugo:k.push(n);break}});let h=[];return[{type:a.Shopee,data:r},{type:a.Tiktok,data:e},{type:a.Lazada,data:c},{type:a.Tokopedia,data:m},{type:a.WooCommerce,data:y},{type:a.Shopify,data:P},{type:a.Plugo,data:k}].filter(n=>n.data.length>0).forEach(n=>{switch(n.type){case a.Shopee:h.push(this.shoppeUploadService.uploadProduct(r));break;case a.Tiktok:h.push(this.tiktokUploadService.uploadProduct(e));break;case a.Lazada:h.push(this.lazadaUploadService.uploadProduct(c));break;case a.Tokopedia:h.push(this.tokopediaUploadService.uploadProduct(m));break;case a.WooCommerce:h.push(this.wooUploadService.uploadProduct(y));break;case a.Shopify:h.push(this.shopifyUploadService.uploadProduct(P));break;case a.Plugo:h.push(this.plugoUploadService.uploadProduct(k));break}}),h}generateDataForUpload(t){let e=[];return t.forEach(r=>{let c=new S;c.ChannelID=r.id,c.ChannelType=r.type,c.Products=this._selectedProduct.getValue(),r.type==a.Shopify?delete c.CategoryID:c.CategoryID=r.categoryId,r.type==a.WooCommerce||r.type==a.Shopify?c.Attribute=r.attributes[0]:c.Attributes=this.formatAttributes(r.type,r.attributes),e.push(c)}),e}formatAttributes(t,e){let r;switch(t){case a.Shopee:r=this.shoppeUploadService.generateAttribute(e);break;case a.Tiktok:r=this.tiktokUploadService.generateAttribute(e);break;case a.WooCommerce:r=this.tiktokUploadService.generateAttribute(e);break;case a.Tokopedia:r=e;break;case a.Shopify:r=e;break;default:r=[];break}return r}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();export{x as a,H as b,z as c,R as d,Bt as e};
1
+ import{a as F}from"./chunk-GPE5CZJG.js";import{a as E}from"./chunk-ZFQW5CVZ.js";import{g as w,i as T}from"./chunk-EDPYVTYS.js";import{b as D,e as u}from"./chunk-4SAJUEHO.js";import{b as a,c as g}from"./chunk-64G3XLI6.js";import{o as j}from"./chunk-OVEJFFL6.js";import{B as I,G as C,J as l,g as b,ja as s,pa as p,q as d,v as A,xb as U}from"./chunk-PQDPS2ID.js";var x=(()=>{let o=class o{constructor(){this.httpService=p(u)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(l(r=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(r=>({value_id:r.value_id,name:r.name}))})),t}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var H=(()=>{let o=class o{constructor(){this.httpService=p(u)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(l(r=>d(null)))}generateAttribute(t){let e;return t.map(r=>(r.type=="PRODUCT_PROPERTY"?e={id:r.id,name:r.name,type:r.type,values:r.values}:e={id:r.id,name:r.values[0].id,type:r.type},e))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var z=(()=>{let o=class o{constructor(){this.httpService=p(u)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var R=(()=>{let o=class o{constructor(){this.httpService=p(u)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var v=class{};var S=class{};var G=(()=>{let o=class o{constructor(){this.httpService=p(u)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var O=(()=>{let o=class o{constructor(){this.httpService=p(u)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var N=(()=>{let o=class o{constructor(){this.httpService=p(u)}uploadProduct(t){return this.httpService.post(w.UploadPlugoProduct,t).pipe(l(e=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Bt=(()=>{let o=class o{constructor(){this.authService=p(T),this.productService=p(E),this.shoppeUploadService=p(x),this.tiktokUploadService=p(H),this.lazadaUploadService=p(z),this.tokopediaUploadService=p(G),this.wooUploadService=p(R),this.shopifyUploadService=p(O),this.plugoUploadService=p(N),this.toastrHandlingService=p(F),this.toastr=p(D),this.router=p(j),this.httpService=p(u),this._selectedProduct=new b(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(C(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return U(t.map(r=>{let c=new v;return c.id=r.ID,c.name=r.Name,c.type=r.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(r=>r.selected&&g.IsNotEmpty(r.categoryId)||r.selected&&(r.type==a.Shopify||r.type==a.Plugo));if(e.length>0){let r=this.generateDataForUpload(e);this.uploadProduct(r)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);I(e).pipe(A(r=>{let c=[];return r.forEach(m=>{c=[...c,...m]}),c})).subscribe({next:(r=[])=>{g.IsNotEmpty(r)&&this.toastrHandlingService.showToastrUploadMultiple(r),this.hasSuccessRes(r)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(r=>{r?.Response.Success_list?.length>0&&g.IsNotEmpty(r)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],r=[],c=[],m=[],y=[],P=[],k=[];t.forEach(n=>{switch(n.ChannelType){case a.Shopee:r.push(n);break;case a.Tiktok:e.push(n);break;case a.Lazada:c.push(n);break;case a.Tokopedia:m.push(n);break;case a.WooCommerce:y.push(n);break;case a.Shopify:P.push(n);break;case a.Plugo:k.push(n);break}});let h=[];return[{type:a.Shopee,data:r},{type:a.Tiktok,data:e},{type:a.Lazada,data:c},{type:a.Tokopedia,data:m},{type:a.WooCommerce,data:y},{type:a.Shopify,data:P},{type:a.Plugo,data:k}].filter(n=>n.data.length>0).forEach(n=>{switch(n.type){case a.Shopee:h.push(this.shoppeUploadService.uploadProduct(r));break;case a.Tiktok:h.push(this.tiktokUploadService.uploadProduct(e));break;case a.Lazada:h.push(this.lazadaUploadService.uploadProduct(c));break;case a.Tokopedia:h.push(this.tokopediaUploadService.uploadProduct(m));break;case a.WooCommerce:h.push(this.wooUploadService.uploadProduct(y));break;case a.Shopify:h.push(this.shopifyUploadService.uploadProduct(P));break;case a.Plugo:h.push(this.plugoUploadService.uploadProduct(k));break}}),h}generateDataForUpload(t){let e=[];return t.forEach(r=>{let c=new S;c.ChannelID=r.id,c.ChannelType=r.type,c.Products=this._selectedProduct.getValue(),r.type==a.Shopify?delete c.CategoryID:c.CategoryID=r.categoryId,r.type==a.WooCommerce||r.type==a.Shopify?c.Attribute=r.attributes[0]:c.Attributes=this.formatAttributes(r.type,r.attributes),e.push(c)}),e}formatAttributes(t,e){let r;switch(t){case a.Shopee:r=this.shoppeUploadService.generateAttribute(e);break;case a.Tiktok:r=this.tiktokUploadService.generateAttribute(e);break;case a.WooCommerce:r=this.tiktokUploadService.generateAttribute(e);break;case a.Tokopedia:r=e;break;case a.Shopify:r=e;break;default:r=[];break}return r}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();export{x as a,H as b,z as c,R as d,Bt as e};