dealpos 26.41.53 → 26.41.55

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 (102) hide show
  1. package/browser/{chunk-LOWVTYLS.js → chunk-2D22WHPR.js} +1 -1
  2. package/browser/{chunk-627E2NBM.js → chunk-2Q4GLDGS.js} +1 -1
  3. package/browser/{chunk-6RB2AMJ5.js → chunk-2UAYPPKG.js} +1 -1
  4. package/browser/{chunk-2DK7KK7R.js → chunk-33ND5WEY.js} +1 -1
  5. package/browser/{chunk-TZYIBZBI.js → chunk-35EQD7TC.js} +1 -1
  6. package/browser/{chunk-BQNPOV73.js → chunk-3RYEX7Y3.js} +1 -1
  7. package/browser/{chunk-PQXHJHJN.js → chunk-3ZJ27K2D.js} +2 -2
  8. package/browser/{chunk-VRBSBI3K.js → chunk-4DJ5OAOA.js} +1 -1
  9. package/browser/{chunk-YYE3YZZS.js → chunk-4WZM4HL7.js} +1 -1
  10. package/browser/{chunk-7SYXNW4M.js → chunk-4XDQ3MSJ.js} +1 -1
  11. package/browser/{chunk-CHAPSEL2.js → chunk-55XZ33UY.js} +1 -1
  12. package/browser/{chunk-B3GULOZL.js → chunk-5QXJNVOO.js} +1 -1
  13. package/browser/{chunk-2N3WPL6D.js → chunk-6NUSKD4W.js} +1 -1
  14. package/browser/{chunk-MNZAH2WS.js → chunk-6XFT2ASF.js} +1 -1
  15. package/browser/{chunk-A25CDHRL.js → chunk-7RNBTDCT.js} +1 -1
  16. package/browser/{chunk-HZVSHF6P.js → chunk-A4BMJGVW.js} +1 -1
  17. package/browser/{chunk-5QKR6DHT.js → chunk-A545JKVS.js} +2 -2
  18. package/browser/{chunk-556OJYNG.js → chunk-A7JI4ZNX.js} +1 -1
  19. package/browser/{chunk-RSMSRN7P.js → chunk-AOPOAWJB.js} +1 -1
  20. package/browser/{chunk-H2NT7HGA.js → chunk-AXZDSJ24.js} +1 -1
  21. package/browser/{chunk-BOHEFZEL.js → chunk-B6VOPOAY.js} +1 -1
  22. package/browser/{chunk-GZ77TRPY.js → chunk-BJRJRUDK.js} +1 -1
  23. package/browser/{chunk-JCWFMEZI.js → chunk-BRA2UNTJ.js} +1 -1
  24. package/browser/{chunk-7AIKHXJC.js → chunk-C2KVMAJD.js} +1 -1
  25. package/browser/{chunk-OBGYNQV7.js → chunk-C4VZ5IZY.js} +1 -1
  26. package/browser/{chunk-QSOOOWTH.js → chunk-CVMI3STJ.js} +1 -1
  27. package/browser/{chunk-FAWEL7W5.js → chunk-CWKMKHTW.js} +1 -1
  28. package/browser/chunk-D4WX4UWT.js +1 -0
  29. package/browser/{chunk-CLKNBSEK.js → chunk-DHUEVFI5.js} +1 -1
  30. package/browser/{chunk-L3BAV4JG.js → chunk-EDCHHISW.js} +1 -1
  31. package/browser/{chunk-DGZXVRLZ.js → chunk-EOIM6MY3.js} +1 -1
  32. package/browser/{chunk-T64XW6PX.js → chunk-FGRELDIA.js} +2 -2
  33. package/browser/{chunk-GOKK45WN.js → chunk-FJFLSQIS.js} +1 -1
  34. package/browser/{chunk-KT2U27ND.js → chunk-FWKZZ2N3.js} +1 -1
  35. package/browser/{chunk-WQOJDYYE.js → chunk-G5X3CYV3.js} +1 -1
  36. package/browser/{chunk-5KJFMFWC.js → chunk-HAUJALUH.js} +1 -1
  37. package/browser/{chunk-RN4ROCXU.js → chunk-HKUNDXSX.js} +1 -1
  38. package/browser/{chunk-47JLP5BJ.js → chunk-HTENL6PI.js} +1 -1
  39. package/browser/{chunk-WMAZ4EFB.js → chunk-IAVU4SKC.js} +1 -1
  40. package/browser/{chunk-VP24UTGT.js → chunk-J3YTG6E4.js} +1 -1
  41. package/browser/{chunk-POK6HPFS.js → chunk-J6TYUZI2.js} +1 -1
  42. package/browser/{chunk-RQ4YG3QJ.js → chunk-JLIKALCO.js} +1 -1
  43. package/browser/{chunk-PKTUPLS5.js → chunk-JQANKZU4.js} +1 -1
  44. package/browser/{chunk-3QNRBQCF.js → chunk-JV6UMRYY.js} +1 -1
  45. package/browser/{chunk-EJ6HJ2XJ.js → chunk-K74YTBJC.js} +1 -1
  46. package/browser/{chunk-DNIOT5EQ.js → chunk-KCJVC3D5.js} +2 -2
  47. package/browser/{chunk-ATF7KCUS.js → chunk-KITYD675.js} +1 -1
  48. package/browser/{chunk-ZGHZF2OX.js → chunk-KVKHMMBC.js} +1 -1
  49. package/browser/{chunk-MY2CJH5G.js → chunk-KZ37J3EZ.js} +1 -1
  50. package/browser/{chunk-IQFPYM53.js → chunk-KZMSNJKV.js} +1 -1
  51. package/browser/{chunk-LZWLG5JM.js → chunk-L2TXH3DT.js} +1 -1
  52. package/browser/{chunk-QTG5SASZ.js → chunk-LIZVLB4Y.js} +1 -1
  53. package/browser/{chunk-UBLSLSL7.js → chunk-NAVXGISQ.js} +1 -1
  54. package/browser/{chunk-GA67K6KE.js → chunk-NFOVMPUD.js} +1 -1
  55. package/browser/{chunk-4LWP3W5G.js → chunk-NVKXGDVR.js} +1 -1
  56. package/browser/{chunk-I336SMAW.js → chunk-NXDWKAEV.js} +1 -1
  57. package/browser/{chunk-HHDVN5OY.js → chunk-OA4VJON6.js} +1 -1
  58. package/browser/{chunk-KPB6MK6D.js → chunk-OVCOB7WF.js} +1 -1
  59. package/browser/{chunk-F4UXVR6S.js → chunk-P6AGIAP3.js} +1 -1
  60. package/browser/{chunk-MLVHWJZZ.js → chunk-PECFN37U.js} +1 -1
  61. package/browser/{chunk-DMNLAPOR.js → chunk-QL6A3QH7.js} +1 -1
  62. package/browser/{chunk-MVLZZWXT.js → chunk-QU33TWHO.js} +1 -1
  63. package/browser/{chunk-O7RXV7RJ.js → chunk-QYT2JOXO.js} +1 -1
  64. package/browser/{chunk-BROXE7T5.js → chunk-R57CTLTT.js} +1 -1
  65. package/browser/{chunk-IQQQITWL.js → chunk-RV5OQ2HP.js} +1 -1
  66. package/browser/{chunk-UXAOZ64S.js → chunk-RYP2DILM.js} +1 -1
  67. package/browser/{chunk-SHHIWXGQ.js → chunk-SGYF5WYT.js} +1 -1
  68. package/browser/{chunk-JADGI6UV.js → chunk-SHII5XVO.js} +1 -1
  69. package/browser/{chunk-L75R5SGH.js → chunk-SJNTFNWD.js} +1 -1
  70. package/browser/{chunk-S4COI6PT.js → chunk-SUBQISHT.js} +1 -1
  71. package/browser/{chunk-KLENSBCE.js → chunk-TGUUERBV.js} +1 -1
  72. package/browser/{chunk-JCEIGHW3.js → chunk-TLXACGP4.js} +2 -2
  73. package/browser/{chunk-CWGE5OR7.js → chunk-TQ7AZFR3.js} +1 -1
  74. package/browser/{chunk-AKGXRNIR.js → chunk-U6BHZUDV.js} +1 -1
  75. package/browser/{chunk-VSU3KYP4.js → chunk-UACTAF6U.js} +1 -1
  76. package/browser/{chunk-MGB2TYBW.js → chunk-UOUKOBPM.js} +1 -1
  77. package/browser/{chunk-PIVWKP6F.js → chunk-UVDJ5F2Z.js} +1 -1
  78. package/browser/{chunk-2MUCSXKL.js → chunk-UYDHYMN4.js} +1 -1
  79. package/browser/{chunk-AORZPLG6.js → chunk-VEA6DVQO.js} +1 -1
  80. package/browser/{chunk-DAEISEIP.js → chunk-VIOICYUV.js} +1 -1
  81. package/browser/{chunk-ORQMALAR.js → chunk-W4GUAUTS.js} +1 -1
  82. package/browser/{chunk-JANYTQHW.js → chunk-WAEZXIYL.js} +1 -1
  83. package/browser/{chunk-ECR4MKHL.js → chunk-WKNAKOKJ.js} +1 -1
  84. package/browser/{chunk-34Y4NLT2.js → chunk-WKPO4QSK.js} +1 -1
  85. package/browser/{chunk-KJPDWMRU.js → chunk-WWGDNSFH.js} +1 -1
  86. package/browser/{chunk-GJQYUCDE.js → chunk-X62J3DRC.js} +1 -1
  87. package/browser/{chunk-DBU2QZW7.js → chunk-XJAZQYNU.js} +1 -1
  88. package/browser/{chunk-PXICENOU.js → chunk-XOVEXBVU.js} +1 -1
  89. package/browser/{chunk-YMV76MIM.js → chunk-YMDZSFDP.js} +1 -1
  90. package/browser/{chunk-RZYEPD74.js → chunk-YPOHGC3M.js} +1 -1
  91. package/browser/{chunk-SGXJKTJJ.js → chunk-YRRDPMB5.js} +2 -2
  92. package/browser/{chunk-UPW6OTT3.js → chunk-Z3MKVNFF.js} +1 -1
  93. package/browser/{chunk-UOBX5AEO.js → chunk-Z4EU7CTC.js} +1 -1
  94. package/browser/{chunk-M7DADJKS.js → chunk-Z4N6SXNM.js} +2 -2
  95. package/browser/{chunk-4ZJ5EU2V.js → chunk-ZABYOGLE.js} +1 -1
  96. package/browser/{chunk-IGIVKM5X.js → chunk-ZBZPU43T.js} +1 -1
  97. package/browser/index.html +2 -2
  98. package/browser/{main-A3JJIW26.js → main-KDKXA5MF.js} +1 -1
  99. package/browser/ngsw-config.json +1 -1
  100. package/browser/ngsw.json +498 -498
  101. package/package.json +1 -1
  102. package/browser/chunk-YWWRITS5.js +0 -1
