dealpos 26.23.2 → 26.23.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/browser/{chunk-AOMMSVJC.js → chunk-22GNT3IU.js} +1 -1
  2. package/browser/{chunk-BBUNSCLU.js → chunk-2AFDH2RD.js} +1 -1
  3. package/browser/{chunk-SFSMLLEO.js → chunk-2YAYXCBI.js} +1 -1
  4. package/browser/{chunk-K4UNI4ZQ.js → chunk-33SLV2VM.js} +1 -1
  5. package/browser/{chunk-GAHW32JB.js → chunk-3CAMBCLF.js} +1 -1
  6. package/browser/{chunk-7HDWVPV3.js → chunk-3FLXNV6R.js} +1 -1
  7. package/browser/{chunk-UCUYHB7R.js → chunk-3QZIU3FE.js} +1 -1
  8. package/browser/{chunk-UUC6OGSB.js → chunk-474SPZKU.js} +1 -1
  9. package/browser/{chunk-I4ZKWCF3.js → chunk-5REGCGFH.js} +1 -1
  10. package/browser/{chunk-VZZP6AX3.js → chunk-6LHXRP6Y.js} +1 -1
  11. package/browser/{chunk-YXBPTOXS.js → chunk-6LYYMVI3.js} +1 -1
  12. package/browser/{chunk-HU7MHVZ4.js → chunk-6SBQN53B.js} +1 -1
  13. package/browser/{chunk-2AU5HI2Y.js → chunk-7CV3UWGT.js} +1 -1
  14. package/browser/{chunk-NIWXI3NK.js → chunk-7D6RCIFX.js} +2 -2
  15. package/browser/{chunk-V4I3PQHA.js → chunk-7ERYSAQA.js} +2 -2
  16. package/browser/{chunk-UQVQY3CM.js → chunk-7IZ3XQ4Y.js} +1 -1
  17. package/browser/{chunk-SEGHQEMV.js → chunk-A2DM52CW.js} +1 -1
  18. package/browser/{chunk-Y6FYGS2X.js → chunk-AOEHHFXF.js} +1 -1
  19. package/browser/{chunk-VAZ5LEGL.js → chunk-AVZEIDAH.js} +2 -2
  20. package/browser/{chunk-7L57YG4E.js → chunk-BBLFHZEO.js} +1 -1
  21. package/browser/{chunk-V7XZIMPY.js → chunk-BDGAMLAL.js} +1 -1
  22. package/browser/{chunk-AGHFGFNK.js → chunk-BFWEXD2Y.js} +1 -1
  23. package/browser/{chunk-353EPTQ5.js → chunk-BJR5FH4M.js} +1 -1
  24. package/browser/{chunk-YU27DXKJ.js → chunk-C2XNH5PA.js} +1 -1
  25. package/browser/{chunk-2FYTHHVN.js → chunk-CGQML2IJ.js} +1 -1
  26. package/browser/{chunk-GSDUBENE.js → chunk-CN4XN6E4.js} +1 -1
  27. package/browser/{chunk-BOAJ6KZ5.js → chunk-CQVECNIA.js} +1 -1
  28. package/browser/{chunk-SXZI6SU7.js → chunk-CR3VHMAV.js} +1 -1
  29. package/browser/{chunk-72T6OXSP.js → chunk-CXDPWBF4.js} +1 -1
  30. package/browser/{chunk-DO7TDR5F.js → chunk-D2GMLSMW.js} +1 -1
  31. package/browser/{chunk-XXTAC62N.js → chunk-DB5MKMVG.js} +1 -1
  32. package/browser/{chunk-4HGM3U4Z.js → chunk-E2OGEQLR.js} +1 -1
  33. package/browser/{chunk-4XAIWT5T.js → chunk-E4ISJ5TT.js} +1 -1
  34. package/browser/{chunk-WKMULRLI.js → chunk-EDKHSIE7.js} +1 -1
  35. package/browser/{chunk-SEDQQVP7.js → chunk-EWVIPH3Y.js} +1 -1
  36. package/browser/{chunk-CZ2YSH23.js → chunk-EZZZFB5W.js} +1 -1
  37. package/browser/{chunk-7ZO37RE3.js → chunk-F6SOV3EO.js} +1 -1
  38. package/browser/{chunk-LRFM6I6H.js → chunk-FGXEE5ER.js} +1 -1
  39. package/browser/{chunk-K4BUXJXT.js → chunk-FGZNHZ6S.js} +1 -1
  40. package/browser/{chunk-G3IX47PY.js → chunk-GB5PBYXO.js} +2 -2
  41. package/browser/{chunk-SGWWI7EY.js → chunk-GDIWAXMB.js} +1 -1
  42. package/browser/{chunk-OJAFESGH.js → chunk-GLXRJASK.js} +1 -1
  43. package/browser/{chunk-Z5VHEI6H.js → chunk-GR47TCNJ.js} +1 -1
  44. package/browser/{chunk-M6IHS3WW.js → chunk-GT6ONUC2.js} +1 -1
  45. package/browser/{chunk-SFSRABV5.js → chunk-GWZLP3JE.js} +1 -1
  46. package/browser/{chunk-4GKVT6U4.js → chunk-H5VYCYJP.js} +1 -1
  47. package/browser/{chunk-6XHAWYCD.js → chunk-HCXQMJWP.js} +1 -1
  48. package/browser/{chunk-UE3N42BY.js → chunk-HFKCKDW4.js} +1 -1
  49. package/browser/{chunk-GYWYXNYW.js → chunk-HJGKJ4AK.js} +1 -1
  50. package/browser/{chunk-KDUM6UZH.js → chunk-I66WOLCK.js} +1 -1
  51. package/browser/{chunk-4XV24TCU.js → chunk-I7ROEGUE.js} +1 -1
  52. package/browser/{chunk-ZKB2FZLX.js → chunk-IVEH5ATO.js} +1 -1
  53. package/browser/{chunk-XKKQV4LZ.js → chunk-KNUEVL24.js} +1 -1
  54. package/browser/{chunk-SGVH33HP.js → chunk-KTLT6WEI.js} +1 -1
  55. package/browser/{chunk-C6DQFHS6.js → chunk-KUY4QRQE.js} +1 -1
  56. package/browser/{chunk-PPHSLWQP.js → chunk-LL6POVQL.js} +1 -1
  57. package/browser/{chunk-JWXQL4M6.js → chunk-LSRSMZ2Z.js} +2 -2
  58. package/browser/{chunk-6CDU6CJB.js → chunk-LYZAXNP3.js} +1 -1
  59. package/browser/{chunk-KPVJ3FM6.js → chunk-MM76WSUF.js} +1 -1
  60. package/browser/{chunk-RSMW6YDU.js → chunk-MRDHGSEO.js} +1 -1
  61. package/browser/{chunk-TBL5PH2R.js → chunk-MRKE47YW.js} +1 -1
  62. package/browser/chunk-NLFFSKTQ.js +1 -0
  63. package/browser/{chunk-TAGBE3S7.js → chunk-NQHKBMAQ.js} +1 -1
  64. package/browser/{chunk-B5EEORFC.js → chunk-NSBIEAEN.js} +1 -1
  65. package/browser/{chunk-PIIH224Z.js → chunk-OA6PQTAA.js} +1 -1
  66. package/browser/{chunk-SKVOTYVC.js → chunk-OSS4TM4Q.js} +1 -1
  67. package/browser/{chunk-IM77C76R.js → chunk-P5LKGTO3.js} +1 -1
  68. package/browser/{chunk-JOT6LRBC.js → chunk-PCHIEGYY.js} +1 -1
  69. package/browser/{chunk-2ZFMJWV7.js → chunk-PMGVTBKY.js} +1 -1
  70. package/browser/{chunk-4OJCDQ36.js → chunk-PUAKDZHO.js} +1 -1
  71. package/browser/{chunk-H3TRBEQR.js → chunk-PUHZOP5L.js} +1 -1
  72. package/browser/{chunk-SQND6B6V.js → chunk-Q42DSMRB.js} +1 -1
  73. package/browser/{chunk-ZWQO35KD.js → chunk-Q7N5T5GA.js} +1 -1
  74. package/browser/{chunk-JPJ3AUXJ.js → chunk-QD4IUL2I.js} +1 -1
  75. package/browser/{chunk-OWR3QL44.js → chunk-QFLXXZAN.js} +1 -1
  76. package/browser/{chunk-SBEVTOCK.js → chunk-QQMKDVYN.js} +1 -1
  77. package/browser/{chunk-JVKDQ46O.js → chunk-R5GA6QKH.js} +1 -1
  78. package/browser/{chunk-7VW63XL3.js → chunk-RDXLVXVP.js} +1 -1
  79. package/browser/{chunk-HFTQXCS3.js → chunk-RMF6CLBR.js} +2 -2
  80. package/browser/{chunk-YYZRJ7WC.js → chunk-SOFMYWY7.js} +1 -1
  81. package/browser/{chunk-46PMBLMT.js → chunk-SOY66PCZ.js} +1 -1
  82. package/browser/{chunk-O2UKVYQL.js → chunk-TQKDPBZR.js} +1 -1
  83. package/browser/{chunk-YFNZ4ZXS.js → chunk-UJSTTU2A.js} +1 -1
  84. package/browser/{chunk-J3AQHTRV.js → chunk-ULTLXONJ.js} +1 -1
  85. package/browser/{chunk-LRZRWGKF.js → chunk-UOYL2LZH.js} +1 -1
  86. package/browser/{chunk-7AJKCI6R.js → chunk-UPLQOCIA.js} +1 -1
  87. package/browser/{chunk-725NTKOA.js → chunk-UPWE6PSY.js} +1 -1
  88. package/browser/{chunk-RZTPIKQ7.js → chunk-UUZ2XVBZ.js} +1 -1
  89. package/browser/{chunk-FAQMNQSV.js → chunk-VXMGAOKY.js} +1 -1
  90. package/browser/{chunk-QFJGVF6F.js → chunk-W2Y3M6IH.js} +1 -1
  91. package/browser/{chunk-EWKWZZ62.js → chunk-W4ROA2VK.js} +1 -1
  92. package/browser/{chunk-HNESPLVM.js → chunk-WF6K4N5K.js} +1 -1
  93. package/browser/{chunk-ACJPABOL.js → chunk-WHFQYL4N.js} +1 -1
  94. package/browser/{chunk-YKPTDISP.js → chunk-WN6WUMLI.js} +1 -1
  95. package/browser/{chunk-XSUGKIEU.js → chunk-WPPILLWU.js} +1 -1
  96. package/browser/{chunk-PQWOTULY.js → chunk-XEGXQ5LP.js} +1 -1
  97. package/browser/{chunk-UAGRAZZA.js → chunk-XMHMIMSB.js} +1 -1
  98. package/browser/{chunk-PAC5NLPP.js → chunk-XRA3FRFV.js} +1 -1
  99. package/browser/{chunk-FYOWID5Y.js → chunk-YAJOVKG3.js} +1 -1
  100. package/browser/{chunk-Z4BPCFOI.js → chunk-YFJ6X6OU.js} +1 -1
  101. package/browser/{chunk-VKVLUGGS.js → chunk-YI4M6JTJ.js} +1 -1
  102. package/browser/{chunk-BRKFLXCS.js → chunk-YI53AO3T.js} +1 -1
  103. package/browser/{chunk-PAF2E6M3.js → chunk-YJCMKEIW.js} +1 -1
  104. package/browser/{chunk-PSIN2TDF.js → chunk-YMQGUWSH.js} +1 -1
  105. package/browser/{chunk-HSB7FC4F.js → chunk-YU3VMXXH.js} +2 -2
  106. package/browser/{chunk-EQOQUNGM.js → chunk-YVFOAXFW.js} +1 -1
  107. package/browser/{chunk-PSMXOOE7.js → chunk-YZKGVOZS.js} +1 -1
  108. package/browser/{chunk-NCWKENB5.js → chunk-ZIEDDJRF.js} +1 -1
  109. package/browser/{chunk-5ZRUOOOS.js → chunk-ZQBEWPGT.js} +1 -1
  110. package/browser/{chunk-6NKR65Y6.js → chunk-ZV2JYV5S.js} +1 -1
  111. package/browser/{chunk-J3ATSVHD.js → chunk-ZZ4FKBNK.js} +1 -1
  112. package/browser/{chunk-3IY5KFJH.js → chunk-ZZBBDUNW.js} +1 -1
  113. package/browser/index.html +2 -2
  114. package/browser/{main-LVGL5GBF.js → main-C4IJHUJK.js} +2 -2
  115. package/package.json +1 -1
  116. package/browser/chunk-GMT7PMNN.js +0 -1
