dealpos 26.32.2 → 26.32.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 (112) hide show
  1. package/browser/{chunk-ZLBZIPZ7.js → chunk-2BJHTYOM.js} +1 -1
  2. package/browser/{chunk-RDMRKBA5.js → chunk-2I3VDZ3J.js} +1 -1
  3. package/browser/{chunk-SLBYDQ64.js → chunk-32LFMSTP.js} +1 -1
  4. package/browser/{chunk-QKDU3KLV.js → chunk-3WMRLD5X.js} +1 -1
  5. package/browser/{chunk-BOJC2RT6.js → chunk-45RBMRNY.js} +1 -1
  6. package/browser/{chunk-C3IXXDMT.js → chunk-46YBZXOM.js} +2 -2
  7. package/browser/{chunk-XBTLK646.js → chunk-4PKHH4WR.js} +1 -1
  8. package/browser/{chunk-GRBR3KBO.js → chunk-4YTIQMCW.js} +1 -1
  9. package/browser/{chunk-QRYT6OX5.js → chunk-5AEWFMTV.js} +1 -1
  10. package/browser/{chunk-KYS3BFCS.js → chunk-5AT5TB6J.js} +1 -1
  11. package/browser/{chunk-PUSZEZ55.js → chunk-5M5LTH2H.js} +1 -1
  12. package/browser/{chunk-C5FYF2I3.js → chunk-67B3O2QN.js} +1 -1
  13. package/browser/{chunk-EO6CYPIK.js → chunk-6KUOA275.js} +1 -1
  14. package/browser/{chunk-HW6TZ2VH.js → chunk-6QPDZUNS.js} +1 -1
  15. package/browser/{chunk-GR54FOKA.js → chunk-6VANBJ44.js} +1 -1
  16. package/browser/{chunk-2GPUTIMR.js → chunk-A2EQQFAB.js} +2 -2
  17. package/browser/{chunk-PRJMGELN.js → chunk-AVBG6BPN.js} +2 -2
  18. package/browser/{chunk-H25OJ4EL.js → chunk-B2ZCTZLT.js} +1 -1
  19. package/browser/{chunk-LPDX6NSN.js → chunk-CBI52XLR.js} +1 -1
  20. package/browser/{chunk-RLQLVMBI.js → chunk-CHPHXTNJ.js} +1 -1
  21. package/browser/{chunk-CE7SFFXX.js → chunk-CLDMWRMC.js} +1 -1
  22. package/browser/{chunk-723XE6Q7.js → chunk-CME2KT5K.js} +1 -1
  23. package/browser/{chunk-JRB7SGCM.js → chunk-CREFIH5I.js} +2 -2
  24. package/browser/{chunk-FKFJC4HR.js → chunk-D3GPGHMK.js} +1 -1
  25. package/browser/{chunk-TAR63TTC.js → chunk-DIVZDHG6.js} +1 -1
  26. package/browser/{chunk-GK3ISJX4.js → chunk-DKKGKYNM.js} +1 -1
  27. package/browser/{chunk-L3OSGNHE.js → chunk-DQVAN4ZE.js} +1 -1
  28. package/browser/{chunk-XGFPQ7DM.js → chunk-DSX5NEYC.js} +1 -1
  29. package/browser/{chunk-AIBC3GLW.js → chunk-DVAI4VUF.js} +1 -1
  30. package/browser/{chunk-QREJ342Y.js → chunk-DX3SWLZE.js} +1 -1
  31. package/browser/{chunk-IDOQKYO4.js → chunk-E2V2G5YQ.js} +2 -2
  32. package/browser/{chunk-6E65LQIF.js → chunk-E6E53GKD.js} +1 -1
  33. package/browser/{chunk-YCODEF2R.js → chunk-E6T76G4D.js} +1 -1
  34. package/browser/{chunk-UAKCFNDX.js → chunk-ELRVPTSP.js} +1 -1
  35. package/browser/{chunk-JDVSUO5O.js → chunk-ELZABDPP.js} +1 -1
  36. package/browser/{chunk-WSQXCB4H.js → chunk-EM7QU2DQ.js} +1 -1
  37. package/browser/{chunk-IJ5W44WQ.js → chunk-EYKJP6P4.js} +1 -1
  38. package/browser/{chunk-GKK3AQ64.js → chunk-FQU22SOC.js} +2 -2
  39. package/browser/{chunk-TM4T5CEI.js → chunk-GCZQ6LTK.js} +1 -1
  40. package/browser/{chunk-HBLEM7PC.js → chunk-GELYEYPC.js} +1 -1
  41. package/browser/{chunk-2I4ET2T7.js → chunk-GKLVJBB3.js} +1 -1
  42. package/browser/{chunk-5JF5ZZIZ.js → chunk-GNSJXMIL.js} +1 -1
  43. package/browser/{chunk-Y5TY5HHJ.js → chunk-GSLCBHH2.js} +1 -1
  44. package/browser/{chunk-GWME6KNP.js → chunk-GUS4C7BE.js} +1 -1
  45. package/browser/{chunk-MRYVJODD.js → chunk-GXXBM7JM.js} +1 -1
  46. package/browser/{chunk-KTKNVTXS.js → chunk-GZLXJPSO.js} +1 -1
  47. package/browser/{chunk-WJJKSVBU.js → chunk-HGNMVFU2.js} +1 -1
  48. package/browser/{chunk-6UB4OZS7.js → chunk-HKV2VOS7.js} +1 -1
  49. package/browser/{chunk-75NPVX4H.js → chunk-HNVFF54N.js} +1 -1
  50. package/browser/{chunk-Y7PG3BXF.js → chunk-HX6SUOPD.js} +1 -1
  51. package/browser/{chunk-FED2YMP5.js → chunk-I5OSZ7ZF.js} +1 -1
  52. package/browser/{chunk-EQHJUU5C.js → chunk-IFL55HXC.js} +1 -1
  53. package/browser/{chunk-2YNG6VRE.js → chunk-IJ7WP43G.js} +1 -1
  54. package/browser/{chunk-EYS7UNNM.js → chunk-ISUYVEFN.js} +1 -1
  55. package/browser/{chunk-I473SQR2.js → chunk-IVT62MGU.js} +1 -1
  56. package/browser/{chunk-X7ZXYDJK.js → chunk-IXIEG2BB.js} +1 -1
  57. package/browser/{chunk-52XKUJCC.js → chunk-JIW22Q2L.js} +1 -1
  58. package/browser/{chunk-QZ4R4IAI.js → chunk-JLCQ5V4H.js} +1 -1
  59. package/browser/{chunk-N764VCKC.js → chunk-K5ZCBMXL.js} +1 -1
  60. package/browser/{chunk-IJUAPF2P.js → chunk-K6K43C7W.js} +1 -1
  61. package/browser/{chunk-DG2R7GZF.js → chunk-KFOMD6NG.js} +1 -1
  62. package/browser/{chunk-GZN4MQRS.js → chunk-L5SQNBQS.js} +1 -1
  63. package/browser/{chunk-YGG5IUPL.js → chunk-LCGGWNMH.js} +1 -1
  64. package/browser/{chunk-ORFRX3CJ.js → chunk-LN6BEM5X.js} +1 -1
  65. package/browser/{chunk-HU3JH4IV.js → chunk-LZLDGNHE.js} +1 -1
  66. package/browser/{chunk-NP4SHMZD.js → chunk-M4SYTSJA.js} +1 -1
  67. package/browser/{chunk-EBFY2M6D.js → chunk-M5XIO7CH.js} +1 -1
  68. package/browser/chunk-N3A2EW3C.js +149 -0
  69. package/browser/{chunk-N7ER4GTT.js → chunk-N3HK7R3B.js} +1 -1
  70. package/browser/{chunk-MOQAZGVB.js → chunk-ODYQPKTR.js} +1 -1
  71. package/browser/{chunk-53N4VUGX.js → chunk-OIZR2EK4.js} +1 -1
  72. package/browser/{chunk-XW7JSER6.js → chunk-OJTKRQM6.js} +1 -1
  73. package/browser/{chunk-LCZSBBLT.js → chunk-OQGUCLDO.js} +1 -1
  74. package/browser/{chunk-PWIMOOYH.js → chunk-ORWAIO4N.js} +1 -1
  75. package/browser/{chunk-AP4S4OV5.js → chunk-OT2RT3GG.js} +1 -1
  76. package/browser/{chunk-X2WNBUDY.js → chunk-PN2T7NKL.js} +1 -1
  77. package/browser/{chunk-P3JKPEVV.js → chunk-PSL7LFHY.js} +1 -1
  78. package/browser/{chunk-W4DXHXQA.js → chunk-PYHYTONY.js} +1 -1
  79. package/browser/{chunk-54HCUO4P.js → chunk-Q5BDIM7L.js} +1 -1
  80. package/browser/{chunk-AYXCHJUQ.js → chunk-Q7I75MOZ.js} +1 -1
  81. package/browser/{chunk-YTLHLGEG.js → chunk-QFYCSQO5.js} +1 -1
  82. package/browser/{chunk-HY2LCWEQ.js → chunk-QZ5LZ2XX.js} +1 -1
  83. package/browser/{chunk-63HRNRBM.js → chunk-RYCFWDVU.js} +2 -2
  84. package/browser/{chunk-VRIG2JWM.js → chunk-RYYLYNL2.js} +1 -1
  85. package/browser/{chunk-GJNBFSNQ.js → chunk-SA6FJC5M.js} +1 -1
  86. package/browser/{chunk-YNHIZH6Y.js → chunk-SEGSWWPK.js} +1 -1
  87. package/browser/{chunk-5R6RTNL3.js → chunk-SFGCSMHQ.js} +1 -1
  88. package/browser/{chunk-D4H77IGG.js → chunk-SIORZPSK.js} +1 -1
  89. package/browser/{chunk-QPPK3J6U.js → chunk-SNXPU577.js} +1 -1
  90. package/browser/{chunk-DCLD2V2C.js → chunk-SQBOICLX.js} +1 -1
  91. package/browser/{chunk-ACHNVRZM.js → chunk-SVXFGOAM.js} +1 -1
  92. package/browser/{chunk-LWRZTLPQ.js → chunk-T2LWN6E6.js} +1 -1
  93. package/browser/{chunk-AU2FU7GQ.js → chunk-TG5CIBV3.js} +1 -1
  94. package/browser/{chunk-SJEGWAIY.js → chunk-U72VGA34.js} +1 -1
  95. package/browser/{chunk-BSITDAOV.js → chunk-UCBYXW7G.js} +1 -1
  96. package/browser/{chunk-S7N4KEIB.js → chunk-UFXUHTDV.js} +1 -1
  97. package/browser/{chunk-IIFHX5QB.js → chunk-VGJKKYLD.js} +1 -1
  98. package/browser/{chunk-SBP6AGKJ.js → chunk-VO6DOOKY.js} +1 -1
  99. package/browser/{chunk-KRZEOB7Z.js → chunk-VVXQV5LK.js} +1 -1
  100. package/browser/{chunk-O3MFEKOF.js → chunk-W77FDKKK.js} +1 -1
  101. package/browser/{chunk-JTQXCL7A.js → chunk-WD6M6CPH.js} +1 -1
  102. package/browser/{chunk-TEXPKXZ5.js → chunk-WYOLKHMD.js} +1 -1
  103. package/browser/{chunk-Z7WH34QL.js → chunk-WYSCU5LK.js} +1 -1
  104. package/browser/{chunk-JZQ6DGKR.js → chunk-XWZL73CP.js} +1 -1
  105. package/browser/{chunk-62ID7525.js → chunk-Y7HLK446.js} +1 -1
  106. package/browser/{chunk-HFEKZBFF.js → chunk-YKWCSIE6.js} +1 -1
  107. package/browser/{chunk-3B5LBUZJ.js → chunk-Z5JF547D.js} +1 -1
  108. package/browser/{chunk-XK5HIA4Z.js → chunk-ZDB6Y3A2.js} +1 -1
  109. package/browser/index.html +2 -2
  110. package/browser/{main-M5IIKGYJ.js → main-7USFZQSG.js} +1 -1
  111. package/package.json +1 -1
  112. package/browser/chunk-HXR2KWU2.js +0 -149
