dealpos 25.37.3 → 25.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/browser/{chunk-WDDMKZLZ.js → chunk-2ZLV5QOF.js} +1 -1
  2. package/browser/{chunk-YMIWL4WY.js → chunk-33Z3MBAK.js} +1 -1
  3. package/browser/chunk-3HEZ7L27.js +14 -0
  4. package/browser/{chunk-J4NQVL2U.js → chunk-3R7CKCQC.js} +1 -1
  5. package/browser/{chunk-4ASACD3Q.js → chunk-4IZK3E4I.js} +1 -1
  6. package/browser/{chunk-5WFN5KAC.js → chunk-4MKFW5HF.js} +2 -2
  7. package/browser/{chunk-KEU6GUET.js → chunk-4QPI5R4J.js} +1 -1
  8. package/browser/{chunk-E3GQ2VEU.js → chunk-53HKNZ5U.js} +1 -1
  9. package/browser/{chunk-FT4VVMUZ.js → chunk-56F5KRLJ.js} +1 -1
  10. package/browser/{chunk-FE7KGLWI.js → chunk-5LDMXZLC.js} +1 -1
  11. package/browser/{chunk-T4MVFJGL.js → chunk-5VKCMGYJ.js} +1 -1
  12. package/browser/chunk-5VRRYWVC.js +140 -0
  13. package/browser/{chunk-LD5LH2YH.js → chunk-6QKPMFLS.js} +1 -1
  14. package/browser/{chunk-OVNI7USJ.js → chunk-6RP2WO45.js} +1 -1
  15. package/browser/{chunk-EMYSF46P.js → chunk-73MSULVJ.js} +1 -1
  16. package/browser/chunk-75M3O563.js +1 -0
  17. package/browser/{chunk-M4IEBQUD.js → chunk-7LY6BGJJ.js} +4 -4
  18. package/browser/chunk-7OH6LVTJ.js +125 -0
  19. package/browser/{chunk-7TZA4PUK.js → chunk-7UBJFV53.js} +1 -1
  20. package/browser/{chunk-2FXL2HDF.js → chunk-7YE4HOHN.js} +1 -1
  21. package/browser/chunk-A5X65SOA.js +57 -0
  22. package/browser/{chunk-LEJBHNYP.js → chunk-AESCW6DK.js} +1 -1
  23. package/browser/chunk-AFU62F2M.js +1 -0
  24. package/browser/{chunk-Z2P2CNKC.js → chunk-ASU7GMVT.js} +1 -1
  25. package/browser/{chunk-IPVEZIYO.js → chunk-AZC62B34.js} +1 -1
  26. package/browser/{chunk-UWNXD5ZO.js → chunk-B3KOTUMH.js} +1 -1
  27. package/browser/{chunk-AXHXNBHV.js → chunk-BDIOBQ3F.js} +1 -1
  28. package/browser/{chunk-VX4WL34G.js → chunk-BGRIUOYM.js} +1 -1
  29. package/browser/{chunk-KMHOACN3.js → chunk-CF6DDJIR.js} +3 -3
  30. package/browser/{chunk-HYW3PEDN.js → chunk-CFQ7OFCQ.js} +1 -1
  31. package/browser/{chunk-72KIMU7G.js → chunk-CKBNUI2K.js} +1 -1
  32. package/browser/chunk-CMTZAHVY.js +1 -0
  33. package/browser/{chunk-QWLFS2FE.js → chunk-DUEJUN6K.js} +1 -1
  34. package/browser/{chunk-AUWH2QWX.js → chunk-DV4SS5LL.js} +1 -1
  35. package/browser/chunk-DXNYWBOJ.js +1 -0
  36. package/browser/{chunk-HUAA5QUE.js → chunk-EAENAZFY.js} +1 -1
  37. package/browser/{chunk-NXQT6LJS.js → chunk-EBR5GJGA.js} +1 -1
  38. package/browser/{chunk-YAGXTRYQ.js → chunk-EPQCS4G7.js} +1 -1
  39. package/browser/{chunk-YFN33F7G.js → chunk-FC2QVVNL.js} +1 -1
  40. package/browser/{chunk-RRGRXLUZ.js → chunk-FT7BPR32.js} +1 -1
  41. package/browser/{chunk-QBECNCED.js → chunk-G7YXYVOM.js} +1 -1
  42. package/browser/{chunk-5O2KKW6F.js → chunk-GKVCGI4Q.js} +14 -12
  43. package/browser/{chunk-IWJJRPWB.js → chunk-GNIXWNP2.js} +1 -1
  44. package/browser/{chunk-FY5VLGQC.js → chunk-GWHR6QGI.js} +1 -1
  45. package/browser/chunk-H6OITCFT.js +1 -0
  46. package/browser/{chunk-RCW46J3Z.js → chunk-HFMOHPY7.js} +1 -1
  47. package/browser/{chunk-BED5HJZ2.js → chunk-HGB2NJEI.js} +1 -1
  48. package/browser/{chunk-A4JKVSUB.js → chunk-I4UPUEJQ.js} +4 -4
  49. package/browser/{chunk-JTWFMMM2.js → chunk-ICQLVIY5.js} +1 -1
  50. package/browser/{chunk-AXEM33OC.js → chunk-IUATJVYE.js} +1 -1
  51. package/browser/chunk-IV6VX4SW.js +1 -0
  52. package/browser/chunk-IY5XCLBB.js +1 -0
  53. package/browser/chunk-J27ER66U.js +2 -0
  54. package/browser/{chunk-YLD325HC.js → chunk-J6H577U5.js} +1 -1
  55. package/browser/{chunk-PMQCMLOB.js → chunk-JG6KP3LU.js} +1 -1
  56. package/browser/{chunk-OFCUJNQU.js → chunk-JHLUUVPP.js} +1 -1
  57. package/browser/{chunk-2RWD5W3A.js → chunk-JI6KR4QD.js} +1 -1
  58. package/browser/chunk-JIFR7UDE.js +1 -0
  59. package/browser/{chunk-IQY2LSF6.js → chunk-JKXSLPGV.js} +1 -1
  60. package/browser/chunk-JRRUR7IA.js +1 -0
  61. package/browser/{chunk-NILHRRUO.js → chunk-JSETQAUZ.js} +1 -1
  62. package/browser/{chunk-7EU2PMHX.js → chunk-K5DJ5WPE.js} +1 -1
  63. package/browser/{chunk-NOK7ZUJF.js → chunk-K7MKOLA6.js} +1 -1
  64. package/browser/{chunk-O6GMQRZG.js → chunk-KGDQP4JR.js} +1 -1
  65. package/browser/chunk-KXOXDBRC.js +1 -0
  66. package/browser/{chunk-CG73T3TQ.js → chunk-KYSWAYKK.js} +1 -1
  67. package/browser/{chunk-H4SCBKWD.js → chunk-L3BBA7TR.js} +1 -1
  68. package/browser/{chunk-CJKH7RU5.js → chunk-L3MPEEI7.js} +1 -1
  69. package/browser/{chunk-N3XWBPCL.js → chunk-LJYCLPTA.js} +1 -1
  70. package/browser/{chunk-LHQMGLCO.js → chunk-LT55LCIC.js} +1 -1
  71. package/browser/{chunk-RT6YCLZW.js → chunk-MGFRGPN4.js} +1 -1
  72. package/browser/{chunk-246GVKUS.js → chunk-MPENEFJK.js} +1 -1
  73. package/browser/chunk-MTTML3DV.js +3 -0
  74. package/browser/chunk-NOHORPPM.js +1 -0
  75. package/browser/{chunk-DTFL44UO.js → chunk-O27UF6WP.js} +1 -1
  76. package/browser/{chunk-RLFBLSFM.js → chunk-O6K27TYY.js} +1 -1
  77. package/browser/{chunk-GAPY6IUE.js → chunk-OQN4WGVB.js} +1 -1
  78. package/browser/{chunk-57IUU6ZC.js → chunk-OWSL7VZ7.js} +1 -1
  79. package/browser/{chunk-AKPQZTEV.js → chunk-PMTKXVGT.js} +1 -1
  80. package/browser/{chunk-LC2G5X3T.js → chunk-PPSWM237.js} +1 -1
  81. package/browser/{chunk-IX5URHI7.js → chunk-Q3GWLSDE.js} +1 -1
  82. package/browser/{chunk-MTMMU7GK.js → chunk-Q5WMF6RD.js} +1 -1
  83. package/browser/chunk-QBWWLEFP.js +24 -0
  84. package/browser/{chunk-2QG4JWAE.js → chunk-QCJ7PV4R.js} +4 -4
  85. package/browser/chunk-QHBYJZNS.js +1 -0
  86. package/browser/chunk-QQ5NVKJL.js +82 -0
  87. package/browser/{chunk-OXLXIWTF.js → chunk-QVRCMMJJ.js} +1 -1
  88. package/browser/chunk-QXK4GGIN.js +1 -0
  89. package/browser/{chunk-CZAQG6WF.js → chunk-QZDLOXOP.js} +1 -1
  90. package/browser/{chunk-DSIUUK4N.js → chunk-RCRLKTEV.js} +1 -1
  91. package/browser/{chunk-5G6GUMV7.js → chunk-RPNTNFVK.js} +1 -1
  92. package/browser/{chunk-PTGE5E6V.js → chunk-SF6TPOUV.js} +1 -1
  93. package/browser/{chunk-76T3TRG4.js → chunk-SP3U2IDW.js} +1 -1
  94. package/browser/{chunk-47I5SA66.js → chunk-SSRC3KCP.js} +1 -1
  95. package/browser/{chunk-VSFXSQWT.js → chunk-STC3XKNG.js} +1 -1
  96. package/browser/{chunk-V55A6VFC.js → chunk-T4BIKBND.js} +1 -1
  97. package/browser/{chunk-XOMO7AVU.js → chunk-TF3Q66XY.js} +1 -1
  98. package/browser/chunk-TIXKTMNP.js +1 -0
  99. package/browser/{chunk-ELFCO6CE.js → chunk-TNJUQ6BJ.js} +1 -1
  100. package/browser/{chunk-QILONTOR.js → chunk-TNXU6YBX.js} +1 -1
  101. package/browser/{chunk-ZDJDS43F.js → chunk-TTGCLMYO.js} +1 -1
  102. package/browser/{chunk-L4VLBO5X.js → chunk-UF66Z7HD.js} +1 -1
  103. package/browser/{chunk-ML4LS3JQ.js → chunk-ULVRQWWQ.js} +1 -1
  104. package/browser/{chunk-2W2V2NM7.js → chunk-UMUBYBGM.js} +1 -1
  105. package/browser/{chunk-EANTJIRK.js → chunk-UYJZPS2Q.js} +1 -1
  106. package/browser/{chunk-HNX747EE.js → chunk-V4VZQ5KY.js} +1 -1
  107. package/browser/chunk-V5A6ADTH.js +1 -0
  108. package/browser/{chunk-Z7BGVRZR.js → chunk-VE4MEWC3.js} +1 -1
  109. package/browser/{chunk-OSWSFGOJ.js → chunk-W446RFN2.js} +1 -1
  110. package/browser/{chunk-FLEDIXNB.js → chunk-W6TD44BK.js} +1 -1
  111. package/browser/chunk-W7TIYEEV.js +1 -0
  112. package/browser/{chunk-X3P7SVC6.js → chunk-WLIVNIHK.js} +1 -1
  113. package/browser/chunk-WNWQWQ7T.js +1 -0
  114. package/browser/{chunk-HHIBVND5.js → chunk-WO4BYI7W.js} +1 -1
  115. package/browser/{chunk-LK3EGJFT.js → chunk-X4OHSOA3.js} +1 -1
  116. package/browser/{chunk-4F7XKKDX.js → chunk-X4UVY3YK.js} +1 -1
  117. package/browser/{chunk-ZGUZW56H.js → chunk-XG6WOYOZ.js} +1 -1
  118. package/browser/{chunk-WG2QGIET.js → chunk-XI63Z4XV.js} +1 -1
  119. package/browser/chunk-XUOXQ56H.js +3 -0
  120. package/browser/{chunk-4PBQC5P6.js → chunk-Y3XAADIW.js} +1 -1
  121. package/browser/{chunk-CKB6AES2.js → chunk-Y5RVOKMC.js} +1 -1
  122. package/browser/{chunk-EQT4SGSU.js → chunk-Y6ACRZOB.js} +1 -1
  123. package/browser/{chunk-ACSIWGQV.js → chunk-Y6SHFOKM.js} +2 -2
  124. package/browser/chunk-YNKGRRRO.js +1 -0
  125. package/browser/{chunk-7EA7EXS5.js → chunk-YTSJ26UL.js} +1 -1
  126. package/browser/{chunk-GKTQL7S6.js → chunk-Z75HO5XT.js} +1 -1
  127. package/browser/{chunk-6FKZY7NZ.js → chunk-ZC5TUX6E.js} +1 -1
  128. package/browser/{chunk-77KTGZY6.js → chunk-ZZVXDXSB.js} +1 -1
  129. package/browser/index.html +3 -3
  130. package/browser/{main-E4MQYENS.js → main-HGYA62Q7.js} +2 -2
  131. package/browser/{styles-AWHBZGFK.css → styles-2TXD27TS.css} +1 -1
  132. package/package.json +1 -1
  133. package/browser/chunk-2CJDU4L3.js +0 -1
  134. package/browser/chunk-BSJU72R6.js +0 -3
  135. package/browser/chunk-ED4YSOUM.js +0 -56
  136. package/browser/chunk-GTRQV3VX.js +0 -1
  137. package/browser/chunk-H3V5PSCN.js +0 -218
  138. package/browser/chunk-HMRDZRDD.js +0 -12
  139. package/browser/chunk-IMEKDDRZ.js +0 -1
  140. package/browser/chunk-IXDUCCKR.js +0 -2
  141. package/browser/chunk-KEUS7V3K.js +0 -1
  142. package/browser/chunk-KP2OKS63.js +0 -1
  143. package/browser/chunk-KZU22HGO.js +0 -1
  144. package/browser/chunk-LMSUV4DF.js +0 -4
  145. package/browser/chunk-LRZRVZHZ.js +0 -24
  146. package/browser/chunk-MXD23J36.js +0 -1
  147. package/browser/chunk-NUGWNTFZ.js +0 -1
  148. package/browser/chunk-ODE5SZH6.js +0 -1
  149. package/browser/chunk-OY46AN7G.js +0 -1
  150. package/browser/chunk-P42NPBKN.js +0 -1
  151. package/browser/chunk-PJZKO6EJ.js +0 -1
  152. package/browser/chunk-RW7QZRJ2.js +0 -3
  153. package/browser/chunk-SZDICN4P.js +0 -1
  154. package/browser/chunk-TPPS3QIA.js +0 -1
  155. package/browser/chunk-UGECMXMN.js +0 -125
  156. package/browser/chunk-VGHP2OV6.js +0 -1
  157. package/browser/chunk-X3HEHRBU.js +0 -1