@@ -1 +1 @@
1
- import{a as g}from"./chunk-GZ77TRPY.js";import{Ba as p,Da as h,f as l}from"./chunk-7D344CRC.js";var u=class extends g{constructor(t,e,s,i,n,a,r,o,c="post",D="post"){super(t,e,s,i,n,a,r,c,D);this.httpService=e;this.toastrService=n;this.route=a;this.cdr=o;this.dataMethod=c;this.loaderMethod=D;o&&h(()=>{this.infiniteListSignal(),this.cdr.markForCheck()})}httpService;toastrService;route;cdr;dataMethod;loaderMethod;toastrCount=0;nextPageDisabled=!1;extendData=!1;goToLast=!1;listTotal=0;_infiniteList$=new l([]);infiniteListSignal=p([]);get infiniteList(){return this._infiniteList$.value}set infiniteList(t){this._infiniteList$.next(t),this.infiniteListSignal.set(t)}originalData=[];StoreRowsCountAPIResult(t,e=!1){this.httpService.post("/api/"+t,this.pageData.Filter).subscribe(s=>{this.listTotal=s.Count,this.pageData.HideStoreApiCount=!0,e&&(this.pageData.Filter.RowCount=this.listTotal,this.goToLast=!0,this.pageData.Filter.PageNumber=1,this.getListData()),this.cdr&&this.cdr.markForCheck()})}NextPage(t){this.pageData.Filter.PageNumber=this.pageData.Filter.PageNumber||1,this.pageData.Filter.PageNumber+=1,this.extendData=t,this.getListData()}postInit(t){t?.Data?.length>0&&(this.toastrCount=0),t?.Data?.length===0&&this.toastrCount===0&&(this.toastrService?.info("No more data to load","Info"),this.toastrCount=1);let e=Array.isArray(t.Data?.hits),s=Array.isArray(t.Data?.[0]?.Variants),i=[...this.infiniteList];if(this.extendData){let a=i.at(-1),r=t.Data.find(o=>o.ID===a?.ID);if(s&&a)if(r){let o=t.Data.filter(c=>c.ID!==a?.ID);a.Variants=a.Variants.concat(r.Variants||[]),i=i.concat(o)}else i=i.concat(t.Data);else i=i.concat(e?t.Data.hits:t.Data);this.postExtendData(t),this.extendData=!1}else i=e?t.Data.hits:t.Data,this.assignAggregate(t);this.infiniteList=i,this.originalData=[...i];let n=e?t.Data.hits.length:t.Data.length;this.nextPageDisabled=n<this.pageData.Filter.RowCount,this.menuData.H=this.data.PageTitle||this.menuData.H,this.afterPostInit(t),this.cdr?.markForCheck?.()}afterPostInit(t){}preSearchFromPageOne(){this.goToLast=!1}postExtendData(t){}assignAggregate(t){}onSelectAllData(t){super.onSelectAllData(t),this.infiniteList=this.infiniteList.map(e=>(e.selected=t,e))}};export{u as a};
1
+ import{a as g}from"./chunk-BJRJRUDK.js";import{Ba as p,Da as h,f as l}from"./chunk-7D344CRC.js";var u=class extends g{constructor(t,e,s,i,n,a,r,o,c="post",D="post"){super(t,e,s,i,n,a,r,c,D);this.httpService=e;this.toastrService=n;this.route=a;this.cdr=o;this.dataMethod=c;this.loaderMethod=D;o&&h(()=>{this.infiniteListSignal(),this.cdr.markForCheck()})}httpService;toastrService;route;cdr;dataMethod;loaderMethod;toastrCount=0;nextPageDisabled=!1;extendData=!1;goToLast=!1;listTotal=0;_infiniteList$=new l([]);infiniteListSignal=p([]);get infiniteList(){return this._infiniteList$.value}set infiniteList(t){this._infiniteList$.next(t),this.infiniteListSignal.set(t)}originalData=[];StoreRowsCountAPIResult(t,e=!1){this.httpService.post("/api/"+t,this.pageData.Filter).subscribe(s=>{this.listTotal=s.Count,this.pageData.HideStoreApiCount=!0,e&&(this.pageData.Filter.RowCount=this.listTotal,this.goToLast=!0,this.pageData.Filter.PageNumber=1,this.getListData()),this.cdr&&this.cdr.markForCheck()})}NextPage(t){this.pageData.Filter.PageNumber=this.pageData.Filter.PageNumber||1,this.pageData.Filter.PageNumber+=1,this.extendData=t,this.getListData()}postInit(t){t?.Data?.length>0&&(this.toastrCount=0),t?.Data?.length===0&&this.toastrCount===0&&(this.toastrService?.info("No more data to load","Info"),this.toastrCount=1);let e=Array.isArray(t.Data?.hits),s=Array.isArray(t.Data?.[0]?.Variants),i=[...this.infiniteList];if(this.extendData){let a=i.at(-1),r=t.Data.find(o=>o.ID===a?.ID);if(s&&a)if(r){let o=t.Data.filter(c=>c.ID!==a?.ID);a.Variants=a.Variants.concat(r.Variants||[]),i=i.concat(o)}else i=i.concat(t.Data);else i=i.concat(e?t.Data.hits:t.Data);this.postExtendData(t),this.extendData=!1}else i=e?t.Data.hits:t.Data,this.assignAggregate(t);this.infiniteList=i,this.originalData=[...i];let n=e?t.Data.hits.length:t.Data.length;this.nextPageDisabled=n<this.pageData.Filter.RowCount,this.menuData.H=this.data.PageTitle||this.menuData.H,this.afterPostInit(t),this.cdr?.markForCheck?.()}afterPostInit(t){}preSearchFromPageOne(){this.goToLast=!1}postExtendData(t){}assignAggregate(t){}onSelectAllData(t){super.onSelectAllData(t),this.infiniteList=this.infiniteList.map(e=>(e.selected=t,e))}};export{u as a};
@@ -1 +1 @@
1
- import{a as Ie}from"./chunk-I7ECOHHK.js";import{a as le}from"./chunk-FAWEL7W5.js";import{g as ve}from"./chunk-ER2NCDJO.js";import{b as pe}from"./chunk-P2NWTCME.js";import{a as ye,b as fe}from"./chunk-WUR7UGG2.js";import{b as ge}from"./chunk-C6AVODTR.js";import{b as oe,c as ae,d as re}from"./chunk-ANFR3NR4.js";import{a as xe}from"./chunk-WHKDTNK2.js";import{a as ue}from"./chunk-XISCWQFV.js";import{f as Ce,g as _e}from"./chunk-MGB2TYBW.js";import{a as se}from"./chunk-GA67K6KE.js";import{b as ie}from"./chunk-JXEPD3CF.js";import{d as ce,e as de}from"./chunk-BUIP3UCE.js";import{c as me}from"./chunk-3V6FZIJD.js";import{F as ne,c as Z,h as $,p as ee,r as te}from"./chunk-AJDQZ346.js";import{b as U}from"./chunk-PUBGTLD3.js";import{n as X,q as Y}from"./chunk-QGYXJUX3.js";import{$a as h,Ab as Q,Ba as O,Bb as L,Cb as W,Da as B,Db as x,Eb as a,Fb as r,Fc as w,Gb as V,Gc as D,Kb as E,Lb as M,Lc as G,Pb as b,Sb as S,Sd as K,Ua as o,Ub as l,db as R,hc as c,ib as k,ic as F,jb as H,jc as _,kd as q,mc as y,nc as f,oa as N,oc as v,ra as u,sa as C,ud as z,wb as p,xd as J,yb as s,yc as A,zb as j}from"./chunk-7D344CRC.js";import{a as T,b as P}from"./chunk-NF7PG5F2.js";var be=n=>({ID:n}),Se=n=>({"expanded-icon":n});function we(n,d){if(n&1){let e=b();a(0,"button",15),S("click",function(){u(e);let t=l();return C(t.openExportModal())}),V(1,"i",16),c(2," Export "),r()}}function De(n,d){if(n&1){let e=b();a(0,"div",17)(1,"div")(2,"h6"),c(3,"Outlet"),r(),a(4,"outlet-selector",18),v("ngModelChange",function(t){u(e);let m=l();return f(m.pageData().Filter.OutletID,t)||(m.pageData().Filter.OutletID=t),C(t)}),r()(),a(5,"div")(6,"h6"),c(7,"Category"),r(),a(8,"POS-product-category-select",19),v("selectedCategoryIDChange",function(t){u(e);let m=l();return f(m.pageData().Filter.ProductCategoryID,t)||(m.pageData().Filter.ProductCategoryID=t),C(t)}),r()(),a(9,"h6"),c(10,"Brand"),r(),a(11,"POS-brand-options",20),v("ngModelChange",function(t){u(e);let m=l();return f(m.pageData().Filter.BrandIDs,t)||(m.pageData().Filter.BrandIDs=t),C(t)}),r(),a(12,"div")(13,"h6"),c(14,"Product Tags"),r(),a(15,"ng-select",21),v("ngModelChange",function(t){u(e);let m=l();return f(m.pageData().Filter.ProductTagID,t)||(m.pageData().Filter.ProductTagID=t),C(t)}),r()(),a(16,"div")(17,"h6"),c(18,"Quantity From - To"),r(),a(19,"div",22)(20,"input",23),v("ngModelChange",function(t){u(e);let m=l();return f(m.pageData().Filter.QtyFrom,t)||(m.pageData().Filter.QtyFrom=t),C(t)}),r(),c(21," - "),a(22,"input",24),v("ngModelChange",function(t){u(e);let m=l();return f(m.pageData().Filter.QtyTo,t)||(m.pageData().Filter.QtyTo=t),C(t)}),r()()()()}if(n&2){let e,i=l();o(4),x("accessType",2),y("ngModel",i.pageData().Filter.OutletID),o(4),y("selectedCategoryID",i.pageData().Filter.ProductCategoryID),x("showClear",!0),o(3),y("ngModel",i.pageData().Filter.BrandIDs),x("multiple",!0)("clearable",!0),o(4),x("items",(e=i.pageData().Options)==null?null:e.Tags),y("ngModel",i.pageData().Filter.ProductTagID),o(5),y("ngModel",i.pageData().Filter.QtyFrom),o(2),y("ngModel",i.pageData().Filter.QtyTo)}}function Te(n,d){if(n&1&&(a(0,"th",10),c(1),r()),n&2){let e=l();o(),_(" ",e.column.VariantName.name," ")}}function Pe(n,d){if(n&1&&(a(0,"th",11),c(1),r()),n&2){let e=l();o(),_(" ",e.column.OnHand.name," ")}}function Ve(n,d){if(n&1&&(a(0,"th",12),c(1),r()),n&2){let e=l();o(),_(" ",e.column.DirectAllocated.name," ")}}function Ee(n,d){if(n&1&&(a(0,"th",13),c(1),r()),n&2){let e=l();o(),_(" ",e.column.IndirectAllocated.name," ")}}function Me(n,d){if(n&1&&(a(0,"th",14),c(1),r()),n&2){let e=l();o(),_(" ",e.column.Available.name," ")}}function Fe(n,d){if(n&1){let e=b();a(0,"button",29),S("click",function(){u(e);let t=l(2).$implicit,m=l();return C(m.onExpand(t))}),V(1,"i",30),r()}if(n&2){let e=l(2).$implicit,i=l();o(),x("ngClass",A(1,Se,i.displayExpandedRow(e.VariantID)))}}function Ae(n,d){if(n&1&&(a(0,"td")(1,"div",26),p(2,Fe,2,3,"button",27),a(3,"div")(4,"a",28),c(5),r(),V(6,"br"),a(7,"small"),c(8),r()()()()),n&2){let e=l().$implicit;o(2),s(e.ListComponent&&e.ListComponent.length>0?2:-1),o(2),x("routerLink","/menu/Products/Catalog/Variants/Info")("queryParams",A(5,be,e.VariantID)),o(),_(" ",e.VariantName," "),o(3),_(" ",e.VariantCode," ")}}function Oe(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l().$implicit;o(),F(D(2,1,e.OnHand))}}function Le(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l(2).$implicit;o(),_(" ",D(2,1,e.DirectAllocated)," ")}}function We(n,d){if(n&1&&p(0,Le,3,3,"td",25),n&2){let e=l(2);s(e.column.DirectAllocated&&e.column.DirectAllocated.selected?0:-1)}}function Ne(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l(2).$implicit;o(),_(" ",D(2,1,e.DirectAllocated)," ")}}function Be(n,d){if(n&1&&p(0,Ne,3,3,"td",25),n&2){let e=l(2);s(e.column.DirectAllocated&&e.column.DirectAllocated.selected?0:-1)}}function Re(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l().$implicit;o(),F(D(2,1,e.IndirectAllocated))}}function ke(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l().$implicit;o(),F(D(2,1,e.Available))}}function He(n,d){if(n&1&&(a(0,"tbody")(1,"tr")(2,"td")(3,"a",28),c(4),r()(),a(5,"td"),c(6),r(),a(7,"td",25),c(8),r(),a(9,"td",25),c(10),r()()()),n&2){let e=d.$implicit,i=l(2).$implicit;o(3),x("routerLink","/menu/Products/Catalog/Variants/Info")("queryParams",A(6,be,i.VariantID)),o(),_(" ",e.VariantName," "),o(2),_(" ",e.VariantCode," "),o(2),_(" ",e.Quantity," "),o(2),_(" ",e.OnHand," ")}}function je(n,d){if(n&1&&(a(0,"tr")(1,"td",31)(2,"div",7)(3,"table",32)(4,"thead",33)(5,"tr",34)(6,"th",35),c(7),r(),a(8,"th",36),c(9,"Code"),r(),a(10,"th",37),c(11," Quantity "),r(),a(12,"th",37),c(13," On Hand "),r()()(),L(14,He,11,8,"tbody",null,j),r()()()()),n&2){let e=l().$implicit;o(7),_(" Components (",e.ListComponent.length,") "),o(7),W(e.ListComponent)}}function Qe(n,d){if(n&1&&(a(0,"tr"),p(1,Ae,9,7,"td"),p(2,Oe,3,3,"td",25),p(3,We,1,1)(4,Be,1,1),p(5,Re,3,3,"td",25),p(6,ke,3,3,"td",25),r(),p(7,je,16,1,"tr")),n&2){let e=d.$implicit,i=l();o(),s(i.column.VariantName&&i.column.VariantName.selected?1:-1),o(),s(i.column.OnHand&&i.column.OnHand.selected?2:-1),o(),s(i.totalIndirect()>0?3:4),o(2),s(i.column.IndirectAllocated&&i.column.IndirectAllocated.selected&&i.totalIndirect()>0?5:-1),o(),s(i.column.Available&&i.column.Available.selected?6:-1),o(),s(i.displayExpandedRow(e.VariantID)&&i.column.VariantName&&i.column.VariantName.selected?7:-1)}}function Ge(n,d){if(n&1){let e=b();a(0,"div")(1,"POS-complex-pagination",38),S("jumpToPage",function(){u(e);let t=l();return C(t.getListData())})("previousPage",function(){u(e);let t=l();return C(t.getListData())})("nextPage",function(){u(e);let t=l();return C(t.getListData())}),v("reloadRowCountChange",function(t){u(e);let m=l();return f(m.reloadRowCount,t)||(m.reloadRowCount=t),C(t)}),r()()}if(n&2){let e=l();o(),x("total",e.data().Data.length)("pageData",e.pageData()),y("reloadRowCount",e.reloadRowCount)}}var he=class n extends le{constructor(e,i,t,m,I){super(e,i,"inventory/GetListInventoryComposite","inventoryloader/GetListInventoryComposite",t,void 0,!1);this.httpService=i;this.csvConverter=m;this.roleService=I;B(()=>{let g=this.totalIndirect();g!==null&&g<=0&&(console.log("Indirect allocation is zero or negative"),this.column=P(T({},this.column),{DirectAllocated:P(T({},this.column.DirectAllocated),{name:"Allocated"}),IndirectAllocated:P(T({},this.column.IndirectAllocated),{show:!1})}))})}httpService;csvConverter;roleService;column={VariantName:{selected:!0,name:"Name",show:!0},OnHand:{selected:!0,name:"On Hand",show:!0},DirectAllocated:{selected:!0,name:"Direct Allocated",show:!0},IndirectAllocated:{selected:!0,name:"Indirect Allocated",show:!0},Available:{selected:!0,name:"Available",show:!0}};totalIndirect=O(null);expandedRow=O([]);dialog=N(me);afterPostInit(e){console.log("Composite Inventory Data",e);let i=e.Data.reduce((t,m)=>t+m.IndirectAllocated,0);console.log("Total Indirect Allocated:",i),this.totalIndirect.set(i)}sortData(e){let i=[...this.data().Data];if(!e.active||e.direction===""){this.infiniteList=i;return}this.infiniteList=i.sort((t,m)=>{let I=e.direction==="asc";return this.compare(t[e.active],m[e.active],I)})}openExportModal(){this.dialog.open(pe,{data:{title:"Composite Inventory",exportTypes:[{ID:"inventoryExport/GetExportInventoryComposite",Value:"Default",FileName:"Composite Inventory"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"inventory/GetCountInventoryComposite",pagination:!0}})}onExpand(e){e?.VariantID&&this.expandedRow.update(i=>i.includes(e.VariantID)?i.filter(t=>t!==e.VariantID):[...i,e.VariantID])}displayExpandedRow(e){return this.expandedRow().includes(e)}static \u0275fac=function(i){return new(i||n)(h(se),h(Y),h(X),h(ue),h(U))};static \u0275cmp=R({type:n,selectors:[["pos-composite-inventory"]],features:[k],decls:21,vars:12,consts:[["pageFilterTemplate",""],["tooltipTitle","Identify and manage unsold inventory that has been stagnant for a long time",3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],["ngProjectAs","actions",5,["actions"]],[1,"btn","btn-outline-secondary","me-3"],["ngProjectAs","filters",5,["filters"]],["ngProjectAs","content",5,["content"]],[1,"container-fluid","mt-3"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","VariantName",2,"width","35%"],["mat-sort-header","OnHand",1,"text-right-sort",2,"width","10%"],["mat-sort-header","DirectAllocated",1,"text-right-sort",2,"width","10%"],["mat-sort-header","IndirectAllocated",1,"text-right-sort",2,"width","10%"],["mat-sort-header","Available",1,"text-right-sort",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"d-flex","flex-column","gap-4"],["placeholder","Choose Outlets (Leave Blank to Choose All)",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["placeholder","Choose Brand",1,"w-100",3,"ngModelChange","ngModel","multiple","clearable"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],[1,"d-flex","align-items-center",2,"column-gap","8px"],["type","number","name","QuantityFrom",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"text-end"],[1,"d-flex","align-items-center"],[1,"btn","btn-sm","expand-btn"],[3,"routerLink","queryParams"],[1,"btn","btn-sm","expand-btn",3,"click"],[1,"fa","fa-chevron-down",3,"ngClass"],["colspan","100%",2,"padding-left","50px"],[1,"table","border-bottom",2,"width","100%"],[2,"background-color","#f5f5f5"],[1,"text-muted"],[2,"width","55%","color","#3b3b3b"],[2,"color","#3b3b3b"],[2,"text-align","right !important","color","#3b3b3b"],["api","inventory/GetCountInventoryComposite",3,"jumpToPage","previousPage","nextPage","reloadRowCountChange","total","pageData","reloadRowCount"]],template:function(i,t){if(i&1){let m=b();a(0,"mainpanel-cmp",1),v("textChange",function(g){return u(m),f(t.pageData().Filter.SearchText,g)||(t.pageData().Filter.SearchText=g),C(g)}),S("onSubmit",function(){return t.searchFromPageOne()}),v("filterChange",function(g){return u(m),f(t.pageData().Filter,g)||(t.pageData().Filter=g),C(g)}),E(1,2),p(2,we,3,0,"button",3),M(),E(3,4),H(4,De,23,11,"ng-template",null,0,G),M(),E(6,5),a(7,"div",6)(8,"div",7)(9,"table",8),S("matSortChange",function(g){return t.sortData(g)}),a(10,"thead",9)(11,"tr"),p(12,Te,2,1,"th",10),p(13,Pe,2,1,"th",11),p(14,Ve,2,1,"th",12),p(15,Ee,2,1,"th",13),p(16,Me,2,1,"th",14),r()(),a(17,"tbody"),L(18,Qe,8,6,null,null,Q),r()()(),p(20,Ge,2,3,"div"),r(),M(),r()}i&2&&(x("pageData",t.menuData()),y("text",t.pageData().Filter.SearchText),x("isFilterOnDropdown",!1),y("filter",t.pageData().Filter),x("column",t.column),o(2),s(t.roleService.global.Export?2:-1),o(10),s(t.column.VariantName&&t.column.VariantName.selected?12:-1),o(),s(t.column.OnHand&&t.column.OnHand.selected?13:-1),o(),s(t.column.DirectAllocated&&t.column.DirectAllocated.selected?14:-1),o(),s(t.column.IndirectAllocated&&t.column.IndirectAllocated.selected&&t.totalIndirect()>0?15:-1),o(),s(t.column.Available&&t.column.Available.selected?16:-1),o(2),W(t.infiniteList),o(2),s(t.data()?20:-1))},dependencies:[_e,Ce,xe,ge,ne,Z,te,$,ee,de,ce,ie,Ie,fe,ye,J,q,K,re,oe,ae,ve,z],styles:["[_nghost-%COMP%]{display:block}.expand-btn[_ngcontent-%COMP%]{border-radius:100px;width:30px;height:30px;transition:all .3s ease;padding:0;transform:rotate(270deg)}.expand-btn[_ngcontent-%COMP%]:hover{background-color:#eaeaea}.expand-btn[_ngcontent-%COMP%]:focus{border:none;outline:none}.expanded-icon[_ngcontent-%COMP%]{transform:rotate(90deg)}[_nghost-%COMP%] .text-right-sort .mat-sort-header-container{display:flex;justify-content:end}th.mat-header-cell[_ngcontent-%COMP%], td.mat-cell[_ngcontent-%COMP%]{text-align:right}"],changeDetection:0})};export{he as a};
1
+ import{a as Ie}from"./chunk-I7ECOHHK.js";import{a as le}from"./chunk-CWKMKHTW.js";import{g as ve}from"./chunk-ER2NCDJO.js";import{b as pe}from"./chunk-P2NWTCME.js";import{a as ye,b as fe}from"./chunk-WUR7UGG2.js";import{b as ge}from"./chunk-C6AVODTR.js";import{b as oe,c as ae,d as re}from"./chunk-ANFR3NR4.js";import{a as xe}from"./chunk-WHKDTNK2.js";import{a as ue}from"./chunk-XISCWQFV.js";import{f as Ce,g as _e}from"./chunk-UOUKOBPM.js";import{a as se}from"./chunk-NFOVMPUD.js";import{b as ie}from"./chunk-JXEPD3CF.js";import{d as ce,e as de}from"./chunk-BUIP3UCE.js";import{c as me}from"./chunk-3V6FZIJD.js";import{F as ne,c as Z,h as $,p as ee,r as te}from"./chunk-AJDQZ346.js";import{b as U}from"./chunk-PUBGTLD3.js";import{n as X,q as Y}from"./chunk-QGYXJUX3.js";import{$a as h,Ab as Q,Ba as O,Bb as L,Cb as W,Da as B,Db as x,Eb as a,Fb as r,Fc as w,Gb as V,Gc as D,Kb as E,Lb as M,Lc as G,Pb as b,Sb as S,Sd as K,Ua as o,Ub as l,db as R,hc as c,ib as k,ic as F,jb as H,jc as _,kd as q,mc as y,nc as f,oa as N,oc as v,ra as u,sa as C,ud as z,wb as p,xd as J,yb as s,yc as A,zb as j}from"./chunk-7D344CRC.js";import{a as T,b as P}from"./chunk-NF7PG5F2.js";var be=n=>({ID:n}),Se=n=>({"expanded-icon":n});function we(n,d){if(n&1){let e=b();a(0,"button",15),S("click",function(){u(e);let t=l();return C(t.openExportModal())}),V(1,"i",16),c(2," Export "),r()}}function De(n,d){if(n&1){let e=b();a(0,"div",17)(1,"div")(2,"h6"),c(3,"Outlet"),r(),a(4,"outlet-selector",18),v("ngModelChange",function(t){u(e);let m=l();return f(m.pageData().Filter.OutletID,t)||(m.pageData().Filter.OutletID=t),C(t)}),r()(),a(5,"div")(6,"h6"),c(7,"Category"),r(),a(8,"POS-product-category-select",19),v("selectedCategoryIDChange",function(t){u(e);let m=l();return f(m.pageData().Filter.ProductCategoryID,t)||(m.pageData().Filter.ProductCategoryID=t),C(t)}),r()(),a(9,"h6"),c(10,"Brand"),r(),a(11,"POS-brand-options",20),v("ngModelChange",function(t){u(e);let m=l();return f(m.pageData().Filter.BrandIDs,t)||(m.pageData().Filter.BrandIDs=t),C(t)}),r(),a(12,"div")(13,"h6"),c(14,"Product Tags"),r(),a(15,"ng-select",21),v("ngModelChange",function(t){u(e);let m=l();return f(m.pageData().Filter.ProductTagID,t)||(m.pageData().Filter.ProductTagID=t),C(t)}),r()(),a(16,"div")(17,"h6"),c(18,"Quantity From - To"),r(),a(19,"div",22)(20,"input",23),v("ngModelChange",function(t){u(e);let m=l();return f(m.pageData().Filter.QtyFrom,t)||(m.pageData().Filter.QtyFrom=t),C(t)}),r(),c(21," - "),a(22,"input",24),v("ngModelChange",function(t){u(e);let m=l();return f(m.pageData().Filter.QtyTo,t)||(m.pageData().Filter.QtyTo=t),C(t)}),r()()()()}if(n&2){let e,i=l();o(4),x("accessType",2),y("ngModel",i.pageData().Filter.OutletID),o(4),y("selectedCategoryID",i.pageData().Filter.ProductCategoryID),x("showClear",!0),o(3),y("ngModel",i.pageData().Filter.BrandIDs),x("multiple",!0)("clearable",!0),o(4),x("items",(e=i.pageData().Options)==null?null:e.Tags),y("ngModel",i.pageData().Filter.ProductTagID),o(5),y("ngModel",i.pageData().Filter.QtyFrom),o(2),y("ngModel",i.pageData().Filter.QtyTo)}}function Te(n,d){if(n&1&&(a(0,"th",10),c(1),r()),n&2){let e=l();o(),_(" ",e.column.VariantName.name," ")}}function Pe(n,d){if(n&1&&(a(0,"th",11),c(1),r()),n&2){let e=l();o(),_(" ",e.column.OnHand.name," ")}}function Ve(n,d){if(n&1&&(a(0,"th",12),c(1),r()),n&2){let e=l();o(),_(" ",e.column.DirectAllocated.name," ")}}function Ee(n,d){if(n&1&&(a(0,"th",13),c(1),r()),n&2){let e=l();o(),_(" ",e.column.IndirectAllocated.name," ")}}function Me(n,d){if(n&1&&(a(0,"th",14),c(1),r()),n&2){let e=l();o(),_(" ",e.column.Available.name," ")}}function Fe(n,d){if(n&1){let e=b();a(0,"button",29),S("click",function(){u(e);let t=l(2).$implicit,m=l();return C(m.onExpand(t))}),V(1,"i",30),r()}if(n&2){let e=l(2).$implicit,i=l();o(),x("ngClass",A(1,Se,i.displayExpandedRow(e.VariantID)))}}function Ae(n,d){if(n&1&&(a(0,"td")(1,"div",26),p(2,Fe,2,3,"button",27),a(3,"div")(4,"a",28),c(5),r(),V(6,"br"),a(7,"small"),c(8),r()()()()),n&2){let e=l().$implicit;o(2),s(e.ListComponent&&e.ListComponent.length>0?2:-1),o(2),x("routerLink","/menu/Products/Catalog/Variants/Info")("queryParams",A(5,be,e.VariantID)),o(),_(" ",e.VariantName," "),o(3),_(" ",e.VariantCode," ")}}function Oe(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l().$implicit;o(),F(D(2,1,e.OnHand))}}function Le(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l(2).$implicit;o(),_(" ",D(2,1,e.DirectAllocated)," ")}}function We(n,d){if(n&1&&p(0,Le,3,3,"td",25),n&2){let e=l(2);s(e.column.DirectAllocated&&e.column.DirectAllocated.selected?0:-1)}}function Ne(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l(2).$implicit;o(),_(" ",D(2,1,e.DirectAllocated)," ")}}function Be(n,d){if(n&1&&p(0,Ne,3,3,"td",25),n&2){let e=l(2);s(e.column.DirectAllocated&&e.column.DirectAllocated.selected?0:-1)}}function Re(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l().$implicit;o(),F(D(2,1,e.IndirectAllocated))}}function ke(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l().$implicit;o(),F(D(2,1,e.Available))}}function He(n,d){if(n&1&&(a(0,"tbody")(1,"tr")(2,"td")(3,"a",28),c(4),r()(),a(5,"td"),c(6),r(),a(7,"td",25),c(8),r(),a(9,"td",25),c(10),r()()()),n&2){let e=d.$implicit,i=l(2).$implicit;o(3),x("routerLink","/menu/Products/Catalog/Variants/Info")("queryParams",A(6,be,i.VariantID)),o(),_(" ",e.VariantName," "),o(2),_(" ",e.VariantCode," "),o(2),_(" ",e.Quantity," "),o(2),_(" ",e.OnHand," ")}}function je(n,d){if(n&1&&(a(0,"tr")(1,"td",31)(2,"div",7)(3,"table",32)(4,"thead",33)(5,"tr",34)(6,"th",35),c(7),r(),a(8,"th",36),c(9,"Code"),r(),a(10,"th",37),c(11," Quantity "),r(),a(12,"th",37),c(13," On Hand "),r()()(),L(14,He,11,8,"tbody",null,j),r()()()()),n&2){let e=l().$implicit;o(7),_(" Components (",e.ListComponent.length,") "),o(7),W(e.ListComponent)}}function Qe(n,d){if(n&1&&(a(0,"tr"),p(1,Ae,9,7,"td"),p(2,Oe,3,3,"td",25),p(3,We,1,1)(4,Be,1,1),p(5,Re,3,3,"td",25),p(6,ke,3,3,"td",25),r(),p(7,je,16,1,"tr")),n&2){let e=d.$implicit,i=l();o(),s(i.column.VariantName&&i.column.VariantName.selected?1:-1),o(),s(i.column.OnHand&&i.column.OnHand.selected?2:-1),o(),s(i.totalIndirect()>0?3:4),o(2),s(i.column.IndirectAllocated&&i.column.IndirectAllocated.selected&&i.totalIndirect()>0?5:-1),o(),s(i.column.Available&&i.column.Available.selected?6:-1),o(),s(i.displayExpandedRow(e.VariantID)&&i.column.VariantName&&i.column.VariantName.selected?7:-1)}}function Ge(n,d){if(n&1){let e=b();a(0,"div")(1,"POS-complex-pagination",38),S("jumpToPage",function(){u(e);let t=l();return C(t.getListData())})("previousPage",function(){u(e);let t=l();return C(t.getListData())})("nextPage",function(){u(e);let t=l();return C(t.getListData())}),v("reloadRowCountChange",function(t){u(e);let m=l();return f(m.reloadRowCount,t)||(m.reloadRowCount=t),C(t)}),r()()}if(n&2){let e=l();o(),x("total",e.data().Data.length)("pageData",e.pageData()),y("reloadRowCount",e.reloadRowCount)}}var he=class n extends le{constructor(e,i,t,m,I){super(e,i,"inventory/GetListInventoryComposite","inventoryloader/GetListInventoryComposite",t,void 0,!1);this.httpService=i;this.csvConverter=m;this.roleService=I;B(()=>{let g=this.totalIndirect();g!==null&&g<=0&&(console.log("Indirect allocation is zero or negative"),this.column=P(T({},this.column),{DirectAllocated:P(T({},this.column.DirectAllocated),{name:"Allocated"}),IndirectAllocated:P(T({},this.column.IndirectAllocated),{show:!1})}))})}httpService;csvConverter;roleService;column={VariantName:{selected:!0,name:"Name",show:!0},OnHand:{selected:!0,name:"On Hand",show:!0},DirectAllocated:{selected:!0,name:"Direct Allocated",show:!0},IndirectAllocated:{selected:!0,name:"Indirect Allocated",show:!0},Available:{selected:!0,name:"Available",show:!0}};totalIndirect=O(null);expandedRow=O([]);dialog=N(me);afterPostInit(e){console.log("Composite Inventory Data",e);let i=e.Data.reduce((t,m)=>t+m.IndirectAllocated,0);console.log("Total Indirect Allocated:",i),this.totalIndirect.set(i)}sortData(e){let i=[...this.data().Data];if(!e.active||e.direction===""){this.infiniteList=i;return}this.infiniteList=i.sort((t,m)=>{let I=e.direction==="asc";return this.compare(t[e.active],m[e.active],I)})}openExportModal(){this.dialog.open(pe,{data:{title:"Composite Inventory",exportTypes:[{ID:"inventoryExport/GetExportInventoryComposite",Value:"Default",FileName:"Composite Inventory"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"inventory/GetCountInventoryComposite",pagination:!0}})}onExpand(e){e?.VariantID&&this.expandedRow.update(i=>i.includes(e.VariantID)?i.filter(t=>t!==e.VariantID):[...i,e.VariantID])}displayExpandedRow(e){return this.expandedRow().includes(e)}static \u0275fac=function(i){return new(i||n)(h(se),h(Y),h(X),h(ue),h(U))};static \u0275cmp=R({type:n,selectors:[["pos-composite-inventory"]],features:[k],decls:21,vars:12,consts:[["pageFilterTemplate",""],["tooltipTitle","Identify and manage unsold inventory that has been stagnant for a long time",3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],["ngProjectAs","actions",5,["actions"]],[1,"btn","btn-outline-secondary","me-3"],["ngProjectAs","filters",5,["filters"]],["ngProjectAs","content",5,["content"]],[1,"container-fluid","mt-3"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","VariantName",2,"width","35%"],["mat-sort-header","OnHand",1,"text-right-sort",2,"width","10%"],["mat-sort-header","DirectAllocated",1,"text-right-sort",2,"width","10%"],["mat-sort-header","IndirectAllocated",1,"text-right-sort",2,"width","10%"],["mat-sort-header","Available",1,"text-right-sort",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"d-flex","flex-column","gap-4"],["placeholder","Choose Outlets (Leave Blank to Choose All)",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["placeholder","Choose Brand",1,"w-100",3,"ngModelChange","ngModel","multiple","clearable"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],[1,"d-flex","align-items-center",2,"column-gap","8px"],["type","number","name","QuantityFrom",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"text-end"],[1,"d-flex","align-items-center"],[1,"btn","btn-sm","expand-btn"],[3,"routerLink","queryParams"],[1,"btn","btn-sm","expand-btn",3,"click"],[1,"fa","fa-chevron-down",3,"ngClass"],["colspan","100%",2,"padding-left","50px"],[1,"table","border-bottom",2,"width","100%"],[2,"background-color","#f5f5f5"],[1,"text-muted"],[2,"width","55%","color","#3b3b3b"],[2,"color","#3b3b3b"],[2,"text-align","right !important","color","#3b3b3b"],["api","inventory/GetCountInventoryComposite",3,"jumpToPage","previousPage","nextPage","reloadRowCountChange","total","pageData","reloadRowCount"]],template:function(i,t){if(i&1){let m=b();a(0,"mainpanel-cmp",1),v("textChange",function(g){return u(m),f(t.pageData().Filter.SearchText,g)||(t.pageData().Filter.SearchText=g),C(g)}),S("onSubmit",function(){return t.searchFromPageOne()}),v("filterChange",function(g){return u(m),f(t.pageData().Filter,g)||(t.pageData().Filter=g),C(g)}),E(1,2),p(2,we,3,0,"button",3),M(),E(3,4),H(4,De,23,11,"ng-template",null,0,G),M(),E(6,5),a(7,"div",6)(8,"div",7)(9,"table",8),S("matSortChange",function(g){return t.sortData(g)}),a(10,"thead",9)(11,"tr"),p(12,Te,2,1,"th",10),p(13,Pe,2,1,"th",11),p(14,Ve,2,1,"th",12),p(15,Ee,2,1,"th",13),p(16,Me,2,1,"th",14),r()(),a(17,"tbody"),L(18,Qe,8,6,null,null,Q),r()()(),p(20,Ge,2,3,"div"),r(),M(),r()}i&2&&(x("pageData",t.menuData()),y("text",t.pageData().Filter.SearchText),x("isFilterOnDropdown",!1),y("filter",t.pageData().Filter),x("column",t.column),o(2),s(t.roleService.global.Export?2:-1),o(10),s(t.column.VariantName&&t.column.VariantName.selected?12:-1),o(),s(t.column.OnHand&&t.column.OnHand.selected?13:-1),o(),s(t.column.DirectAllocated&&t.column.DirectAllocated.selected?14:-1),o(),s(t.column.IndirectAllocated&&t.column.IndirectAllocated.selected&&t.totalIndirect()>0?15:-1),o(),s(t.column.Available&&t.column.Available.selected?16:-1),o(2),W(t.infiniteList),o(2),s(t.data()?20:-1))},dependencies:[_e,Ce,xe,ge,ne,Z,te,$,ee,de,ce,ie,Ie,fe,ye,J,q,K,re,oe,ae,ve,z],styles:["[_nghost-%COMP%]{display:block}.expand-btn[_ngcontent-%COMP%]{border-radius:100px;width:30px;height:30px;transition:all .3s ease;padding:0;transform:rotate(270deg)}.expand-btn[_ngcontent-%COMP%]:hover{background-color:#eaeaea}.expand-btn[_ngcontent-%COMP%]:focus{border:none;outline:none}.expanded-icon[_ngcontent-%COMP%]{transform:rotate(90deg)}[_nghost-%COMP%] .text-right-sort .mat-sort-header-container{display:flex;justify-content:end}th.mat-header-cell[_ngcontent-%COMP%], td.mat-cell[_ngcontent-%COMP%]{text-align:right}"],changeDetection:0})};export{he as a};
@@ -1 +1 @@
1
- import{a as $e}from"./chunk-J5SPES4K.js";import{b as Ve,c as Le,d as Re,e as Be,f as We,g as je}from"./chunk-FYCVHWE5.js";import"./chunk-ZPIILEA6.js";import{b as ze}from"./chunk-7HMU6MXA.js";import"./chunk-PT6PCXOU.js";import{c as ve}from"./chunk-G53IMHKY.js";import{c as Se}from"./chunk-3EAA4CUP.js";import"./chunk-5U2B2SGN.js";import{b as be}from"./chunk-YJV74F2X.js";import"./chunk-WPCHBRKW.js";import{a as Ne,f as Ae}from"./chunk-IIJLLEMO.js";import"./chunk-PZSSTNYS.js";import{d as Fe}from"./chunk-YHZEJWGM.js";import"./chunk-VFRVMDDY.js";import"./chunk-ESZD2F4X.js";import{a as we}from"./chunk-ONECCHQ5.js";import{d as Oe,e as De,f as ke,g as Ue}from"./chunk-MGB2TYBW.js";import"./chunk-WRBKQHRI.js";import"./chunk-FS62MIXD.js";import"./chunk-BAIS4TWD.js";import"./chunk-XBINTEVI.js";import"./chunk-QSFZAHQ2.js";import"./chunk-TGQEO6S3.js";import"./chunk-ONKLHHM3.js";import"./chunk-X2OQT5MH.js";import"./chunk-XTOFMSDQ.js";import"./chunk-ZM456L6A.js";import"./chunk-F5JDPCBG.js";import"./chunk-GJQYUCDE.js";import{a as Me}from"./chunk-GA67K6KE.js";import"./chunk-3DC26I3D.js";import{a as Ee,b as Pe}from"./chunk-UHM2XEMM.js";import"./chunk-UQSKGZO5.js";import"./chunk-4BITXMRY.js";import"./chunk-2AOZZW2I.js";import"./chunk-TM2I5PAG.js";import"./chunk-JXEPD3CF.js";import"./chunk-PPMQE2JW.js";import"./chunk-UI32X6QC.js";import"./chunk-SIAVPMSP.js";import"./chunk-N5VS2V7L.js";import{a as ye,b as Ie,c as Te}from"./chunk-3V6FZIJD.js";import"./chunk-DEJ5V3PF.js";import"./chunk-T45W4CQR.js";import"./chunk-OK7LFGGQ.js";import"./chunk-VGLTFO5N.js";import"./chunk-UTSVZMZD.js";import"./chunk-BP6PECKT.js";import{a as H}from"./chunk-GNDUQZGK.js";import"./chunk-7KKUTTZ3.js";import"./chunk-ZS4XLRDB.js";import"./chunk-TYEI4SD2.js";import{b as Ce,c as he}from"./chunk-BKOMMH62.js";import"./chunk-7ESJNFN4.js";import"./chunk-JTDKDDTJ.js";import"./chunk-3TKWEWIY.js";import{ra as xe}from"./chunk-SXVOKLC4.js";import{F as B,G as ge,h as _e,p as fe}from"./chunk-AJDQZ346.js";import"./chunk-ORQMALAR.js";import"./chunk-L75R5SGH.js";import"./chunk-YY6WVNU4.js";import"./chunk-PUBGTLD3.js";import"./chunk-PPTZHIIZ.js";import{a as ce}from"./chunk-34Y4NLT2.js";import{q as ue}from"./chunk-QGYXJUX3.js";import{$a as $,Ac as ae,Ba as U,Bb as te,Cb as ie,Db as c,E as K,Eb as n,Fb as o,Fc as g,Gb as v,Gc as C,Hc as pe,I as Y,Kb as E,Lb as P,Pa as X,Pb as w,Sb as f,Sc as Q,Tc as L,Ua as p,Ub as s,Vb as ne,Wb as G,Y as j,Yb as F,Zb as N,_b as A,aa as J,cc as V,db as I,ea as z,ec as oe,hc as r,ib as Z,ic as d,j as q,jb as T,jc as y,kd as me,mc as O,nc as D,oa as M,oc as k,qd as se,ra as u,sa as _,ud as de,wb as S,xc as re,xd as R,yb as b,yc as le,zb as ee}from"./chunk-7D344CRC.js";import"./chunk-NF7PG5F2.js";var qe=["stepperRef"],Ke=[[["preview"]],[["complete"]]],Ye=["preview","complete"];function Je(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function Xe(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function Ze(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function et(t,a){t&1&&(v(0,"i",8),n(1,"span"),r(2,"Upload"),o())}function tt(t,a){if(t&1){let e=w();n(0,"div",9)(1,"div",10)(2,"POS-uppy",11),f("fileUploaded",function(i){u(e);let m=s(2);return _(m.onDropFile(i))}),o()(),n(3,"div",12)(4,"p",13),r(5," Please refer this "),n(6,"a",14),r(7,"article"),o(),r(8," for more information "),o()()()}if(t&2){let e=s(2);p(2),c("sampleUrl",e.sampleUrl())("subtitle","Accepted file formats: .csv & max file size: 1 MB"),p(4),c("href",e.articleLink(),X)}}function it(t,a){if(t&1&&S(0,tt,9,3,"div",9),t&2){s();let e=V(1);b(e.selectedIndex===0?0:-1)}}function nt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function ot(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function rt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function lt(t,a){t&1&&(v(0,"i",15),n(1,"span"),r(2,"Preview"),o())}function at(t,a){t&1&&G(0)}function pt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function mt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function st(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function dt(t,a){t&1&&(v(0,"i",16),n(1,"span"),r(2,"Finish"),o())}function ct(t,a){t&1&&G(0,1)}var h=(function(t){return t[t.UPLOAD=0]="UPLOAD",t[t.PREVIEW=1]="PREVIEW",t[t.COMPLETE=2]="COMPLETE",t})(h||{}),Qe=(()=>{class t{constructor(){this.sampleUrl=L(""),this.articleLink=L(),this._onDropFile=Q({alias:"onDropFile"}),this.disabledEdit=L(!1),this._onStateChange=Q({alias:"onStateChange"}),console.log("Import Stepper Component Initialized")}get stepper(){return this._stepper}nextStep(){this._stepper&&(this.stepper.selected&&(this.stepper.selected.completed=!0),this._stepper.next())}previousStep(){this._stepper&&this._stepper.previous()}resetStep(){this._stepper&&this._stepper.reset()}onStepChange(e){e.selectedIndex===1?this._onStateChange.emit(h.PREVIEW):e.selectedIndex===2?this._onStateChange.emit(h.COMPLETE):this._onStateChange.emit(h.UPLOAD)}onDropFile(e){this._onDropFile.emit(e)}onRemoveFile(){}stateUpload(){}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=I({type:t,selectors:[["pos-import-stepper"]],viewQuery:function(l,i){if(l&1&&F(qe,5),l&2){let m;N(m=A())&&(i._stepper=m.first)}},inputs:{sampleUrl:[1,"sampleUrl"],articleLink:[1,"articleLink"],disabledEdit:[1,"disabledEdit"]},outputs:{_onDropFile:"onDropFile",_onStateChange:"onStateChange"},ngContentSelectors:Ye,decls:20,vars:7,consts:[["stepperRef",""],[3,"selectionChange","linear"],[3,"completed","editable"],["matStepperIcon","done"],["matStepperIcon","create"],["matStepperIcon","edit"],["matStepLabel",""],["matStepContent",""],[1,"fa-solid","fa-upload","me-3"],[1,"d-flex","flex-column","align-items-center","justify-content-center","gap-2"],[2,"max-width","580px"],["file","",3,"fileUploaded","sampleUrl","subtitle"],[1,"d-flex","w-100",2,"max-width","580px"],[1,"fst-italic"],["target","_blank",3,"href"],[1,"fa-regular","fa-file","me-3"],[1,"fa-solid","fa-check","me-3"]],template:function(l,i){l&1&&(ne(Ke),n(0,"mat-stepper",1,0),f("selectionChange",function(x){return i.onStepChange(x)}),n(2,"mat-step",2),T(3,Je,1,1,"ng-template",3)(4,Xe,1,1,"ng-template",4)(5,Ze,1,1,"ng-template",5)(6,et,3,0,"ng-template",6)(7,it,1,1,"ng-template",7),o(),n(8,"mat-step",2),T(9,nt,1,1,"ng-template",3)(10,ot,1,1,"ng-template",4)(11,rt,1,1,"ng-template",5)(12,lt,3,0,"ng-template",6)(13,at,1,0,"ng-template",7),o(),n(14,"mat-step",2),T(15,pt,1,1,"ng-template",3)(16,mt,1,1,"ng-template",4)(17,st,1,1,"ng-template",5)(18,dt,3,0,"ng-template",6)(19,ct,1,0,"ng-template",7),o()()),l&2&&(c("linear",!0),p(2),c("completed",!1)("editable",!i.disabledEdit()),p(6),c("completed",!1)("editable",!i.disabledEdit()),p(6),c("completed",!1)("editable",!1))},dependencies:[Se,B,ge,be,ve,ze,Fe,je,Be,Ve,We,Le,Re],styles:[".mat-horizontal-stepper-header-container{width:50%!important;margin:0 auto} .mat-horizontal-stepper-wrapper{gap:1rem} .mat-horizontal-stepper-content{display:flex;justify-content:center} p-table .p-datatable-tbody>tr{border-bottom-width:1px;border-color:#dee2e6} p-table .p-datatable-tbody>tr>th{font-family:Roboto,system-ui!important;font-weight:400;font-style:normal} .p-datatable .p-datatable-wrapper .p-datatable-table .p-datatable-thead>tr>th{font-family:Roboto,Courier,monospace;font-weight:700;font-style:normal;color:#333} .p-datatable .p-datatable-wrapper .p-datatable-table .p-datatable-tbody>tr>td{font-family:Roboto,Courier,monospace;font-weight:400;font-style:normal;color:#333}"]})}}return t})();var W=class t{configModal=new Ce;dialogRef=M(ye);data=M(Ie);constructor(){this.initDialogConfig()}initDialogConfig(){this.configModal.title="Preview Summary",this.configModal.hideCancel=!0,this.configModal.okText="Import (F2)",this.configModal.customWidth="500px"}onOk(){this.dialogRef.close(!0)}onClose(){this.dialogRef.close(!1)}ngOnInit(){}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=I({type:t,selectors:[["app-dialog-import-preview"]],decls:30,vars:10,consts:[[3,"onOk","onCancel","onClose","config"],[1,"card","mb-0"],[1,"card-header","py-6","bg-gradient-success"],[1,"card-body"],[1,"row"],[1,"col"],[1,"d-flex","flex-column","gap-2"],[2,"font-size","1.9rem"],[2,"font-size","1rem"]],template:function(e,l){e&1&&(n(0,"modal-material",0),f("onOk",function(){return l.onOk()})("onCancel",function(){return l.onClose()})("onClose",function(){return l.onClose()}),v(1,"header"),n(2,"content")(3,"div",1)(4,"div",2)(5,"h3"),r(6,"Import Summary"),o()(),n(7,"div",3)(8,"div",4)(9,"div",5)(10,"div",6)(11,"span",7),r(12),g(13,"number"),o(),n(14,"span",8),r(15,"New Outlet"),o()()(),n(16,"div",5)(17,"div",6)(18,"span",7),r(19),g(20,"number"),o(),n(21,"span",8),r(22,"Update Outlet"),o()()(),n(23,"div",5)(24,"div",6)(25,"span",7),r(26),g(27,"number"),o(),n(28,"span",8),r(29,"New Outlet Group"),o()()()()()()()()),e&2&&(c("config",l.configModal),p(12),d(C(13,4,l.data==null?null:l.data.new)),p(7),d(C(20,6,l.data==null?null:l.data.update)),p(7),d(C(27,8,l.data==null?null:l.data.newOutletGroup)))},dependencies:[R,he,de],encapsulation:2})};var ft=["importStepper"],gt=()=>({"min-width":"50rem"}),Ct=(t,a,e)=>({"btn-success":t,"btn-outline-secondary":a,"not-allowed":e}),ht=t=>({"mb-1":t});function xt(t,a){if(t&1){let e=w();n(0,"button",14),f("click",function(){u(e);let i=s();return _(i.onPreviousStep())}),r(1," Back "),o()}}function St(t,a){if(t&1){let e=w();n(0,"button",15),g(1,"async"),g(2,"async"),f("click",function(){u(e);let i=s();return _(i.onNextStep())}),r(3," Next "),o()}if(t&2){let e,l,i=s();c("ngClass",ae(6,Ct,i.currentState()===1,i.currentState()!==1,!((e=C(1,2,i.importPreview$))!=null&&e.CanProceed)))("disabled",!((l=C(2,4,i.importPreview$))!=null&&l.CanProceed)&&i.currentState()===1)}}function bt(t,a){if(t&1){let e=w();n(0,"button",14),f("click",function(){u(e);let i=s();return _(i.onReset())}),r(1," New "),o()}}function vt(t,a){if(t&1){let e=w();n(0,"tr")(1,"th",16),r(2,"Name"),o(),n(3,"th",17),r(4,"Code"),o(),n(5,"th",18),r(6," Status "),n(7,"i",19),f("click",function(i){u(e);let m=V(9);return _(m.toggle(i))}),o(),n(8,"p-popover",null,1)(10,"div",20)(11,"div",21)(12,"p-checkbox",22),f("ngModelChange",function(i){u(e);let m=s();return _(m.selectAll(i))}),o(),n(13,"label",23),r(14,"All"),o()(),n(15,"div",24)(16,"p-checkbox",25),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(17,"label",26),r(18,"Unchanged"),o()(),n(19,"div",24)(20,"p-checkbox",27),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(21,"label",28),r(22,"New"),o()(),n(23,"div",24)(24,"p-checkbox",29),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(25,"label",30),r(26,"Error"),o()(),n(27,"div",24)(28,"p-checkbox",31),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(29,"label",32),r(30,"Update"),o()()()()(),n(31,"th"),r(32,"Message"),o()()}if(t&2){let e=s();p(12),c("ngModel",e.pickAll),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition)}}function wt(t,a){if(t&1&&(n(0,"div",33)(1,"span",34),r(2),o(),n(3,"span"),r(4),o()()),t&2){let e=a.$implicit,l=a.$index,i=s().$implicit;c("ngClass",le(3,ht,l<i.Issues.length-1)),p(2),y(" ",e.Issue,". "),p(2),y("",e.Solution," ")}}function yt(t,a){if(t&1&&(n(0,"tr")(1,"td"),r(2),o(),n(3,"td"),r(4),o(),n(5,"td"),r(6),o(),n(7,"td"),te(8,wt,5,5,"div",33,ee),o()()),t&2){let e=a.$implicit;p(2),d(e.Name),p(2),d(e.Code),p(),oe("bg-gradient-success",e.Action=="New")("bg-gradient-warning",e.Action=="Update")("bg-gradient-danger",e.Action=="Error"),p(),y(" ",e.Action," "),p(2),ie(e.Issues)}}function It(t,a){if(t&1&&(n(0,"div",37)(1,"span"),r(2),o(),r(3,", "),n(4,"span"),r(5),o(),n(6,"span"),r(7),o(),n(8,"span"),r(9,"succesfully imported"),o()()),t&2){let e=a;p(2),y("",e==null?null:e.Summary.NewOutlet," New Outlets"),p(3),y("",e==null?null:e.Summary.UpdateOutlet," Updated Outlets"),p(2),y("and ",e==null?null:e.Summary.NewOutletGroup," New Outlet Group")}}function Tt(t,a){if(t&1&&(n(0,"div",13),v(1,"i",35),n(2,"h1",36),r(3,"Upload Complete!"),o(),S(4,It,10,3,"div",37),g(5,"async"),o()),t&2){let e,l=s();p(4),b((e=C(5,1,l.importPreview$))?4:-1,e)}}var He=class t extends we{constructor(e,l){super(e);this.httpService=l;this.menuData$.subscribe()}httpService;pickAll=["All"];filterTreeCondition=["Unchanged","New","Error","Update"];importStepper;fileToImport=U(null);importPreview$;sampleImportFileUrl=ce.files.csv.outlet_import;articleLink="https://support.dealpos.com/en/articles/11069092-import-new-outlet";currentState=U(h.UPLOAD);confirmImport$;importPreview=U(null);dialog=M(Te);onDropFile(e){this.fileToImport.set(e)}onNextStep(){switch(this.currentState()){case h.UPLOAD:this.onPreviewImport();break;case h.PREVIEW:this.onImport();break;default:break}}onPreviousStep(){this.importStepper.previousStep()}onReset(){this.importPreview.set(null),this.importPreview$=null,this.confirmImport$=null,this.fileToImport.set(null),this.currentState.update(()=>h.UPLOAD),this.importStepper.resetStep()}onStateChange(e){this.currentState.update(()=>e)}onPreviewImport(){this.pickAll=["All"],this.filterTreeCondition=["Unchanged","New","Error","Update"];let e=new FormData;e.append("file",this.fileToImport()),this.importPreview$=this.httpService.postFormData(H.previewImportOutlet,e).pipe(z(l=>{this.importPreview.set(l),this.importStepper.nextStep()}),j(1))}onImport(){this.confirmImport$=this.dialog.open(W,{data:{new:this.importPreview()?.Summary?.NewOutlet,update:this.importPreview()?.Summary?.UpdateOutlet,newOutletGroup:this.importPreview()?.Summary?.NewOutletGroup}}).afterClosed().pipe(K(e=>e==!0),J(()=>this.httpService.post(H.importOutlet,{CacheKey:this.importPreview()?.CacheKey})),z(e=>{this.importStepper.nextStep()}),Y(e=>(this.pickAll=[],this.filterTreeCondition=["Error"],q)),j(1))}selectAll(e){this.pickAll=e,this.pickAll.length==0?this.filterTreeCondition=[]:this.filterTreeCondition=["Unchanged","New","Error","Update"]}static \u0275fac=function(l){return new(l||t)($(Me),$(ue))};static \u0275cmp=I({type:t,selectors:[["app-outlet-import"]],viewQuery:function(l,i){if(l&1&&F(ft,5),l&2){let m;N(m=A())&&(i.importStepper=m.first)}},features:[Z],decls:17,vars:21,consts:[["importStepper",""],["op",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","actions",5,["actions"]],["type","button",1,"btn","btn-outline-secondary"],[1,"btn",3,"ngClass","disabled"],["ngProjectAs","content",5,["content"]],[3,"onDropFile","onStateChange","sampleUrl","disabledEdit","articleLink"],["ngProjectAs","preview",5,["preview"]],[1,"w-100",3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["ngProjectAs","complete",5,["complete"]],[1,"d-flex","flex-column","align-items-center"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"btn",3,"click","ngClass","disabled"],[2,"width","300px"],[2,"width","200px"],[2,"width","100px"],[1,"fa","fa-filter","pointer",3,"click"],[2,"width","150px"],[1,"border-bottom","pb-3","d-flex","align-items-center","column-gap-3"],["label","Select All","name","filterTreeCondition","value","All","inputId","all",3,"ngModelChange","ngModel"],["for","all",1,"ms-2"],[1,"mt-4","d-flex","align-items-center","column-gap-3"],["label","Unchanged","name","filterTreeCondition","value","Unchanged","inputId","unchanged",3,"ngModelChange","ngModel"],["for","unchanged",1,"ms-2"],["label","New","name","filterTreeCondition","value","New","inputId","new",3,"ngModelChange","ngModel"],["for","new",1,"ms-2"],["label","Error","name","filterTreeCondition","value","Error","inputId","error",3,"ngModelChange","ngModel"],["for","error",1,"ms-2"],["label","Updated","name","filterTreeCondition","value","Update","inputId","update",3,"ngModelChange","ngModel"],["for","update",1,"ms-2"],[3,"ngClass"],[1,"me-1"],[1,"fa-solid","fa-circle-check","text-success",2,"font-size","110px"],[1,"mt-8"],[1,"d-flex","gap-2","fw-normal","fs-4","mt-2"]],template:function(l,i){if(l&1&&(n(0,"mainpanel-cmp",2),E(1,3),S(2,xt,2,0,"button",4),S(3,St,4,10,"button",5),S(4,bt,2,0,"button",4),P(),E(5,6),n(6,"pos-import-stepper",7,0),f("onDropFile",function(x){return i.onDropFile(x)})("onStateChange",function(x){return i.onStateChange(x)}),E(8,8),n(9,"p-table",9),g(10,"async"),g(11,"filterTree"),T(12,vt,33,5,"ng-template",10)(13,yt,10,9,"ng-template",11),o(),P(),E(14,12),S(15,Tt,6,3,"div",13),g(16,"async"),P(),o(),P(),o()),l&2){let m,x;c("pageData",i.menuData())("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),b(i.currentState()==1?2:-1),p(),b(i.fileToImport()&&((m=i.fileToImport())==null?null:m.size)>0&&i.currentState()<2?3:-1),p(),b(i.currentState()===2?4:-1),p(2),c("sampleUrl",i.sampleImportFileUrl)("disabledEdit",i.currentState()===2)("articleLink",i.articleLink),p(3),c("value",pe(11,15,(x=C(10,13,i.importPreview$))==null?null:x.DataRow,i.filterTreeCondition))("scrollable",!0)("tableStyle",re(20,gt)),p(6),b(C(16,18,i.confirmImport$)?15:-1)}},dependencies:[R,me,Qe,Ue,ke,Ae,Ne,xe,Pe,Ee,B,_e,fe,De,Oe,se,$e],encapsulation:2})};export{He as OutletImportComponent};
1
+ import{a as $e}from"./chunk-J5SPES4K.js";import{b as Ve,c as Le,d as Re,e as Be,f as We,g as je}from"./chunk-FYCVHWE5.js";import"./chunk-ZPIILEA6.js";import{b as ze}from"./chunk-7HMU6MXA.js";import"./chunk-PT6PCXOU.js";import{c as ve}from"./chunk-G53IMHKY.js";import{c as Se}from"./chunk-3EAA4CUP.js";import"./chunk-5U2B2SGN.js";import{b as be}from"./chunk-YJV74F2X.js";import"./chunk-WPCHBRKW.js";import{a as Ne,f as Ae}from"./chunk-IIJLLEMO.js";import"./chunk-PZSSTNYS.js";import{d as Fe}from"./chunk-YHZEJWGM.js";import"./chunk-VFRVMDDY.js";import"./chunk-ESZD2F4X.js";import{a as we}from"./chunk-ONECCHQ5.js";import{d as Oe,e as De,f as ke,g as Ue}from"./chunk-UOUKOBPM.js";import"./chunk-WRBKQHRI.js";import"./chunk-FS62MIXD.js";import"./chunk-BAIS4TWD.js";import"./chunk-XBINTEVI.js";import"./chunk-QSFZAHQ2.js";import"./chunk-TGQEO6S3.js";import"./chunk-ONKLHHM3.js";import"./chunk-X2OQT5MH.js";import"./chunk-XTOFMSDQ.js";import"./chunk-ZM456L6A.js";import"./chunk-F5JDPCBG.js";import"./chunk-X62J3DRC.js";import{a as Me}from"./chunk-NFOVMPUD.js";import"./chunk-3DC26I3D.js";import{a as Ee,b as Pe}from"./chunk-UHM2XEMM.js";import"./chunk-UQSKGZO5.js";import"./chunk-4BITXMRY.js";import"./chunk-2AOZZW2I.js";import"./chunk-TM2I5PAG.js";import"./chunk-JXEPD3CF.js";import"./chunk-PPMQE2JW.js";import"./chunk-UI32X6QC.js";import"./chunk-SIAVPMSP.js";import"./chunk-N5VS2V7L.js";import{a as ye,b as Ie,c as Te}from"./chunk-3V6FZIJD.js";import"./chunk-DEJ5V3PF.js";import"./chunk-T45W4CQR.js";import"./chunk-OK7LFGGQ.js";import"./chunk-VGLTFO5N.js";import"./chunk-UTSVZMZD.js";import"./chunk-BP6PECKT.js";import{a as H}from"./chunk-GNDUQZGK.js";import"./chunk-7KKUTTZ3.js";import"./chunk-ZS4XLRDB.js";import"./chunk-TYEI4SD2.js";import{b as Ce,c as he}from"./chunk-BKOMMH62.js";import"./chunk-7ESJNFN4.js";import"./chunk-JTDKDDTJ.js";import"./chunk-3TKWEWIY.js";import{ra as xe}from"./chunk-SXVOKLC4.js";import{F as B,G as ge,h as _e,p as fe}from"./chunk-AJDQZ346.js";import"./chunk-W4GUAUTS.js";import"./chunk-SJNTFNWD.js";import"./chunk-YY6WVNU4.js";import"./chunk-PUBGTLD3.js";import"./chunk-PPTZHIIZ.js";import{a as ce}from"./chunk-WKPO4QSK.js";import{q as ue}from"./chunk-QGYXJUX3.js";import{$a as $,Ac as ae,Ba as U,Bb as te,Cb as ie,Db as c,E as K,Eb as n,Fb as o,Fc as g,Gb as v,Gc as C,Hc as pe,I as Y,Kb as E,Lb as P,Pa as X,Pb as w,Sb as f,Sc as Q,Tc as L,Ua as p,Ub as s,Vb as ne,Wb as G,Y as j,Yb as F,Zb as N,_b as A,aa as J,cc as V,db as I,ea as z,ec as oe,hc as r,ib as Z,ic as d,j as q,jb as T,jc as y,kd as me,mc as O,nc as D,oa as M,oc as k,qd as se,ra as u,sa as _,ud as de,wb as S,xc as re,xd as R,yb as b,yc as le,zb as ee}from"./chunk-7D344CRC.js";import"./chunk-NF7PG5F2.js";var qe=["stepperRef"],Ke=[[["preview"]],[["complete"]]],Ye=["preview","complete"];function Je(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function Xe(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function Ze(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function et(t,a){t&1&&(v(0,"i",8),n(1,"span"),r(2,"Upload"),o())}function tt(t,a){if(t&1){let e=w();n(0,"div",9)(1,"div",10)(2,"POS-uppy",11),f("fileUploaded",function(i){u(e);let m=s(2);return _(m.onDropFile(i))}),o()(),n(3,"div",12)(4,"p",13),r(5," Please refer this "),n(6,"a",14),r(7,"article"),o(),r(8," for more information "),o()()()}if(t&2){let e=s(2);p(2),c("sampleUrl",e.sampleUrl())("subtitle","Accepted file formats: .csv & max file size: 1 MB"),p(4),c("href",e.articleLink(),X)}}function it(t,a){if(t&1&&S(0,tt,9,3,"div",9),t&2){s();let e=V(1);b(e.selectedIndex===0?0:-1)}}function nt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function ot(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function rt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function lt(t,a){t&1&&(v(0,"i",15),n(1,"span"),r(2,"Preview"),o())}function at(t,a){t&1&&G(0)}function pt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function mt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function st(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function dt(t,a){t&1&&(v(0,"i",16),n(1,"span"),r(2,"Finish"),o())}function ct(t,a){t&1&&G(0,1)}var h=(function(t){return t[t.UPLOAD=0]="UPLOAD",t[t.PREVIEW=1]="PREVIEW",t[t.COMPLETE=2]="COMPLETE",t})(h||{}),Qe=(()=>{class t{constructor(){this.sampleUrl=L(""),this.articleLink=L(),this._onDropFile=Q({alias:"onDropFile"}),this.disabledEdit=L(!1),this._onStateChange=Q({alias:"onStateChange"}),console.log("Import Stepper Component Initialized")}get stepper(){return this._stepper}nextStep(){this._stepper&&(this.stepper.selected&&(this.stepper.selected.completed=!0),this._stepper.next())}previousStep(){this._stepper&&this._stepper.previous()}resetStep(){this._stepper&&this._stepper.reset()}onStepChange(e){e.selectedIndex===1?this._onStateChange.emit(h.PREVIEW):e.selectedIndex===2?this._onStateChange.emit(h.COMPLETE):this._onStateChange.emit(h.UPLOAD)}onDropFile(e){this._onDropFile.emit(e)}onRemoveFile(){}stateUpload(){}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=I({type:t,selectors:[["pos-import-stepper"]],viewQuery:function(l,i){if(l&1&&F(qe,5),l&2){let m;N(m=A())&&(i._stepper=m.first)}},inputs:{sampleUrl:[1,"sampleUrl"],articleLink:[1,"articleLink"],disabledEdit:[1,"disabledEdit"]},outputs:{_onDropFile:"onDropFile",_onStateChange:"onStateChange"},ngContentSelectors:Ye,decls:20,vars:7,consts:[["stepperRef",""],[3,"selectionChange","linear"],[3,"completed","editable"],["matStepperIcon","done"],["matStepperIcon","create"],["matStepperIcon","edit"],["matStepLabel",""],["matStepContent",""],[1,"fa-solid","fa-upload","me-3"],[1,"d-flex","flex-column","align-items-center","justify-content-center","gap-2"],[2,"max-width","580px"],["file","",3,"fileUploaded","sampleUrl","subtitle"],[1,"d-flex","w-100",2,"max-width","580px"],[1,"fst-italic"],["target","_blank",3,"href"],[1,"fa-regular","fa-file","me-3"],[1,"fa-solid","fa-check","me-3"]],template:function(l,i){l&1&&(ne(Ke),n(0,"mat-stepper",1,0),f("selectionChange",function(x){return i.onStepChange(x)}),n(2,"mat-step",2),T(3,Je,1,1,"ng-template",3)(4,Xe,1,1,"ng-template",4)(5,Ze,1,1,"ng-template",5)(6,et,3,0,"ng-template",6)(7,it,1,1,"ng-template",7),o(),n(8,"mat-step",2),T(9,nt,1,1,"ng-template",3)(10,ot,1,1,"ng-template",4)(11,rt,1,1,"ng-template",5)(12,lt,3,0,"ng-template",6)(13,at,1,0,"ng-template",7),o(),n(14,"mat-step",2),T(15,pt,1,1,"ng-template",3)(16,mt,1,1,"ng-template",4)(17,st,1,1,"ng-template",5)(18,dt,3,0,"ng-template",6)(19,ct,1,0,"ng-template",7),o()()),l&2&&(c("linear",!0),p(2),c("completed",!1)("editable",!i.disabledEdit()),p(6),c("completed",!1)("editable",!i.disabledEdit()),p(6),c("completed",!1)("editable",!1))},dependencies:[Se,B,ge,be,ve,ze,Fe,je,Be,Ve,We,Le,Re],styles:[".mat-horizontal-stepper-header-container{width:50%!important;margin:0 auto} .mat-horizontal-stepper-wrapper{gap:1rem} .mat-horizontal-stepper-content{display:flex;justify-content:center} p-table .p-datatable-tbody>tr{border-bottom-width:1px;border-color:#dee2e6} p-table .p-datatable-tbody>tr>th{font-family:Roboto,system-ui!important;font-weight:400;font-style:normal} .p-datatable .p-datatable-wrapper .p-datatable-table .p-datatable-thead>tr>th{font-family:Roboto,Courier,monospace;font-weight:700;font-style:normal;color:#333} .p-datatable .p-datatable-wrapper .p-datatable-table .p-datatable-tbody>tr>td{font-family:Roboto,Courier,monospace;font-weight:400;font-style:normal;color:#333}"]})}}return t})();var W=class t{configModal=new Ce;dialogRef=M(ye);data=M(Ie);constructor(){this.initDialogConfig()}initDialogConfig(){this.configModal.title="Preview Summary",this.configModal.hideCancel=!0,this.configModal.okText="Import (F2)",this.configModal.customWidth="500px"}onOk(){this.dialogRef.close(!0)}onClose(){this.dialogRef.close(!1)}ngOnInit(){}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=I({type:t,selectors:[["app-dialog-import-preview"]],decls:30,vars:10,consts:[[3,"onOk","onCancel","onClose","config"],[1,"card","mb-0"],[1,"card-header","py-6","bg-gradient-success"],[1,"card-body"],[1,"row"],[1,"col"],[1,"d-flex","flex-column","gap-2"],[2,"font-size","1.9rem"],[2,"font-size","1rem"]],template:function(e,l){e&1&&(n(0,"modal-material",0),f("onOk",function(){return l.onOk()})("onCancel",function(){return l.onClose()})("onClose",function(){return l.onClose()}),v(1,"header"),n(2,"content")(3,"div",1)(4,"div",2)(5,"h3"),r(6,"Import Summary"),o()(),n(7,"div",3)(8,"div",4)(9,"div",5)(10,"div",6)(11,"span",7),r(12),g(13,"number"),o(),n(14,"span",8),r(15,"New Outlet"),o()()(),n(16,"div",5)(17,"div",6)(18,"span",7),r(19),g(20,"number"),o(),n(21,"span",8),r(22,"Update Outlet"),o()()(),n(23,"div",5)(24,"div",6)(25,"span",7),r(26),g(27,"number"),o(),n(28,"span",8),r(29,"New Outlet Group"),o()()()()()()()()),e&2&&(c("config",l.configModal),p(12),d(C(13,4,l.data==null?null:l.data.new)),p(7),d(C(20,6,l.data==null?null:l.data.update)),p(7),d(C(27,8,l.data==null?null:l.data.newOutletGroup)))},dependencies:[R,he,de],encapsulation:2})};var ft=["importStepper"],gt=()=>({"min-width":"50rem"}),Ct=(t,a,e)=>({"btn-success":t,"btn-outline-secondary":a,"not-allowed":e}),ht=t=>({"mb-1":t});function xt(t,a){if(t&1){let e=w();n(0,"button",14),f("click",function(){u(e);let i=s();return _(i.onPreviousStep())}),r(1," Back "),o()}}function St(t,a){if(t&1){let e=w();n(0,"button",15),g(1,"async"),g(2,"async"),f("click",function(){u(e);let i=s();return _(i.onNextStep())}),r(3," Next "),o()}if(t&2){let e,l,i=s();c("ngClass",ae(6,Ct,i.currentState()===1,i.currentState()!==1,!((e=C(1,2,i.importPreview$))!=null&&e.CanProceed)))("disabled",!((l=C(2,4,i.importPreview$))!=null&&l.CanProceed)&&i.currentState()===1)}}function bt(t,a){if(t&1){let e=w();n(0,"button",14),f("click",function(){u(e);let i=s();return _(i.onReset())}),r(1," New "),o()}}function vt(t,a){if(t&1){let e=w();n(0,"tr")(1,"th",16),r(2,"Name"),o(),n(3,"th",17),r(4,"Code"),o(),n(5,"th",18),r(6," Status "),n(7,"i",19),f("click",function(i){u(e);let m=V(9);return _(m.toggle(i))}),o(),n(8,"p-popover",null,1)(10,"div",20)(11,"div",21)(12,"p-checkbox",22),f("ngModelChange",function(i){u(e);let m=s();return _(m.selectAll(i))}),o(),n(13,"label",23),r(14,"All"),o()(),n(15,"div",24)(16,"p-checkbox",25),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(17,"label",26),r(18,"Unchanged"),o()(),n(19,"div",24)(20,"p-checkbox",27),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(21,"label",28),r(22,"New"),o()(),n(23,"div",24)(24,"p-checkbox",29),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(25,"label",30),r(26,"Error"),o()(),n(27,"div",24)(28,"p-checkbox",31),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(29,"label",32),r(30,"Update"),o()()()()(),n(31,"th"),r(32,"Message"),o()()}if(t&2){let e=s();p(12),c("ngModel",e.pickAll),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition)}}function wt(t,a){if(t&1&&(n(0,"div",33)(1,"span",34),r(2),o(),n(3,"span"),r(4),o()()),t&2){let e=a.$implicit,l=a.$index,i=s().$implicit;c("ngClass",le(3,ht,l<i.Issues.length-1)),p(2),y(" ",e.Issue,". "),p(2),y("",e.Solution," ")}}function yt(t,a){if(t&1&&(n(0,"tr")(1,"td"),r(2),o(),n(3,"td"),r(4),o(),n(5,"td"),r(6),o(),n(7,"td"),te(8,wt,5,5,"div",33,ee),o()()),t&2){let e=a.$implicit;p(2),d(e.Name),p(2),d(e.Code),p(),oe("bg-gradient-success",e.Action=="New")("bg-gradient-warning",e.Action=="Update")("bg-gradient-danger",e.Action=="Error"),p(),y(" ",e.Action," "),p(2),ie(e.Issues)}}function It(t,a){if(t&1&&(n(0,"div",37)(1,"span"),r(2),o(),r(3,", "),n(4,"span"),r(5),o(),n(6,"span"),r(7),o(),n(8,"span"),r(9,"succesfully imported"),o()()),t&2){let e=a;p(2),y("",e==null?null:e.Summary.NewOutlet," New Outlets"),p(3),y("",e==null?null:e.Summary.UpdateOutlet," Updated Outlets"),p(2),y("and ",e==null?null:e.Summary.NewOutletGroup," New Outlet Group")}}function Tt(t,a){if(t&1&&(n(0,"div",13),v(1,"i",35),n(2,"h1",36),r(3,"Upload Complete!"),o(),S(4,It,10,3,"div",37),g(5,"async"),o()),t&2){let e,l=s();p(4),b((e=C(5,1,l.importPreview$))?4:-1,e)}}var He=class t extends we{constructor(e,l){super(e);this.httpService=l;this.menuData$.subscribe()}httpService;pickAll=["All"];filterTreeCondition=["Unchanged","New","Error","Update"];importStepper;fileToImport=U(null);importPreview$;sampleImportFileUrl=ce.files.csv.outlet_import;articleLink="https://support.dealpos.com/en/articles/11069092-import-new-outlet";currentState=U(h.UPLOAD);confirmImport$;importPreview=U(null);dialog=M(Te);onDropFile(e){this.fileToImport.set(e)}onNextStep(){switch(this.currentState()){case h.UPLOAD:this.onPreviewImport();break;case h.PREVIEW:this.onImport();break;default:break}}onPreviousStep(){this.importStepper.previousStep()}onReset(){this.importPreview.set(null),this.importPreview$=null,this.confirmImport$=null,this.fileToImport.set(null),this.currentState.update(()=>h.UPLOAD),this.importStepper.resetStep()}onStateChange(e){this.currentState.update(()=>e)}onPreviewImport(){this.pickAll=["All"],this.filterTreeCondition=["Unchanged","New","Error","Update"];let e=new FormData;e.append("file",this.fileToImport()),this.importPreview$=this.httpService.postFormData(H.previewImportOutlet,e).pipe(z(l=>{this.importPreview.set(l),this.importStepper.nextStep()}),j(1))}onImport(){this.confirmImport$=this.dialog.open(W,{data:{new:this.importPreview()?.Summary?.NewOutlet,update:this.importPreview()?.Summary?.UpdateOutlet,newOutletGroup:this.importPreview()?.Summary?.NewOutletGroup}}).afterClosed().pipe(K(e=>e==!0),J(()=>this.httpService.post(H.importOutlet,{CacheKey:this.importPreview()?.CacheKey})),z(e=>{this.importStepper.nextStep()}),Y(e=>(this.pickAll=[],this.filterTreeCondition=["Error"],q)),j(1))}selectAll(e){this.pickAll=e,this.pickAll.length==0?this.filterTreeCondition=[]:this.filterTreeCondition=["Unchanged","New","Error","Update"]}static \u0275fac=function(l){return new(l||t)($(Me),$(ue))};static \u0275cmp=I({type:t,selectors:[["app-outlet-import"]],viewQuery:function(l,i){if(l&1&&F(ft,5),l&2){let m;N(m=A())&&(i.importStepper=m.first)}},features:[Z],decls:17,vars:21,consts:[["importStepper",""],["op",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","actions",5,["actions"]],["type","button",1,"btn","btn-outline-secondary"],[1,"btn",3,"ngClass","disabled"],["ngProjectAs","content",5,["content"]],[3,"onDropFile","onStateChange","sampleUrl","disabledEdit","articleLink"],["ngProjectAs","preview",5,["preview"]],[1,"w-100",3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["ngProjectAs","complete",5,["complete"]],[1,"d-flex","flex-column","align-items-center"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"btn",3,"click","ngClass","disabled"],[2,"width","300px"],[2,"width","200px"],[2,"width","100px"],[1,"fa","fa-filter","pointer",3,"click"],[2,"width","150px"],[1,"border-bottom","pb-3","d-flex","align-items-center","column-gap-3"],["label","Select All","name","filterTreeCondition","value","All","inputId","all",3,"ngModelChange","ngModel"],["for","all",1,"ms-2"],[1,"mt-4","d-flex","align-items-center","column-gap-3"],["label","Unchanged","name","filterTreeCondition","value","Unchanged","inputId","unchanged",3,"ngModelChange","ngModel"],["for","unchanged",1,"ms-2"],["label","New","name","filterTreeCondition","value","New","inputId","new",3,"ngModelChange","ngModel"],["for","new",1,"ms-2"],["label","Error","name","filterTreeCondition","value","Error","inputId","error",3,"ngModelChange","ngModel"],["for","error",1,"ms-2"],["label","Updated","name","filterTreeCondition","value","Update","inputId","update",3,"ngModelChange","ngModel"],["for","update",1,"ms-2"],[3,"ngClass"],[1,"me-1"],[1,"fa-solid","fa-circle-check","text-success",2,"font-size","110px"],[1,"mt-8"],[1,"d-flex","gap-2","fw-normal","fs-4","mt-2"]],template:function(l,i){if(l&1&&(n(0,"mainpanel-cmp",2),E(1,3),S(2,xt,2,0,"button",4),S(3,St,4,10,"button",5),S(4,bt,2,0,"button",4),P(),E(5,6),n(6,"pos-import-stepper",7,0),f("onDropFile",function(x){return i.onDropFile(x)})("onStateChange",function(x){return i.onStateChange(x)}),E(8,8),n(9,"p-table",9),g(10,"async"),g(11,"filterTree"),T(12,vt,33,5,"ng-template",10)(13,yt,10,9,"ng-template",11),o(),P(),E(14,12),S(15,Tt,6,3,"div",13),g(16,"async"),P(),o(),P(),o()),l&2){let m,x;c("pageData",i.menuData())("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),b(i.currentState()==1?2:-1),p(),b(i.fileToImport()&&((m=i.fileToImport())==null?null:m.size)>0&&i.currentState()<2?3:-1),p(),b(i.currentState()===2?4:-1),p(2),c("sampleUrl",i.sampleImportFileUrl)("disabledEdit",i.currentState()===2)("articleLink",i.articleLink),p(3),c("value",pe(11,15,(x=C(10,13,i.importPreview$))==null?null:x.DataRow,i.filterTreeCondition))("scrollable",!0)("tableStyle",re(20,gt)),p(6),b(C(16,18,i.confirmImport$)?15:-1)}},dependencies:[R,me,Qe,Ue,ke,Ae,Ne,xe,Pe,Ee,B,_e,fe,De,Oe,se,$e],encapsulation:2})};export{He as OutletImportComponent};
@@ -1 +1 @@
1
- import{a as o}from"./chunk-PPTZHIIZ.js";import{a as i}from"./chunk-34Y4NLT2.js";import{Ed as h,Id as d,aa as u,ka as m,oa as g,s}from"./chunk-7D344CRC.js";var c=class n{http=g(d);uploadFile(t,e){o.IsEmpty(e)&&(e="testfolder");let r=new h({"Cache-Control":"no-cache"});return this.http.put(`${i.uppy.storageHost}/api/upload/binary/${e}/${t.name}`,t,{headers:r})}uploadFileThroughPreSignedUrl(t,e,r=!0,a){o.IsEmpty(e)&&(e="testfolder");let l=new File([t],t.name.replace(/ /g,"_"),{type:t.type});return a=a||(r?"small":void 0),this.generatePreSignedURL(l,e,a).pipe(u(p=>this.http.put(p.Authorization,l).pipe(s(()=>({url:p.URL,thumbnail:p.Thumbnail})))))}uploadFileToServer(t,e){return this.uploadFile(t,e).pipe(s(r=>r.URL))}uploadWithSignedUrl(t,e){return this.http.put(t,e)}generatePreSignedURL(t,e,r){return this.http.get(`${i.uppy.storageHost}/api/GeneratePresigned/${e}/${t.name}${r?`?thumbnail=${r}`:""}`)}deleteImageInBucket(t,e){return this.http.delete(`${i.uppy.storageHost}/api/Upload/Delete/${e}/${t}`)}uploadRemoteURLToCloudflare(t){return this.http.post(`${i.uppy.storageHost}/api/upload/MultiURL`,t)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=m({token:n,factory:n.\u0275fac,providedIn:"root"})};export{c as a};
1
+ import{a as o}from"./chunk-PPTZHIIZ.js";import{a as i}from"./chunk-WKPO4QSK.js";import{Ed as h,Id as d,aa as u,ka as m,oa as g,s}from"./chunk-7D344CRC.js";var c=class n{http=g(d);uploadFile(t,e){o.IsEmpty(e)&&(e="testfolder");let r=new h({"Cache-Control":"no-cache"});return this.http.put(`${i.uppy.storageHost}/api/upload/binary/${e}/${t.name}`,t,{headers:r})}uploadFileThroughPreSignedUrl(t,e,r=!0,a){o.IsEmpty(e)&&(e="testfolder");let l=new File([t],t.name.replace(/ /g,"_"),{type:t.type});return a=a||(r?"small":void 0),this.generatePreSignedURL(l,e,a).pipe(u(p=>this.http.put(p.Authorization,l).pipe(s(()=>({url:p.URL,thumbnail:p.Thumbnail})))))}uploadFileToServer(t,e){return this.uploadFile(t,e).pipe(s(r=>r.URL))}uploadWithSignedUrl(t,e){return this.http.put(t,e)}generatePreSignedURL(t,e,r){return this.http.get(`${i.uppy.storageHost}/api/GeneratePresigned/${e}/${t.name}${r?`?thumbnail=${r}`:""}`)}deleteImageInBucket(t,e){return this.http.delete(`${i.uppy.storageHost}/api/Upload/Delete/${e}/${t}`)}uploadRemoteURLToCloudflare(t){return this.http.post(`${i.uppy.storageHost}/api/upload/MultiURL`,t)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=m({token:n,factory:n.\u0275fac,providedIn:"root"})};export{c as a};
@@ -1 +1 @@
1
- import{b as Y}from"./chunk-S77FVPQM.js";import{b as N,c as X}from"./chunk-B53CZMGZ.js";import{a as Z}from"./chunk-RQCACWGY.js";import{b as z}from"./chunk-PJHXZWSV.js";import{a as h}from"./chunk-I3WUTJXX.js";import{b as K,f as x,g as R}from"./chunk-N5VS2V7L.js";import{a as l}from"./chunk-GNDUQZGK.js";import{a as c}from"./chunk-PPTZHIIZ.js";import{a as W}from"./chunk-34Y4NLT2.js";import{n as A,q as T}from"./chunk-QGYXJUX3.js";import{E as g,I as B,M as P,P as S,aa as b,b as L,ea as $,f as d,j as U,k as O,ka as D,l as F,m as J,na as u,q as Q,s as f,ud as q}from"./chunk-7D344CRC.js";import{h as p}from"./chunk-NF7PG5F2.js";var v=class{ID;Number;Due;Date;CustomDateField;TimeCustom;SurchargePcg;TempSurchargePcg;ToP;Note;ReferenceInvoiceID;PaymentStateID;Sales;DateCustom;constructor(){this.ID=c.GuidEmpty,this.SurchargePcg=0,this.TempSurchargePcg=0,this.Due=null}};var tt=(i=>(i[i.Unsent=0]="Unsent",i[i.AwaitingCollection=1]="AwaitingCollection",i[i.Partial=2]="Partial",i[i.Sent=3]="Sent",i))(tt||{});var y=class{ID;EntityID;RegisterID;TypeID;Date;Number;CustomerID;SalesID;Discount=0;Discount2=0;DiscountAmount=0;CustomerDiscountRate=0;Note="";DeliveryOutletID;TaxTypeID;CurrencyID;CurrencyRate;PointUsed;InvoicedStateID;ReferenceNumber="";LogisticsServiceID;ParkLabel="";NumberOfPerson;ClientTimestamp;Created;PromotionCoupon="";CouponType=1;PromotionNote="";DeliveryStateID;CouponProvider="Internal";CurrencySymbol;constructor(){this.ID=c.GuidEmpty,this.EntityID=c.GuidEmpty,this.RegisterID=c.GuidEmpty,this.Number="",this.CustomerID=null,this.SalesID=null,this.Discount=0,this.Discount2=0,this.DiscountAmount=0,this.Note="",this.TaxTypeID=c.GuidEmpty,this.CurrencyID=1,this.CurrencyRate=1,this.DeliveryStateID=3,this.PointUsed=0,this.NumberOfPerson=1,this.Date=new Date}removeEnterNote(){this.Note&&(this.Note=this.Note.replace(/\n/g,""))}};var M=class{MethodID;Amount=0;Note;Index;Date;PaidAmount;Code;MethodName;InvoiceID;ID;TypeID;constructor(e,t,r,i){this.MethodID=e||0,this.Amount=t||0,this.PaidAmount=r||0,this.Date=i}};var I=class{Name;Phone;Address;City;constructor(){this.Name="",this.Phone="",this.Address="",this.City=""}};var C=class{DeliveryEntityID;Type;NewOrderID;constructor(){this.DeliveryEntityID="",this.Type=3}};var E=class{Amount;ApplyToProduct;Code;Type;TypeDescription;Coupon;Notification;MaxDiscount;Note};var m=class{Order;Invoice;Shipping;Action;Payments;Items;CartItems;Promotion;ContactName;SplitParkLabel;get cartQuantity(){let e=0;for(let t of this.CartItems)e+=t.Quantity;return e}constructor(){this.Order=new y,this.Invoice=new v,this.Shipping=new I,this.Action=new C,this.Payments=Array(),this.Items=Array(),this.CartItems=Array(),this.ContactName=""}get TotalPaidAmount(){let e=0;return this.Payments.forEach(t=>{e+=t.PaidAmount}),e}get RedeemableAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID!=1);return this.GetAmountByCart(e)}get TotalQuantity(){let e=0;return this.CartItems.forEach(t=>{t.PromotionGift||(e+=t.Quantity)}),e}get CashOnlyAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID==1);return this.GetAmountByCart(e)}get PointOnlyAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID==2);return this.GetAmountByCart(e)}get PrepaidPackageItem(){return this.CartItems.filter(t=>t.Variant.TypeID==10)}GetAmountByCart(e){let t=0;return e.forEach(r=>{t+=r.Total}),t=t*(100-this.Order.Discount)/100,t=t*(100-this.Order.Discount2)/100,t}getRewards(){return this.CartItems.filter(t=>t.PromotionGift)}};p([h(()=>y)],m.prototype,"Order",2),p([h(()=>v)],m.prototype,"Invoice",2),p([h(()=>I)],m.prototype,"Shipping",2),p([h(()=>C)],m.prototype,"Action",2),p([h(()=>M)],m.prototype,"Payments",2),p([h(()=>N)],m.prototype,"Items",2),p([h(()=>X)],m.prototype,"CartItems",2),p([h(()=>E)],m.prototype,"Promotion",2);var w=class{Success;Message;message;ObjectID;SalesOrderID;OutDeliveryID;Contact;LoyaltyPoint;InvoiceNumber;Creator;OrderTimeString;PrintMode;PaymentStateID;PaymentStateLabel;Final;InvoiceNumberResult;constructor(){this.Success=!0,this.Message="",this.ObjectID="",this.SalesOrderID="",this.OutDeliveryID="",this.Contact=null,this.LoyaltyPoint="",this.InvoiceNumber="",this.Creator="",this.OrderTimeString="",this.PrintMode=0,this.PaymentStateID=0,this.PaymentStateLabel="",this.Final=0}};var H=class s{constructor(e,t,r,i){this.httpService=e;this._localDataService=t;this._onlineStatusService=r;this._toastrService=i;this._onlineStatusService.getOnlineStatus$().subscribe(o=>{this.isOnline=o})}httpService;_localDataService;_onlineStatusService;_toastrService;_Data=new d(null);Data$=this._Data.pipe(S(),g(e=>e!==null));isOnline;get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}getSalesOrderPrint(e){return this.httpService.get("/API/POS/GetSalesOrderPrint",[{key:"TemplateID",value:e}])}submitOrder(e,t){let r=this.generatePOSDataForSubmission(e,this.isOnline);if(this.isOnline)return this.submitOnline(r).pipe(this.handleTimeOutError(r),$(i=>{i?.Success&&this._localDataService.markUnsentOrderSuccess(r,i).catch(o=>console.error("Failed to reconcile local offline order",o))}));if(t.ModuleSell.EnableOfflineTransaction)return O(this._localDataService.syncOrder(r)).pipe(f(()=>this.generateCompleteData(r)));this._toastrService.warning("Offline order is not Supported!","Info!")}uploadOfflineOrder(e){return O(this._localDataService.uploadSingleOrder(e)).pipe(b(t=>t?F(t):U),B(t=>t?.message?.includes("objectStore does not exists")?this.submitOnline(e):J(()=>t)))}submitOnline(e){return this.httpService.post(l.SubmitOrder,e,W.pos.submitOrderTimeout)}handleTimeOutError(e){return L(B(t=>{if(t instanceof Q||t?.name=="TimeoutError"){let r=this.generateCompleteData(e);this.pushNewValue(r)}throw t}))}generatePOSDataForSubmission(e,t=!0){let r=Object.assign(new m,e);r.Items=[],r.Order.CustomerID==null&&(r.Order.CustomerID=c.GuidEmpty),r.Order.SalesID==null&&(r.Order.SalesID=c.GuidEmpty);let i=1;r.Payments=r.Payments.map(a=>(a.Date=r.Order.Date,a.Index=i,i++,delete a.TypeID,a));let o=1;for(let a of r.CartItems){let n=new N;n.ID=a.ID,n.VariantID=a.VariantID,n.Quantity=a.Quantity,n.Cost=a.Cost,n.Price=a.Price,n.Discount=a.Discount,n.DiscountAmount=a.DiscountAmount,n.Note=a.Note,n.Taxable=a.Variant.Taxable,n.LoyaltyPoint=a.LoyaltyPoint,n.UnitCost=a.Cost,n.UnitPrice=a.Price,n.UnitPriceOriginal=a.UnitPriceOriginal,n.UnitExpense=a.UnitExpense,n.EntityID=a.EntityID,n.Index=o,n.LandedCost=a.LandedCost,n.UnitQuantity=a.UnitQuantity,n.PriceTypeID=a.PriceTypeID,n.PriceNote=a.PriceNote,n.Splited=a.SplitQuantity>0,n.SplitQuantity=a.SplitQuantity,n.InventoryTypeID=a.Variant.TypeID,n.SalesID="",n.Serial=a.Serial,a.SalesID&&(n.SalesID=a.SalesID),delete a.CouponDiscount,r.Items.push(n),o++}return t?(delete r.CartItems,delete r.Order.ClientTimestamp):r.Order.ClientTimestamp=new Date,r}generateCompleteData(e){let t=new w;return t.InvoiceNumber=e.Order.Number,t.OrderTimeString=new Date().toString(),t.PaymentStateID=e.Action?.Type,t.PaymentStateLabel="Offline",t.Success=!0,t.OutDeliveryID=e.Action.DeliveryEntityID,t}GetReturnInvoice(e,t){return this.httpService.get(l.ReturnInvoiceV2,[{key:"EntityID",value:t},{key:"Number",value:e}])}GetInvoiceBySoID(e){return this.httpService.get(l.GetPOSDataByID,[{key:"ID",value:e}])}UploadCSV(e,t){let r={CartItems:e,EntityID:t};return this.httpService.post(l.UploadCsv,r)}sendEmail(e,t){return new Promise((r,i)=>{this._onlineStatusService.isProductFromServer().pipe(P(1)).subscribe(o=>{if(o){let a={invoiceID:t,email:e};this.httpService.post(l.SendInvoiceEmail,a).subscribe({next:n=>{r(n)},error:n=>{i(n)}})}else i(K.wrongOfflineAction)})})}sendWhatsaap(e,t){let r={InvoiceID:e,PhoneNumber:t};return this.httpService.post(l.SendInvoiceWhatsapp,r)}createCustomerByInvoice(e,t){let r={InvoiceID:e,Mobile:t};return this.httpService.post(l.CreateCustomerInvoice,r)}saveCommission(e,t){let r={SOID:e,commission:t};return this.httpService.POSText("/API/Transaction/SetCommission",r)}generateReceiptA4(e){let t={ID:e};return this.httpService.post(l.InvoiceA4,t)}generateReceiptA4Column(e){let t={ID:e};return this.httpService.post(l.InvoiceA4Column,t)}getVacant(e){return this.httpService.get(l.GetVacant,[{key:"EntityID",value:e}])}checkExistingInvoiceNumber(e,t){return this.httpService.post(l.CheckExistingInvoiceNumber,{Number:e,OutletID:t})}static \u0275fac=function(t){return new(t||s)(u(T),u(x),u(R),u(A))};static \u0275prov=D({token:s,factory:s.\u0275fac,providedIn:"root"})};var et=(o=>(o[o.cash=1]="cash",o[o.card=2]="card",o[o.emoney=3]="emoney",o[o.other=4]="other",o[o.ECR=99]="ECR",o))(et||{});var _=class s{constructor(e,t,r){this._OrderHttpService=e;this._customerHttpService=t;this._toastrService=r}_OrderHttpService;_customerHttpService;_toastrService;_Data=new d(new m);transaction_id;Data$=this._Data.asObservable();get Data(){return this._Data.value}pushNewValue(e){if(e)this._Data.next(e);else{let t=this.Data;this._Data.next(t)}}submitOrder(e){return new Promise((t,r)=>{this.checkTransactionId(),this._OrderHttpService.submitOrder(this.Data,e).subscribe({next:i=>{t(i)},error:i=>{this.Data.Items=[],r(i)}})})}uploadOfflineOrder(){return this.checkTransactionId(),this._OrderHttpService.uploadOfflineOrder(this.Data)}checkTransactionId(){let t=this.Data.Payments.find(r=>r.TypeID==3);c.IsNotEmpty(t)&&c.IsEmpty(this.transaction_id)&&this._toastrService.warning("Midtrans transaction_id is empty. Please verify manually!","Mobile Payment Failure")}updateCustomerID(e){return this.Data.Order.CustomerID=e,this.pushNewValue(this.Data),new Promise((t,r)=>{this._customerHttpService.GetPrivilegeByID(e,this.Data.Order.EntityID).subscribe({next:i=>{this._customerHttpService.Data=i,this.pushNewValue(this.Data),t(i)},error:i=>{this.Data.Order.CustomerID=null,this.Data.ContactName=null;let o=i.error?.Message;i.status==409?this._toastrService.warning(o,"Warning"):this._toastrService.error(o,`API Error - ${i.status}`),r(i)}})})}static \u0275fac=function(t){return new(t||s)(u(H),u(z),u(A))};static \u0275prov=D({token:s,factory:s.\u0275fac,providedIn:"root"})};var j=class s{constructor(e,t,r){this._localDataService=e;this._onlineStatusService=t;this._httpService=r}_localDataService;_onlineStatusService;_httpService;_Data=new d(null);Data$=this._Data.asObservable().pipe(g(e=>e!==null),S());get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}requestObservable(){return this._onlineStatusService.getOnlineStatus$().pipe(S(),P(1),b(e=>e?this._httpService.get(l.GetPOSStorage).pipe(f(t=>({data:t,type:"Online"}))):O(this._localDataService.getLoadPOSAPI()).pipe(g(t=>!!t),f(t=>({data:t,type:"Offline"})))))}getOutletName(e){return this.Data.Entities.find(r=>r.ID==e)?.Name}static \u0275fac=function(t){return new(t||s)(u(x),u(R),u(T))};static \u0275prov=D({token:s,factory:s.\u0275fac,providedIn:"root"})};var G=class{ModuleSell;ApplicationLoyalty;ApplicationMath;CoreDefaults;ModuleDelivery;ApplicationParkAndRetrieve;ApplicationRegisterClosure;PaymentConfigGopay;PaymentConfigXendit;PaymentConfigLink;PrintConfigInvoice;CorePrint;PaymentConfigEmpatKali;ApplicationSettings;PrintConfigGeneral;ModuleProducts;ModuleContact;ApplicationTransactionNumbering;ModuleOrders;ModuleShift;ModuleBuy;ModuleAdjustment;TadaCouponVisible;CouponRedemptionType;ProviderOption;WhatsAppConfigJSON};var rt=class s{constructor(e,t,r,i){this._orderDataService=e;this._posService=t;this.POSMATH=r;this.decimalPipe=i;this._orderDataService.Data$.pipe(b(o=>this._posService.Data$.pipe(f(a=>({appConfig:a.AppConfigJSON,salesOrder:o}))))).subscribe(o=>{this.salesOrderData=o.salesOrder,this.appConfigJSON=o.appConfig,this.calculateDiscountAmount(),this.pushNewValue(this.grandTotal)})}_orderDataService;_posService;POSMATH;decimalPipe;_Data=new d(0);Data$=this._Data.asObservable().pipe(S());tax=new Y;discountAfterTax=0;currencySymbol="Rp";get Data(){return this._Data.value}salesOrderData=new m;appConfigJSON=new G;pushNewValue(e){this._Data.next(e)}get grandTotal(){let e=this.TotalAfterSurcharge;return isNaN(e)?0:e}setDecimalDigit(e){let t=this.decimalPipe.transform(e,"1.0-4");return e=parseFloat(t.split(",").join("")),e}get TotalAfterTax(){let e=this.TaxAmount,t=this.TotalBeforeTax+e;return t=this.POSMATH.Round(t,this.appConfigJSON.ApplicationMath.RoundingDigit.DecimalPlaceValue,this.appConfigJSON.ApplicationMath.RoundingDigit.RoundAlgorithm),t}get TotalBeforeTax(){let e=this.tax?.CalculationTypeID===1,t=0;return e?t=this.DiscountTotal-this.TaxAmount:t=this.DiscountTotal,t}get TotalAfterSurcharge(){let e=this.TotalAfterTax+this.SurchargeAmount;return this.POSMATH.Round(e,this.appConfigJSON.ApplicationMath.RoundingDigit.DecimalPlaceValue,this.appConfigJSON.ApplicationMath.RoundingDigit.RoundAlgorithm)}get TotalAfterDiscountTaxable(){return this.GrossTotalTaxable-this.DiscountTotal}get TaxAmount(){if(this.tax!=null){let e=0,t=this.appConfigJSON.ApplicationMath.RoundingTaxDigit.DecimalPlaceValue,r=this.appConfigJSON.ApplicationMath.RoundingTaxDigit.RoundAlgorithm,i=this.GrossTotalTaxable;return this.tax.CalculationTypeID==1?e=this.tax.Rate/(100+this.tax.Rate)*i:e=this.tax.Rate/100*i,e=this.POSMATH.Round(e,t,r),e}else return 0}get SurchargeAmount(){return this.TotalAfterTax*this.salesOrderData.Invoice.SurchargePcg/100}get Discount1Amount(){return this.GrossTotal*this.salesOrderData.Order.Discount/100}get AfterDiscount1Amount(){return this.GrossTotal-this.Discount1Amount}get Discount2Amount(){return this.AfterDiscount1Amount*this.salesOrderData.Order.Discount2/100}get AfterDiscount2Amount(){return this.AfterDiscount1Amount-this.Discount2Amount}get DiscountTotal(){return this.AfterDiscount2Amount-this.salesOrderData.Order.DiscountAmount}calculateDiscountAmount(){let e=this.salesOrderData.Order.DiscountAmount,t=0;this.AfterDiscount2Amount>=0&&e>0&&e>this.AfterDiscount2Amount&&(t=this.AfterDiscount2Amount),t!==0&&t<=e&&this.GrossTotal!==0&&(e=t),this.salesOrderData.Order.DiscountAmount=e}get GrossTotal(){return this.sum(this.salesOrderData.CartItems,"Total")}get GrossTotalTaxable(){let e=this.salesOrderData.CartItems.filter(r=>r.Taxable),t=this.sum(e,"Total");if(e.length!==0){let r=this.calculateDiscountTaxableItem(e);t=t*(100-this.salesOrderData.Order.Discount)/100,t=t*(100-this.salesOrderData.Order.Discount2)/100,t=t-r}return t}calculateDiscountTaxableItem(e){let t=this.GrossTotal,r=this.salesOrderData.Order.DiscountAmount,i=0,o=0,a=0,n=0;for(let k of e)i=k.getItemAfterDiscount/t,o=i*r,n=o*k.Quantity,a+=n;return a}get GrossTotalNonTaxable(){let e=this.salesOrderData.CartItems.filter(r=>r.Taxable==!1),t=this.sum(e,"Total");return t=t*(100-this.salesOrderData.Order.Discount)/100,t=t*(100-this.salesOrderData.Order.Discount2)/100,t=t-this.salesOrderData.Order.DiscountAmount,t}sum(e,t){let r=e.reduce((i,o)=>i+o[t],0);return r=this.setDecimalDigit(r),r}GetPointOnlyAmount(){let e=this.salesOrderData.CartItems.filter(t=>t.Variant.PaymentTypeID==2);return this.GetAmountByCart(e)}GetCashOnlyAmount(){let e=this.salesOrderData.CartItems.filter(t=>t.Variant.PaymentTypeID==1);return this.GetAmountByCart(e)}GetCashAndPointAmountCart(){let e=this.salesOrderData.CartItems.filter(t=>t.Variant.PaymentTypeID!=1);return this.GetAmountByCart(e)}GetAmountByCart(e){let t=this.sum(e,"Total");return t=t*(100-this.salesOrderData.Order.Discount)/100,t=t*(100-this.salesOrderData.Order.Discount2)/100,t}calculateGrossTotal(e){return this.sum(e,"Total")}static \u0275fac=function(t){return new(t||s)(u(_),u(j),u(Z),u(q))};static \u0275prov=D({token:s,factory:s.\u0275fac,providedIn:"root"})};export{v as a,I as b,M as c,G as d,tt as e,m as f,et as g,w as h,H as i,_ as j,j as k,rt as l};
1
+ import{b as Y}from"./chunk-S77FVPQM.js";import{b as N,c as X}from"./chunk-B53CZMGZ.js";import{a as Z}from"./chunk-RQCACWGY.js";import{b as z}from"./chunk-PJHXZWSV.js";import{a as h}from"./chunk-I3WUTJXX.js";import{b as K,f as x,g as R}from"./chunk-N5VS2V7L.js";import{a as l}from"./chunk-GNDUQZGK.js";import{a as c}from"./chunk-PPTZHIIZ.js";import{a as W}from"./chunk-WKPO4QSK.js";import{n as A,q as T}from"./chunk-QGYXJUX3.js";import{E as g,I as B,M as P,P as S,aa as b,b as L,ea as $,f as d,j as U,k as O,ka as D,l as F,m as J,na as u,q as Q,s as f,ud as q}from"./chunk-7D344CRC.js";import{h as p}from"./chunk-NF7PG5F2.js";var v=class{ID;Number;Due;Date;CustomDateField;TimeCustom;SurchargePcg;TempSurchargePcg;ToP;Note;ReferenceInvoiceID;PaymentStateID;Sales;DateCustom;constructor(){this.ID=c.GuidEmpty,this.SurchargePcg=0,this.TempSurchargePcg=0,this.Due=null}};var tt=(i=>(i[i.Unsent=0]="Unsent",i[i.AwaitingCollection=1]="AwaitingCollection",i[i.Partial=2]="Partial",i[i.Sent=3]="Sent",i))(tt||{});var y=class{ID;EntityID;RegisterID;TypeID;Date;Number;CustomerID;SalesID;Discount=0;Discount2=0;DiscountAmount=0;CustomerDiscountRate=0;Note="";DeliveryOutletID;TaxTypeID;CurrencyID;CurrencyRate;PointUsed;InvoicedStateID;ReferenceNumber="";LogisticsServiceID;ParkLabel="";NumberOfPerson;ClientTimestamp;Created;PromotionCoupon="";CouponType=1;PromotionNote="";DeliveryStateID;CouponProvider="Internal";CurrencySymbol;constructor(){this.ID=c.GuidEmpty,this.EntityID=c.GuidEmpty,this.RegisterID=c.GuidEmpty,this.Number="",this.CustomerID=null,this.SalesID=null,this.Discount=0,this.Discount2=0,this.DiscountAmount=0,this.Note="",this.TaxTypeID=c.GuidEmpty,this.CurrencyID=1,this.CurrencyRate=1,this.DeliveryStateID=3,this.PointUsed=0,this.NumberOfPerson=1,this.Date=new Date}removeEnterNote(){this.Note&&(this.Note=this.Note.replace(/\n/g,""))}};var M=class{MethodID;Amount=0;Note;Index;Date;PaidAmount;Code;MethodName;InvoiceID;ID;TypeID;constructor(e,t,r,i){this.MethodID=e||0,this.Amount=t||0,this.PaidAmount=r||0,this.Date=i}};var I=class{Name;Phone;Address;City;constructor(){this.Name="",this.Phone="",this.Address="",this.City=""}};var C=class{DeliveryEntityID;Type;NewOrderID;constructor(){this.DeliveryEntityID="",this.Type=3}};var E=class{Amount;ApplyToProduct;Code;Type;TypeDescription;Coupon;Notification;MaxDiscount;Note};var m=class{Order;Invoice;Shipping;Action;Payments;Items;CartItems;Promotion;ContactName;SplitParkLabel;get cartQuantity(){let e=0;for(let t of this.CartItems)e+=t.Quantity;return e}constructor(){this.Order=new y,this.Invoice=new v,this.Shipping=new I,this.Action=new C,this.Payments=Array(),this.Items=Array(),this.CartItems=Array(),this.ContactName=""}get TotalPaidAmount(){let e=0;return this.Payments.forEach(t=>{e+=t.PaidAmount}),e}get RedeemableAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID!=1);return this.GetAmountByCart(e)}get TotalQuantity(){let e=0;return this.CartItems.forEach(t=>{t.PromotionGift||(e+=t.Quantity)}),e}get CashOnlyAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID==1);return this.GetAmountByCart(e)}get PointOnlyAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID==2);return this.GetAmountByCart(e)}get PrepaidPackageItem(){return this.CartItems.filter(t=>t.Variant.TypeID==10)}GetAmountByCart(e){let t=0;return e.forEach(r=>{t+=r.Total}),t=t*(100-this.Order.Discount)/100,t=t*(100-this.Order.Discount2)/100,t}getRewards(){return this.CartItems.filter(t=>t.PromotionGift)}};p([h(()=>y)],m.prototype,"Order",2),p([h(()=>v)],m.prototype,"Invoice",2),p([h(()=>I)],m.prototype,"Shipping",2),p([h(()=>C)],m.prototype,"Action",2),p([h(()=>M)],m.prototype,"Payments",2),p([h(()=>N)],m.prototype,"Items",2),p([h(()=>X)],m.prototype,"CartItems",2),p([h(()=>E)],m.prototype,"Promotion",2);var w=class{Success;Message;message;ObjectID;SalesOrderID;OutDeliveryID;Contact;LoyaltyPoint;InvoiceNumber;Creator;OrderTimeString;PrintMode;PaymentStateID;PaymentStateLabel;Final;InvoiceNumberResult;constructor(){this.Success=!0,this.Message="",this.ObjectID="",this.SalesOrderID="",this.OutDeliveryID="",this.Contact=null,this.LoyaltyPoint="",this.InvoiceNumber="",this.Creator="",this.OrderTimeString="",this.PrintMode=0,this.PaymentStateID=0,this.PaymentStateLabel="",this.Final=0}};var H=class s{constructor(e,t,r,i){this.httpService=e;this._localDataService=t;this._onlineStatusService=r;this._toastrService=i;this._onlineStatusService.getOnlineStatus$().subscribe(o=>{this.isOnline=o})}httpService;_localDataService;_onlineStatusService;_toastrService;_Data=new d(null);Data$=this._Data.pipe(S(),g(e=>e!==null));isOnline;get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}getSalesOrderPrint(e){return this.httpService.get("/API/POS/GetSalesOrderPrint",[{key:"TemplateID",value:e}])}submitOrder(e,t){let r=this.generatePOSDataForSubmission(e,this.isOnline);if(this.isOnline)return this.submitOnline(r).pipe(this.handleTimeOutError(r),$(i=>{i?.Success&&this._localDataService.markUnsentOrderSuccess(r,i).catch(o=>console.error("Failed to reconcile local offline order",o))}));if(t.ModuleSell.EnableOfflineTransaction)return O(this._localDataService.syncOrder(r)).pipe(f(()=>this.generateCompleteData(r)));this._toastrService.warning("Offline order is not Supported!","Info!")}uploadOfflineOrder(e){return O(this._localDataService.uploadSingleOrder(e)).pipe(b(t=>t?F(t):U),B(t=>t?.message?.includes("objectStore does not exists")?this.submitOnline(e):J(()=>t)))}submitOnline(e){return this.httpService.post(l.SubmitOrder,e,W.pos.submitOrderTimeout)}handleTimeOutError(e){return L(B(t=>{if(t instanceof Q||t?.name=="TimeoutError"){let r=this.generateCompleteData(e);this.pushNewValue(r)}throw t}))}generatePOSDataForSubmission(e,t=!0){let r=Object.assign(new m,e);r.Items=[],r.Order.CustomerID==null&&(r.Order.CustomerID=c.GuidEmpty),r.Order.SalesID==null&&(r.Order.SalesID=c.GuidEmpty);let i=1;r.Payments=r.Payments.map(a=>(a.Date=r.Order.Date,a.Index=i,i++,delete a.TypeID,a));let o=1;for(let a of r.CartItems){let n=new N;n.ID=a.ID,n.VariantID=a.VariantID,n.Quantity=a.Quantity,n.Cost=a.Cost,n.Price=a.Price,n.Discount=a.Discount,n.DiscountAmount=a.DiscountAmount,n.Note=a.Note,n.Taxable=a.Variant.Taxable,n.LoyaltyPoint=a.LoyaltyPoint,n.UnitCost=a.Cost,n.UnitPrice=a.Price,n.UnitPriceOriginal=a.UnitPriceOriginal,n.UnitExpense=a.UnitExpense,n.EntityID=a.EntityID,n.Index=o,n.LandedCost=a.LandedCost,n.UnitQuantity=a.UnitQuantity,n.PriceTypeID=a.PriceTypeID,n.PriceNote=a.PriceNote,n.Splited=a.SplitQuantity>0,n.SplitQuantity=a.SplitQuantity,n.InventoryTypeID=a.Variant.TypeID,n.SalesID="",n.Serial=a.Serial,a.SalesID&&(n.SalesID=a.SalesID),delete a.CouponDiscount,r.Items.push(n),o++}return t?(delete r.CartItems,delete r.Order.ClientTimestamp):r.Order.ClientTimestamp=new Date,r}generateCompleteData(e){let t=new w;return t.InvoiceNumber=e.Order.Number,t.OrderTimeString=new Date().toString(),t.PaymentStateID=e.Action?.Type,t.PaymentStateLabel="Offline",t.Success=!0,t.OutDeliveryID=e.Action.DeliveryEntityID,t}GetReturnInvoice(e,t){return this.httpService.get(l.ReturnInvoiceV2,[{key:"EntityID",value:t},{key:"Number",value:e}])}GetInvoiceBySoID(e){return this.httpService.get(l.GetPOSDataByID,[{key:"ID",value:e}])}UploadCSV(e,t){let r={CartItems:e,EntityID:t};return this.httpService.post(l.UploadCsv,r)}sendEmail(e,t){return new Promise((r,i)=>{this._onlineStatusService.isProductFromServer().pipe(P(1)).subscribe(o=>{if(o){let a={invoiceID:t,email:e};this.httpService.post(l.SendInvoiceEmail,a).subscribe({next:n=>{r(n)},error:n=>{i(n)}})}else i(K.wrongOfflineAction)})})}sendWhatsaap(e,t){let r={InvoiceID:e,PhoneNumber:t};return this.httpService.post(l.SendInvoiceWhatsapp,r)}createCustomerByInvoice(e,t){let r={InvoiceID:e,Mobile:t};return this.httpService.post(l.CreateCustomerInvoice,r)}saveCommission(e,t){let r={SOID:e,commission:t};return this.httpService.POSText("/API/Transaction/SetCommission",r)}generateReceiptA4(e){let t={ID:e};return this.httpService.post(l.InvoiceA4,t)}generateReceiptA4Column(e){let t={ID:e};return this.httpService.post(l.InvoiceA4Column,t)}getVacant(e){return this.httpService.get(l.GetVacant,[{key:"EntityID",value:e}])}checkExistingInvoiceNumber(e,t){return this.httpService.post(l.CheckExistingInvoiceNumber,{Number:e,OutletID:t})}static \u0275fac=function(t){return new(t||s)(u(T),u(x),u(R),u(A))};static \u0275prov=D({token:s,factory:s.\u0275fac,providedIn:"root"})};var et=(o=>(o[o.cash=1]="cash",o[o.card=2]="card",o[o.emoney=3]="emoney",o[o.other=4]="other",o[o.ECR=99]="ECR",o))(et||{});var _=class s{constructor(e,t,r){this._OrderHttpService=e;this._customerHttpService=t;this._toastrService=r}_OrderHttpService;_customerHttpService;_toastrService;_Data=new d(new m);transaction_id;Data$=this._Data.asObservable();get Data(){return this._Data.value}pushNewValue(e){if(e)this._Data.next(e);else{let t=this.Data;this._Data.next(t)}}submitOrder(e){return new Promise((t,r)=>{this.checkTransactionId(),this._OrderHttpService.submitOrder(this.Data,e).subscribe({next:i=>{t(i)},error:i=>{this.Data.Items=[],r(i)}})})}uploadOfflineOrder(){return this.checkTransactionId(),this._OrderHttpService.uploadOfflineOrder(this.Data)}checkTransactionId(){let t=this.Data.Payments.find(r=>r.TypeID==3);c.IsNotEmpty(t)&&c.IsEmpty(this.transaction_id)&&this._toastrService.warning("Midtrans transaction_id is empty. Please verify manually!","Mobile Payment Failure")}updateCustomerID(e){return this.Data.Order.CustomerID=e,this.pushNewValue(this.Data),new Promise((t,r)=>{this._customerHttpService.GetPrivilegeByID(e,this.Data.Order.EntityID).subscribe({next:i=>{this._customerHttpService.Data=i,this.pushNewValue(this.Data),t(i)},error:i=>{this.Data.Order.CustomerID=null,this.Data.ContactName=null;let o=i.error?.Message;i.status==409?this._toastrService.warning(o,"Warning"):this._toastrService.error(o,`API Error - ${i.status}`),r(i)}})})}static \u0275fac=function(t){return new(t||s)(u(H),u(z),u(A))};static \u0275prov=D({token:s,factory:s.\u0275fac,providedIn:"root"})};var j=class s{constructor(e,t,r){this._localDataService=e;this._onlineStatusService=t;this._httpService=r}_localDataService;_onlineStatusService;_httpService;_Data=new d(null);Data$=this._Data.asObservable().pipe(g(e=>e!==null),S());get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}requestObservable(){return this._onlineStatusService.getOnlineStatus$().pipe(S(),P(1),b(e=>e?this._httpService.get(l.GetPOSStorage).pipe(f(t=>({data:t,type:"Online"}))):O(this._localDataService.getLoadPOSAPI()).pipe(g(t=>!!t),f(t=>({data:t,type:"Offline"})))))}getOutletName(e){return this.Data.Entities.find(r=>r.ID==e)?.Name}static \u0275fac=function(t){return new(t||s)(u(x),u(R),u(T))};static \u0275prov=D({token:s,factory:s.\u0275fac,providedIn:"root"})};var G=class{ModuleSell;ApplicationLoyalty;ApplicationMath;CoreDefaults;ModuleDelivery;ApplicationParkAndRetrieve;ApplicationRegisterClosure;PaymentConfigGopay;PaymentConfigXendit;PaymentConfigLink;PrintConfigInvoice;CorePrint;PaymentConfigEmpatKali;ApplicationSettings;PrintConfigGeneral;ModuleProducts;ModuleContact;ApplicationTransactionNumbering;ModuleOrders;ModuleShift;ModuleBuy;ModuleAdjustment;TadaCouponVisible;CouponRedemptionType;ProviderOption;WhatsAppConfigJSON};var rt=class s{constructor(e,t,r,i){this._orderDataService=e;this._posService=t;this.POSMATH=r;this.decimalPipe=i;this._orderDataService.Data$.pipe(b(o=>this._posService.Data$.pipe(f(a=>({appConfig:a.AppConfigJSON,salesOrder:o}))))).subscribe(o=>{this.salesOrderData=o.salesOrder,this.appConfigJSON=o.appConfig,this.calculateDiscountAmount(),this.pushNewValue(this.grandTotal)})}_orderDataService;_posService;POSMATH;decimalPipe;_Data=new d(0);Data$=this._Data.asObservable().pipe(S());tax=new Y;discountAfterTax=0;currencySymbol="Rp";get Data(){return this._Data.value}salesOrderData=new m;appConfigJSON=new G;pushNewValue(e){this._Data.next(e)}get grandTotal(){let e=this.TotalAfterSurcharge;return isNaN(e)?0:e}setDecimalDigit(e){let t=this.decimalPipe.transform(e,"1.0-4");return e=parseFloat(t.split(",").join("")),e}get TotalAfterTax(){let e=this.TaxAmount,t=this.TotalBeforeTax+e;return t=this.POSMATH.Round(t,this.appConfigJSON.ApplicationMath.RoundingDigit.DecimalPlaceValue,this.appConfigJSON.ApplicationMath.RoundingDigit.RoundAlgorithm),t}get TotalBeforeTax(){let e=this.tax?.CalculationTypeID===1,t=0;return e?t=this.DiscountTotal-this.TaxAmount:t=this.DiscountTotal,t}get TotalAfterSurcharge(){let e=this.TotalAfterTax+this.SurchargeAmount;return this.POSMATH.Round(e,this.appConfigJSON.ApplicationMath.RoundingDigit.DecimalPlaceValue,this.appConfigJSON.ApplicationMath.RoundingDigit.RoundAlgorithm)}get TotalAfterDiscountTaxable(){return this.GrossTotalTaxable-this.DiscountTotal}get TaxAmount(){if(this.tax!=null){let e=0,t=this.appConfigJSON.ApplicationMath.RoundingTaxDigit.DecimalPlaceValue,r=this.appConfigJSON.ApplicationMath.RoundingTaxDigit.RoundAlgorithm,i=this.GrossTotalTaxable;return this.tax.CalculationTypeID==1?e=this.tax.Rate/(100+this.tax.Rate)*i:e=this.tax.Rate/100*i,e=this.POSMATH.Round(e,t,r),e}else return 0}get SurchargeAmount(){return this.TotalAfterTax*this.salesOrderData.Invoice.SurchargePcg/100}get Discount1Amount(){return this.GrossTotal*this.salesOrderData.Order.Discount/100}get AfterDiscount1Amount(){return this.GrossTotal-this.Discount1Amount}get Discount2Amount(){return this.AfterDiscount1Amount*this.salesOrderData.Order.Discount2/100}get AfterDiscount2Amount(){return this.AfterDiscount1Amount-this.Discount2Amount}get DiscountTotal(){return this.AfterDiscount2Amount-this.salesOrderData.Order.DiscountAmount}calculateDiscountAmount(){let e=this.salesOrderData.Order.DiscountAmount,t=0;this.AfterDiscount2Amount>=0&&e>0&&e>this.AfterDiscount2Amount&&(t=this.AfterDiscount2Amount),t!==0&&t<=e&&this.GrossTotal!==0&&(e=t),this.salesOrderData.Order.DiscountAmount=e}get GrossTotal(){return this.sum(this.salesOrderData.CartItems,"Total")}get GrossTotalTaxable(){let e=this.salesOrderData.CartItems.filter(r=>r.Taxable),t=this.sum(e,"Total");if(e.length!==0){let r=this.calculateDiscountTaxableItem(e);t=t*(100-this.salesOrderData.Order.Discount)/100,t=t*(100-this.salesOrderData.Order.Discount2)/100,t=t-r}return t}calculateDiscountTaxableItem(e){let t=this.GrossTotal,r=this.salesOrderData.Order.DiscountAmount,i=0,o=0,a=0,n=0;for(let k of e)i=k.getItemAfterDiscount/t,o=i*r,n=o*k.Quantity,a+=n;return a}get GrossTotalNonTaxable(){let e=this.salesOrderData.CartItems.filter(r=>r.Taxable==!1),t=this.sum(e,"Total");return t=t*(100-this.salesOrderData.Order.Discount)/100,t=t*(100-this.salesOrderData.Order.Discount2)/100,t=t-this.salesOrderData.Order.DiscountAmount,t}sum(e,t){let r=e.reduce((i,o)=>i+o[t],0);return r=this.setDecimalDigit(r),r}GetPointOnlyAmount(){let e=this.salesOrderData.CartItems.filter(t=>t.Variant.PaymentTypeID==2);return this.GetAmountByCart(e)}GetCashOnlyAmount(){let e=this.salesOrderData.CartItems.filter(t=>t.Variant.PaymentTypeID==1);return this.GetAmountByCart(e)}GetCashAndPointAmountCart(){let e=this.salesOrderData.CartItems.filter(t=>t.Variant.PaymentTypeID!=1);return this.GetAmountByCart(e)}GetAmountByCart(e){let t=this.sum(e,"Total");return t=t*(100-this.salesOrderData.Order.Discount)/100,t=t*(100-this.salesOrderData.Order.Discount2)/100,t}calculateGrossTotal(e){return this.sum(e,"Total")}static \u0275fac=function(t){return new(t||s)(u(_),u(j),u(Z),u(q))};static \u0275prov=D({token:s,factory:s.\u0275fac,providedIn:"root"})};export{v as a,I as b,M as c,G as d,tt as e,m as f,et as g,w as h,H as i,_ as j,j as k,rt as l};
@@ -1 +1 @@
1
- import{a as r}from"./chunk-JXEPD3CF.js";import{a as f}from"./chunk-34Y4NLT2.js";import{$a as m,Ga as l,Hd as d,I as n,Id as v,_a as p,ea as a,fb as c,j as o,oa as i,wc as h}from"./chunk-7D344CRC.js";var E=class s{constructor(e){this.el=e;this.el.nativeElement.onerror=()=>{}}el;renderer=i(p);tooltip=i(r);httpClient=i(v);ngAfterViewInit(){let e=this.el.nativeElement;!e||!e.src||(e.onerror=()=>{this.setFallbackImage()},e.src.includes("cloudinary")?this.httpClient.get(e.src,{responseType:"blob"}).pipe(a(t=>{t.type.startsWith("image/")?this.addTooltip("Click to view image"):this.setFallbackImage()}),n(t=>(t instanceof d&&this.setFallbackImage(),o))).subscribe():this.addTooltip(""))}setFallbackImage(){this.renderer.setAttribute(this.el.nativeElement,"src",f.FALLBACK_PRODUCT_IMAGE_URL),this.renderer.setStyle(this.el.nativeElement,"border","1px solid #dee2e6"),this.renderer.setStyle(this.el.nativeElement,"border-radius","4px")}addTooltip(e){this.renderer.listen(this.el.nativeElement,"mouseenter",()=>{this.tooltip.message=e,this.tooltip.position="above",this.tooltip.show()}),this.renderer.listen(this.el.nativeElement,"mouseleave",()=>{this.tooltip.message="",this.tooltip.hide()})}static \u0275fac=function(t){return new(t||s)(m(l))};static \u0275dir=c({type:s,selectors:[["","appFallbackImage",""]],features:[h([r])]})};export{E as a};
1
+ import{a as r}from"./chunk-JXEPD3CF.js";import{a as f}from"./chunk-WKPO4QSK.js";import{$a as m,Ga as l,Hd as d,I as n,Id as v,_a as p,ea as a,fb as c,j as o,oa as i,wc as h}from"./chunk-7D344CRC.js";var E=class s{constructor(e){this.el=e;this.el.nativeElement.onerror=()=>{}}el;renderer=i(p);tooltip=i(r);httpClient=i(v);ngAfterViewInit(){let e=this.el.nativeElement;!e||!e.src||(e.onerror=()=>{this.setFallbackImage()},e.src.includes("cloudinary")?this.httpClient.get(e.src,{responseType:"blob"}).pipe(a(t=>{t.type.startsWith("image/")?this.addTooltip("Click to view image"):this.setFallbackImage()}),n(t=>(t instanceof d&&this.setFallbackImage(),o))).subscribe():this.addTooltip(""))}setFallbackImage(){this.renderer.setAttribute(this.el.nativeElement,"src",f.FALLBACK_PRODUCT_IMAGE_URL),this.renderer.setStyle(this.el.nativeElement,"border","1px solid #dee2e6"),this.renderer.setStyle(this.el.nativeElement,"border-radius","4px")}addTooltip(e){this.renderer.listen(this.el.nativeElement,"mouseenter",()=>{this.tooltip.message=e,this.tooltip.position="above",this.tooltip.show()}),this.renderer.listen(this.el.nativeElement,"mouseleave",()=>{this.tooltip.message="",this.tooltip.hide()})}static \u0275fac=function(t){return new(t||s)(m(l))};static \u0275dir=c({type:s,selectors:[["","appFallbackImage",""]],features:[h([r])]})};export{E as a};