@@ -1 +1 @@
1
- import{a as ye}from"./chunk-ESI3EIOA.js";import"./chunk-4VRCKWUY.js";import{p as Ce}from"./chunk-NQT3PG63.js";import"./chunk-2D4XBF6C.js";import"./chunk-J63OB27M.js";import"./chunk-MPN57TB5.js";import"./chunk-KF3MHC66.js";import"./chunk-KBZZ7PX4.js";import"./chunk-ETGLCIRD.js";import{a as _e,b as ge}from"./chunk-IGJSYOLU.js";import{a as ae}from"./chunk-M2AZOKFB.js";import{a as ue}from"./chunk-TBL5PH2R.js";import"./chunk-H3TRBEQR.js";import{d as ce}from"./chunk-LMI6FIPG.js";import"./chunk-3S3T7QLT.js";import{b as oe}from"./chunk-HP5IPESO.js";import"./chunk-6N2DU4HB.js";import{a as ee}from"./chunk-OJAFESGH.js";import"./chunk-PSMXOOE7.js";import"./chunk-XKQYXDV6.js";import"./chunk-4KO3X4S2.js";import"./chunk-BACG4SJJ.js";import"./chunk-CQTLBAQD.js";import{a as ne}from"./chunk-OFSPPASQ.js";import"./chunk-6CDU6CJB.js";import"./chunk-XULGDGRO.js";import"./chunk-43NB6BM4.js";import"./chunk-OVEGWW7W.js";import"./chunk-LL4377Z2.js";import"./chunk-GAOYV53E.js";import"./chunk-W6JPMHYE.js";import"./chunk-BXA2JYKG.js";import{f as de,g as se}from"./chunk-B5EEORFC.js";import"./chunk-PAF2E6M3.js";import"./chunk-HNHLGX7F.js";import{a as re}from"./chunk-7L57YG4E.js";import"./chunk-LXFJ7QGK.js";import"./chunk-SFSRABV5.js";import{e as pe,f as me}from"./chunk-HNESPLVM.js";import"./chunk-G7E24J2R.js";import"./chunk-VYA2NFJ5.js";import"./chunk-SH55PTEY.js";import"./chunk-VPS35GPI.js";import"./chunk-UGBMCXS6.js";import"./chunk-5TTXT2K2.js";import"./chunk-YNQPX5G6.js";import{O as le}from"./chunk-BXYSKXYX.js";import"./chunk-JFJPOKIM.js";import"./chunk-QYSFCWV7.js";import{d as ie}from"./chunk-IEJVBN5K.js";import"./chunk-SGWWI7EY.js";import{c as te}from"./chunk-BQPO535K.js";import"./chunk-HLLBCLO6.js";import"./chunk-4P6SOZDY.js";import"./chunk-XN7T54IM.js";import"./chunk-RULWGB4E.js";import"./chunk-2HIDUY57.js";import"./chunk-U5Y75IZ5.js";import"./chunk-HY3IUHOC.js";import"./chunk-4AEX2WLA.js";import"./chunk-2MELUOYA.js";import"./chunk-WOPE6PPO.js";import{E as Y,c as J,h as Q,o as X}from"./chunk-MDIMQ3H3.js";import"./chunk-PIIH224Z.js";import"./chunk-NCWKENB5.js";import"./chunk-MWDJTJ3O.js";import{b as $}from"./chunk-7CQSSHSC.js";import{a as z}from"./chunk-3DEA4WWC.js";import"./chunk-SEDQQVP7.js";import{q as Z}from"./chunk-TKVDP62Z.js";import{Ad as q,Bb as _,Cc as T,Db as g,Dc as F,Eb as L,Fa as M,Gb as O,Hb as W,Ib as u,Jb as n,Kb as t,Kc as f,Lb as k,Lc as H,Mc as w,Qc as U,Ub as h,Vd as G,Xb as P,Xd as K,Za as r,Zb as d,eb as E,ib as V,lc as B,mc as p,nb as N,nc as S,ob as I,oc as D,qd as R,ra as b,rc as C,sc as y,tc as x,va as s,vd as A,wa as c,xd as j}from"./chunk-GJDGQISV.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";var he=()=>["/menu/Orders/Advanced/Reprint/History/Flat_View"],xe=a=>({ID:a}),Pe=()=>["/menu/Contacts/Contact/Customers/Info"],Se=a=>({"text-danger":a});function De(a,m){if(a&1){let e=h();n(0,"button",15),P("click",function(){s(e);let o=d();return c(o.openExportModal())}),k(1,"i",16),p(2," Export "),t()}}function we(a,m){if(a&1){let e=h();n(0,"h6"),p(1,"Last Reprint By (User)"),t(),n(2,"autocompleteV2",28),x("ngModelChange",function(o){s(e);let l=d(2);return y(l.pageData.Filter.UserID,o)||(l.pageData.Filter.UserID=o),c(o)}),t()}if(a&2){let e=d(2);r(2),C("ngModel",e.pageData.Filter.UserID)}}function Fe(a,m){if(a&1){let e=h();n(0,"div",17)(1,"h6"),p(2,"Outlets"),t(),n(3,"outlet-selector",18),x("ngModelChange",function(o){s(e);let l=d();return y(l.pageData.Filter.ListOutletID,o)||(l.pageData.Filter.ListOutletID=o),c(o)}),t(),n(4,"h6"),p(5,"Customer"),t(),n(6,"autocompleteV2",19),x("ngModelChange",function(o){s(e);let l=d();return y(l.pageData.Filter.CustomerID,o)||(l.pageData.Filter.CustomerID=o),c(o)}),t(),n(7,"h6"),p(8,"From - To"),t(),n(9,"div",20)(10,"div",21)(11,"datepicker",22),x("dateChange",function(o){s(e);let l=d();return y(l.pageData.Filter.From,o)||(l.pageData.Filter.From=o),c(o)}),t()(),n(12,"div",23)(13,"datepicker",24),x("dateChange",function(o){s(e);let l=d();return y(l.pageData.Filter.To,o)||(l.pageData.Filter.To=o),c(o)}),t()()(),n(14,"h6"),p(15,"Number Filter Comparator"),t(),n(16,"ng-select",25),x("ngModelChange",function(o){s(e);let l=d();return y(l.pageData.Filter.NumberFilterComparator,o)||(l.pageData.Filter.NumberFilterComparator=o),c(o)}),P("ngModelChange",function(o){s(e);let l=d();return c(l.updateSearchPlaceholder(o))}),t(),n(17,"h6"),p(18,"Printed"),t(),n(19,"radio-options",26),x("modelChange",function(o){s(e);let l=d();return y(l.pageData.Filter.Printed,o)||(l.pageData.Filter.Printed=o),c(o)}),t(),_(20,we,3,1),n(21,"h6"),p(22,"Page Size"),t(),n(23,"div")(24,"input",27),x("ngModelChange",function(o){s(e);let l=d();return y(l.pageData.Filter.RowCount,o)||(l.pageData.Filter.RowCount=o),c(o)}),t()()()}if(a&2){let e=d();r(3),C("ngModel",e.pageData.Filter.ListOutletID),u("multiple",!0),r(3),C("ngModel",e.pageData.Filter.CustomerID),r(5),u("isFloatingLabel",!1),C("date",e.pageData.Filter.From),r(2),u("isFloatingLabel",!1),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.NumberFilterComparator),u("items",e.pageData.Options.SearchComparatorTypeOption)("clearable",!1),r(3),C("model",e.pageData.Filter.Printed),u("options",e.pageData.Options.PrintedOptions),r(),g(e.pageData.Filter.Printed!==0?20:-1),r(4),C("ngModel",e.pageData.Filter.RowCount)}}function ve(a,m){a&1&&(n(0,"th",10),p(1,"Last Reprint By"),t())}function be(a,m){a&1&&(n(0,"th",7),p(1,"Date"),t())}function Me(a,m){a&1&&(n(0,"th",11),p(1,"Time"),t())}function Ee(a,m){a&1&&(n(0,"th",13),p(1,"Count"),t())}function Ie(a,m){if(a&1&&(n(0,"td"),p(1),t()),a&2){let e=d().$implicit;r(),S(e.CreatorName)}}function Te(a,m){if(a&1&&(n(0,"td"),p(1),f(2,"date"),t()),a&2){let e=d().$implicit;r(),D(" ",e.Created==="0001-01-01T00:00:00"?"":w(2,1,e.Created,"dd MMM yyyy")," ")}}function He(a,m){if(a&1&&(n(0,"td"),p(1),f(2,"date"),t()),a&2){let e=d().$implicit;r(),D(" ",e.Created==="0001-01-01T00:00:00"?"":w(2,1,e.Created,"HH:mm:ss")," ")}}function Ve(a,m){if(a&1&&(n(0,"td",33),p(1),f(2,"amountFraction"),t()),a&2){let e=d().$implicit;B(F(5,Se,e.InvoiceAmount<0)),r(),D(" ",H(2,3,e.InvoiceAmount)," ")}}function Ne(a,m){if(a&1){let e=h();n(0,"td",34),P("click",function(){s(e);let o=d().$implicit,l=d();return c(l.onInvoiceCountClick(o))}),p(1),f(2,"number"),t()}if(a&2){let e=d().$implicit;r(),D(" ",H(2,1,e.Count)," ")}}function Le(a,m){if(a&1&&(n(0,"tr")(1,"td"),p(2),t(),n(3,"td")(4,"a",29),p(5),t()(),n(6,"td")(7,"a",30),p(8),t()(),n(9,"td"),p(10),f(11,"date"),t(),n(12,"td"),p(13),f(14,"date"),t(),_(15,Ie,2,1,"td"),_(16,Te,3,4,"td"),_(17,He,3,4,"td"),I(18,Ve,3,7,"td",31),_(19,Ne,3,3,"td",32),t()),a&2){let e=m.$implicit,i=d();r(2),S(e.EntityName),r(2),u("queryParams",F(19,xe,e.InvoiceID)),r(),S(e.Number),r(2),u("routerLink",T(21,Pe))("queryParams",F(22,xe,e.CustomerID)),r(),D(" ",e.CustomerName," "),r(2),S(w(11,13,e.InvoiceDate,"dd MMM yyyy")),r(3),S(w(14,16,e.InvoiceDueDate,"dd MMM")),r(2),g(i.isNotUnprintedOnly()?15:-1),r(),g(i.isNotUnprintedOnly()?16:-1),r(),g(i.isNotUnprintedOnly()?17:-1),r(),u("ngIf",i.roleService.sell.PriceVisible),r(),g(i.isNotUnprintedOnly()?19:-1)}}var fe=class a extends ee{roleService=b($);dialog=b(te);isNotUnprintedOnly=M(!0);searchBoxPlaceholder=M(null);constructor(m,e){super(m,e,"invoice/GetPrintHistoryList","invoiceLoader/GetPrintHistoryList")}preInitList(){this.updateSearchPlaceholder(this.pageData.Filter.NumberFilterComparator)}updateSearchPlaceholder(m){let e=this.pageData.Options.SearchComparatorTypeOption?.find(o=>o.Key===m),i=z.IsNotEmpty(e)?`Number ${e?.Value}`:"Number Starts With";this.searchBoxPlaceholder.set(i)}openExportModal(){this.pageData.Filter.Export=!0,this.dialog.open(oe,{data:{title:"Reprint History (Aggregate)",exportTypes:[{ID:"invoice/GetPrintHistoryList",Value:"Default",FileName:"Reprint History (Aggregate)"}],filterExport:this.pageData.Filter,pagination:!0}}).afterClosed().subscribe(()=>{this.pageData.Filter.Export=!1})}onSubmit(){let m=this.pageData.Filter.Printed!==0;this.isNotUnprintedOnly.set(m),this.getListData()}onInvoiceCountClick(m){let e=`${le.InvoicePrintHistory}/${m.InvoiceID}`;this.httpService.get(e).subscribe(i=>{this.dialog.open(ye,{data:i?.Data})})}static \u0275fac=function(e){return new(e||a)(E(re),E(Z))};static \u0275cmp=V({type:a,selectors:[["app-print-history"]],features:[N],decls:34,vars:14,consts:[["pageFilterTemplate",""],[3,"onSubmit","textChange","pageData","isFilterOnDropdown","searchBoxPlaceholder","text"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"btn","btn-outline-secondary","ms-3"],[1,"container-fluid","mt-5"],["matSort","",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","100px"],[2,"width","200px"],[2,"width","80px"],[2,"width","120px"],[2,"width","70px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","30px"],[3,"jumpToPage","previousPage","nextPage","total","totalAllData","pageData"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload","me-1"],[1,"dialog-filter"],[3,"ngModelChange","ngModel","multiple"],["name","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"row"],[1,"col-6","pe-2"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"col-6","ps-2"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an Comparator",3,"ngModelChange","ngModel","items","clearable"],[3,"modelChange","model","options"],["type","text","placeholder","Page Size","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["requestUrl","/API/AC/GetUserSuggestion",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",1,"link-primary","cursor-pointer",3,"queryParams"],[1,"link-primary","cursor-pointer",3,"routerLink","queryParams"],["class","text-end",3,"class",4,"ngIf"],[1,"cursor-pointer","text-end","link-primary"],[1,"text-end"],[1,"cursor-pointer","text-end","link-primary",3,"click"]],template:function(e,i){if(e&1){let o=h();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return i.onSubmit()}),x("textChange",function(v){return s(o),y(i.pageData.Filter.Number,v)||(i.pageData.Filter.Number=v),c(v)}),n(1,"actions")(2,"a",2)(3,"span"),p(4,"Flat View"),t()(),_(5,De,3,0,"button",3),t(),n(6,"filters"),I(7,Fe,25,14,"ng-template",null,0,U),t(),n(9,"content")(10,"div",4)(11,"table",5)(12,"thead",6)(13,"tr")(14,"th",7),p(15,"Outlet"),t(),n(16,"th",8),p(17,"Number"),t(),n(18,"th"),p(19,"Customer"),t(),n(20,"th",7),p(21,"Date"),t(),n(22,"th",9),p(23,"Due"),t(),_(24,ve,2,0,"th",10),_(25,be,2,0,"th",7),_(26,Me,2,0,"th",11),n(27,"th",12),p(28,"Amount"),t(),_(29,Ee,2,0,"th",13),t()(),n(30,"tbody"),O(31,Le,20,24,"tr",null,L),t()(),n(33,"POS-complex-pagination",14),P("jumpToPage",function(){return i.getListData()})("previousPage",function(){return i.getListData()})("nextPage",function(){return i.getListData()}),t()()()()}e&2&&(u("pageData",i.menuData)("isFilterOnDropdown",!1)("searchBoxPlaceholder",i.searchBoxPlaceholder()),C("text",i.pageData.Filter.Number),r(2),u("routerLink",T(13,he)),r(3),g(i.roleService.global.Export?5:-1),r(19),g(i.isNotUnprintedOnly()?24:-1),r(),g(i.isNotUnprintedOnly()?25:-1),r(),g(i.isNotUnprintedOnly()?26:-1),r(3),g(i.isNotUnprintedOnly()?29:-1),r(2),W(i.data==null?null:i.data.Data),r(2),u("total",i.data==null||i.data.Data==null?null:i.data.Data.length)("totalAllData",i.data==null?null:i.data.ListTotal)("pageData",i.pageData))},dependencies:[q,R,se,de,ue,Y,J,Q,X,Ce,ge,_e,ne,K,G,me,pe,ce,ie,j,A,ae],encapsulation:2})};export{fe as PrintHistoryComponent};
1
+ import{a as ye}from"./chunk-ESI3EIOA.js";import"./chunk-4VRCKWUY.js";import{p as Ce}from"./chunk-NQT3PG63.js";import"./chunk-2D4XBF6C.js";import"./chunk-J63OB27M.js";import"./chunk-MPN57TB5.js";import"./chunk-KF3MHC66.js";import"./chunk-KBZZ7PX4.js";import"./chunk-ETGLCIRD.js";import{a as _e,b as ge}from"./chunk-IGJSYOLU.js";import{a as ae}from"./chunk-M2AZOKFB.js";import{a as ue}from"./chunk-MRKE47YW.js";import"./chunk-PUHZOP5L.js";import{d as ce}from"./chunk-LMI6FIPG.js";import"./chunk-3S3T7QLT.js";import{b as oe}from"./chunk-HP5IPESO.js";import"./chunk-6N2DU4HB.js";import{a as ee}from"./chunk-GLXRJASK.js";import"./chunk-YZKGVOZS.js";import"./chunk-XKQYXDV6.js";import"./chunk-4KO3X4S2.js";import"./chunk-BACG4SJJ.js";import"./chunk-CQTLBAQD.js";import{a as ne}from"./chunk-OFSPPASQ.js";import"./chunk-LYZAXNP3.js";import"./chunk-XULGDGRO.js";import"./chunk-43NB6BM4.js";import"./chunk-OVEGWW7W.js";import"./chunk-LL4377Z2.js";import"./chunk-GAOYV53E.js";import"./chunk-W6JPMHYE.js";import"./chunk-BXA2JYKG.js";import{f as de,g as se}from"./chunk-NSBIEAEN.js";import"./chunk-YJCMKEIW.js";import"./chunk-HNHLGX7F.js";import{a as re}from"./chunk-BBLFHZEO.js";import"./chunk-LXFJ7QGK.js";import"./chunk-GWZLP3JE.js";import{e as pe,f as me}from"./chunk-WF6K4N5K.js";import"./chunk-G7E24J2R.js";import"./chunk-VYA2NFJ5.js";import"./chunk-SH55PTEY.js";import"./chunk-VPS35GPI.js";import"./chunk-UGBMCXS6.js";import"./chunk-5TTXT2K2.js";import"./chunk-YNQPX5G6.js";import{O as le}from"./chunk-BXYSKXYX.js";import"./chunk-JFJPOKIM.js";import"./chunk-QYSFCWV7.js";import{d as ie}from"./chunk-IEJVBN5K.js";import"./chunk-GDIWAXMB.js";import{c as te}from"./chunk-BQPO535K.js";import"./chunk-HLLBCLO6.js";import"./chunk-4P6SOZDY.js";import"./chunk-XN7T54IM.js";import"./chunk-RULWGB4E.js";import"./chunk-2HIDUY57.js";import"./chunk-U5Y75IZ5.js";import"./chunk-HY3IUHOC.js";import"./chunk-4AEX2WLA.js";import"./chunk-2MELUOYA.js";import"./chunk-WOPE6PPO.js";import{E as Y,c as J,h as Q,o as X}from"./chunk-MDIMQ3H3.js";import"./chunk-OA6PQTAA.js";import"./chunk-ZIEDDJRF.js";import"./chunk-MWDJTJ3O.js";import{b as $}from"./chunk-7CQSSHSC.js";import{a as z}from"./chunk-3DEA4WWC.js";import"./chunk-EWVIPH3Y.js";import{q as Z}from"./chunk-TKVDP62Z.js";import{Ad as q,Bb as _,Cc as T,Db as g,Dc as F,Eb as L,Fa as M,Gb as O,Hb as W,Ib as u,Jb as n,Kb as t,Kc as f,Lb as k,Lc as H,Mc as w,Qc as U,Ub as h,Vd as G,Xb as P,Xd as K,Za as r,Zb as d,eb as E,ib as V,lc as B,mc as p,nb as N,nc as S,ob as I,oc as D,qd as R,ra as b,rc as C,sc as y,tc as x,va as s,vd as A,wa as c,xd as j}from"./chunk-GJDGQISV.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";var he=()=>["/menu/Orders/Advanced/Reprint/History/Flat_View"],xe=a=>({ID:a}),Pe=()=>["/menu/Contacts/Contact/Customers/Info"],Se=a=>({"text-danger":a});function De(a,m){if(a&1){let e=h();n(0,"button",15),P("click",function(){s(e);let o=d();return c(o.openExportModal())}),k(1,"i",16),p(2," Export "),t()}}function we(a,m){if(a&1){let e=h();n(0,"h6"),p(1,"Last Reprint By (User)"),t(),n(2,"autocompleteV2",28),x("ngModelChange",function(o){s(e);let l=d(2);return y(l.pageData.Filter.UserID,o)||(l.pageData.Filter.UserID=o),c(o)}),t()}if(a&2){let e=d(2);r(2),C("ngModel",e.pageData.Filter.UserID)}}function Fe(a,m){if(a&1){let e=h();n(0,"div",17)(1,"h6"),p(2,"Outlets"),t(),n(3,"outlet-selector",18),x("ngModelChange",function(o){s(e);let l=d();return y(l.pageData.Filter.ListOutletID,o)||(l.pageData.Filter.ListOutletID=o),c(o)}),t(),n(4,"h6"),p(5,"Customer"),t(),n(6,"autocompleteV2",19),x("ngModelChange",function(o){s(e);let l=d();return y(l.pageData.Filter.CustomerID,o)||(l.pageData.Filter.CustomerID=o),c(o)}),t(),n(7,"h6"),p(8,"From - To"),t(),n(9,"div",20)(10,"div",21)(11,"datepicker",22),x("dateChange",function(o){s(e);let l=d();return y(l.pageData.Filter.From,o)||(l.pageData.Filter.From=o),c(o)}),t()(),n(12,"div",23)(13,"datepicker",24),x("dateChange",function(o){s(e);let l=d();return y(l.pageData.Filter.To,o)||(l.pageData.Filter.To=o),c(o)}),t()()(),n(14,"h6"),p(15,"Number Filter Comparator"),t(),n(16,"ng-select",25),x("ngModelChange",function(o){s(e);let l=d();return y(l.pageData.Filter.NumberFilterComparator,o)||(l.pageData.Filter.NumberFilterComparator=o),c(o)}),P("ngModelChange",function(o){s(e);let l=d();return c(l.updateSearchPlaceholder(o))}),t(),n(17,"h6"),p(18,"Printed"),t(),n(19,"radio-options",26),x("modelChange",function(o){s(e);let l=d();return y(l.pageData.Filter.Printed,o)||(l.pageData.Filter.Printed=o),c(o)}),t(),_(20,we,3,1),n(21,"h6"),p(22,"Page Size"),t(),n(23,"div")(24,"input",27),x("ngModelChange",function(o){s(e);let l=d();return y(l.pageData.Filter.RowCount,o)||(l.pageData.Filter.RowCount=o),c(o)}),t()()()}if(a&2){let e=d();r(3),C("ngModel",e.pageData.Filter.ListOutletID),u("multiple",!0),r(3),C("ngModel",e.pageData.Filter.CustomerID),r(5),u("isFloatingLabel",!1),C("date",e.pageData.Filter.From),r(2),u("isFloatingLabel",!1),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.NumberFilterComparator),u("items",e.pageData.Options.SearchComparatorTypeOption)("clearable",!1),r(3),C("model",e.pageData.Filter.Printed),u("options",e.pageData.Options.PrintedOptions),r(),g(e.pageData.Filter.Printed!==0?20:-1),r(4),C("ngModel",e.pageData.Filter.RowCount)}}function ve(a,m){a&1&&(n(0,"th",10),p(1,"Last Reprint By"),t())}function be(a,m){a&1&&(n(0,"th",7),p(1,"Date"),t())}function Me(a,m){a&1&&(n(0,"th",11),p(1,"Time"),t())}function Ee(a,m){a&1&&(n(0,"th",13),p(1,"Count"),t())}function Ie(a,m){if(a&1&&(n(0,"td"),p(1),t()),a&2){let e=d().$implicit;r(),S(e.CreatorName)}}function Te(a,m){if(a&1&&(n(0,"td"),p(1),f(2,"date"),t()),a&2){let e=d().$implicit;r(),D(" ",e.Created==="0001-01-01T00:00:00"?"":w(2,1,e.Created,"dd MMM yyyy")," ")}}function He(a,m){if(a&1&&(n(0,"td"),p(1),f(2,"date"),t()),a&2){let e=d().$implicit;r(),D(" ",e.Created==="0001-01-01T00:00:00"?"":w(2,1,e.Created,"HH:mm:ss")," ")}}function Ve(a,m){if(a&1&&(n(0,"td",33),p(1),f(2,"amountFraction"),t()),a&2){let e=d().$implicit;B(F(5,Se,e.InvoiceAmount<0)),r(),D(" ",H(2,3,e.InvoiceAmount)," ")}}function Ne(a,m){if(a&1){let e=h();n(0,"td",34),P("click",function(){s(e);let o=d().$implicit,l=d();return c(l.onInvoiceCountClick(o))}),p(1),f(2,"number"),t()}if(a&2){let e=d().$implicit;r(),D(" ",H(2,1,e.Count)," ")}}function Le(a,m){if(a&1&&(n(0,"tr")(1,"td"),p(2),t(),n(3,"td")(4,"a",29),p(5),t()(),n(6,"td")(7,"a",30),p(8),t()(),n(9,"td"),p(10),f(11,"date"),t(),n(12,"td"),p(13),f(14,"date"),t(),_(15,Ie,2,1,"td"),_(16,Te,3,4,"td"),_(17,He,3,4,"td"),I(18,Ve,3,7,"td",31),_(19,Ne,3,3,"td",32),t()),a&2){let e=m.$implicit,i=d();r(2),S(e.EntityName),r(2),u("queryParams",F(19,xe,e.InvoiceID)),r(),S(e.Number),r(2),u("routerLink",T(21,Pe))("queryParams",F(22,xe,e.CustomerID)),r(),D(" ",e.CustomerName," "),r(2),S(w(11,13,e.InvoiceDate,"dd MMM yyyy")),r(3),S(w(14,16,e.InvoiceDueDate,"dd MMM")),r(2),g(i.isNotUnprintedOnly()?15:-1),r(),g(i.isNotUnprintedOnly()?16:-1),r(),g(i.isNotUnprintedOnly()?17:-1),r(),u("ngIf",i.roleService.sell.PriceVisible),r(),g(i.isNotUnprintedOnly()?19:-1)}}var fe=class a extends ee{roleService=b($);dialog=b(te);isNotUnprintedOnly=M(!0);searchBoxPlaceholder=M(null);constructor(m,e){super(m,e,"invoice/GetPrintHistoryList","invoiceLoader/GetPrintHistoryList")}preInitList(){this.updateSearchPlaceholder(this.pageData.Filter.NumberFilterComparator)}updateSearchPlaceholder(m){let e=this.pageData.Options.SearchComparatorTypeOption?.find(o=>o.Key===m),i=z.IsNotEmpty(e)?`Number ${e?.Value}`:"Number Starts With";this.searchBoxPlaceholder.set(i)}openExportModal(){this.pageData.Filter.Export=!0,this.dialog.open(oe,{data:{title:"Reprint History (Aggregate)",exportTypes:[{ID:"invoice/GetPrintHistoryList",Value:"Default",FileName:"Reprint History (Aggregate)"}],filterExport:this.pageData.Filter,pagination:!0}}).afterClosed().subscribe(()=>{this.pageData.Filter.Export=!1})}onSubmit(){let m=this.pageData.Filter.Printed!==0;this.isNotUnprintedOnly.set(m),this.getListData()}onInvoiceCountClick(m){let e=`${le.InvoicePrintHistory}/${m.InvoiceID}`;this.httpService.get(e).subscribe(i=>{this.dialog.open(ye,{data:i?.Data})})}static \u0275fac=function(e){return new(e||a)(E(re),E(Z))};static \u0275cmp=V({type:a,selectors:[["app-print-history"]],features:[N],decls:34,vars:14,consts:[["pageFilterTemplate",""],[3,"onSubmit","textChange","pageData","isFilterOnDropdown","searchBoxPlaceholder","text"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"btn","btn-outline-secondary","ms-3"],[1,"container-fluid","mt-5"],["matSort","",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","100px"],[2,"width","200px"],[2,"width","80px"],[2,"width","120px"],[2,"width","70px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","30px"],[3,"jumpToPage","previousPage","nextPage","total","totalAllData","pageData"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload","me-1"],[1,"dialog-filter"],[3,"ngModelChange","ngModel","multiple"],["name","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"row"],[1,"col-6","pe-2"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"col-6","ps-2"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an Comparator",3,"ngModelChange","ngModel","items","clearable"],[3,"modelChange","model","options"],["type","text","placeholder","Page Size","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["requestUrl","/API/AC/GetUserSuggestion",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",1,"link-primary","cursor-pointer",3,"queryParams"],[1,"link-primary","cursor-pointer",3,"routerLink","queryParams"],["class","text-end",3,"class",4,"ngIf"],[1,"cursor-pointer","text-end","link-primary"],[1,"text-end"],[1,"cursor-pointer","text-end","link-primary",3,"click"]],template:function(e,i){if(e&1){let o=h();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return i.onSubmit()}),x("textChange",function(v){return s(o),y(i.pageData.Filter.Number,v)||(i.pageData.Filter.Number=v),c(v)}),n(1,"actions")(2,"a",2)(3,"span"),p(4,"Flat View"),t()(),_(5,De,3,0,"button",3),t(),n(6,"filters"),I(7,Fe,25,14,"ng-template",null,0,U),t(),n(9,"content")(10,"div",4)(11,"table",5)(12,"thead",6)(13,"tr")(14,"th",7),p(15,"Outlet"),t(),n(16,"th",8),p(17,"Number"),t(),n(18,"th"),p(19,"Customer"),t(),n(20,"th",7),p(21,"Date"),t(),n(22,"th",9),p(23,"Due"),t(),_(24,ve,2,0,"th",10),_(25,be,2,0,"th",7),_(26,Me,2,0,"th",11),n(27,"th",12),p(28,"Amount"),t(),_(29,Ee,2,0,"th",13),t()(),n(30,"tbody"),O(31,Le,20,24,"tr",null,L),t()(),n(33,"POS-complex-pagination",14),P("jumpToPage",function(){return i.getListData()})("previousPage",function(){return i.getListData()})("nextPage",function(){return i.getListData()}),t()()()()}e&2&&(u("pageData",i.menuData)("isFilterOnDropdown",!1)("searchBoxPlaceholder",i.searchBoxPlaceholder()),C("text",i.pageData.Filter.Number),r(2),u("routerLink",T(13,he)),r(3),g(i.roleService.global.Export?5:-1),r(19),g(i.isNotUnprintedOnly()?24:-1),r(),g(i.isNotUnprintedOnly()?25:-1),r(),g(i.isNotUnprintedOnly()?26:-1),r(3),g(i.isNotUnprintedOnly()?29:-1),r(2),W(i.data==null?null:i.data.Data),r(2),u("total",i.data==null||i.data.Data==null?null:i.data.Data.length)("totalAllData",i.data==null?null:i.data.ListTotal)("pageData",i.pageData))},dependencies:[q,R,se,de,ue,Y,J,Q,X,Ce,ge,_e,ne,K,G,me,pe,ce,ie,j,A,ae],encapsulation:2})};export{fe as PrintHistoryComponent};
@@ -1 +1 @@
1
- import{a as me}from"./chunk-MU3MEP6L.js";import{a as Y}from"./chunk-QFJGVF6F.js";import{p as de}from"./chunk-NQT3PG63.js";import"./chunk-2D4XBF6C.js";import"./chunk-J63OB27M.js";import"./chunk-MPN57TB5.js";import"./chunk-KF3MHC66.js";import"./chunk-KBZZ7PX4.js";import"./chunk-ETGLCIRD.js";import{e as pe}from"./chunk-7AJKCI6R.js";import"./chunk-VKVLUGGS.js";import"./chunk-WJGP2CLN.js";import"./chunk-2ZXCNSZZ.js";import"./chunk-3S3T7QLT.js";import{b as te}from"./chunk-HP5IPESO.js";import"./chunk-6N2DU4HB.js";import"./chunk-UCUYHB7R.js";import"./chunk-JLQUTBFH.js";import"./chunk-YHXZO4DY.js";import"./chunk-JEKS3WOF.js";import"./chunk-OJAFESGH.js";import"./chunk-PSMXOOE7.js";import"./chunk-XKQYXDV6.js";import"./chunk-4KO3X4S2.js";import"./chunk-BACG4SJJ.js";import"./chunk-CQTLBAQD.js";import"./chunk-OFSPPASQ.js";import"./chunk-JFIKQKZJ.js";import"./chunk-N4NZWFKH.js";import"./chunk-6CDU6CJB.js";import"./chunk-XULGDGRO.js";import"./chunk-43NB6BM4.js";import"./chunk-OVEGWW7W.js";import"./chunk-LL4377Z2.js";import"./chunk-GAOYV53E.js";import"./chunk-W6JPMHYE.js";import"./chunk-BXA2JYKG.js";import{a as ae}from"./chunk-W6N427P2.js";import{f as re,g as le}from"./chunk-B5EEORFC.js";import"./chunk-PAF2E6M3.js";import"./chunk-HNHLGX7F.js";import{a as ie}from"./chunk-7L57YG4E.js";import"./chunk-LXFJ7QGK.js";import"./chunk-SFSRABV5.js";import{e as ne,f as oe}from"./chunk-HNESPLVM.js";import"./chunk-G7E24J2R.js";import"./chunk-VYA2NFJ5.js";import"./chunk-SH55PTEY.js";import"./chunk-VPS35GPI.js";import"./chunk-UGBMCXS6.js";import"./chunk-5TTXT2K2.js";import"./chunk-YNQPX5G6.js";import"./chunk-BXYSKXYX.js";import"./chunk-JFJPOKIM.js";import"./chunk-QYSFCWV7.js";import{d as $,e as ee}from"./chunk-IEJVBN5K.js";import"./chunk-SGWWI7EY.js";import{c as Z}from"./chunk-BQPO535K.js";import"./chunk-HLLBCLO6.js";import"./chunk-4P6SOZDY.js";import"./chunk-XN7T54IM.js";import"./chunk-RULWGB4E.js";import"./chunk-2HIDUY57.js";import"./chunk-U5Y75IZ5.js";import"./chunk-HY3IUHOC.js";import"./chunk-4AEX2WLA.js";import"./chunk-2MELUOYA.js";import"./chunk-WOPE6PPO.js";import{E as J,h as z,o as K}from"./chunk-MDIMQ3H3.js";import"./chunk-PIIH224Z.js";import"./chunk-NCWKENB5.js";import"./chunk-MWDJTJ3O.js";import{b as X}from"./chunk-7CQSSHSC.js";import"./chunk-3DEA4WWC.js";import"./chunk-SEDQQVP7.js";import{n as q,q as Q}from"./chunk-TKVDP62Z.js";import{Ad as N,Bb as E,Db as V,Dc as W,Eb as H,Gb as b,Hb as U,Ib as C,Jb as i,Kb as a,Kc as L,Lb as T,Mc as A,Pb as P,Qb as h,Qc as B,Sa as I,Sd as O,Ub as w,Vd as j,Xb as x,Xd as G,Za as o,Zb as c,dd as R,eb as _,ib as M,mc as r,nb as F,nc as D,ob as v,rc as s,sc as g,tc as u,va as d,vd as k,wa as m}from"./chunk-GJDGQISV.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";var ue=p=>({ID:p});function _e(p,S){if(p&1){let t=w();i(0,"a",11),x("click",function(){d(t);let e=c();return m(e.openExportModal())}),T(1,"i",12),r(2," Export "),a()}}function Ce(p,S){if(p&1){let t=w();i(0,"div",13)(1,"h6"),r(2,"Category"),a(),i(3,"POS-product-category-select",14),u("selectedCategoryIDChange",function(e){d(t);let n=c();return g(n.pageData.Filter.CategoryID,e)||(n.pageData.Filter.CategoryID=e),m(e)}),a(),i(4,"h6"),r(5,"Brand"),a(),i(6,"ng-select",15),u("ngModelChange",function(e){d(t);let n=c();return g(n.pageData.Filter.BrandID,e)||(n.pageData.Filter.BrandID=e),m(e)}),a(),i(7,"h6"),r(8,"Tags"),a(),i(9,"ng-select",16),u("ngModelChange",function(e){d(t);let n=c();return g(n.pageData.Filter.TagsID,e)||(n.pageData.Filter.TagsID=e),m(e)}),a(),i(10,"h6"),r(11,"Supplier"),a(),i(12,"autocompleteV2",17),u("ngModelChange",function(e){d(t);let n=c();return g(n.pageData.Filter.SupplierID,e)||(n.pageData.Filter.SupplierID=e),m(e)}),a(),i(13,"h6"),r(14,"From - To"),a(),i(15,"div")(16,"datepicker",18),u("dateChange",function(e){d(t);let n=c();return g(n.pageData.Filter.From,e)||(n.pageData.Filter.From=e),m(e)}),a()(),i(17,"div",19)(18,"datepicker",20),u("dateChange",function(e){d(t);let n=c();return g(n.pageData.Filter.To,e)||(n.pageData.Filter.To=e),m(e)}),a()(),i(19,"h6"),r(20,"Product"),a(),i(21,"autocompleteV2",21),u("ngModelChange",function(e){d(t);let n=c();return g(n.pageData.Filter.ProductID,e)||(n.pageData.Filter.ProductID=e),m(e)}),a()()}if(p&2){let t=c();o(3),s("selectedCategoryID",t.pageData.Filter.CategoryID),C("showClear",!0)("continuedCategoriesOnly",!0),o(3),C("items",t.pageData.Options==null?null:t.pageData.Options.Brands),s("ngModel",t.pageData.Filter.BrandID),o(3),C("items",t.pageData.Options==null?null:t.pageData.Options.Tags),s("ngModel",t.pageData.Filter.TagsID),o(3),s("ngModel",t.pageData.Filter.SupplierID),o(4),s("date",t.pageData.Filter.From),o(2),s("date",t.pageData.Filter.To),o(3),s("ngModel",t.pageData.Filter.ProductID)}}function ye(p,S){if(p&1&&(i(0,"tr")(1,"td")(2,"a",22),r(3),a()(),i(4,"td"),r(5),a(),i(6,"td"),r(7),a(),i(8,"td"),r(9),L(10,"date"),a(),i(11,"td"),T(12,"div",23),a()()),p&2){let t=S.$implicit;o(2),C("queryParams",W(9,ue,t.ProductID)),o(),D(t.ProductName),o(2),D(t.ProductCode),o(2),D(t.Modifier),o(2),D(A(10,6,t.Modified,"dd MMM yyyy HH:mm")),o(3),C("innerHTML",t.Note,I)}}var ce=class p extends Y{constructor(t,l,e,n,f,y,se,ge){super(t,l,"catalog/Product/GetProductUpdateHistories","catalog/ProductLoader/GetProductUpdateHistories",e,se,!1,ge);this.httpService=l;this.csvConverter=n;this.matDialog=f;this.roleService=y}openExportModal(){this.matDialog.open(te,{data:{title:"Product Import Log",exportTypes:[{ID:"productExport/GetExportProductUpdateHistories",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"catalog/Product/GetCountProductUpdateHistories",pagination:!0}})}static \u0275fac=function(l){return new(l||p)(_(ie),_(Q),_(q),_(ae),_(Z),_(X),_(O),_(R))};static \u0275cmp=M({type:p,selectors:[["pos-product-update-history"]],features:[F],decls:26,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["ngProjectAs","actions",5,["actions"]],[1,"btn","btn-outline-secondary"],["ngProjectAs","filters",5,["filters"]],["ngProjectAs","content",5,["content"]],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-header","account-receivable-header"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear","continuedCategoriesOnly"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["requestUrl","api/ac/GetProductSuggestionByCodeNName",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["target","_blank","routerLink","/menu/Products/Catalog/Products/Info",1,"link","link-primary",3,"queryParams"],[3,"innerHTML"]],template:function(l,e){if(l&1){let n=w();i(0,"mainpanel-cmp",1),u("textChange",function(y){return d(n),g(e.pageData.Filter.SearchText,y)||(e.pageData.Filter.SearchText=y),m(y)}),x("onSubmit",function(){return e.searchFromPageOne()}),u("filterChange",function(y){return d(n),g(e.pageData.Filter,y)||(e.pageData.Filter=y),m(y)}),P(1,2),E(2,_e,3,0,"a",3),h(),P(3,4),v(4,Ce,22,11,"ng-template",null,0,B),h(),P(6,5),i(7,"div",6)(8,"div",7)(9,"table",8)(10,"thead",9)(11,"tr")(12,"th"),r(13,"Product"),a(),i(14,"th"),r(15,"Code"),a(),i(16,"th"),r(17,"Modified By"),a(),i(18,"th"),r(19,"Modified"),a(),i(20,"th"),r(21,"Note"),a()()(),i(22,"tbody"),b(23,ye,13,11,"tr",null,H),a()()(),i(25,"infinite-pagination",10),x("nextPage",function(){return e.NextPage(!0)})("fetchTotalData",function(){return e.StoreRowsCountAPIResult("catalog/Product/GetCountProductUpdateHistories")})("concatAllData",function(){return e.StoreRowsCountAPIResult("catalog/Product/GetCountProductUpdateHistories",!0)}),a()(),h(),a()}l&2&&(C("pageData",e.menuData),s("text",e.pageData.Filter.SearchText),C("isFilterOnDropdown",!1),s("filter",e.pageData.Filter),o(2),V(e.roleService.global.Export?2:-1),o(21),U(e.infiniteList),o(2),C("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast))},dependencies:[le,re,J,z,K,N,me,pe,ee,$,de,oe,ne,G,j,k],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{ce as ProductUpdateHistoryComponent};
1
+ import{a as me}from"./chunk-MU3MEP6L.js";import{a as Y}from"./chunk-W2Y3M6IH.js";import{p as de}from"./chunk-NQT3PG63.js";import"./chunk-2D4XBF6C.js";import"./chunk-J63OB27M.js";import"./chunk-MPN57TB5.js";import"./chunk-KF3MHC66.js";import"./chunk-KBZZ7PX4.js";import"./chunk-ETGLCIRD.js";import{e as pe}from"./chunk-UPLQOCIA.js";import"./chunk-YI4M6JTJ.js";import"./chunk-WJGP2CLN.js";import"./chunk-2ZXCNSZZ.js";import"./chunk-3S3T7QLT.js";import{b as te}from"./chunk-HP5IPESO.js";import"./chunk-6N2DU4HB.js";import"./chunk-3QZIU3FE.js";import"./chunk-JLQUTBFH.js";import"./chunk-YHXZO4DY.js";import"./chunk-JEKS3WOF.js";import"./chunk-GLXRJASK.js";import"./chunk-YZKGVOZS.js";import"./chunk-XKQYXDV6.js";import"./chunk-4KO3X4S2.js";import"./chunk-BACG4SJJ.js";import"./chunk-CQTLBAQD.js";import"./chunk-OFSPPASQ.js";import"./chunk-JFIKQKZJ.js";import"./chunk-N4NZWFKH.js";import"./chunk-LYZAXNP3.js";import"./chunk-XULGDGRO.js";import"./chunk-43NB6BM4.js";import"./chunk-OVEGWW7W.js";import"./chunk-LL4377Z2.js";import"./chunk-GAOYV53E.js";import"./chunk-W6JPMHYE.js";import"./chunk-BXA2JYKG.js";import{a as ae}from"./chunk-W6N427P2.js";import{f as re,g as le}from"./chunk-NSBIEAEN.js";import"./chunk-YJCMKEIW.js";import"./chunk-HNHLGX7F.js";import{a as ie}from"./chunk-BBLFHZEO.js";import"./chunk-LXFJ7QGK.js";import"./chunk-GWZLP3JE.js";import{e as ne,f as oe}from"./chunk-WF6K4N5K.js";import"./chunk-G7E24J2R.js";import"./chunk-VYA2NFJ5.js";import"./chunk-SH55PTEY.js";import"./chunk-VPS35GPI.js";import"./chunk-UGBMCXS6.js";import"./chunk-5TTXT2K2.js";import"./chunk-YNQPX5G6.js";import"./chunk-BXYSKXYX.js";import"./chunk-JFJPOKIM.js";import"./chunk-QYSFCWV7.js";import{d as $,e as ee}from"./chunk-IEJVBN5K.js";import"./chunk-GDIWAXMB.js";import{c as Z}from"./chunk-BQPO535K.js";import"./chunk-HLLBCLO6.js";import"./chunk-4P6SOZDY.js";import"./chunk-XN7T54IM.js";import"./chunk-RULWGB4E.js";import"./chunk-2HIDUY57.js";import"./chunk-U5Y75IZ5.js";import"./chunk-HY3IUHOC.js";import"./chunk-4AEX2WLA.js";import"./chunk-2MELUOYA.js";import"./chunk-WOPE6PPO.js";import{E as J,h as z,o as K}from"./chunk-MDIMQ3H3.js";import"./chunk-OA6PQTAA.js";import"./chunk-ZIEDDJRF.js";import"./chunk-MWDJTJ3O.js";import{b as X}from"./chunk-7CQSSHSC.js";import"./chunk-3DEA4WWC.js";import"./chunk-EWVIPH3Y.js";import{n as q,q as Q}from"./chunk-TKVDP62Z.js";import{Ad as N,Bb as E,Db as V,Dc as W,Eb as H,Gb as b,Hb as U,Ib as C,Jb as i,Kb as a,Kc as L,Lb as T,Mc as A,Pb as P,Qb as h,Qc as B,Sa as I,Sd as O,Ub as w,Vd as j,Xb as x,Xd as G,Za as o,Zb as c,dd as R,eb as _,ib as M,mc as r,nb as F,nc as D,ob as v,rc as s,sc as g,tc as u,va as d,vd as k,wa as m}from"./chunk-GJDGQISV.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";var ue=p=>({ID:p});function _e(p,S){if(p&1){let t=w();i(0,"a",11),x("click",function(){d(t);let e=c();return m(e.openExportModal())}),T(1,"i",12),r(2," Export "),a()}}function Ce(p,S){if(p&1){let t=w();i(0,"div",13)(1,"h6"),r(2,"Category"),a(),i(3,"POS-product-category-select",14),u("selectedCategoryIDChange",function(e){d(t);let n=c();return g(n.pageData.Filter.CategoryID,e)||(n.pageData.Filter.CategoryID=e),m(e)}),a(),i(4,"h6"),r(5,"Brand"),a(),i(6,"ng-select",15),u("ngModelChange",function(e){d(t);let n=c();return g(n.pageData.Filter.BrandID,e)||(n.pageData.Filter.BrandID=e),m(e)}),a(),i(7,"h6"),r(8,"Tags"),a(),i(9,"ng-select",16),u("ngModelChange",function(e){d(t);let n=c();return g(n.pageData.Filter.TagsID,e)||(n.pageData.Filter.TagsID=e),m(e)}),a(),i(10,"h6"),r(11,"Supplier"),a(),i(12,"autocompleteV2",17),u("ngModelChange",function(e){d(t);let n=c();return g(n.pageData.Filter.SupplierID,e)||(n.pageData.Filter.SupplierID=e),m(e)}),a(),i(13,"h6"),r(14,"From - To"),a(),i(15,"div")(16,"datepicker",18),u("dateChange",function(e){d(t);let n=c();return g(n.pageData.Filter.From,e)||(n.pageData.Filter.From=e),m(e)}),a()(),i(17,"div",19)(18,"datepicker",20),u("dateChange",function(e){d(t);let n=c();return g(n.pageData.Filter.To,e)||(n.pageData.Filter.To=e),m(e)}),a()(),i(19,"h6"),r(20,"Product"),a(),i(21,"autocompleteV2",21),u("ngModelChange",function(e){d(t);let n=c();return g(n.pageData.Filter.ProductID,e)||(n.pageData.Filter.ProductID=e),m(e)}),a()()}if(p&2){let t=c();o(3),s("selectedCategoryID",t.pageData.Filter.CategoryID),C("showClear",!0)("continuedCategoriesOnly",!0),o(3),C("items",t.pageData.Options==null?null:t.pageData.Options.Brands),s("ngModel",t.pageData.Filter.BrandID),o(3),C("items",t.pageData.Options==null?null:t.pageData.Options.Tags),s("ngModel",t.pageData.Filter.TagsID),o(3),s("ngModel",t.pageData.Filter.SupplierID),o(4),s("date",t.pageData.Filter.From),o(2),s("date",t.pageData.Filter.To),o(3),s("ngModel",t.pageData.Filter.ProductID)}}function ye(p,S){if(p&1&&(i(0,"tr")(1,"td")(2,"a",22),r(3),a()(),i(4,"td"),r(5),a(),i(6,"td"),r(7),a(),i(8,"td"),r(9),L(10,"date"),a(),i(11,"td"),T(12,"div",23),a()()),p&2){let t=S.$implicit;o(2),C("queryParams",W(9,ue,t.ProductID)),o(),D(t.ProductName),o(2),D(t.ProductCode),o(2),D(t.Modifier),o(2),D(A(10,6,t.Modified,"dd MMM yyyy HH:mm")),o(3),C("innerHTML",t.Note,I)}}var ce=class p extends Y{constructor(t,l,e,n,f,y,se,ge){super(t,l,"catalog/Product/GetProductUpdateHistories","catalog/ProductLoader/GetProductUpdateHistories",e,se,!1,ge);this.httpService=l;this.csvConverter=n;this.matDialog=f;this.roleService=y}openExportModal(){this.matDialog.open(te,{data:{title:"Product Import Log",exportTypes:[{ID:"productExport/GetExportProductUpdateHistories",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"catalog/Product/GetCountProductUpdateHistories",pagination:!0}})}static \u0275fac=function(l){return new(l||p)(_(ie),_(Q),_(q),_(ae),_(Z),_(X),_(O),_(R))};static \u0275cmp=M({type:p,selectors:[["pos-product-update-history"]],features:[F],decls:26,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["ngProjectAs","actions",5,["actions"]],[1,"btn","btn-outline-secondary"],["ngProjectAs","filters",5,["filters"]],["ngProjectAs","content",5,["content"]],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-header","account-receivable-header"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear","continuedCategoriesOnly"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["requestUrl","api/ac/GetProductSuggestionByCodeNName",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["target","_blank","routerLink","/menu/Products/Catalog/Products/Info",1,"link","link-primary",3,"queryParams"],[3,"innerHTML"]],template:function(l,e){if(l&1){let n=w();i(0,"mainpanel-cmp",1),u("textChange",function(y){return d(n),g(e.pageData.Filter.SearchText,y)||(e.pageData.Filter.SearchText=y),m(y)}),x("onSubmit",function(){return e.searchFromPageOne()}),u("filterChange",function(y){return d(n),g(e.pageData.Filter,y)||(e.pageData.Filter=y),m(y)}),P(1,2),E(2,_e,3,0,"a",3),h(),P(3,4),v(4,Ce,22,11,"ng-template",null,0,B),h(),P(6,5),i(7,"div",6)(8,"div",7)(9,"table",8)(10,"thead",9)(11,"tr")(12,"th"),r(13,"Product"),a(),i(14,"th"),r(15,"Code"),a(),i(16,"th"),r(17,"Modified By"),a(),i(18,"th"),r(19,"Modified"),a(),i(20,"th"),r(21,"Note"),a()()(),i(22,"tbody"),b(23,ye,13,11,"tr",null,H),a()()(),i(25,"infinite-pagination",10),x("nextPage",function(){return e.NextPage(!0)})("fetchTotalData",function(){return e.StoreRowsCountAPIResult("catalog/Product/GetCountProductUpdateHistories")})("concatAllData",function(){return e.StoreRowsCountAPIResult("catalog/Product/GetCountProductUpdateHistories",!0)}),a()(),h(),a()}l&2&&(C("pageData",e.menuData),s("text",e.pageData.Filter.SearchText),C("isFilterOnDropdown",!1),s("filter",e.pageData.Filter),o(2),V(e.roleService.global.Export?2:-1),o(21),U(e.infiniteList),o(2),C("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast))},dependencies:[le,re,J,z,K,N,me,pe,ee,$,de,oe,ne,G,j,k],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{ce as ProductUpdateHistoryComponent};
@@ -1 +1 @@
1
- import{a as N}from"./chunk-PAPGVZ7T.js";import{a as M}from"./chunk-N4VK5DYX.js";import{a as w}from"./chunk-PSMXOOE7.js";import{a as A}from"./chunk-BXA2JYKG.js";import{a as x}from"./chunk-B5EEORFC.js";import{a as y}from"./chunk-HLLBCLO6.js";import{a as b}from"./chunk-U5Y75IZ5.js";import{a as D}from"./chunk-3DEA4WWC.js";import{A as L,Fa as c,ga as P,ra as F,u as C}from"./chunk-GJDGQISV.js";import{a as u,b as m}from"./chunk-SNAKHGZS.js";var S=class{enabledDragItem=c(!1);constructor(){}drop(s,t){A(t.Data,s.previousIndex,s.currentIndex)}toggleEnabledDragItem(){this.enabledDragItem.set(!this.enabledDragItem())}onSaveDragAndDrop(s,t){this.enabledDragItem.set(!this.enabledDragItem()),this.enabledDragItem()||t.postListID(s,t.data().Data)}onPutSaveDragAndDrop(s,t){this.enabledDragItem.set(!this.enabledDragItem()),this.enabledDragItem()||t.putListID(s,t.data().Data)}};var v=class{constructor(s){this.httpService=s}exportCSV(s,t,e,a){e.pageData().Filter.Export=!0,e.pageData().Filter.FormatType=0,a=a||"export.csv",this.httpService.post(`/api/${t}`,e.pageData().Filter).subscribe(r=>{s.convertToCSV(r,a),e.pageData().Filter.Export=!1})}convertToCSV(s,t=!1,e){let a=this.ExportDataFromUI2(t);s.convertToCSV(a,e)}ExportDataFromUI2(s=!1){let t=document.getElementById("tableGrid"),e=[];return D.IsNotEmpty(t)&&t.querySelectorAll("tr").forEach(r=>{let i=new Object,l=0;r.querySelectorAll("th, td").forEach(g=>{l++;let p=parseInt(g.getAttribute("colspan"));for(let n=1;n<p;n++)i["column"+l]="",l++;let o=g.innerText,d=o.toString().split("");if(s&&d[0]==="0"&&d.length>1){let n="'"+o.trim();i["column"+l]=n}else i["column"+l]=o.trim()}),e.push(i)}),e}};var f=class{listTotal=c(0);pageSize=c(0);show=c(!1);constructor(){}changePaginationData(s){let t=s.pageData().Filter.RowCount;this.pageSize.set(t);let e=s.data(),a=e?.ListTotal??e?.Data?.total?.value??0;this.listTotal.set(a),this.show.set(this.pageSize()<=this.listTotal())}changePage(s,t,e){t().Filter.PageNumber=s.pageIndex+1,e.getListData()}};var T=class extends N{constructor(t,e,a,r,i,l,h){super(t);this.httpService=e;this.dataAPI=a;this.pageAPI=r;this.toastrService=i;this.route=l;this.initOpenDialog=h;this.exportHandler=new v(e),r?(l&&this.loaderPayload.set(u({ListIDs:this.reportFilterService?.initOutletFilter()},l.snapshot.queryParams)),this.preInitLoader(),L([this.menuData$,this.httpService.post("/api/"+this.pageAPI,this.loaderPayload())]).pipe(C(([g,p])=>p)).pipe(y()).subscribe(g=>{this.pageData.set(g),this.pageData().Filter||(this.pageData().Filter={},this.pageData().Filter.RowCount=20),this.pageData().Filter.PageNumber=1,this.pageData().Filter.ID=this.loaderPayload()?.ID,this.preInitList(),h?this.openDialogFilter.openDialog():this.getListData()})):(this.pageData().Filter.RowCount=20,this.pageData().Filter.PageNumber=1,this.preInitList(),L({menuData:this.menuData$,listData:this.getListData$()}).pipe(y()).subscribe())}openDialogFilter=F(x);reportFilterService=F(w);pageData=c({Filter:{},Options:{},Roles:{},Config:{}});data=c(null);pagination=new f;dragDrop=new S;exportHandler;comparation=c(0);loaderPayload=c(null);reloadRowCount=c(!1);preInitLoader(){}preInitList(){}getListData(t){this.preGetList(),this.dataAPI&&this.httpService.post("/api/"+this.dataAPI,this.pageData().Filter).pipe(M("ListComponent - getListData")).subscribe(e=>{e.PageSubTitle&&(this.menuData.SH=e.PageSubTitle),this.data.set(e),this.postInit(e),this.reloadRowCount.set(!0),this.pagination.changePaginationData(this),t&&(this.pageData().HideStoreApiCount=!1)})}getListData$(t){return this.preGetList(),this.httpService.post("/api/"+this.dataAPI,this.pageData().Filter).pipe(P(e=>{this.data.set(e),this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData().HideStoreApiCount=!1)}))}searchFromPageOne(){this.preSearchFromPageOne(),this.pageData().Filter.PageNumber=1,this.getListData("filterMode")}postInit(t){t.PageTitle!=null&&(this.menuData.H=t.PageTitle)}preGetList(){this.pageData().Filter.From==null&&(this.pageData().Filter.From=D.MinDate),this.pageData().Filter.To==null&&(this.pageData().Filter.To=D.MinDate)}preSearchFromPageOne(){}onPaginationChange(t){this.pagination.changePage(t,this.pageData,this)}onSelectAllData(t){this.data.update(e=>!e||!e.Data?e:m(u({},e),{Data:e.Data.map(a=>m(u({},a),{selected:t}))}))}getSelectedData(){let t=[];if(this.data()){let e=this.data();t=e.Data?e.Data.filter(a=>a.selected):[]}return t}httpPostListID(t,e,a){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.postListID(t,r,a)}httpPutListID(t,e,a){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.putListID(t,r,a)}httpDeleteListID(t,e,a){if(e||(e="Are you sure you want to delete selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.DeleteListID(t,r,a)}onSaveDragAndDrop(t){this.dragDrop.onSaveDragAndDrop(t,this)}onPutSaveDragAndDrop(t){this.dragDrop.onPutSaveDragAndDrop(t,this)}postListID(t,e,a){let r=e.map(i=>a?i[a]:i.ID);this.httpService.post(`/api/${t}`,r,1e6,!0).subscribe(i=>{this.toastrService.success(i.Message?i.Message:i,b.Success),this.getListData()},i=>{let l=i.status+" "+i.statusText;this.toastrService.error(i.error.Message!=""?i.error.Message:"An unknown error has occured!",l,{enableHtml:!0})})}putListID(t,e,a){let r=e.map(i=>a?i[a]:i.ID);this.httpService.put(`/api/${t}`,r).subscribe(i=>{this.toastrService.success(i.Message?i.Message:i,b.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(t,e,a){let r=e.map(i=>a?i[a]:i.ID);this.httpService.delete(`/api/${t}`,{body:r}).subscribe(i=>{this.toastrService.success(i.Message?i.Message:i,b.Success),this.getListData()})}postData(t,e){this.httpService.post("/API/"+t,e).subscribe(a=>{this.getListData(),this.toastrService.success(a.Message?a.Message:a,b.Success)})}compare(t,e,a){return(t<e?-1:1)*(a?1:-1)}exportCSV(t,e,a){this.exportHandler.exportCSV(t,e,this,a)}s2ab(t){for(var e=new ArrayBuffer(t.length),a=new Uint8Array(e),r=0;r!=t.length;++r)a[r]=t.charCodeAt(r)&255;return e}exportXlsx(t,e){this.pageData().Filter.FormatType=1,this.pageData().Filter.Export=!0,this.httpService.post(`/api/${t}`,this.pageData().Filter).subscribe(a=>{e=decodeURI(e);let r=window.URL.createObjectURL(new Blob([this.s2ab(atob(a))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),i=document.createElement("a");i.href=r,i.setAttribute("download",e),document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(r),i.remove()})}convertToCSV(t,e=!1,a){let r=this.exportHandler.ExportDataFromUI2(e);t.convertToCSV(r,a)}OnCompare(t){let e=this.data(),a=t?e?.[t]:e;if(!a||a.length<1)return;let r=Object.assign({},this.pageData().Filter);r.From=new Date(new Date(this.pageData().Filter.From).getFullYear(),new Date(this.pageData().Filter.From).getMonth()-1,1),r.To=new Date(new Date(this.pageData().Filter.To).getFullYear(),new Date(this.pageData().Filter.To).getMonth(),0).toDateString(),this.httpService.post("/API/"+this.dataAPI,r).subscribe(i=>{let l=t?i[t]:i,h=0,g=a.map(p=>{let o=u({},p);o.PrevIndex="-",o.CurrentIndex="-",o.Increase="-";let d=l.filter(n=>n.EntityID==p.EntityID);if(o.CurrentIndex=p.Rank,d.length>0){let n=d[0];o.PrevIndex=n.Rank,n.SalesNet?o.Increase=(p.SalesNet-n.SalesNet)/n.SalesNet*100:n.Sales&&(o.Increase=(p.Sales-n.Sales)/n.Sales*100),o.IsPositive=o.Increase>0,o.IsNegative=o.Increase<0,h+=typeof o.Increase=="number"?o.Increase:0}return o});this.data.update(p=>p&&(t?m(u({},p),{[t]:g}):g)),this.comparation.set(h)})}};export{T as a};
1
+ import{a as N}from"./chunk-PAPGVZ7T.js";import{a as M}from"./chunk-N4VK5DYX.js";import{a as w}from"./chunk-YZKGVOZS.js";import{a as A}from"./chunk-BXA2JYKG.js";import{a as x}from"./chunk-NSBIEAEN.js";import{a as y}from"./chunk-HLLBCLO6.js";import{a as b}from"./chunk-U5Y75IZ5.js";import{a as D}from"./chunk-3DEA4WWC.js";import{A as L,Fa as c,ga as P,ra as F,u as C}from"./chunk-GJDGQISV.js";import{a as u,b as m}from"./chunk-SNAKHGZS.js";var S=class{enabledDragItem=c(!1);constructor(){}drop(s,t){A(t.Data,s.previousIndex,s.currentIndex)}toggleEnabledDragItem(){this.enabledDragItem.set(!this.enabledDragItem())}onSaveDragAndDrop(s,t){this.enabledDragItem.set(!this.enabledDragItem()),this.enabledDragItem()||t.postListID(s,t.data().Data)}onPutSaveDragAndDrop(s,t){this.enabledDragItem.set(!this.enabledDragItem()),this.enabledDragItem()||t.putListID(s,t.data().Data)}};var v=class{constructor(s){this.httpService=s}exportCSV(s,t,e,a){e.pageData().Filter.Export=!0,e.pageData().Filter.FormatType=0,a=a||"export.csv",this.httpService.post(`/api/${t}`,e.pageData().Filter).subscribe(r=>{s.convertToCSV(r,a),e.pageData().Filter.Export=!1})}convertToCSV(s,t=!1,e){let a=this.ExportDataFromUI2(t);s.convertToCSV(a,e)}ExportDataFromUI2(s=!1){let t=document.getElementById("tableGrid"),e=[];return D.IsNotEmpty(t)&&t.querySelectorAll("tr").forEach(r=>{let i=new Object,l=0;r.querySelectorAll("th, td").forEach(g=>{l++;let p=parseInt(g.getAttribute("colspan"));for(let n=1;n<p;n++)i["column"+l]="",l++;let o=g.innerText,d=o.toString().split("");if(s&&d[0]==="0"&&d.length>1){let n="'"+o.trim();i["column"+l]=n}else i["column"+l]=o.trim()}),e.push(i)}),e}};var f=class{listTotal=c(0);pageSize=c(0);show=c(!1);constructor(){}changePaginationData(s){let t=s.pageData().Filter.RowCount;this.pageSize.set(t);let e=s.data(),a=e?.ListTotal??e?.Data?.total?.value??0;this.listTotal.set(a),this.show.set(this.pageSize()<=this.listTotal())}changePage(s,t,e){t().Filter.PageNumber=s.pageIndex+1,e.getListData()}};var T=class extends N{constructor(t,e,a,r,i,l,h){super(t);this.httpService=e;this.dataAPI=a;this.pageAPI=r;this.toastrService=i;this.route=l;this.initOpenDialog=h;this.exportHandler=new v(e),r?(l&&this.loaderPayload.set(u({ListIDs:this.reportFilterService?.initOutletFilter()},l.snapshot.queryParams)),this.preInitLoader(),L([this.menuData$,this.httpService.post("/api/"+this.pageAPI,this.loaderPayload())]).pipe(C(([g,p])=>p)).pipe(y()).subscribe(g=>{this.pageData.set(g),this.pageData().Filter||(this.pageData().Filter={},this.pageData().Filter.RowCount=20),this.pageData().Filter.PageNumber=1,this.pageData().Filter.ID=this.loaderPayload()?.ID,this.preInitList(),h?this.openDialogFilter.openDialog():this.getListData()})):(this.pageData().Filter.RowCount=20,this.pageData().Filter.PageNumber=1,this.preInitList(),L({menuData:this.menuData$,listData:this.getListData$()}).pipe(y()).subscribe())}openDialogFilter=F(x);reportFilterService=F(w);pageData=c({Filter:{},Options:{},Roles:{},Config:{}});data=c(null);pagination=new f;dragDrop=new S;exportHandler;comparation=c(0);loaderPayload=c(null);reloadRowCount=c(!1);preInitLoader(){}preInitList(){}getListData(t){this.preGetList(),this.dataAPI&&this.httpService.post("/api/"+this.dataAPI,this.pageData().Filter).pipe(M("ListComponent - getListData")).subscribe(e=>{e.PageSubTitle&&(this.menuData.SH=e.PageSubTitle),this.data.set(e),this.postInit(e),this.reloadRowCount.set(!0),this.pagination.changePaginationData(this),t&&(this.pageData().HideStoreApiCount=!1)})}getListData$(t){return this.preGetList(),this.httpService.post("/api/"+this.dataAPI,this.pageData().Filter).pipe(P(e=>{this.data.set(e),this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData().HideStoreApiCount=!1)}))}searchFromPageOne(){this.preSearchFromPageOne(),this.pageData().Filter.PageNumber=1,this.getListData("filterMode")}postInit(t){t.PageTitle!=null&&(this.menuData.H=t.PageTitle)}preGetList(){this.pageData().Filter.From==null&&(this.pageData().Filter.From=D.MinDate),this.pageData().Filter.To==null&&(this.pageData().Filter.To=D.MinDate)}preSearchFromPageOne(){}onPaginationChange(t){this.pagination.changePage(t,this.pageData,this)}onSelectAllData(t){this.data.update(e=>!e||!e.Data?e:m(u({},e),{Data:e.Data.map(a=>m(u({},a),{selected:t}))}))}getSelectedData(){let t=[];if(this.data()){let e=this.data();t=e.Data?e.Data.filter(a=>a.selected):[]}return t}httpPostListID(t,e,a){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.postListID(t,r,a)}httpPutListID(t,e,a){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.putListID(t,r,a)}httpDeleteListID(t,e,a){if(e||(e="Are you sure you want to delete selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.DeleteListID(t,r,a)}onSaveDragAndDrop(t){this.dragDrop.onSaveDragAndDrop(t,this)}onPutSaveDragAndDrop(t){this.dragDrop.onPutSaveDragAndDrop(t,this)}postListID(t,e,a){let r=e.map(i=>a?i[a]:i.ID);this.httpService.post(`/api/${t}`,r,1e6,!0).subscribe(i=>{this.toastrService.success(i.Message?i.Message:i,b.Success),this.getListData()},i=>{let l=i.status+" "+i.statusText;this.toastrService.error(i.error.Message!=""?i.error.Message:"An unknown error has occured!",l,{enableHtml:!0})})}putListID(t,e,a){let r=e.map(i=>a?i[a]:i.ID);this.httpService.put(`/api/${t}`,r).subscribe(i=>{this.toastrService.success(i.Message?i.Message:i,b.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(t,e,a){let r=e.map(i=>a?i[a]:i.ID);this.httpService.delete(`/api/${t}`,{body:r}).subscribe(i=>{this.toastrService.success(i.Message?i.Message:i,b.Success),this.getListData()})}postData(t,e){this.httpService.post("/API/"+t,e).subscribe(a=>{this.getListData(),this.toastrService.success(a.Message?a.Message:a,b.Success)})}compare(t,e,a){return(t<e?-1:1)*(a?1:-1)}exportCSV(t,e,a){this.exportHandler.exportCSV(t,e,this,a)}s2ab(t){for(var e=new ArrayBuffer(t.length),a=new Uint8Array(e),r=0;r!=t.length;++r)a[r]=t.charCodeAt(r)&255;return e}exportXlsx(t,e){this.pageData().Filter.FormatType=1,this.pageData().Filter.Export=!0,this.httpService.post(`/api/${t}`,this.pageData().Filter).subscribe(a=>{e=decodeURI(e);let r=window.URL.createObjectURL(new Blob([this.s2ab(atob(a))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),i=document.createElement("a");i.href=r,i.setAttribute("download",e),document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(r),i.remove()})}convertToCSV(t,e=!1,a){let r=this.exportHandler.ExportDataFromUI2(e);t.convertToCSV(r,a)}OnCompare(t){let e=this.data(),a=t?e?.[t]:e;if(!a||a.length<1)return;let r=Object.assign({},this.pageData().Filter);r.From=new Date(new Date(this.pageData().Filter.From).getFullYear(),new Date(this.pageData().Filter.From).getMonth()-1,1),r.To=new Date(new Date(this.pageData().Filter.To).getFullYear(),new Date(this.pageData().Filter.To).getMonth(),0).toDateString(),this.httpService.post("/API/"+this.dataAPI,r).subscribe(i=>{let l=t?i[t]:i,h=0,g=a.map(p=>{let o=u({},p);o.PrevIndex="-",o.CurrentIndex="-",o.Increase="-";let d=l.filter(n=>n.EntityID==p.EntityID);if(o.CurrentIndex=p.Rank,d.length>0){let n=d[0];o.PrevIndex=n.Rank,n.SalesNet?o.Increase=(p.SalesNet-n.SalesNet)/n.SalesNet*100:n.Sales&&(o.Increase=(p.Sales-n.Sales)/n.Sales*100),o.IsPositive=o.Increase>0,o.IsNegative=o.Increase<0,h+=typeof o.Increase=="number"?o.Increase:0}return o});this.data.update(p=>p&&(t?m(u({},p),{[t]:g}):g)),this.comparation.set(h)})}};export{T as a};
@@ -1 +1 @@
1
- import{a as O}from"./chunk-AJSSO7KX.js";import{c as Oe}from"./chunk-NSNUUKNK.js";import{a as Ee}from"./chunk-LY56B57S.js";import"./chunk-AVOTGRPZ.js";import{a as we}from"./chunk-TBL5PH2R.js";import"./chunk-H3TRBEQR.js";import"./chunk-6N2DU4HB.js";import"./chunk-XKQYXDV6.js";import"./chunk-6CDU6CJB.js";import"./chunk-XULGDGRO.js";import"./chunk-43NB6BM4.js";import"./chunk-OVEGWW7W.js";import"./chunk-LL4377Z2.js";import"./chunk-GAOYV53E.js";import"./chunk-W6JPMHYE.js";import{f as ye,g as ve}from"./chunk-B5EEORFC.js";import"./chunk-PAF2E6M3.js";import{a as Se}from"./chunk-HNHLGX7F.js";import{a as Te}from"./chunk-7L57YG4E.js";import"./chunk-LXFJ7QGK.js";import"./chunk-SFSRABV5.js";import"./chunk-HNESPLVM.js";import"./chunk-G7E24J2R.js";import"./chunk-VYA2NFJ5.js";import"./chunk-SH55PTEY.js";import"./chunk-VPS35GPI.js";import"./chunk-UGBMCXS6.js";import{a as De,b as be}from"./chunk-5TTXT2K2.js";import"./chunk-YNQPX5G6.js";import{N as xe}from"./chunk-BXYSKXYX.js";import"./chunk-JFJPOKIM.js";import"./chunk-QYSFCWV7.js";import"./chunk-SGWWI7EY.js";import"./chunk-BQPO535K.js";import"./chunk-HLLBCLO6.js";import"./chunk-4P6SOZDY.js";import"./chunk-XN7T54IM.js";import"./chunk-RULWGB4E.js";import"./chunk-2HIDUY57.js";import"./chunk-U5Y75IZ5.js";import"./chunk-HY3IUHOC.js";import"./chunk-4AEX2WLA.js";import"./chunk-2MELUOYA.js";import"./chunk-WOPE6PPO.js";import{E as fe,h as Ce,o as ge}from"./chunk-MDIMQ3H3.js";import"./chunk-PIIH224Z.js";import"./chunk-NCWKENB5.js";import"./chunk-MWDJTJ3O.js";import{b as j}from"./chunk-7CQSSHSC.js";import{a as _e}from"./chunk-3DEA4WWC.js";import"./chunk-SEDQQVP7.js";import"./chunk-TKVDP62Z.js";import{Ad as L,Bb as m,Bc as Y,Ca as te,Cc as b,Db as u,Dc as V,Ec as X,Fa as f,Fb as oe,Fc as de,Gb as re,Ha as ie,Hb as le,Ib as c,Ja as ae,Jb as o,Kb as r,Kc as h,Lb as S,Mc as _,Qc as w,Rb as N,Tc as ce,Ub as v,Vd as ue,Xb as P,Xd as he,Yc as pe,Za as l,Zb as d,eb as E,hc as D,ib as M,mc as s,nb as ne,nc as F,nd as U,ob as y,oc as C,pb as W,pc as se,rc as z,sc as J,sd as R,tc as Q,ub as I,va as T,vb as A,vd as me,wa as x,xd as G}from"./chunk-GJDGQISV.js";import"./chunk-WFMAM73Y.js";import{a as B,b as H}from"./chunk-SNAKHGZS.js";var k=class{Cost;Profit;Sales;SalesWithTax;Tax;Count;TopOutlet};var ee=t=>({"border-bottom":t}),$=()=>["/menu/Reports/Sales_Report/Standard/Summary"],Ne=(t,n,e)=>({From:t,To:n,ListIDs:e}),Re=t=>({today:t}),Pe=(t,n)=>({From:t,To:n});function Le(t,n){if(t&1){let e=v();o(0,"div",6)(1,"a",15),s(2),r(),o(3,"ul",16)(4,"li")(5,"a",17),P("click",function(){T(e);let a=d();return a.isTodayFilter=!a.isTodayFilter,x(a.onChangeFilterPeriod())}),s(6),r()()()()}if(t&2){let e=d();l(2),C(" ",e.isTodayFilter?"Today":"Last 7 Days"," "),l(),c("ngClass",V(3,Re,!e.isTodayFilter)),l(3),C(" ",e.isTodayFilter?"Last 7 Days":"Today"," ")}}function ke(t,n){t&1&&(o(0,"span",7),s(1,"Today"),r())}function Be(t,n){if(t&1&&(o(0,"div",18)(1,"a",9),h(2,"date"),h(3,"date"),o(4,"div",10),s(5,"Tax"),r(),o(6,"div",19)(7,"small",20),s(8),r(),o(9,"h2",11),s(10),h(11,"number"),r()()()(),o(12,"div",8)(13,"a",9),h(14,"date"),h(15,"date"),o(16,"div",10),s(17,"Sales + Tax"),r(),o(18,"div",19)(19,"small",20),s(20),r(),o(21,"h2",11),s(22),h(23,"number"),r()()()()),t&2){let e=d();l(),c("routerLink",b(27,$))("queryParams",X(28,Pe,_(2,9,e.isTodayFilter?e.today:e.chartData==null?null:e.chartData.From,"yyyy-MM-dd"),_(3,12,e.isTodayFilter?e.today:e.dateTo,"yyyy-MM-dd"))),l(7),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(11,15,e.salesData==null?null:e.salesData.Tax,"1.0-0")," "),l(2),c("ngClass",V(31,ee,e.role.product.Cost)),l(),c("routerLink",b(33,$))("queryParams",X(34,Pe,_(14,18,e.isTodayFilter?e.today:e.chartData==null?null:e.chartData.From,"yyyy-MM-dd"),_(15,21,e.isTodayFilter?e.today:e.dateTo,"yyyy-MM-dd"))),l(7),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(23,24,e.salesData==null?null:e.salesData.SalesWithTax,"1.0-0")," ")}}function He(t,n){if(t&1&&(o(0,"div",8)(1,"div")(2,"div",21),s(3,"Cost"),r(),o(4,"div",19)(5,"small",20),s(6),r(),o(7,"h2",11),s(8),h(9,"number"),r()()()()),t&2){let e=d();c("ngClass",V(6,ee,e.role.report.Profit)),l(6),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(9,3,e.salesData==null?null:e.salesData.Cost,"1.0-0")," ")}}function Ye(t,n){if(t&1&&(o(0,"div",12)(1,"div")(2,"div",22),s(3),r(),o(4,"div",19)(5,"small",20),s(6),r(),o(7,"h2",11),s(8),h(9,"number"),r()()()()),t&2){let e=d();l(3),C(" ",e.includeTax?"Gross Profit":"Profit"," "),l(3),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(9,3,e.salesData==null?null:e.salesData.Profit,"1.0-0")," ")}}var Z=class t{constructor(n,e){this.dashboardService=n;this.role=e;this.chartConfig=this.dashboardService.getLineChartConfig()}chartData;salesData;dashboardConfig;filterSalesWidget=new te;chartConfig;todaySalesData;weeklySalesData;isTodayFilter=!0;showPeriodFilter;includeTax;today=new Date;dateTo;filterByOutletIds=pe([]);ngOnChanges(n){if(n.chartData&&n.chartData.currentValue){this.initSalesData();let e=n?.chartData?.currentValue?.Series;e=this.setChartLineColor(e),e=this.setSalesTaxLegend(e),this.chartConfig=H(B({},this.chartConfig),{series:e}),this.chartConfig=this.dashboardService.setSeriesPointStart(this.chartData.From,this.chartConfig),this.initPeriodFilter(e),this.getDateTo()}}initPeriodFilter(n){this.showPeriodFilter=n[0]?.data?.length>=7}initSalesData(){this.salesData=new k,this.includeTax=this.isIncludeTax(),this.salesData.Sales=this.dashboardService.getTotalData("Sales",this.chartData.Series,1),this.salesData.SalesWithTax=this.dashboardService.getTotalData("Sales + Tax",this.chartData.Series,1),this.salesData.Cost=this.dashboardService.getTotalData("Cost",this.chartData.Series,1),this.salesData.Tax=this.salesData.SalesWithTax-this.salesData.Sales,this.salesData.Profit=(this.includeTax?this.salesData.SalesWithTax:this.salesData.Sales)-this.salesData.Cost,this.salesData.Count=this.dashboardService.getTotalData("Count",this.chartData.Series,1),this.todaySalesData=Oe(k,this.salesData)}setChartLineColor(n=[]){return n?.map(e=>(e.name=="Sales"&&(e.color="rgb(44, 175, 254)",e.fillColor=this.dashboardService.getLinierGradient("rgb(44, 175, 254)")),e.name=="Cost"&&(e.color="#fb404b",e.fillColor=this.dashboardService.getLinierGradient("#fb404b")),e.name=="Sales + Tax"&&(e.color="#2ECC71",e.fillColor=this.dashboardService.getLinierGradient("#2ECC71")),e))}onChangeFilterPeriod(){this.isTodayFilter?this.salesData=this.todaySalesData:(this.generateWeeklySalesData(),this.salesData=this.weeklySalesData),this.filterSalesWidget.emit({period:this.isTodayFilter?"TODAY":"WEEKLY"})}getDateTo(){let n=new Date,e=new Date(this.chartData.From);n.setDate(e.getDate()+7),this.dateTo=n}generateWeeklySalesData(){if(_e.IsEmpty(this.weeklySalesData)){let n=this.dashboardService.getTotalData("Sales",this.chartData.Series,7),e=this.dashboardService.getTotalData("Sales + Tax",this.chartData.Series,7),i=this.dashboardService.getTotalData("Cost",this.chartData.Series,7),a=this.dashboardService.getTotalData("Count",this.chartData.Series,7),p=e-n,g=(this.includeTax?e:n)-i;this.weeklySalesData=this.weeklySalesData?this.weeklySalesData:new k,this.weeklySalesData.Sales=n,this.weeklySalesData.SalesWithTax=e,this.weeklySalesData.Cost=i,this.weeklySalesData.Profit=g,this.weeklySalesData.Tax=p,this.weeklySalesData.Count=a}}isIncludeTax(){let n=this.chartData.Series;return this.dashboardService.filterSeriesByName("Sales + Tax",n).visible}setSalesTaxLegend(n){return n=n.map(e=>(e.name=="Sales + Tax"&&(e.showInLegend=this.salesData.Tax>0),e)),n}static \u0275fac=function(e){return new(e||t)(E(O),E(j))};static \u0275cmp=M({type:t,selectors:[["app-sales-widget"]],inputs:{chartData:"chartData",dashboardConfig:"dashboardConfig",filterByOutletIds:[1,"filterByOutletIds"]},outputs:{filterSalesWidget:"onFilter"},features:[Y([O]),ae],decls:25,vars:30,consts:[[1,"d-flex","flex-row","flex-wrap","mt-8","justify-content-between"],[1,"chart-widget"],["containerId","salesChart",3,"config"],[1,"sales-card-widget"],[1,"border","rounded","rounded-bottom-0","px-8","py-4","w-100","h-auto"],[1,"border-bottom","d-flex","align-items-center","justify-content-end",2,"height","42px"],[1,"btn-group"],[1,"link-dark","fs-2","headings-font-family"],[1,"text-end","card-row","d-flex","align-items-center","justify-content-end",3,"ngClass"],["target","_blank",1,"link-dark",3,"routerLink","queryParams"],[1,"fs-5"],[1,"fw-normal"],[1,"text-end","d-flex","align-items-center","justify-content-end","card-row"],[1,"card-footer","border","rounded-bottom","border-top-0","text-end","p-3"],["routerLink","/menu/Setup/Configuration/Application"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"dropdown-toggle","link-dark","fs-2","headings-font-family"],[1,"dropdown-menu","p-0",2,"position","absolute","right","20px !important",3,"ngClass"],["role","button",1,"dropdown-item","fs-4",3,"click"],[1,"text-end","border-bottom","card-row","d-flex","align-items-center","justify-content-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"me-2"],[1,"fs-5","text-danger"],[1,"fs-5","text-success"]],template:function(e,i){e&1&&(o(0,"div",0)(1,"div",1),S(2,"app-chart-container",2),r(),o(3,"div",3)(4,"div",4)(5,"div",5),m(6,Le,7,5,"div",6)(7,ke,2,0,"span",7),r(),o(8,"div",8)(9,"a",9),h(10,"date"),h(11,"date"),o(12,"div",10),s(13,"Order"),r(),o(14,"h2",11),s(15),h(16,"number"),r()()(),m(17,Be,24,37),m(18,He,10,8,"div",8),m(19,Ye,10,6,"div",12),r(),o(20,"div",13)(21,"a",14)(22,"small"),s(23),h(24,"date"),r()()()()()),e&2&&(l(2),c("config",i.chartConfig),l(4),u(!(i.role==null||i.role.dashboard==null)&&i.role.dashboard.View&&i.showPeriodFilter?6:7),l(2),c("ngClass",V(23,ee,(i.salesData==null?null:i.salesData.Tax)||i.role.product.Cost)),l(),c("routerLink",b(25,$))("queryParams",de(26,Ne,_(10,11,i.isTodayFilter?i.today:i.chartData==null?null:i.chartData.From,"yyyy-MM-dd"),_(11,14,i.isTodayFilter?i.today:i.dateTo,"yyyy-MM-dd"),i.filterByOutletIds())),l(6),F(_(16,17,i.salesData==null?null:i.salesData.Count,"1.0-0")),l(2),u((i.salesData==null?null:i.salesData.Tax)>0?17:-1),l(),u(i.role.product.Cost?18:-1),l(),u(i.role.report.Profit&&i.role.product.Cost?19:-1),l(4),se("",_(24,20,i.dashboardConfig==null?null:i.dashboardConfig.SpanConfigTime,"dd MMM HH:mm")," ",i.dashboardConfig==null?null:i.dashboardConfig.SmallTimeZone))},dependencies:[L,U,Ee,he,ue,xe,G,me],styles:[".chart-widget[_ngcontent-%COMP%]{width:80%}.link-dark[_ngcontent-%COMP%]{color:#333!important}.dropdown-menu.show.today[_ngcontent-%COMP%]{inset:0 auto auto -34px!important}.sales-card-widget[_ngcontent-%COMP%]{width:19%}.sales-card-widget[_ngcontent-%COMP%] .card-row[_ngcontent-%COMP%]{height:64px}@media only screen and (max-width:767px){.chart-widget[_ngcontent-%COMP%]{width:100%}.sales-card-widget[_ngcontent-%COMP%]{width:100%;margin-top:12px}}@media only screen and (min-width:768px)and (max-width:991px){.chart-widget[_ngcontent-%COMP%]{width:100%}.sales-card-widget[_ngcontent-%COMP%]{width:100%;margin-top:12px}}"]})};var Ue=t=>({active:t});function Ge(t,n){if(t&1&&(o(0,"div",1),s(1),r(),o(2,"div",2)(3,"small",3),s(4),r(),o(5,"h2",4),s(6),r()()),t&2){let e=d();l(),F(e.title),l(3),F(e.currencySymbol),l(2),F(e.value)}}function je(t,n){if(t&1&&(o(0,"div",1),s(1),r(),o(2,"h2",4),s(3,"-"),r()),t&2){let e=d();l(),F(e.title)}}var K=class t{title;isActive;currencySymbol;value;showValue;constructor(){}ngOnInit(){}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=M({type:t,selectors:[["app-card-widget"]],inputs:{title:"title",isActive:"isActive",currencySymbol:"currencySymbol",value:"value",showValue:"showValue"},decls:3,vars:4,consts:[[1,"card-widget","pe-0",3,"ngClass"],[1,"fs-4","headings-font-family"],[1,"d-flex","justify-content-start","align-items-center"],[1,"fw-normal","me-2"],[1,"fw-normal"]],template:function(e,i){e&1&&(o(0,"div",0),m(1,Ge,7,3)(2,je,4,1),r()),e&2&&(c("ngClass",V(2,Ue,i.isActive)),l(),u(i.showValue?1:2))},dependencies:[L,U],styles:[".card-widget[_ngcontent-%COMP%]{padding:20px;border-radius:6px;min-height:95px;border:.5px solid #e4e4e4;width:100%}.active[_ngcontent-%COMP%]{background-color:#f0f0f0}@media only screen and (max-width:767px){.card-widget[_ngcontent-%COMP%]{width:200px}}@media only screen and (min-width:768px)and (max-width:991px){.card-widget[_ngcontent-%COMP%]{width:200px}}"]})};var Ze=()=>[R,import("./chunk-XJMPCHB4.js").then(t=>t.PaymentWidgetComponent)],Ke=()=>[R,import("./chunk-S6X3RI3M.js").then(t=>t.PurchaseWidgetComponent)],qe=()=>[R,import("./chunk-5TY4K3E2.js").then(t=>t.DebtWidgetComponent)],ze=()=>[R,import("./chunk-SSIG6XZC.js").then(t=>t.ProductWidgetComponent)],Je=()=>[R,import("./chunk-WOZC5DHE.js").then(t=>t.InventoryWidgetComponent)],Qe=()=>({role:"Payment View Role"}),Xe=()=>({role:"Buy Report Role"}),$e=()=>({role:"Debt View Role"}),et=()=>({role:"Report View Role"}),tt=()=>({role:"Inventory View Role"});function it(t,n){if(t&1){let e=v();o(0,"div",13)(1,"h6"),s(2,"Outlet"),r(),o(3,"outlet-selector",14),Q("ngModelChange",function(a){T(e);let p=d();return J(p.dashboardFilter().Outlets,a)||(p.dashboardFilter().Outlets=a),x(a)}),r()()}if(t&2){let e=d();l(3),c("multiple",!0)("accessType",e.outletAccess()),z("ngModel",e.dashboardFilter().Outlets)}}function at(t,n){if(t&1){let e=v();o(0,"div",19),P("click",function(){let a=T(e).$implicit,p=d(2);return x(p.onClickCardWidget(a))}),S(1,"app-card-widget",20),h(2,"number"),r()}if(t&2){let e=n.$implicit,i=d(),a=d();l(),c("title",e.title)("matTooltip",e.tooltip)("currencySymbol",i==null||i.ConfigData==null?null:i.ConfigData.CurrencySymbol)("value",e.value==null?"-":_(2,6,e.value,"1.0-0"))("showValue",e.showValue)("isActive",e.id==a.activeTab())}}function nt(t,n){if(t&1){let e=v();o(0,"app-sales-widget",21),P("onFilter",function(a){T(e);let p=d(2);return x(p.onFilterSalesWidget(a))}),r()}if(t&2){let e=d(),i=d();c("dashboardConfig",e==null?null:e.ConfigData)("chartData",e==null?null:e.HighChartData)("filterByOutletIds",i.dashboardFilter().Outlets)}}function ot(t,n){t&1&&N(0)}function rt(t,n){if(t&1){let e=v();o(0,"app-payment-widget",23),P("onFilter",function(a){T(e);let p=d(4);return x(p.onFilterPaymentWidget(a))}),r()}if(t&2){let e,i=d(3),a=d();c("dashboardConfig",i==null?null:i.ConfigData)("chartData",(e=a.paymentData())==null?null:e.Data)}}function lt(t,n){if(t&1&&y(0,ot,1,0,"ng-container",22)(1,rt,1,2,"ng-template",null,2,w),t&2){let e=D(2),i=d(3),a=D(11);c("ngTemplateOutlet",i.role.payment.View?e:a)("ngTemplateOutletContext",b(2,Qe))}}function st(t,n){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function dt(t,n){t&1&&(W(0,lt,3,3)(1,st,2,0),I(2,0,Ze,null,1),A(0,-1))}function ct(t,n){t&1&&N(0)}function pt(t,n){if(t&1&&S(0,"app-purchase-widget",18),t&2){let e,i=d(3),a=d();c("dashboardConfig",i==null?null:i.ConfigData)("chartData",(e=a.purchaseData())==null?null:e.HighChartData)("filterByOutletIds",a.dashboardFilter().Outlets)}}function mt(t,n){if(t&1&&y(0,ct,1,0,"ng-container",22)(1,pt,1,3,"ng-template",null,3,w),t&2){let e=D(2),i=d(3),a=D(11);c("ngTemplateOutlet",i.role.buy.Report?e:a)("ngTemplateOutletContext",b(2,Xe))}}function ut(t,n){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function ht(t,n){t&1&&(W(0,mt,3,3)(1,ut,2,0),I(2,0,Ke,null,1),A(0,-1))}function _t(t,n){t&1&&N(0)}function Ct(t,n){if(t&1&&S(0,"app-debt-widget",25),t&2){let e,i=d(3),a=d();c("dashboardConfig",i==null?null:i.ConfigData)("debtData",(e=a.debtData())==null?null:e.PageData)}}function gt(t,n){if(t&1&&y(0,_t,1,0,"ng-container",22)(1,Ct,1,2,"ng-template",null,4,w),t&2){let e=D(2),i=d(3),a=D(11);c("ngTemplateOutlet",i.role.debt.View?e:a)("ngTemplateOutletContext",b(2,$e))}}function ft(t,n){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function Dt(t,n){t&1&&(W(0,gt,3,3)(1,ft,2,0),I(2,0,qe,null,1),A(0,-1))}function bt(t,n){t&1&&N(0)}function St(t,n){if(t&1&&S(0,"app-product-widget",26),t&2){let e,i=d(3),a=d();c("dashboardConfig",i==null?null:i.ConfigData)("productData",(e=a.productData())==null?null:e.PageData)}}function Tt(t,n){if(t&1&&y(0,bt,1,0,"ng-container",22)(1,St,1,2,"ng-template",null,5,w),t&2){let e=D(2),i=d(3),a=D(11);c("ngTemplateOutlet",i.role.report.View?e:a)("ngTemplateOutletContext",b(2,et))}}function xt(t,n){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function yt(t,n){t&1&&(W(0,Tt,3,3)(1,xt,2,0),I(2,0,ze,null,1),A(0,-1))}function vt(t,n){t&1&&N(0)}function wt(t,n){if(t&1&&S(0,"app-inventory-widget",27),t&2){let e,i=d(3),a=d();c("dashboardConfig",i==null?null:i.ConfigData)("logisticsData",(e=a.logisticsData())==null?null:e.PageData)}}function Ot(t,n){if(t&1&&y(0,vt,1,0,"ng-container",22)(1,wt,1,2,"ng-template",null,6,w),t&2){let e=D(2),i=d(3),a=D(11);c("ngTemplateOutlet",i.role.inventory.View?e:a)("ngTemplateOutletContext",b(2,tt))}}function Et(t,n){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function Pt(t,n){t&1&&(W(0,Ot,3,3)(1,Et,2,0),I(2,0,Je,null,1),A(0,-1))}function Ft(t,n){if(t&1&&(o(0,"div",12)(1,"div",15)(2,"div",16),re(3,at,3,9,"div",17,oe),r(),m(5,nt,1,3,"app-sales-widget",18),m(6,dt,4,0),m(7,ht,4,0),m(8,Dt,4,0),m(9,yt,4,0),m(10,Pt,4,0),r()()),t&2){let e=d();l(3),le(e.cardWidgetComputed()),l(2),u(e.activeTab()=="SALES"?5:-1),l(),u(e.activeTab()=="PAYMENT"?6:-1),l(),u(e.activeTab()=="PURCHASE"?7:-1),l(),u(e.activeTab()=="DEBT"?8:-1),l(),u(e.activeTab()=="PRODUCT"?9:-1),l(),u(e.activeTab()=="LOGISTICS"?10:-1)}}function Vt(t,n){if(t&1&&(o(0,"div",24)(1,"div",28)(2,"div"),S(3,"img",29),r(),o(4,"h1",30),s(5,"You are not authorized"),r(),o(6,"p"),s(7," This page requires role "),o(8,"span",31),s(9),r(),s(10," to be accessed. Please contact your Administrator to gain access! "),r()()()),t&2){let e=n.role;l(9),C("[",e,"]")}}var We=class t extends Se{constructor(e,i,a){super(e);this.dashboardService=i;this.role=a;this.menuData$.subscribe(),this.fetchAllData(),ie(()=>{this.updateCardWidget()})}cardWidget=f([]);outletAccess=f(2);dashboardFilter=f({Outlets:[]});salesData=f(null);paymentData=f(null);purchaseData=f(null);debtData=f(null);productData=f(null);logisticsData=f(null);activeTab=f("SALES");cardWidgetComputed=ce(()=>this.cardWidget().map(e=>{let i=!1;if(e.id==="SALES"?i=this.role.dashboard.View:e.id==="PAYMENT"?i=this.role.payment.View:e.id==="PURCHASE"?i=this.role.buy.Create&&this.role.buy.Report:e.id==="DEBT"?i=this.role.debt.View:e.id==="PRODUCT"?i=this.role.report.View:e.id==="LOGISTICS"?i=this.role.inventory.View:i=!0,!i)return null;let a=e.tooltip;return e.id==="SALES"?a=this.activeTab()==="SALES"?e.tooltip:"Total Sales Today":e.id==="PAYMENT"?a=this.activeTab()==="PAYMENT"?e.tooltip:"Total Payment Today":e.id==="PURCHASE"?a=this.activeTab()==="PURCHASE"?e.tooltip:"Total Purchase Today":e.id==="DEBT"?a=this.activeTab()==="DEBT"?e.tooltip:"Total Debt Today":e.id==="PRODUCT"?a=this.activeTab()==="PRODUCT"?e.tooltip:"Total Product Today":e.id==="LOGISTICS"&&(a=this.activeTab()==="LOGISTICS"?e.tooltip:"Total Logistics Today"),H(B({},e),{tooltip:a})}).filter(e=>e!==null));fetchAllData(){this.dashboardService.getDashboardSales(this.dashboardFilter()).subscribe(e=>this.salesData.set(e))}updateCardWidget(){let e=this.activeTab();if(e==="SALES"&&this.salesData()){let i=this.dashboardService.getTotalData("Sales",this.salesData().HighChartData.Series,1);this.dashboardService.setWidgetData(i,e).subscribe(a=>this.cardWidget.set(a))}else if(e==="PAYMENT"&&this.paymentData()){let i=this.dashboardService.getTotalData("All",this.paymentData().Data.Series,1);this.dashboardService.setWidgetData(i,e).subscribe(a=>this.cardWidget.set(a))}else if(e==="PURCHASE"&&this.purchaseData()){let i=this.dashboardService.getTotalData("Purchase",this.purchaseData().HighChartData.Series,1);this.dashboardService.setWidgetData(i,e).subscribe(a=>this.cardWidget.set(a))}else if(e==="DEBT"&&this.debtData()){let i=this.debtData().PageData.Receivable;this.dashboardService.setWidgetData(i,e).subscribe(a=>this.cardWidget.set(a))}else if(e==="LOGISTICS"&&this.logisticsData()){let i=this.logisticsData()?.PageData?.Logistic?.Total;i&&this.dashboardService.setWidgetData(i,e).subscribe(a=>this.cardWidget.set(a)),this.dashboardService.getDashboardLogistics(this.dashboardFilter()).subscribe(a=>{this.logisticsData.set(a)})}}onFilterByOutlet(){this.dashboardService.clearCache(),this.fetchAllData(),this.updateCardWidget()}onClickCardWidget(e){switch(this.activeTab.set(e.id),e.id){case"SALES":this.dashboardService.getDashboardSales(this.dashboardFilter()).subscribe(i=>this.salesData.set(i));break;case"PURCHASE":this.dashboardService.getDashboardPurchase(this.dashboardFilter()).subscribe(i=>this.purchaseData.set(i));break;case"DEBT":this.dashboardService.getDashboardDebt(this.dashboardFilter()).subscribe(i=>this.debtData.set(i));break;case"PRODUCT":this.dashboardService.getDashboardProduct(this.dashboardFilter()).subscribe(i=>this.productData.set(i));break;case"LOGISTICS":this.dashboardService.getDashboardLogistics(this.dashboardFilter()).subscribe(i=>{console.log("Received logistics data => ",i.PageData),this.logisticsData.set(i)});break;case"PAYMENT":this.dashboardService.getDashboardPayment(this.dashboardFilter()).subscribe(i=>this.paymentData.set(i));break;default:new Error("Invalid widget type")}this.updateCardWidget()}onFilterSalesWidget(e){if(!this.salesData())return;let i=e.period==="WEEKLY"?7:1,a=this.dashboardService.getTotalData("Sales",this.salesData().HighChartData.Series,i);this.dashboardService.setWidgetData(a,"SALES").subscribe(p=>{this.cardWidget.set(p.map(g=>(g.id==="SALES"&&(g.tooltip=e.period==="TODAY"?"Total Sales Today":"Total Sales last 7 days"),g)))})}onFilterPaymentWidget(e){if(!this.paymentData())return;let i=e.period==="WEEKLY"?7:1,a=this.dashboardService.getTotalData("All",this.paymentData().Data.Series,i);this.dashboardService.setWidgetData(a,"PAYMENT").subscribe(p=>{this.cardWidget.set(p.map(g=>(g.id==="PAYMENT"&&(g.tooltip=e.period==="TODAY"?"Total Payment Today":"Total Payment last 7 days"),g)))})}static \u0275fac=function(i){return new(i||t)(E(Te),E(O),E(j))};static \u0275cmp=M({type:t,selectors:[["POS-dashboard-v2"]],features:[Y([O]),ne],decls:12,vars:5,consts:[["pageFilterTemplate",""],["NOT_AUTHORIZED",""],["PAYMENT",""],["BUY",""],["DEBT",""],["PRODUCT",""],["INVENTORY",""],[3,"onSubmit","filterChange","hideSearchBox","pageData","isFilterOnDropdown","filter"],[1,"content"],[1,"container-fluid","bg-light-gray","p-8"],[1,"row"],[1,"col-12"],[1,"card","mb-0"],[1,"dialog-filter"],["appendTo","body","placeholder","Select Outlets",3,"ngModelChange","multiple","accessType","ngModel"],[1,"card-body"],[1,"d-flex","flex-row","flex-nowrap","justify-content-between","align-items-center","overflow-auto",2,"column-gap","18px"],[1,"cursor-pointer","card-widget-tab"],[3,"dashboardConfig","chartData","filterByOutletIds"],[1,"cursor-pointer","card-widget-tab",3,"click"],["matTooltipPosition","above",3,"title","matTooltip","currencySymbol","value","showValue","isActive"],[3,"onFilter","dashboardConfig","chartData","filterByOutletIds"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"onFilter","dashboardConfig","chartData"],[1,"d-flex","align-items-center","justify-content-center","mt-8",2,"height","350px"],[3,"dashboardConfig","debtData"],[3,"dashboardConfig","productData"],[3,"dashboardConfig","logisticsData"],[1,"text-center"],["src","https://cdn.dealpos.xyz/web-image/locked.svg",2,"width","160px"],[1,"mt-2","mb-6"],[1,"fw-bold"]],template:function(i,a){if(i&1){let p=v();o(0,"mainpanel-cmp",7),P("onSubmit",function(){return a.onFilterByOutlet()}),Q("filterChange",function(q){return T(p),J(a.dashboardFilter,q)||(a.dashboardFilter=q),x(q)}),o(1,"filters"),y(2,it,4,3,"ng-template",null,0,w),r(),o(4,"content")(5,"div",8)(6,"div",9)(7,"div",10)(8,"div",11),m(9,Ft,11,6,"div",12),r()()()()()(),y(10,Vt,11,1,"ng-template",null,1,w)}if(i&2){let p;c("hideSearchBox",!0)("pageData",a.menuData)("isFilterOnDropdown",!1),z("filter",a.dashboardFilter),l(9),u((p=a.salesData())?9:-1,p)}},dependencies:[L,ve,ye,fe,Ce,ge,Z,K,we,be,De,G],styles:[".card-widget-tab[_ngcontent-%COMP%]{flex:1 1 0px}@media only screen and (max-width:767px){.card-widget-tab[_ngcontent-%COMP%]{margin-right:1rem;margin-top:.5rem;width:auto}}@media only screen and (min-width:768px)and (max-width:991px){.card-widget-tab[_ngcontent-%COMP%]{margin-right:1rem;margin-top:.5rem;width:auto}}"]})};export{We as DashboardV2Component};
1
+ import{a as O}from"./chunk-AJSSO7KX.js";import{c as Oe}from"./chunk-NSNUUKNK.js";import{a as Ee}from"./chunk-LY56B57S.js";import"./chunk-AVOTGRPZ.js";import{a as we}from"./chunk-MRKE47YW.js";import"./chunk-PUHZOP5L.js";import"./chunk-6N2DU4HB.js";import"./chunk-XKQYXDV6.js";import"./chunk-LYZAXNP3.js";import"./chunk-XULGDGRO.js";import"./chunk-43NB6BM4.js";import"./chunk-OVEGWW7W.js";import"./chunk-LL4377Z2.js";import"./chunk-GAOYV53E.js";import"./chunk-W6JPMHYE.js";import{f as ye,g as ve}from"./chunk-NSBIEAEN.js";import"./chunk-YJCMKEIW.js";import{a as Se}from"./chunk-HNHLGX7F.js";import{a as Te}from"./chunk-BBLFHZEO.js";import"./chunk-LXFJ7QGK.js";import"./chunk-GWZLP3JE.js";import"./chunk-WF6K4N5K.js";import"./chunk-G7E24J2R.js";import"./chunk-VYA2NFJ5.js";import"./chunk-SH55PTEY.js";import"./chunk-VPS35GPI.js";import"./chunk-UGBMCXS6.js";import{a as De,b as be}from"./chunk-5TTXT2K2.js";import"./chunk-YNQPX5G6.js";import{N as xe}from"./chunk-BXYSKXYX.js";import"./chunk-JFJPOKIM.js";import"./chunk-QYSFCWV7.js";import"./chunk-GDIWAXMB.js";import"./chunk-BQPO535K.js";import"./chunk-HLLBCLO6.js";import"./chunk-4P6SOZDY.js";import"./chunk-XN7T54IM.js";import"./chunk-RULWGB4E.js";import"./chunk-2HIDUY57.js";import"./chunk-U5Y75IZ5.js";import"./chunk-HY3IUHOC.js";import"./chunk-4AEX2WLA.js";import"./chunk-2MELUOYA.js";import"./chunk-WOPE6PPO.js";import{E as fe,h as Ce,o as ge}from"./chunk-MDIMQ3H3.js";import"./chunk-OA6PQTAA.js";import"./chunk-ZIEDDJRF.js";import"./chunk-MWDJTJ3O.js";import{b as j}from"./chunk-7CQSSHSC.js";import{a as _e}from"./chunk-3DEA4WWC.js";import"./chunk-EWVIPH3Y.js";import"./chunk-TKVDP62Z.js";import{Ad as L,Bb as m,Bc as Y,Ca as te,Cc as b,Db as u,Dc as V,Ec as X,Fa as f,Fb as oe,Fc as de,Gb as re,Ha as ie,Hb as le,Ib as c,Ja as ae,Jb as o,Kb as r,Kc as h,Lb as S,Mc as _,Qc as w,Rb as N,Tc as ce,Ub as v,Vd as ue,Xb as P,Xd as he,Yc as pe,Za as l,Zb as d,eb as E,hc as D,ib as M,mc as s,nb as ne,nc as F,nd as U,ob as y,oc as C,pb as W,pc as se,rc as z,sc as J,sd as R,tc as Q,ub as I,va as T,vb as A,vd as me,wa as x,xd as G}from"./chunk-GJDGQISV.js";import"./chunk-WFMAM73Y.js";import{a as B,b as H}from"./chunk-SNAKHGZS.js";var k=class{Cost;Profit;Sales;SalesWithTax;Tax;Count;TopOutlet};var ee=t=>({"border-bottom":t}),$=()=>["/menu/Reports/Sales_Report/Standard/Summary"],Ne=(t,n,e)=>({From:t,To:n,ListIDs:e}),Re=t=>({today:t}),Pe=(t,n)=>({From:t,To:n});function Le(t,n){if(t&1){let e=v();o(0,"div",6)(1,"a",15),s(2),r(),o(3,"ul",16)(4,"li")(5,"a",17),P("click",function(){T(e);let a=d();return a.isTodayFilter=!a.isTodayFilter,x(a.onChangeFilterPeriod())}),s(6),r()()()()}if(t&2){let e=d();l(2),C(" ",e.isTodayFilter?"Today":"Last 7 Days"," "),l(),c("ngClass",V(3,Re,!e.isTodayFilter)),l(3),C(" ",e.isTodayFilter?"Last 7 Days":"Today"," ")}}function ke(t,n){t&1&&(o(0,"span",7),s(1,"Today"),r())}function Be(t,n){if(t&1&&(o(0,"div",18)(1,"a",9),h(2,"date"),h(3,"date"),o(4,"div",10),s(5,"Tax"),r(),o(6,"div",19)(7,"small",20),s(8),r(),o(9,"h2",11),s(10),h(11,"number"),r()()()(),o(12,"div",8)(13,"a",9),h(14,"date"),h(15,"date"),o(16,"div",10),s(17,"Sales + Tax"),r(),o(18,"div",19)(19,"small",20),s(20),r(),o(21,"h2",11),s(22),h(23,"number"),r()()()()),t&2){let e=d();l(),c("routerLink",b(27,$))("queryParams",X(28,Pe,_(2,9,e.isTodayFilter?e.today:e.chartData==null?null:e.chartData.From,"yyyy-MM-dd"),_(3,12,e.isTodayFilter?e.today:e.dateTo,"yyyy-MM-dd"))),l(7),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(11,15,e.salesData==null?null:e.salesData.Tax,"1.0-0")," "),l(2),c("ngClass",V(31,ee,e.role.product.Cost)),l(),c("routerLink",b(33,$))("queryParams",X(34,Pe,_(14,18,e.isTodayFilter?e.today:e.chartData==null?null:e.chartData.From,"yyyy-MM-dd"),_(15,21,e.isTodayFilter?e.today:e.dateTo,"yyyy-MM-dd"))),l(7),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(23,24,e.salesData==null?null:e.salesData.SalesWithTax,"1.0-0")," ")}}function He(t,n){if(t&1&&(o(0,"div",8)(1,"div")(2,"div",21),s(3,"Cost"),r(),o(4,"div",19)(5,"small",20),s(6),r(),o(7,"h2",11),s(8),h(9,"number"),r()()()()),t&2){let e=d();c("ngClass",V(6,ee,e.role.report.Profit)),l(6),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(9,3,e.salesData==null?null:e.salesData.Cost,"1.0-0")," ")}}function Ye(t,n){if(t&1&&(o(0,"div",12)(1,"div")(2,"div",22),s(3),r(),o(4,"div",19)(5,"small",20),s(6),r(),o(7,"h2",11),s(8),h(9,"number"),r()()()()),t&2){let e=d();l(3),C(" ",e.includeTax?"Gross Profit":"Profit"," "),l(3),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(9,3,e.salesData==null?null:e.salesData.Profit,"1.0-0")," ")}}var Z=class t{constructor(n,e){this.dashboardService=n;this.role=e;this.chartConfig=this.dashboardService.getLineChartConfig()}chartData;salesData;dashboardConfig;filterSalesWidget=new te;chartConfig;todaySalesData;weeklySalesData;isTodayFilter=!0;showPeriodFilter;includeTax;today=new Date;dateTo;filterByOutletIds=pe([]);ngOnChanges(n){if(n.chartData&&n.chartData.currentValue){this.initSalesData();let e=n?.chartData?.currentValue?.Series;e=this.setChartLineColor(e),e=this.setSalesTaxLegend(e),this.chartConfig=H(B({},this.chartConfig),{series:e}),this.chartConfig=this.dashboardService.setSeriesPointStart(this.chartData.From,this.chartConfig),this.initPeriodFilter(e),this.getDateTo()}}initPeriodFilter(n){this.showPeriodFilter=n[0]?.data?.length>=7}initSalesData(){this.salesData=new k,this.includeTax=this.isIncludeTax(),this.salesData.Sales=this.dashboardService.getTotalData("Sales",this.chartData.Series,1),this.salesData.SalesWithTax=this.dashboardService.getTotalData("Sales + Tax",this.chartData.Series,1),this.salesData.Cost=this.dashboardService.getTotalData("Cost",this.chartData.Series,1),this.salesData.Tax=this.salesData.SalesWithTax-this.salesData.Sales,this.salesData.Profit=(this.includeTax?this.salesData.SalesWithTax:this.salesData.Sales)-this.salesData.Cost,this.salesData.Count=this.dashboardService.getTotalData("Count",this.chartData.Series,1),this.todaySalesData=Oe(k,this.salesData)}setChartLineColor(n=[]){return n?.map(e=>(e.name=="Sales"&&(e.color="rgb(44, 175, 254)",e.fillColor=this.dashboardService.getLinierGradient("rgb(44, 175, 254)")),e.name=="Cost"&&(e.color="#fb404b",e.fillColor=this.dashboardService.getLinierGradient("#fb404b")),e.name=="Sales + Tax"&&(e.color="#2ECC71",e.fillColor=this.dashboardService.getLinierGradient("#2ECC71")),e))}onChangeFilterPeriod(){this.isTodayFilter?this.salesData=this.todaySalesData:(this.generateWeeklySalesData(),this.salesData=this.weeklySalesData),this.filterSalesWidget.emit({period:this.isTodayFilter?"TODAY":"WEEKLY"})}getDateTo(){let n=new Date,e=new Date(this.chartData.From);n.setDate(e.getDate()+7),this.dateTo=n}generateWeeklySalesData(){if(_e.IsEmpty(this.weeklySalesData)){let n=this.dashboardService.getTotalData("Sales",this.chartData.Series,7),e=this.dashboardService.getTotalData("Sales + Tax",this.chartData.Series,7),i=this.dashboardService.getTotalData("Cost",this.chartData.Series,7),a=this.dashboardService.getTotalData("Count",this.chartData.Series,7),p=e-n,g=(this.includeTax?e:n)-i;this.weeklySalesData=this.weeklySalesData?this.weeklySalesData:new k,this.weeklySalesData.Sales=n,this.weeklySalesData.SalesWithTax=e,this.weeklySalesData.Cost=i,this.weeklySalesData.Profit=g,this.weeklySalesData.Tax=p,this.weeklySalesData.Count=a}}isIncludeTax(){let n=this.chartData.Series;return this.dashboardService.filterSeriesByName("Sales + Tax",n).visible}setSalesTaxLegend(n){return n=n.map(e=>(e.name=="Sales + Tax"&&(e.showInLegend=this.salesData.Tax>0),e)),n}static \u0275fac=function(e){return new(e||t)(E(O),E(j))};static \u0275cmp=M({type:t,selectors:[["app-sales-widget"]],inputs:{chartData:"chartData",dashboardConfig:"dashboardConfig",filterByOutletIds:[1,"filterByOutletIds"]},outputs:{filterSalesWidget:"onFilter"},features:[Y([O]),ae],decls:25,vars:30,consts:[[1,"d-flex","flex-row","flex-wrap","mt-8","justify-content-between"],[1,"chart-widget"],["containerId","salesChart",3,"config"],[1,"sales-card-widget"],[1,"border","rounded","rounded-bottom-0","px-8","py-4","w-100","h-auto"],[1,"border-bottom","d-flex","align-items-center","justify-content-end",2,"height","42px"],[1,"btn-group"],[1,"link-dark","fs-2","headings-font-family"],[1,"text-end","card-row","d-flex","align-items-center","justify-content-end",3,"ngClass"],["target","_blank",1,"link-dark",3,"routerLink","queryParams"],[1,"fs-5"],[1,"fw-normal"],[1,"text-end","d-flex","align-items-center","justify-content-end","card-row"],[1,"card-footer","border","rounded-bottom","border-top-0","text-end","p-3"],["routerLink","/menu/Setup/Configuration/Application"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"dropdown-toggle","link-dark","fs-2","headings-font-family"],[1,"dropdown-menu","p-0",2,"position","absolute","right","20px !important",3,"ngClass"],["role","button",1,"dropdown-item","fs-4",3,"click"],[1,"text-end","border-bottom","card-row","d-flex","align-items-center","justify-content-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"me-2"],[1,"fs-5","text-danger"],[1,"fs-5","text-success"]],template:function(e,i){e&1&&(o(0,"div",0)(1,"div",1),S(2,"app-chart-container",2),r(),o(3,"div",3)(4,"div",4)(5,"div",5),m(6,Le,7,5,"div",6)(7,ke,2,0,"span",7),r(),o(8,"div",8)(9,"a",9),h(10,"date"),h(11,"date"),o(12,"div",10),s(13,"Order"),r(),o(14,"h2",11),s(15),h(16,"number"),r()()(),m(17,Be,24,37),m(18,He,10,8,"div",8),m(19,Ye,10,6,"div",12),r(),o(20,"div",13)(21,"a",14)(22,"small"),s(23),h(24,"date"),r()()()()()),e&2&&(l(2),c("config",i.chartConfig),l(4),u(!(i.role==null||i.role.dashboard==null)&&i.role.dashboard.View&&i.showPeriodFilter?6:7),l(2),c("ngClass",V(23,ee,(i.salesData==null?null:i.salesData.Tax)||i.role.product.Cost)),l(),c("routerLink",b(25,$))("queryParams",de(26,Ne,_(10,11,i.isTodayFilter?i.today:i.chartData==null?null:i.chartData.From,"yyyy-MM-dd"),_(11,14,i.isTodayFilter?i.today:i.dateTo,"yyyy-MM-dd"),i.filterByOutletIds())),l(6),F(_(16,17,i.salesData==null?null:i.salesData.Count,"1.0-0")),l(2),u((i.salesData==null?null:i.salesData.Tax)>0?17:-1),l(),u(i.role.product.Cost?18:-1),l(),u(i.role.report.Profit&&i.role.product.Cost?19:-1),l(4),se("",_(24,20,i.dashboardConfig==null?null:i.dashboardConfig.SpanConfigTime,"dd MMM HH:mm")," ",i.dashboardConfig==null?null:i.dashboardConfig.SmallTimeZone))},dependencies:[L,U,Ee,he,ue,xe,G,me],styles:[".chart-widget[_ngcontent-%COMP%]{width:80%}.link-dark[_ngcontent-%COMP%]{color:#333!important}.dropdown-menu.show.today[_ngcontent-%COMP%]{inset:0 auto auto -34px!important}.sales-card-widget[_ngcontent-%COMP%]{width:19%}.sales-card-widget[_ngcontent-%COMP%] .card-row[_ngcontent-%COMP%]{height:64px}@media only screen and (max-width:767px){.chart-widget[_ngcontent-%COMP%]{width:100%}.sales-card-widget[_ngcontent-%COMP%]{width:100%;margin-top:12px}}@media only screen and (min-width:768px)and (max-width:991px){.chart-widget[_ngcontent-%COMP%]{width:100%}.sales-card-widget[_ngcontent-%COMP%]{width:100%;margin-top:12px}}"]})};var Ue=t=>({active:t});function Ge(t,n){if(t&1&&(o(0,"div",1),s(1),r(),o(2,"div",2)(3,"small",3),s(4),r(),o(5,"h2",4),s(6),r()()),t&2){let e=d();l(),F(e.title),l(3),F(e.currencySymbol),l(2),F(e.value)}}function je(t,n){if(t&1&&(o(0,"div",1),s(1),r(),o(2,"h2",4),s(3,"-"),r()),t&2){let e=d();l(),F(e.title)}}var K=class t{title;isActive;currencySymbol;value;showValue;constructor(){}ngOnInit(){}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=M({type:t,selectors:[["app-card-widget"]],inputs:{title:"title",isActive:"isActive",currencySymbol:"currencySymbol",value:"value",showValue:"showValue"},decls:3,vars:4,consts:[[1,"card-widget","pe-0",3,"ngClass"],[1,"fs-4","headings-font-family"],[1,"d-flex","justify-content-start","align-items-center"],[1,"fw-normal","me-2"],[1,"fw-normal"]],template:function(e,i){e&1&&(o(0,"div",0),m(1,Ge,7,3)(2,je,4,1),r()),e&2&&(c("ngClass",V(2,Ue,i.isActive)),l(),u(i.showValue?1:2))},dependencies:[L,U],styles:[".card-widget[_ngcontent-%COMP%]{padding:20px;border-radius:6px;min-height:95px;border:.5px solid #e4e4e4;width:100%}.active[_ngcontent-%COMP%]{background-color:#f0f0f0}@media only screen and (max-width:767px){.card-widget[_ngcontent-%COMP%]{width:200px}}@media only screen and (min-width:768px)and (max-width:991px){.card-widget[_ngcontent-%COMP%]{width:200px}}"]})};var Ze=()=>[R,import("./chunk-XJMPCHB4.js").then(t=>t.PaymentWidgetComponent)],Ke=()=>[R,import("./chunk-S6X3RI3M.js").then(t=>t.PurchaseWidgetComponent)],qe=()=>[R,import("./chunk-5TY4K3E2.js").then(t=>t.DebtWidgetComponent)],ze=()=>[R,import("./chunk-SSIG6XZC.js").then(t=>t.ProductWidgetComponent)],Je=()=>[R,import("./chunk-WOZC5DHE.js").then(t=>t.InventoryWidgetComponent)],Qe=()=>({role:"Payment View Role"}),Xe=()=>({role:"Buy Report Role"}),$e=()=>({role:"Debt View Role"}),et=()=>({role:"Report View Role"}),tt=()=>({role:"Inventory View Role"});function it(t,n){if(t&1){let e=v();o(0,"div",13)(1,"h6"),s(2,"Outlet"),r(),o(3,"outlet-selector",14),Q("ngModelChange",function(a){T(e);let p=d();return J(p.dashboardFilter().Outlets,a)||(p.dashboardFilter().Outlets=a),x(a)}),r()()}if(t&2){let e=d();l(3),c("multiple",!0)("accessType",e.outletAccess()),z("ngModel",e.dashboardFilter().Outlets)}}function at(t,n){if(t&1){let e=v();o(0,"div",19),P("click",function(){let a=T(e).$implicit,p=d(2);return x(p.onClickCardWidget(a))}),S(1,"app-card-widget",20),h(2,"number"),r()}if(t&2){let e=n.$implicit,i=d(),a=d();l(),c("title",e.title)("matTooltip",e.tooltip)("currencySymbol",i==null||i.ConfigData==null?null:i.ConfigData.CurrencySymbol)("value",e.value==null?"-":_(2,6,e.value,"1.0-0"))("showValue",e.showValue)("isActive",e.id==a.activeTab())}}function nt(t,n){if(t&1){let e=v();o(0,"app-sales-widget",21),P("onFilter",function(a){T(e);let p=d(2);return x(p.onFilterSalesWidget(a))}),r()}if(t&2){let e=d(),i=d();c("dashboardConfig",e==null?null:e.ConfigData)("chartData",e==null?null:e.HighChartData)("filterByOutletIds",i.dashboardFilter().Outlets)}}function ot(t,n){t&1&&N(0)}function rt(t,n){if(t&1){let e=v();o(0,"app-payment-widget",23),P("onFilter",function(a){T(e);let p=d(4);return x(p.onFilterPaymentWidget(a))}),r()}if(t&2){let e,i=d(3),a=d();c("dashboardConfig",i==null?null:i.ConfigData)("chartData",(e=a.paymentData())==null?null:e.Data)}}function lt(t,n){if(t&1&&y(0,ot,1,0,"ng-container",22)(1,rt,1,2,"ng-template",null,2,w),t&2){let e=D(2),i=d(3),a=D(11);c("ngTemplateOutlet",i.role.payment.View?e:a)("ngTemplateOutletContext",b(2,Qe))}}function st(t,n){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function dt(t,n){t&1&&(W(0,lt,3,3)(1,st,2,0),I(2,0,Ze,null,1),A(0,-1))}function ct(t,n){t&1&&N(0)}function pt(t,n){if(t&1&&S(0,"app-purchase-widget",18),t&2){let e,i=d(3),a=d();c("dashboardConfig",i==null?null:i.ConfigData)("chartData",(e=a.purchaseData())==null?null:e.HighChartData)("filterByOutletIds",a.dashboardFilter().Outlets)}}function mt(t,n){if(t&1&&y(0,ct,1,0,"ng-container",22)(1,pt,1,3,"ng-template",null,3,w),t&2){let e=D(2),i=d(3),a=D(11);c("ngTemplateOutlet",i.role.buy.Report?e:a)("ngTemplateOutletContext",b(2,Xe))}}function ut(t,n){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function ht(t,n){t&1&&(W(0,mt,3,3)(1,ut,2,0),I(2,0,Ke,null,1),A(0,-1))}function _t(t,n){t&1&&N(0)}function Ct(t,n){if(t&1&&S(0,"app-debt-widget",25),t&2){let e,i=d(3),a=d();c("dashboardConfig",i==null?null:i.ConfigData)("debtData",(e=a.debtData())==null?null:e.PageData)}}function gt(t,n){if(t&1&&y(0,_t,1,0,"ng-container",22)(1,Ct,1,2,"ng-template",null,4,w),t&2){let e=D(2),i=d(3),a=D(11);c("ngTemplateOutlet",i.role.debt.View?e:a)("ngTemplateOutletContext",b(2,$e))}}function ft(t,n){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function Dt(t,n){t&1&&(W(0,gt,3,3)(1,ft,2,0),I(2,0,qe,null,1),A(0,-1))}function bt(t,n){t&1&&N(0)}function St(t,n){if(t&1&&S(0,"app-product-widget",26),t&2){let e,i=d(3),a=d();c("dashboardConfig",i==null?null:i.ConfigData)("productData",(e=a.productData())==null?null:e.PageData)}}function Tt(t,n){if(t&1&&y(0,bt,1,0,"ng-container",22)(1,St,1,2,"ng-template",null,5,w),t&2){let e=D(2),i=d(3),a=D(11);c("ngTemplateOutlet",i.role.report.View?e:a)("ngTemplateOutletContext",b(2,et))}}function xt(t,n){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function yt(t,n){t&1&&(W(0,Tt,3,3)(1,xt,2,0),I(2,0,ze,null,1),A(0,-1))}function vt(t,n){t&1&&N(0)}function wt(t,n){if(t&1&&S(0,"app-inventory-widget",27),t&2){let e,i=d(3),a=d();c("dashboardConfig",i==null?null:i.ConfigData)("logisticsData",(e=a.logisticsData())==null?null:e.PageData)}}function Ot(t,n){if(t&1&&y(0,vt,1,0,"ng-container",22)(1,wt,1,2,"ng-template",null,6,w),t&2){let e=D(2),i=d(3),a=D(11);c("ngTemplateOutlet",i.role.inventory.View?e:a)("ngTemplateOutletContext",b(2,tt))}}function Et(t,n){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function Pt(t,n){t&1&&(W(0,Ot,3,3)(1,Et,2,0),I(2,0,Je,null,1),A(0,-1))}function Ft(t,n){if(t&1&&(o(0,"div",12)(1,"div",15)(2,"div",16),re(3,at,3,9,"div",17,oe),r(),m(5,nt,1,3,"app-sales-widget",18),m(6,dt,4,0),m(7,ht,4,0),m(8,Dt,4,0),m(9,yt,4,0),m(10,Pt,4,0),r()()),t&2){let e=d();l(3),le(e.cardWidgetComputed()),l(2),u(e.activeTab()=="SALES"?5:-1),l(),u(e.activeTab()=="PAYMENT"?6:-1),l(),u(e.activeTab()=="PURCHASE"?7:-1),l(),u(e.activeTab()=="DEBT"?8:-1),l(),u(e.activeTab()=="PRODUCT"?9:-1),l(),u(e.activeTab()=="LOGISTICS"?10:-1)}}function Vt(t,n){if(t&1&&(o(0,"div",24)(1,"div",28)(2,"div"),S(3,"img",29),r(),o(4,"h1",30),s(5,"You are not authorized"),r(),o(6,"p"),s(7," This page requires role "),o(8,"span",31),s(9),r(),s(10," to be accessed. Please contact your Administrator to gain access! "),r()()()),t&2){let e=n.role;l(9),C("[",e,"]")}}var We=class t extends Se{constructor(e,i,a){super(e);this.dashboardService=i;this.role=a;this.menuData$.subscribe(),this.fetchAllData(),ie(()=>{this.updateCardWidget()})}cardWidget=f([]);outletAccess=f(2);dashboardFilter=f({Outlets:[]});salesData=f(null);paymentData=f(null);purchaseData=f(null);debtData=f(null);productData=f(null);logisticsData=f(null);activeTab=f("SALES");cardWidgetComputed=ce(()=>this.cardWidget().map(e=>{let i=!1;if(e.id==="SALES"?i=this.role.dashboard.View:e.id==="PAYMENT"?i=this.role.payment.View:e.id==="PURCHASE"?i=this.role.buy.Create&&this.role.buy.Report:e.id==="DEBT"?i=this.role.debt.View:e.id==="PRODUCT"?i=this.role.report.View:e.id==="LOGISTICS"?i=this.role.inventory.View:i=!0,!i)return null;let a=e.tooltip;return e.id==="SALES"?a=this.activeTab()==="SALES"?e.tooltip:"Total Sales Today":e.id==="PAYMENT"?a=this.activeTab()==="PAYMENT"?e.tooltip:"Total Payment Today":e.id==="PURCHASE"?a=this.activeTab()==="PURCHASE"?e.tooltip:"Total Purchase Today":e.id==="DEBT"?a=this.activeTab()==="DEBT"?e.tooltip:"Total Debt Today":e.id==="PRODUCT"?a=this.activeTab()==="PRODUCT"?e.tooltip:"Total Product Today":e.id==="LOGISTICS"&&(a=this.activeTab()==="LOGISTICS"?e.tooltip:"Total Logistics Today"),H(B({},e),{tooltip:a})}).filter(e=>e!==null));fetchAllData(){this.dashboardService.getDashboardSales(this.dashboardFilter()).subscribe(e=>this.salesData.set(e))}updateCardWidget(){let e=this.activeTab();if(e==="SALES"&&this.salesData()){let i=this.dashboardService.getTotalData("Sales",this.salesData().HighChartData.Series,1);this.dashboardService.setWidgetData(i,e).subscribe(a=>this.cardWidget.set(a))}else if(e==="PAYMENT"&&this.paymentData()){let i=this.dashboardService.getTotalData("All",this.paymentData().Data.Series,1);this.dashboardService.setWidgetData(i,e).subscribe(a=>this.cardWidget.set(a))}else if(e==="PURCHASE"&&this.purchaseData()){let i=this.dashboardService.getTotalData("Purchase",this.purchaseData().HighChartData.Series,1);this.dashboardService.setWidgetData(i,e).subscribe(a=>this.cardWidget.set(a))}else if(e==="DEBT"&&this.debtData()){let i=this.debtData().PageData.Receivable;this.dashboardService.setWidgetData(i,e).subscribe(a=>this.cardWidget.set(a))}else if(e==="LOGISTICS"&&this.logisticsData()){let i=this.logisticsData()?.PageData?.Logistic?.Total;i&&this.dashboardService.setWidgetData(i,e).subscribe(a=>this.cardWidget.set(a)),this.dashboardService.getDashboardLogistics(this.dashboardFilter()).subscribe(a=>{this.logisticsData.set(a)})}}onFilterByOutlet(){this.dashboardService.clearCache(),this.fetchAllData(),this.updateCardWidget()}onClickCardWidget(e){switch(this.activeTab.set(e.id),e.id){case"SALES":this.dashboardService.getDashboardSales(this.dashboardFilter()).subscribe(i=>this.salesData.set(i));break;case"PURCHASE":this.dashboardService.getDashboardPurchase(this.dashboardFilter()).subscribe(i=>this.purchaseData.set(i));break;case"DEBT":this.dashboardService.getDashboardDebt(this.dashboardFilter()).subscribe(i=>this.debtData.set(i));break;case"PRODUCT":this.dashboardService.getDashboardProduct(this.dashboardFilter()).subscribe(i=>this.productData.set(i));break;case"LOGISTICS":this.dashboardService.getDashboardLogistics(this.dashboardFilter()).subscribe(i=>{console.log("Received logistics data => ",i.PageData),this.logisticsData.set(i)});break;case"PAYMENT":this.dashboardService.getDashboardPayment(this.dashboardFilter()).subscribe(i=>this.paymentData.set(i));break;default:new Error("Invalid widget type")}this.updateCardWidget()}onFilterSalesWidget(e){if(!this.salesData())return;let i=e.period==="WEEKLY"?7:1,a=this.dashboardService.getTotalData("Sales",this.salesData().HighChartData.Series,i);this.dashboardService.setWidgetData(a,"SALES").subscribe(p=>{this.cardWidget.set(p.map(g=>(g.id==="SALES"&&(g.tooltip=e.period==="TODAY"?"Total Sales Today":"Total Sales last 7 days"),g)))})}onFilterPaymentWidget(e){if(!this.paymentData())return;let i=e.period==="WEEKLY"?7:1,a=this.dashboardService.getTotalData("All",this.paymentData().Data.Series,i);this.dashboardService.setWidgetData(a,"PAYMENT").subscribe(p=>{this.cardWidget.set(p.map(g=>(g.id==="PAYMENT"&&(g.tooltip=e.period==="TODAY"?"Total Payment Today":"Total Payment last 7 days"),g)))})}static \u0275fac=function(i){return new(i||t)(E(Te),E(O),E(j))};static \u0275cmp=M({type:t,selectors:[["POS-dashboard-v2"]],features:[Y([O]),ne],decls:12,vars:5,consts:[["pageFilterTemplate",""],["NOT_AUTHORIZED",""],["PAYMENT",""],["BUY",""],["DEBT",""],["PRODUCT",""],["INVENTORY",""],[3,"onSubmit","filterChange","hideSearchBox","pageData","isFilterOnDropdown","filter"],[1,"content"],[1,"container-fluid","bg-light-gray","p-8"],[1,"row"],[1,"col-12"],[1,"card","mb-0"],[1,"dialog-filter"],["appendTo","body","placeholder","Select Outlets",3,"ngModelChange","multiple","accessType","ngModel"],[1,"card-body"],[1,"d-flex","flex-row","flex-nowrap","justify-content-between","align-items-center","overflow-auto",2,"column-gap","18px"],[1,"cursor-pointer","card-widget-tab"],[3,"dashboardConfig","chartData","filterByOutletIds"],[1,"cursor-pointer","card-widget-tab",3,"click"],["matTooltipPosition","above",3,"title","matTooltip","currencySymbol","value","showValue","isActive"],[3,"onFilter","dashboardConfig","chartData","filterByOutletIds"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"onFilter","dashboardConfig","chartData"],[1,"d-flex","align-items-center","justify-content-center","mt-8",2,"height","350px"],[3,"dashboardConfig","debtData"],[3,"dashboardConfig","productData"],[3,"dashboardConfig","logisticsData"],[1,"text-center"],["src","https://cdn.dealpos.xyz/web-image/locked.svg",2,"width","160px"],[1,"mt-2","mb-6"],[1,"fw-bold"]],template:function(i,a){if(i&1){let p=v();o(0,"mainpanel-cmp",7),P("onSubmit",function(){return a.onFilterByOutlet()}),Q("filterChange",function(q){return T(p),J(a.dashboardFilter,q)||(a.dashboardFilter=q),x(q)}),o(1,"filters"),y(2,it,4,3,"ng-template",null,0,w),r(),o(4,"content")(5,"div",8)(6,"div",9)(7,"div",10)(8,"div",11),m(9,Ft,11,6,"div",12),r()()()()()(),y(10,Vt,11,1,"ng-template",null,1,w)}if(i&2){let p;c("hideSearchBox",!0)("pageData",a.menuData)("isFilterOnDropdown",!1),z("filter",a.dashboardFilter),l(9),u((p=a.salesData())?9:-1,p)}},dependencies:[L,ve,ye,fe,Ce,ge,Z,K,we,be,De,G],styles:[".card-widget-tab[_ngcontent-%COMP%]{flex:1 1 0px}@media only screen and (max-width:767px){.card-widget-tab[_ngcontent-%COMP%]{margin-right:1rem;margin-top:.5rem;width:auto}}@media only screen and (min-width:768px)and (max-width:991px){.card-widget-tab[_ngcontent-%COMP%]{margin-right:1rem;margin-top:.5rem;width:auto}}"]})};export{We as DashboardV2Component};
@@ -1 +1 @@
1
- import{a as de}from"./chunk-PUITSSTH.js";import{f as re,g as le}from"./chunk-B5EEORFC.js";import"./chunk-PAF2E6M3.js";import"./chunk-HNHLGX7F.js";import{a as ne}from"./chunk-7L57YG4E.js";import"./chunk-LXFJ7QGK.js";import"./chunk-SFSRABV5.js";import"./chunk-HNESPLVM.js";import"./chunk-G7E24J2R.js";import"./chunk-VYA2NFJ5.js";import"./chunk-SH55PTEY.js";import"./chunk-VPS35GPI.js";import"./chunk-UGBMCXS6.js";import"./chunk-5TTXT2K2.js";import"./chunk-YNQPX5G6.js";import"./chunk-BXYSKXYX.js";import"./chunk-SGWWI7EY.js";import{a as ie,b as oe,c as ae}from"./chunk-BQPO535K.js";import"./chunk-HLLBCLO6.js";import"./chunk-4P6SOZDY.js";import{a as $,b as ee,c as te}from"./chunk-U5Y75IZ5.js";import"./chunk-HY3IUHOC.js";import"./chunk-4AEX2WLA.js";import"./chunk-2MELUOYA.js";import"./chunk-WOPE6PPO.js";import{D as Q,E as X,c as q,h as G,o as z,z as J}from"./chunk-MDIMQ3H3.js";import"./chunk-PIIH224Z.js";import"./chunk-NCWKENB5.js";import"./chunk-MWDJTJ3O.js";import"./chunk-7CQSSHSC.js";import{a as H}from"./chunk-3DEA4WWC.js";import"./chunk-SEDQQVP7.js";import{n as W,q as Z}from"./chunk-TKVDP62Z.js";import{Ad as w,Bb as T,Db as S,Dc as D,F as E,Fa as V,Fb as Y,Gb as L,Hb as k,Ib as _,Jb as o,Kb as a,Kc as F,Lb as g,Lc as B,Sd as K,Ub as y,Xb as f,Za as s,Zb as m,eb as C,hc as N,ib as b,mc as r,nb as A,nc as I,nd as U,oc as O,rc as R,sc as x,tc as M,va as p,wa as u,xd as j}from"./chunk-GJDGQISV.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";var v=(d=>(d.TRANSACTIONS="TRANSACTIONS",d.PRODUCTS="PRODUCTS",d.CONTACTS="CONTACTS",d.LOYALTY_POINTS="LOYALTY_POINTS",d.RECYCLE_BIN="RECYCLE_BIN",d.INVENTORY="INVENTORY",d))(v||{});function ue(n,l){if(n&1&&(o(0,"div",3)(1,"div",4)(2,"div",16),g(3,"i",17),o(4,"span"),r(5),a()()()()),n&2){let i=m();s(5),O(" ",i.selectedClearData.message," ")}}function Ce(n,l){n&1&&(o(0,"small",8),r(1," *Subdomain is required "),a())}function fe(n,l){n&1&&(o(0,"small",8),r(1," *Password is required "),a())}function _e(n,l){n&1&&g(0,"i",14)}function Te(n,l){n&1&&g(0,"i",15)}var h=class n{constructor(l,i,t){this.data=l;this.dialogRef=i;this.fb=t;this.modalConfig.title=this.modalTitle[this.data.type],this.subdomain="",this.subdomainPlaceholder=l.subDomain}clearData=[{type:"TRANSACTIONS",api:"Setup/Data/ClearTransaction",message:"Your Invoice, Bill, Adjustment, TransferOrder will be deleted"},{type:"PRODUCTS",api:"Setup/Data/ClearProduct",message:"Your Category, Product and Variant will be deleted"},{type:"LOYALTY_POINTS",api:"Setup/Data/ClearLoyaltyPoint"},{type:"RECYCLE_BIN",api:"Setup/Data/ClearRecycleBin"},{type:"INVENTORY",api:"Setup/Data/ClearInventory",message:"Your Product Inventory will be set to 0"},{type:"CONTACTS",api:"Setup/Data/ClearContact",message:"Your Customer, Supplier and Sales Person will be deleted"}];selectedClearData;modalConfig=new ee;modalTitle={TRANSACTIONS:"Clear Transactions",PRODUCTS:"Clear Products",LOYALTY_POINTS:"Clear Loyalty Points",RECYCLE_BIN:"Clear Recycle Bin",CONTACTS:"Clear Contacts",INVENTORY:"Clear Inventory"};subdomain;subdomainPlaceholder;password;form;passwordVisibility=V(!1);ngOnInit(){this.initSelectedClearData(),this.form=this.fb.group({subdomain:[""],password:[""]})}initSelectedClearData(){this.selectedClearData=this.clearData.find(l=>l.type===this.data.type)}onSubmit(){let l={password:this.password,subdomain:this.subdomain,apiUrl:this.selectedClearData.api};this.dialogRef.close(l)}static \u0275fac=function(i){return new(i||n)(C(oe),C(ie),C(Q))};static \u0275cmp=b({type:n,selectors:[["app-confirmation-modal"]],decls:24,vars:10,consts:[["subdomainCtrl","ngModel"],["passwordCtrl","ngModel"],[3,"onOk","onClose","onCancel","config","dynamicValidated"],[1,"row"],[1,"col-12"],[1,"form-floating-outline","mt-5"],["type","text","id","subdomain","placeholder","Subdomain","name","subdomain","autofocus","","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"control-label","text-danger"],[1,"form-floating-outline"],["id","pass","placeholder","Password","name","password","required","",1,"form-control",3,"ngModelChange","type","ngModel"],["for","pass"],[1,"password-visibility"],["type","button",1,"btn","btn-link",3,"click"],[1,"fa-solid","fa-eye"],[1,"fa-solid","fa-eye-slash"],[1,"alert","alert-warning","cursor","w-100"],[1,"fa-solid","fa-circle-exclamation","me-2"]],template:function(i,t){if(i&1){let e=y();o(0,"modal-material",2),f("onOk",function(){return t.onSubmit()})("onClose",function(){return t.dialogRef.close()})("onCancel",function(){return t.dialogRef.close()}),o(1,"content"),T(2,ue,6,1,"div",3),o(3,"div",3)(4,"div",4)(5,"strong"),r(6),a(),o(7,"div",5)(8,"input",6,0),M("ngModelChange",function(d){return p(e),x(t.subdomain,d)||(t.subdomain=d),u(d)}),a(),o(10,"label",7),r(11,"Subdomain"),a(),T(12,Ce,2,0,"small",8),a()(),o(13,"div",4)(14,"div",9)(15,"input",10,1),M("ngModelChange",function(d){return p(e),x(t.password,d)||(t.password=d),u(d)}),a(),o(17,"label",11),r(18,"Password"),a(),T(19,fe,2,0,"small",8),o(20,"div",12)(21,"button",13),f("click",function(){return t.passwordVisibility.set(!t.passwordVisibility())}),T(22,_e,1,0,"i",14)(23,Te,1,0,"i",15),a()()()()()()()}if(i&2){let e=N(9),c=N(16);_("config",t.modalConfig)("dynamicValidated",t.password&&t.subdomain),s(2),S(t.selectedClearData.message?2:-1),s(4),O("Enter the following subdomain to confirm: ",t.subdomainPlaceholder),s(2),R("ngModel",t.subdomain),s(4),S(e.invalid&&(e.dirty||e.touched)?12:-1),s(3),_("type",t.passwordVisibility()?"text":"password"),R("ngModel",t.password),s(4),S(c.invalid&&(c.dirty||c.touched)?19:-1),s(3),S(t.passwordVisibility()?22:23)}},dependencies:[w,te,X,q,G,J,z],styles:[".password-visibility[_ngcontent-%COMP%]{position:absolute;right:0;top:50%;transform:translateY(-50%);cursor:pointer;font-size:1.5rem}"]})};var P=n=>({"border border-0":n});function Se(n,l){if(n&1&&(o(0,"tr",21)(1,"td",21),r(2),a(),o(3,"td",22),r(4),F(5,"number"),a()()),n&2){let i=l.$implicit,t=l.$index,e=m(2);_("ngClass",D(7,P,t==e.data.Data.length-1)),s(),_("ngClass",D(9,P,t==e.data.Data.length-1)),s(),I(i.Key),s(),_("ngClass",D(11,P,t==e.data.Data.length-1)),s(),I(B(5,5,i.Value))}}function be(n,l){if(n&1){let i=y();o(0,"mainpanel-cmp",0)(1,"actions")(2,"div",1)(3,"div",2)(4,"button",3),r(5," Format Data "),a(),o(6,"ul",4)(7,"li")(8,"a",5),f("click",function(){p(i);let e=m();return u(e.onClearRecord(e.clearDataType.TRANSACTIONS))}),r(9," 1. Clear Transactions "),a()(),o(10,"li")(11,"a",6),f("click",function(){p(i);let e=m();return u(e.onClearRecord(e.clearDataType.INVENTORY))}),r(12," 2. Clear Inventory "),a()(),o(13,"li")(14,"a",7),f("click",function(){p(i);let e=m();return u(e.onClearRecord(e.clearDataType.PRODUCTS))}),r(15," 3. Clear Products "),a()(),o(16,"li")(17,"a",8),f("click",function(){p(i);let e=m();return u(e.onClearRecord(e.clearDataType.CONTACTS))}),r(18," 4. Clear Contacts "),a()(),o(19,"li")(20,"a",9),f("click",function(){p(i);let e=m();return u(e.onClearRecord(e.clearDataType.LOYALTY_POINTS))}),r(21," 5. Clear Loyalty Point "),a()(),o(22,"li")(23,"a",10),f("click",function(){p(i);let e=m();return u(e.onClearRecord(e.clearDataType.RECYCLE_BIN))}),r(24," 6. Clear Recycle Bin "),a()()()()()(),o(25,"content")(26,"div",11)(27,"div",12)(28,"div",13)(29,"h5"),r(30,"Database Records"),a(),o(31,"i"),r(32,"Current data count"),a()(),o(33,"div",14)(34,"div",15)(35,"div",16)(36,"table",17)(37,"thead",18)(38,"tr",19)(39,"th"),r(40,"Table"),a(),o(41,"th",20),r(42,"Rows"),a()()(),o(43,"tbody"),L(44,Se,6,13,"tr",21,Y),a()()()()()()()()()}if(n&2){let i=m();_("pageData",i.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),s(44),k(i.data.Data)}}var se=class n extends de{constructor(i,t,e,c,d){super(i,t,"Setup/DataLoader/clearformatdata",e);this.httpService=t;this.activatedRoute=e;this.toaster=c;this.dialog=d}clearDataType=v;onClearRecord(i){this.dialog.open(h,{data:{type:i,subDomain:this.data.SubDomain}}).afterClosed().pipe(E(t=>H.IsNotEmpty(t))).subscribe(t=>{this.formData={Subdomain:t.subdomain,Password:t.password},this.onSubmit(t.apiUrl),i=="PRODUCTS"?this.data.Data.find(e=>e.Key=="Product").Value=0:i=="CONTACTS"?this.data.Data.find(e=>e.Key=="Customer").Value=0:i=="INVENTORY"?this.data.Data.find(e=>e.Key=="ItemTransfer").Value=0:i=="LOYALTY_POINTS"?this.data.Data.find(e=>e.Key=="JournalHeader").Value=0:i=="RECYCLE_BIN"?this.data.Data.find(e=>e.Key=="Recycle Bin").Value=0:i=="TRANSACTIONS"&&(this.data.Data.find(e=>e.Key=="SalesOrder").Value=0)})}onSubmitSuccess(i){this.toaster.success(i.Message,$.Success)}static \u0275fac=function(t){return new(t||n)(C(ne),C(Z),C(K),C(W),C(ae))};static \u0275cmp=b({type:n,selectors:[["POS-format-data"]],features:[A],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"d-flex"],[1,"dropdown"],["type","button","data-bs-toggle","dropdown","aria-expanded","false","confirm-message","Are you sure you want to clear the record?",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end"],["role","button","matTooltipPosition","above","matTooltip","Clear Transaction",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Inventory",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Products",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Contacts",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Loyalty Point",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Recycle Bin",1,"dropdown-item",3,"click"],[1,"container","pt-3"],[1,"row","border-bottom","mt-10","ms-2"],[1,"col-sm-2"],[1,"col-sm-10"],[1,"row"],[1,"col-md-12"],["id","tableGrid",1,"table",2,"width","250px"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end"],[3,"ngClass"],[1,"text-end",3,"ngClass"]],template:function(t,e){t&1&&T(0,be,46,3,"mainpanel-cmp",0),t&2&&S(e.formData?0:-1)},dependencies:[w,U,le,re,j],encapsulation:2})};export{se as FormatDataComponent};
1
+ import{a as de}from"./chunk-PUITSSTH.js";import{f as re,g as le}from"./chunk-NSBIEAEN.js";import"./chunk-YJCMKEIW.js";import"./chunk-HNHLGX7F.js";import{a as ne}from"./chunk-BBLFHZEO.js";import"./chunk-LXFJ7QGK.js";import"./chunk-GWZLP3JE.js";import"./chunk-WF6K4N5K.js";import"./chunk-G7E24J2R.js";import"./chunk-VYA2NFJ5.js";import"./chunk-SH55PTEY.js";import"./chunk-VPS35GPI.js";import"./chunk-UGBMCXS6.js";import"./chunk-5TTXT2K2.js";import"./chunk-YNQPX5G6.js";import"./chunk-BXYSKXYX.js";import"./chunk-GDIWAXMB.js";import{a as ie,b as oe,c as ae}from"./chunk-BQPO535K.js";import"./chunk-HLLBCLO6.js";import"./chunk-4P6SOZDY.js";import{a as $,b as ee,c as te}from"./chunk-U5Y75IZ5.js";import"./chunk-HY3IUHOC.js";import"./chunk-4AEX2WLA.js";import"./chunk-2MELUOYA.js";import"./chunk-WOPE6PPO.js";import{D as Q,E as X,c as q,h as G,o as z,z as J}from"./chunk-MDIMQ3H3.js";import"./chunk-OA6PQTAA.js";import"./chunk-ZIEDDJRF.js";import"./chunk-MWDJTJ3O.js";import"./chunk-7CQSSHSC.js";import{a as H}from"./chunk-3DEA4WWC.js";import"./chunk-EWVIPH3Y.js";import{n as W,q as Z}from"./chunk-TKVDP62Z.js";import{Ad as w,Bb as T,Db as S,Dc as D,F as E,Fa as V,Fb as Y,Gb as L,Hb as k,Ib as _,Jb as o,Kb as a,Kc as F,Lb as g,Lc as B,Sd as K,Ub as y,Xb as f,Za as s,Zb as m,eb as C,hc as N,ib as b,mc as r,nb as A,nc as I,nd as U,oc as O,rc as R,sc as x,tc as M,va as p,wa as u,xd as j}from"./chunk-GJDGQISV.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";var v=(d=>(d.TRANSACTIONS="TRANSACTIONS",d.PRODUCTS="PRODUCTS",d.CONTACTS="CONTACTS",d.LOYALTY_POINTS="LOYALTY_POINTS",d.RECYCLE_BIN="RECYCLE_BIN",d.INVENTORY="INVENTORY",d))(v||{});function ue(n,l){if(n&1&&(o(0,"div",3)(1,"div",4)(2,"div",16),g(3,"i",17),o(4,"span"),r(5),a()()()()),n&2){let i=m();s(5),O(" ",i.selectedClearData.message," ")}}function Ce(n,l){n&1&&(o(0,"small",8),r(1," *Subdomain is required "),a())}function fe(n,l){n&1&&(o(0,"small",8),r(1," *Password is required "),a())}function _e(n,l){n&1&&g(0,"i",14)}function Te(n,l){n&1&&g(0,"i",15)}var h=class n{constructor(l,i,t){this.data=l;this.dialogRef=i;this.fb=t;this.modalConfig.title=this.modalTitle[this.data.type],this.subdomain="",this.subdomainPlaceholder=l.subDomain}clearData=[{type:"TRANSACTIONS",api:"Setup/Data/ClearTransaction",message:"Your Invoice, Bill, Adjustment, TransferOrder will be deleted"},{type:"PRODUCTS",api:"Setup/Data/ClearProduct",message:"Your Category, Product and Variant will be deleted"},{type:"LOYALTY_POINTS",api:"Setup/Data/ClearLoyaltyPoint"},{type:"RECYCLE_BIN",api:"Setup/Data/ClearRecycleBin"},{type:"INVENTORY",api:"Setup/Data/ClearInventory",message:"Your Product Inventory will be set to 0"},{type:"CONTACTS",api:"Setup/Data/ClearContact",message:"Your Customer, Supplier and Sales Person will be deleted"}];selectedClearData;modalConfig=new ee;modalTitle={TRANSACTIONS:"Clear Transactions",PRODUCTS:"Clear Products",LOYALTY_POINTS:"Clear Loyalty Points",RECYCLE_BIN:"Clear Recycle Bin",CONTACTS:"Clear Contacts",INVENTORY:"Clear Inventory"};subdomain;subdomainPlaceholder;password;form;passwordVisibility=V(!1);ngOnInit(){this.initSelectedClearData(),this.form=this.fb.group({subdomain:[""],password:[""]})}initSelectedClearData(){this.selectedClearData=this.clearData.find(l=>l.type===this.data.type)}onSubmit(){let l={password:this.password,subdomain:this.subdomain,apiUrl:this.selectedClearData.api};this.dialogRef.close(l)}static \u0275fac=function(i){return new(i||n)(C(oe),C(ie),C(Q))};static \u0275cmp=b({type:n,selectors:[["app-confirmation-modal"]],decls:24,vars:10,consts:[["subdomainCtrl","ngModel"],["passwordCtrl","ngModel"],[3,"onOk","onClose","onCancel","config","dynamicValidated"],[1,"row"],[1,"col-12"],[1,"form-floating-outline","mt-5"],["type","text","id","subdomain","placeholder","Subdomain","name","subdomain","autofocus","","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"control-label","text-danger"],[1,"form-floating-outline"],["id","pass","placeholder","Password","name","password","required","",1,"form-control",3,"ngModelChange","type","ngModel"],["for","pass"],[1,"password-visibility"],["type","button",1,"btn","btn-link",3,"click"],[1,"fa-solid","fa-eye"],[1,"fa-solid","fa-eye-slash"],[1,"alert","alert-warning","cursor","w-100"],[1,"fa-solid","fa-circle-exclamation","me-2"]],template:function(i,t){if(i&1){let e=y();o(0,"modal-material",2),f("onOk",function(){return t.onSubmit()})("onClose",function(){return t.dialogRef.close()})("onCancel",function(){return t.dialogRef.close()}),o(1,"content"),T(2,ue,6,1,"div",3),o(3,"div",3)(4,"div",4)(5,"strong"),r(6),a(),o(7,"div",5)(8,"input",6,0),M("ngModelChange",function(d){return p(e),x(t.subdomain,d)||(t.subdomain=d),u(d)}),a(),o(10,"label",7),r(11,"Subdomain"),a(),T(12,Ce,2,0,"small",8),a()(),o(13,"div",4)(14,"div",9)(15,"input",10,1),M("ngModelChange",function(d){return p(e),x(t.password,d)||(t.password=d),u(d)}),a(),o(17,"label",11),r(18,"Password"),a(),T(19,fe,2,0,"small",8),o(20,"div",12)(21,"button",13),f("click",function(){return t.passwordVisibility.set(!t.passwordVisibility())}),T(22,_e,1,0,"i",14)(23,Te,1,0,"i",15),a()()()()()()()}if(i&2){let e=N(9),c=N(16);_("config",t.modalConfig)("dynamicValidated",t.password&&t.subdomain),s(2),S(t.selectedClearData.message?2:-1),s(4),O("Enter the following subdomain to confirm: ",t.subdomainPlaceholder),s(2),R("ngModel",t.subdomain),s(4),S(e.invalid&&(e.dirty||e.touched)?12:-1),s(3),_("type",t.passwordVisibility()?"text":"password"),R("ngModel",t.password),s(4),S(c.invalid&&(c.dirty||c.touched)?19:-1),s(3),S(t.passwordVisibility()?22:23)}},dependencies:[w,te,X,q,G,J,z],styles:[".password-visibility[_ngcontent-%COMP%]{position:absolute;right:0;top:50%;transform:translateY(-50%);cursor:pointer;font-size:1.5rem}"]})};var P=n=>({"border border-0":n});function Se(n,l){if(n&1&&(o(0,"tr",21)(1,"td",21),r(2),a(),o(3,"td",22),r(4),F(5,"number"),a()()),n&2){let i=l.$implicit,t=l.$index,e=m(2);_("ngClass",D(7,P,t==e.data.Data.length-1)),s(),_("ngClass",D(9,P,t==e.data.Data.length-1)),s(),I(i.Key),s(),_("ngClass",D(11,P,t==e.data.Data.length-1)),s(),I(B(5,5,i.Value))}}function be(n,l){if(n&1){let i=y();o(0,"mainpanel-cmp",0)(1,"actions")(2,"div",1)(3,"div",2)(4,"button",3),r(5," Format Data "),a(),o(6,"ul",4)(7,"li")(8,"a",5),f("click",function(){p(i);let e=m();return u(e.onClearRecord(e.clearDataType.TRANSACTIONS))}),r(9," 1. Clear Transactions "),a()(),o(10,"li")(11,"a",6),f("click",function(){p(i);let e=m();return u(e.onClearRecord(e.clearDataType.INVENTORY))}),r(12," 2. Clear Inventory "),a()(),o(13,"li")(14,"a",7),f("click",function(){p(i);let e=m();return u(e.onClearRecord(e.clearDataType.PRODUCTS))}),r(15," 3. Clear Products "),a()(),o(16,"li")(17,"a",8),f("click",function(){p(i);let e=m();return u(e.onClearRecord(e.clearDataType.CONTACTS))}),r(18," 4. Clear Contacts "),a()(),o(19,"li")(20,"a",9),f("click",function(){p(i);let e=m();return u(e.onClearRecord(e.clearDataType.LOYALTY_POINTS))}),r(21," 5. Clear Loyalty Point "),a()(),o(22,"li")(23,"a",10),f("click",function(){p(i);let e=m();return u(e.onClearRecord(e.clearDataType.RECYCLE_BIN))}),r(24," 6. Clear Recycle Bin "),a()()()()()(),o(25,"content")(26,"div",11)(27,"div",12)(28,"div",13)(29,"h5"),r(30,"Database Records"),a(),o(31,"i"),r(32,"Current data count"),a()(),o(33,"div",14)(34,"div",15)(35,"div",16)(36,"table",17)(37,"thead",18)(38,"tr",19)(39,"th"),r(40,"Table"),a(),o(41,"th",20),r(42,"Rows"),a()()(),o(43,"tbody"),L(44,Se,6,13,"tr",21,Y),a()()()()()()()()()}if(n&2){let i=m();_("pageData",i.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),s(44),k(i.data.Data)}}var se=class n extends de{constructor(i,t,e,c,d){super(i,t,"Setup/DataLoader/clearformatdata",e);this.httpService=t;this.activatedRoute=e;this.toaster=c;this.dialog=d}clearDataType=v;onClearRecord(i){this.dialog.open(h,{data:{type:i,subDomain:this.data.SubDomain}}).afterClosed().pipe(E(t=>H.IsNotEmpty(t))).subscribe(t=>{this.formData={Subdomain:t.subdomain,Password:t.password},this.onSubmit(t.apiUrl),i=="PRODUCTS"?this.data.Data.find(e=>e.Key=="Product").Value=0:i=="CONTACTS"?this.data.Data.find(e=>e.Key=="Customer").Value=0:i=="INVENTORY"?this.data.Data.find(e=>e.Key=="ItemTransfer").Value=0:i=="LOYALTY_POINTS"?this.data.Data.find(e=>e.Key=="JournalHeader").Value=0:i=="RECYCLE_BIN"?this.data.Data.find(e=>e.Key=="Recycle Bin").Value=0:i=="TRANSACTIONS"&&(this.data.Data.find(e=>e.Key=="SalesOrder").Value=0)})}onSubmitSuccess(i){this.toaster.success(i.Message,$.Success)}static \u0275fac=function(t){return new(t||n)(C(ne),C(Z),C(K),C(W),C(ae))};static \u0275cmp=b({type:n,selectors:[["POS-format-data"]],features:[A],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"d-flex"],[1,"dropdown"],["type","button","data-bs-toggle","dropdown","aria-expanded","false","confirm-message","Are you sure you want to clear the record?",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end"],["role","button","matTooltipPosition","above","matTooltip","Clear Transaction",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Inventory",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Products",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Contacts",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Loyalty Point",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Recycle Bin",1,"dropdown-item",3,"click"],[1,"container","pt-3"],[1,"row","border-bottom","mt-10","ms-2"],[1,"col-sm-2"],[1,"col-sm-10"],[1,"row"],[1,"col-md-12"],["id","tableGrid",1,"table",2,"width","250px"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end"],[3,"ngClass"],[1,"text-end",3,"ngClass"]],template:function(t,e){t&1&&T(0,be,46,3,"mainpanel-cmp",0),t&2&&S(e.formData?0:-1)},dependencies:[w,U,le,re,j],encapsulation:2})};export{se as FormatDataComponent};