marketplacepos 3.4.1 → 3.4.2

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 (76) hide show
  1. package/Marketplace/{chunk-XDPBTCKN.js → chunk-2PR23CRN.js} +1 -1
  2. package/Marketplace/{chunk-JI67LAJB.js → chunk-3FA5VSAY.js} +1 -1
  3. package/Marketplace/{chunk-CFL3VDAM.js → chunk-45BCCCD5.js} +1 -1
  4. package/Marketplace/{chunk-MYMGFQII.js → chunk-4FIQ677Y.js} +1 -1
  5. package/Marketplace/{chunk-IJ3WNDAP.js → chunk-4ZIFLVEZ.js} +1 -1
  6. package/Marketplace/{chunk-YIB32JAF.js → chunk-5LIHLHZ2.js} +1 -1
  7. package/Marketplace/{chunk-I2FTGSXA.js → chunk-6H6S75XM.js} +1 -1
  8. package/Marketplace/{chunk-S7ANPM6L.js → chunk-7O2LUPOW.js} +1 -1
  9. package/Marketplace/{chunk-B6ZV4WVU.js → chunk-ANO5F2BV.js} +1 -1
  10. package/Marketplace/{chunk-QSO3ASFL.js → chunk-APSB364O.js} +1 -1
  11. package/Marketplace/{chunk-MB6PCQRT.js → chunk-BJCKTMTZ.js} +1 -1
  12. package/Marketplace/{chunk-AN4U7FVT.js → chunk-CAF3EESF.js} +1 -1
  13. package/Marketplace/{chunk-JJXHYCB6.js → chunk-CB54UHPH.js} +1 -1
  14. package/Marketplace/{chunk-LICL6LNZ.js → chunk-CLLCMDP4.js} +1 -1
  15. package/Marketplace/{chunk-32YQ5ZBK.js → chunk-CNK2ETMZ.js} +1 -1
  16. package/Marketplace/{chunk-OGJ6YVG4.js → chunk-CVIYGYJG.js} +1 -1
  17. package/Marketplace/{chunk-BBX2DZWF.js → chunk-DANZQU6U.js} +1 -1
  18. package/Marketplace/{chunk-5YX57TZJ.js → chunk-DH7A3MMY.js} +1 -1
  19. package/Marketplace/{chunk-2Y47HNW5.js → chunk-EBAG6BIX.js} +1 -1
  20. package/Marketplace/{chunk-YZHBBFDR.js → chunk-EGVKBYT5.js} +1 -1
  21. package/Marketplace/{chunk-DE2BZXNA.js → chunk-EIQQEQMI.js} +1 -1
  22. package/Marketplace/{chunk-JRZ4OAAZ.js → chunk-ENUKURHL.js} +1 -1
  23. package/Marketplace/{chunk-G6DYB24N.js → chunk-FJAD3LVA.js} +1 -1
  24. package/Marketplace/chunk-FWUAZZDI.js +1 -0
  25. package/Marketplace/{chunk-QV22VQ5Q.js → chunk-GPNYP6CI.js} +1 -1
  26. package/Marketplace/{chunk-3MUYDBXT.js → chunk-H5BAFHZZ.js} +1 -1
  27. package/Marketplace/{chunk-TIXJK5ZY.js → chunk-HIQEVY5J.js} +1 -1
  28. package/Marketplace/{chunk-FR67IIWG.js → chunk-HMATF4RH.js} +1 -1
  29. package/Marketplace/{chunk-RHM4GQMX.js → chunk-HO6I7ZN6.js} +1 -1
  30. package/Marketplace/{chunk-J55273WG.js → chunk-I5WJTOZD.js} +1 -1
  31. package/Marketplace/{chunk-RS52HOKA.js → chunk-IKBHUDBF.js} +1 -1
  32. package/Marketplace/{chunk-JT76ON64.js → chunk-JD4NX6LL.js} +1 -1
  33. package/Marketplace/{chunk-Q4Y764AE.js → chunk-JDAC3DI7.js} +1 -1
  34. package/Marketplace/chunk-JIRDXTRJ.js +1 -0
  35. package/Marketplace/{chunk-QJKKB3RG.js → chunk-KHQYY4CP.js} +1 -1
  36. package/Marketplace/{chunk-5UESNVF7.js → chunk-KS42UW22.js} +1 -1
  37. package/Marketplace/{chunk-HDWZXE6G.js → chunk-LC5NUVMA.js} +1 -1
  38. package/Marketplace/{chunk-55NPYZ64.js → chunk-LHYUY4OW.js} +1 -1
  39. package/Marketplace/{chunk-R3VPTXDH.js → chunk-LUN7S6P4.js} +1 -1
  40. package/Marketplace/{chunk-XQTL4ELH.js → chunk-MPXURNR4.js} +1 -1
  41. package/Marketplace/{chunk-GUKAWOAK.js → chunk-NLUIK3SD.js} +1 -1
  42. package/Marketplace/{chunk-5PV4AXUR.js → chunk-NQ5YXCPF.js} +1 -1
  43. package/Marketplace/{chunk-UUMW24BF.js → chunk-OGA3XTQE.js} +1 -1
  44. package/Marketplace/{chunk-NNYMQPRT.js → chunk-OHLIZGJ7.js} +1 -1
  45. package/Marketplace/{chunk-CA4NYL7C.js → chunk-PASXSTSS.js} +1 -1
  46. package/Marketplace/{chunk-FDYGWNMG.js → chunk-Q27U6EXR.js} +1 -1
  47. package/Marketplace/{chunk-YHWXRXON.js → chunk-QA6BHZKW.js} +1 -1
  48. package/Marketplace/{chunk-KKQWPACG.js → chunk-QXKJ6AH2.js} +1 -1
  49. package/Marketplace/{chunk-IGSHV4S3.js → chunk-QZHSCJJ5.js} +1 -1
  50. package/Marketplace/{chunk-HTODD7RF.js → chunk-RUG3NZNS.js} +1 -1
  51. package/Marketplace/{chunk-BLRV33OB.js → chunk-TEIBLAW7.js} +2 -2
  52. package/Marketplace/{chunk-BTKP3PJH.js → chunk-TFM4P7KH.js} +1 -1
  53. package/Marketplace/{chunk-2GOE5RBJ.js → chunk-TKW6MA5X.js} +1 -1
  54. package/Marketplace/{chunk-DE6KXPBU.js → chunk-TZO7ICWB.js} +1 -1
  55. package/Marketplace/{chunk-NV3T3OZB.js → chunk-VJLQRARA.js} +1 -1
  56. package/Marketplace/{chunk-FDGOGKXD.js → chunk-VLWVI7LT.js} +1 -1
  57. package/Marketplace/{chunk-OI7LGMDP.js → chunk-WAE5XPQ6.js} +1 -1
  58. package/Marketplace/{chunk-LWR5YJ24.js → chunk-WGNBD2TG.js} +1 -1
  59. package/Marketplace/{chunk-353KSOKY.js → chunk-WL3GCHJ5.js} +1 -1
  60. package/Marketplace/{chunk-HQTUUTDT.js → chunk-WT7HH4UV.js} +1 -1
  61. package/Marketplace/{chunk-7AS2YI3I.js → chunk-X6OLODND.js} +1 -1
  62. package/Marketplace/{chunk-2QO2D23V.js → chunk-XG47KOUR.js} +1 -1
  63. package/Marketplace/{chunk-TEEFXPWJ.js → chunk-XNEL4SD6.js} +1 -1
  64. package/Marketplace/{chunk-6FFJWFMY.js → chunk-Y4RCGXQK.js} +1 -1
  65. package/Marketplace/index.html +2 -2
  66. package/Marketplace/{main-KZQ55EQA.js → main-MTBOIFWC.js} +1 -1
  67. package/package.json +1 -1
  68. package/Marketplace/chunk-LZR6F2JE.js +0 -1
  69. package/Marketplace/chunk-VMRMDMBE.js +0 -1
  70. /package/Marketplace/{chunk-IFHFFP4S.js → chunk-4YO3BZ5L.js} +0 -0
  71. /package/Marketplace/{chunk-2XMJ7C47.js → chunk-7G5B67SI.js} +0 -0
  72. /package/Marketplace/{chunk-TZ6CWMER.js → chunk-DILTMQOY.js} +0 -0
  73. /package/Marketplace/{chunk-J3NU4TSW.js → chunk-HPDCVTZM.js} +0 -0
  74. /package/Marketplace/{chunk-GAMNBDJD.js → chunk-SZQIM5RM.js} +0 -0
  75. /package/Marketplace/{polyfills-OSLX3UYW.js → polyfills-WRDNL3NI.js} +0 -0
  76. /package/Marketplace/{styles-LDNPEPLO.css → styles-JRURH5LL.css} +0 -0