@@ -1 +1 @@
1
- import{a as ne,b as ae}from"./chunk-SOWALOYP.js";import"./chunk-H3HSBSA5.js";import"./chunk-U2JF2UMO.js";import"./chunk-K33O52MA.js";import"./chunk-7FQSGPHL.js";import{a as ie}from"./chunk-4XJKVTWO.js";import{p as te}from"./chunk-5DDN7F2G.js";import"./chunk-5VZWXSVF.js";import"./chunk-CBVW2WXV.js";import"./chunk-AGI6OY3T.js";import"./chunk-CPOQEU6C.js";import"./chunk-6XNSSWFM.js";import"./chunk-G3RF7GBQ.js";import"./chunk-TDI2ZUL6.js";import"./chunk-AOXQWAVH.js";import"./chunk-CKHJNQTW.js";import{a as ee}from"./chunk-C5FYF2I3.js";import"./chunk-U34R74K4.js";import{a as Q}from"./chunk-5JF5ZZIZ.js";import"./chunk-ORJAUIF4.js";import"./chunk-52XKUJCC.js";import"./chunk-KTMZNXL5.js";import"./chunk-LZBHDTSD.js";import{a as K,g as Z,h as $}from"./chunk-HW6TZ2VH.js";import"./chunk-MF3BDWCO.js";import"./chunk-BF42EMHQ.js";import"./chunk-QOZCJI3Q.js";import"./chunk-WURU2W3C.js";import"./chunk-UEFG7JV5.js";import"./chunk-ZSK2V6PP.js";import"./chunk-2KEPYDRB.js";import"./chunk-EUIKMR24.js";import"./chunk-7VXCKSAE.js";import"./chunk-3GAEZ6NJ.js";import"./chunk-GZN4MQRS.js";import{a as Y}from"./chunk-EO6CYPIK.js";import"./chunk-JI7J6USO.js";import"./chunk-N7HFG3PM.js";import"./chunk-BSITDAOV.js";import"./chunk-DXN47M53.js";import"./chunk-HPCTP4FD.js";import"./chunk-KFWGALIF.js";import"./chunk-Z7UCI72M.js";import"./chunk-PPMQE2JW.js";import"./chunk-7OCVKGLK.js";import"./chunk-NF7H3LPQ.js";import"./chunk-XW7JSER6.js";import"./chunk-OKQYRKDJ.js";import"./chunk-XK5HIA4Z.js";import{d as X}from"./chunk-QHP5XZP6.js";import"./chunk-DU6XSMWH.js";import"./chunk-EYS7UNNM.js";import"./chunk-LCBHD53Y.js";import"./chunk-IKV23X6H.js";import"./chunk-C6TJ57ES.js";import"./chunk-RJDDPGUV.js";import"./chunk-VUC4E73K.js";import"./chunk-OTSIIVCA.js";import{a as k}from"./chunk-DUAKLYOO.js";import"./chunk-TJT2EEUH.js";import"./chunk-IX2NXO5F.js";import"./chunk-ZRB4EZI3.js";import{a as J}from"./chunk-KXQJYBG5.js";import"./chunk-3MLD6BQG.js";import"./chunk-LUUIBDJG.js";import"./chunk-R7VXUOCU.js";import"./chunk-NYN3E7NN.js";import{F as z,h as U,p as q}from"./chunk-4XQKDYF2.js";import"./chunk-XGFPQ7DM.js";import"./chunk-IJUAPF2P.js";import"./chunk-AGPZGAMV.js";import"./chunk-K74WZXBF.js";import"./chunk-PPTZHIIZ.js";import"./chunk-AP4S4OV5.js";import{n as H,q as G}from"./chunk-ETYXTCKV.js";import{$a as y,Ba as A,Bb as W,Cb as V,Db as l,Eb as a,Fb as r,Fc as w,Gb as b,Gc as F,Lc as N,Pb as T,Sb as v,Ua as c,Ub as p,X as I,da as B,db as O,e as x,hc as u,ib as E,jb as M,mc as C,na as P,nc as g,oc as _,od as j,ra as m,sa as s,vd as R,wb as D,yb as S,zb as L}from"./chunk-DUSKF5IQ.js";import"./chunk-NF7PG5F2.js";function oe(o,d){if(o&1){let t=T();a(0,"button",6),v("click",function(){m(t);let e=p();return s(e.onPrint())}),b(1,"i",7),a(2,"span"),u(3,"Print"),r()()}}function le(o,d){if(o&1){let t=T();a(0,"div",8)(1,"h6"),u(2,"Outlet"),r(),a(3,"outlet-selector",9),v("ngModelChange",function(e){m(t);let n=p();return s(n.onEntityIDChange(e))}),r(),a(4,"h6"),u(5,"Sales Order Tag"),r(),a(6,"ng-select",10),_("ngModelChange",function(e){m(t);let n=p();return g(n.pageData().Filter.SalesOrderTagID,e)||(n.pageData().Filter.SalesOrderTagID=e),s(e)}),r(),a(7,"h6"),u(8,"From"),r(),a(9,"div",11)(10,"div",12)(11,"datepicker",13),_("dateChange",function(e){m(t);let n=p();return g(n.pageData().Filter.From,e)||(n.pageData().Filter.From=e),s(e)}),r()(),a(12,"div",12)(13,"app-timepicker",14),_("timeChange",function(e){m(t);let n=p();return g(n.pageData().Filter.StartTime,e)||(n.pageData().Filter.StartTime=e),s(e)}),r()()(),a(14,"h6"),u(15,"To"),r(),a(16,"div",11)(17,"div",12)(18,"datepicker",15),_("dateChange",function(e){m(t);let n=p();return g(n.pageData().Filter.To,e)||(n.pageData().Filter.To=e),s(e)}),r()(),a(19,"div",12)(20,"app-timepicker",14),_("timeChange",function(e){m(t);let n=p();return g(n.pageData().Filter.EndTime,e)||(n.pageData().Filter.EndTime=e),s(e)}),r()()()()}if(o&2){let t,i=p();c(3),l("accessType",2)("ngModel",i.pageData().Filter.EntityID),c(3),l("items",(t=i.pageData())==null||t.Options==null?null:t.Options.SalesOrderTags),C("ngModel",i.pageData().Filter.SalesOrderTagID),c(5),l("isFloatingLabel",!1),C("date",i.pageData().Filter.From),l("hidelClearBtn",!0),c(2),C("time",i.pageData().Filter.StartTime),l("fullWidth",!0),c(5),l("isFloatingLabel",!1)("hidelClearBtn",!0),C("date",i.pageData().Filter.To),c(2),C("time",i.pageData().Filter.EndTime),l("fullWidth",!0)}}function pe(o,d){o&1&&(a(0,"div",19),u(1,"\xA0"),r())}function me(o,d){if(o&1&&(b(0,"pos-receipt-a4",16),a(1,"div",17),b(2,"div",18),r(),D(3,pe,2,0,"div",19)),o&2){let t=d.$implicit,i=d.$index,e=p(),n=p();l("data",t)("printTemplate",n.printTemplates==null?null:n.printTemplates.get(t.PrintTemplateID))("config",e.AppConfig)("workOrderMode",!1)("fullMode",!0)("stylesheet",e.StylesSheet),c(3),S(i!==(e.Data==null?null:e.Data.length)-1?3:-1)}}function se(o,d){o&1&&W(0,me,4,7,null,null,L),o&2&&V(d.Data)}var re=class o extends Q{constructor(t,i,e){super(t,i,"Tool/GetBulkPrintLoader","Tool/GetBulkPrintLoader",e,null,!0);this.httpService=i;this.initPrintListener()}httpService;dialogFilter=P(K);receipts$;printTemplates;invoiceIds=A([]);validatedSubject=new x(!1);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(k.GetBulkPrintA4,this.pageData().Filter).pipe(B(t=>{t?.Data?.length==0?this.toastrService.info("There are no transaction",J.Info):this.generatePrintTemplate(t.PrintTemplates),this.invoiceIds.set(t.Data.map(i=>i?.Invoice?.ID))}),I(1))}generatePrintTemplate(t=[]){this.printTemplates=new Map(t.map(i=>[i.ID,i]))}getOpenDialogOptions(){return{validated$:this.validatedSubject.asObservable()}}onEntityIDChange(t){this.pageData().Filter.EntityID=t,this.validatedSubject.next(!!t)}onNewPrint(){this.dialogFilter.openDialog({validated$:this.validatedSubject.asObservable()})}onPrint(){window.setTimeout(function(){window.print()},500)}initPrintListener(){window.addEventListener("afterprint",this.handleAfterPrint)}handleAfterPrint=()=>{this.invoiceIds()?.length>0&&this.httpService.post(k.UpdateLastPrintByListID,{ListID:this.invoiceIds()}).subscribe()};ngOnDestroy(){window.removeEventListener("afterprint",this.handleAfterPrint)}static \u0275fac=function(i){return new(i||o)(y(Y),y(G),y(H))};static \u0275cmp=O({type:o,selectors:[["bulk-invoice-A4"]],features:[E],decls:13,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","hideSearchBox","text","filter","isFilterOnDropdown"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-success",3,"click"],["filters",""],[1,"container-fluid","mt-5"],[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"],["customContainerClass","pos-bulk-invoice",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(i,e){if(i&1){let n=T();a(0,"mainpanel-cmp",1),_("textChange",function(f){return m(n),g(e.pageData().Filter.Number,f)||(e.pageData().Filter.Number=f),s(f)}),v("onSubmit",function(){return e.onFilter()}),_("filterChange",function(f){return m(n),g(e.pageData().Filter,f)||(e.pageData().Filter=f),s(f)}),a(1,"actions"),D(2,oe,4,0,"button",2),w(3,"async"),a(4,"button",3),v("click",function(){return e.onNewPrint()}),u(5,"New"),r()(),a(6,"div",4),M(7,le,21,14,"ng-template",null,0,N),r(),a(9,"content")(10,"div",5),D(11,se,2,0),w(12,"async"),r()()()}if(i&2){let n,h;l("pageData",e.menuData())("hideSearchBox",!0),C("text",e.pageData().Filter.Number)("filter",e.pageData().Filter),l("isFilterOnDropdown",!1),c(2),S(((n=F(3,7,e.receipts$))==null||n.Data==null?null:n.Data.length)>0?2:-1),c(9),S((h=F(12,9,e.printTemplates&&e.receipts$))?11:-1,h)}},dependencies:[R,ae,ne,$,Z,ee,X,te,z,U,q,ie,j],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}}"],changeDetection:0})};export{re as BulkInvoiceA4Component};
1
+ import{a as ne,b as ae}from"./chunk-SOWALOYP.js";import"./chunk-H3HSBSA5.js";import"./chunk-U2JF2UMO.js";import"./chunk-K33O52MA.js";import"./chunk-7FQSGPHL.js";import{a as ie}from"./chunk-4XJKVTWO.js";import{p as te}from"./chunk-5DDN7F2G.js";import"./chunk-5VZWXSVF.js";import"./chunk-CBVW2WXV.js";import"./chunk-AGI6OY3T.js";import"./chunk-CPOQEU6C.js";import"./chunk-6XNSSWFM.js";import"./chunk-G3RF7GBQ.js";import"./chunk-TDI2ZUL6.js";import"./chunk-AOXQWAVH.js";import"./chunk-CKHJNQTW.js";import{a as ee}from"./chunk-67B3O2QN.js";import"./chunk-U34R74K4.js";import{a as Q}from"./chunk-GNSJXMIL.js";import"./chunk-ORJAUIF4.js";import"./chunk-JIW22Q2L.js";import"./chunk-KTMZNXL5.js";import"./chunk-LZBHDTSD.js";import{a as K,g as Z,h as $}from"./chunk-6QPDZUNS.js";import"./chunk-MF3BDWCO.js";import"./chunk-BF42EMHQ.js";import"./chunk-QOZCJI3Q.js";import"./chunk-WURU2W3C.js";import"./chunk-UEFG7JV5.js";import"./chunk-ZSK2V6PP.js";import"./chunk-2KEPYDRB.js";import"./chunk-EUIKMR24.js";import"./chunk-7VXCKSAE.js";import"./chunk-3GAEZ6NJ.js";import"./chunk-L5SQNBQS.js";import{a as Y}from"./chunk-6KUOA275.js";import"./chunk-JI7J6USO.js";import"./chunk-N7HFG3PM.js";import"./chunk-UCBYXW7G.js";import"./chunk-DXN47M53.js";import"./chunk-HPCTP4FD.js";import"./chunk-KFWGALIF.js";import"./chunk-Z7UCI72M.js";import"./chunk-PPMQE2JW.js";import"./chunk-7OCVKGLK.js";import"./chunk-NF7H3LPQ.js";import"./chunk-OJTKRQM6.js";import"./chunk-OKQYRKDJ.js";import"./chunk-ZDB6Y3A2.js";import{d as X}from"./chunk-QHP5XZP6.js";import"./chunk-DU6XSMWH.js";import"./chunk-ISUYVEFN.js";import"./chunk-LCBHD53Y.js";import"./chunk-IKV23X6H.js";import"./chunk-C6TJ57ES.js";import"./chunk-RJDDPGUV.js";import"./chunk-VUC4E73K.js";import"./chunk-OTSIIVCA.js";import{a as k}from"./chunk-DUAKLYOO.js";import"./chunk-TJT2EEUH.js";import"./chunk-IX2NXO5F.js";import"./chunk-ZRB4EZI3.js";import{a as J}from"./chunk-KXQJYBG5.js";import"./chunk-3MLD6BQG.js";import"./chunk-LUUIBDJG.js";import"./chunk-R7VXUOCU.js";import"./chunk-NYN3E7NN.js";import{F as z,h as U,p as q}from"./chunk-4XQKDYF2.js";import"./chunk-DSX5NEYC.js";import"./chunk-K6K43C7W.js";import"./chunk-AGPZGAMV.js";import"./chunk-K74WZXBF.js";import"./chunk-PPTZHIIZ.js";import"./chunk-OT2RT3GG.js";import{n as H,q as G}from"./chunk-ETYXTCKV.js";import{$a as y,Ba as A,Bb as W,Cb as V,Db as l,Eb as a,Fb as r,Fc as w,Gb as b,Gc as F,Lc as N,Pb as T,Sb as v,Ua as c,Ub as p,X as I,da as B,db as O,e as x,hc as u,ib as E,jb as M,mc as C,na as P,nc as g,oc as _,od as j,ra as m,sa as s,vd as R,wb as D,yb as S,zb as L}from"./chunk-DUSKF5IQ.js";import"./chunk-NF7PG5F2.js";function oe(o,d){if(o&1){let t=T();a(0,"button",6),v("click",function(){m(t);let e=p();return s(e.onPrint())}),b(1,"i",7),a(2,"span"),u(3,"Print"),r()()}}function le(o,d){if(o&1){let t=T();a(0,"div",8)(1,"h6"),u(2,"Outlet"),r(),a(3,"outlet-selector",9),v("ngModelChange",function(e){m(t);let n=p();return s(n.onEntityIDChange(e))}),r(),a(4,"h6"),u(5,"Sales Order Tag"),r(),a(6,"ng-select",10),_("ngModelChange",function(e){m(t);let n=p();return g(n.pageData().Filter.SalesOrderTagID,e)||(n.pageData().Filter.SalesOrderTagID=e),s(e)}),r(),a(7,"h6"),u(8,"From"),r(),a(9,"div",11)(10,"div",12)(11,"datepicker",13),_("dateChange",function(e){m(t);let n=p();return g(n.pageData().Filter.From,e)||(n.pageData().Filter.From=e),s(e)}),r()(),a(12,"div",12)(13,"app-timepicker",14),_("timeChange",function(e){m(t);let n=p();return g(n.pageData().Filter.StartTime,e)||(n.pageData().Filter.StartTime=e),s(e)}),r()()(),a(14,"h6"),u(15,"To"),r(),a(16,"div",11)(17,"div",12)(18,"datepicker",15),_("dateChange",function(e){m(t);let n=p();return g(n.pageData().Filter.To,e)||(n.pageData().Filter.To=e),s(e)}),r()(),a(19,"div",12)(20,"app-timepicker",14),_("timeChange",function(e){m(t);let n=p();return g(n.pageData().Filter.EndTime,e)||(n.pageData().Filter.EndTime=e),s(e)}),r()()()()}if(o&2){let t,i=p();c(3),l("accessType",2)("ngModel",i.pageData().Filter.EntityID),c(3),l("items",(t=i.pageData())==null||t.Options==null?null:t.Options.SalesOrderTags),C("ngModel",i.pageData().Filter.SalesOrderTagID),c(5),l("isFloatingLabel",!1),C("date",i.pageData().Filter.From),l("hidelClearBtn",!0),c(2),C("time",i.pageData().Filter.StartTime),l("fullWidth",!0),c(5),l("isFloatingLabel",!1)("hidelClearBtn",!0),C("date",i.pageData().Filter.To),c(2),C("time",i.pageData().Filter.EndTime),l("fullWidth",!0)}}function pe(o,d){o&1&&(a(0,"div",19),u(1,"\xA0"),r())}function me(o,d){if(o&1&&(b(0,"pos-receipt-a4",16),a(1,"div",17),b(2,"div",18),r(),D(3,pe,2,0,"div",19)),o&2){let t=d.$implicit,i=d.$index,e=p(),n=p();l("data",t)("printTemplate",n.printTemplates==null?null:n.printTemplates.get(t.PrintTemplateID))("config",e.AppConfig)("workOrderMode",!1)("fullMode",!0)("stylesheet",e.StylesSheet),c(3),S(i!==(e.Data==null?null:e.Data.length)-1?3:-1)}}function se(o,d){o&1&&W(0,me,4,7,null,null,L),o&2&&V(d.Data)}var re=class o extends Q{constructor(t,i,e){super(t,i,"Tool/GetBulkPrintLoader","Tool/GetBulkPrintLoader",e,null,!0);this.httpService=i;this.initPrintListener()}httpService;dialogFilter=P(K);receipts$;printTemplates;invoiceIds=A([]);validatedSubject=new x(!1);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(k.GetBulkPrintA4,this.pageData().Filter).pipe(B(t=>{t?.Data?.length==0?this.toastrService.info("There are no transaction",J.Info):this.generatePrintTemplate(t.PrintTemplates),this.invoiceIds.set(t.Data.map(i=>i?.Invoice?.ID))}),I(1))}generatePrintTemplate(t=[]){this.printTemplates=new Map(t.map(i=>[i.ID,i]))}getOpenDialogOptions(){return{validated$:this.validatedSubject.asObservable()}}onEntityIDChange(t){this.pageData().Filter.EntityID=t,this.validatedSubject.next(!!t)}onNewPrint(){this.dialogFilter.openDialog({validated$:this.validatedSubject.asObservable()})}onPrint(){window.setTimeout(function(){window.print()},500)}initPrintListener(){window.addEventListener("afterprint",this.handleAfterPrint)}handleAfterPrint=()=>{this.invoiceIds()?.length>0&&this.httpService.post(k.UpdateLastPrintByListID,{ListID:this.invoiceIds()}).subscribe()};ngOnDestroy(){window.removeEventListener("afterprint",this.handleAfterPrint)}static \u0275fac=function(i){return new(i||o)(y(Y),y(G),y(H))};static \u0275cmp=O({type:o,selectors:[["bulk-invoice-A4"]],features:[E],decls:13,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","hideSearchBox","text","filter","isFilterOnDropdown"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-success",3,"click"],["filters",""],[1,"container-fluid","mt-5"],[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"],["customContainerClass","pos-bulk-invoice",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(i,e){if(i&1){let n=T();a(0,"mainpanel-cmp",1),_("textChange",function(f){return m(n),g(e.pageData().Filter.Number,f)||(e.pageData().Filter.Number=f),s(f)}),v("onSubmit",function(){return e.onFilter()}),_("filterChange",function(f){return m(n),g(e.pageData().Filter,f)||(e.pageData().Filter=f),s(f)}),a(1,"actions"),D(2,oe,4,0,"button",2),w(3,"async"),a(4,"button",3),v("click",function(){return e.onNewPrint()}),u(5,"New"),r()(),a(6,"div",4),M(7,le,21,14,"ng-template",null,0,N),r(),a(9,"content")(10,"div",5),D(11,se,2,0),w(12,"async"),r()()()}if(i&2){let n,h;l("pageData",e.menuData())("hideSearchBox",!0),C("text",e.pageData().Filter.Number)("filter",e.pageData().Filter),l("isFilterOnDropdown",!1),c(2),S(((n=F(3,7,e.receipts$))==null||n.Data==null?null:n.Data.length)>0?2:-1),c(9),S((h=F(12,9,e.printTemplates&&e.receipts$))?11:-1,h)}},dependencies:[R,ae,ne,$,Z,ee,X,te,z,U,q,ie,j],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}}"],changeDetection:0})};export{re as BulkInvoiceA4Component};
@@ -1 +1 @@
1
- import{a as C}from"./chunk-52XKUJCC.js";import{a as w}from"./chunk-HW6TZ2VH.js";import{a as A}from"./chunk-3GAEZ6NJ.js";import{a as x}from"./chunk-SLMXA7HD.js";import{a as I}from"./chunk-VUC4E73K.js";import{a as c}from"./chunk-KXQJYBG5.js";import{a as l}from"./chunk-PPTZHIIZ.js";import{Ba as P,da as L,na as f,r as F,x as S}from"./chunk-DUSKF5IQ.js";import{a as y}from"./chunk-NF7PG5F2.js";var d=class{enabledDragItem;constructor(){this.enabledDragItem=!1}drop(o,t){A(t.Data,o.previousIndex,o.currentIndex)}toggleEnabledDragItem(){}onSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.postListID(o,t.data.Data)}onPutSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.putListID(o,t.data.Data)}};var D=class{constructor(o){this.httpService=o}httpService;exportCSV(o,t,e,i){e.pageData.Filter.Export=!0,e.pageData.Filter.FormatType=0,i=i||"export.csv",this.httpService.post(`/api/${t}`,e.pageData.Filter).subscribe(r=>{o.convertToCSV(r,i),e.pageData.Filter.Export=!1})}convertToCSV(o,t=!1,e){let i=this.ExportDataFromUI2(t);o.convertToCSV(i,e)}ExportDataFromUI2(o=!1){let t=document.getElementById("tableGrid"),e=[];return l.IsNotEmpty(t)&&t.querySelectorAll("tr").forEach(r=>{let a=new Object,s=0;r.querySelectorAll("th, td").forEach(n=>{s++;let v=parseInt(n.getAttribute("colspan"));for(let u=1;u<v;u++)a["column"+s]="",s++;let p=n.innerText,h=p.toString().split("");if(o&&h[0]==="0"&&h.length>1){let u="'"+p.trim();a["column"+s]=u}else a["column"+s]=p.trim()}),e.push(a)}),e}};var b=class{listTotal;pageSize;show;constructor(){this.listTotal=0,this.pageSize=0,this.show=!1}changePaginationData(o){this.pageSize=o.pageData.Filter.RowCount,this.listTotal=o.data?.ListTotal??o.data?.Data?.total?.value,this.show=this.pageSize<=this.listTotal}changePage(o,t,e){t.Filter.PageNumber=o.pageIndex+1,e.getListData()}};var M=class extends x{constructor(t,e,i,r,a,s,g,n="post",v="post"){super(t);this.httpService=e;this.dataAPI=i;this.pageAPI=r;this.toastrService=a;this.route=s;this.initOpenDialog=g;this.dataMethod=n;this.loaderMethod=v;this.exportHandler=new D(e),r?(s&&(this.loaderPayload=y({ListIDs:this.reportFilterService?.initOutletFilter()},s.snapshot.queryParams)),this.preInitLoader(),S([this.menuData$,this.callApi("/api/"+this.pageAPI,this.loaderPayload,this.loaderMethod)]).pipe(F(([p,h])=>h)).pipe(I()).subscribe(p=>{this.pageData=p,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(),this.initOpenDialog?this.openDialogFilter.openDialog(this.getOpenDialogOptions()):this.getListData()})):(this.pageData.Filter.RowCount=20,this.pageData.Filter.PageNumber=1,this.preInitList(),S({menuData:this.menuData$,listData:this.getListData$()}).pipe(I()).subscribe())}httpService;dataAPI;pageAPI;toastrService;route;initOpenDialog;dataMethod;loaderMethod;openDialogFilter=f(w);reportFilterService=f(C);pageData={Filter:{},Options:{},Roles:{},Config:{}};data;pagination=new b;dragDrop=new d;exportHandler;comparation=0;loaderPayload={};reloadRowCount=P(!1);mapToKeyValueArray(t){return t?Object.keys(t).map(e=>({key:e,value:t[e]})):[]}callApi(t,e,i="post"){let r=t;if(i==="get"){let a=this.mapToKeyValueArray(e);return this.httpService.get(r,a)}return this.httpService[i](r,e)}preInitLoader(){}getOpenDialogOptions(){}preInitList(){}getListData(t){this.preGetList(),this.dataAPI&&this.callApi("/api/"+this.dataAPI,this.pageData.Filter,this.dataMethod).subscribe(e=>{e.PageSubTitle&&(this.menuData.SH=e.PageSubTitle),this.data=e,this.postInit(e),this.reloadRowCount.set(!0),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)})}getListData$(t){return this.preGetList(),this.callApi("/api/"+this.dataAPI,this.pageData.Filter,this.dataMethod).pipe(L(e=>{this.data=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=l.MinDate),this.pageData.Filter.To==null&&(this.pageData.Filter.To=l.MinDate)}preSearchFromPageOne(){}onPaginationChange(t){this.pagination.changePage(t,this.pageData,this)}onSelectAllData(t){this.data.Data=this.data.Data.map(e=>(e.selected=t,e))}getSelectedData(){let t=[];return this.data&&(t=this.data.Data.filter(e=>e.selected)),t}httpPostListID(t,e,i){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,i)}httpPutListID(t,e,i){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,i)}httpDeleteListID(t,e,i){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,i)}onSaveDragAndDrop(t){this.dragDrop.onSaveDragAndDrop(t,this)}onPutSaveDragAndDrop(t){this.dragDrop.onPutSaveDragAndDrop(t,this)}postListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.post(`/api/${t}`,r,1e6,!0).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.getListData()},a=>{let s=a.status+" "+a.statusText;this.toastrService.error(a.error.Message!=""?a.error.Message:"An unknown error has occured!",s,{enableHtml:!0})})}putListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.put(`/api/${t}`,r).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.delete(`/api/${t}`,{body:r}).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.getListData()})}postData(t,e){this.httpService.post("/API/"+t,e).subscribe(i=>{this.getListData(),this.toastrService.success(i.Message?i.Message:i,c.Success)})}compare(t,e,i){return(t<e?-1:1)*(i?1:-1)}exportCSV(t,e,i){this.exportHandler.exportCSV(t,e,this,i)}s2ab(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),r=0;r!=t.length;++r)i[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(i=>{e=decodeURI(e);let r=window.URL.createObjectURL(new Blob([this.s2ab(atob(i))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),a=document.createElement("a");a.href=r,a.setAttribute("download",e),document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(r),a.remove()})}convertToCSV(t,e=!1,i){let r=this.exportHandler.ExportDataFromUI2(e);t.convertToCSV(r,i)}OnCompare(t){let e=t?this.data[t]:this.data;if(e.length<1)return;let i=Object.assign({},this.pageData.Filter);i.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),i.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,i).subscribe(r=>{let a=t?r[t]:r;this.comparation=0,e.forEach(s=>{s.PrevIndex="-",s.CurrentIndex="-",s.Increase="-";let g=a.filter(n=>n.EntityID==s.EntityID);if(s.CurrentIndex=s.Rank,g.length>0){let n=g[0];s.PrevIndex=n.Rank,n.SalesNet?s.Increase=(s.SalesNet-n.SalesNet)/n.SalesNet*100:n.Sales&&(s.Increase=(s.Sales-n.Sales)/n.Sales*100),s.IsPositive=s.Increase>0,s.IsNegative=s.Increase<0,this.comparation+=s.Increase}})})}};export{M as a};
1
+ import{a as C}from"./chunk-JIW22Q2L.js";import{a as w}from"./chunk-6QPDZUNS.js";import{a as A}from"./chunk-3GAEZ6NJ.js";import{a as x}from"./chunk-SLMXA7HD.js";import{a as I}from"./chunk-VUC4E73K.js";import{a as c}from"./chunk-KXQJYBG5.js";import{a as l}from"./chunk-PPTZHIIZ.js";import{Ba as P,da as L,na as f,r as F,x as S}from"./chunk-DUSKF5IQ.js";import{a as y}from"./chunk-NF7PG5F2.js";var d=class{enabledDragItem;constructor(){this.enabledDragItem=!1}drop(o,t){A(t.Data,o.previousIndex,o.currentIndex)}toggleEnabledDragItem(){}onSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.postListID(o,t.data.Data)}onPutSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.putListID(o,t.data.Data)}};var D=class{constructor(o){this.httpService=o}httpService;exportCSV(o,t,e,i){e.pageData.Filter.Export=!0,e.pageData.Filter.FormatType=0,i=i||"export.csv",this.httpService.post(`/api/${t}`,e.pageData.Filter).subscribe(r=>{o.convertToCSV(r,i),e.pageData.Filter.Export=!1})}convertToCSV(o,t=!1,e){let i=this.ExportDataFromUI2(t);o.convertToCSV(i,e)}ExportDataFromUI2(o=!1){let t=document.getElementById("tableGrid"),e=[];return l.IsNotEmpty(t)&&t.querySelectorAll("tr").forEach(r=>{let a=new Object,s=0;r.querySelectorAll("th, td").forEach(n=>{s++;let v=parseInt(n.getAttribute("colspan"));for(let u=1;u<v;u++)a["column"+s]="",s++;let p=n.innerText,h=p.toString().split("");if(o&&h[0]==="0"&&h.length>1){let u="'"+p.trim();a["column"+s]=u}else a["column"+s]=p.trim()}),e.push(a)}),e}};var b=class{listTotal;pageSize;show;constructor(){this.listTotal=0,this.pageSize=0,this.show=!1}changePaginationData(o){this.pageSize=o.pageData.Filter.RowCount,this.listTotal=o.data?.ListTotal??o.data?.Data?.total?.value,this.show=this.pageSize<=this.listTotal}changePage(o,t,e){t.Filter.PageNumber=o.pageIndex+1,e.getListData()}};var M=class extends x{constructor(t,e,i,r,a,s,g,n="post",v="post"){super(t);this.httpService=e;this.dataAPI=i;this.pageAPI=r;this.toastrService=a;this.route=s;this.initOpenDialog=g;this.dataMethod=n;this.loaderMethod=v;this.exportHandler=new D(e),r?(s&&(this.loaderPayload=y({ListIDs:this.reportFilterService?.initOutletFilter()},s.snapshot.queryParams)),this.preInitLoader(),S([this.menuData$,this.callApi("/api/"+this.pageAPI,this.loaderPayload,this.loaderMethod)]).pipe(F(([p,h])=>h)).pipe(I()).subscribe(p=>{this.pageData=p,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(),this.initOpenDialog?this.openDialogFilter.openDialog(this.getOpenDialogOptions()):this.getListData()})):(this.pageData.Filter.RowCount=20,this.pageData.Filter.PageNumber=1,this.preInitList(),S({menuData:this.menuData$,listData:this.getListData$()}).pipe(I()).subscribe())}httpService;dataAPI;pageAPI;toastrService;route;initOpenDialog;dataMethod;loaderMethod;openDialogFilter=f(w);reportFilterService=f(C);pageData={Filter:{},Options:{},Roles:{},Config:{}};data;pagination=new b;dragDrop=new d;exportHandler;comparation=0;loaderPayload={};reloadRowCount=P(!1);mapToKeyValueArray(t){return t?Object.keys(t).map(e=>({key:e,value:t[e]})):[]}callApi(t,e,i="post"){let r=t;if(i==="get"){let a=this.mapToKeyValueArray(e);return this.httpService.get(r,a)}return this.httpService[i](r,e)}preInitLoader(){}getOpenDialogOptions(){}preInitList(){}getListData(t){this.preGetList(),this.dataAPI&&this.callApi("/api/"+this.dataAPI,this.pageData.Filter,this.dataMethod).subscribe(e=>{e.PageSubTitle&&(this.menuData.SH=e.PageSubTitle),this.data=e,this.postInit(e),this.reloadRowCount.set(!0),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)})}getListData$(t){return this.preGetList(),this.callApi("/api/"+this.dataAPI,this.pageData.Filter,this.dataMethod).pipe(L(e=>{this.data=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=l.MinDate),this.pageData.Filter.To==null&&(this.pageData.Filter.To=l.MinDate)}preSearchFromPageOne(){}onPaginationChange(t){this.pagination.changePage(t,this.pageData,this)}onSelectAllData(t){this.data.Data=this.data.Data.map(e=>(e.selected=t,e))}getSelectedData(){let t=[];return this.data&&(t=this.data.Data.filter(e=>e.selected)),t}httpPostListID(t,e,i){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,i)}httpPutListID(t,e,i){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,i)}httpDeleteListID(t,e,i){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,i)}onSaveDragAndDrop(t){this.dragDrop.onSaveDragAndDrop(t,this)}onPutSaveDragAndDrop(t){this.dragDrop.onPutSaveDragAndDrop(t,this)}postListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.post(`/api/${t}`,r,1e6,!0).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.getListData()},a=>{let s=a.status+" "+a.statusText;this.toastrService.error(a.error.Message!=""?a.error.Message:"An unknown error has occured!",s,{enableHtml:!0})})}putListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.put(`/api/${t}`,r).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.delete(`/api/${t}`,{body:r}).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.getListData()})}postData(t,e){this.httpService.post("/API/"+t,e).subscribe(i=>{this.getListData(),this.toastrService.success(i.Message?i.Message:i,c.Success)})}compare(t,e,i){return(t<e?-1:1)*(i?1:-1)}exportCSV(t,e,i){this.exportHandler.exportCSV(t,e,this,i)}s2ab(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),r=0;r!=t.length;++r)i[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(i=>{e=decodeURI(e);let r=window.URL.createObjectURL(new Blob([this.s2ab(atob(i))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),a=document.createElement("a");a.href=r,a.setAttribute("download",e),document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(r),a.remove()})}convertToCSV(t,e=!1,i){let r=this.exportHandler.ExportDataFromUI2(e);t.convertToCSV(r,i)}OnCompare(t){let e=t?this.data[t]:this.data;if(e.length<1)return;let i=Object.assign({},this.pageData.Filter);i.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),i.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,i).subscribe(r=>{let a=t?r[t]:r;this.comparation=0,e.forEach(s=>{s.PrevIndex="-",s.CurrentIndex="-",s.Increase="-";let g=a.filter(n=>n.EntityID==s.EntityID);if(s.CurrentIndex=s.Rank,g.length>0){let n=g[0];s.PrevIndex=n.Rank,n.SalesNet?s.Increase=(s.SalesNet-n.SalesNet)/n.SalesNet*100:n.Sales&&(s.Increase=(s.Sales-n.Sales)/n.Sales*100),s.IsPositive=s.Increase>0,s.IsNegative=s.Increase<0,this.comparation+=s.Increase}})})}};export{M as a};
@@ -1 +1 @@
1
- import{a as z}from"./chunk-AIBC3GLW.js";import{a as me}from"./chunk-COGUYACV.js";import{a as le}from"./chunk-UXF6X367.js";import{p as re}from"./chunk-5DDN7F2G.js";import"./chunk-5VZWXSVF.js";import"./chunk-CBVW2WXV.js";import"./chunk-AGI6OY3T.js";import"./chunk-CPOQEU6C.js";import"./chunk-6XNSSWFM.js";import"./chunk-G3RF7GBQ.js";import"./chunk-HA3KYO6D.js";import"./chunk-TDI2ZUL6.js";import{a as oe}from"./chunk-C5FYF2I3.js";import"./chunk-U34R74K4.js";import{a as J}from"./chunk-5JF5ZZIZ.js";import{b as X}from"./chunk-VBJRQLYD.js";import"./chunk-ORJAUIF4.js";import"./chunk-RDMRKBA5.js";import"./chunk-52XKUJCC.js";import"./chunk-KTMZNXL5.js";import"./chunk-LZBHDTSD.js";import{a as Z}from"./chunk-B5AGSH45.js";import{g as ne,h as ae}from"./chunk-HW6TZ2VH.js";import"./chunk-W6QJ4QXK.js";import"./chunk-MOXC7FRX.js";import"./chunk-QOZCJI3Q.js";import"./chunk-WURU2W3C.js";import"./chunk-UEFG7JV5.js";import"./chunk-ZSK2V6PP.js";import"./chunk-2KEPYDRB.js";import"./chunk-EUIKMR24.js";import"./chunk-7VXCKSAE.js";import"./chunk-3GAEZ6NJ.js";import"./chunk-MOV2FQBP.js";import"./chunk-W4DKC5G3.js";import"./chunk-SLMXA7HD.js";import"./chunk-GZN4MQRS.js";import{a as Y}from"./chunk-EO6CYPIK.js";import"./chunk-JI7J6USO.js";import"./chunk-N7HFG3PM.js";import{b as te,c as ie}from"./chunk-BSITDAOV.js";import"./chunk-DXN47M53.js";import"./chunk-HPCTP4FD.js";import"./chunk-KFWGALIF.js";import"./chunk-Z7UCI72M.js";import"./chunk-PPMQE2JW.js";import{N as ee,g as $}from"./chunk-7OCVKGLK.js";import"./chunk-NF7H3LPQ.js";import"./chunk-XW7JSER6.js";import"./chunk-OKQYRKDJ.js";import"./chunk-XK5HIA4Z.js";import{d as Q}from"./chunk-QHP5XZP6.js";import"./chunk-DU6XSMWH.js";import"./chunk-EYS7UNNM.js";import{c as K}from"./chunk-LCBHD53Y.js";import"./chunk-IKV23X6H.js";import"./chunk-C6TJ57ES.js";import"./chunk-RJDDPGUV.js";import"./chunk-VUC4E73K.js";import"./chunk-OTSIIVCA.js";import"./chunk-DUAKLYOO.js";import"./chunk-TJT2EEUH.js";import"./chunk-IX2NXO5F.js";import"./chunk-ZRB4EZI3.js";import"./chunk-KXQJYBG5.js";import"./chunk-3MLD6BQG.js";import"./chunk-LUUIBDJG.js";import"./chunk-R7VXUOCU.js";import"./chunk-NYN3E7NN.js";import{F as G,h as H,p as q}from"./chunk-4XQKDYF2.js";import"./chunk-XGFPQ7DM.js";import"./chunk-IJUAPF2P.js";import"./chunk-AGPZGAMV.js";import{b as U}from"./chunk-K74WZXBF.js";import"./chunk-PPTZHIIZ.js";import"./chunk-AP4S4OV5.js";import{q as j}from"./chunk-ETYXTCKV.js";import{$a as _,Ba as S,Bb as E,Cb as B,Db as s,Dc as L,Eb as i,Fb as n,Fc as f,Gb as M,Gc as y,Hc as x,Lc as R,Pb as v,Qd as A,Sb as w,Ua as m,Ub as p,db as P,hc as l,ib as W,ic as F,jb as T,jc as b,mc as u,nc as C,oc as D,qd as k,ra as d,sa as c,sd as N,wb as h,xc as O,yb as I,zb as V}from"./chunk-DUSKF5IQ.js";import"./chunk-NF7PG5F2.js";var de=()=>["/menu/Payment/Default/Write_Off_Item/Details"],ce=(r,g,t,a,e,o)=>({LabelID:r,OutletIds:g,SalesOrderTagID:t,CustomerID:a,From:e,To:o});function se(r,g){if(r&1){let t=v();i(0,"a",13),w("click",function(){d(t);let e=p(2);return c(e.openExportModal())}),M(1,"i",14),l(2," Export"),n()}}function ge(r,g){if(r&1){let t=v();i(0,"div",15)(1,"div",16)(2,"h6"),l(3,"Outlet"),n(),i(4,"outlet-selector",17),D("ngModelChange",function(e){d(t);let o=p(2);return C(o.pageData().Filter.ListOutletID,e)||(o.pageData().Filter.ListOutletID=e),c(e)}),n()(),i(5,"div",16)(6,"h6"),l(7,"Tag"),n(),i(8,"ng-select",18),D("ngModelChange",function(e){d(t);let o=p(2);return C(o.pageData().Filter.SalesTagID,e)||(o.pageData().Filter.SalesTagID=e),c(e)}),n()(),i(9,"div",16)(10,"h6"),l(11,"From Date"),n(),i(12,"datepicker",19),D("dateChange",function(e){d(t);let o=p(2);return C(o.pageData().Filter.From,e)||(o.pageData().Filter.From=e),c(e)}),w("dateChange",function(){d(t);let e=p(2);return c(e.changeDatepickerValidation())}),n()(),i(13,"div",16)(14,"h6"),l(15,"To Date"),n(),i(16,"datepicker",20),D("dateChange",function(e){d(t);let o=p(2);return C(o.pageData().Filter.To,e)||(o.pageData().Filter.To=e),c(e)}),n()(),i(17,"div",16)(18,"h6"),l(19,"Customer"),n(),i(20,"autocompleteV2",21),D("ngModelChange",function(e){d(t);let o=p(2);return C(o.pageData().Filter.CustomerID,e)||(o.pageData().Filter.CustomerID=e),c(e)}),n()(),i(21,"div",16)(22,"h6"),l(23,"Reason"),n(),i(24,"ng-select",22),D("ngModelChange",function(e){d(t);let o=p(2);return C(o.pageData().Filter.ReasonID,e)||(o.pageData().Filter.ReasonID=e),c(e)}),n()()()}if(r&2){let t=p(2);m(4),s("accessType",2),u("ngModel",t.pageData().Filter.ListOutletID),s("multiple",!0),m(4),u("ngModel",t.pageData().Filter.SalesTagID),s("items",t.pageData().Options.Types),m(4),s("hidelClearBtn",t.hideDateClearButton())("isFloatingLabel",!1),u("date",t.pageData().Filter.From),m(4),s("hidelClearBtn",t.hideDateClearButton())("isFloatingLabel",!1),u("date",t.pageData().Filter.To),s("minDateValidation",t.toMinDate()),m(4),u("ngModel",t.pageData().Filter.CustomerID),m(4),s("items",t.pageData().Options.ReasonOption),u("ngModel",t.pageData().Filter.ReasonID)}}function fe(r,g){r&1&&(i(0,"tr")(1,"td",23),M(2,"app-empty-state"),n()())}function _e(r,g){if(r&1&&(i(0,"tr")(1,"th",24),l(2),n(),i(3,"td",12)(4,"a",25),f(5,"date"),f(6,"date"),l(7),f(8,"number"),n()(),i(9,"td",12),l(10),f(11,"number"),n()()),r&2){let t,a=g.$implicit,e=p(3);m(2),F(a.Name),m(2),s("routerLink",O(15,de))("queryParams",L(16,ce,a.ID,((t=e.pageData().Filter.ListOutletID)==null?null:t.join(","))??"",e.pageData().Filter.SalesTagID??"",e.pageData().Filter.CustomerID??"",x(5,5,e.pageData().Filter.From,"ddMMyyyy"),x(6,8,e.pageData().Filter.To,"ddMMyyyy"))),m(3),F(y(8,11,a.Count)),m(3),F(y(11,13,a.Amount))}}function ue(r,g){if(r&1&&E(0,_e,12,23,"tr",null,V),r&2){let t=p(2);B(t.data().Data)}}function Ce(r,g){if(r&1){let t=v();i(0,"mainpanel-cmp",2),w("onSubmit",function(){d(t);let e=p();return c(e.searchFromPageOne())}),D("filterChange",function(e){d(t);let o=p();return C(o.pageData().Filter,e)||(o.pageData().Filter=e),c(e)}),i(1,"actions"),h(2,se,3,0,"a",3),n(),i(3,"filters"),T(4,ge,25,15,"ng-template",null,0,R),n(),i(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),l(13,"Name"),n(),i(14,"th",9),l(15,"Count"),n(),i(16,"th",9),l(17," Amount "),n()()(),i(18,"tbody"),h(19,fe,3,0,"tr")(20,ue,2,0),n(),i(21,"tfoot",10)(22,"tr",11)(23,"td"),l(24,"Total"),n(),i(25,"td",12),l(26),f(27,"sum"),f(28,"number"),n(),i(29,"td",12),l(30),f(31,"sum"),f(32,"number"),n()()()()()()()()}if(r&2){let t=p();s("pageData",t.menuData())("hideSearchBox",!0)("isFilterOnDropdown",!1),u("filter",t.pageData().Filter),m(2),I(t.roleService.global.Export?2:-1),m(17),I(t.data().Data.length?20:19),m(7),b(" ",y(28,11,x(27,8,t.data().Data,"Count"))," "),m(4),b(" ",y(32,16,x(31,13,t.data().Data,"Amount"))," ")}}var pe=class r extends J{constructor(t,a,e,o,De,ye,xe){super(t,a,"Payment/InvoiceWriteOffItemReport","PaymentLoader/InvoiceWriteOffItemReport");this.csvConverter=e;this.dataDaysRangeService=o;this.roleService=De;this.matDialog=ye;this.paymentDateService=xe}csvConverter;dataDaysRangeService;roleService;matDialog;paymentDateService;toMinDate=S(null);fromMinDate=S(new Date);hideDateClearButton=S(!1);changeDatepickerValidation(t=!1){this.hideDateClearButton.update(()=>this.dataDaysRangeService.isHideClearDateBtn);let a=this.pageData().Filter.From,e=this.dataDaysRangeService.getDateValidation(a);this.toMinDate.update(()=>e.toMinDate),this.fromMinDate.update(()=>e.fromMinDate)}openExportModal(){this.matDialog.open(X,{data:{title:"Write Off Item Report",exportTypes:[{ID:"PaymentExport/InvoiceWriteOffItemReport",Value:"Default",FileName:"Write Off Item Report"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(a){return new(a||r)(_(Y),_(j),_(Z),_(me),_(U),_(K),_(z))};static \u0275cmp=P({type:r,selectors:[["POS-payment-writeoff-item"]],features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],["filterDialogWidth","600px",3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],["filterDialogWidth","600px",3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col"],["scope","col",1,"text-end",2,"width","150px"],[1,"table-footer"],[1,"fw-semibold"],[1,"text-end"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter","grid-filter"],[1,"filter-item"],["placeholder","Choose an Outlet",1,"w-100",3,"ngModelChange","accessType","ngModel","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Tag",3,"ngModelChange","ngModel","items"],["placeholder","From","appearance","outline","name","From",3,"dateChange","hidelClearBtn","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","hidelClearBtn","isFloatingLabel","date","minDateValidation"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose a reason","bindLabel","Name","bindValue","ID",3,"ngModelChange","items","ngModel"],["colspan","3",1,""],[1,"fw-normal"],[1,"link-primary","cursor-pointer",3,"routerLink","queryParams"]],template:function(a,e){a&1&&h(0,Ce,33,18,"mainpanel-cmp",1),a&2&&I(e.data()?0:-1)},dependencies:[re,G,H,q,ae,ne,Q,oe,ee,ie,te,le,A,k,N,$],encapsulation:2,changeDetection:0})};export{pe as PaymentWriteoffItemComponent};
1
+ import{a as z}from"./chunk-DVAI4VUF.js";import{a as me}from"./chunk-COGUYACV.js";import{a as le}from"./chunk-UXF6X367.js";import{p as re}from"./chunk-5DDN7F2G.js";import"./chunk-5VZWXSVF.js";import"./chunk-CBVW2WXV.js";import"./chunk-AGI6OY3T.js";import"./chunk-CPOQEU6C.js";import"./chunk-6XNSSWFM.js";import"./chunk-G3RF7GBQ.js";import"./chunk-HA3KYO6D.js";import"./chunk-TDI2ZUL6.js";import{a as oe}from"./chunk-67B3O2QN.js";import"./chunk-U34R74K4.js";import{a as J}from"./chunk-GNSJXMIL.js";import{b as X}from"./chunk-VBJRQLYD.js";import"./chunk-ORJAUIF4.js";import"./chunk-2I3VDZ3J.js";import"./chunk-JIW22Q2L.js";import"./chunk-KTMZNXL5.js";import"./chunk-LZBHDTSD.js";import{a as Z}from"./chunk-B5AGSH45.js";import{g as ne,h as ae}from"./chunk-6QPDZUNS.js";import"./chunk-W6QJ4QXK.js";import"./chunk-MOXC7FRX.js";import"./chunk-QOZCJI3Q.js";import"./chunk-WURU2W3C.js";import"./chunk-UEFG7JV5.js";import"./chunk-ZSK2V6PP.js";import"./chunk-2KEPYDRB.js";import"./chunk-EUIKMR24.js";import"./chunk-7VXCKSAE.js";import"./chunk-3GAEZ6NJ.js";import"./chunk-MOV2FQBP.js";import"./chunk-W4DKC5G3.js";import"./chunk-SLMXA7HD.js";import"./chunk-L5SQNBQS.js";import{a as Y}from"./chunk-6KUOA275.js";import"./chunk-JI7J6USO.js";import"./chunk-N7HFG3PM.js";import{b as te,c as ie}from"./chunk-UCBYXW7G.js";import"./chunk-DXN47M53.js";import"./chunk-HPCTP4FD.js";import"./chunk-KFWGALIF.js";import"./chunk-Z7UCI72M.js";import"./chunk-PPMQE2JW.js";import{N as ee,g as $}from"./chunk-7OCVKGLK.js";import"./chunk-NF7H3LPQ.js";import"./chunk-OJTKRQM6.js";import"./chunk-OKQYRKDJ.js";import"./chunk-ZDB6Y3A2.js";import{d as Q}from"./chunk-QHP5XZP6.js";import"./chunk-DU6XSMWH.js";import"./chunk-ISUYVEFN.js";import{c as K}from"./chunk-LCBHD53Y.js";import"./chunk-IKV23X6H.js";import"./chunk-C6TJ57ES.js";import"./chunk-RJDDPGUV.js";import"./chunk-VUC4E73K.js";import"./chunk-OTSIIVCA.js";import"./chunk-DUAKLYOO.js";import"./chunk-TJT2EEUH.js";import"./chunk-IX2NXO5F.js";import"./chunk-ZRB4EZI3.js";import"./chunk-KXQJYBG5.js";import"./chunk-3MLD6BQG.js";import"./chunk-LUUIBDJG.js";import"./chunk-R7VXUOCU.js";import"./chunk-NYN3E7NN.js";import{F as G,h as H,p as q}from"./chunk-4XQKDYF2.js";import"./chunk-DSX5NEYC.js";import"./chunk-K6K43C7W.js";import"./chunk-AGPZGAMV.js";import{b as U}from"./chunk-K74WZXBF.js";import"./chunk-PPTZHIIZ.js";import"./chunk-OT2RT3GG.js";import{q as j}from"./chunk-ETYXTCKV.js";import{$a as _,Ba as S,Bb as E,Cb as B,Db as s,Dc as L,Eb as i,Fb as n,Fc as f,Gb as M,Gc as y,Hc as x,Lc as R,Pb as v,Qd as A,Sb as w,Ua as m,Ub as p,db as P,hc as l,ib as W,ic as F,jb as T,jc as b,mc as u,nc as C,oc as D,qd as k,ra as d,sa as c,sd as N,wb as h,xc as O,yb as I,zb as V}from"./chunk-DUSKF5IQ.js";import"./chunk-NF7PG5F2.js";var de=()=>["/menu/Payment/Default/Write_Off_Item/Details"],ce=(r,g,t,a,e,o)=>({LabelID:r,OutletIds:g,SalesOrderTagID:t,CustomerID:a,From:e,To:o});function se(r,g){if(r&1){let t=v();i(0,"a",13),w("click",function(){d(t);let e=p(2);return c(e.openExportModal())}),M(1,"i",14),l(2," Export"),n()}}function ge(r,g){if(r&1){let t=v();i(0,"div",15)(1,"div",16)(2,"h6"),l(3,"Outlet"),n(),i(4,"outlet-selector",17),D("ngModelChange",function(e){d(t);let o=p(2);return C(o.pageData().Filter.ListOutletID,e)||(o.pageData().Filter.ListOutletID=e),c(e)}),n()(),i(5,"div",16)(6,"h6"),l(7,"Tag"),n(),i(8,"ng-select",18),D("ngModelChange",function(e){d(t);let o=p(2);return C(o.pageData().Filter.SalesTagID,e)||(o.pageData().Filter.SalesTagID=e),c(e)}),n()(),i(9,"div",16)(10,"h6"),l(11,"From Date"),n(),i(12,"datepicker",19),D("dateChange",function(e){d(t);let o=p(2);return C(o.pageData().Filter.From,e)||(o.pageData().Filter.From=e),c(e)}),w("dateChange",function(){d(t);let e=p(2);return c(e.changeDatepickerValidation())}),n()(),i(13,"div",16)(14,"h6"),l(15,"To Date"),n(),i(16,"datepicker",20),D("dateChange",function(e){d(t);let o=p(2);return C(o.pageData().Filter.To,e)||(o.pageData().Filter.To=e),c(e)}),n()(),i(17,"div",16)(18,"h6"),l(19,"Customer"),n(),i(20,"autocompleteV2",21),D("ngModelChange",function(e){d(t);let o=p(2);return C(o.pageData().Filter.CustomerID,e)||(o.pageData().Filter.CustomerID=e),c(e)}),n()(),i(21,"div",16)(22,"h6"),l(23,"Reason"),n(),i(24,"ng-select",22),D("ngModelChange",function(e){d(t);let o=p(2);return C(o.pageData().Filter.ReasonID,e)||(o.pageData().Filter.ReasonID=e),c(e)}),n()()()}if(r&2){let t=p(2);m(4),s("accessType",2),u("ngModel",t.pageData().Filter.ListOutletID),s("multiple",!0),m(4),u("ngModel",t.pageData().Filter.SalesTagID),s("items",t.pageData().Options.Types),m(4),s("hidelClearBtn",t.hideDateClearButton())("isFloatingLabel",!1),u("date",t.pageData().Filter.From),m(4),s("hidelClearBtn",t.hideDateClearButton())("isFloatingLabel",!1),u("date",t.pageData().Filter.To),s("minDateValidation",t.toMinDate()),m(4),u("ngModel",t.pageData().Filter.CustomerID),m(4),s("items",t.pageData().Options.ReasonOption),u("ngModel",t.pageData().Filter.ReasonID)}}function fe(r,g){r&1&&(i(0,"tr")(1,"td",23),M(2,"app-empty-state"),n()())}function _e(r,g){if(r&1&&(i(0,"tr")(1,"th",24),l(2),n(),i(3,"td",12)(4,"a",25),f(5,"date"),f(6,"date"),l(7),f(8,"number"),n()(),i(9,"td",12),l(10),f(11,"number"),n()()),r&2){let t,a=g.$implicit,e=p(3);m(2),F(a.Name),m(2),s("routerLink",O(15,de))("queryParams",L(16,ce,a.ID,((t=e.pageData().Filter.ListOutletID)==null?null:t.join(","))??"",e.pageData().Filter.SalesTagID??"",e.pageData().Filter.CustomerID??"",x(5,5,e.pageData().Filter.From,"ddMMyyyy"),x(6,8,e.pageData().Filter.To,"ddMMyyyy"))),m(3),F(y(8,11,a.Count)),m(3),F(y(11,13,a.Amount))}}function ue(r,g){if(r&1&&E(0,_e,12,23,"tr",null,V),r&2){let t=p(2);B(t.data().Data)}}function Ce(r,g){if(r&1){let t=v();i(0,"mainpanel-cmp",2),w("onSubmit",function(){d(t);let e=p();return c(e.searchFromPageOne())}),D("filterChange",function(e){d(t);let o=p();return C(o.pageData().Filter,e)||(o.pageData().Filter=e),c(e)}),i(1,"actions"),h(2,se,3,0,"a",3),n(),i(3,"filters"),T(4,ge,25,15,"ng-template",null,0,R),n(),i(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),l(13,"Name"),n(),i(14,"th",9),l(15,"Count"),n(),i(16,"th",9),l(17," Amount "),n()()(),i(18,"tbody"),h(19,fe,3,0,"tr")(20,ue,2,0),n(),i(21,"tfoot",10)(22,"tr",11)(23,"td"),l(24,"Total"),n(),i(25,"td",12),l(26),f(27,"sum"),f(28,"number"),n(),i(29,"td",12),l(30),f(31,"sum"),f(32,"number"),n()()()()()()()()}if(r&2){let t=p();s("pageData",t.menuData())("hideSearchBox",!0)("isFilterOnDropdown",!1),u("filter",t.pageData().Filter),m(2),I(t.roleService.global.Export?2:-1),m(17),I(t.data().Data.length?20:19),m(7),b(" ",y(28,11,x(27,8,t.data().Data,"Count"))," "),m(4),b(" ",y(32,16,x(31,13,t.data().Data,"Amount"))," ")}}var pe=class r extends J{constructor(t,a,e,o,De,ye,xe){super(t,a,"Payment/InvoiceWriteOffItemReport","PaymentLoader/InvoiceWriteOffItemReport");this.csvConverter=e;this.dataDaysRangeService=o;this.roleService=De;this.matDialog=ye;this.paymentDateService=xe}csvConverter;dataDaysRangeService;roleService;matDialog;paymentDateService;toMinDate=S(null);fromMinDate=S(new Date);hideDateClearButton=S(!1);changeDatepickerValidation(t=!1){this.hideDateClearButton.update(()=>this.dataDaysRangeService.isHideClearDateBtn);let a=this.pageData().Filter.From,e=this.dataDaysRangeService.getDateValidation(a);this.toMinDate.update(()=>e.toMinDate),this.fromMinDate.update(()=>e.fromMinDate)}openExportModal(){this.matDialog.open(X,{data:{title:"Write Off Item Report",exportTypes:[{ID:"PaymentExport/InvoiceWriteOffItemReport",Value:"Default",FileName:"Write Off Item Report"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(a){return new(a||r)(_(Y),_(j),_(Z),_(me),_(U),_(K),_(z))};static \u0275cmp=P({type:r,selectors:[["POS-payment-writeoff-item"]],features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],["filterDialogWidth","600px",3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],["filterDialogWidth","600px",3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col"],["scope","col",1,"text-end",2,"width","150px"],[1,"table-footer"],[1,"fw-semibold"],[1,"text-end"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter","grid-filter"],[1,"filter-item"],["placeholder","Choose an Outlet",1,"w-100",3,"ngModelChange","accessType","ngModel","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Tag",3,"ngModelChange","ngModel","items"],["placeholder","From","appearance","outline","name","From",3,"dateChange","hidelClearBtn","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","hidelClearBtn","isFloatingLabel","date","minDateValidation"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose a reason","bindLabel","Name","bindValue","ID",3,"ngModelChange","items","ngModel"],["colspan","3",1,""],[1,"fw-normal"],[1,"link-primary","cursor-pointer",3,"routerLink","queryParams"]],template:function(a,e){a&1&&h(0,Ce,33,18,"mainpanel-cmp",1),a&2&&I(e.data()?0:-1)},dependencies:[re,G,H,q,ae,ne,Q,oe,ee,ie,te,le,A,k,N,$],encapsulation:2,changeDetection:0})};export{pe as PaymentWriteoffItemComponent};
@@ -1,4 +1,4 @@
1
- import{a as Ti}from"./chunk-TGWNQWD2.js";import{a as Va}from"./chunk-DCLD2V2C.js";import{a as Ii}from"./chunk-TS3T4OA3.js";import{a as Di}from"./chunk-U62COZKB.js";import{a as ka}from"./chunk-JTQXCL7A.js";import{a as xi}from"./chunk-M4T7OZR5.js";import{a as Si}from"./chunk-CDMUNCIC.js";import{a as vi}from"./chunk-EXHNTWLG.js";import"./chunk-JXLQVHA4.js";import{a as fi}from"./chunk-PWIMOOYH.js";import{a as Kt}from"./chunk-5R6RTNL3.js";import{a as Ea}from"./chunk-W4DXHXQA.js";import{a as Ci}from"./chunk-FED2YMP5.js";import{a as Cn}from"./chunk-HHFHJ6MZ.js";import{a as Ma}from"./chunk-6KKVHXJX.js";import{a as zo}from"./chunk-FDWDS434.js";import{a as ni,b as ea}from"./chunk-YSLAPCNO.js";import"./chunk-YXNQ2YYU.js";import{a as _i}from"./chunk-SU6YLO4U.js";import{a as Oa}from"./chunk-HBAQBI6Z.js";import{h as Fa}from"./chunk-N764VCKC.js";import"./chunk-TPTCXX5L.js";import"./chunk-G7AL57D3.js";import"./chunk-GK3ISJX4.js";import"./chunk-JDVSUO5O.js";import"./chunk-RHOCFCH3.js";import"./chunk-COBRNIYT.js";import"./chunk-BYXBJQAS.js";import"./chunk-GGDW5WFA.js";import"./chunk-5BYW5TOT.js";import"./chunk-D2FPJJV3.js";import"./chunk-ET4GSDIH.js";import"./chunk-H3HSBSA5.js";import"./chunk-U2JF2UMO.js";import"./chunk-DUBSPAA2.js";import"./chunk-K33O52MA.js";import"./chunk-I42DV4HI.js";import"./chunk-EBFY2M6D.js";import{b as yi}from"./chunk-ZPBLTJZB.js";import"./chunk-BUP3F3S5.js";import"./chunk-LW4YXLL2.js";import"./chunk-EPUVTA4V.js";import{b as bi}from"./chunk-FEJLGG7W.js";import{a as Jt}from"./chunk-5U27NT5S.js";import"./chunk-7FQSGPHL.js";import"./chunk-J7D4A2JN.js";import"./chunk-BYXBJQAS.js";import"./chunk-KYS3BFCS.js";import"./chunk-S77FVPQM.js";import"./chunk-ZZ2RLD3G.js";import"./chunk-Z3E24JZW.js";import"./chunk-5UDUWK67.js";import"./chunk-I3WUTJXX.js";import"./chunk-SKME2EES.js";import"./chunk-QPPK3J6U.js";import"./chunk-DDLXGCOB.js";import"./chunk-Q47RU7VG.js";import"./chunk-YKOGSGA3.js";import{e as ti}from"./chunk-E7AVQYKT.js";import{a as Gt}from"./chunk-UXF6X367.js";import{a as hi}from"./chunk-63VYORHV.js";import{l as Qo,m as So,p as ce}from"./chunk-5DDN7F2G.js";import{d as Yo}from"./chunk-5VZWXSVF.js";import{c as Zo}from"./chunk-CBVW2WXV.js";import"./chunk-AGI6OY3T.js";import"./chunk-CPOQEU6C.js";import"./chunk-6XNSSWFM.js";import"./chunk-G3RF7GBQ.js";import{a as Wt}from"./chunk-Z3EH6NKY.js";import"./chunk-NSVTK37H.js";import{a as fn}from"./chunk-4XQNIABW.js";import{a as We}from"./chunk-RMPCUE2N.js";import{c as Xo,d as mi}from"./chunk-FRF3FEGI.js";import"./chunk-TDI2ZUL6.js";import"./chunk-ORFRX3CJ.js";import{b as Me,c as Ae,d as Tt}from"./chunk-7GBU7E7F.js";import{a as gi,b as Aa}from"./chunk-J4ZV3A3I.js";import{d as Pa}from"./chunk-AOXQWAVH.js";import{a as Ia,b as Ta,d as wa}from"./chunk-CKHJNQTW.js";import{a as Ee}from"./chunk-C5FYF2I3.js";import"./chunk-U34R74K4.js";import{a as _a,b as ga,c as ha,d as Ca}from"./chunk-6QDAWGFY.js";import{a as fa,b as ya}from"./chunk-CCLE2IVS.js";import{a as Ne}from"./chunk-5JF5ZZIZ.js";import{a as ma,b as he}from"./chunk-VBJRQLYD.js";import"./chunk-ORJAUIF4.js";import"./chunk-RDMRKBA5.js";import"./chunk-52XKUJCC.js";import{a as oi}from"./chunk-KTMZNXL5.js";import"./chunk-LZBHDTSD.js";import{a as Ge}from"./chunk-B5AGSH45.js";import{g as ie,h as mt}from"./chunk-HW6TZ2VH.js";import{c as ta}from"./chunk-W6QJ4QXK.js";import{a as wt}from"./chunk-MOXC7FRX.js";import"./chunk-MF3BDWCO.js";import"./chunk-BF42EMHQ.js";import{a as ba,b as di,c as ui}from"./chunk-QOZCJI3Q.js";import"./chunk-WURU2W3C.js";import{a as xa,b as va,c as Sa,d as Da}from"./chunk-UEFG7JV5.js";import"./chunk-ZSK2V6PP.js";import"./chunk-2KEPYDRB.js";import{b as pi}from"./chunk-EUIKMR24.js";import"./chunk-7VXCKSAE.js";import{a as Fn,c as na,d as ia,e as oa,f as aa,h as ii}from"./chunk-3GAEZ6NJ.js";import"./chunk-MOV2FQBP.js";import"./chunk-W4DKC5G3.js";import"./chunk-SLMXA7HD.js";import"./chunk-GZN4MQRS.js";import{a as z}from"./chunk-EO6CYPIK.js";import"./chunk-JI7J6USO.js";import{a as ua}from"./chunk-N7HFG3PM.js";import{b as nt,c as pa}from"./chunk-BSITDAOV.js";import{k as Bt,n as $o,o as Ht,p as jt,q as Ut,r as qt}from"./chunk-DXN47M53.js";import"./chunk-HPCTP4FD.js";import"./chunk-KFWGALIF.js";import{a as Re,b as It}from"./chunk-Z7UCI72M.js";import"./chunk-PPMQE2JW.js";import{G as Pt,N as hn,g as Ke,l as li,o as ci}from"./chunk-7OCVKGLK.js";import"./chunk-NF7H3LPQ.js";import"./chunk-XW7JSER6.js";import"./chunk-OKQYRKDJ.js";import"./chunk-XK5HIA4Z.js";import{d as Be,e as ri}from"./chunk-QHP5XZP6.js";import"./chunk-DU6XSMWH.js";import"./chunk-EYS7UNNM.js";import{a as et,b as tt,c as le,d as ra,e as la,f as ca,g as sa,h as ai}from"./chunk-LCBHD53Y.js";import{a as da}from"./chunk-IKV23X6H.js";import"./chunk-C6TJ57ES.js";import{a as si}from"./chunk-RJDDPGUV.js";import{b as st,c as Kn}from"./chunk-VUC4E73K.js";import"./chunk-OTSIIVCA.js";import{a as An}from"./chunk-DUAKLYOO.js";import{a as Jo}from"./chunk-TJT2EEUH.js";import"./chunk-IX2NXO5F.js";import"./chunk-ZRB4EZI3.js";import{a as qe,b as Je,c as Qe}from"./chunk-KXQJYBG5.js";import{a as Ko}from"./chunk-3MLD6BQG.js";import"./chunk-LUUIBDJG.js";import"./chunk-R7VXUOCU.js";import{Da as Xn,Fa as Zn,Ga as Go,Ha as Dt,Ia as ei,M as Ho,N as jo,O as _n,R as xo,b as nn,d as Bo,e as zn,f as un,g as bo,i as De,ia as vo,ja as Qn,k as En,ma as $n,o as Wo,pa as Uo,qa as qo,ra as Yn,sa as gn}from"./chunk-NYN3E7NN.js";import{F as Se,G as St,a as Ro,b as dn,c as Pe,h as G,m as vt,p as K,s as No,t as Nt}from"./chunk-4XQKDYF2.js";import"./chunk-XGFPQ7DM.js";import{a as Jn}from"./chunk-IJUAPF2P.js";import"./chunk-AGPZGAMV.js";import{b as ne}from"./chunk-K74WZXBF.js";import{a as pe}from"./chunk-PPTZHIIZ.js";import{a as Lo}from"./chunk-AP4S4OV5.js";import{n as ve,q as ee}from"./chunk-ETYXTCKV.js";import{$ as Ce,$a as P,Ab as $,Ac as mn,Ba as E,Bb as R,Bc as wn,Cb as N,D as Ye,Da as Ze,Db as p,Eb as o,Fa as Et,Fb as a,Fc as g,Gb as y,Gc as w,Hc as F,Ic as Wn,J as kn,Jb as Nn,Jd as Ft,Kb as oe,L as Vt,Lb as ae,Lc as Y,Mb as He,Na as je,Nc as Hn,Nd as Le,Oc as fe,P as Lt,Pa as dt,Pb as v,Pd as ct,Qd as te,Sa as Ln,Sb as f,Sc as lt,Sd as Mn,Tc as xe,Ua as c,Ub as m,Vb as ko,Wb as fo,Xb as Bn,Xc as yo,Yb as gt,Zb as U,_a as rt,_b as q,_c as jn,ad as de,bd as Pn,cc as ge,da as J,db as L,dc as rn,eb as tn,ec as xt,fc as ho,gc as X,hb as Rn,hc as s,ia as Oo,ib as Z,ic as S,id as we,ja as at,jb as M,jc as b,ka as en,kc as Co,kd as Un,l as be,la as Vn,ld as pn,mc as D,md as Rt,na as O,nc as I,nd as qn,oc as T,od as ft,qd as Ue,r as _e,ra as u,s as kt,sa as _,sb as me,sc as ln,sd as re,ta as Ie,tc as Vo,va as bt,vc as cn,vd as ue,wb as h,wc as sn,wd as Gn,xc as H,ya as ke,yb as C,yc as k,zb as Ve,zc as Te}from"./chunk-DUSKF5IQ.js";import{a as A,b as V,g as go,j as pt}from"./chunk-NF7PG5F2.js";var yr=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],br=i=>({ID:i});function xr(i,r){if(i&1){let e=v();o(0,"a",6),f("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),y(1,"i",7),s(2," Export "),a()}}function vr(i,r){if(i&1){let e=v();o(0,"div",8)(1,"h6"),s(2,"Customer"),a(),o(3,"autocompleteV2",9),T("ngModelChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.CustomerID,t)||(l.pageData().Filter.CustomerID=t),_(t)}),a(),o(4,"h6"),s(5,"Scope"),a(),o(6,"radio-options",10),T("modelChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.DateFilter,t)||(l.pageData().Filter.DateFilter=t),_(t)}),a(),o(7,"h6"),s(8,"From - To"),a(),o(9,"datepicker",11),T("dateChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.From,t)||(l.pageData().Filter.From=t),_(t)}),a(),o(10,"div",12)(11,"datepicker",13),T("dateChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.To,t)||(l.pageData().Filter.To=t),_(t)}),a()()()}if(i&2){let e=m(2);c(3),D("ngModel",e.pageData().Filter.CustomerID),c(3),D("model",e.pageData().Filter.DateFilter),p("options",e.DateFilter),c(3),p("isFloatingLabel",!1),D("date",e.pageData().Filter.From),c(2),p("isFloatingLabel",!1),D("date",e.pageData().Filter.To)}}function Sr(i,r){if(i&1&&(o(0,"th",21),s(1),a()),i&2){let e=r.$implicit;c(),b(" ",e.HeaderOption," ")}}function Dr(i,r){if(i&1&&(o(0,"td")(1,"span",28),s(2),g(3,"date"),a(),o(4,"span",29),s(5),g(6,"number"),a()()),i&2){let e=r.$implicit;c(2),S(F(3,2,e.Due,"dd MMM")),c(3),S(w(6,5,e.PriceAfterDiscount))}}function Ir(i,r){if(i&1&&(o(0,"tr")(1,"td"),s(2),g(3,"date"),a(),o(4,"td"),s(5),g(6,"date"),a(),o(7,"td")(8,"a",26),s(9),a()(),R(10,Dr,7,7,"td",null,$),o(12,"td",27),s(13),g(14,"number"),a()()),i&2){let e=r.$implicit;c(2),S(F(3,6,e.DeliveryDate,"dd MMM")),c(3),S(F(6,9,e.InvoiceDate,"dd MMM")),c(3),p("routerLink",H(14,yr))("queryParams",k(15,br,e.ID)),c(),S(e.Number),c(),N(e.ARColumn),c(3),S(w(14,12,e.Total))}}function Tr(i,r){i&1&&y(0,"td",25)}function wr(i,r){if(i&1){let e=v();o(0,"div")(1,"h6",14),s(2),a(),o(3,"table",15),f("matSortChange",function(t){let l=u(e).$index,d=m(2);return _(d.sortData(t,l))}),o(4,"thead",16)(5,"tr",17)(6,"th",18),s(7," DLVRY. DATE "),a(),o(8,"th",19),s(9," INV. DATE "),a(),o(10,"th",20),s(11," Number "),a(),R(12,Sr,2,1,"th",21,$),o(14,"th",22),s(15),a()()(),o(16,"tbody"),R(17,Ir,15,17,"tr",null,$),a(),o(19,"tfoot")(20,"tr",23),y(21,"td",24)(22,"td",24)(23,"td",24),R(24,Tr,1,0,"td",25,$),o(26,"td",25),s(27),g(28,"sum"),g(29,"number"),a()()()()()}if(i&2){let e=r.$implicit;c(2),S(e.Name),c(10),N(e.AR),c(3),b(" ",e.Header!=null?e.Header:"Total"," "),c(2),N(e.Invoice),c(7),N(e.AR),c(3),b(" ",w(29,6,F(28,3,e.Invoice,"Total"))," ")}}function Pr(i,r){if(i&1){let e=v();o(0,"mainpanel-cmp",2),T("textChange",function(t){u(e);let l=m();return I(l.pageData().Filter.Text,t)||(l.pageData().Filter.Text=t),_(t)}),f("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),T("filterChange",function(t){u(e);let l=m();return I(l.pageData().Filter,t)||(l.pageData().Filter=t),_(t)}),o(1,"actions"),h(2,xr,3,0,"a",3),a(),o(3,"filters"),M(4,vr,12,7,"ng-template",null,0,Y),a(),o(6,"content")(7,"div",4),R(8,wr,30,8,"div",null,$),o(10,"h2",5),s(11),g(12,"number"),a()()()()}if(i&2){let e=m();p("pageData",e.menuData()),D("text",e.pageData().Filter.Text),p("isFilterOnDropdown",!1),D("filter",e.pageData().Filter),c(2),C(!(e.role==null||e.role.global==null)&&e.role.global.Export?2:-1),c(6),N(e.data().Data),c(3),b(" Total AR : ",w(12,6,e.data().TotalAR)," ")}}var wi=class i extends Ne{constructor(e,n,t,l,d){super(e,n,"Debt/PaymentDiscountIllustrationList","DebtLoader/PaymentDiscountIllustrationLoader");this.httpService=n;this.csvConverter=t;this.role=l;this.matDialog=d}httpService;csvConverter;role;matDialog;originalData=E([]);DateFilter=[{Key:!1,Value:"None"},{Key:!0,Value:"Range"}];openExportModal(){this.matDialog.open(he,{data:{title:"Payment Discount Illustration",exportTypes:[{ID:"Debt/PaymentDiscountIllustrationList",Value:"Default",FileName:"PaymentIllustration"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.menuData().H=e.PageTitle,this.originalData.set(e.Data)}sortData(e,n){let t=this.data().Data[n].Invoice.slice();if(!e.active||e.direction===""){this.data().Data[n]=this.originalData()[n];return}this.data().Data[n].Invoice=t.sort((l,d)=>{let x=e.direction==="asc";switch(typeof l[e.active]){case"string":return this.compare(l[e.active].toLocaleLowerCase(),d[e.active].toLocaleLowerCase(),x);case"number":return this.compare(l[e.active],d[e.active],x);default:return 0}})}static \u0275fac=function(n){return new(n||i)(P(z),P(ee),P(Ge),P(ne),P(le))};static \u0275cmp=L({type:i,selectors:[["ng-component"]],standalone:!1,features:[Z],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button",1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"float-end","me-7","mt-5"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-upload"],[1,"dialog-filter"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","Date",3,"modelChange","model","options"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],[1,"text-primary","ng-binding","mt-2"],["matSort","",1,"table","mt-3",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","DeliveryDate",1,"align-left",2,"width","100px"],["mat-sort-header","InvoiceDate",1,"align-left",2,"width","100px"],["mat-sort-header","Number",1,"align-left",2,"width","100px"],[2,"text-align","right"],["mat-sort-header","Total",1,"flex-right","text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end","text-success"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"float-start"],[1,"float-end"]],template:function(n,t){n&1&&h(0,Pr,13,8,"mainpanel-cmp",1),n&2&&C(t.data()?0:-1)},dependencies:[ie,te,G,K,ce,mi,Me,Ae,nt,re,Ue,Ke],encapsulation:2,changeDetection:0})};var Mr=["data-p-icon","angle-double-down"],La=(()=>{class i extends si{static \u0275fac=(()=>{let e;return function(t){return(e||(e=Et(i)))(t||i)}})();static \u0275cmp=L({type:i,selectors:[["","data-p-icon","angle-double-down"]],features:[Z],attrs:Mr,decls:1,vars:0,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M6.70786 6.59831C6.80043 6.63674 6.89974 6.65629 6.99997 6.65581C7.19621 6.64081 7.37877 6.54953 7.50853 6.40153L11.0685 2.8416C11.1364 2.69925 11.1586 2.53932 11.132 2.38384C11.1053 2.22837 11.0311 2.08498 10.9195 1.97343C10.808 1.86188 10.6646 1.78766 10.5091 1.76099C10.3536 1.73431 10.1937 1.75649 10.0513 1.82448L6.99997 4.87585L3.9486 1.82448C3.80625 1.75649 3.64632 1.73431 3.49084 1.76099C3.33536 1.78766 3.19197 1.86188 3.08043 1.97343C2.96888 2.08498 2.89466 2.22837 2.86798 2.38384C2.84131 2.53932 2.86349 2.69925 2.93147 2.8416L6.46089 6.43205C6.53132 6.50336 6.61528 6.55989 6.70786 6.59831ZM6.70786 12.1925C6.80043 12.2309 6.89974 12.2505 6.99997 12.25C7.10241 12.2465 7.20306 12.2222 7.29575 12.1785C7.38845 12.1348 7.47124 12.0726 7.53905 11.9957L11.0685 8.46629C11.1614 8.32292 11.2036 8.15249 11.1881 7.98233C11.1727 7.81216 11.1005 7.6521 10.9833 7.52781C10.866 7.40353 10.7104 7.3222 10.5415 7.29688C10.3725 7.27155 10.1999 7.30369 10.0513 7.38814L6.99997 10.4395L3.9486 7.38814C3.80006 7.30369 3.62747 7.27155 3.45849 7.29688C3.28951 7.3222 3.13393 7.40353 3.01667 7.52781C2.89942 7.6521 2.82729 7.81216 2.81184 7.98233C2.79639 8.15249 2.83852 8.32292 2.93148 8.46629L6.4609 12.0262C6.53133 12.0975 6.61529 12.1541 6.70786 12.1925Z","fill","currentColor"]],template:function(n,t){n&1&&(Ie(),Nn(0,"path",0))},encapsulation:2})}return i})();var Ar=["data-p-icon","angle-double-up"],Ra=(()=>{class i extends si{static \u0275fac=(()=>{let e;return function(t){return(e||(e=Et(i)))(t||i)}})();static \u0275cmp=L({type:i,selectors:[["","data-p-icon","angle-double-up"]],features:[Z],attrs:Ar,decls:1,vars:0,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M10.1504 6.67719C10.2417 6.71508 10.3396 6.73436 10.4385 6.73389C10.6338 6.74289 10.8249 6.67441 10.97 6.54334C11.1109 6.4023 11.19 6.21112 11.19 6.01178C11.19 5.81245 11.1109 5.62127 10.97 5.48023L7.45977 1.96998C7.31873 1.82912 7.12755 1.75 6.92821 1.75C6.72888 1.75 6.5377 1.82912 6.39666 1.96998L2.9165 5.45014C2.83353 5.58905 2.79755 5.751 2.81392 5.91196C2.83028 6.07293 2.89811 6.22433 3.00734 6.34369C3.11656 6.46306 3.26137 6.54402 3.42025 6.57456C3.57914 6.60511 3.74364 6.5836 3.88934 6.51325L6.89813 3.50446L9.90691 6.51325C9.97636 6.58357 10.0592 6.6393 10.1504 6.67719ZM9.93702 11.9993C10.065 12.1452 10.245 12.2352 10.4385 12.25C10.632 12.2352 10.812 12.1452 10.9399 11.9993C11.0633 11.8614 11.1315 11.6828 11.1315 11.4978C11.1315 11.3128 11.0633 11.1342 10.9399 10.9963L7.48987 7.48609C7.34883 7.34523 7.15765 7.26611 6.95832 7.26611C6.75899 7.26611 6.5678 7.34523 6.42677 7.48609L2.91652 10.9963C2.84948 11.1367 2.82761 11.2944 2.85391 11.4477C2.88022 11.601 2.9534 11.7424 3.06339 11.8524C3.17338 11.9624 3.31477 12.0356 3.46808 12.0619C3.62139 12.0882 3.77908 12.0663 3.91945 11.9993L6.92823 8.99048L9.93702 11.9993Z","fill","currentColor"]],template:function(n,t){n&1&&(Ie(),Nn(0,"path",0))},encapsulation:2})}return i})();var Fr=()=>["New_Join_Bill"],Or=()=>["New_Join_Bill/Info"],Do=i=>({ID:i}),kr=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],Vr=(i,r,e)=>({"text-success":i,"text-warning":r,"text-danger":e});function Lr(i,r){if(i&1){let e=v();o(0,"a",12),f("click",function(){u(e);let t=m(2);return _(t.httpPostListID("Debt/DeleteAppCollection"))}),y(1,"i",13),s(2," Delete"),a()}}function Rr(i,r){if(i&1){let e=v();o(0,"a",12),f("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),y(1,"i",14),s(2," Export "),a()}}function Nr(i,r){i&1&&(o(0,"a",4),s(1,"Add "),a()),i&2&&p("routerLink",H(1,Fr))}function Br(i,r){if(i&1){let e=v();o(0,"div",15)(1,"h6"),s(2,"Outlet"),a(),o(3,"outlet-selector",16),T("ngModelChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.EntityID,t)||(l.pageData().Filter.EntityID=t),_(t)}),a(),o(4,"h6"),s(5,"Supplier"),a(),o(6,"autocompleteV2",17),T("ngModelChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.SupplierID,t)||(l.pageData().Filter.SupplierID=t),_(t)}),a(),o(7,"h6"),s(8,"From - To"),a(),o(9,"datepicker",18),T("dateChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.From,t)||(l.pageData().Filter.From=t),_(t)}),a(),o(10,"div",19)(11,"datepicker",20),T("dateChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.To,t)||(l.pageData().Filter.To=t),_(t)}),a()()()}if(i&2){let e=m(2);c(3),p("accessType",2),D("ngModel",e.pageData().Filter.EntityID),c(3),D("ngModel",e.pageData().Filter.SupplierID),c(3),p("isFloatingLabel",!1),D("date",e.pageData().Filter.From),c(2),p("isFloatingLabel",!1),D("date",e.pageData().Filter.To)}}function Wr(i,r){if(i&1){let e=v();o(0,"th",9)(1,"input",21),f("change",function(t){u(e);let l=m(2);return _(l.onSelectAllData(t.target.checked))}),a()()}}function Hr(i,r){if(i&1){let e=v();o(0,"td",9)(1,"input",26),T("ngModelChange",function(t){u(e);let l=m().$implicit;return I(l.selected,t)||(l.selected=t),_(t)}),a()()}if(i&2){let e=m().$implicit;c(),D("ngModel",e.selected)}}function jr(i,r){if(i&1&&(o(0,"tr"),h(1,Hr,2,1,"td",9),o(2,"td"),s(3),a(),o(4,"td")(5,"a",22),s(6),a()(),o(7,"td")(8,"a",22),s(9),a()(),o(10,"td"),s(11),g(12,"date"),a(),o(13,"td"),s(14),g(15,"IsMinDate"),a(),y(16,"td",23),g(17,"newlines"),o(18,"td")(19,"span"),s(20),a()(),o(21,"td")(22,"a",24),y(23,"i",25),a()()()),i&2){let e=r.$implicit,n=m(2);c(),C(n.role.debt.Delete?1:-1),c(2),S(e.EntityName),c(2),p("routerLink",H(23,Or))("queryParams",k(24,Do,e.ID)),c(),b("",e.Number," "),c(2),p("routerLink",H(26,kr))("queryParams",k(27,Do,e.SupplierID)),c(),b("",e.Name," "),c(2),S(F(12,15,e.Date,"dd MMM yyyy")),c(3),S(F(15,18,e.Due,"dd MMM yyyy")),c(2),p("innerHTML",w(17,21,e.Note),je),c(3),X(mn(29,Vr,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),c(),S(e.PaymentStateLabel),c(2),p("queryParams",k(33,Do,e.ID))}}function Ur(i,r){if(i&1){let e=v();o(0,"mat-paginator",27),f("page",function(t){u(e);let l=m(2);return _(l.onPaginationChange(t))}),a()}if(i&2){let e=m(2);p("length",e.pagination.listTotal())("pageSize",e.pagination.pageSize())("pageIndex",e.pageData().Filter.PageNumber==0?0:e.pageData().Filter.PageNumber-1)}}function qr(i,r){if(i&1){let e=v();o(0,"mainpanel-cmp",2),T("textChange",function(t){u(e);let l=m();return I(l.pageData().Filter.Number,t)||(l.pageData().Filter.Number=t),_(t)}),f("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),T("filterChange",function(t){u(e);let l=m();return I(l.pageData().Filter,t)||(l.pageData().Filter=t),_(t)}),o(1,"actions"),h(2,Lr,3,0,"a",3),h(3,Rr,3,0,"a",3),h(4,Nr,2,2,"a",4),a(),o(5,"filters"),M(6,Br,12,7,"ng-template",null,0,Y),a(),o(8,"content")(9,"div",5)(10,"div",6)(11,"table",7)(12,"thead",8)(13,"tr"),h(14,Wr,2,0,"th",9),o(15,"th"),s(16,"Outlet"),a(),o(17,"th"),s(18,"Number"),a(),o(19,"th"),s(20,"Supplier"),a(),o(21,"th"),s(22,"Date"),a(),o(23,"th"),s(24,"Due"),a(),o(25,"th"),s(26,"Note"),a(),o(27,"th"),s(28,"Payment"),a(),y(29,"th",10),a()(),o(30,"tbody"),R(31,jr,24,35,"tr",null,$),a()(),o(33,"div"),h(34,Ur,1,3,"mat-paginator",11),a()()()()()}if(i&2){let e=m();p("pageData",e.menuData()),D("text",e.pageData().Filter.Number),p("isFilterOnDropdown",!1),D("filter",e.pageData().Filter),c(2),C(e.getSelectedData().length>0?2:-1),c(),C(e.role.global.Export?3:-1),c(),C(e.role.debt.Create?4:-1),c(10),C(e.role.debt.Delete?14:-1),c(17),N(e.data().Data),c(3),C(e.pagination.listTotal()>0?34:-1)}}var Pi=class i extends Ne{constructor(e,n,t,l,d,x){super(e,n,"Debt/GetAppCollection","DebtLoader/GetAppCollection",l);this.httpService=n;this.csvConverter=t;this.matDialog=d;this.role=x}httpService;csvConverter;matDialog;role;renderer=O(rt);ngAfterViewInit(){this.renderer.removeClass(document.querySelector("#full-container"),"full-container")}openExportModal(){this.matDialog.open(he,{data:{title:"Join Bill",exportTypes:[{ID:"Debt/GetAppCollection",Value:"Default",FileName:"Join Bill"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(n){return new(n||i)(P(z),P(ee),P(Ge),P(ve),P(le),P(ne))};static \u0275cmp=L({type:i,selectors:[["ng-component"]],standalone:!1,features:[Z],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button",1,"btn","btn-outline-secondary","me-3"],["role","button",1,"btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","14px"],[2,"width","3px"],[3,"length","pageSize","pageIndex"],["role","button",1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa-solid","fa-trash"],[1,"fa","fa-upload"],[1,"dialog-filter"],["placeholder","Choose an Outlet",3,"ngModelChange","accessType","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["type","checkbox",3,"change"],["target","_blank",3,"routerLink","queryParams"],[3,"innerHTML"],["routerLink","/print/BulkSupplierInvoice","target","_blank",3,"queryParams"],["aria-hidden","true",1,"fa","fa-print"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"page","length","pageSize","pageIndex"]],template:function(n,t){n&1&&h(0,qr,35,9,"mainpanel-cmp",1),n&2&&C(t.data()?0:-1)},dependencies:[ie,te,dn,G,K,ni,ce,nt,Ee,Ue,ci,Pt],encapsulation:2,changeDetection:0})};var Ba=i=>({selected:i});function Kr(i,r){if(i&1){let e=v();o(0,"a",4),f("click",function(){let t=u(e).$implicit,l=m();return _(l.onChangeTab(t))}),s(1),a()}if(i&2){let e=r.$implicit,n=m();p("ngClass",k(2,Ba,n.activeTab().key===e.key)),c(),b(" ",e.value," ")}}function Jr(i,r){if(i&1){let e=v();o(0,"div",3)(1,"div",5)(2,"datepicker",6),T("dateChange",function(t){u(e);let l=m();return I(l.Dialog.Date,t)||(l.Dialog.Date=t),_(t)}),a()(),o(3,"div",5)(4,"div",7)(5,"ng-select",8),T("ngModelChange",function(t){u(e);let l=m();return I(l.Dialog.MethodID,t)||(l.Dialog.MethodID=t),_(t)}),a(),o(6,"label",9),s(7,"Payment Method"),a()()(),o(8,"div",5)(9,"div",10)(10,"input",11),T("ngModelChange",function(t){u(e);let l=m();return I(l.Dialog.Amount,t)||(l.Dialog.Amount=t),_(t)}),a(),o(11,"label",12),s(12,"Amount"),a()()(),o(13,"div",5)(14,"div",10)(15,"input",13),T("ngModelChange",function(t){u(e);let l=m();return I(l.Dialog.Code,t)||(l.Dialog.Code=t),_(t)}),a(),o(16,"label",14),s(17,"Payment Code"),a()()(),o(18,"div",15)(19,"POS-tinymce-editor",16),T("ngModelChange",function(t){u(e);let l=m();return I(l.Dialog.Note,t)||(l.Dialog.Note=t),_(t)}),a()()()}if(i&2){let e=m();c(2),p("disabled",!e.roleService.global.Date)("matTooltip",e.roleService.global.Date?"":"Date role is required"),D("date",e.Dialog.Date),c(2),p("ngClass",k(10,Ba,e.isNotEmpty(e.Options))),c(),D("ngModel",e.Dialog.MethodID),p("items",e.Options)("clearable",!1),c(5),D("ngModel",e.Dialog.Amount),c(5),D("ngModel",e.Dialog.Code),c(4),D("ngModel",e.Dialog.Note)}}function zr(i,r){if(i&1){let e=v();o(0,"POS-uppy",18),f("fileUploadComplete",function(t){u(e);let l=m(2);return _(l.onUpload(t))}),a()}if(i&2){let e=m(2);p("uppyCoreConfiguration",e.uppyCoreConfiguration)("dashboardPropsConfiguration",e.dashboardProps)("subtitle","Accepted file formats: .jpeg and .pdf & max file size: 2.5 MB")}}function Qr(i,r){if(i&1){let e=v();o(0,"div",19)(1,"a",20),y(2,"i",21),o(3,"h5",22),s(4,"File Uploaded"),a(),o(5,"small",23),s(6),a(),o(7,"div",24)(8,"i",25),f("click",function(t){u(e);let l=m(3);return _(l.onRemoveFile(t))}),a()()()()}if(i&2){let e=m(3);c(),p("href",e.fileUrl,dt),c(5),S(e.fileName)}}function $r(i,r){if(i&1){let e=v();o(0,"div",19)(1,"a",20)(2,"img",26),f("click",function(t){u(e);let l=m(3);return _(l.openBiggerPicture(l.fileUrl,t))}),a(),o(3,"small",27),s(4),a(),o(5,"div",24)(6,"i",25),f("click",function(t){u(e);let l=m(3);return _(l.onRemoveFile(t))}),a()()()()}if(i&2){let e=m(3);c(),p("href",e.fileUrl,dt),c(),p("src",e.fileUrl,dt),c(2),S(e.fileName)}}function Yr(i,r){if(i&1&&h(0,Qr,9,2,"div",19)(1,$r,7,3,"div",19),i&2){let e=m(2);C(e.isPdfFile?0:1)}}function Xr(i,r){if(i&1&&(o(0,"div",3)(1,"div",15),h(2,zr,1,3,"POS-uppy",17)(3,Yr,2,1),a()()),i&2){let e=m();c(2),C(e.isUploadFile?3:2)}}var yn=class i{constructor(r,e,n){this.dialogRef=r;this.data=e;this.httpService=n;this.Dialog=A({},e.paymentDetail),this.Dialog.SumInvoice=e.totalAmount,this.Options=e.option,this.InfoID=e.queryString.ID,this.form=A({},e.paymentDetail),this.storagePath=e.storagePath,this.cloudflareDebtID=e.uuid,this.initShowingImage(),this.setTemporaryID()}dialogRef;data;httpService;toastrService=O(ve);storagePath="";isUploadFile;fileName;fileUrl;isPdfFile=!1;isRemoveImage;config=new Je;roleService=O(ne);bigPicture=O(Cn);Dialog;Options;InfoID;form={ImageUrlClient:"",ImageUrl:"",ID:""};cloudflareDebtID;processUppy=O(ka);tabs=E([{key:0,value:"General",active:!0},{key:1,value:"Attachment",active:!1}]);uppyCoreConfiguration={restrictions:{allowedFileTypes:["image/*",".jpg",".jpeg",".png",".pdf"],maxTotalFileSize:Lo.uppy.invoicePayment}};dashboardProps={height:325};setTemporaryID(){pe.IsEmpty(this.form.ID)?this.onGetUUID().subscribe(r=>{this.form.TemporaryID=r,this.cloudflareDebtID=this.form.TemporaryID}):this.cloudflareDebtID=this.form.ID}onRemoveFile(r){r.preventDefault(),this.isUploadFile=!1,this.fileUrl=null,this.fileName=null,this.isRemoveImage=!0}openBiggerPicture(r,e){this.bigPicture.openBiggerPicture(e,r)}initShowingImage(){this.isUploadFile=!1,this.isRemoveImage=!1,pe.IsNotEmpty(this.form.ImageUrlClient)&&(this.fileUrl=this.form.ImageUrlClient,this.fileName=this.form.ImageUrl,this.checkIsPdfFile(),this.isUploadFile=!0)}checkIsPdfFile(){let r=this.fileName.split(".").pop();this.isPdfFile=r=="pdf"}isNotEmpty(r){return pe.IsNotEmpty(r)}ngOnInit(){this.config.headerType=qe.Success,this.config.title="Payment Detail",this.config.bodyScrollable=!0,this.config.customWidth="600px"}onOk(){this.Dialog.InfoID=this.InfoID,this.Dialog.ImageUrlClient=this.fileUrl,this.Dialog.ImageUrl=this.fileName,this.Dialog.PaymentID=this.cloudflareDebtID,this.dialogRef.close({Dialog:this.Dialog})}onChangeTab(r){this.tabs.update(e=>e.map(n=>(n.active=!1,n.key===r.key&&(n.active=!0),n)))}activeTab=fe(()=>this.tabs().find(r=>r.active));noteValueChange(r){this.Dialog.Note=r}onUpload(r){this.processUppy.uploadFileThroughPreSignedUrl(r,this.storagePath+this.cloudflareDebtID).subscribe(e=>{this.fileName=r.name,this.fileUrl=e.url})}onGetUUID(){return this.httpService.get(An.GetUUID).pipe(_e(r=>r.UUID))}static \u0275fac=function(e){return new(e||i)(P(et),P(tt),P(ee))};static \u0275cmp=L({type:i,selectors:[["modal-add-payment"]],standalone:!1,decls:8,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"row","border-bottom"],["data-cy","tab-note",1,"btn","btn-link","note-tab",3,"ngClass"],[1,"row",2,"margin","1rem 0"],["data-cy","tab-note",1,"btn","btn-link","note-tab",3,"click","ngClass"],[1,"col-sm-6"],["matTooltipPosition","above","name","orderDate","placeholder","Date","appearance","outline",2,"height","auto","font-size","16px","width","100%","padding","0",3,"dateChange","disabled","matTooltip","date"],[1,"form-floating-outline",3,"ngClass"],["id","paymentMethod","appendTo","body","bindLabel","Name","bindValue","ID","name","paymentMethod",1,"productform",3,"ngModelChange","ngModel","items","clearable"],["for","paymentMethod",1,"ng-select"],[1,"form-floating-outline"],["type","text","id","amount","autoNum","","autofocus","","placeholder","Amount","name","sumInvoice",1,"form-control",2,"width","100%",3,"ngModelChange","ngModel"],["for","amount"],["type","text","id","code","placeholder","Payment Code","name","code",1,"form-control",3,"ngModelChange","ngModel"],["for","code"],[1,"col-sm-12"],[3,"ngModelChange","ngModel"],[3,"uppyCoreConfiguration","dashboardPropsConfiguration","subtitle"],[3,"fileUploadComplete","uppyCoreConfiguration","dashboardPropsConfiguration","subtitle"],[1,"file-container"],["target","_blank",1,"d-flex","flex-column","align-items-center","justify-content-center","cursor-pointer",3,"href"],[1,"fa-regular","fa-4x","fa-circle-check"],[1,"mt-2"],[1,"text-dark","mt-2"],[1,"position-absolute","rm-img","pointer"],["matTooltipPosition","above","matTooltip","Remove Image",1,"fa-light","fa-trash","text-danger","fa-2x",3,"click"],[2,"width","200px",3,"click","src"],[1,"text-dark","mt-2","px-3"]],template:function(e,n){if(e&1&&(o(0,"modal-material",0),f("onOk",function(){return n.onOk()})("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"div"),R(4,Kr,2,4,"a",2,Ve),a()(),h(6,Jr,20,12,"div",3)(7,Xr,4,1,"div",3),a()()),e&2){let t;p("config",n.config),c(4),N(n.tabs()),c(2),C((t=n.activeTab().key)===0?6:t===1?7:-1)}},dependencies:[we,Pe,G,K,Qe,Be,wt,ce,Jt,Re,bi],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.clickable[_ngcontent-%COMP%]{cursor:pointer}.btn-link.note-tab[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.note-tab.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}a.btn.btn-link.note-tab[_ngcontent-%COMP%]{color:inherit}.rm-img[_ngcontent-%COMP%]{background:#fff;padding:10px;border-radius:100%;border:1px solid rgba(51,51,51,.2);top:55px;right:0}.file-container[_ngcontent-%COMP%]{height:325px;border:1px solid #c8d3df;border-radius:.375rem;display:flex;align-items:center;justify-content:center} .tox.tox-tinymce{height:175px!important}"]})};var bn=class i{constructor(r,e={writeOffOptions:[],writeOffPayment:{ID:null,Note:null,ReasonID:null,Date:null,Amount:0}}){this.dialogRef=r;this.data=e;this.note=this.data?.writeOffPayment?.Note||null,this.date=this.data?.writeOffPayment?.Date||new Date,this.tagId=this.data?.writeOffPayment?.ReasonID||this.data?.writeOffPayment?.WriteOffOptionID}dialogRef;data;date;note;tagId;configModal;ngOnInit(){this.configModal=new Je,this.configModal.title="Write Off",this.configModal.customWidth="500px"}isNotEmpty(r){return pe.IsNotEmpty(r)}onOk(){this.dialogRef.close({ID:this.data?.writeOffPayment?.ID,Amount:this.data?.writeOffPayment?.Amount||0,Note:this.note,ReasonID:this.tagId,Date:this.date})}static \u0275fac=function(e){return new(e||i)(P(et),P(tt))};static \u0275cmp=L({type:i,selectors:[["CustomerDisplay-modal-write-off"]],decls:18,vars:7,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row","mt-5"],[1,"col","fw-bold","d-flex","align-items-center"],[1,"col-10"],["matTooltipPosition","above","matTooltip","Date","name","Date","placeholder","Date","appearance","outline",2,"height","auto","font-size","16px","width","100%","padding","0",3,"dateChange","date","hidelClearBtn"],["bindLabel","Name","appendTo","body","bindValue","ID","placeholder","Choose a reason",1,"writeoff-tag",3,"ngModelChange","ngModel","items","clearable"],[3,"ngModelChange","ngModel"]],template:function(e,n){e&1&&(o(0,"modal-material",0),f("onOk",function(){return n.onOk()})("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"div",2)(4,"div",3),s(5,"Date"),a(),o(6,"div",4)(7,"datepicker",5),T("dateChange",function(l){return I(n.date,l)||(n.date=l),l}),a()()(),o(8,"div",2)(9,"div",3),s(10,"Tag"),a(),o(11,"div",4)(12,"ng-select",6),T("ngModelChange",function(l){return I(n.tagId,l)||(n.tagId=l),l}),a()()(),o(13,"div",2)(14,"div",3),s(15,"Note"),a(),o(16,"div",4)(17,"POS-tinymce-editor",7),T("ngModelChange",function(l){return I(n.note,l)||(n.note=l),l}),a()()()()()()),e&2&&(p("config",n.configModal),c(7),D("date",n.date),p("hidelClearBtn",!0),c(5),D("ngModel",n.tagId),p("items",n.data==null?null:n.data.writeOffOptions)("clearable",n.isNotEmpty(n.tagId)),c(5),D("ngModel",n.note))},dependencies:[Qe,Se,G,K,Be,Jt,ce],styles:["ng-select.writeoff-tag div.ng-select-container{height:48px!important} ng-select.writeoff-tag div.ng-select-container div.ng-placeholder{font-size:14px!important}"]})};var Zr=(i,r)=>({ID:i,Template:r}),el=(i,r)=>({ID:i,Template:r,Mode:"Copy"}),tl=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],Wa=i=>({ID:i}),nl=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],il=i=>({"d-flex":i});function ol(i,r){if(i&1){let e=v();o(0,"button",34),f("click",function(){u(e);let t=m(2);return _(t.onEdit())}),y(1,"i",35),s(2," Edit "),a()}}function al(i,r){if(i&1){let e=v();o(0,"a",36),f("click",function(){let t;u(e);let l=m(2);return _(l.removeData("Debt/InvoiceDelete",(t=l.data().Info)==null?null:t.ID))}),y(1,"i",37),s(2," Delete"),a()}}function rl(i,r){if(i&1&&(o(0,"td"),s(1),g(2,"date"),a()),i&2){let e,n=m(2);c(),b(" ",F(2,1,(e=n.data().Info)==null?null:e.Due,"d/MM/yyyy")," ")}}function ll(i,r){if(i&1&&(o(0,"tr")(1,"th"),s(2,"Journal Link"),a(),o(3,"td"),s(4,":"),a(),o(5,"td")(6,"a",38),s(7,"Books Journal"),a()()()),i&2){let e,n=m(2);c(6),p("href",Vo("https://books.dealpos.app/pages/journal/journal-entry?BulkID=",(e=n.data().Info)==null?null:e.ID),dt)}}function cl(i,r){i&1&&(o(0,"th",25),s(1,"Supplier"),a())}function sl(i,r){if(i&1&&(o(0,"td",25),s(1),a()),i&2){let e=m().$implicit;c(),b(" ",e.Data.SupplierName," ")}}function ml(i,r){if(i&1&&(o(0,"tr")(1,"td"),s(2),a(),o(3,"td"),s(4),g(5,"date"),a(),o(6,"td"),s(7),g(8,"date"),a(),o(9,"td")(10,"a",14),s(11),a()(),h(12,sl,2,1,"td",25),o(13,"td",29),s(14),g(15,"number"),a()()),i&2){let e=r.$implicit,n=r.$index,t=m(2);c(2),b("",n+1,"."),c(2),S(F(5,8,e.Data.Date,"dd MMM yyyy")),c(3),S(F(8,11,e.Data.Due,"dd MMM")),c(3),p("routerLink",H(16,nl))("queryParams",k(17,Wa,e.ID)),c(),S(e.Number),c(),C(t.areAllSupplierNamesSame()?-1:12),c(2),b(" ",w(15,14,e.RemainingPaymentBaseCurrency)," ")}}function pl(i,r){i&1&&y(0,"td")}function dl(i,r){if(i&1){let e=v();o(0,"a",39),f("click",function(){u(e);let t=m(2);return _(t.showPaymentModal(t.data().Payment))}),s(1,"Add"),a()}}function ul(i,r){if(i&1){let e=v();o(0,"a",39),f("click",function(){u(e);let t=m(2);return _(t.showWriteOff())}),s(1,"Write Off"),a()}}function _l(i,r){if(i&1){let e=v();o(0,"a",39),f("click",function(){u(e);let t=m(2);return _(t.cancelWriteOff())}),s(1,"Cancel Write Off"),a()}}function gl(i,r){i&1&&y(0,"th",44)}function fl(i,r){if(i&1&&(o(0,"div",45),g(1,"date"),g(2,"date"),o(3,"span"),s(4),g(5,"date"),a(),y(6,"i",57),a()),i&2){let e=m().$implicit;p("matTooltip",cn("Created : ",e.CreatorLoginID," - ",F(1,5,e.Created,"dd MMM yyyy HH:mm")," ",e.ModifierLoginID?`
1
+ import{a as Ti}from"./chunk-TGWNQWD2.js";import{a as Va}from"./chunk-SQBOICLX.js";import{a as Ii}from"./chunk-TS3T4OA3.js";import{a as Di}from"./chunk-U62COZKB.js";import{a as ka}from"./chunk-WD6M6CPH.js";import{a as xi}from"./chunk-M4T7OZR5.js";import{a as Si}from"./chunk-CDMUNCIC.js";import{a as vi}from"./chunk-EXHNTWLG.js";import"./chunk-JXLQVHA4.js";import{a as fi}from"./chunk-ORWAIO4N.js";import{a as Kt}from"./chunk-SFGCSMHQ.js";import{a as Ea}from"./chunk-PYHYTONY.js";import{a as Ci}from"./chunk-I5OSZ7ZF.js";import{a as Cn}from"./chunk-HHFHJ6MZ.js";import{a as Ma}from"./chunk-6KKVHXJX.js";import{a as zo}from"./chunk-FDWDS434.js";import{a as ni,b as ea}from"./chunk-YSLAPCNO.js";import"./chunk-YXNQ2YYU.js";import{a as _i}from"./chunk-SU6YLO4U.js";import{a as Oa}from"./chunk-HBAQBI6Z.js";import{h as Fa}from"./chunk-K5ZCBMXL.js";import"./chunk-TPTCXX5L.js";import"./chunk-G7AL57D3.js";import"./chunk-DKKGKYNM.js";import"./chunk-ELZABDPP.js";import"./chunk-RHOCFCH3.js";import"./chunk-COBRNIYT.js";import"./chunk-BYXBJQAS.js";import"./chunk-GGDW5WFA.js";import"./chunk-5BYW5TOT.js";import"./chunk-D2FPJJV3.js";import"./chunk-ET4GSDIH.js";import"./chunk-H3HSBSA5.js";import"./chunk-U2JF2UMO.js";import"./chunk-DUBSPAA2.js";import"./chunk-K33O52MA.js";import"./chunk-I42DV4HI.js";import"./chunk-M5XIO7CH.js";import{b as yi}from"./chunk-ZPBLTJZB.js";import"./chunk-BUP3F3S5.js";import"./chunk-LW4YXLL2.js";import"./chunk-EPUVTA4V.js";import{b as bi}from"./chunk-FEJLGG7W.js";import{a as Jt}from"./chunk-5U27NT5S.js";import"./chunk-7FQSGPHL.js";import"./chunk-J7D4A2JN.js";import"./chunk-BYXBJQAS.js";import"./chunk-5AT5TB6J.js";import"./chunk-S77FVPQM.js";import"./chunk-ZZ2RLD3G.js";import"./chunk-Z3E24JZW.js";import"./chunk-5UDUWK67.js";import"./chunk-I3WUTJXX.js";import"./chunk-SKME2EES.js";import"./chunk-SNXPU577.js";import"./chunk-DDLXGCOB.js";import"./chunk-Q47RU7VG.js";import"./chunk-YKOGSGA3.js";import{e as ti}from"./chunk-E7AVQYKT.js";import{a as Gt}from"./chunk-UXF6X367.js";import{a as hi}from"./chunk-63VYORHV.js";import{l as Qo,m as So,p as ce}from"./chunk-5DDN7F2G.js";import{d as Yo}from"./chunk-5VZWXSVF.js";import{c as Zo}from"./chunk-CBVW2WXV.js";import"./chunk-AGI6OY3T.js";import"./chunk-CPOQEU6C.js";import"./chunk-6XNSSWFM.js";import"./chunk-G3RF7GBQ.js";import{a as Wt}from"./chunk-Z3EH6NKY.js";import"./chunk-NSVTK37H.js";import{a as fn}from"./chunk-4XQNIABW.js";import{a as We}from"./chunk-RMPCUE2N.js";import{c as Xo,d as mi}from"./chunk-FRF3FEGI.js";import"./chunk-TDI2ZUL6.js";import"./chunk-LN6BEM5X.js";import{b as Me,c as Ae,d as Tt}from"./chunk-7GBU7E7F.js";import{a as gi,b as Aa}from"./chunk-J4ZV3A3I.js";import{d as Pa}from"./chunk-AOXQWAVH.js";import{a as Ia,b as Ta,d as wa}from"./chunk-CKHJNQTW.js";import{a as Ee}from"./chunk-67B3O2QN.js";import"./chunk-U34R74K4.js";import{a as _a,b as ga,c as ha,d as Ca}from"./chunk-6QDAWGFY.js";import{a as fa,b as ya}from"./chunk-CCLE2IVS.js";import{a as Ne}from"./chunk-GNSJXMIL.js";import{a as ma,b as he}from"./chunk-VBJRQLYD.js";import"./chunk-ORJAUIF4.js";import"./chunk-2I3VDZ3J.js";import"./chunk-JIW22Q2L.js";import{a as oi}from"./chunk-KTMZNXL5.js";import"./chunk-LZBHDTSD.js";import{a as Ge}from"./chunk-B5AGSH45.js";import{g as ie,h as mt}from"./chunk-6QPDZUNS.js";import{c as ta}from"./chunk-W6QJ4QXK.js";import{a as wt}from"./chunk-MOXC7FRX.js";import"./chunk-MF3BDWCO.js";import"./chunk-BF42EMHQ.js";import{a as ba,b as di,c as ui}from"./chunk-QOZCJI3Q.js";import"./chunk-WURU2W3C.js";import{a as xa,b as va,c as Sa,d as Da}from"./chunk-UEFG7JV5.js";import"./chunk-ZSK2V6PP.js";import"./chunk-2KEPYDRB.js";import{b as pi}from"./chunk-EUIKMR24.js";import"./chunk-7VXCKSAE.js";import{a as Fn,c as na,d as ia,e as oa,f as aa,h as ii}from"./chunk-3GAEZ6NJ.js";import"./chunk-MOV2FQBP.js";import"./chunk-W4DKC5G3.js";import"./chunk-SLMXA7HD.js";import"./chunk-L5SQNBQS.js";import{a as z}from"./chunk-6KUOA275.js";import"./chunk-JI7J6USO.js";import{a as ua}from"./chunk-N7HFG3PM.js";import{b as nt,c as pa}from"./chunk-UCBYXW7G.js";import{k as Bt,n as $o,o as Ht,p as jt,q as Ut,r as qt}from"./chunk-DXN47M53.js";import"./chunk-HPCTP4FD.js";import"./chunk-KFWGALIF.js";import{a as Re,b as It}from"./chunk-Z7UCI72M.js";import"./chunk-PPMQE2JW.js";import{G as Pt,N as hn,g as Ke,l as li,o as ci}from"./chunk-7OCVKGLK.js";import"./chunk-NF7H3LPQ.js";import"./chunk-OJTKRQM6.js";import"./chunk-OKQYRKDJ.js";import"./chunk-ZDB6Y3A2.js";import{d as Be,e as ri}from"./chunk-QHP5XZP6.js";import"./chunk-DU6XSMWH.js";import"./chunk-ISUYVEFN.js";import{a as et,b as tt,c as le,d as ra,e as la,f as ca,g as sa,h as ai}from"./chunk-LCBHD53Y.js";import{a as da}from"./chunk-IKV23X6H.js";import"./chunk-C6TJ57ES.js";import{a as si}from"./chunk-RJDDPGUV.js";import{b as st,c as Kn}from"./chunk-VUC4E73K.js";import"./chunk-OTSIIVCA.js";import{a as An}from"./chunk-DUAKLYOO.js";import{a as Jo}from"./chunk-TJT2EEUH.js";import"./chunk-IX2NXO5F.js";import"./chunk-ZRB4EZI3.js";import{a as qe,b as Je,c as Qe}from"./chunk-KXQJYBG5.js";import{a as Ko}from"./chunk-3MLD6BQG.js";import"./chunk-LUUIBDJG.js";import"./chunk-R7VXUOCU.js";import{Da as Xn,Fa as Zn,Ga as Go,Ha as Dt,Ia as ei,M as Ho,N as jo,O as _n,R as xo,b as nn,d as Bo,e as zn,f as un,g as bo,i as De,ia as vo,ja as Qn,k as En,ma as $n,o as Wo,pa as Uo,qa as qo,ra as Yn,sa as gn}from"./chunk-NYN3E7NN.js";import{F as Se,G as St,a as Ro,b as dn,c as Pe,h as G,m as vt,p as K,s as No,t as Nt}from"./chunk-4XQKDYF2.js";import"./chunk-DSX5NEYC.js";import{a as Jn}from"./chunk-K6K43C7W.js";import"./chunk-AGPZGAMV.js";import{b as ne}from"./chunk-K74WZXBF.js";import{a as pe}from"./chunk-PPTZHIIZ.js";import{a as Lo}from"./chunk-OT2RT3GG.js";import{n as ve,q as ee}from"./chunk-ETYXTCKV.js";import{$ as Ce,$a as P,Ab as $,Ac as mn,Ba as E,Bb as R,Bc as wn,Cb as N,D as Ye,Da as Ze,Db as p,Eb as o,Fa as Et,Fb as a,Fc as g,Gb as y,Gc as w,Hc as F,Ic as Wn,J as kn,Jb as Nn,Jd as Ft,Kb as oe,L as Vt,Lb as ae,Lc as Y,Mb as He,Na as je,Nc as Hn,Nd as Le,Oc as fe,P as Lt,Pa as dt,Pb as v,Pd as ct,Qd as te,Sa as Ln,Sb as f,Sc as lt,Sd as Mn,Tc as xe,Ua as c,Ub as m,Vb as ko,Wb as fo,Xb as Bn,Xc as yo,Yb as gt,Zb as U,_a as rt,_b as q,_c as jn,ad as de,bd as Pn,cc as ge,da as J,db as L,dc as rn,eb as tn,ec as xt,fc as ho,gc as X,hb as Rn,hc as s,ia as Oo,ib as Z,ic as S,id as we,ja as at,jb as M,jc as b,ka as en,kc as Co,kd as Un,l as be,la as Vn,ld as pn,mc as D,md as Rt,na as O,nc as I,nd as qn,oc as T,od as ft,qd as Ue,r as _e,ra as u,s as kt,sa as _,sb as me,sc as ln,sd as re,ta as Ie,tc as Vo,va as bt,vc as cn,vd as ue,wb as h,wc as sn,wd as Gn,xc as H,ya as ke,yb as C,yc as k,zb as Ve,zc as Te}from"./chunk-DUSKF5IQ.js";import{a as A,b as V,g as go,j as pt}from"./chunk-NF7PG5F2.js";var yr=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],br=i=>({ID:i});function xr(i,r){if(i&1){let e=v();o(0,"a",6),f("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),y(1,"i",7),s(2," Export "),a()}}function vr(i,r){if(i&1){let e=v();o(0,"div",8)(1,"h6"),s(2,"Customer"),a(),o(3,"autocompleteV2",9),T("ngModelChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.CustomerID,t)||(l.pageData().Filter.CustomerID=t),_(t)}),a(),o(4,"h6"),s(5,"Scope"),a(),o(6,"radio-options",10),T("modelChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.DateFilter,t)||(l.pageData().Filter.DateFilter=t),_(t)}),a(),o(7,"h6"),s(8,"From - To"),a(),o(9,"datepicker",11),T("dateChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.From,t)||(l.pageData().Filter.From=t),_(t)}),a(),o(10,"div",12)(11,"datepicker",13),T("dateChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.To,t)||(l.pageData().Filter.To=t),_(t)}),a()()()}if(i&2){let e=m(2);c(3),D("ngModel",e.pageData().Filter.CustomerID),c(3),D("model",e.pageData().Filter.DateFilter),p("options",e.DateFilter),c(3),p("isFloatingLabel",!1),D("date",e.pageData().Filter.From),c(2),p("isFloatingLabel",!1),D("date",e.pageData().Filter.To)}}function Sr(i,r){if(i&1&&(o(0,"th",21),s(1),a()),i&2){let e=r.$implicit;c(),b(" ",e.HeaderOption," ")}}function Dr(i,r){if(i&1&&(o(0,"td")(1,"span",28),s(2),g(3,"date"),a(),o(4,"span",29),s(5),g(6,"number"),a()()),i&2){let e=r.$implicit;c(2),S(F(3,2,e.Due,"dd MMM")),c(3),S(w(6,5,e.PriceAfterDiscount))}}function Ir(i,r){if(i&1&&(o(0,"tr")(1,"td"),s(2),g(3,"date"),a(),o(4,"td"),s(5),g(6,"date"),a(),o(7,"td")(8,"a",26),s(9),a()(),R(10,Dr,7,7,"td",null,$),o(12,"td",27),s(13),g(14,"number"),a()()),i&2){let e=r.$implicit;c(2),S(F(3,6,e.DeliveryDate,"dd MMM")),c(3),S(F(6,9,e.InvoiceDate,"dd MMM")),c(3),p("routerLink",H(14,yr))("queryParams",k(15,br,e.ID)),c(),S(e.Number),c(),N(e.ARColumn),c(3),S(w(14,12,e.Total))}}function Tr(i,r){i&1&&y(0,"td",25)}function wr(i,r){if(i&1){let e=v();o(0,"div")(1,"h6",14),s(2),a(),o(3,"table",15),f("matSortChange",function(t){let l=u(e).$index,d=m(2);return _(d.sortData(t,l))}),o(4,"thead",16)(5,"tr",17)(6,"th",18),s(7," DLVRY. DATE "),a(),o(8,"th",19),s(9," INV. DATE "),a(),o(10,"th",20),s(11," Number "),a(),R(12,Sr,2,1,"th",21,$),o(14,"th",22),s(15),a()()(),o(16,"tbody"),R(17,Ir,15,17,"tr",null,$),a(),o(19,"tfoot")(20,"tr",23),y(21,"td",24)(22,"td",24)(23,"td",24),R(24,Tr,1,0,"td",25,$),o(26,"td",25),s(27),g(28,"sum"),g(29,"number"),a()()()()()}if(i&2){let e=r.$implicit;c(2),S(e.Name),c(10),N(e.AR),c(3),b(" ",e.Header!=null?e.Header:"Total"," "),c(2),N(e.Invoice),c(7),N(e.AR),c(3),b(" ",w(29,6,F(28,3,e.Invoice,"Total"))," ")}}function Pr(i,r){if(i&1){let e=v();o(0,"mainpanel-cmp",2),T("textChange",function(t){u(e);let l=m();return I(l.pageData().Filter.Text,t)||(l.pageData().Filter.Text=t),_(t)}),f("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),T("filterChange",function(t){u(e);let l=m();return I(l.pageData().Filter,t)||(l.pageData().Filter=t),_(t)}),o(1,"actions"),h(2,xr,3,0,"a",3),a(),o(3,"filters"),M(4,vr,12,7,"ng-template",null,0,Y),a(),o(6,"content")(7,"div",4),R(8,wr,30,8,"div",null,$),o(10,"h2",5),s(11),g(12,"number"),a()()()()}if(i&2){let e=m();p("pageData",e.menuData()),D("text",e.pageData().Filter.Text),p("isFilterOnDropdown",!1),D("filter",e.pageData().Filter),c(2),C(!(e.role==null||e.role.global==null)&&e.role.global.Export?2:-1),c(6),N(e.data().Data),c(3),b(" Total AR : ",w(12,6,e.data().TotalAR)," ")}}var wi=class i extends Ne{constructor(e,n,t,l,d){super(e,n,"Debt/PaymentDiscountIllustrationList","DebtLoader/PaymentDiscountIllustrationLoader");this.httpService=n;this.csvConverter=t;this.role=l;this.matDialog=d}httpService;csvConverter;role;matDialog;originalData=E([]);DateFilter=[{Key:!1,Value:"None"},{Key:!0,Value:"Range"}];openExportModal(){this.matDialog.open(he,{data:{title:"Payment Discount Illustration",exportTypes:[{ID:"Debt/PaymentDiscountIllustrationList",Value:"Default",FileName:"PaymentIllustration"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.menuData().H=e.PageTitle,this.originalData.set(e.Data)}sortData(e,n){let t=this.data().Data[n].Invoice.slice();if(!e.active||e.direction===""){this.data().Data[n]=this.originalData()[n];return}this.data().Data[n].Invoice=t.sort((l,d)=>{let x=e.direction==="asc";switch(typeof l[e.active]){case"string":return this.compare(l[e.active].toLocaleLowerCase(),d[e.active].toLocaleLowerCase(),x);case"number":return this.compare(l[e.active],d[e.active],x);default:return 0}})}static \u0275fac=function(n){return new(n||i)(P(z),P(ee),P(Ge),P(ne),P(le))};static \u0275cmp=L({type:i,selectors:[["ng-component"]],standalone:!1,features:[Z],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button",1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"float-end","me-7","mt-5"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-upload"],[1,"dialog-filter"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","Date",3,"modelChange","model","options"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],[1,"text-primary","ng-binding","mt-2"],["matSort","",1,"table","mt-3",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","DeliveryDate",1,"align-left",2,"width","100px"],["mat-sort-header","InvoiceDate",1,"align-left",2,"width","100px"],["mat-sort-header","Number",1,"align-left",2,"width","100px"],[2,"text-align","right"],["mat-sort-header","Total",1,"flex-right","text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end","text-success"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"float-start"],[1,"float-end"]],template:function(n,t){n&1&&h(0,Pr,13,8,"mainpanel-cmp",1),n&2&&C(t.data()?0:-1)},dependencies:[ie,te,G,K,ce,mi,Me,Ae,nt,re,Ue,Ke],encapsulation:2,changeDetection:0})};var Mr=["data-p-icon","angle-double-down"],La=(()=>{class i extends si{static \u0275fac=(()=>{let e;return function(t){return(e||(e=Et(i)))(t||i)}})();static \u0275cmp=L({type:i,selectors:[["","data-p-icon","angle-double-down"]],features:[Z],attrs:Mr,decls:1,vars:0,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M6.70786 6.59831C6.80043 6.63674 6.89974 6.65629 6.99997 6.65581C7.19621 6.64081 7.37877 6.54953 7.50853 6.40153L11.0685 2.8416C11.1364 2.69925 11.1586 2.53932 11.132 2.38384C11.1053 2.22837 11.0311 2.08498 10.9195 1.97343C10.808 1.86188 10.6646 1.78766 10.5091 1.76099C10.3536 1.73431 10.1937 1.75649 10.0513 1.82448L6.99997 4.87585L3.9486 1.82448C3.80625 1.75649 3.64632 1.73431 3.49084 1.76099C3.33536 1.78766 3.19197 1.86188 3.08043 1.97343C2.96888 2.08498 2.89466 2.22837 2.86798 2.38384C2.84131 2.53932 2.86349 2.69925 2.93147 2.8416L6.46089 6.43205C6.53132 6.50336 6.61528 6.55989 6.70786 6.59831ZM6.70786 12.1925C6.80043 12.2309 6.89974 12.2505 6.99997 12.25C7.10241 12.2465 7.20306 12.2222 7.29575 12.1785C7.38845 12.1348 7.47124 12.0726 7.53905 11.9957L11.0685 8.46629C11.1614 8.32292 11.2036 8.15249 11.1881 7.98233C11.1727 7.81216 11.1005 7.6521 10.9833 7.52781C10.866 7.40353 10.7104 7.3222 10.5415 7.29688C10.3725 7.27155 10.1999 7.30369 10.0513 7.38814L6.99997 10.4395L3.9486 7.38814C3.80006 7.30369 3.62747 7.27155 3.45849 7.29688C3.28951 7.3222 3.13393 7.40353 3.01667 7.52781C2.89942 7.6521 2.82729 7.81216 2.81184 7.98233C2.79639 8.15249 2.83852 8.32292 2.93148 8.46629L6.4609 12.0262C6.53133 12.0975 6.61529 12.1541 6.70786 12.1925Z","fill","currentColor"]],template:function(n,t){n&1&&(Ie(),Nn(0,"path",0))},encapsulation:2})}return i})();var Ar=["data-p-icon","angle-double-up"],Ra=(()=>{class i extends si{static \u0275fac=(()=>{let e;return function(t){return(e||(e=Et(i)))(t||i)}})();static \u0275cmp=L({type:i,selectors:[["","data-p-icon","angle-double-up"]],features:[Z],attrs:Ar,decls:1,vars:0,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M10.1504 6.67719C10.2417 6.71508 10.3396 6.73436 10.4385 6.73389C10.6338 6.74289 10.8249 6.67441 10.97 6.54334C11.1109 6.4023 11.19 6.21112 11.19 6.01178C11.19 5.81245 11.1109 5.62127 10.97 5.48023L7.45977 1.96998C7.31873 1.82912 7.12755 1.75 6.92821 1.75C6.72888 1.75 6.5377 1.82912 6.39666 1.96998L2.9165 5.45014C2.83353 5.58905 2.79755 5.751 2.81392 5.91196C2.83028 6.07293 2.89811 6.22433 3.00734 6.34369C3.11656 6.46306 3.26137 6.54402 3.42025 6.57456C3.57914 6.60511 3.74364 6.5836 3.88934 6.51325L6.89813 3.50446L9.90691 6.51325C9.97636 6.58357 10.0592 6.6393 10.1504 6.67719ZM9.93702 11.9993C10.065 12.1452 10.245 12.2352 10.4385 12.25C10.632 12.2352 10.812 12.1452 10.9399 11.9993C11.0633 11.8614 11.1315 11.6828 11.1315 11.4978C11.1315 11.3128 11.0633 11.1342 10.9399 10.9963L7.48987 7.48609C7.34883 7.34523 7.15765 7.26611 6.95832 7.26611C6.75899 7.26611 6.5678 7.34523 6.42677 7.48609L2.91652 10.9963C2.84948 11.1367 2.82761 11.2944 2.85391 11.4477C2.88022 11.601 2.9534 11.7424 3.06339 11.8524C3.17338 11.9624 3.31477 12.0356 3.46808 12.0619C3.62139 12.0882 3.77908 12.0663 3.91945 11.9993L6.92823 8.99048L9.93702 11.9993Z","fill","currentColor"]],template:function(n,t){n&1&&(Ie(),Nn(0,"path",0))},encapsulation:2})}return i})();var Fr=()=>["New_Join_Bill"],Or=()=>["New_Join_Bill/Info"],Do=i=>({ID:i}),kr=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],Vr=(i,r,e)=>({"text-success":i,"text-warning":r,"text-danger":e});function Lr(i,r){if(i&1){let e=v();o(0,"a",12),f("click",function(){u(e);let t=m(2);return _(t.httpPostListID("Debt/DeleteAppCollection"))}),y(1,"i",13),s(2," Delete"),a()}}function Rr(i,r){if(i&1){let e=v();o(0,"a",12),f("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),y(1,"i",14),s(2," Export "),a()}}function Nr(i,r){i&1&&(o(0,"a",4),s(1,"Add "),a()),i&2&&p("routerLink",H(1,Fr))}function Br(i,r){if(i&1){let e=v();o(0,"div",15)(1,"h6"),s(2,"Outlet"),a(),o(3,"outlet-selector",16),T("ngModelChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.EntityID,t)||(l.pageData().Filter.EntityID=t),_(t)}),a(),o(4,"h6"),s(5,"Supplier"),a(),o(6,"autocompleteV2",17),T("ngModelChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.SupplierID,t)||(l.pageData().Filter.SupplierID=t),_(t)}),a(),o(7,"h6"),s(8,"From - To"),a(),o(9,"datepicker",18),T("dateChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.From,t)||(l.pageData().Filter.From=t),_(t)}),a(),o(10,"div",19)(11,"datepicker",20),T("dateChange",function(t){u(e);let l=m(2);return I(l.pageData().Filter.To,t)||(l.pageData().Filter.To=t),_(t)}),a()()()}if(i&2){let e=m(2);c(3),p("accessType",2),D("ngModel",e.pageData().Filter.EntityID),c(3),D("ngModel",e.pageData().Filter.SupplierID),c(3),p("isFloatingLabel",!1),D("date",e.pageData().Filter.From),c(2),p("isFloatingLabel",!1),D("date",e.pageData().Filter.To)}}function Wr(i,r){if(i&1){let e=v();o(0,"th",9)(1,"input",21),f("change",function(t){u(e);let l=m(2);return _(l.onSelectAllData(t.target.checked))}),a()()}}function Hr(i,r){if(i&1){let e=v();o(0,"td",9)(1,"input",26),T("ngModelChange",function(t){u(e);let l=m().$implicit;return I(l.selected,t)||(l.selected=t),_(t)}),a()()}if(i&2){let e=m().$implicit;c(),D("ngModel",e.selected)}}function jr(i,r){if(i&1&&(o(0,"tr"),h(1,Hr,2,1,"td",9),o(2,"td"),s(3),a(),o(4,"td")(5,"a",22),s(6),a()(),o(7,"td")(8,"a",22),s(9),a()(),o(10,"td"),s(11),g(12,"date"),a(),o(13,"td"),s(14),g(15,"IsMinDate"),a(),y(16,"td",23),g(17,"newlines"),o(18,"td")(19,"span"),s(20),a()(),o(21,"td")(22,"a",24),y(23,"i",25),a()()()),i&2){let e=r.$implicit,n=m(2);c(),C(n.role.debt.Delete?1:-1),c(2),S(e.EntityName),c(2),p("routerLink",H(23,Or))("queryParams",k(24,Do,e.ID)),c(),b("",e.Number," "),c(2),p("routerLink",H(26,kr))("queryParams",k(27,Do,e.SupplierID)),c(),b("",e.Name," "),c(2),S(F(12,15,e.Date,"dd MMM yyyy")),c(3),S(F(15,18,e.Due,"dd MMM yyyy")),c(2),p("innerHTML",w(17,21,e.Note),je),c(3),X(mn(29,Vr,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),c(),S(e.PaymentStateLabel),c(2),p("queryParams",k(33,Do,e.ID))}}function Ur(i,r){if(i&1){let e=v();o(0,"mat-paginator",27),f("page",function(t){u(e);let l=m(2);return _(l.onPaginationChange(t))}),a()}if(i&2){let e=m(2);p("length",e.pagination.listTotal())("pageSize",e.pagination.pageSize())("pageIndex",e.pageData().Filter.PageNumber==0?0:e.pageData().Filter.PageNumber-1)}}function qr(i,r){if(i&1){let e=v();o(0,"mainpanel-cmp",2),T("textChange",function(t){u(e);let l=m();return I(l.pageData().Filter.Number,t)||(l.pageData().Filter.Number=t),_(t)}),f("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),T("filterChange",function(t){u(e);let l=m();return I(l.pageData().Filter,t)||(l.pageData().Filter=t),_(t)}),o(1,"actions"),h(2,Lr,3,0,"a",3),h(3,Rr,3,0,"a",3),h(4,Nr,2,2,"a",4),a(),o(5,"filters"),M(6,Br,12,7,"ng-template",null,0,Y),a(),o(8,"content")(9,"div",5)(10,"div",6)(11,"table",7)(12,"thead",8)(13,"tr"),h(14,Wr,2,0,"th",9),o(15,"th"),s(16,"Outlet"),a(),o(17,"th"),s(18,"Number"),a(),o(19,"th"),s(20,"Supplier"),a(),o(21,"th"),s(22,"Date"),a(),o(23,"th"),s(24,"Due"),a(),o(25,"th"),s(26,"Note"),a(),o(27,"th"),s(28,"Payment"),a(),y(29,"th",10),a()(),o(30,"tbody"),R(31,jr,24,35,"tr",null,$),a()(),o(33,"div"),h(34,Ur,1,3,"mat-paginator",11),a()()()()()}if(i&2){let e=m();p("pageData",e.menuData()),D("text",e.pageData().Filter.Number),p("isFilterOnDropdown",!1),D("filter",e.pageData().Filter),c(2),C(e.getSelectedData().length>0?2:-1),c(),C(e.role.global.Export?3:-1),c(),C(e.role.debt.Create?4:-1),c(10),C(e.role.debt.Delete?14:-1),c(17),N(e.data().Data),c(3),C(e.pagination.listTotal()>0?34:-1)}}var Pi=class i extends Ne{constructor(e,n,t,l,d,x){super(e,n,"Debt/GetAppCollection","DebtLoader/GetAppCollection",l);this.httpService=n;this.csvConverter=t;this.matDialog=d;this.role=x}httpService;csvConverter;matDialog;role;renderer=O(rt);ngAfterViewInit(){this.renderer.removeClass(document.querySelector("#full-container"),"full-container")}openExportModal(){this.matDialog.open(he,{data:{title:"Join Bill",exportTypes:[{ID:"Debt/GetAppCollection",Value:"Default",FileName:"Join Bill"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(n){return new(n||i)(P(z),P(ee),P(Ge),P(ve),P(le),P(ne))};static \u0275cmp=L({type:i,selectors:[["ng-component"]],standalone:!1,features:[Z],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button",1,"btn","btn-outline-secondary","me-3"],["role","button",1,"btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","14px"],[2,"width","3px"],[3,"length","pageSize","pageIndex"],["role","button",1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa-solid","fa-trash"],[1,"fa","fa-upload"],[1,"dialog-filter"],["placeholder","Choose an Outlet",3,"ngModelChange","accessType","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["type","checkbox",3,"change"],["target","_blank",3,"routerLink","queryParams"],[3,"innerHTML"],["routerLink","/print/BulkSupplierInvoice","target","_blank",3,"queryParams"],["aria-hidden","true",1,"fa","fa-print"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"page","length","pageSize","pageIndex"]],template:function(n,t){n&1&&h(0,qr,35,9,"mainpanel-cmp",1),n&2&&C(t.data()?0:-1)},dependencies:[ie,te,dn,G,K,ni,ce,nt,Ee,Ue,ci,Pt],encapsulation:2,changeDetection:0})};var Ba=i=>({selected:i});function Kr(i,r){if(i&1){let e=v();o(0,"a",4),f("click",function(){let t=u(e).$implicit,l=m();return _(l.onChangeTab(t))}),s(1),a()}if(i&2){let e=r.$implicit,n=m();p("ngClass",k(2,Ba,n.activeTab().key===e.key)),c(),b(" ",e.value," ")}}function Jr(i,r){if(i&1){let e=v();o(0,"div",3)(1,"div",5)(2,"datepicker",6),T("dateChange",function(t){u(e);let l=m();return I(l.Dialog.Date,t)||(l.Dialog.Date=t),_(t)}),a()(),o(3,"div",5)(4,"div",7)(5,"ng-select",8),T("ngModelChange",function(t){u(e);let l=m();return I(l.Dialog.MethodID,t)||(l.Dialog.MethodID=t),_(t)}),a(),o(6,"label",9),s(7,"Payment Method"),a()()(),o(8,"div",5)(9,"div",10)(10,"input",11),T("ngModelChange",function(t){u(e);let l=m();return I(l.Dialog.Amount,t)||(l.Dialog.Amount=t),_(t)}),a(),o(11,"label",12),s(12,"Amount"),a()()(),o(13,"div",5)(14,"div",10)(15,"input",13),T("ngModelChange",function(t){u(e);let l=m();return I(l.Dialog.Code,t)||(l.Dialog.Code=t),_(t)}),a(),o(16,"label",14),s(17,"Payment Code"),a()()(),o(18,"div",15)(19,"POS-tinymce-editor",16),T("ngModelChange",function(t){u(e);let l=m();return I(l.Dialog.Note,t)||(l.Dialog.Note=t),_(t)}),a()()()}if(i&2){let e=m();c(2),p("disabled",!e.roleService.global.Date)("matTooltip",e.roleService.global.Date?"":"Date role is required"),D("date",e.Dialog.Date),c(2),p("ngClass",k(10,Ba,e.isNotEmpty(e.Options))),c(),D("ngModel",e.Dialog.MethodID),p("items",e.Options)("clearable",!1),c(5),D("ngModel",e.Dialog.Amount),c(5),D("ngModel",e.Dialog.Code),c(4),D("ngModel",e.Dialog.Note)}}function zr(i,r){if(i&1){let e=v();o(0,"POS-uppy",18),f("fileUploadComplete",function(t){u(e);let l=m(2);return _(l.onUpload(t))}),a()}if(i&2){let e=m(2);p("uppyCoreConfiguration",e.uppyCoreConfiguration)("dashboardPropsConfiguration",e.dashboardProps)("subtitle","Accepted file formats: .jpeg and .pdf & max file size: 2.5 MB")}}function Qr(i,r){if(i&1){let e=v();o(0,"div",19)(1,"a",20),y(2,"i",21),o(3,"h5",22),s(4,"File Uploaded"),a(),o(5,"small",23),s(6),a(),o(7,"div",24)(8,"i",25),f("click",function(t){u(e);let l=m(3);return _(l.onRemoveFile(t))}),a()()()()}if(i&2){let e=m(3);c(),p("href",e.fileUrl,dt),c(5),S(e.fileName)}}function $r(i,r){if(i&1){let e=v();o(0,"div",19)(1,"a",20)(2,"img",26),f("click",function(t){u(e);let l=m(3);return _(l.openBiggerPicture(l.fileUrl,t))}),a(),o(3,"small",27),s(4),a(),o(5,"div",24)(6,"i",25),f("click",function(t){u(e);let l=m(3);return _(l.onRemoveFile(t))}),a()()()()}if(i&2){let e=m(3);c(),p("href",e.fileUrl,dt),c(),p("src",e.fileUrl,dt),c(2),S(e.fileName)}}function Yr(i,r){if(i&1&&h(0,Qr,9,2,"div",19)(1,$r,7,3,"div",19),i&2){let e=m(2);C(e.isPdfFile?0:1)}}function Xr(i,r){if(i&1&&(o(0,"div",3)(1,"div",15),h(2,zr,1,3,"POS-uppy",17)(3,Yr,2,1),a()()),i&2){let e=m();c(2),C(e.isUploadFile?3:2)}}var yn=class i{constructor(r,e,n){this.dialogRef=r;this.data=e;this.httpService=n;this.Dialog=A({},e.paymentDetail),this.Dialog.SumInvoice=e.totalAmount,this.Options=e.option,this.InfoID=e.queryString.ID,this.form=A({},e.paymentDetail),this.storagePath=e.storagePath,this.cloudflareDebtID=e.uuid,this.initShowingImage(),this.setTemporaryID()}dialogRef;data;httpService;toastrService=O(ve);storagePath="";isUploadFile;fileName;fileUrl;isPdfFile=!1;isRemoveImage;config=new Je;roleService=O(ne);bigPicture=O(Cn);Dialog;Options;InfoID;form={ImageUrlClient:"",ImageUrl:"",ID:""};cloudflareDebtID;processUppy=O(ka);tabs=E([{key:0,value:"General",active:!0},{key:1,value:"Attachment",active:!1}]);uppyCoreConfiguration={restrictions:{allowedFileTypes:["image/*",".jpg",".jpeg",".png",".pdf"],maxTotalFileSize:Lo.uppy.invoicePayment}};dashboardProps={height:325};setTemporaryID(){pe.IsEmpty(this.form.ID)?this.onGetUUID().subscribe(r=>{this.form.TemporaryID=r,this.cloudflareDebtID=this.form.TemporaryID}):this.cloudflareDebtID=this.form.ID}onRemoveFile(r){r.preventDefault(),this.isUploadFile=!1,this.fileUrl=null,this.fileName=null,this.isRemoveImage=!0}openBiggerPicture(r,e){this.bigPicture.openBiggerPicture(e,r)}initShowingImage(){this.isUploadFile=!1,this.isRemoveImage=!1,pe.IsNotEmpty(this.form.ImageUrlClient)&&(this.fileUrl=this.form.ImageUrlClient,this.fileName=this.form.ImageUrl,this.checkIsPdfFile(),this.isUploadFile=!0)}checkIsPdfFile(){let r=this.fileName.split(".").pop();this.isPdfFile=r=="pdf"}isNotEmpty(r){return pe.IsNotEmpty(r)}ngOnInit(){this.config.headerType=qe.Success,this.config.title="Payment Detail",this.config.bodyScrollable=!0,this.config.customWidth="600px"}onOk(){this.Dialog.InfoID=this.InfoID,this.Dialog.ImageUrlClient=this.fileUrl,this.Dialog.ImageUrl=this.fileName,this.Dialog.PaymentID=this.cloudflareDebtID,this.dialogRef.close({Dialog:this.Dialog})}onChangeTab(r){this.tabs.update(e=>e.map(n=>(n.active=!1,n.key===r.key&&(n.active=!0),n)))}activeTab=fe(()=>this.tabs().find(r=>r.active));noteValueChange(r){this.Dialog.Note=r}onUpload(r){this.processUppy.uploadFileThroughPreSignedUrl(r,this.storagePath+this.cloudflareDebtID).subscribe(e=>{this.fileName=r.name,this.fileUrl=e.url})}onGetUUID(){return this.httpService.get(An.GetUUID).pipe(_e(r=>r.UUID))}static \u0275fac=function(e){return new(e||i)(P(et),P(tt),P(ee))};static \u0275cmp=L({type:i,selectors:[["modal-add-payment"]],standalone:!1,decls:8,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"row","border-bottom"],["data-cy","tab-note",1,"btn","btn-link","note-tab",3,"ngClass"],[1,"row",2,"margin","1rem 0"],["data-cy","tab-note",1,"btn","btn-link","note-tab",3,"click","ngClass"],[1,"col-sm-6"],["matTooltipPosition","above","name","orderDate","placeholder","Date","appearance","outline",2,"height","auto","font-size","16px","width","100%","padding","0",3,"dateChange","disabled","matTooltip","date"],[1,"form-floating-outline",3,"ngClass"],["id","paymentMethod","appendTo","body","bindLabel","Name","bindValue","ID","name","paymentMethod",1,"productform",3,"ngModelChange","ngModel","items","clearable"],["for","paymentMethod",1,"ng-select"],[1,"form-floating-outline"],["type","text","id","amount","autoNum","","autofocus","","placeholder","Amount","name","sumInvoice",1,"form-control",2,"width","100%",3,"ngModelChange","ngModel"],["for","amount"],["type","text","id","code","placeholder","Payment Code","name","code",1,"form-control",3,"ngModelChange","ngModel"],["for","code"],[1,"col-sm-12"],[3,"ngModelChange","ngModel"],[3,"uppyCoreConfiguration","dashboardPropsConfiguration","subtitle"],[3,"fileUploadComplete","uppyCoreConfiguration","dashboardPropsConfiguration","subtitle"],[1,"file-container"],["target","_blank",1,"d-flex","flex-column","align-items-center","justify-content-center","cursor-pointer",3,"href"],[1,"fa-regular","fa-4x","fa-circle-check"],[1,"mt-2"],[1,"text-dark","mt-2"],[1,"position-absolute","rm-img","pointer"],["matTooltipPosition","above","matTooltip","Remove Image",1,"fa-light","fa-trash","text-danger","fa-2x",3,"click"],[2,"width","200px",3,"click","src"],[1,"text-dark","mt-2","px-3"]],template:function(e,n){if(e&1&&(o(0,"modal-material",0),f("onOk",function(){return n.onOk()})("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"div"),R(4,Kr,2,4,"a",2,Ve),a()(),h(6,Jr,20,12,"div",3)(7,Xr,4,1,"div",3),a()()),e&2){let t;p("config",n.config),c(4),N(n.tabs()),c(2),C((t=n.activeTab().key)===0?6:t===1?7:-1)}},dependencies:[we,Pe,G,K,Qe,Be,wt,ce,Jt,Re,bi],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.clickable[_ngcontent-%COMP%]{cursor:pointer}.btn-link.note-tab[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.note-tab.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}a.btn.btn-link.note-tab[_ngcontent-%COMP%]{color:inherit}.rm-img[_ngcontent-%COMP%]{background:#fff;padding:10px;border-radius:100%;border:1px solid rgba(51,51,51,.2);top:55px;right:0}.file-container[_ngcontent-%COMP%]{height:325px;border:1px solid #c8d3df;border-radius:.375rem;display:flex;align-items:center;justify-content:center} .tox.tox-tinymce{height:175px!important}"]})};var bn=class i{constructor(r,e={writeOffOptions:[],writeOffPayment:{ID:null,Note:null,ReasonID:null,Date:null,Amount:0}}){this.dialogRef=r;this.data=e;this.note=this.data?.writeOffPayment?.Note||null,this.date=this.data?.writeOffPayment?.Date||new Date,this.tagId=this.data?.writeOffPayment?.ReasonID||this.data?.writeOffPayment?.WriteOffOptionID}dialogRef;data;date;note;tagId;configModal;ngOnInit(){this.configModal=new Je,this.configModal.title="Write Off",this.configModal.customWidth="500px"}isNotEmpty(r){return pe.IsNotEmpty(r)}onOk(){this.dialogRef.close({ID:this.data?.writeOffPayment?.ID,Amount:this.data?.writeOffPayment?.Amount||0,Note:this.note,ReasonID:this.tagId,Date:this.date})}static \u0275fac=function(e){return new(e||i)(P(et),P(tt))};static \u0275cmp=L({type:i,selectors:[["CustomerDisplay-modal-write-off"]],decls:18,vars:7,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row","mt-5"],[1,"col","fw-bold","d-flex","align-items-center"],[1,"col-10"],["matTooltipPosition","above","matTooltip","Date","name","Date","placeholder","Date","appearance","outline",2,"height","auto","font-size","16px","width","100%","padding","0",3,"dateChange","date","hidelClearBtn"],["bindLabel","Name","appendTo","body","bindValue","ID","placeholder","Choose a reason",1,"writeoff-tag",3,"ngModelChange","ngModel","items","clearable"],[3,"ngModelChange","ngModel"]],template:function(e,n){e&1&&(o(0,"modal-material",0),f("onOk",function(){return n.onOk()})("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"div",2)(4,"div",3),s(5,"Date"),a(),o(6,"div",4)(7,"datepicker",5),T("dateChange",function(l){return I(n.date,l)||(n.date=l),l}),a()()(),o(8,"div",2)(9,"div",3),s(10,"Tag"),a(),o(11,"div",4)(12,"ng-select",6),T("ngModelChange",function(l){return I(n.tagId,l)||(n.tagId=l),l}),a()()(),o(13,"div",2)(14,"div",3),s(15,"Note"),a(),o(16,"div",4)(17,"POS-tinymce-editor",7),T("ngModelChange",function(l){return I(n.note,l)||(n.note=l),l}),a()()()()()()),e&2&&(p("config",n.configModal),c(7),D("date",n.date),p("hidelClearBtn",!0),c(5),D("ngModel",n.tagId),p("items",n.data==null?null:n.data.writeOffOptions)("clearable",n.isNotEmpty(n.tagId)),c(5),D("ngModel",n.note))},dependencies:[Qe,Se,G,K,Be,Jt,ce],styles:["ng-select.writeoff-tag div.ng-select-container{height:48px!important} ng-select.writeoff-tag div.ng-select-container div.ng-placeholder{font-size:14px!important}"]})};var Zr=(i,r)=>({ID:i,Template:r}),el=(i,r)=>({ID:i,Template:r,Mode:"Copy"}),tl=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],Wa=i=>({ID:i}),nl=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],il=i=>({"d-flex":i});function ol(i,r){if(i&1){let e=v();o(0,"button",34),f("click",function(){u(e);let t=m(2);return _(t.onEdit())}),y(1,"i",35),s(2," Edit "),a()}}function al(i,r){if(i&1){let e=v();o(0,"a",36),f("click",function(){let t;u(e);let l=m(2);return _(l.removeData("Debt/InvoiceDelete",(t=l.data().Info)==null?null:t.ID))}),y(1,"i",37),s(2," Delete"),a()}}function rl(i,r){if(i&1&&(o(0,"td"),s(1),g(2,"date"),a()),i&2){let e,n=m(2);c(),b(" ",F(2,1,(e=n.data().Info)==null?null:e.Due,"d/MM/yyyy")," ")}}function ll(i,r){if(i&1&&(o(0,"tr")(1,"th"),s(2,"Journal Link"),a(),o(3,"td"),s(4,":"),a(),o(5,"td")(6,"a",38),s(7,"Books Journal"),a()()()),i&2){let e,n=m(2);c(6),p("href",Vo("https://books.dealpos.app/pages/journal/journal-entry?BulkID=",(e=n.data().Info)==null?null:e.ID),dt)}}function cl(i,r){i&1&&(o(0,"th",25),s(1,"Supplier"),a())}function sl(i,r){if(i&1&&(o(0,"td",25),s(1),a()),i&2){let e=m().$implicit;c(),b(" ",e.Data.SupplierName," ")}}function ml(i,r){if(i&1&&(o(0,"tr")(1,"td"),s(2),a(),o(3,"td"),s(4),g(5,"date"),a(),o(6,"td"),s(7),g(8,"date"),a(),o(9,"td")(10,"a",14),s(11),a()(),h(12,sl,2,1,"td",25),o(13,"td",29),s(14),g(15,"number"),a()()),i&2){let e=r.$implicit,n=r.$index,t=m(2);c(2),b("",n+1,"."),c(2),S(F(5,8,e.Data.Date,"dd MMM yyyy")),c(3),S(F(8,11,e.Data.Due,"dd MMM")),c(3),p("routerLink",H(16,nl))("queryParams",k(17,Wa,e.ID)),c(),S(e.Number),c(),C(t.areAllSupplierNamesSame()?-1:12),c(2),b(" ",w(15,14,e.RemainingPaymentBaseCurrency)," ")}}function pl(i,r){i&1&&y(0,"td")}function dl(i,r){if(i&1){let e=v();o(0,"a",39),f("click",function(){u(e);let t=m(2);return _(t.showPaymentModal(t.data().Payment))}),s(1,"Add"),a()}}function ul(i,r){if(i&1){let e=v();o(0,"a",39),f("click",function(){u(e);let t=m(2);return _(t.showWriteOff())}),s(1,"Write Off"),a()}}function _l(i,r){if(i&1){let e=v();o(0,"a",39),f("click",function(){u(e);let t=m(2);return _(t.cancelWriteOff())}),s(1,"Cancel Write Off"),a()}}function gl(i,r){i&1&&y(0,"th",44)}function fl(i,r){if(i&1&&(o(0,"div",45),g(1,"date"),g(2,"date"),o(3,"span"),s(4),g(5,"date"),a(),y(6,"i",57),a()),i&2){let e=m().$implicit;p("matTooltip",cn("Created : ",e.CreatorLoginID," - ",F(1,5,e.Created,"dd MMM yyyy HH:mm")," ",e.ModifierLoginID?`
2
2
  Modified : `+e.ModifierLoginID+" - "+F(2,8,e.Modified,"dd MMM yyyy HH:mm"):"")),c(4),S(F(5,11,e.Date,"dd MMM yyyy"))}}function hl(i,r){if(i&1&&(s(0),g(1,"date")),i&2){let e=m().$implicit;b(" ",F(1,1,e.Date,"dd MMM yyyy")," ")}}function Cl(i,r){if(i&1&&(o(0,"a",58),s(1),a()),i&2){let e=m(2).$implicit;p("href",e.ImageUrlClient,dt),c(),b(" ",e.ImageUrl," ")}}function yl(i,r){if(i&1){let e=v();o(0,"img",60),f("click",function(t){u(e);let l=m(2).$implicit,d=m(3);return _(d.openBigPicture(l.ImageUrlClient,t))}),a()}if(i&2){let e=m(2).$implicit;p("src",e.Thumbnail??e.ImageUrlClient,dt)}}function bl(i,r){if(i&1&&h(0,Cl,2,2,"a",58)(1,yl,1,1,"img",59),i&2){let e=m().$implicit;C(e.IsPdfFile?0:1)}}function xl(i,r){if(i&1&&y(0,"span",48),i&2){let e=m().$implicit;p("innerHTML",e.Note,je)}}function vl(i,r){if(i&1){let e=v();o(0,"a",61),f("click",function(){u(e);let t=m().$implicit,l=m(3);return _(l.showPaymentModal(t))}),s(1,"Edit"),a()}}function Sl(i,r){if(i&1){let e=v();o(0,"tr")(1,"td"),h(2,fl,7,14,"div",45)(3,hl,2,4),a(),o(4,"td"),s(5),a(),o(6,"td",29),s(7),g(8,"number"),a(),o(9,"td"),s(10),a(),o(11,"td",46),h(12,bl,2,1),o(13,"div",47),h(14,xl,1,1,"span",48),a()(),o(15,"td")(16,"div",49),h(17,vl,2,0,"a",50),o(18,"button",51),y(19,"b",52),a(),o(20,"ul",53)(21,"li",54)(22,"a",55),f("click",function(){let t=u(e).$implicit,l=m(3);return _(l.DeletePayment(t))}),y(23,"i",56),s(24," Delete "),a()()()()()()}if(i&2){let e=r.$implicit,n=m(3);c(2),C(n.role.users.LogRestriction?3:2),c(3),S(e.MethodName),c(2),b(" ",w(8,8,e.Amount)," "),c(3),S(e.Code),c(),p("ngClass",k(10,il,e.ImageUrlClient&&!e.IsPdfFile)),c(),C(e.ImageUrlClient?12:-1),c(2),C(e.Note?14:-1),c(3),C(n.role.payment.Edit?17:-1)}}function Dl(i,r){if(i&1&&(o(0,"div",45),g(1,"date"),g(2,"date"),o(3,"span"),s(4),g(5,"date"),a(),y(6,"i",57),a()),i&2){let e,n,t=m(4);p("matTooltip",cn("Created : ",(e=t.data())==null||e.WriteOffPayment==null?null:e.WriteOffPayment.CreatorName," - ",F(1,5,(e=t.data())==null||e.WriteOffPayment==null?null:e.WriteOffPayment.Created,"dd MMM yyyy HH:mm")," ",!((e=t.data())==null||e.WriteOffPayment==null)&&e.WriteOffPayment.ModifierName?`
3
3
  Modified : `+((e=t.data())==null||e.WriteOffPayment==null?null:e.WriteOffPayment.ModifierName)+" - "+F(2,8,(e=t.data())==null||e.WriteOffPayment==null?null:e.WriteOffPayment.Modified,"dd MMM yyyy HH:mm"):"")),c(4),S(F(5,11,(n=t.data())==null||n.WriteOffPayment==null?null:n.WriteOffPayment.Date,"dd MMM yyyy"))}}function Il(i,r){if(i&1&&(o(0,"span"),s(1),g(2,"date"),a()),i&2){let e,n=m(4);c(),b(" ",F(2,1,(e=n.data())==null||e.WriteOffPayment==null?null:e.WriteOffPayment.Date,"dd MMM yyyy")," ")}}function Tl(i,r){if(i&1){let e=v();o(0,"a",61),f("click",function(){u(e);let t=m(4);return _(t.showWriteOff())}),s(1,"Edit"),a()}}function wl(i,r){if(i&1){let e=v();o(0,"ul",53)(1,"li",54)(2,"a",63),f("click",function(){u(e);let t=m(4);return _(t.cancelWriteOff())}),s(3,"Cancel Write Off"),a()()()}}function Pl(i,r){if(i&1&&(o(0,"tr")(1,"td"),h(2,Dl,7,14,"div",45)(3,Il,3,4,"span"),a(),o(4,"td"),s(5,"Write Off"),a(),o(6,"td",29),s(7),g(8,"number"),a(),y(9,"td"),o(10,"td")(11,"p"),s(12),a(),y(13,"p",62),a(),o(14,"td")(15,"div",49),h(16,Tl,2,0,"a",50),o(17,"button",51),y(18,"b",52),a(),h(19,wl,4,0,"ul",53),a()()()),i&2){let e,n,t,l=m(3);c(2),C(l.role.users.LogRestriction?3:2),c(5),b(" ",w(8,6,(e=l.data())==null||e.WriteOffPayment==null?null:e.WriteOffPayment.Amount)," "),c(5),b(" ",(n=l.data())==null||n.WriteOffPayment==null?null:n.WriteOffPayment.WriteOffOptionName," "),c(),p("innerHTML",(t=l.data())==null||t.WriteOffPayment==null?null:t.WriteOffPayment.Note,je),c(3),C(l.role.payment.Edit?16:-1),c(3),C(l.role.payment.Delete?19:-1)}}function Ml(i,r){if(i&1&&(o(0,"table",19)(1,"thead",20)(2,"tr",21)(3,"th",40),s(4,"Date"),a(),o(5,"th",41),s(6,"Method"),a(),o(7,"th",42),s(8," Amount "),a(),o(9,"th",43),s(10,"Code"),a(),o(11,"th",24),s(12,"Note"),a(),h(13,gl,1,0,"th",44),a()(),o(14,"tbody"),R(15,Sl,25,12,"tr",null,$),h(17,Pl,20,8,"tr"),a()()),i&2){let e,n=m(2);c(13),C(n.role.payment.Edit||n.role.payment.Delete?13:-1),c(2),N(n.data().PaymentDetail),c(2),C((e=n.data())!=null&&e.WriteOffPayment?17:-1)}}function Al(i,r){if(i&1&&(o(0,"mainpanel-cmp",0)(1,"actions")(2,"div",1)(3,"a",2),s(4,"Print Original"),a(),o(5,"a",3),s(6,"Print Copy"),a()(),o(7,"div",4),h(8,ol,3,0,"button",5),h(9,al,3,0,"a",6),a()(),o(10,"content")(11,"div",7)(12,"div",8)(13,"div",9)(14,"div",10)(15,"div",11)(16,"h2"),s(17,"General"),a()(),o(18,"div",12)(19,"table",13)(20,"tr")(21,"th"),s(22,"Outlet"),a(),o(23,"td"),s(24,":"),a(),o(25,"td"),s(26),a()(),o(27,"tr")(28,"th"),s(29,"Supplier"),a(),o(30,"td"),s(31,":"),a(),o(32,"td")(33,"a",14),s(34),a()()(),o(35,"tr")(36,"th"),s(37,"Date"),a(),o(38,"td"),s(39,":"),a(),o(40,"td"),s(41),g(42,"date"),a()(),o(43,"tr")(44,"th"),s(45,"Due"),a(),o(46,"td"),s(47,":"),a(),h(48,rl,3,4,"td"),a(),o(49,"tr")(50,"th"),s(51,"Att"),a(),o(52,"td"),s(53,":"),a(),o(54,"td"),s(55),a()(),o(56,"tr")(57,"th"),s(58,"Note"),a(),o(59,"td"),s(60,":"),a(),y(61,"td",15),a(),h(62,ll,8,2,"tr"),a()()(),o(63,"div",16)(64,"div",11)(65,"h2",17),s(66,"Purchase Order"),a()(),o(67,"div",12)(68,"table",13)(69,"tr")(70,"th"),s(71,"Number"),a(),o(72,"td"),s(73,":"),a(),o(74,"td"),s(75),a()(),o(76,"tr")(77,"th"),s(78,"Type"),a(),o(79,"td"),s(80,":"),a(),o(81,"td"),s(82),a()()()()()(),o(83,"div",18)(84,"div",10)(85,"div",11)(86,"h2",17),s(87,"Supplier Bills"),a()(),o(88,"div",12)(89,"table",19)(90,"thead",20)(91,"tr",21)(92,"th",22),s(93,"No"),a(),o(94,"th",23),s(95,"Date"),a(),o(96,"th",23),s(97,"Due"),a(),o(98,"th",24),s(99,"Number"),a(),h(100,cl,2,0,"th",25),o(101,"th",26),s(102,"Total"),a()()(),o(103,"tbody"),R(104,ml,16,19,"tr",null,$),a(),o(106,"tfoot")(107,"tr",27)(108,"td",28),s(109),a(),h(110,pl,1,0,"td"),o(111,"td",29),s(112),g(113,"sum"),g(114,"number"),a()()()()()(),o(115,"div",16)(116,"div",30)(117,"h2",17),s(118," Payment "),o(119,"small",31),s(120),a()(),o(121,"div",4),h(122,dl,2,0,"a",32),h(123,ul,2,0,"a",32),h(124,_l,2,0,"a",32),a()(),o(125,"div",12),h(126,Ml,18,2,"table",19),a()()()(),y(127,"pos-footer-alert",33),a()()()),i&2){let e,n,t,l,d,x,B,j,Oe,_t,Dn,$t,Yt,In,Xt,Zt,Tn,W=m();p("pageData",W.menuData())("hideSearchDropdown",!0)("hideSearchBox",!0),c(3),p("queryParams",Te(37,Zr,(e=W.data())==null||e.Info==null?null:e.Info.ID,(e=W.data())==null?null:e.TemplateID)),c(2),p("queryParams",Te(40,el,(n=W.data())==null||n.Info==null?null:n.Info.ID,(n=W.data())==null?null:n.TemplateID)),c(3),C(W.role.debt.Edit?8:-1),c(),C(W.role.debt.Delete?9:-1),c(17),S(W.data().EntityName),c(7),p("routerLink",H(43,tl))("queryParams",k(44,Wa,(t=W.data().Info)==null?null:t.SupplierID)),c(),S((l=W.data().Info)==null?null:l.Name),c(7),S(F(42,29,(d=W.data().Info)==null?null:d.Date,"dd MMM yyyy")),c(7),C(((x=W.data().Info)==null?null:x.Due)!=W.minDate?48:-1),c(7),S((B=W.data().Info)==null?null:B.Att),c(6),p("innerHTML",(j=W.data().Info)==null?null:j.Note,je),c(),C(W.data().JournalURL!=null?62:-1),c(13),S(W.data().CurrencySymbol),c(7),S((Oe=W.data().SupplierPO)==null?null:Oe.Discount),c(18),C(W.areAllSupplierNamesSame()?-1:100),c(4),N(W.data().Item),c(5),b(" ",(_t=W.data().Item)==null?null:_t.length," Supplier Bills,Total : "),c(),C(W.areAllSupplierNamesSame()?-1:110),c(2),b(" ",w(114,35,F(113,32,W.data().Item,"RemainingPaymentBaseCurrency"))," "),c(8),b(" ",(Dn=W.data().Info)==null?null:Dn.PaymentStateLabel," "),c(2),C((($t=W.data())==null||$t.Info==null?null:$t.Info.PaymentStateID)<3&&W.role.payment.Create?122:-1),c(),C(((Yt=W.data())==null||Yt.Info==null?null:Yt.Info.PaymentStateID)<3&&W.role.payment.Edit?123:-1),c(),C((In=W.data())!=null&&In.WriteOffPayment&&W.role.payment.Delete?124:-1),c(2),C(((Xt=W.data().PaymentDetail)==null?null:Xt.length)>0||W.data().WriteOffPayment?126:-1),c(),p("created",(Zt=W.data().DocumentInfo)==null?null:Zt.Created)("modified",(Tn=W.data().DocumentInfo)==null?null:Tn.Modified)}}var Mi=class i extends Ne{constructor(e,n,t,l,d,x,B){super(e,n,"debt/joinbillinfo",void 0,l,t);this.httpService=n;this.toaster=l;this.router=d;this.matDialog=x;this.role=B}httpService;toaster;router;matDialog;role;bigPicture=O(Cn);renderer=O(rt);minDate=E(pe.MinDate);due=E("");ngAfterViewInit(){let e=document.querySelector(".main-panel");e&&this.renderer.removeClass(e,"full-container")}preGetList(){let e=this.route?.snapshot.queryParams;this.pageData().Filter=e}postInit(){this.menuData().H=this.data().PageTitle}areAllSupplierNamesSame(){return this.data().Item?.every(e=>e.Data.SupplierName===this.data()?.Item[0]?.Data.SupplierName)}removeData(e,n){if(!confirm("Are you sure you want to delete selected record/s?"))return;let t="/API/"+e;this.httpService.delete(t,{params:[{key:"ID",value:n}]}).subscribe(l=>{this.toaster.success("Invoices has been deleted",qe.Success),this.router.navigate(["/menu/Debt/Debt/Join_Bill"])})}showPaymentModal(e){this.matDialog.open(yn,{data:{paymentDetail:e,option:this.data().Options.PaymentMethods,queryString:this.route?.snapshot.queryParams,writeOffPayment:this.data().WriteOffPayment,storagePath:this.data().StoragePath,totalAmount:this.data()?.Info?.Sales}}).afterClosed().pipe(Ye(t=>pe.IsNotEmpty(t)),_e(t=>(delete t?.Dialog.SumInvoice,t))).subscribe(t=>this.AddOrUpdatePayment(t))}showWriteOff(){this.matDialog.open(bn,{data:{writeOffOptions:this.data()?.Options?.WriteOffOptions,writeOffPayment:this.data().WriteOffPayment}}).afterClosed().pipe(Ye(n=>pe.IsNotEmpty(n)),Ce(n=>{let t={JoinBillID:this.data().Info.ID,WriteOffOptionID:n?.ReasonID,Note:n?.Note,Date:n.Date};return this.httpService.put("/API/Debt/writeoffjoinbill",t)})).subscribe(n=>{n&&this.getListData()})}cancelWriteOff(){this.httpService.put("/API/debt/cancelwriteoffjoinbill",{JoinBillID:this.data().Info.ID}).subscribe({next:e=>{e&&(this.toaster.success("Write off payment cancelled","Success"),this.getListData())}})}openBigPicture(e,n){return pt(this,null,function*(){this.bigPicture.openBiggerPicture(n,e)})}AddOrUpdatePayment(e){this.httpService.post("/API/Debt/AddOrUpdatePayment",e.Dialog).subscribe({next:n=>{n&&this.getListData()}})}DeletePayment(e){if(!confirm("Are you sure you want to delete selected record/s?"))return;let n={ID:e.ID,InfoID:this.route?.snapshot?.queryParams?.ID};this.httpService.post("/API/Debt/DeletePayment",n).subscribe({next:t=>{t&&this.getListData()}})}onEdit(){if(this.data().Info.PaymentStateID===2||this.data().PaymentDetail.length>1){this.toaster.error("You cannot edit this join bill because it has more than 1 payment",qe.Error);return}this.router.navigate(["/menu/Debt/Debt/Join_Bill/New_Join_Bill"],{queryParams:{ID:this.route?.snapshot.queryParams.ID}})}static \u0275fac=function(n){return new(n||i)(P(z),P(ee),P(Le),P(ve),P(ct),P(le),P(ne))};static \u0275cmp=L({type:i,selectors:[["ng-component"]],standalone:!1,features:[Z],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"btn-group","me-5"],["routerLink","/print/BulkSupplierInvoice","role","button","matTooltipPosition","above","matTooltip","Print Original",1,"btn","btn-outline-secondary",3,"queryParams"],["routerLink","/print/BulkSupplierInvoice","role","button","matTooltipPosition","above","matTooltip","Print Copy",1,"btn","btn-outline-secondary",3,"queryParams"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","edit",1,"btn","btn-outline-secondary"],["role","button","matTooltipPosition","above","matTooltip","Delete",1,"btn","btn-outline-secondary"],[1,"container-fluid","card-container","bg-light-gray"],[1,"row"],[1,"col-sm-4"],[1,"card","mt-5"],[1,"card-header"],[1,"card-body"],[1,"table-sm","table-borderless"],[3,"routerLink","queryParams"],[2,"word-break","break-all",3,"innerHTML"],[1,"card"],[1,"title"],[1,"col-sm-8"],[1,"table","table-bordered","custom-table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"border-end",2,"width","20px"],[1,"border-end",2,"width","100px"],[1,"border-end"],[1,""],[1,"border-end","text-end"],[1,"table-footer"],["colspan","4",1,"text-end"],[1,"text-end"],[1,"card-header","d-flex","justify-content-between"],[1,"text-body-secondary","h6"],["role","button",1,"btn","btn-outline-secondary","btn-sm"],[3,"created","modified"],["role","button","matTooltipPosition","above","matTooltip","edit",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-pen-to-square"],["role","button","matTooltipPosition","above","matTooltip","Delete",1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash"],[3,"href"],["role","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"border-end",2,"width","115px"],[1,"border-end",2,"width","130px"],[1,"border-end","text-end",2,"width","105px"],[1,"border-end",2,"width","85px"],[1,"border-end",2,"width","30px"],["matTooltipPosition","above",1,"d-flex","align-items-baseline","gap-2",3,"matTooltip"],[3,"ngClass"],[1,"d-flex","flex-wrap",2,"width","8vw"],[2,"display","inline-block","width","inherit",3,"innerHTML"],["role","group",1,"btn-group"],["role","button",1,"btn","btn-outline-secondary","border-end-0","btn-sm"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end"],[1,"dropdown-item"],[2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fa-solid","fa-trash","fa-sm"],[1,"fa-solid","fa-circle-info","ms-2"],["target","_blank",3,"href"],["matTooltip",`{{
4
4
  payment.ImageUrlClient?.substring(
@@ -1 +1 @@
1
- import{f as te}from"./chunk-TWC7U66D.js";import{b as X,c as Y}from"./chunk-RAAIED6S.js";import{a as Z,b as ee}from"./chunk-ORJAUIF4.js";import{a as Q,b as W}from"./chunk-Z7UCI72M.js";import{a as B}from"./chunk-XW7JSER6.js";import{ra as K}from"./chunk-NYN3E7NN.js";import{F as J,h as q,p as G}from"./chunk-4XQKDYF2.js";import{a as d}from"./chunk-PPTZHIIZ.js";import{q as m}from"./chunk-ETYXTCKV.js";import{$a as b,Db as p,Eb as g,Fb as C,Fc as N,Gc as R,Lc as z,Mb as x,Pb as A,Sb as E,Sc as v,Ua as _,Ub as i,X as h,aa as f,cc as I,d as w,da as O,db as M,fa as S,hc as T,ja as L,jb as s,jc as H,l as u,ma as P,na as D,nd as F,od as k,ra as l,sa as c,vd as U,wb as V,ya as $,yb as j}from"./chunk-DUSKF5IQ.js";var y=class o{signalRClient=D(B);continuedCategories$;allCategories$;_onOpenTreeSelector=new w;onOpenTreeSelector$=this._onOpenTreeSelector.asObservable();constructor(t){this.continuedCategories$=this.onOpenTreeSelector$.pipe(S(this.signalRClient.recacheCategory$),f((e,[r,n])=>n||!e.length?(this.signalRClient.resetCategoryCache(),t.get("/API/catalog/category/ActiveOptions")):u(e),[]),h(1)),this.allCategories$=this.onOpenTreeSelector$.pipe(S(this.signalRClient.recacheCategory$),f((e,[r,n])=>n||!e.length?t.get("/API/catalog/category/SelectOptions"):u(e),[]),h(1))}onOpenTreeSelector(){this._onOpenTreeSelector.next(!0)}forceLoadCategories(){this._onOpenTreeSelector.next(!0)}static \u0275fac=function(e){return new(e||o)(P(m))};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};function ae(o,t){o&1&&x(0)}function le(o,t){if(o&1&&(g(0,"p-floatLabel",1),s(1,ae,1,0,"ng-container",2),g(2,"label",3),T(3,"Category"),C()()),o&2){i();let e=I(3);_(),p("ngTemplateOutlet",e)}}function ce(o,t){o&1&&x(0)}function se(o,t){if(o&1&&s(0,ce,1,0,"ng-container",2),o&2){i();let e=I(3);p("ngTemplateOutlet",e)}}function pe(o,t){if(o&1&&(g(0,"div",6),T(1),C()),o&2){let e=i(2);p("matTooltip",e.selectedCategoryLabel),_(),H(" ",e.selectedCategoryLabel," ")}}function ge(o,t){if(o&1){let e=A();g(0,"p-treeSelect",4),N(1,"async"),E("onShow",function(){l(e);let n=i();return c(n.loadCategories())})("ngModelChange",function(n){l(e);let a=i();return c(a.onSelectCategory(n))})("onClear",function(){l(e);let n=i();return c(n.onClear())})("onNodeUnselect",function(n){l(e);let a=i();return c(a.onUnselectCategory(n))}),s(2,pe,2,2,"ng-template",5),C()}if(o&2){let e=i();p("options",R(1,4,e.categories$))("ngModel",e.selectedCategory)("showClear",e.showClear)("placeholder",e.showLabel?"":e.placeholder)}}var oe=class o{constructor(t,e){this.http=t;this.treeSelector=e}http;treeSelector;continuedCategoriesOnly=!0;categories=[];showClear=!1;showLabel=!1;placeholder="Select Category";isInitializedCategoryLabel=!1;selectedCategory;selectedCategoryID;selectedCategoryIDChange=new $;onSelectedCategory=v();_onClearCategory=v({alias:"onClearCategory"});selectedCategoryLabel;top=0;isLoadCategories=!1;categories$;ngAfterViewInit(){let t=document.querySelector("body");this.top=t.getBoundingClientRect().top*-1}ngOnInit(){this.isInitializedCategoryLabel&&(d.IsEmpty(this.selectedCategoryID)&&d.IsNotEmpty(this.categories)&&(this.selectedCategoryID=this.categories[0]?.key),this.selectedCategory=this.findSelectedCategory(this.categories,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)),this.categories$=this.continuedCategoriesOnly?this.treeSelector.continuedCategories$:this.treeSelector.allCategories$,this.categories$=this.categories$.pipe(O(t=>{this.selectedCategory=this.findSelectedCategory(t,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)}))}onSelectCategory(t){t&&(this.selectedCategory=t,this.generateLabelSelectedCategory(this.selectedCategory),this.selectedCategoryID=t?.key,this.selectedCategoryIDChange.emit(this.selectedCategoryID),this.onSelectedCategory.emit(this.selectedCategory))}onUnselectCategory(t){this.onSelectCategory(t.node)}generateLabelSelectedCategory(t){if(t){let e=[];this.selectedCategoryLabel="";do e=[...e,t.label],t=t.parent;while(t!==void 0);this.selectedCategoryLabel=e.reverse().join("/")}else this.selectedCategoryLabel=this.placeholder}findSelectedCategory(t,e){if(d.IsNotEmpty(e))for(let r of t){if(r.key===e)return r;{r.children=r.children?r.children:[],r.children=r.children.map(a=>(a.parent=r,a));let n=this.findSelectedCategory(r.children,e);if(n)return n}}else return null}loadCategories(){try{setTimeout(()=>{let t=document.querySelector(".p-overlay.p-component"),e=this.top+t.getBoundingClientRect().top,r=t.getAttribute("style")||"";t.setAttribute("style",`${r} top: ${e+this.top}px;`)},0)}catch(t){console.error("Error adjusting top position:",t)}finally{this.treeSelector.onOpenTreeSelector()}}onClear(){this.selectedCategory=null,this.generateLabelSelectedCategory(null),this.selectedCategoryID=null,this.selectedCategoryIDChange.emit(null),this._onClearCategory.emit()}static \u0275fac=function(e){return new(e||o)(b(m),b(y))};static \u0275cmp=M({type:o,selectors:[["POS-product-category-select"]],inputs:{continuedCategoriesOnly:"continuedCategoriesOnly",categories:"categories",showClear:"showClear",showLabel:"showLabel",placeholder:"placeholder",isInitializedCategoryLabel:"isInitializedCategoryLabel",selectedCategoryID:"selectedCategoryID"},outputs:{selectedCategoryIDChange:"selectedCategoryIDChange",onSelectedCategory:"onSelectedCategory",_onClearCategory:"onClearCategory"},decls:4,vars:1,consts:[["categorySelectTemplate",""],["variant","on",1,"w-100"],[4,"ngTemplateOutlet"],["for","selectCategory",1,"tree-category-label",2,"z-index","99 !important"],["appendTo","body","selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","inputId","selectCategory",3,"onShow","ngModelChange","onClear","onNodeUnselect","options","ngModel","showClear","placeholder"],["pTemplate","value"],["matTooltipPosition","above",3,"matTooltip"]],template:function(e,r){e&1&&(V(0,le,4,1,"p-floatLabel",1)(1,se,1,1,"ng-container"),s(2,ge,3,6,"ng-template",null,0,z)),e&2&&j(r.showLabel?0:1)},dependencies:[U,F,W,Q,Y,X,K,J,q,G,ee,Z,te,k],styles:[".p-overlay.p-component{z-index:10000000000000000000000!important} .p-treeselect-panel .p-treeselect-items-wrapper .p-tree{padding-left:4px!important} .p-float-label .p-inputwrapper-filled~label.tree-category-label{left:.5rem!important}"]})};export{y as a,oe as b};
1
+ import{f as te}from"./chunk-TWC7U66D.js";import{b as X,c as Y}from"./chunk-RAAIED6S.js";import{a as Z,b as ee}from"./chunk-ORJAUIF4.js";import{a as Q,b as W}from"./chunk-Z7UCI72M.js";import{a as B}from"./chunk-OJTKRQM6.js";import{ra as K}from"./chunk-NYN3E7NN.js";import{F as J,h as q,p as G}from"./chunk-4XQKDYF2.js";import{a as d}from"./chunk-PPTZHIIZ.js";import{q as m}from"./chunk-ETYXTCKV.js";import{$a as b,Db as p,Eb as g,Fb as C,Fc as N,Gc as R,Lc as z,Mb as x,Pb as A,Sb as E,Sc as v,Ua as _,Ub as i,X as h,aa as f,cc as I,d as w,da as O,db as M,fa as S,hc as T,ja as L,jb as s,jc as H,l as u,ma as P,na as D,nd as F,od as k,ra as l,sa as c,vd as U,wb as V,ya as $,yb as j}from"./chunk-DUSKF5IQ.js";var y=class o{signalRClient=D(B);continuedCategories$;allCategories$;_onOpenTreeSelector=new w;onOpenTreeSelector$=this._onOpenTreeSelector.asObservable();constructor(t){this.continuedCategories$=this.onOpenTreeSelector$.pipe(S(this.signalRClient.recacheCategory$),f((e,[r,n])=>n||!e.length?(this.signalRClient.resetCategoryCache(),t.get("/API/catalog/category/ActiveOptions")):u(e),[]),h(1)),this.allCategories$=this.onOpenTreeSelector$.pipe(S(this.signalRClient.recacheCategory$),f((e,[r,n])=>n||!e.length?t.get("/API/catalog/category/SelectOptions"):u(e),[]),h(1))}onOpenTreeSelector(){this._onOpenTreeSelector.next(!0)}forceLoadCategories(){this._onOpenTreeSelector.next(!0)}static \u0275fac=function(e){return new(e||o)(P(m))};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};function ae(o,t){o&1&&x(0)}function le(o,t){if(o&1&&(g(0,"p-floatLabel",1),s(1,ae,1,0,"ng-container",2),g(2,"label",3),T(3,"Category"),C()()),o&2){i();let e=I(3);_(),p("ngTemplateOutlet",e)}}function ce(o,t){o&1&&x(0)}function se(o,t){if(o&1&&s(0,ce,1,0,"ng-container",2),o&2){i();let e=I(3);p("ngTemplateOutlet",e)}}function pe(o,t){if(o&1&&(g(0,"div",6),T(1),C()),o&2){let e=i(2);p("matTooltip",e.selectedCategoryLabel),_(),H(" ",e.selectedCategoryLabel," ")}}function ge(o,t){if(o&1){let e=A();g(0,"p-treeSelect",4),N(1,"async"),E("onShow",function(){l(e);let n=i();return c(n.loadCategories())})("ngModelChange",function(n){l(e);let a=i();return c(a.onSelectCategory(n))})("onClear",function(){l(e);let n=i();return c(n.onClear())})("onNodeUnselect",function(n){l(e);let a=i();return c(a.onUnselectCategory(n))}),s(2,pe,2,2,"ng-template",5),C()}if(o&2){let e=i();p("options",R(1,4,e.categories$))("ngModel",e.selectedCategory)("showClear",e.showClear)("placeholder",e.showLabel?"":e.placeholder)}}var oe=class o{constructor(t,e){this.http=t;this.treeSelector=e}http;treeSelector;continuedCategoriesOnly=!0;categories=[];showClear=!1;showLabel=!1;placeholder="Select Category";isInitializedCategoryLabel=!1;selectedCategory;selectedCategoryID;selectedCategoryIDChange=new $;onSelectedCategory=v();_onClearCategory=v({alias:"onClearCategory"});selectedCategoryLabel;top=0;isLoadCategories=!1;categories$;ngAfterViewInit(){let t=document.querySelector("body");this.top=t.getBoundingClientRect().top*-1}ngOnInit(){this.isInitializedCategoryLabel&&(d.IsEmpty(this.selectedCategoryID)&&d.IsNotEmpty(this.categories)&&(this.selectedCategoryID=this.categories[0]?.key),this.selectedCategory=this.findSelectedCategory(this.categories,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)),this.categories$=this.continuedCategoriesOnly?this.treeSelector.continuedCategories$:this.treeSelector.allCategories$,this.categories$=this.categories$.pipe(O(t=>{this.selectedCategory=this.findSelectedCategory(t,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)}))}onSelectCategory(t){t&&(this.selectedCategory=t,this.generateLabelSelectedCategory(this.selectedCategory),this.selectedCategoryID=t?.key,this.selectedCategoryIDChange.emit(this.selectedCategoryID),this.onSelectedCategory.emit(this.selectedCategory))}onUnselectCategory(t){this.onSelectCategory(t.node)}generateLabelSelectedCategory(t){if(t){let e=[];this.selectedCategoryLabel="";do e=[...e,t.label],t=t.parent;while(t!==void 0);this.selectedCategoryLabel=e.reverse().join("/")}else this.selectedCategoryLabel=this.placeholder}findSelectedCategory(t,e){if(d.IsNotEmpty(e))for(let r of t){if(r.key===e)return r;{r.children=r.children?r.children:[],r.children=r.children.map(a=>(a.parent=r,a));let n=this.findSelectedCategory(r.children,e);if(n)return n}}else return null}loadCategories(){try{setTimeout(()=>{let t=document.querySelector(".p-overlay.p-component"),e=this.top+t.getBoundingClientRect().top,r=t.getAttribute("style")||"";t.setAttribute("style",`${r} top: ${e+this.top}px;`)},0)}catch(t){console.error("Error adjusting top position:",t)}finally{this.treeSelector.onOpenTreeSelector()}}onClear(){this.selectedCategory=null,this.generateLabelSelectedCategory(null),this.selectedCategoryID=null,this.selectedCategoryIDChange.emit(null),this._onClearCategory.emit()}static \u0275fac=function(e){return new(e||o)(b(m),b(y))};static \u0275cmp=M({type:o,selectors:[["POS-product-category-select"]],inputs:{continuedCategoriesOnly:"continuedCategoriesOnly",categories:"categories",showClear:"showClear",showLabel:"showLabel",placeholder:"placeholder",isInitializedCategoryLabel:"isInitializedCategoryLabel",selectedCategoryID:"selectedCategoryID"},outputs:{selectedCategoryIDChange:"selectedCategoryIDChange",onSelectedCategory:"onSelectedCategory",_onClearCategory:"onClearCategory"},decls:4,vars:1,consts:[["categorySelectTemplate",""],["variant","on",1,"w-100"],[4,"ngTemplateOutlet"],["for","selectCategory",1,"tree-category-label",2,"z-index","99 !important"],["appendTo","body","selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","inputId","selectCategory",3,"onShow","ngModelChange","onClear","onNodeUnselect","options","ngModel","showClear","placeholder"],["pTemplate","value"],["matTooltipPosition","above",3,"matTooltip"]],template:function(e,r){e&1&&(V(0,le,4,1,"p-floatLabel",1)(1,se,1,1,"ng-container"),s(2,ge,3,6,"ng-template",null,0,z)),e&2&&j(r.showLabel?0:1)},dependencies:[U,F,W,Q,Y,X,K,J,q,G,ee,Z,te,k],styles:[".p-overlay.p-component{z-index:10000000000000000000000!important} .p-treeselect-panel .p-treeselect-items-wrapper .p-tree{padding-left:4px!important} .p-float-label .p-inputwrapper-filled~label.tree-category-label{left:.5rem!important}"]})};export{y as a,oe as b};