@@ -1 +1 @@
1
- import{a as re}from"./chunk-X3HEHRBU.js";import{a as ae,b as oe}from"./chunk-JTWFMMM2.js";import"./chunk-W2UCLTBY.js";import"./chunk-I5K3C5EY.js";import"./chunk-OLALZT3L.js";import"./chunk-DWWBB3GE.js";import"./chunk-6N4AU5UX.js";import"./chunk-TGAOY65D.js";import{e as ee}from"./chunk-H4SCBKWD.js";import{d as ie,e as ne}from"./chunk-V55A6VFC.js";import"./chunk-72KIMU7G.js";import"./chunk-3RK6DDJD.js";import"./chunk-L2EDFSBR.js";import"./chunk-DTFL44UO.js";import"./chunk-TEFNN3TY.js";import"./chunk-N3XWBPCL.js";import"./chunk-JKYTSC2D.js";import"./chunk-VQ7WKMGF.js";import{a as te}from"./chunk-T4MVFJGL.js";import"./chunk-HYW3PEDN.js";import"./chunk-TYLM2YM3.js";import{a as K}from"./chunk-MTMMU7GK.js";import"./chunk-7TZA4PUK.js";import"./chunk-C73IEBHE.js";import{a as J,h as Z,i as $}from"./chunk-H3V5PSCN.js";import"./chunk-LMSUV4DF.js";import"./chunk-OBNSNZON.js";import"./chunk-RBCKIP6D.js";import"./chunk-FD5YMPRL.js";import"./chunk-MV3QRRW6.js";import"./chunk-3LBZWLLT.js";import"./chunk-LZNTSIJX.js";import"./chunk-C6ARCDXZ.js";import{b as X}from"./chunk-P42NPBKN.js";import"./chunk-52EOLV7I.js";import"./chunk-5UL73W4S.js";import"./chunk-6ZOGADBZ.js";import"./chunk-FY5VLGQC.js";import"./chunk-CIBQBSM6.js";import{P as Y}from"./chunk-IX5URHI7.js";import"./chunk-ZT4RBJMM.js";import"./chunk-GIKR6Y2K.js";import{d as Q}from"./chunk-LPGMI3V2.js";import"./chunk-ZZ7LHETD.js";import"./chunk-567HXZXC.js";import"./chunk-I7VBCYOO.js";import"./chunk-CGESXTHC.js";import{a as z}from"./chunk-2FWFPV5I.js";import"./chunk-TLOTIYIE.js";import{F as U,h as j,o as G}from"./chunk-2RSBMS36.js";import"./chunk-2FXL2HDF.js";import"./chunk-246GVKUS.js";import"./chunk-AHCRE4GP.js";import"./chunk-WG2QGIET.js";import{$a as c,Ac as x,Db as A,Eb as E,Fc as O,Gb as V,Hb as W,Ib as n,Jb as a,Kb as S,Lb as D,Mb as v,Ob as T,Qb as y,Rb as s,Vd as H,Y as k,Yd as q,Zc as L,cd as N,db as h,ec as u,fa as I,jc as g,jd as R,kb as P,kc as _,lc as f,na as B,ob as M,qb as C,va as p,vb as l,wa as m,zc as b}from"./chunk-DZT5XHBQ.js";import"./chunk-7DCB7DB2.js";function pe(o,d){if(o&1){let t=T();n(0,"button",7),y("click",function(){p(t);let e=s();return m(e.onPrint())}),S(1,"i",8),n(2,"span"),u(3,"Print"),a()()}}function me(o,d){if(o&1){let t=T();n(0,"div",9)(1,"h6"),u(2,"Outlet"),a(),n(3,"outlet-selector",10),f("ngModelChange",function(e){p(t);let i=s();return _(i.pageData.Filter.EntityID,e)||(i.pageData.Filter.EntityID=e),m(e)}),a(),n(4,"h6"),u(5,"Sales Order Tag"),a(),n(6,"ng-select",11),f("ngModelChange",function(e){p(t);let i=s();return _(i.pageData.Filter.SalesOrderTagID,e)||(i.pageData.Filter.SalesOrderTagID=e),m(e)}),a(),n(7,"h6"),u(8,"From"),a(),n(9,"div",12)(10,"div",13)(11,"datepicker",14),f("dateChange",function(e){p(t);let i=s();return _(i.pageData.Filter.From,e)||(i.pageData.Filter.From=e),m(e)}),a()(),n(12,"div",13)(13,"app-timepicker",15),f("timeChange",function(e){p(t);let i=s();return _(i.pageData.Filter.StartTime,e)||(i.pageData.Filter.StartTime=e),m(e)}),a()()(),n(14,"h6"),u(15,"To"),a(),n(16,"div",12)(17,"div",13)(18,"datepicker",16),f("dateChange",function(e){p(t);let i=s();return _(i.pageData.Filter.To,e)||(i.pageData.Filter.To=e),m(e)}),a()(),n(19,"div",13)(20,"app-timepicker",15),f("timeChange",function(e){p(t);let i=s();return _(i.pageData.Filter.EndTime,e)||(i.pageData.Filter.EndTime=e),m(e)}),a()()()()}if(o&2){let t=s();c(3),l("accessType",2),g("ngModel",t.pageData.Filter.EntityID),c(3),l("items",t.pageData==null||t.pageData.Options==null?null:t.pageData.Options.SalesOrderTags),g("ngModel",t.pageData.Filter.SalesOrderTagID),c(5),l("isFloatingLabel",!1),g("date",t.pageData.Filter.From),l("hidelClearBtn",!0),c(2),g("time",t.pageData.Filter.StartTime),l("fullWidth",!0),c(5),l("isFloatingLabel",!1)("hidelClearBtn",!0),g("date",t.pageData.Filter.To),c(2),g("time",t.pageData.Filter.EndTime),l("fullWidth",!0)}}function ce(o,d){o&1&&(D(0),n(1,"div",20),u(2,"\xA0"),a(),v())}function se(o,d){if(o&1&&(S(0,"pos-receipt-a4",17),n(1,"div",18),S(2,"div",19),a(),C(3,ce,3,0,"ng-container",6)),o&2){let t=d.$implicit,r=d.$index,e=s().ngIf,i=s();l("data",t)("printTemplate",i.printTemplates==null?null:i.printTemplates.get(t.PrintTemplateID))("config",e.AppConfig)("workOrderMode",!1)("fullMode",!0)("stylesheet",e.StylesSheet),c(3),l("ngIf",r!==(e.Data==null?null:e.Data.length)-1)}}function de(o,d){if(o&1&&(D(0),V(1,se,4,7,null,null,E),v()),o&2){let t=d.ngIf;c(),W(t.Data)}}var le=class o extends K{constructor(t,r,e){super(t,r,"Tool/GetBulkPrintLoader","Tool/GetBulkPrintLoader",e,null,!0);this.httpService=r}dialogFilter=B(J);receipts$;printTemplates;preInitList(){this.pageData.Filter.From=new Date,this.pageData.Filter.To=new Date,this.pageData.Filter.StartTime="00:00",this.pageData.Filter.EndTime="23:59"}onFilter(){this.receipts$=this.httpService.post(Y.GetBulkPrintA4,this.pageData.Filter).pipe(I(t=>{t?.Data?.length==0?this.toastrService.info("There are no transaction",z.Info):this.generatePrintTemplate(t.PrintTemplates)}),k(1))}generatePrintTemplate(t=[]){this.printTemplates=new Map(t.map(r=>[r.ID,r]))}onNewPrint(){this.dialogFilter.openDialog()}onPrint(){window.setTimeout(function(){window.print()},500)}static \u0275fac=function(r){return new(r||o)(h(X),h(q),h(H))};static \u0275cmp=P({type:o,selectors:[["bulk-invoice-A4"]],features:[M],decls:13,vars:10,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","pageData","hideSearchBox","text","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-success",3,"click"],["filters",""],[1,"container-fluid","mt-5"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa","fa-print","me-3"],[1,"dialog-filter"],["placeholder","Choose an Outlet",3,"ngModelChange","accessType","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],[1,"d-flex","align-items-center","gap-5"],[1,"w-100"],["placeholder","From","appearance","outline","name","From",1,"me-4",3,"dateChange","isFloatingLabel","date","hidelClearBtn"],[3,"timeChange","time","fullWidth"],["placeholder","To","appearance","outline","name","To",1,"me-4",3,"dateChange","isFloatingLabel","hidelClearBtn","date"],[3,"data","printTemplate","config","workOrderMode","fullMode","stylesheet"],[1,"d-print-none","mt-8"],[2,"border-top-style","dotted","margin-bottom","5px"],[1,"page-break"]],template:function(r,e){if(r&1){let i=T();n(0,"mainpanel-cmp",1),f("textChange",function(w){return p(i),_(e.pageData.Filter.Number,w)||(e.pageData.Filter.Number=w),m(w)}),y("onSubmit",function(){return p(i),m(e.onFilter())}),n(1,"actions"),C(2,pe,4,0,"button",2),b(3,"async"),n(4,"button",3),y("click",function(){return p(i),m(e.onNewPrint())}),u(5,"New"),a()(),n(6,"div",4),C(7,me,21,14,"ng-template",null,0,O),a(),n(9,"content")(10,"div",5),C(11,de,3,0,"ng-container",6),b(12,"async"),a()()()}if(r&2){let i;l("pageData",e.menuData)("hideSearchBox",!0),g("text",e.pageData.Filter.Number),l("hideSearchDropdown",!0),c(2),A(((i=x(3,6,e.receipts$))==null||i.Data==null?null:i.Data.length)>0?2:-1),c(9),l("ngIf",x(12,8,e.printTemplates&&e.receipts$))}},dependencies:[R,L,N,oe,ae,$,Z,te,Q,ne,ie,ee,U,j,G,re],styles:["input.p-inputtext{height:46.63px;border-color:#0000001f!important} input.p-inputtext :hover{border-color:#0000001f!important}@media print{.page-break[_ngcontent-%COMP%]{page-break-after:always}}"]})};export{le as BulkInvoiceA4Component};
1
+ import{a as re}from"./chunk-IY5XCLBB.js";import{a as ae,b as oe}from"./chunk-ICQLVIY5.js";import"./chunk-W2UCLTBY.js";import"./chunk-I5K3C5EY.js";import"./chunk-OLALZT3L.js";import"./chunk-DWWBB3GE.js";import"./chunk-6N4AU5UX.js";import"./chunk-TGAOY65D.js";import{e as ee}from"./chunk-L3BBA7TR.js";import{d as ie,e as ne}from"./chunk-T4BIKBND.js";import"./chunk-CKBNUI2K.js";import"./chunk-3RK6DDJD.js";import"./chunk-L2EDFSBR.js";import"./chunk-O27UF6WP.js";import"./chunk-TEFNN3TY.js";import"./chunk-LJYCLPTA.js";import"./chunk-JKYTSC2D.js";import"./chunk-VQ7WKMGF.js";import{a as te}from"./chunk-5VKCMGYJ.js";import{a as K}from"./chunk-Q5WMF6RD.js";import"./chunk-7UBJFV53.js";import"./chunk-C73IEBHE.js";import{a as J,d as Z,e as $}from"./chunk-QQ5NVKJL.js";import"./chunk-CFQ7OFCQ.js";import"./chunk-TYLM2YM3.js";import"./chunk-5VRRYWVC.js";import"./chunk-OBNSNZON.js";import"./chunk-RBCKIP6D.js";import"./chunk-3LBZWLLT.js";import"./chunk-LZNTSIJX.js";import"./chunk-C6ARCDXZ.js";import"./chunk-FD5YMPRL.js";import"./chunk-MV3QRRW6.js";import{b as X}from"./chunk-TIXKTMNP.js";import"./chunk-52EOLV7I.js";import"./chunk-5UL73W4S.js";import"./chunk-6ZOGADBZ.js";import"./chunk-GWHR6QGI.js";import"./chunk-CIBQBSM6.js";import{P as Y}from"./chunk-Q3GWLSDE.js";import"./chunk-ZT4RBJMM.js";import"./chunk-GIKR6Y2K.js";import{d as Q}from"./chunk-LPGMI3V2.js";import"./chunk-ZZ7LHETD.js";import"./chunk-567HXZXC.js";import"./chunk-I7VBCYOO.js";import"./chunk-CGESXTHC.js";import{a as z}from"./chunk-2FWFPV5I.js";import"./chunk-TLOTIYIE.js";import{F as U,h as j,o as G}from"./chunk-2RSBMS36.js";import"./chunk-7YE4HOHN.js";import"./chunk-MPENEFJK.js";import"./chunk-AHCRE4GP.js";import"./chunk-XI63Z4XV.js";import{$a as c,Ac as x,Db as A,Eb as E,Fc as O,Gb as V,Hb as W,Ib as n,Jb as a,Kb as S,Lb as D,Mb as v,Ob as T,Qb as y,Rb as s,Vd as H,Y as k,Yd as q,Zc as L,cd as N,db as h,ec as u,fa as I,jc as g,jd as R,kb as P,kc as _,lc as f,na as B,ob as M,qb as C,va as p,vb as l,wa as m,zc as b}from"./chunk-DZT5XHBQ.js";import"./chunk-7DCB7DB2.js";function pe(o,d){if(o&1){let t=T();n(0,"button",7),y("click",function(){p(t);let e=s();return m(e.onPrint())}),S(1,"i",8),n(2,"span"),u(3,"Print"),a()()}}function me(o,d){if(o&1){let t=T();n(0,"div",9)(1,"h6"),u(2,"Outlet"),a(),n(3,"outlet-selector",10),f("ngModelChange",function(e){p(t);let i=s();return _(i.pageData.Filter.EntityID,e)||(i.pageData.Filter.EntityID=e),m(e)}),a(),n(4,"h6"),u(5,"Sales Order Tag"),a(),n(6,"ng-select",11),f("ngModelChange",function(e){p(t);let i=s();return _(i.pageData.Filter.SalesOrderTagID,e)||(i.pageData.Filter.SalesOrderTagID=e),m(e)}),a(),n(7,"h6"),u(8,"From"),a(),n(9,"div",12)(10,"div",13)(11,"datepicker",14),f("dateChange",function(e){p(t);let i=s();return _(i.pageData.Filter.From,e)||(i.pageData.Filter.From=e),m(e)}),a()(),n(12,"div",13)(13,"app-timepicker",15),f("timeChange",function(e){p(t);let i=s();return _(i.pageData.Filter.StartTime,e)||(i.pageData.Filter.StartTime=e),m(e)}),a()()(),n(14,"h6"),u(15,"To"),a(),n(16,"div",12)(17,"div",13)(18,"datepicker",16),f("dateChange",function(e){p(t);let i=s();return _(i.pageData.Filter.To,e)||(i.pageData.Filter.To=e),m(e)}),a()(),n(19,"div",13)(20,"app-timepicker",15),f("timeChange",function(e){p(t);let i=s();return _(i.pageData.Filter.EndTime,e)||(i.pageData.Filter.EndTime=e),m(e)}),a()()()()}if(o&2){let t=s();c(3),l("accessType",2),g("ngModel",t.pageData.Filter.EntityID),c(3),l("items",t.pageData==null||t.pageData.Options==null?null:t.pageData.Options.SalesOrderTags),g("ngModel",t.pageData.Filter.SalesOrderTagID),c(5),l("isFloatingLabel",!1),g("date",t.pageData.Filter.From),l("hidelClearBtn",!0),c(2),g("time",t.pageData.Filter.StartTime),l("fullWidth",!0),c(5),l("isFloatingLabel",!1)("hidelClearBtn",!0),g("date",t.pageData.Filter.To),c(2),g("time",t.pageData.Filter.EndTime),l("fullWidth",!0)}}function ce(o,d){o&1&&(D(0),n(1,"div",20),u(2,"\xA0"),a(),v())}function se(o,d){if(o&1&&(S(0,"pos-receipt-a4",17),n(1,"div",18),S(2,"div",19),a(),C(3,ce,3,0,"ng-container",6)),o&2){let t=d.$implicit,r=d.$index,e=s().ngIf,i=s();l("data",t)("printTemplate",i.printTemplates==null?null:i.printTemplates.get(t.PrintTemplateID))("config",e.AppConfig)("workOrderMode",!1)("fullMode",!0)("stylesheet",e.StylesSheet),c(3),l("ngIf",r!==(e.Data==null?null:e.Data.length)-1)}}function de(o,d){if(o&1&&(D(0),V(1,se,4,7,null,null,E),v()),o&2){let t=d.ngIf;c(),W(t.Data)}}var le=class o extends K{constructor(t,r,e){super(t,r,"Tool/GetBulkPrintLoader","Tool/GetBulkPrintLoader",e,null,!0);this.httpService=r}dialogFilter=B(J);receipts$;printTemplates;preInitList(){this.pageData.Filter.From=new Date,this.pageData.Filter.To=new Date,this.pageData.Filter.StartTime="00:00",this.pageData.Filter.EndTime="23:59"}onFilter(){this.receipts$=this.httpService.post(Y.GetBulkPrintA4,this.pageData.Filter).pipe(I(t=>{t?.Data?.length==0?this.toastrService.info("There are no transaction",z.Info):this.generatePrintTemplate(t.PrintTemplates)}),k(1))}generatePrintTemplate(t=[]){this.printTemplates=new Map(t.map(r=>[r.ID,r]))}onNewPrint(){this.dialogFilter.openDialog()}onPrint(){window.setTimeout(function(){window.print()},500)}static \u0275fac=function(r){return new(r||o)(h(X),h(q),h(H))};static \u0275cmp=P({type:o,selectors:[["bulk-invoice-A4"]],features:[M],decls:13,vars:10,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","pageData","hideSearchBox","text","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-success",3,"click"],["filters",""],[1,"container-fluid","mt-5"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa","fa-print","me-3"],[1,"dialog-filter"],["placeholder","Choose an Outlet",3,"ngModelChange","accessType","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],[1,"d-flex","align-items-center","gap-5"],[1,"w-100"],["placeholder","From","appearance","outline","name","From",1,"me-4",3,"dateChange","isFloatingLabel","date","hidelClearBtn"],[3,"timeChange","time","fullWidth"],["placeholder","To","appearance","outline","name","To",1,"me-4",3,"dateChange","isFloatingLabel","hidelClearBtn","date"],[3,"data","printTemplate","config","workOrderMode","fullMode","stylesheet"],[1,"d-print-none","mt-8"],[2,"border-top-style","dotted","margin-bottom","5px"],[1,"page-break"]],template:function(r,e){if(r&1){let i=T();n(0,"mainpanel-cmp",1),f("textChange",function(w){return p(i),_(e.pageData.Filter.Number,w)||(e.pageData.Filter.Number=w),m(w)}),y("onSubmit",function(){return p(i),m(e.onFilter())}),n(1,"actions"),C(2,pe,4,0,"button",2),b(3,"async"),n(4,"button",3),y("click",function(){return p(i),m(e.onNewPrint())}),u(5,"New"),a()(),n(6,"div",4),C(7,me,21,14,"ng-template",null,0,O),a(),n(9,"content")(10,"div",5),C(11,de,3,0,"ng-container",6),b(12,"async"),a()()()}if(r&2){let i;l("pageData",e.menuData)("hideSearchBox",!0),g("text",e.pageData.Filter.Number),l("hideSearchDropdown",!0),c(2),A(((i=x(3,6,e.receipts$))==null||i.Data==null?null:i.Data.length)>0?2:-1),c(9),l("ngIf",x(12,8,e.printTemplates&&e.receipts$))}},dependencies:[R,L,N,oe,ae,$,Z,te,Q,ne,ie,ee,U,j,G,re],styles:["input.p-inputtext{height:46.63px;border-color:#0000001f!important} input.p-inputtext :hover{border-color:#0000001f!important}@media print{.page-break[_ngcontent-%COMP%]{page-break-after:always}}"]})};export{le as BulkInvoiceA4Component};
@@ -1 +1 @@
1
- import{a as me}from"./chunk-SE7OFLAL.js";import{a as le}from"./chunk-4PBQC5P6.js";import{a as ie,c as ne,e as re,f as ae,g as oe}from"./chunk-76T3TRG4.js";import{a as Y}from"./chunk-L2EDFSBR.js";import{a as Z,c as ee}from"./chunk-LNVTHMH7.js";import{m as X}from"./chunk-FY5VLGQC.js";import{O as te}from"./chunk-IX5URHI7.js";import{d as T}from"./chunk-LPGMI3V2.js";import{a as J}from"./chunk-2FWFPV5I.js";import{F as z,c as G,h as U,o as q}from"./chunk-2RSBMS36.js";import{a as K}from"./chunk-AHCRE4GP.js";import{$a as m,Ac as F,Bc as Q,Fa as y,Fc as A,Ib as a,Jb as l,Kb as x,Lb as h,Mb as g,Ob as S,Qb as f,Rb as s,Vd as $,Y as D,Yc as H,Zc as W,cd as L,db as I,dc as C,ec as _,ed as j,fa as N,fc as k,gc as b,jc as v,jd as B,ka as O,kb as P,kc as E,lb as R,lc as w,qb as u,t as V,va as p,vb as c,wa as d,zc as M}from"./chunk-DZT5XHBQ.js";function de(i,t){i&1&&(h(0),a(1,"div",5)(2,"div",6),_(3,"Edit Serial is disabled during EDIT MODE"),l(),a(4,"div"),_(5," If you make a mistake, please delete the item and then add again "),l()(),g())}function _e(i,t){if(i&1){let e=S();a(0,"mat-chip-row",19),f("removed",function(){let r=p(e).$implicit,o=s(3);return d(o.onRemoveSerialChip(r))}),_(1),a(2,"button",20),x(3,"i",21),l()()}if(i&2){let e=t.$implicit;m(),b(" ",e," ")}}function ue(i,t){if(i&1){let e=S();h(0),a(1,"div",10)(2,"div",11)(3,"mat-form-field",12),f("keyup.enter",function(r){return p(e),d(r.stopPropagation())}),a(4,"mat-chip-grid",null,1),u(6,_e,4,1,"mat-chip-row",13),a(7,"input",14,2),f("matChipInputTokenEnd",function(r){p(e);let o=C(8),pe=s(2);return d(pe.addSerial(r,o))}),l()()()(),a(9,"div",15)(10,"button",16),f("click",function(){p(e);let r=C(8),o=s(2);return d(o.submitSerial(r))}),x(11,"i",17),a(12,"strong",18),_(13,"ADD"),l()()()(),g()}if(i&2){let e=C(5),n=s(2);m(6),c("ngForOf",n.serials),m(),c("matChipInputFor",e)("matChipInputSeparatorKeyCodes",n.separatorKeysCodes)}}function he(i,t){if(i&1){let e=S();a(0,"ng-select",22),M(1,"async"),w("ngModelChange",function(r){p(e);let o=s(2);return E(o.serials,r)||(o.serials=r),d(r)}),f("remove",function(r){p(e);let o=s(2);return d(o.onRemoveSerialFromOption(r.value))})("change",function(r){p(e);let o=s(2);return d(o.onSelectSerial(r))}),l()}if(i&2){let e=s(2);c("items",F(1,3,e.serials$)),v("ngModel",e.serials),c("multiple",!0)}}function ge(i,t){if(i&1&&(h(0),a(1,"div",7)(2,"div",8),u(3,ue,14,3,"ng-container",9)(4,he,2,5,"ng-template",null,0,A),l()(),g()),i&2){let e=C(5),n=s();m(3),c("ngIf",n.isReturn)("ngIfElse",e)}}function fe(i,t){i&1&&(h(0),x(1,"th",29),g())}function Se(i,t){i&1&&(h(0),a(1,"th",30),_(2,"Expiry Date"),l(),g())}function Ce(i,t){if(i&1){let e=S();h(0),a(1,"td",32)(2,"i",33),f("click",function(){p(e);let r=s().index,o=s(2);return d(o.onRemoveSerial(r))}),l()(),g()}}function xe(i,t){if(i&1&&(h(0),a(1,"td"),_(2),M(3,"date"),l(),g()),i&2){let e=s().$implicit;m(2),b(" ",e.ExpiryDate?Q(3,1,e.ExpiryDate,"dd MMM yyyy"):"-"," ")}}function ye(i,t){if(i&1){let e=S();a(0,"tr"),u(1,Ce,3,0,"ng-container",4),a(2,"td"),_(3),l(),u(4,xe,4,4,"ng-container",4),a(5,"td")(6,"input",31),w("ngModelChange",function(r){let o=p(e).$implicit;return E(o.Quantity,r)||(o.Quantity=r),d(r)}),f("change",function(){p(e);let r=s(2);return d(r.onChangeQty())}),l()()()}if(i&2){let e=t.$implicit,n=s(2);m(),c("ngIf",!n.disabled),m(2),k(e.Number),m(),c("ngIf",n.showExpiryDate),m(2),v("ngModel",e.Quantity),c("disabled",n.disabled)("decimalPlaces",0)}}function Ie(i,t){if(i&1&&(h(0),a(1,"div",23)(2,"div",8)(3,"table",24)(4,"thead",25)(5,"tr"),u(6,fe,2,0,"ng-container",4),a(7,"th",26),_(8,"Serial Number"),l(),u(9,Se,3,0,"ng-container",4),a(10,"th",27),_(11,"Quantity"),l()()(),a(12,"tbody"),u(13,ye,7,6,"tr",28),l()()()(),g()),i&2){let e=s();m(6),c("ngIf",!e.disabled),m(3),c("ngIf",e.showExpiryDate),m(4),c("ngForOf",e.selectedSerial)}}var se=class i{constructor(t,e){this.productService=t;this.toastr=e;this.cartItemChange=new y,this.serialsChange=new y}separatorKeysCodes=[13,188];_cartItem;isReturn=!1;disabled=!1;set cartItem(t){t&&(this._cartItem=t,this.initSelectedSerial(),t.Quantity<0?this.isReturn=!0:this.getSerialVariant())}get cartItem(){return this._cartItem}cartItemChange;entityId;serials;serialsChange;serials$;selectedSerial=[];showExpiryDate;ngOnDestroy(){this.serialsChange.emit([])}initSelectedSerial(){let t=this.cartItem.Serial;t&&t.length>0&&(this.selectedSerial=t,this.checkShowExpiryDate())}getSerialVariant(){let t=this.cartItem.VariantID,e;this.serials$=this.productService.getVariantSerial(this.entityId,t).pipe(V(n=>n.map(r=>(e=new me,e.Number=r.Number,e.Quantity=r.Quantity?r.Quantity:1,e.ExpiryDate=r.ExpiryDate,e))),N(()=>{this.isReturn||(this.serials=this.generateSerialCode(this.selectedSerial))}),D())}generateSerialCode(t=[]){return t.map(e=>e.Number)}onSelectSerial(t){let e=t.filter(n=>this.selectedSerial.findIndex(r=>r.Number==n.Number)==-1);e.length>0&&(e[0].Quantity=1,this.selectedSerial=[...this.selectedSerial,...e],this.updateCartItem())}onRemoveSerial(t){this.selectedSerial=this.selectedSerial.filter((e,n)=>n!==t),this.serials=this.generateSerialCode(this.selectedSerial),this.updateCartItem()}onRemoveSerialChip(t){this.serials=this.serials.filter(e=>e!==t),this.serialsChange.emit(this.serials)}onRemoveSerialFromOption(t){this.selectedSerial=this.selectedSerial.filter(e=>e.Number!==t.Number),this.serials=this.generateSerialCode(this.selectedSerial)}onChangeQty(){this.updateCartItem()}submitSerial(t){t.value.trim()&&(this.serials.push(t.value.trim()),t.value="");let e=this.generateSerialData();this.selectedSerial=[...this.selectedSerial,...e],this.serials=[],this.updateCartItem()}generateSerialData(){return this.serials.filter(e=>this.selectedSerial.findIndex(n=>n.Number==e)==-1).map(e=>({Number:e,Quantity:this.isReturn?-1:1,ExpiryDate:null}))}addSerial(t,e){let n=(t.value||"").trim();if(n)if(this.serials.find(r=>r==n)){e.value="",this.toastr.info("Serial already exists",J.Info);return}else this.serials.push(n),this.serialsChange.emit(this.serials);t.chipInput.clear()}updateCartItem(){this.cartItem.Serial=this.selectedSerial,this.checkShowExpiryDate(),this.calculateSerialQty(),this.cartItemChange.emit(this.cartItem)}calculateSerialQty(){let t=0;this.selectedSerial.forEach(e=>{t+=e.Quantity}),this.cartItem.Quantity=t}checkShowExpiryDate(){let t=0;this.selectedSerial.forEach(e=>{K.IsNotEmpty(e.ExpiryDate)&&(t+=1)}),this.showExpiryDate=t>0}static \u0275fac=function(e){return new(e||i)(I(le),I($))};static \u0275cmp=P({type:i,selectors:[["app-item-serial"]],inputs:{disabled:"disabled",cartItem:"cartItem",entityId:"entityId",serials:"serials"},outputs:{cartItemChange:"cartItemChange",serialsChange:"serialsChange"},standalone:!1,decls:4,vars:3,consts:[["NOT_RETURN",""],["chipGrid",""],["inputChip",""],[1,"my-8"],[4,"ngIf"],[1,"alert","alert-warning","text-center","my-5","py-3"],[1,"fw-bold"],[1,"row"],[1,"col-12"],[4,"ngIf","ngIfElse"],[1,"input-group","mb-3"],[1,"col"],["appearance","outline",1,"serial-chip",3,"keyup.enter"],[3,"removed",4,"ngFor","ngForOf"],["placeholder","E.g. Serial1 Serial2",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"col-auto"],["type","button",1,"btn","btn-outline-secondary","btn-sm","add-chip",3,"click"],["aria-hidden","true",1,"fa","fa-plus","me-1","fs-6"],[1,"headings-font-family","h6","font-weight-bold"],[3,"removed"],["matChipRemove",""],[1,"fa-solid","fa-circle-xmark"],["bindLabel","Number","appendTo","body","bindValue","Number","placeholder","Insert Number",1,"ng-select-multiple",3,"ngModelChange","remove","change","items","ngModel","multiple"],[1,"row","mt-8"],[1,"table","table-bordered"],[1,"thead-light"],[1,"border-end"],[1,"border-end","text-end",2,"width","60px"],[4,"ngFor","ngForOf"],[1,"border-end",2,"width","40px"],[1,"border-end",2,"width","100px"],["type","text","placeholder","Serial Quantity","autoNum","",1,"form-control","text-end",3,"ngModelChange","change","ngModel","disabled","decimalPlaces"],[1,"text-center"],["aria-hidden","true","title","Remove serial",1,"fa","fa-xmark","text-danger","cursor-pointer","fa-2x",3,"click"]],template:function(e,n){e&1&&(a(0,"div",3),u(1,de,6,0,"ng-container",4)(2,ge,6,2,"ng-container",4)(3,Ie,14,3,"ng-container",4),l()),e&2&&(m(),c("ngIf",n.disabled),m(),c("ngIf",!n.disabled),m(),c("ngIf",n.selectedSerial.length>0))},dependencies:()=>[H,W,T,G,U,q,ee,re,ae,ie,ne,X,L,j],styles:[".serial-chip[_ngcontent-%COMP%]{width:100%}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input, .serial-chip[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:40px!important}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing, .serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__notch, .serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__leading{border-color:#ccc!important}.serial-chip[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:8px;padding-bottom:8px}.add-chip[_ngcontent-%COMP%]{height:calc(100% - 18.4px);margin-left:1px;border-top-left-radius:0;border-bottom-left-radius:0}"]})},ce=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=R({type:i});static \u0275inj=O({imports:[B,te,T,z,Z,oe,Y]})};export{se as a,ce as b};
1
+ import{a as me}from"./chunk-SE7OFLAL.js";import{a as le}from"./chunk-Y3XAADIW.js";import{a as ie,c as ne,e as re,f as ae,g as oe}from"./chunk-SP3U2IDW.js";import{a as Y}from"./chunk-L2EDFSBR.js";import{a as Z,c as ee}from"./chunk-LNVTHMH7.js";import{m as X}from"./chunk-GWHR6QGI.js";import{O as te}from"./chunk-Q3GWLSDE.js";import{d as T}from"./chunk-LPGMI3V2.js";import{a as J}from"./chunk-2FWFPV5I.js";import{F as z,c as G,h as U,o as q}from"./chunk-2RSBMS36.js";import{a as K}from"./chunk-AHCRE4GP.js";import{$a as m,Ac as F,Bc as Q,Fa as y,Fc as A,Ib as a,Jb as l,Kb as x,Lb as h,Mb as g,Ob as S,Qb as f,Rb as s,Vd as $,Y as D,Yc as H,Zc as W,cd as L,db as I,dc as C,ec as _,ed as j,fa as N,fc as k,gc as b,jc as v,jd as B,ka as O,kb as P,kc as E,lb as R,lc as w,qb as u,t as V,va as p,vb as c,wa as d,zc as M}from"./chunk-DZT5XHBQ.js";function de(i,t){i&1&&(h(0),a(1,"div",5)(2,"div",6),_(3,"Edit Serial is disabled during EDIT MODE"),l(),a(4,"div"),_(5," If you make a mistake, please delete the item and then add again "),l()(),g())}function _e(i,t){if(i&1){let e=S();a(0,"mat-chip-row",19),f("removed",function(){let r=p(e).$implicit,o=s(3);return d(o.onRemoveSerialChip(r))}),_(1),a(2,"button",20),x(3,"i",21),l()()}if(i&2){let e=t.$implicit;m(),b(" ",e," ")}}function ue(i,t){if(i&1){let e=S();h(0),a(1,"div",10)(2,"div",11)(3,"mat-form-field",12),f("keyup.enter",function(r){return p(e),d(r.stopPropagation())}),a(4,"mat-chip-grid",null,1),u(6,_e,4,1,"mat-chip-row",13),a(7,"input",14,2),f("matChipInputTokenEnd",function(r){p(e);let o=C(8),pe=s(2);return d(pe.addSerial(r,o))}),l()()()(),a(9,"div",15)(10,"button",16),f("click",function(){p(e);let r=C(8),o=s(2);return d(o.submitSerial(r))}),x(11,"i",17),a(12,"strong",18),_(13,"ADD"),l()()()(),g()}if(i&2){let e=C(5),n=s(2);m(6),c("ngForOf",n.serials),m(),c("matChipInputFor",e)("matChipInputSeparatorKeyCodes",n.separatorKeysCodes)}}function he(i,t){if(i&1){let e=S();a(0,"ng-select",22),M(1,"async"),w("ngModelChange",function(r){p(e);let o=s(2);return E(o.serials,r)||(o.serials=r),d(r)}),f("remove",function(r){p(e);let o=s(2);return d(o.onRemoveSerialFromOption(r.value))})("change",function(r){p(e);let o=s(2);return d(o.onSelectSerial(r))}),l()}if(i&2){let e=s(2);c("items",F(1,3,e.serials$)),v("ngModel",e.serials),c("multiple",!0)}}function ge(i,t){if(i&1&&(h(0),a(1,"div",7)(2,"div",8),u(3,ue,14,3,"ng-container",9)(4,he,2,5,"ng-template",null,0,A),l()(),g()),i&2){let e=C(5),n=s();m(3),c("ngIf",n.isReturn)("ngIfElse",e)}}function fe(i,t){i&1&&(h(0),x(1,"th",29),g())}function Se(i,t){i&1&&(h(0),a(1,"th",30),_(2,"Expiry Date"),l(),g())}function Ce(i,t){if(i&1){let e=S();h(0),a(1,"td",32)(2,"i",33),f("click",function(){p(e);let r=s().index,o=s(2);return d(o.onRemoveSerial(r))}),l()(),g()}}function xe(i,t){if(i&1&&(h(0),a(1,"td"),_(2),M(3,"date"),l(),g()),i&2){let e=s().$implicit;m(2),b(" ",e.ExpiryDate?Q(3,1,e.ExpiryDate,"dd MMM yyyy"):"-"," ")}}function ye(i,t){if(i&1){let e=S();a(0,"tr"),u(1,Ce,3,0,"ng-container",4),a(2,"td"),_(3),l(),u(4,xe,4,4,"ng-container",4),a(5,"td")(6,"input",31),w("ngModelChange",function(r){let o=p(e).$implicit;return E(o.Quantity,r)||(o.Quantity=r),d(r)}),f("change",function(){p(e);let r=s(2);return d(r.onChangeQty())}),l()()()}if(i&2){let e=t.$implicit,n=s(2);m(),c("ngIf",!n.disabled),m(2),k(e.Number),m(),c("ngIf",n.showExpiryDate),m(2),v("ngModel",e.Quantity),c("disabled",n.disabled)("decimalPlaces",0)}}function Ie(i,t){if(i&1&&(h(0),a(1,"div",23)(2,"div",8)(3,"table",24)(4,"thead",25)(5,"tr"),u(6,fe,2,0,"ng-container",4),a(7,"th",26),_(8,"Serial Number"),l(),u(9,Se,3,0,"ng-container",4),a(10,"th",27),_(11,"Quantity"),l()()(),a(12,"tbody"),u(13,ye,7,6,"tr",28),l()()()(),g()),i&2){let e=s();m(6),c("ngIf",!e.disabled),m(3),c("ngIf",e.showExpiryDate),m(4),c("ngForOf",e.selectedSerial)}}var se=class i{constructor(t,e){this.productService=t;this.toastr=e;this.cartItemChange=new y,this.serialsChange=new y}separatorKeysCodes=[13,188];_cartItem;isReturn=!1;disabled=!1;set cartItem(t){t&&(this._cartItem=t,this.initSelectedSerial(),t.Quantity<0?this.isReturn=!0:this.getSerialVariant())}get cartItem(){return this._cartItem}cartItemChange;entityId;serials;serialsChange;serials$;selectedSerial=[];showExpiryDate;ngOnDestroy(){this.serialsChange.emit([])}initSelectedSerial(){let t=this.cartItem.Serial;t&&t.length>0&&(this.selectedSerial=t,this.checkShowExpiryDate())}getSerialVariant(){let t=this.cartItem.VariantID,e;this.serials$=this.productService.getVariantSerial(this.entityId,t).pipe(V(n=>n.map(r=>(e=new me,e.Number=r.Number,e.Quantity=r.Quantity?r.Quantity:1,e.ExpiryDate=r.ExpiryDate,e))),N(()=>{this.isReturn||(this.serials=this.generateSerialCode(this.selectedSerial))}),D())}generateSerialCode(t=[]){return t.map(e=>e.Number)}onSelectSerial(t){let e=t.filter(n=>this.selectedSerial.findIndex(r=>r.Number==n.Number)==-1);e.length>0&&(e[0].Quantity=1,this.selectedSerial=[...this.selectedSerial,...e],this.updateCartItem())}onRemoveSerial(t){this.selectedSerial=this.selectedSerial.filter((e,n)=>n!==t),this.serials=this.generateSerialCode(this.selectedSerial),this.updateCartItem()}onRemoveSerialChip(t){this.serials=this.serials.filter(e=>e!==t),this.serialsChange.emit(this.serials)}onRemoveSerialFromOption(t){this.selectedSerial=this.selectedSerial.filter(e=>e.Number!==t.Number),this.serials=this.generateSerialCode(this.selectedSerial)}onChangeQty(){this.updateCartItem()}submitSerial(t){t.value.trim()&&(this.serials.push(t.value.trim()),t.value="");let e=this.generateSerialData();this.selectedSerial=[...this.selectedSerial,...e],this.serials=[],this.updateCartItem()}generateSerialData(){return this.serials.filter(e=>this.selectedSerial.findIndex(n=>n.Number==e)==-1).map(e=>({Number:e,Quantity:this.isReturn?-1:1,ExpiryDate:null}))}addSerial(t,e){let n=(t.value||"").trim();if(n)if(this.serials.find(r=>r==n)){e.value="",this.toastr.info("Serial already exists",J.Info);return}else this.serials.push(n),this.serialsChange.emit(this.serials);t.chipInput.clear()}updateCartItem(){this.cartItem.Serial=this.selectedSerial,this.checkShowExpiryDate(),this.calculateSerialQty(),this.cartItemChange.emit(this.cartItem)}calculateSerialQty(){let t=0;this.selectedSerial.forEach(e=>{t+=e.Quantity}),this.cartItem.Quantity=t}checkShowExpiryDate(){let t=0;this.selectedSerial.forEach(e=>{K.IsNotEmpty(e.ExpiryDate)&&(t+=1)}),this.showExpiryDate=t>0}static \u0275fac=function(e){return new(e||i)(I(le),I($))};static \u0275cmp=P({type:i,selectors:[["app-item-serial"]],inputs:{disabled:"disabled",cartItem:"cartItem",entityId:"entityId",serials:"serials"},outputs:{cartItemChange:"cartItemChange",serialsChange:"serialsChange"},standalone:!1,decls:4,vars:3,consts:[["NOT_RETURN",""],["chipGrid",""],["inputChip",""],[1,"my-8"],[4,"ngIf"],[1,"alert","alert-warning","text-center","my-5","py-3"],[1,"fw-bold"],[1,"row"],[1,"col-12"],[4,"ngIf","ngIfElse"],[1,"input-group","mb-3"],[1,"col"],["appearance","outline",1,"serial-chip",3,"keyup.enter"],[3,"removed",4,"ngFor","ngForOf"],["placeholder","E.g. Serial1 Serial2",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"col-auto"],["type","button",1,"btn","btn-outline-secondary","btn-sm","add-chip",3,"click"],["aria-hidden","true",1,"fa","fa-plus","me-1","fs-6"],[1,"headings-font-family","h6","font-weight-bold"],[3,"removed"],["matChipRemove",""],[1,"fa-solid","fa-circle-xmark"],["bindLabel","Number","appendTo","body","bindValue","Number","placeholder","Insert Number",1,"ng-select-multiple",3,"ngModelChange","remove","change","items","ngModel","multiple"],[1,"row","mt-8"],[1,"table","table-bordered"],[1,"thead-light"],[1,"border-end"],[1,"border-end","text-end",2,"width","60px"],[4,"ngFor","ngForOf"],[1,"border-end",2,"width","40px"],[1,"border-end",2,"width","100px"],["type","text","placeholder","Serial Quantity","autoNum","",1,"form-control","text-end",3,"ngModelChange","change","ngModel","disabled","decimalPlaces"],[1,"text-center"],["aria-hidden","true","title","Remove serial",1,"fa","fa-xmark","text-danger","cursor-pointer","fa-2x",3,"click"]],template:function(e,n){e&1&&(a(0,"div",3),u(1,de,6,0,"ng-container",4)(2,ge,6,2,"ng-container",4)(3,Ie,14,3,"ng-container",4),l()),e&2&&(m(),c("ngIf",n.disabled),m(),c("ngIf",!n.disabled),m(),c("ngIf",n.selectedSerial.length>0))},dependencies:()=>[H,W,T,G,U,q,ee,re,ae,ie,ne,X,L,j],styles:[".serial-chip[_ngcontent-%COMP%]{width:100%}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input, .serial-chip[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:40px!important}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing, .serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__notch, .serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__leading{border-color:#ccc!important}.serial-chip[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:8px;padding-bottom:8px}.add-chip[_ngcontent-%COMP%]{height:calc(100% - 18.4px);margin-left:1px;border-top-left-radius:0;border-bottom-left-radius:0}"]})},ce=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=R({type:i});static \u0275inj=O({imports:[B,te,T,z,Z,oe,Y]})};export{se as a,ce as b};
@@ -0,0 +1 @@
1
+ import{w as r}from"./chunk-GWHR6QGI.js";import{O as a}from"./chunk-Q3GWLSDE.js";import{F as c}from"./chunk-2RSBMS36.js";import{jd as e,ka as t,lb as o}from"./chunk-DZT5XHBQ.js";var i=class n{static \u0275fac=function(g){return new(g||n)};static \u0275mod=o({type:n});static \u0275inj=t({imports:[e,r,c,a]})};export{i as a};