@@ -1 +1 @@
1
- import{a as me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-CA4NYL7C.js";import{b as T}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-Q4Y764AE.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-QJKKB3RG.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-RHM4GQMX.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-R3VPTXDH.js";import{a as pe,b as se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-OI7LGMDP.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-DE2BZXNA.js";import{e as ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-BBX2DZWF.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-6FFJWFMY.js";import{a as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-2QO2D23V.js";import{v as D,w as le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-YZHBBFDR.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-32YQ5ZBK.js";import{u as ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-UUMW24BF.js";import{c as h}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-GAMNBDJD.js";import{$ as Q,$b as Z,Ab as x,Bb as w,Ea as l,Fa as y,Fc as re,Hc as ne,Jc as oe,Na as s,P as U,Qa as z,Ta as u,W as $,Xb as Y,Ya as o,Yb as _,Za as a,_ as G,_a as g,ac as F,ba as V,bb as H,cc as ee,da as v,dc as te,ea as J,gb as d,ha as K,ib as C,lb as j,ob as f,pb as R,qb as q,ub as W,ya as k,zb as X}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-LWR5YJ24.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-J3NU4TSW.js";var de=(()=>{let r=class r{constructor(){this.reportTabs=[{Title:"1 - New Order",Url:"/menu/report/order/sync-order"},{Title:"2 - Ready to Ship",Url:"/menu/report/order/invoice"},{Title:"3 - Shipped",Url:"/menu/report/order/delivery"},{Title:"4 - Completed",Url:"/menu/report/order/payment"},{Title:"All",Url:"/menu/report/order/all"}]}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=v({type:r,selectors:[["app-order"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,i){t&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),g(3,"nav-tab",2),a()()(),g(4,"router-outlet")),t&2&&(l(3),s("Tabs",i.reportTabs))},dependencies:[pe,re],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]});let n=r;return n})();var S=class{};var P=(()=>{let r=class r{constructor(e){this.http=e}GetLoader(){return this.http.post("/api/Report/GetLoader",{})}GetSyncOrder(e){return new Promise((t,i)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(m=>{t(m)})})}GetSyncInvoice(e){return new Promise((t,i)=>{this.http.post("/api/Report/Invoice",JSON.stringify(e)).subscribe(m=>{t(m)})})}GetSyncDelivery(e){return new Promise((t,i)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(m=>{t(m)})})}GetSyncPayment(e){return new Promise((t,i)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(m=>{t(m)})})}getAllReport(e){return this.http.post("/api/Report/all",JSON.stringify(e))}};r.\u0275fac=function(t){return new(t||r)(V(ie))},r.\u0275prov=G({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var E=function(n){return n[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.CONFLICT=409]="CONFLICT",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n}(E||{});function Ce(n,r){if(n&1&&(o(0,"th",9)(1,"div",10)(2,"h4"),f(3),a(),o(4,"small",11),f(5),a()()()),n&2){let p=r.$implicit,e=C();l(3),R(p),l(1),z(e.getTextBgColor(p)),l(1),R(e.getHeaderStatusDesc(p))}}var ve=()=>["/menu/log/order"],Te=(n,r,p,e,t)=>({responseCode:n,From:r,to:p,actionType:e,ChannelID:t});function Se(n,r){if(n&1&&(o(0,"td",14)(1,"a",15),f(2),a()()),n&2){let p=r.$implicit,e=C().$implicit,t=C();l(1),s("routerLink",W(3,ve))("queryParams",X(4,Te,p.Key,t.fromQueryParam,t.toQueryParam,t.type,e.ChannelID)),l(1),q(" ",p.Value," ")}}function _e(n,r){if(n&1&&(o(0,"tr")(1,"td")(2,"a",12),g(3,"img",13),a()(),o(4,"td")(5,"div")(6,"a",12),f(7),a()(),o(8,"div"),f(9),a()(),u(10,Se,3,10,"td",8),a()),n&2){let p=r.$implicit,e=C();l(2),j("href",p.Url,k),l(1),s("src",e.getChannelLogo(p.Type),k),l(3),j("href",p.Url,k),l(1),R(p.Name),l(2),R(p.Url),l(1),s("ngForOf",p.list)}}function Fe(n,r){if(n&1&&(o(0,"td",14)(1,"div",16),f(2),x(3,"number"),a()()),n&2){let p=r.$implicit;l(2),R(w(3,1,p.total))}}var b=(()=>{let r=class r{constructor(){this.type=null,this.headerStatus=E,this.listCalculationStatusCode=[]}set from(e){e&&(this.fromQueryParam=new Date(e).toJSON().toString())}set to(e){e&&(this.toQueryParam=new Date(e).toJSON().toString())}ngOnChanges(e){e.result&&this.calculateStatusCode()}getHeaderStatusDesc(e){let t=null;switch(e){case E.BAD_REQUEST:t="BAD REQUEST";break;case E.CONFLICT:t="CONFLICT";break;case E.INTERNAL_SERVER_ERROR:t="INTERNAL SERVER ERROR";break;case E.NOT_FOUND:t="NOT FOUND";break;default:t="OK";break}return t}getTextBgColor(e){let t=null;switch(e){case E.OK:t="bg-success";break;case E.INTERNAL_SERVER_ERROR:t="bg-danger";break;default:t="bg-warning";break}return t}getChannelLogo(e){return h.getChannelLogoByTypeId(e)}calculateStatusCode(){if(this.listCalculationStatusCode=[],this.result){let e,t;this.concatStatusCode().forEach(i=>{e=this.listCalculationStatusCode.findIndex(m=>m.status==i.Key),t=e!==-1,t?this.listCalculationStatusCode[e].total+=i.Value:this.listCalculationStatusCode=[...this.listCalculationStatusCode,{status:i.Key,total:i.Value}]})}}concatStatusCode(){return this.result.map(e=>e.list).reduce((e,t)=>[...e,...t])}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=v({type:r,selectors:[["app-table-report"]],inputs:{header:"header",result:"result",from:"from",to:"to",type:"type"},features:[K],decls:15,vars:3,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],["class","text-start","style","width: 10%;",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],["colspan","2"],[1,"text-center","h3","fw-bold"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(t,i){t&1&&(o(0,"table",0)(1,"thead",1)(2,"tr"),g(3,"th",2),o(4,"th",3),f(5,"Channel"),a(),u(6,Ce,6,4,"th",4),a()(),o(7,"tbody"),u(8,_e,11,6,"tr",5),a(),o(9,"tfoot")(10,"tr")(11,"td",6)(12,"div",7),f(13,"Total"),a()(),u(14,Fe,4,3,"td",8),a()()()),t&2&&(l(6),s("ngForOf",i.header),l(2),s("ngForOf",i.result),l(6),s("ngForOf",i.listCalculationStatusCode))},dependencies:[Y,ne,ee],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]});let n=r;return n})();function De(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),g(2,"app-table-report",9),a()()),n&2){let p=C();l(2),s("result",p.result)("header",p.header)("from",p.filter.From)("to",p.filter.To)("type",0)}}var ce=(()=>{let r=class r{constructor(e,t){this.http=e,this.datePipe=t,this.filter=new S,this.pageTitle="New Order";let i=new Date;this.maxDate=i,this.minDate=h.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=h.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(t){return new(t||r)(y(P),y(F))},r.\u0275cmp=v({type:r,selectors:[["app-sales-order"]],decls:11,vars:5,consts:[[3,"headerTitle","hideSearchBox","onSubmit"],["container","",2,"width","250px"],[1,"filterDate"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(o(0,"mainpanel",0),d("onSubmit",function(){return i.getChannelLogs()}),o(1,"filters")(2,"div",1)(3,"div",2)(4,"h6"),f(5,"From/To"),a(),o(6,"datepicker",3),d("dateChange",function(c){return i.filter.From=c}),a(),o(7,"datepicker",4),d("dateChange",function(c){return i.filter.To=c}),a()()()(),o(8,"content")(9,"div",5),u(10,De,3,5,"div",6),a()()()),t&2&&(s("headerTitle",i.pageTitle)("hideSearchBox",!0),l(6),s("date",i.filter.From),l(1),s("date",i.filter.To),l(3),s("ngIf",i.result))},dependencies:[_,D,T,b]});let n=r;return n})();function Pe(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),g(2,"app-table-report",9),a()()),n&2){let p=C();l(2),s("result",p.result)("header",p.header)("from",p.filter.From)("to",p.filter.To)("type",1)}}var fe=(()=>{let r=class r{constructor(e,t){this.http=e,this.datePipe=t,this.filter=new S,this.PageTitle="Ready to Ship";let i=new Date;this.maxDate=i,this.minDate=h.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=h.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(t){return new(t||r)(y(P),y(F))},r.\u0275cmp=v({type:r,selectors:[["app-invoice"]],decls:11,vars:5,consts:[[3,"headerTitle","hideSearchBox","onSubmit"],["container","",2,"width","250px"],[1,"filterDate"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(o(0,"mainpanel",0),d("onSubmit",function(){return i.onFilter()}),o(1,"filters")(2,"div",1)(3,"div",2)(4,"h6"),f(5,"From/To"),a(),o(6,"datepicker",3),d("dateChange",function(c){return i.filter.From=c}),a(),o(7,"datepicker",4),d("dateChange",function(c){return i.filter.To=c}),a()()()(),o(8,"content")(9,"div",5),u(10,Pe,3,5,"div",6),a()()()),t&2&&(s("headerTitle",i.PageTitle)("hideSearchBox",!0),l(6),s("date",i.filter.From),l(1),s("date",i.filter.To),l(3),s("ngIf",i.result))},dependencies:[_,D,T,b]});let n=r;return n})();function be(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),g(2,"app-table-report",9),a()()),n&2){let p=C();l(2),s("result",p.result)("header",p.header)("from",p.filter.From)("to",p.filter.To)("type",3)}}var he=(()=>{let r=class r{constructor(e,t){this.http=e,this.datePipe=t,this.filter=new S;let i=new Date;this.maxDate=i,this.minDate=h.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=h.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(t){return new(t||r)(y(P),y(F))},r.\u0275cmp=v({type:r,selectors:[["app-delivery"]],decls:11,vars:5,consts:[[3,"headerTitle","hideSearchBox","onSubmit"],["container","",2,"width","250px"],[1,"filterDate"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(o(0,"mainpanel",0),d("onSubmit",function(){return i.onFilter()}),o(1,"filters")(2,"div",1)(3,"div",2)(4,"h6"),f(5,"From/To"),a(),o(6,"datepicker",3),d("dateChange",function(c){return i.filter.From=c}),a(),o(7,"datepicker",4),d("dateChange",function(c){return i.filter.To=c}),a()()()(),o(8,"content")(9,"div",5),u(10,be,3,5,"div",6),a()()()),t&2&&(s("headerTitle",i.PageTitle)("hideSearchBox",!0),l(6),s("date",i.filter.From),l(1),s("date",i.filter.To),l(3),s("ngIf",i.result))},dependencies:[_,D,T,b]});let n=r;return n})();function Ee(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),g(2,"app-table-report",9),a()()),n&2){let p=C();l(2),s("result",p.result)("header",p.header)("from",p.filter.From)("to",p.filter.To)("type",4)}}var ue=(()=>{let r=class r{constructor(e,t){this.http=e,this.datePipe=t,this.filter=new S,this.PageTitle="Completed";let i=new Date;this.minDate=h.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=h.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(t){return new(t||r)(y(P),y(F))},r.\u0275cmp=v({type:r,selectors:[["app-payment"]],decls:11,vars:5,consts:[[3,"headerTitle","hideSearchBox","onSubmit"],["container","",2,"width","250px"],[1,"filterDate"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(o(0,"mainpanel",0),d("onSubmit",function(){return i.onFilter()}),o(1,"filters")(2,"div",1)(3,"div",2)(4,"h6"),f(5,"From/To"),a(),o(6,"datepicker",3),d("dateChange",function(c){return i.filter.From=c}),a(),o(7,"datepicker",4),d("dateChange",function(c){return i.filter.To=c}),a()()()(),o(8,"content")(9,"div",5),u(10,Ee,3,5,"div",6),a()()()),t&2&&(s("headerTitle",i.PageTitle)("hideSearchBox",!0),l(6),s("date",i.filter.From),l(1),s("date",i.filter.To),l(3),s("ngIf",i.result))},dependencies:[_,D,T,b]});let n=r;return n})();function Ie(n,r){n&1&&H(0)}function Re(n,r){if(n&1&&(o(0,"div",8)(1,"div",9),g(2,"app-table-report",10),a()()),n&2){let p=r.ngIf,e=C();l(2),s("result",p.Body)("header",p.Header)("from",e.filter==null?null:e.filter.From)("to",e.filter==null?null:e.filter.To)}}var ge=(()=>{let r=class r{constructor(e,t){this.reportOrderService=e,this.datePipe=t,this.filter=new S}ngOnInit(){this.initFilter(),this.initLoader()}initFilter(){let e=new Date;this.minDate=h.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}updatePageTitle(){let e=h.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`All (${e==null?"":t+"-"} ${i})`}initLoader(){this.pageLoader$=this.reportOrderService.GetLoader().pipe($(e=>{this.filter=e,this.updatePageTitle(),this.initData()}))}initData(){this.reportData$=this.reportOrderService.getAllReport(this.filter).pipe(U())}onFilter(){this.updatePageTitle(),this.initData()}};r.\u0275fac=function(t){return new(t||r)(y(P),y(F))},r.\u0275cmp=v({type:r,selectors:[["app-all"]],decls:15,vars:10,consts:[[3,"headerTitle","hideSearchBox","onSubmit"],["container","",2,"width","250px"],[1,"filterDate"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid"],[4,"ngIf"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to"]],template:function(t,i){t&1&&(o(0,"mainpanel",0),d("onSubmit",function(){return i.onFilter()}),o(1,"filters")(2,"div",1)(3,"div",2)(4,"div")(5,"h6"),f(6,"From/To"),a(),o(7,"datepicker",3),d("dateChange",function(c){return i.filter.From=c}),a(),o(8,"datepicker",4),d("dateChange",function(c){return i.filter.To=c}),a()()()()(),o(9,"content")(10,"div",5),u(11,Ie,1,0,"ng-container",6),x(12,"async"),u(13,Re,3,4,"div",7),x(14,"async"),a()()()),t&2&&(s("headerTitle",i.pageTitle)("hideSearchBox",!0),l(7),s("date",i.filter.From),l(1),s("date",i.filter.To),l(3),s("ngIf",w(12,6,i.pageLoader$)),l(2),s("ngIf",w(14,8,i.reportData$)))},dependencies:[_,D,T,b,Z]});let n=r;return n})();var Oe=[{path:"",component:de,children:[{path:"",redirectTo:"sync-order",pathMatch:"full"},{path:"sync-order",component:ce,canActivate:[O],data:{title:"Sync Order"}},{path:"invoice",component:fe,canActivate:[O],data:{title:"Sync Invoice"}},{path:"delivery",component:he,canActivate:[O],data:{title:"Sync Delivery"}},{path:"payment",component:ue,canActivate:[O],data:{title:"Sync Payment"}},{path:"all",component:ge,canActivate:[O],data:{title:"All Report"}}]}],gt=(()=>{let r=class r{};r.\u0275fac=function(t){return new(t||r)},r.\u0275mod=J({type:r}),r.\u0275inj=Q({imports:[te,se,ae,le,me,T,oe.forChild(Oe)]});let n=r;return n})();export{gt as OrderModule};
1
+ import{a as me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-PASXSTSS.js";import{b as T}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-JDAC3DI7.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-KHQYY4CP.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-HO6I7ZN6.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-LUN7S6P4.js";import{a as pe,b as se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WAE5XPQ6.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-EIQQEQMI.js";import{e as ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-DANZQU6U.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-Y4RCGXQK.js";import{a as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-XG47KOUR.js";import{v as D,w as le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-EGVKBYT5.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-CNK2ETMZ.js";import{u as ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-OGA3XTQE.js";import{c as h}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-SZQIM5RM.js";import{$ as Q,$b as Z,Ab as x,Bb as w,Ea as l,Fa as y,Fc as re,Hc as ne,Jc as oe,Na as s,P as U,Qa as z,Ta as u,W as $,Xb as Y,Ya as o,Yb as _,Za as a,_ as G,_a as g,ac as F,ba as V,bb as H,cc as ee,da as v,dc as te,ea as J,gb as d,ha as K,ib as C,lb as j,ob as f,pb as R,qb as q,ub as W,ya as k,zb as X}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WGNBD2TG.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-HPDCVTZM.js";var de=(()=>{let r=class r{constructor(){this.reportTabs=[{Title:"1 - New Order",Url:"/menu/report/order/sync-order"},{Title:"2 - Ready to Ship",Url:"/menu/report/order/invoice"},{Title:"3 - Shipped",Url:"/menu/report/order/delivery"},{Title:"4 - Completed",Url:"/menu/report/order/payment"},{Title:"All",Url:"/menu/report/order/all"}]}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=v({type:r,selectors:[["app-order"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,i){t&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),g(3,"nav-tab",2),a()()(),g(4,"router-outlet")),t&2&&(l(3),s("Tabs",i.reportTabs))},dependencies:[pe,re],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]});let n=r;return n})();var S=class{};var P=(()=>{let r=class r{constructor(e){this.http=e}GetLoader(){return this.http.post("/api/Report/GetLoader",{})}GetSyncOrder(e){return new Promise((t,i)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(m=>{t(m)})})}GetSyncInvoice(e){return new Promise((t,i)=>{this.http.post("/api/Report/Invoice",JSON.stringify(e)).subscribe(m=>{t(m)})})}GetSyncDelivery(e){return new Promise((t,i)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(m=>{t(m)})})}GetSyncPayment(e){return new Promise((t,i)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(m=>{t(m)})})}getAllReport(e){return this.http.post("/api/Report/all",JSON.stringify(e))}};r.\u0275fac=function(t){return new(t||r)(V(ie))},r.\u0275prov=G({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var E=function(n){return n[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.CONFLICT=409]="CONFLICT",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n}(E||{});function Ce(n,r){if(n&1&&(o(0,"th",9)(1,"div",10)(2,"h4"),f(3),a(),o(4,"small",11),f(5),a()()()),n&2){let p=r.$implicit,e=C();l(3),R(p),l(1),z(e.getTextBgColor(p)),l(1),R(e.getHeaderStatusDesc(p))}}var ve=()=>["/menu/log/order"],Te=(n,r,p,e,t)=>({responseCode:n,From:r,to:p,actionType:e,ChannelID:t});function Se(n,r){if(n&1&&(o(0,"td",14)(1,"a",15),f(2),a()()),n&2){let p=r.$implicit,e=C().$implicit,t=C();l(1),s("routerLink",W(3,ve))("queryParams",X(4,Te,p.Key,t.fromQueryParam,t.toQueryParam,t.type,e.ChannelID)),l(1),q(" ",p.Value," ")}}function _e(n,r){if(n&1&&(o(0,"tr")(1,"td")(2,"a",12),g(3,"img",13),a()(),o(4,"td")(5,"div")(6,"a",12),f(7),a()(),o(8,"div"),f(9),a()(),u(10,Se,3,10,"td",8),a()),n&2){let p=r.$implicit,e=C();l(2),j("href",p.Url,k),l(1),s("src",e.getChannelLogo(p.Type),k),l(3),j("href",p.Url,k),l(1),R(p.Name),l(2),R(p.Url),l(1),s("ngForOf",p.list)}}function Fe(n,r){if(n&1&&(o(0,"td",14)(1,"div",16),f(2),x(3,"number"),a()()),n&2){let p=r.$implicit;l(2),R(w(3,1,p.total))}}var b=(()=>{let r=class r{constructor(){this.type=null,this.headerStatus=E,this.listCalculationStatusCode=[]}set from(e){e&&(this.fromQueryParam=new Date(e).toJSON().toString())}set to(e){e&&(this.toQueryParam=new Date(e).toJSON().toString())}ngOnChanges(e){e.result&&this.calculateStatusCode()}getHeaderStatusDesc(e){let t=null;switch(e){case E.BAD_REQUEST:t="BAD REQUEST";break;case E.CONFLICT:t="CONFLICT";break;case E.INTERNAL_SERVER_ERROR:t="INTERNAL SERVER ERROR";break;case E.NOT_FOUND:t="NOT FOUND";break;default:t="OK";break}return t}getTextBgColor(e){let t=null;switch(e){case E.OK:t="bg-success";break;case E.INTERNAL_SERVER_ERROR:t="bg-danger";break;default:t="bg-warning";break}return t}getChannelLogo(e){return h.getChannelLogoByTypeId(e)}calculateStatusCode(){if(this.listCalculationStatusCode=[],this.result){let e,t;this.concatStatusCode().forEach(i=>{e=this.listCalculationStatusCode.findIndex(m=>m.status==i.Key),t=e!==-1,t?this.listCalculationStatusCode[e].total+=i.Value:this.listCalculationStatusCode=[...this.listCalculationStatusCode,{status:i.Key,total:i.Value}]})}}concatStatusCode(){return this.result.map(e=>e.list).reduce((e,t)=>[...e,...t])}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=v({type:r,selectors:[["app-table-report"]],inputs:{header:"header",result:"result",from:"from",to:"to",type:"type"},features:[K],decls:15,vars:3,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],["class","text-start","style","width: 10%;",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],["colspan","2"],[1,"text-center","h3","fw-bold"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(t,i){t&1&&(o(0,"table",0)(1,"thead",1)(2,"tr"),g(3,"th",2),o(4,"th",3),f(5,"Channel"),a(),u(6,Ce,6,4,"th",4),a()(),o(7,"tbody"),u(8,_e,11,6,"tr",5),a(),o(9,"tfoot")(10,"tr")(11,"td",6)(12,"div",7),f(13,"Total"),a()(),u(14,Fe,4,3,"td",8),a()()()),t&2&&(l(6),s("ngForOf",i.header),l(2),s("ngForOf",i.result),l(6),s("ngForOf",i.listCalculationStatusCode))},dependencies:[Y,ne,ee],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]});let n=r;return n})();function De(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),g(2,"app-table-report",9),a()()),n&2){let p=C();l(2),s("result",p.result)("header",p.header)("from",p.filter.From)("to",p.filter.To)("type",0)}}var ce=(()=>{let r=class r{constructor(e,t){this.http=e,this.datePipe=t,this.filter=new S,this.pageTitle="New Order";let i=new Date;this.maxDate=i,this.minDate=h.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=h.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(t){return new(t||r)(y(P),y(F))},r.\u0275cmp=v({type:r,selectors:[["app-sales-order"]],decls:11,vars:5,consts:[[3,"headerTitle","hideSearchBox","onSubmit"],["container","",2,"width","250px"],[1,"filterDate"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(o(0,"mainpanel",0),d("onSubmit",function(){return i.getChannelLogs()}),o(1,"filters")(2,"div",1)(3,"div",2)(4,"h6"),f(5,"From/To"),a(),o(6,"datepicker",3),d("dateChange",function(c){return i.filter.From=c}),a(),o(7,"datepicker",4),d("dateChange",function(c){return i.filter.To=c}),a()()()(),o(8,"content")(9,"div",5),u(10,De,3,5,"div",6),a()()()),t&2&&(s("headerTitle",i.pageTitle)("hideSearchBox",!0),l(6),s("date",i.filter.From),l(1),s("date",i.filter.To),l(3),s("ngIf",i.result))},dependencies:[_,D,T,b]});let n=r;return n})();function Pe(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),g(2,"app-table-report",9),a()()),n&2){let p=C();l(2),s("result",p.result)("header",p.header)("from",p.filter.From)("to",p.filter.To)("type",1)}}var fe=(()=>{let r=class r{constructor(e,t){this.http=e,this.datePipe=t,this.filter=new S,this.PageTitle="Ready to Ship";let i=new Date;this.maxDate=i,this.minDate=h.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=h.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(t){return new(t||r)(y(P),y(F))},r.\u0275cmp=v({type:r,selectors:[["app-invoice"]],decls:11,vars:5,consts:[[3,"headerTitle","hideSearchBox","onSubmit"],["container","",2,"width","250px"],[1,"filterDate"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(o(0,"mainpanel",0),d("onSubmit",function(){return i.onFilter()}),o(1,"filters")(2,"div",1)(3,"div",2)(4,"h6"),f(5,"From/To"),a(),o(6,"datepicker",3),d("dateChange",function(c){return i.filter.From=c}),a(),o(7,"datepicker",4),d("dateChange",function(c){return i.filter.To=c}),a()()()(),o(8,"content")(9,"div",5),u(10,Pe,3,5,"div",6),a()()()),t&2&&(s("headerTitle",i.PageTitle)("hideSearchBox",!0),l(6),s("date",i.filter.From),l(1),s("date",i.filter.To),l(3),s("ngIf",i.result))},dependencies:[_,D,T,b]});let n=r;return n})();function be(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),g(2,"app-table-report",9),a()()),n&2){let p=C();l(2),s("result",p.result)("header",p.header)("from",p.filter.From)("to",p.filter.To)("type",3)}}var he=(()=>{let r=class r{constructor(e,t){this.http=e,this.datePipe=t,this.filter=new S;let i=new Date;this.maxDate=i,this.minDate=h.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=h.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(t){return new(t||r)(y(P),y(F))},r.\u0275cmp=v({type:r,selectors:[["app-delivery"]],decls:11,vars:5,consts:[[3,"headerTitle","hideSearchBox","onSubmit"],["container","",2,"width","250px"],[1,"filterDate"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(o(0,"mainpanel",0),d("onSubmit",function(){return i.onFilter()}),o(1,"filters")(2,"div",1)(3,"div",2)(4,"h6"),f(5,"From/To"),a(),o(6,"datepicker",3),d("dateChange",function(c){return i.filter.From=c}),a(),o(7,"datepicker",4),d("dateChange",function(c){return i.filter.To=c}),a()()()(),o(8,"content")(9,"div",5),u(10,be,3,5,"div",6),a()()()),t&2&&(s("headerTitle",i.PageTitle)("hideSearchBox",!0),l(6),s("date",i.filter.From),l(1),s("date",i.filter.To),l(3),s("ngIf",i.result))},dependencies:[_,D,T,b]});let n=r;return n})();function Ee(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),g(2,"app-table-report",9),a()()),n&2){let p=C();l(2),s("result",p.result)("header",p.header)("from",p.filter.From)("to",p.filter.To)("type",4)}}var ue=(()=>{let r=class r{constructor(e,t){this.http=e,this.datePipe=t,this.filter=new S,this.PageTitle="Completed";let i=new Date;this.minDate=h.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=h.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(t){return new(t||r)(y(P),y(F))},r.\u0275cmp=v({type:r,selectors:[["app-payment"]],decls:11,vars:5,consts:[[3,"headerTitle","hideSearchBox","onSubmit"],["container","",2,"width","250px"],[1,"filterDate"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(o(0,"mainpanel",0),d("onSubmit",function(){return i.onFilter()}),o(1,"filters")(2,"div",1)(3,"div",2)(4,"h6"),f(5,"From/To"),a(),o(6,"datepicker",3),d("dateChange",function(c){return i.filter.From=c}),a(),o(7,"datepicker",4),d("dateChange",function(c){return i.filter.To=c}),a()()()(),o(8,"content")(9,"div",5),u(10,Ee,3,5,"div",6),a()()()),t&2&&(s("headerTitle",i.PageTitle)("hideSearchBox",!0),l(6),s("date",i.filter.From),l(1),s("date",i.filter.To),l(3),s("ngIf",i.result))},dependencies:[_,D,T,b]});let n=r;return n})();function Ie(n,r){n&1&&H(0)}function Re(n,r){if(n&1&&(o(0,"div",8)(1,"div",9),g(2,"app-table-report",10),a()()),n&2){let p=r.ngIf,e=C();l(2),s("result",p.Body)("header",p.Header)("from",e.filter==null?null:e.filter.From)("to",e.filter==null?null:e.filter.To)}}var ge=(()=>{let r=class r{constructor(e,t){this.reportOrderService=e,this.datePipe=t,this.filter=new S}ngOnInit(){this.initFilter(),this.initLoader()}initFilter(){let e=new Date;this.minDate=h.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}updatePageTitle(){let e=h.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`All (${e==null?"":t+"-"} ${i})`}initLoader(){this.pageLoader$=this.reportOrderService.GetLoader().pipe($(e=>{this.filter=e,this.updatePageTitle(),this.initData()}))}initData(){this.reportData$=this.reportOrderService.getAllReport(this.filter).pipe(U())}onFilter(){this.updatePageTitle(),this.initData()}};r.\u0275fac=function(t){return new(t||r)(y(P),y(F))},r.\u0275cmp=v({type:r,selectors:[["app-all"]],decls:15,vars:10,consts:[[3,"headerTitle","hideSearchBox","onSubmit"],["container","",2,"width","250px"],[1,"filterDate"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid"],[4,"ngIf"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to"]],template:function(t,i){t&1&&(o(0,"mainpanel",0),d("onSubmit",function(){return i.onFilter()}),o(1,"filters")(2,"div",1)(3,"div",2)(4,"div")(5,"h6"),f(6,"From/To"),a(),o(7,"datepicker",3),d("dateChange",function(c){return i.filter.From=c}),a(),o(8,"datepicker",4),d("dateChange",function(c){return i.filter.To=c}),a()()()()(),o(9,"content")(10,"div",5),u(11,Ie,1,0,"ng-container",6),x(12,"async"),u(13,Re,3,4,"div",7),x(14,"async"),a()()()),t&2&&(s("headerTitle",i.pageTitle)("hideSearchBox",!0),l(7),s("date",i.filter.From),l(1),s("date",i.filter.To),l(3),s("ngIf",w(12,6,i.pageLoader$)),l(2),s("ngIf",w(14,8,i.reportData$)))},dependencies:[_,D,T,b,Z]});let n=r;return n})();var Oe=[{path:"",component:de,children:[{path:"",redirectTo:"sync-order",pathMatch:"full"},{path:"sync-order",component:ce,canActivate:[O],data:{title:"Sync Order"}},{path:"invoice",component:fe,canActivate:[O],data:{title:"Sync Invoice"}},{path:"delivery",component:he,canActivate:[O],data:{title:"Sync Delivery"}},{path:"payment",component:ue,canActivate:[O],data:{title:"Sync Payment"}},{path:"all",component:ge,canActivate:[O],data:{title:"All Report"}}]}],gt=(()=>{let r=class r{};r.\u0275fac=function(t){return new(t||r)},r.\u0275mod=J({type:r}),r.\u0275inj=Q({imports:[te,se,ae,le,me,T,oe.forChild(Oe)]});let n=r;return n})();export{gt as OrderModule};
@@ -1,2 +1,2 @@
1
- import{a as ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-353KSOKY.js";import{b as D,c as E}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-CFL3VDAM.js";import{a as x,b as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-QV22VQ5Q.js";import{b as ce,e as pe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-BBX2DZWF.js";import{c as fe,d as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-55NPYZ64.js";import{t as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-YZHBBFDR.js";import{b as me,h as F,k as U,u as he}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-UUMW24BF.js";import{b as m,c as B}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-GAMNBDJD.js";import{$ as ie,$a as I,Ab as q,B as Z,Bb as J,Ea as s,Fa as f,H as ee,Ia as H,J as te,Jb as L,Ma as G,Na as d,Oa as oe,S as K,Ta as u,U as P,Vb as re,Xb as v,Ya as l,Yb as A,Za as r,_ as ne,_a as C,ab as M,ba as W,c as w,cb as Y,cc as se,da as _,dc as de,ea as ae,gb as g,ia as V,ib as h,ja as N,n as Q,nb as $,ob as c,pb as y,q as X,qb as T,vb as le,ya as S}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-LWR5YJ24.js";var b=function(i){return i.Tokopedia="https://seller.tokopedia.com",i.Shoope="https://seller.shopee.co.id",i.Tiktok="https://seller-id.tiktok.com",i.WooCommerce="https://woocommerce.dealpos.app",i.Lazada="https://sellercenter.lazada.co.id",i}(b||{});function Me(i,n){if(i&1&&(I(0),l(1,"tr")(2,"td",11),c(3),r(),l(4,"td",11),c(5),r(),l(6,"td",12)(7,"p",13),c(8,"Product Not in Channel!"),r()()(),M()),i&2){let a=h().$implicit;s(3),T(" ",a==null?null:a.Model,""),s(2),T(" ",a==null?null:a.Code,"")}}function Te(i,n){if(i&1&&(l(0,"td",11),c(1),r()),i&2){let a=h(3).$implicit;G("rowspan",a.Channel.length),s(1),T(" ",a==null?null:a.Model,"")}}function ve(i,n){if(i&1&&(l(0,"td",11),c(1),r()),i&2){let a=h(3).$implicit;G("rowspan",a.Channel.length),s(1),T(" ",a==null?null:a.Code,"")}}var xe=i=>({"is-disabled":i});function Oe(i,n){if(i&1&&(l(0,"tr"),u(1,Te,2,2,"td",14)(2,ve,2,2,"td",14),l(3,"td",11)(4,"div",15)(5,"a",16),C(6,"img",17),r(),l(7,"div",18),c(8),r()()(),l(9,"td",11),c(10),q(11,"number"),r(),l(12,"td",19),c(13),q(14,"number"),r(),l(15,"td",19)(16,"a",20),C(17,"i",21),l(18,"span",22),c(19,"Edit"),r()()()()),i&2){let a=n.$implicit,t=n.index,e=h(3);s(1),d("ngIf",t==0),s(1),d("ngIf",t==0),s(3),d("href",a.Url,S)("title",a.Title),s(1),d("src",e.getChannelLogo(a.TypeID),S),s(1),d("matTooltip",(a==null||a.Name==null?null:a.Name.length)>55?a==null?null:a.Name:""),s(1),T(" ",a.Name," "),s(2),y(J(11,12,a.Price)),s(3),y(J(14,14,a.Inventory)),s(3),d("href",e.getHyperlinkSellerCenter(a),S)("ngClass",le(16,xe,a.TypeID==e.channelType.KalCare))("matTooltip",a.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function De(i,n){if(i&1&&u(0,Oe,20,18,"tr",8),i&2){let a=h().$implicit;d("ngForOf",a==null?null:a.Channel)}}function Ee(i,n){if(i&1&&(I(0),u(1,Me,9,2,"ng-container",9)(2,De,1,1,"ng-template",null,10,L),M()),i&2){let a=n.$implicit,t=$(3);s(1),d("ngIf",!a.Channel||a.Channel.length<1)("ngIfElse",t)}}var Re=(()=>{let n=class n{constructor(t,e){this.data=t,this.dialogRef=e,this.channelType=m,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new D,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return B.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let e="javascript:void(0)";switch(t.TypeID){case m.ShopeeV2:e=`${b.Shoope}/portal/product/${t.ChannelItemID}`;break;case m.Tiktok:e=`${b.Tiktok}/product/edit/${t.ChannelItemID}`;break;case m.Tokopedia:e=`${b.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case m.WooCommerce:e=`${b.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case m.Lazada:e=`${b.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return e}};n.\u0275fac=function(e){return new(e||n)(f(O),f(x))},n.\u0275cmp=_({type:n,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(l(0,"modal-material",0),g("onCancel",function(){return o.dialogRef.close()}),l(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),c(6," VARIANT "),l(7,"sup"),C(8,"i",5),r()(),l(9,"th",4),c(10,"SKU"),r(),l(11,"th",4),c(12," PRODUCT "),l(13,"sup"),C(14,"i",6),r()(),l(15,"th",4),c(16,"PRICE"),r(),l(17,"th",7),c(18,"INVENTORY"),r(),C(19,"th",4),r()(),l(20,"tbody"),u(21,Ee,4,2,"ng-container",8),r()()()()),e&2&&(d("config",o.modalConfig),s(21),d("ngForOf",o.variants))},dependencies:[re,v,A,j,E,se],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let i=n;return i})();var R=class{constructor(){this._input$=new w,this._destroy$=new w,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(ee(200),te(),X(n=>(n&&(n=n.toLowerCase()),this.filterData(n))),Z(n=>n!==void 0),P(this._destroy$)).subscribe(n=>{this._dataBuffer=n.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(n){let a=-1,t;return this._data.filter(o=>(t=JSON.stringify(o).toLowerCase(),a=t.indexOf(n),a!==-1||n==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(n){this._data=n||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(n,a){if(B.IsNotEmpty(n)){let t=this._data.filter(e=>e[a].toString().toLowerCase().indexOf(n)!==-1);this._dataBuffer=t.slice(0,this._bufferSize)}}set bufferSize(n){this._bufferSize=n}onScrollToEnd(){this.fetchMore()}fetchMore(){let n=this._dataBuffer.length,a=this._data.slice(n,this._bufferSize+n);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(a)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var be=(()=>{let n=class n{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.width="100%",this.clearable=!0,this.disabled=!1,this.ngSelectInfiniteScroll=new R,this.selectedChange=new H,this.selectedLabel=new H}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=_({type:n,selectors:[["ng-select-infinite"]],inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel"},decls:1,vars:12,consts:[[3,"disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable","appendTo","clear","scrollToEnd","change"]],template:function(e,o){e&1&&(l(0,"ng-select",0),g("clear",function(){return o.ngSelectInfiniteScroll.onClear()})("scrollToEnd",function(){return o.ngSelectInfiniteScroll.onScrollToEnd()})("change",function(k){return o.onSelectChange(k)}),r()),e&2&&(oe("width",o.width),d("disabled",o.disabled)("virtualScroll",!0)("typeahead",o.ngSelectInfiniteScroll.input$)("items",o.ngSelectInfiniteScroll.bufferData)("bindLabel",o.bindLabel)("bindValue",o.bindValue)("placeholder",o.placeholder)("ngModel",o.selected)("clearable",o.clearable)("appendTo",o.parent))},dependencies:[fe,F,U]});let i=n;return i})(),ot=(()=>{let n=class n{};n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=ae({type:n}),n.\u0275inj=ie({imports:[de,ge,he]});let i=n;return i})();var Se=(()=>{let n=class n{constructor(t,e){this.LocalData=t,this.httpService=e}getCategoriesByTypeId(t,e){return this.LocalData.getCategoriesByChannelType(t).pipe(K(o=>o!=null?Q(o):this._getCategoriesByTypeID(t,e)))}_getCategoriesByTypeID(t,e){let o={TypeID:t,ID:e};return this.httpService.post("/api/Channel/getCategoriesByTypeID",o).pipe(K(p=>this.LocalData.saveCategoriesByChannelType(p,t)))}};n.\u0275fac=function(e){return new(e||n)(W(ue),W(pe))},n.\u0275prov=ne({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();function Ve(i,n){if(i&1){let a=Y();I(0),l(1,"ng-select-infinite",16),g("selectedChange",function(e){V(a);let o=h().index,p=h();return N(p.onSelectCategory(e,o))}),r(),M()}if(i&2){let a=h().$implicit;s(1),d("items",a.Categories)("clearable",!1)}}function Ne(i,n){if(i&1&&(l(0,"div",17),C(1,"input",18),r()),i&2){let a=h().$implicit,t=h();s(1),d("placeholder",t.getChannelCategory(a.TypeID))}}function $e(i,n){if(i&1){let a=Y();I(0),l(1,"tr")(2,"td",9)(3,"input",10),g("ngModelChange",function(e){let p=V(a).$implicit;return N(p.Selected=e)})("ngModelChange",function(){V(a);let e=h();return N(e.onSelectChannel())}),r()(),l(4,"td")(5,"div",11),C(6,"img",12),l(7,"span",13),c(8),r()()(),l(9,"td"),u(10,Ve,2,2,"ng-container",14)(11,Ne,2,1,"ng-template",null,15,L),r()(),M()}if(i&2){let a=n.$implicit,t=$(12);s(3),d("ngModel",a.Selected),s(3),d("src",a.Img,S),s(2),y(a.Name),s(2),d("ngIf",a.Categories.length>0)("ngIfElse",t)}}var ft=(()=>{let n=class n{constructor(t,e,o,p){this.data=t,this.channelService=e,this.dialogRef=o,this.toastrService=p,this.channelOptions=[],this.uploadResponse=[],this.channelType=m,this.enableBtnOk=!1,this.destroy$=new w,this.uploadResponse=[],this.channels=this.data.channels}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new D,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe(P(this.destroy$)).subscribe(o=>{this.setCategoriesChannelOption(e.channelType,o)})})}setCategoriesChannelOption(t,e){this.channelOptions=this.channelOptions.map(o=>(o.TypeID==t&&(o.Categories=e),o))}initChannelOptions(){this.channelOptions=this.channels.map(t=>({Name:t.Name,Img:t.Img,ID:t.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(t.TypeID),TypeID:t.TypeID,Categories:[]}))}initDefaultChannelCategoryId(t){let e=0;switch(t){case m.Lazada:e=6509;break}return e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,o,p)=>p.findIndex(k=>e.channelType==k.channelType)==o).filter(e=>e.channelType==m.Tokopedia)}onSelectCategory(t,e){this.channelOptions[e].CategoryID=t,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(t){this.channelOptions=this.channelOptions.map(e=>(e.Selected=t,e)),this.enableBtnOk=t}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return this.channelOptions.findIndex(t=>t.Selected)!==-1}onClose(){this.dialogRef.close("CANCEL")}onSave(){if(!this.validateSelectedCategory()){this.toastrService.warning("Category is required","Warning!");return}let t=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(t)}validateSelectedCategory(){return this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==m.Tokopedia).findIndex(e=>e.CategoryID==0)==-1}getChannelCategory(t){let e;switch(t){case m.ShopeeV2:e="Aksesoris Fashion";break;case m.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case m.WooCommerce:e="New Product";break;case m.Lazada:e="Fashion Accessories / Women Accessories / Others";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};n.\u0275fac=function(e){return new(e||n)(f(O),f(Se),f(x),f(ce))},n.\u0275cmp=_({type:n,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"d-flex","align-items-center"],["alt","",1,"channel-logo-size",3,"src"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["EMPTY",""],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"items","clearable","selectedChange"],["matTooltip","Product Category is Harcoded, Please Change Product Category in Seller Center","matTooltipPosition","above","matTooltipClass","custom-width-tooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,o){e&1&&(l(0,"modal-material",0),g("onOk",function(){return o.onSave()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",1)(2,"table",2)(3,"thead")(4,"tr")(5,"th",3)(6,"input",4),g("change",function(k){return o.onSelectAllChannel(k.target.checked)}),r()(),l(7,"th",5)(8,"span",6),c(9,"CHANNEL"),r()(),l(10,"th",7)(11,"span",6),c(12,"CATEGORY"),r()()()(),l(13,"tbody"),u(14,$e,13,5,"ng-container",8),r()()()()),e&2&&(d("dynamicValidated",o.enableBtnOk)("config",o.modalConfig),s(14),d("ngForOf",o.channelOptions))},dependencies:[v,A,me,F,U,j,E,be],styles:[`input[type=checkbox]{width:15px;height:15px}img.channel-logo-size{width:24px;height:24px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}
1
+ import{a as ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WL3GCHJ5.js";import{b as D,c as E}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-45BCCCD5.js";import{a as x,b as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-GPNYP6CI.js";import{b as ce,e as pe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-DANZQU6U.js";import{c as fe,d as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-LHYUY4OW.js";import{t as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-EGVKBYT5.js";import{b as me,h as F,k as U,u as he}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-OGA3XTQE.js";import{b as m,c as B}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-SZQIM5RM.js";import{$ as ie,$a as I,Ab as q,B as Z,Bb as J,Ea as s,Fa as f,H as ee,Ia as H,J as te,Jb as L,Ma as G,Na as d,Oa as oe,S as K,Ta as u,U as P,Vb as re,Xb as v,Ya as l,Yb as A,Za as r,_ as ne,_a as C,ab as M,ba as W,c as w,cb as Y,cc as se,da as _,dc as de,ea as ae,gb as g,ia as V,ib as h,ja as N,n as Q,nb as $,ob as c,pb as y,q as X,qb as T,vb as le,ya as S}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WGNBD2TG.js";var b=function(i){return i.Tokopedia="https://seller.tokopedia.com",i.Shoope="https://seller.shopee.co.id",i.Tiktok="https://seller-id.tiktok.com",i.WooCommerce="https://woocommerce.dealpos.app",i.Lazada="https://sellercenter.lazada.co.id",i}(b||{});function Me(i,n){if(i&1&&(I(0),l(1,"tr")(2,"td",11),c(3),r(),l(4,"td",11),c(5),r(),l(6,"td",12)(7,"p",13),c(8,"Product Not in Channel!"),r()()(),M()),i&2){let a=h().$implicit;s(3),T(" ",a==null?null:a.Model,""),s(2),T(" ",a==null?null:a.Code,"")}}function Te(i,n){if(i&1&&(l(0,"td",11),c(1),r()),i&2){let a=h(3).$implicit;G("rowspan",a.Channel.length),s(1),T(" ",a==null?null:a.Model,"")}}function ve(i,n){if(i&1&&(l(0,"td",11),c(1),r()),i&2){let a=h(3).$implicit;G("rowspan",a.Channel.length),s(1),T(" ",a==null?null:a.Code,"")}}var xe=i=>({"is-disabled":i});function Oe(i,n){if(i&1&&(l(0,"tr"),u(1,Te,2,2,"td",14)(2,ve,2,2,"td",14),l(3,"td",11)(4,"div",15)(5,"a",16),C(6,"img",17),r(),l(7,"div",18),c(8),r()()(),l(9,"td",11),c(10),q(11,"number"),r(),l(12,"td",19),c(13),q(14,"number"),r(),l(15,"td",19)(16,"a",20),C(17,"i",21),l(18,"span",22),c(19,"Edit"),r()()()()),i&2){let a=n.$implicit,t=n.index,e=h(3);s(1),d("ngIf",t==0),s(1),d("ngIf",t==0),s(3),d("href",a.Url,S)("title",a.Title),s(1),d("src",e.getChannelLogo(a.TypeID),S),s(1),d("matTooltip",(a==null||a.Name==null?null:a.Name.length)>55?a==null?null:a.Name:""),s(1),T(" ",a.Name," "),s(2),y(J(11,12,a.Price)),s(3),y(J(14,14,a.Inventory)),s(3),d("href",e.getHyperlinkSellerCenter(a),S)("ngClass",le(16,xe,a.TypeID==e.channelType.KalCare))("matTooltip",a.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function De(i,n){if(i&1&&u(0,Oe,20,18,"tr",8),i&2){let a=h().$implicit;d("ngForOf",a==null?null:a.Channel)}}function Ee(i,n){if(i&1&&(I(0),u(1,Me,9,2,"ng-container",9)(2,De,1,1,"ng-template",null,10,L),M()),i&2){let a=n.$implicit,t=$(3);s(1),d("ngIf",!a.Channel||a.Channel.length<1)("ngIfElse",t)}}var Re=(()=>{let n=class n{constructor(t,e){this.data=t,this.dialogRef=e,this.channelType=m,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new D,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return B.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let e="javascript:void(0)";switch(t.TypeID){case m.ShopeeV2:e=`${b.Shoope}/portal/product/${t.ChannelItemID}`;break;case m.Tiktok:e=`${b.Tiktok}/product/edit/${t.ChannelItemID}`;break;case m.Tokopedia:e=`${b.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case m.WooCommerce:e=`${b.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case m.Lazada:e=`${b.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return e}};n.\u0275fac=function(e){return new(e||n)(f(O),f(x))},n.\u0275cmp=_({type:n,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(l(0,"modal-material",0),g("onCancel",function(){return o.dialogRef.close()}),l(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),c(6," VARIANT "),l(7,"sup"),C(8,"i",5),r()(),l(9,"th",4),c(10,"SKU"),r(),l(11,"th",4),c(12," PRODUCT "),l(13,"sup"),C(14,"i",6),r()(),l(15,"th",4),c(16,"PRICE"),r(),l(17,"th",7),c(18,"INVENTORY"),r(),C(19,"th",4),r()(),l(20,"tbody"),u(21,Ee,4,2,"ng-container",8),r()()()()),e&2&&(d("config",o.modalConfig),s(21),d("ngForOf",o.variants))},dependencies:[re,v,A,j,E,se],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let i=n;return i})();var R=class{constructor(){this._input$=new w,this._destroy$=new w,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(ee(200),te(),X(n=>(n&&(n=n.toLowerCase()),this.filterData(n))),Z(n=>n!==void 0),P(this._destroy$)).subscribe(n=>{this._dataBuffer=n.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(n){let a=-1,t;return this._data.filter(o=>(t=JSON.stringify(o).toLowerCase(),a=t.indexOf(n),a!==-1||n==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(n){this._data=n||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(n,a){if(B.IsNotEmpty(n)){let t=this._data.filter(e=>e[a].toString().toLowerCase().indexOf(n)!==-1);this._dataBuffer=t.slice(0,this._bufferSize)}}set bufferSize(n){this._bufferSize=n}onScrollToEnd(){this.fetchMore()}fetchMore(){let n=this._dataBuffer.length,a=this._data.slice(n,this._bufferSize+n);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(a)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var be=(()=>{let n=class n{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.width="100%",this.clearable=!0,this.disabled=!1,this.ngSelectInfiniteScroll=new R,this.selectedChange=new H,this.selectedLabel=new H}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=_({type:n,selectors:[["ng-select-infinite"]],inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel"},decls:1,vars:12,consts:[[3,"disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable","appendTo","clear","scrollToEnd","change"]],template:function(e,o){e&1&&(l(0,"ng-select",0),g("clear",function(){return o.ngSelectInfiniteScroll.onClear()})("scrollToEnd",function(){return o.ngSelectInfiniteScroll.onScrollToEnd()})("change",function(k){return o.onSelectChange(k)}),r()),e&2&&(oe("width",o.width),d("disabled",o.disabled)("virtualScroll",!0)("typeahead",o.ngSelectInfiniteScroll.input$)("items",o.ngSelectInfiniteScroll.bufferData)("bindLabel",o.bindLabel)("bindValue",o.bindValue)("placeholder",o.placeholder)("ngModel",o.selected)("clearable",o.clearable)("appendTo",o.parent))},dependencies:[fe,F,U]});let i=n;return i})(),ot=(()=>{let n=class n{};n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=ae({type:n}),n.\u0275inj=ie({imports:[de,ge,he]});let i=n;return i})();var Se=(()=>{let n=class n{constructor(t,e){this.LocalData=t,this.httpService=e}getCategoriesByTypeId(t,e){return this.LocalData.getCategoriesByChannelType(t).pipe(K(o=>o!=null?Q(o):this._getCategoriesByTypeID(t,e)))}_getCategoriesByTypeID(t,e){let o={TypeID:t,ID:e};return this.httpService.post("/api/Channel/getCategoriesByTypeID",o).pipe(K(p=>this.LocalData.saveCategoriesByChannelType(p,t)))}};n.\u0275fac=function(e){return new(e||n)(W(ue),W(pe))},n.\u0275prov=ne({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();function Ve(i,n){if(i&1){let a=Y();I(0),l(1,"ng-select-infinite",16),g("selectedChange",function(e){V(a);let o=h().index,p=h();return N(p.onSelectCategory(e,o))}),r(),M()}if(i&2){let a=h().$implicit;s(1),d("items",a.Categories)("clearable",!1)}}function Ne(i,n){if(i&1&&(l(0,"div",17),C(1,"input",18),r()),i&2){let a=h().$implicit,t=h();s(1),d("placeholder",t.getChannelCategory(a.TypeID))}}function $e(i,n){if(i&1){let a=Y();I(0),l(1,"tr")(2,"td",9)(3,"input",10),g("ngModelChange",function(e){let p=V(a).$implicit;return N(p.Selected=e)})("ngModelChange",function(){V(a);let e=h();return N(e.onSelectChannel())}),r()(),l(4,"td")(5,"div",11),C(6,"img",12),l(7,"span",13),c(8),r()()(),l(9,"td"),u(10,Ve,2,2,"ng-container",14)(11,Ne,2,1,"ng-template",null,15,L),r()(),M()}if(i&2){let a=n.$implicit,t=$(12);s(3),d("ngModel",a.Selected),s(3),d("src",a.Img,S),s(2),y(a.Name),s(2),d("ngIf",a.Categories.length>0)("ngIfElse",t)}}var ft=(()=>{let n=class n{constructor(t,e,o,p){this.data=t,this.channelService=e,this.dialogRef=o,this.toastrService=p,this.channelOptions=[],this.uploadResponse=[],this.channelType=m,this.enableBtnOk=!1,this.destroy$=new w,this.uploadResponse=[],this.channels=this.data.channels}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new D,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe(P(this.destroy$)).subscribe(o=>{this.setCategoriesChannelOption(e.channelType,o)})})}setCategoriesChannelOption(t,e){this.channelOptions=this.channelOptions.map(o=>(o.TypeID==t&&(o.Categories=e),o))}initChannelOptions(){this.channelOptions=this.channels.map(t=>({Name:t.Name,Img:t.Img,ID:t.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(t.TypeID),TypeID:t.TypeID,Categories:[]}))}initDefaultChannelCategoryId(t){let e=0;switch(t){case m.Lazada:e=6509;break}return e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,o,p)=>p.findIndex(k=>e.channelType==k.channelType)==o).filter(e=>e.channelType==m.Tokopedia)}onSelectCategory(t,e){this.channelOptions[e].CategoryID=t,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(t){this.channelOptions=this.channelOptions.map(e=>(e.Selected=t,e)),this.enableBtnOk=t}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return this.channelOptions.findIndex(t=>t.Selected)!==-1}onClose(){this.dialogRef.close("CANCEL")}onSave(){if(!this.validateSelectedCategory()){this.toastrService.warning("Category is required","Warning!");return}let t=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(t)}validateSelectedCategory(){return this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==m.Tokopedia).findIndex(e=>e.CategoryID==0)==-1}getChannelCategory(t){let e;switch(t){case m.ShopeeV2:e="Aksesoris Fashion";break;case m.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case m.WooCommerce:e="New Product";break;case m.Lazada:e="Fashion Accessories / Women Accessories / Others";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};n.\u0275fac=function(e){return new(e||n)(f(O),f(Se),f(x),f(ce))},n.\u0275cmp=_({type:n,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"d-flex","align-items-center"],["alt","",1,"channel-logo-size",3,"src"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["EMPTY",""],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"items","clearable","selectedChange"],["matTooltip","Product Category is Harcoded, Please Change Product Category in Seller Center","matTooltipPosition","above","matTooltipClass","custom-width-tooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,o){e&1&&(l(0,"modal-material",0),g("onOk",function(){return o.onSave()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",1)(2,"table",2)(3,"thead")(4,"tr")(5,"th",3)(6,"input",4),g("change",function(k){return o.onSelectAllChannel(k.target.checked)}),r()(),l(7,"th",5)(8,"span",6),c(9,"CHANNEL"),r()(),l(10,"th",7)(11,"span",6),c(12,"CATEGORY"),r()()()(),l(13,"tbody"),u(14,$e,13,5,"ng-container",8),r()()()()),e&2&&(d("dynamicValidated",o.enableBtnOk)("config",o.modalConfig),s(14),d("ngForOf",o.channelOptions))},dependencies:[v,A,me,F,U,j,E,be],styles:[`input[type=checkbox]{width:15px;height:15px}img.channel-logo-size{width:24px;height:24px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}
2
2
  `],encapsulation:2});let i=n;return i})();function Le(i,n){if(i&1&&(l(0,"tr")(1,"td"),c(2),r(),l(3,"td"),c(4),r()()),i&2){let a=n.$implicit;s(2),y(a==null?null:a.Name),s(2),y(a==null?null:a.ChannelVariationSKU)}}var _t=(()=>{let n=class n{constructor(t,e){this.data=t,this.dialogRef=e}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new D,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}};n.\u0275fac=function(e){return new(e||n)(f(O),f(x))},n.\u0275cmp=_({type:n,selectors:[["app-modal-variants"]],decls:11,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"]],template:function(e,o){e&1&&(l(0,"modal-material",0),g("onCancel",function(){return o.dialogRef.close()}),l(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th"),c(6,"Variant"),r(),l(7,"th"),c(8,"SKU"),r()()(),l(9,"tbody"),u(10,Le,5,2,"tr",4),r()()()()),e&2&&(d("config",o.modalConfig),s(10),d("ngForOf",o.data.variants))},dependencies:[v,E],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]});let i=n;return i})();export{Re as a,ot as b,ft as c,_t as d};
@@ -1 +1 @@
1
- import{Gc as s,_ as n,ba as a}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-LWR5YJ24.js";var p=(()=>{let e=class e{constructor(r){this.router=r}canActivate(r,o){let i=JSON.parse(window.localStorage.getItem("user")),c=new Date;if(i!=null){let l=new Date(i.Token.expiredAt);return c<l?!0:(this.router.navigate([""]),!1)}else return this.router.navigate([""]),!1}};e.\u0275fac=function(o){return new(o||e)(a(s))},e.\u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();export{p as a};
1
+ import{Gc as s,_ as n,ba as a}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WGNBD2TG.js";var p=(()=>{let e=class e{constructor(r){this.router=r}canActivate(r,o){let i=JSON.parse(window.localStorage.getItem("user")),c=new Date;if(i!=null){let l=new Date(i.Token.expiredAt);return c<l?!0:(this.router.navigate([""]),!1)}else return this.router.navigate([""]),!1}};e.\u0275fac=function(o){return new(o||e)(a(s))},e.\u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();export{p as a};
@@ -1,2 +1,2 @@
1
- import{a as P,b as Ie,c as ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-RS52HOKA.js";import{a as be,b as Me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-2Y47HNW5.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-I2FTGSXA.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-2XMJ7C47.js";import{a as we,b as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-5YX57TZJ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-TZ6CWMER.js";import{a as ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-MYMGFQII.js";import{a as ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-QSO3ASFL.js";import{a as te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-NV3T3OZB.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-CFL3VDAM.js";import{c as X}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-QV22VQ5Q.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-R3VPTXDH.js";import{a as Se,b as ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-OI7LGMDP.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-DE2BZXNA.js";import{b as k,e as Q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-BBX2DZWF.js";import{a as ye}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-IJ3WNDAP.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-HDWZXE6G.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-G6DYB24N.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-6FFJWFMY.js";import{d as Ce}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-55NPYZ64.js";import{a as le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-2QO2D23V.js";import{t as Z,u as fe,v as q,w as xe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-YZHBBFDR.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-32YQ5ZBK.js";import{b as ue,c as K,h as J,k as Y,m as W,u as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-UUMW24BF.js";import{c as w}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-GAMNBDJD.js";import{$ as O,$a as T,$b as j,Ab as f,B as V,Bb as x,Cb as re,Ea as s,Fa as y,Fc as he,Jb as $,Jc as G,Na as c,Ta as C,Vb as me,W as N,Xb as de,Ya as r,Yb as U,Za as l,_ as se,_a as S,ab as M,ac as _e,ba as ce,cb as v,cc as H,da as F,dc as z,ea as L,gb as g,ia as _,ib as p,ja as h,lb as pe,nb as R,ob as m,pb as E,qb as b,vb as oe,ya as A}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-LWR5YJ24.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-J3NU4TSW.js";var De=(()=>{let o=class o{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=F({type:o,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),S(3,"nav-tab",2),l()()(),S(4,"router-outlet")),n&2&&(s(3),c("Tabs",a.inventoryTabs))},dependencies:[he,Se]});let i=o;return i})();function Ue(i,o){if(i&1){let e=v();r(0,"button",22),g("click",function(){_(e);let n=p(3);return h(n.openScanDialog())}),S(1,"i",23),m(2," Scan Channel "),l()}}function je(i,o){if(i&1){let e=v();r(0,"button",24),g("click",function(){_(e);let n=p().ngIf,a=p(2);return h(a.onUpdateItems(n))}),S(1,"i",25),m(2," Update "),l()}}function He(i,o){if(i&1&&(r(0,"actions")(1,"div",3)(2,"div"),C(3,Ue,3,0,"button",20)(4,je,3,0,"button",21),l()()()),i&2){let e=o.ngIf,t=p(2);s(3),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function ze(i,o){if(i&1){let e=v();r(0,"app-table",26),g("onToggle",function(n){_(e);let a=p(2);return h(a.onShowDifferenceStock(n))})("onSubmit",function(n){let d=_(e).ngIf,u=p(2);return h(u.updateStockByVariant(n,d))}),l()}if(i&2){let e=o.ngIf,t=p(2);c("data",e)("channel",t.channelOptions)("showProductToggle",!0)("filter",t.searchFilter)}}function Qe(i,o){if(i&1){let e=v();r(0,"span",27),g("click",function(){_(e);let n=p(2);return h(n.getRowCount())}),r(1,"i",28),m(2,"?"),l()()}}function Ge(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=o.ngIf;s(1),E(x(2,1,e))}}function Ke(i,o){if(i&1){let e=v();r(0,"a",29),g("click",function(){_(e);let n=p(2);return h(n.nextPage())}),S(1,"i",30),m(2," Next"),l()}}function Je(i,o){if(i&1){let e=v();r(0,"a",31),g("click",function(){_(e);let n=p(2);return h(n.getAllData())}),S(1,"i",32),m(2," Last"),l()}}function Ye(i,o){if(i&1){let e=v();r(0,"mainpanel",1),g("onSubmit",function(n){_(e);let a=p();return h(a.onSearch(n))}),C(1,He,5,2,"actions",2),f(2,"async"),r(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"label",5),m(8,"PageNumber"),l(),r(9,"input",6),g("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.PageNumber=n)}),l()(),r(10,"div")(11,"label",7),m(12,"Page Size"),l(),r(13,"input",8),g("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.RowCount=n)}),l()()()()(),r(14,"content")(15,"div",9)(16,"div",10)(17,"div",11),C(18,ze,1,4,"app-table",12),f(19,"async"),T(20),r(21,"div",13)(22,"div",14)(23,"div",15),m(24),f(25,"number"),f(26,"async"),C(27,Qe,3,0,"span",16)(28,Ge,3,3,"span",2),f(29,"async"),m(30),l()(),r(31,"div",17),C(32,Ke,3,0,"a",18)(33,Je,3,0,"a",19),l()(),M(),l()()()()()}if(i&2){let e=p(),t;c("pageData",e.pageData)("hideSearchBox",!1)("textButton","Search"),s(1),c("ngIf",x(2,13,e.paginationService.data$)),s(8),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(5),c("ngIf",x(19,15,e.paginationService.data$)),s(6),b(" Showing 1 - ",x(25,17,(t=x(26,19,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",x(29,21,!e.paginationService.hideCount&&e.allDataCount$)),s(2),b(" records ~ ",e.paginationService.footerPageNumber," Page "),s(2),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}var Ve=(()=>{let o=class o{constructor(t,n,a,d,u){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=d,this.productService=u,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(N(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,filterModel:P.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,n){let a=this.productService.selectedVariantProduct(t);if(a.length>0){let u=a.map(I=>({ID:I.ID,Code:I.Code,Inventory:I.Inventory}));var d=n.filter(I=>I.selected).map(I=>I.ID);let D={ListChannelID:d,List:u};this.http.post("/api/Inventory/UpdateChannel",D).subscribe(I=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+D.List.length+" variants in "+D.ListChannelID.length+" channels","Success")})}}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(ee,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(V(a=>w.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=w.GuidEMpty})}updateStockByVariant(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(d=>{let u=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+u.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=P.DIFFERENCE:this.searchFilter.filterModel=P.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let n=this.productService.selectedVariantProduct(t);this.dialog.open(be,{data:{selectedItems:n,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe(V(a=>w.IsNotEmpty(a))).subscribe(a=>{this.updateStock(t,a)})}getRowCount(){this.paginationService.hideCount=!1;let t={text:this.searchFilter.text};this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,t)}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(Q),y(k),y(X),y(ne),y(te))},o.\u0275cmp=F({type:o,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit"],[4,"ngIf"],[1,"d-flex"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(C(0,Ye,34,23,"mainpanel",0),f(1,"async")),n&2&&c("ngIf",x(1,1,a.loader$))},dependencies:[U,K,W,J,Y,q,ie,Z,j,H],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();var ae=(()=>{let o=class o{constructor(t){this.toastrService=t}showToastrUpdateInventory(t,n){let a=t.length>0,d=n.length>0;if(!d&&a&&this.toastrService.success(`${this.generateSuccessMessage(t.length)}`,"Success",{enableHtml:!0}),d&&a){let u=`<li>${this.generateSuccessMessage(t.length)}</li>`,D=this.generateErrorMessage(n),I=`<ol>${u} ${D}</ol>`;this.toastrService.warning(I,"Warning",{enableHtml:!0})}if(d&&!a){let u=`<ol>${this.generateErrorMessage(n)}</ol>`;this.toastrService.error(u,"Error",{enableHtml:!0})}}generateSuccessMessage(t){return`<span class="fw-bold">Successfully</span> updated ${t} variants in 1 channels`}generateErrorMessage(t=[]){let n="";return t.forEach((a,d)=>{n+=`<li><span class="fw-bold">Error</span> Updating stock for [${a.Name}] - <b>${a.Message}</b></li>`}),n}};o.\u0275fac=function(n){return new(n||o)(ce(k))},o.\u0275prov=se({token:o,factory:o.\u0275fac});let i=o;return i})();function Ze(i,o){if(i&1){let e=v();r(0,"button",36),g("click",function(){_(e);let n=p(2).ngIf,a=p();return h(a.openScanDialog(n))}),S(1,"i",37),m(2," Scan Channel "),l()}}function qe(i,o){if(i&1){let e=v();r(0,"button",38),g("click",function(){_(e);let n=p().ngIf,a=p(2);return h(a.updateStock(n))}),S(1,"i",39),m(2," Update"),l()}}function Xe(i,o){if(i&1&&(r(0,"div"),C(1,Ze,3,0,"button",34)(2,qe,3,0,"button",35),l()),i&2){let e=o.ngIf,t=p(2);s(1),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function et(i,o){i&1&&(r(0,"div",40)(1,"span"),m(2," showing only different stock, please press next to populate more data "),l()())}function tt(i,o){if(i&1){let e=v();r(0,"th")(1,"input",41),g("ngModelChange",function(n){_(e);let a=p(2);return h(a.checkboxState=n)})("ngModelChange",function(){let a=_(e).ngIf,d=p(2);return h(d.onCheckboxStateChange(a))}),l()()}if(i&2){let e=p(2);s(1),c("ngModel",e.checkboxState)}}function nt(i,o){i&1&&(T(0),r(1,"th",42),m(2," Reserved "),l(),M())}function it(i,o){if(i&1){let e=v();r(0,"input",67),g("ngModelChange",function(n){_(e);let a=p(3).$implicit;return h(a.selected=n)})("ngModelChange",function(){_(e);let n=p(3).$implicit,a=p(2);return h(a.onCheckboxStateProduct(n))}),l()}if(i&2){let e=p(3).$implicit;c("ngModel",e.selected)}}function at(i,o){if(i&1){let e=v();r(0,"img",68),g("click",function(n){_(e);let a=p(3).$implicit,d=p(2);return h(d.onZoomImage(n,a==null?null:a.ImageUrl))}),l()}if(i&2){let e=p(3).$implicit;pe("src",e==null?null:e.ThumbnailUrl,A)}}function ot(i,o){i&1&&S(0,"img",69)}function rt(i,o){if(i&1&&(T(0),r(1,"td",58)(2,"div",59),C(3,it,1,1,"input",60)(4,at,1,1,"img",61)(5,ot,1,0,"ng-template",null,62,$),l()(),r(7,"td",63)(8,"span",64),m(9),l(),S(10,"br"),r(11,"div",65),S(12,"i",66),r(13,"small"),m(14),l()()(),M()),i&2){let e=R(6),t=p().$implicit,n=p().$implicit;s(1),c("rowSpan",n==null?null:n.Variants.length),s(2),c("ngIf",(t==null?null:t.Inventory)>=0||n.Variants.length>1),s(1),c("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",e),s(3),c("rowSpan",n==null?null:n.Variants.length),s(2),E(n==null?null:n.Name),s(5),b("(",n==null?null:n.Category,")")}}function lt(i,o){if(i&1){let e=v();T(0),r(1,"input",41),g("ngModelChange",function(n){_(e);let a=p(3).$implicit;return h(a.selected=n)}),l(),M()}if(i&2){let e=p(3).$implicit;s(1),c("ngModel",e.selected)}}function st(i,o){if(i&1&&(T(0),C(1,lt,2,1,"ng-container",3),M()),i&2){let e=p(2).$implicit;s(1),c("ngIf",(e==null?null:e.Inventory)<=1e5)}}function ct(i,o){if(i&1){let e=v();r(0,"input",41),g("ngModelChange",function(n){_(e);let a=p(3).$implicit;return h(a.selected=n)}),l()}if(i&2){let e=p(3).$implicit;c("ngModel",e.selected)}}function pt(i,o){if(i&1&&C(0,ct,1,1,"input",71),i&2){let e=p(2).$implicit;c("ngIf",(e==null?null:e.Inventory)>=0)}}function mt(i,o){if(i&1&&(T(0),C(1,st,2,1,"ng-container",53)(2,pt,1,1,"ng-template",null,70,$),M()),i&2){let e=R(3),t=p().$implicit;s(1),c("ngIf",(t==null?null:t.Channel[0].TypeID)==1)("ngIfElse",e)}}function dt(i,o){if(i&1&&(r(0,"span")(1,"span",72),m(2),f(3,"number"),l(),m(4," => "),r(5,"span",73),m(6),f(7,"number"),l()()),i&2){let e=p().$implicit;s(2),b(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),E(x(7,4,e==null?null:e.Inventory))}}function _t(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=p().$implicit;s(1),b(" ",x(2,1,e==null?null:e.Inventory)," ")}}var ht=i=>({"bg-gradient-warning":i});function ut(i,o){if(i&1){let e=v();r(0,"td",74)(1,"span",75),g("click",function(){_(e);let n=p().$implicit,a=p(),d=a.$implicit,u=a.ngForOf,D=p(2);return h(D.openTableDialog(d,n,u))}),m(2),f(3,"number"),l()()}if(i&2){let e=p().$implicit;c("ngClass",oe(4,ht,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(2),b(" ",x(3,2,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function gt(i,o){if(i&1&&(T(0),r(1,"span",77),m(2),f(3,"number"),l(),M()),i&2){let e=p(2).$implicit;s(2),b(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function Ct(i,o){i&1&&m(0," - ")}function ft(i,o){if(i&1&&(T(0),r(1,"td",51),C(2,gt,4,3,"ng-container",53)(3,Ct,1,0,"ng-template",null,76,$),l(),M()),i&2){let e=R(4),t=p().$implicit;s(2),c("ngIf",t==null||t.Channel[0]==null?null:t.Channel[0].InventoryReserved)("ngIfElse",e)}}function xt(i,o){i&1&&(T(0),m(1," - "),M())}function St(i,o){if(i&1&&(r(0,"span",78),f(1,"date"),m(2),f(3,"date"),l()),i&2){let e=p().$implicit;c("matTooltip",re(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),b(" ",re(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}var vt=i=>({"text-decoration-line-through":i});function yt(i,o){if(i&1){let e=v();r(0,"tr"),C(1,rt,15,7,"ng-container",3),r(2,"td",43),m(3),l(),r(4,"td",44)(5,"div",45)(6,"span",46),m(7),l(),r(8,"span",47)(9,"a",48),S(10,"i",49),l()()()(),r(11,"td",50),C(12,mt,4,2,"ng-container",3),l(),r(13,"td",51),C(14,dt,8,6,"span",3)(15,_t,3,3,"span",3),l(),C(16,ut,4,6,"td",52)(17,ft,5,2,"ng-container",3),r(18,"td",26),C(19,xt,2,0,"ng-container",53)(20,St,4,8,"ng-template",null,54,$),l(),r(22,"td")(23,"div",12)(24,"div",55)(25,"a",48),S(26,"i",49),l(),m(27," \xA0\xA0 "),r(28,"span",56),g("click",function(){let a=_(e).$implicit,d=p(3);return h(d.refreshInventory(a==null||a.Channel[0]==null?null:a.Channel[0].ChannelItemID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelVariationID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelID,a==null?null:a.ID))}),S(29,"i",57),l()()()()()}if(i&2){let e=o.$implicit,t=o.index,n=R(21),a=p(3);s(1),c("ngIf",t==0),s(2),E(e==null?null:e.Model),s(1),c("matTooltip",e.Discontinued?a.discontinuedVariantMsg:""),s(2),c("ngClass",oe(14,vt,e.Discontinued)),s(1),E(e==null?null:e.Code),s(2),c("href","https://"+a.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),A),s(3),c("ngIf",!e.Discontinued),s(2),c("ngIf",(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",(e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",e==null?null:e.Channel),s(1),c("ngIf",a.isShowReservedColumn),s(2),c("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==a.minDate)("ngIfElse",n),s(6),c("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,A)}}function bt(i,o){if(i&1&&(r(0,"tbody"),C(1,yt,30,16,"tr",28),l()),i&2){let e=o.$implicit;s(1),c("ngForOf",e.Variants)}}function It(i,o){if(i&1){let e=v();r(0,"span",79),g("click",function(){_(e);let n=p(2);return h(n.getRowCount())}),r(1,"i",80),m(2,"?"),l()()}}function wt(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=o.ngIf;s(1),E(x(2,1,e==null?null:e.Total))}}function Tt(i,o){if(i&1){let e=v();r(0,"a",84),g("click",function(){_(e);let n=p(3);return h(n.onNextPage())}),S(1,"i",85),m(2," Next"),l()}}function Mt(i,o){if(i&1){let e=v();r(0,"a",86),g("click",function(){_(e);let n=p(3);return h(n.onLastPage())}),S(1,"i",87),m(2," Last"),l()}}function Dt(i,o){if(i&1&&(r(0,"div",81),C(1,Tt,3,0,"a",82)(2,Mt,3,0,"a",83),l()),i&2){let e=p(2);s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}function Et(i,o){if(i&1){let e=v();r(0,"mainpanel",1),g("onSubmit",function(n){_(e);let a=p();return h(a.onSearch(n))}),r(1,"actions")(2,"div",2),C(3,Xe,3,2,"div",3),f(4,"async"),l()(),r(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),m(10,"PageNumber"),l(),r(11,"input",6),g("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.PageNumber=n)}),l()(),r(12,"div")(13,"label",7),m(14,"Page Size"),l(),r(15,"input",8),g("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.RowCount=n)}),l()(),r(16,"div")(17,"h6"),m(18,"Quantity From - To"),l(),r(19,"input",9),g("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.QuantityFrom=n)}),l(),m(20," - "),r(21,"input",10),g("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.QuantityTo=n)}),l()()()()(),r(22,"content")(23,"div",11)(24,"div",12)(25,"div",13),C(26,et,3,0,"div",14),r(27,"table",15)(28,"thead",16)(29,"tr")(30,"th",17),m(31,"Product "),S(32,"br"),r(33,"mat-slide-toggle",18),g("toggleChange",function(){_(e);let n=p();return n.showDifferenceStock=!n.showDifferenceStock,h(n.onShowDifferenceStock())}),r(34,"small",19),m(35,"FILTER DIFFERENT INVENTORY"),l()()(),r(36,"th",20),m(37,"Variant"),l(),r(38,"th",21),m(39,"SKU"),l(),C(40,tt,2,1,"th",3),f(41,"async"),r(42,"th",22),m(43,"POS"),l(),r(44,"th",23)(45,"div",24),g("click",function(){_(e);let n=p();return h(n.onChangeChannel())}),S(46,"img",25),m(47),l()(),C(48,nt,3,0,"ng-container",3),r(49,"th",26),m(50,"Last Sync"),l(),S(51,"th",27),l()(),C(52,bt,2,1,"tbody",28),f(53,"async"),l(),r(54,"div",29)(55,"div",30)(56,"div",31),m(57),f(58,"number"),f(59,"async"),C(60,It,3,0,"span",32)(61,wt,3,3,"span",3),f(62,"async"),m(63),l()(),C(64,Dt,3,2,"div",33),f(65,"async"),l()()()()()()}if(i&2){let e=p(),t,n;c("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),c("ngIf",x(4,20,e.paginationService.data$)),s(8),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(4),c("ngModel",e.searchFilter.QuantityFrom),s(2),c("ngModel",e.searchFilter.QuantityTo),s(5),c("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),c("ngIf",x(41,22,e.paginationService.data$)),s(5),c("matTooltip","Change "+(e.selectedChannel==null?null:e.selectedChannel.Name)),s(1),c("src",e.selectedChannel.logo,A),s(1),b(" ",e.selectedChannel!=null&&e.selectedChannel.Name?e.selectedChannel==null?null:e.selectedChannel.Name:"Choose Channel ..."," "),s(1),c("ngIf",e.isShowReservedColumn),s(4),c("ngForOf",x(53,24,e.products$)),s(5),b(" Showing 1 - ",x(58,26,(t=x(59,28,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",x(62,30,!e.paginationService.hideCount&&e.rowCount$)),s(2),b(" records ~ ",e.paginationService.footerPageNumber," Page "),s(1),c("ngIf",((n=x(65,32,e.paginationService.data$))==null?null:n.length)>0)}}var Pe=(()=>{let o=class o{constructor(t,n,a,d,u,D,I){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=d,this.productService=u,this.biggerPictureService=D,this.inventoryService=I,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=w.MinDate,this.isShowReservedColumn=!0,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.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]},this.hostName=u.getHostName()}ngOnInit(){this.initPageLoader(),this.products$=this.paginationService.data$.pipe(N(t=>{this.checkShowReservedColumn(t)}))}checkShowReservedColumn(t){let n=0,a;t.forEach(d=>{a=d.Variants.find(u=>w.IsNotEmpty(u?.Channel[0]?.InventoryReserved)),a&&(n+=1)}),this.isShowReservedColumn=n>0}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe(N(t=>{if(this.channelOptions=t.Options.Channel,this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.initSelectedChannel(),this.paginationService.reloadPagination(this.searchFilter),!t.Filter.IsMarketplaceAppActive){let n=`Automatic inventory sync disabled.
1
+ import{a as P,b as Ie,c as ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-IKBHUDBF.js";import{a as be,b as Me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-EBAG6BIX.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-6H6S75XM.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-7G5B67SI.js";import{a as we,b as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-DH7A3MMY.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-DILTMQOY.js";import{a as ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-4FIQ677Y.js";import{a as ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-APSB364O.js";import{a as te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-VJLQRARA.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-45BCCCD5.js";import{c as X}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-GPNYP6CI.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-LUN7S6P4.js";import{a as Se,b as ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WAE5XPQ6.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-EIQQEQMI.js";import{b as k,e as Q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-DANZQU6U.js";import{a as ye}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-4ZIFLVEZ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-LC5NUVMA.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-FJAD3LVA.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-Y4RCGXQK.js";import{d as Ce}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-LHYUY4OW.js";import{a as le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-XG47KOUR.js";import{t as Z,u as fe,v as q,w as xe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-EGVKBYT5.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-CNK2ETMZ.js";import{b as ue,c as K,h as J,k as Y,m as W,u as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-OGA3XTQE.js";import{c as w}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-SZQIM5RM.js";import{$ as O,$a as T,$b as j,Ab as f,B as V,Bb as x,Cb as re,Ea as s,Fa as y,Fc as he,Jb as $,Jc as G,Na as c,Ta as C,Vb as me,W as N,Xb as de,Ya as r,Yb as U,Za as l,_ as se,_a as S,ab as M,ac as _e,ba as ce,cb as v,cc as H,da as F,dc as z,ea as L,gb as g,ia as _,ib as p,ja as h,lb as pe,nb as R,ob as m,pb as E,qb as b,vb as oe,ya as A}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WGNBD2TG.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-HPDCVTZM.js";var De=(()=>{let o=class o{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=F({type:o,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),S(3,"nav-tab",2),l()()(),S(4,"router-outlet")),n&2&&(s(3),c("Tabs",a.inventoryTabs))},dependencies:[he,Se]});let i=o;return i})();function Ue(i,o){if(i&1){let e=v();r(0,"button",22),g("click",function(){_(e);let n=p(3);return h(n.openScanDialog())}),S(1,"i",23),m(2," Scan Channel "),l()}}function je(i,o){if(i&1){let e=v();r(0,"button",24),g("click",function(){_(e);let n=p().ngIf,a=p(2);return h(a.onUpdateItems(n))}),S(1,"i",25),m(2," Update "),l()}}function He(i,o){if(i&1&&(r(0,"actions")(1,"div",3)(2,"div"),C(3,Ue,3,0,"button",20)(4,je,3,0,"button",21),l()()()),i&2){let e=o.ngIf,t=p(2);s(3),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function ze(i,o){if(i&1){let e=v();r(0,"app-table",26),g("onToggle",function(n){_(e);let a=p(2);return h(a.onShowDifferenceStock(n))})("onSubmit",function(n){let d=_(e).ngIf,u=p(2);return h(u.updateStockByVariant(n,d))}),l()}if(i&2){let e=o.ngIf,t=p(2);c("data",e)("channel",t.channelOptions)("showProductToggle",!0)("filter",t.searchFilter)}}function Qe(i,o){if(i&1){let e=v();r(0,"span",27),g("click",function(){_(e);let n=p(2);return h(n.getRowCount())}),r(1,"i",28),m(2,"?"),l()()}}function Ge(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=o.ngIf;s(1),E(x(2,1,e))}}function Ke(i,o){if(i&1){let e=v();r(0,"a",29),g("click",function(){_(e);let n=p(2);return h(n.nextPage())}),S(1,"i",30),m(2," Next"),l()}}function Je(i,o){if(i&1){let e=v();r(0,"a",31),g("click",function(){_(e);let n=p(2);return h(n.getAllData())}),S(1,"i",32),m(2," Last"),l()}}function Ye(i,o){if(i&1){let e=v();r(0,"mainpanel",1),g("onSubmit",function(n){_(e);let a=p();return h(a.onSearch(n))}),C(1,He,5,2,"actions",2),f(2,"async"),r(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"label",5),m(8,"PageNumber"),l(),r(9,"input",6),g("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.PageNumber=n)}),l()(),r(10,"div")(11,"label",7),m(12,"Page Size"),l(),r(13,"input",8),g("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.RowCount=n)}),l()()()()(),r(14,"content")(15,"div",9)(16,"div",10)(17,"div",11),C(18,ze,1,4,"app-table",12),f(19,"async"),T(20),r(21,"div",13)(22,"div",14)(23,"div",15),m(24),f(25,"number"),f(26,"async"),C(27,Qe,3,0,"span",16)(28,Ge,3,3,"span",2),f(29,"async"),m(30),l()(),r(31,"div",17),C(32,Ke,3,0,"a",18)(33,Je,3,0,"a",19),l()(),M(),l()()()()()}if(i&2){let e=p(),t;c("pageData",e.pageData)("hideSearchBox",!1)("textButton","Search"),s(1),c("ngIf",x(2,13,e.paginationService.data$)),s(8),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(5),c("ngIf",x(19,15,e.paginationService.data$)),s(6),b(" Showing 1 - ",x(25,17,(t=x(26,19,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",x(29,21,!e.paginationService.hideCount&&e.allDataCount$)),s(2),b(" records ~ ",e.paginationService.footerPageNumber," Page "),s(2),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}var Ve=(()=>{let o=class o{constructor(t,n,a,d,u){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=d,this.productService=u,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(N(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,filterModel:P.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,n){let a=this.productService.selectedVariantProduct(t);if(a.length>0){let u=a.map(I=>({ID:I.ID,Code:I.Code,Inventory:I.Inventory}));var d=n.filter(I=>I.selected).map(I=>I.ID);let D={ListChannelID:d,List:u};this.http.post("/api/Inventory/UpdateChannel",D).subscribe(I=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+D.List.length+" variants in "+D.ListChannelID.length+" channels","Success")})}}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(ee,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(V(a=>w.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=w.GuidEMpty})}updateStockByVariant(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(d=>{let u=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+u.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=P.DIFFERENCE:this.searchFilter.filterModel=P.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let n=this.productService.selectedVariantProduct(t);this.dialog.open(be,{data:{selectedItems:n,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe(V(a=>w.IsNotEmpty(a))).subscribe(a=>{this.updateStock(t,a)})}getRowCount(){this.paginationService.hideCount=!1;let t={text:this.searchFilter.text};this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,t)}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(Q),y(k),y(X),y(ne),y(te))},o.\u0275cmp=F({type:o,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit"],[4,"ngIf"],[1,"d-flex"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(C(0,Ye,34,23,"mainpanel",0),f(1,"async")),n&2&&c("ngIf",x(1,1,a.loader$))},dependencies:[U,K,W,J,Y,q,ie,Z,j,H],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();var ae=(()=>{let o=class o{constructor(t){this.toastrService=t}showToastrUpdateInventory(t,n){let a=t.length>0,d=n.length>0;if(!d&&a&&this.toastrService.success(`${this.generateSuccessMessage(t.length)}`,"Success",{enableHtml:!0}),d&&a){let u=`<li>${this.generateSuccessMessage(t.length)}</li>`,D=this.generateErrorMessage(n),I=`<ol>${u} ${D}</ol>`;this.toastrService.warning(I,"Warning",{enableHtml:!0})}if(d&&!a){let u=`<ol>${this.generateErrorMessage(n)}</ol>`;this.toastrService.error(u,"Error",{enableHtml:!0})}}generateSuccessMessage(t){return`<span class="fw-bold">Successfully</span> updated ${t} variants in 1 channels`}generateErrorMessage(t=[]){let n="";return t.forEach((a,d)=>{n+=`<li><span class="fw-bold">Error</span> Updating stock for [${a.Name}] - <b>${a.Message}</b></li>`}),n}};o.\u0275fac=function(n){return new(n||o)(ce(k))},o.\u0275prov=se({token:o,factory:o.\u0275fac});let i=o;return i})();function Ze(i,o){if(i&1){let e=v();r(0,"button",36),g("click",function(){_(e);let n=p(2).ngIf,a=p();return h(a.openScanDialog(n))}),S(1,"i",37),m(2," Scan Channel "),l()}}function qe(i,o){if(i&1){let e=v();r(0,"button",38),g("click",function(){_(e);let n=p().ngIf,a=p(2);return h(a.updateStock(n))}),S(1,"i",39),m(2," Update"),l()}}function Xe(i,o){if(i&1&&(r(0,"div"),C(1,Ze,3,0,"button",34)(2,qe,3,0,"button",35),l()),i&2){let e=o.ngIf,t=p(2);s(1),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function et(i,o){i&1&&(r(0,"div",40)(1,"span"),m(2," showing only different stock, please press next to populate more data "),l()())}function tt(i,o){if(i&1){let e=v();r(0,"th")(1,"input",41),g("ngModelChange",function(n){_(e);let a=p(2);return h(a.checkboxState=n)})("ngModelChange",function(){let a=_(e).ngIf,d=p(2);return h(d.onCheckboxStateChange(a))}),l()()}if(i&2){let e=p(2);s(1),c("ngModel",e.checkboxState)}}function nt(i,o){i&1&&(T(0),r(1,"th",42),m(2," Reserved "),l(),M())}function it(i,o){if(i&1){let e=v();r(0,"input",67),g("ngModelChange",function(n){_(e);let a=p(3).$implicit;return h(a.selected=n)})("ngModelChange",function(){_(e);let n=p(3).$implicit,a=p(2);return h(a.onCheckboxStateProduct(n))}),l()}if(i&2){let e=p(3).$implicit;c("ngModel",e.selected)}}function at(i,o){if(i&1){let e=v();r(0,"img",68),g("click",function(n){_(e);let a=p(3).$implicit,d=p(2);return h(d.onZoomImage(n,a==null?null:a.ImageUrl))}),l()}if(i&2){let e=p(3).$implicit;pe("src",e==null?null:e.ThumbnailUrl,A)}}function ot(i,o){i&1&&S(0,"img",69)}function rt(i,o){if(i&1&&(T(0),r(1,"td",58)(2,"div",59),C(3,it,1,1,"input",60)(4,at,1,1,"img",61)(5,ot,1,0,"ng-template",null,62,$),l()(),r(7,"td",63)(8,"span",64),m(9),l(),S(10,"br"),r(11,"div",65),S(12,"i",66),r(13,"small"),m(14),l()()(),M()),i&2){let e=R(6),t=p().$implicit,n=p().$implicit;s(1),c("rowSpan",n==null?null:n.Variants.length),s(2),c("ngIf",(t==null?null:t.Inventory)>=0||n.Variants.length>1),s(1),c("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",e),s(3),c("rowSpan",n==null?null:n.Variants.length),s(2),E(n==null?null:n.Name),s(5),b("(",n==null?null:n.Category,")")}}function lt(i,o){if(i&1){let e=v();T(0),r(1,"input",41),g("ngModelChange",function(n){_(e);let a=p(3).$implicit;return h(a.selected=n)}),l(),M()}if(i&2){let e=p(3).$implicit;s(1),c("ngModel",e.selected)}}function st(i,o){if(i&1&&(T(0),C(1,lt,2,1,"ng-container",3),M()),i&2){let e=p(2).$implicit;s(1),c("ngIf",(e==null?null:e.Inventory)<=1e5)}}function ct(i,o){if(i&1){let e=v();r(0,"input",41),g("ngModelChange",function(n){_(e);let a=p(3).$implicit;return h(a.selected=n)}),l()}if(i&2){let e=p(3).$implicit;c("ngModel",e.selected)}}function pt(i,o){if(i&1&&C(0,ct,1,1,"input",71),i&2){let e=p(2).$implicit;c("ngIf",(e==null?null:e.Inventory)>=0)}}function mt(i,o){if(i&1&&(T(0),C(1,st,2,1,"ng-container",53)(2,pt,1,1,"ng-template",null,70,$),M()),i&2){let e=R(3),t=p().$implicit;s(1),c("ngIf",(t==null?null:t.Channel[0].TypeID)==1)("ngIfElse",e)}}function dt(i,o){if(i&1&&(r(0,"span")(1,"span",72),m(2),f(3,"number"),l(),m(4," => "),r(5,"span",73),m(6),f(7,"number"),l()()),i&2){let e=p().$implicit;s(2),b(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),E(x(7,4,e==null?null:e.Inventory))}}function _t(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=p().$implicit;s(1),b(" ",x(2,1,e==null?null:e.Inventory)," ")}}var ht=i=>({"bg-gradient-warning":i});function ut(i,o){if(i&1){let e=v();r(0,"td",74)(1,"span",75),g("click",function(){_(e);let n=p().$implicit,a=p(),d=a.$implicit,u=a.ngForOf,D=p(2);return h(D.openTableDialog(d,n,u))}),m(2),f(3,"number"),l()()}if(i&2){let e=p().$implicit;c("ngClass",oe(4,ht,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(2),b(" ",x(3,2,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function gt(i,o){if(i&1&&(T(0),r(1,"span",77),m(2),f(3,"number"),l(),M()),i&2){let e=p(2).$implicit;s(2),b(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function Ct(i,o){i&1&&m(0," - ")}function ft(i,o){if(i&1&&(T(0),r(1,"td",51),C(2,gt,4,3,"ng-container",53)(3,Ct,1,0,"ng-template",null,76,$),l(),M()),i&2){let e=R(4),t=p().$implicit;s(2),c("ngIf",t==null||t.Channel[0]==null?null:t.Channel[0].InventoryReserved)("ngIfElse",e)}}function xt(i,o){i&1&&(T(0),m(1," - "),M())}function St(i,o){if(i&1&&(r(0,"span",78),f(1,"date"),m(2),f(3,"date"),l()),i&2){let e=p().$implicit;c("matTooltip",re(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),b(" ",re(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}var vt=i=>({"text-decoration-line-through":i});function yt(i,o){if(i&1){let e=v();r(0,"tr"),C(1,rt,15,7,"ng-container",3),r(2,"td",43),m(3),l(),r(4,"td",44)(5,"div",45)(6,"span",46),m(7),l(),r(8,"span",47)(9,"a",48),S(10,"i",49),l()()()(),r(11,"td",50),C(12,mt,4,2,"ng-container",3),l(),r(13,"td",51),C(14,dt,8,6,"span",3)(15,_t,3,3,"span",3),l(),C(16,ut,4,6,"td",52)(17,ft,5,2,"ng-container",3),r(18,"td",26),C(19,xt,2,0,"ng-container",53)(20,St,4,8,"ng-template",null,54,$),l(),r(22,"td")(23,"div",12)(24,"div",55)(25,"a",48),S(26,"i",49),l(),m(27," \xA0\xA0 "),r(28,"span",56),g("click",function(){let a=_(e).$implicit,d=p(3);return h(d.refreshInventory(a==null||a.Channel[0]==null?null:a.Channel[0].ChannelItemID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelVariationID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelID,a==null?null:a.ID))}),S(29,"i",57),l()()()()()}if(i&2){let e=o.$implicit,t=o.index,n=R(21),a=p(3);s(1),c("ngIf",t==0),s(2),E(e==null?null:e.Model),s(1),c("matTooltip",e.Discontinued?a.discontinuedVariantMsg:""),s(2),c("ngClass",oe(14,vt,e.Discontinued)),s(1),E(e==null?null:e.Code),s(2),c("href","https://"+a.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),A),s(3),c("ngIf",!e.Discontinued),s(2),c("ngIf",(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",(e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",e==null?null:e.Channel),s(1),c("ngIf",a.isShowReservedColumn),s(2),c("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==a.minDate)("ngIfElse",n),s(6),c("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,A)}}function bt(i,o){if(i&1&&(r(0,"tbody"),C(1,yt,30,16,"tr",28),l()),i&2){let e=o.$implicit;s(1),c("ngForOf",e.Variants)}}function It(i,o){if(i&1){let e=v();r(0,"span",79),g("click",function(){_(e);let n=p(2);return h(n.getRowCount())}),r(1,"i",80),m(2,"?"),l()()}}function wt(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=o.ngIf;s(1),E(x(2,1,e==null?null:e.Total))}}function Tt(i,o){if(i&1){let e=v();r(0,"a",84),g("click",function(){_(e);let n=p(3);return h(n.onNextPage())}),S(1,"i",85),m(2," Next"),l()}}function Mt(i,o){if(i&1){let e=v();r(0,"a",86),g("click",function(){_(e);let n=p(3);return h(n.onLastPage())}),S(1,"i",87),m(2," Last"),l()}}function Dt(i,o){if(i&1&&(r(0,"div",81),C(1,Tt,3,0,"a",82)(2,Mt,3,0,"a",83),l()),i&2){let e=p(2);s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}function Et(i,o){if(i&1){let e=v();r(0,"mainpanel",1),g("onSubmit",function(n){_(e);let a=p();return h(a.onSearch(n))}),r(1,"actions")(2,"div",2),C(3,Xe,3,2,"div",3),f(4,"async"),l()(),r(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),m(10,"PageNumber"),l(),r(11,"input",6),g("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.PageNumber=n)}),l()(),r(12,"div")(13,"label",7),m(14,"Page Size"),l(),r(15,"input",8),g("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.RowCount=n)}),l()(),r(16,"div")(17,"h6"),m(18,"Quantity From - To"),l(),r(19,"input",9),g("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.QuantityFrom=n)}),l(),m(20," - "),r(21,"input",10),g("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.QuantityTo=n)}),l()()()()(),r(22,"content")(23,"div",11)(24,"div",12)(25,"div",13),C(26,et,3,0,"div",14),r(27,"table",15)(28,"thead",16)(29,"tr")(30,"th",17),m(31,"Product "),S(32,"br"),r(33,"mat-slide-toggle",18),g("toggleChange",function(){_(e);let n=p();return n.showDifferenceStock=!n.showDifferenceStock,h(n.onShowDifferenceStock())}),r(34,"small",19),m(35,"FILTER DIFFERENT INVENTORY"),l()()(),r(36,"th",20),m(37,"Variant"),l(),r(38,"th",21),m(39,"SKU"),l(),C(40,tt,2,1,"th",3),f(41,"async"),r(42,"th",22),m(43,"POS"),l(),r(44,"th",23)(45,"div",24),g("click",function(){_(e);let n=p();return h(n.onChangeChannel())}),S(46,"img",25),m(47),l()(),C(48,nt,3,0,"ng-container",3),r(49,"th",26),m(50,"Last Sync"),l(),S(51,"th",27),l()(),C(52,bt,2,1,"tbody",28),f(53,"async"),l(),r(54,"div",29)(55,"div",30)(56,"div",31),m(57),f(58,"number"),f(59,"async"),C(60,It,3,0,"span",32)(61,wt,3,3,"span",3),f(62,"async"),m(63),l()(),C(64,Dt,3,2,"div",33),f(65,"async"),l()()()()()()}if(i&2){let e=p(),t,n;c("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),c("ngIf",x(4,20,e.paginationService.data$)),s(8),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(4),c("ngModel",e.searchFilter.QuantityFrom),s(2),c("ngModel",e.searchFilter.QuantityTo),s(5),c("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),c("ngIf",x(41,22,e.paginationService.data$)),s(5),c("matTooltip","Change "+(e.selectedChannel==null?null:e.selectedChannel.Name)),s(1),c("src",e.selectedChannel.logo,A),s(1),b(" ",e.selectedChannel!=null&&e.selectedChannel.Name?e.selectedChannel==null?null:e.selectedChannel.Name:"Choose Channel ..."," "),s(1),c("ngIf",e.isShowReservedColumn),s(4),c("ngForOf",x(53,24,e.products$)),s(5),b(" Showing 1 - ",x(58,26,(t=x(59,28,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",x(62,30,!e.paginationService.hideCount&&e.rowCount$)),s(2),b(" records ~ ",e.paginationService.footerPageNumber," Page "),s(1),c("ngIf",((n=x(65,32,e.paginationService.data$))==null?null:n.length)>0)}}var Pe=(()=>{let o=class o{constructor(t,n,a,d,u,D,I){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=d,this.productService=u,this.biggerPictureService=D,this.inventoryService=I,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=w.MinDate,this.isShowReservedColumn=!0,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.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]},this.hostName=u.getHostName()}ngOnInit(){this.initPageLoader(),this.products$=this.paginationService.data$.pipe(N(t=>{this.checkShowReservedColumn(t)}))}checkShowReservedColumn(t){let n=0,a;t.forEach(d=>{a=d.Variants.find(u=>w.IsNotEmpty(u?.Channel[0]?.InventoryReserved)),a&&(n+=1)}),this.isShowReservedColumn=n>0}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe(N(t=>{if(this.channelOptions=t.Options.Channel,this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.initSelectedChannel(),this.paginationService.reloadPagination(this.searchFilter),!t.Filter.IsMarketplaceAppActive){let n=`Automatic inventory sync disabled.
2
2
  Please enable Dealpos X Marketplace Apps integration in POS Configuration`;this.toastr.warning(n,"Warning")}}))}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(t=>t.ID==this.searchFilter.ChannelID),this.selectedChannel&&(this.selectedChannel.logo=w.getChannelLogoByTypeId(this.selectedChannel.TypeID))}onChangeChannel(){this.dialog.open(Me,{data:{channelOptions:this.channelOptions,selectedChannel:this.selectedChannel}}).afterClosed().pipe(V(t=>w.IsNotEmpty(t))).subscribe(t=>{this.selectedChannel=t,this.onFilterChannel(t.ID)})}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}onFilterChannel(t){this.searchFilter.ChannelID=t,this.searchFilter.PageNumber=1,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t){let n=this.productService.selectedVariantProduct(t);if(n.length>0){let a=n.map(u=>({ID:u.ID,Code:u.Code,Inventory:u.Inventory})),d={ListChannelID:[this.searchFilter.ChannelID],List:a};this.http.post("/api/Inventory/UpdateChannel",d).subscribe(u=>{this.searchFilter.PageNumber=1,this.paginationService.reloadPagination(this.searchFilter),this.checkboxState=!1,this.handlingUpdateStock(u)})}}handlingUpdateStock(t){if(t[0]?.StatusProduct){let n=t[0].StatusProduct.Fail_list,a=t[0].StatusProduct.Success_list;this.inventoryService.showToastrUpdateInventory(a,n)}else this.toastr.error(t[0]?.Exception,"Error")}openScanDialog(t){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=w.GuidEMpty,this.dialog.open(ee,{data:{filter:n,channelOptions:t.Options.Channel},width:"600px"}).afterClosed().pipe(V(d=>w.IsNotEmpty(d))).subscribe(d=>{this.searchFilter.ChannelID=d.ChannelID,this.searchFilter.ScanFull=d.ScanFull,this.searchFilter.UpdatedProduct=d.UpdatedProduct,this.searchFilter.Async=d.Async,this.scannALl(t)})}scannALl(t){let n=this.productService.findChannelById(this.searchFilter.ChannelID,t.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(a=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.searchFilter.ScanFull=!1,this.initPageLoader(),this.toastr.success("Successfully scanned from "+n?.Name,"Success"))})}refreshInventory(t,n,a,d){let u={ChannelItemID:t,ChannelVariationID:n,ChannelID:a,VariantID:d};this.http.post("/api/Inventory/RefreshInventoryChannel",u).subscribe(D=>{this.toastr.success("Successfully updated","Success"),this.paginationService.reloadPagination(this.searchFilter)})}onCheckboxStateProduct(t){t.Variants=t.Variants.map(n=>(n.Inventory>=0&&(n.selected=t.selected),n))}onCheckboxStateChange(t){t=t.map(n=>(n.Variants=n.Variants.map(a=>(a.selected=this.checkboxState,a)),n))}openTableDialog(t,n,a){this.dialog.open(Ie,{data:{Name:t.Name,Variant:n,ChannelID:n?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:t.ChannelItemID}}).afterClosed().pipe(V(u=>w.IsNotEmpty(u))).subscribe(u=>{this.updateItemAfterDialog(u,a)})}updateItemAfterDialog(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku},d=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(u=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+d?.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=P.DIFFERENCE:this.searchFilter.filterModel=P.ALL,this.paginationService.reloadPagination(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,PageNumber:1,text:this.searchFilter.text};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,t)}onLastPage(){let t={ChannelID:this.searchFilter.ChannelID,PageNumber:1};this.http.post(`${this.rowCountApi}`,t).subscribe({next:n=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,n.Total)}})}onZoomImage(t,n){this.biggerPictureService.openBiggerPicture(t,n)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(Q),y(k),y(X),y(ne),y(te),y(ye),y(ae))},o.\u0275cmp=F({type:o,selectors:[["app-single-channel-comparison"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],["type","number","name","QuantityFrom",1,"w-25","me-2",3,"ngModel","ngModelChange"],["type","number","name","QuantityTo",1,"w-25","ms-2",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],[1,"fw-bold"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","100px"],["matTooltipPosition","above",1,"d-inline-block","text-truncate","mt-3","cursor-pointer",2,"max-width","114px",3,"matTooltip","click"],[2,"width","16px",3,"src"],[1,"text-center"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-start"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle"],[1,"text-end"],["class","text-end",3,"ngClass",4,"ngIf"],[4,"ngIf","ngIfElse"],["SYNCDATE",""],[1,"col-12","ps-0","d-flex","justify-content-between"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["OTHER_CHANNEL",""],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"text-end",3,"ngClass"],[1,"cursor",3,"click"],["EMPTY_RESERVED",""],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(C(0,Et,66,34,"mainpanel",0),f(1,"async")),n&2&&c("ngIf",x(1,1,a.loader$))},dependencies:[me,de,U,K,W,ue,J,Y,we,q,Z,j,H,_e],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let i=o;return i})();var Vt=[{path:"",component:De,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:Ve,canActivate:[le],data:{title:"Inventory Comparison"}},{path:"bychannel",component:Pe,canActivate:[le],data:{title:"Inventory Comparison"}}]}],Fe=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=L({type:o}),o.\u0275inj=O({imports:[z,G.forChild(Vt)]});let i=o;return i})();var vn=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=L({type:o}),o.\u0275inj=O({providers:[ae],imports:[z,Fe,G,ve,ge,Ce,Te,xe,ie,fe]});let i=o;return i})();export{vn as InventoryModule};