dealpos 25.50.0 → 25.51.0
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.
- package/browser/{chunk-HGSF7LOB.js → chunk-27OXTS7Y.js} +1 -1
- package/browser/{chunk-4YZVDERU.js → chunk-2EHLYOAD.js} +1 -1
- package/browser/{chunk-BFNGPKGX.js → chunk-2GIDUMXS.js} +1 -1
- package/browser/{chunk-BRNU2JXC.js → chunk-2MAOKHWO.js} +1 -1
- package/browser/{chunk-KVMBRL53.js → chunk-2WSP3Y6V.js} +1 -1
- package/browser/{chunk-HWPSC7RE.js → chunk-3DL5OLEL.js} +1 -1
- package/browser/{chunk-CFWHBIM3.js → chunk-3DUSH3ND.js} +1 -1
- package/browser/{chunk-NOYC5PIT.js → chunk-3FS7DBBR.js} +1 -1
- package/browser/{chunk-FMKY4THI.js → chunk-3HDEMBWS.js} +1 -1
- package/browser/chunk-3M5FKEPW.js +1 -0
- package/browser/{chunk-O2VVATBW.js → chunk-3MAZIRSX.js} +1 -1
- package/browser/{chunk-OZ3MKU4C.js → chunk-3PKJLXTC.js} +1 -1
- package/browser/{chunk-PHH2AA3W.js → chunk-3Q5WV3VF.js} +1 -1
- package/browser/{chunk-3AZAILT2.js → chunk-3XDE3GJ3.js} +1 -1
- package/browser/{chunk-ZMJLTU5O.js → chunk-3XH2STFE.js} +1 -1
- package/browser/{chunk-26YFRPR2.js → chunk-3ZH3XK5V.js} +1 -1
- package/browser/{chunk-X2GHGFH2.js → chunk-43G72GH2.js} +1 -1
- package/browser/{chunk-MLBTUOHX.js → chunk-4467AQLM.js} +1 -1
- package/browser/chunk-4CYACZL5.js +149 -0
- package/browser/{chunk-2MPRVJXH.js → chunk-4HJHXVYF.js} +1 -1
- package/browser/{chunk-S7FOJJP2.js → chunk-4HLKKTIV.js} +1 -1
- package/browser/{chunk-MNJSQKLX.js → chunk-4L4MSVOU.js} +1 -1
- package/browser/{chunk-ISN5K6K2.js → chunk-4MWVPOV6.js} +1 -1
- package/browser/{chunk-5SIEW7SH.js → chunk-4OTZNFYS.js} +1 -1
- package/browser/{chunk-GDQGP7DV.js → chunk-57WKDIDF.js} +1 -1
- package/browser/{chunk-SOW7VMSU.js → chunk-5HIJCKLY.js} +1 -1
- package/browser/{chunk-TXJJUZ26.js → chunk-5PDQ5UNO.js} +1 -1
- package/browser/{chunk-FW4OCSXV.js → chunk-5RFSSCAR.js} +1 -1
- package/browser/{chunk-36GWLMZX.js → chunk-5RYL4EJ2.js} +1 -1
- package/browser/{chunk-B36P4U32.js → chunk-5VYU6SHE.js} +1 -1
- package/browser/chunk-5YBSS4EL.js +21 -0
- package/browser/{chunk-3ZWJMFYL.js → chunk-5ZPO7V26.js} +1 -1
- package/browser/{chunk-FV4MYFQI.js → chunk-67UFIJ2O.js} +1 -1
- package/browser/{chunk-MZSJCSUV.js → chunk-6AHKVKAZ.js} +2 -2
- package/browser/chunk-6F45DEGR.js +136 -0
- package/browser/{chunk-DC3TCY6D.js → chunk-6G7LPAEQ.js} +1 -1
- package/browser/chunk-6GCAXVFO.js +1 -0
- package/browser/{chunk-7F4QLFQQ.js → chunk-6I2YT4SH.js} +1 -1
- package/browser/{chunk-PLR55YR2.js → chunk-6LZENMYE.js} +1 -1
- package/browser/{chunk-PXIMA665.js → chunk-6O6OE4KQ.js} +14 -14
- package/browser/{chunk-B7BVEOOI.js → chunk-6UY42XOC.js} +1 -1
- package/browser/{chunk-OXWQ7ZZS.js → chunk-6WMEGLEF.js} +1 -1
- package/browser/{chunk-D7DUI5NF.js → chunk-6XNP4ZXB.js} +1 -1
- package/browser/chunk-735YXRQB.js +1 -0
- package/browser/{chunk-OYGBAHVX.js → chunk-73ADHCC2.js} +1 -1
- package/browser/{chunk-QZZ2NRA3.js → chunk-75FYOZH7.js} +1 -1
- package/browser/{chunk-CCD6EYWH.js → chunk-76CUXDTU.js} +1 -1
- package/browser/{chunk-BLEJLNEO.js → chunk-7JBFR3T4.js} +1 -1
- package/browser/{chunk-DWZ5JTI2.js → chunk-7MRUPBXU.js} +1 -1
- package/browser/{chunk-KZFNI67M.js → chunk-7YYWBCWJ.js} +1 -1
- package/browser/{chunk-T7PBUS2H.js → chunk-A2EDYIYP.js} +1 -1
- package/browser/{chunk-HFZ437GH.js → chunk-A5LIALQE.js} +1 -1
- package/browser/{chunk-QI7I46MV.js → chunk-A7C35XPM.js} +1 -1
- package/browser/{chunk-AQW4VS3Y.js → chunk-ACXQ2FOW.js} +1 -1
- package/browser/{chunk-WMZLH4YK.js → chunk-AHTR7XKG.js} +1 -1
- package/browser/{chunk-XTCEZONP.js → chunk-AJAUI7BA.js} +1 -1
- package/browser/{chunk-6C2HPRJZ.js → chunk-AQKJ3LSN.js} +1 -1
- package/browser/{chunk-RESN2GAB.js → chunk-ARAUAPQU.js} +1 -1
- package/browser/{chunk-3HZIDGPN.js → chunk-AXCTEREY.js} +1 -1
- package/browser/{chunk-SIQZO2WM.js → chunk-B4TZQBTN.js} +1 -1
- package/browser/{chunk-2ENLMKGR.js → chunk-B6TCVVAN.js} +1 -1
- package/browser/{chunk-BT7NN7PT.js → chunk-BAXZ74LK.js} +1 -1
- package/browser/{chunk-KB4247J2.js → chunk-BHQZXJKQ.js} +1 -1
- package/browser/{chunk-GRLVYPPM.js → chunk-BVOUQJCA.js} +1 -1
- package/browser/{chunk-RSNEHVIM.js → chunk-C22G4JGX.js} +1 -1
- package/browser/{chunk-4BXCIT62.js → chunk-CCIHCGP5.js} +1 -1
- package/browser/{chunk-FQZELIHB.js → chunk-CERE2LBX.js} +1 -1
- package/browser/{chunk-SK6Y77W4.js → chunk-CRKJEU3Z.js} +1 -1
- package/browser/{chunk-FAED643P.js → chunk-CVN6ZXXJ.js} +1 -1
- package/browser/{chunk-BYTV42NJ.js → chunk-D6HBPIFD.js} +1 -1
- package/browser/{chunk-YUILNWDI.js → chunk-D7YMUC3H.js} +1 -1
- package/browser/{chunk-Y5DX5U5Q.js → chunk-DCONKX6G.js} +1 -1
- package/browser/{chunk-TYE7PH3R.js → chunk-DIWYKKLA.js} +1 -1
- package/browser/{chunk-SBTTKQ4L.js → chunk-DJUOMCAV.js} +1 -1
- package/browser/{chunk-GWKBJZYT.js → chunk-DODZXMH2.js} +1 -1
- package/browser/{chunk-GTPQNPNO.js → chunk-DSXOFWO7.js} +1 -1
- package/browser/{chunk-YBUERVXV.js → chunk-DX56EYRS.js} +1 -1
- package/browser/{chunk-VVYRPW2Y.js → chunk-E4AXPU4U.js} +1 -1
- package/browser/{chunk-R2GUMKAU.js → chunk-E634BI4W.js} +1 -1
- package/browser/chunk-ECW7GAZQ.js +1 -0
- package/browser/{chunk-C2NCV7VC.js → chunk-EMH25BNO.js} +1 -1
- package/browser/{chunk-TCUCRGQD.js → chunk-EXFA6B6P.js} +1 -1
- package/browser/{chunk-B5IABJO5.js → chunk-EZNBK62W.js} +3 -3
- package/browser/chunk-F3HDP5CA.js +1 -0
- package/browser/{chunk-IFIH2CE2.js → chunk-F6LSMAF4.js} +1 -1
- package/browser/{chunk-ESDXMFGP.js → chunk-FINTUPRM.js} +1 -1
- package/browser/{chunk-D4FCXEV4.js → chunk-FM7BHGBW.js} +1 -1
- package/browser/{chunk-VZUPDSBH.js → chunk-FMEMQRBJ.js} +1 -1
- package/browser/{chunk-A565EUMD.js → chunk-FVNQ7SQY.js} +1 -1
- package/browser/{chunk-X44CHNHS.js → chunk-FZQE7J2C.js} +1 -1
- package/browser/{chunk-HSIXOQO7.js → chunk-G7L6AVIG.js} +1 -1
- package/browser/{chunk-DTVCBHPA.js → chunk-GFSJZHCB.js} +1 -1
- package/browser/{chunk-QPAUI5EG.js → chunk-GXAF3JUO.js} +1 -1
- package/browser/{chunk-S4D5UGSM.js → chunk-H2RXYP7A.js} +1 -1
- package/browser/{chunk-4XJWQAS6.js → chunk-HAXEFEKW.js} +1 -1
- package/browser/{chunk-DYBRYTEM.js → chunk-HHCNN3XR.js} +2 -2
- package/browser/{chunk-WXYXGYFH.js → chunk-HHM4L75O.js} +1 -1
- package/browser/{chunk-Y7KCHRMM.js → chunk-HIA4J5DB.js} +1 -1
- package/browser/{chunk-T3ZHKT2K.js → chunk-HQGZC4Y3.js} +1 -1
- package/browser/{chunk-TTCSYFRX.js → chunk-HSLDD424.js} +1 -1
- package/browser/{chunk-YLEKN2EU.js → chunk-HVFYCXLX.js} +1 -1
- package/browser/{chunk-FPRM3L6U.js → chunk-HYCKETL4.js} +1 -1
- package/browser/{chunk-CB6QEEJX.js → chunk-HZP6OUOI.js} +1 -1
- package/browser/{chunk-2ITJBRJU.js → chunk-I7AQHKKG.js} +7 -7
- package/browser/{chunk-4OEDK7YE.js → chunk-IDJEXQ5I.js} +1 -1
- package/browser/{chunk-XMZLK7EB.js → chunk-IDOUPEKS.js} +1 -1
- package/browser/{chunk-H74MLHRV.js → chunk-IET73YWA.js} +1 -1
- package/browser/{chunk-VKWSK452.js → chunk-IEX7S7T7.js} +1 -1
- package/browser/chunk-IHIJW73V.js +1 -0
- package/browser/chunk-IKSROKD5.css +1 -0
- package/browser/{chunk-ISQHQTAS.js → chunk-IM3B5EF2.js} +1 -1
- package/browser/{chunk-WM2DGNWH.js → chunk-ITTFNOLB.js} +1 -1
- package/browser/{chunk-JXXYVM7W.js → chunk-IZF7S2RF.js} +1 -1
- package/browser/{chunk-C3STDN73.js → chunk-JEZMYDZR.js} +1 -1
- package/browser/{chunk-T4MU3R7Y.js → chunk-JIRDK6TJ.js} +1 -1
- package/browser/chunk-JOLAOKHD.js +21 -0
- package/browser/{chunk-6WATOQG3.js → chunk-JQDS4BXR.js} +1 -1
- package/browser/{chunk-J6M7UWVR.js → chunk-JT4M6AIA.js} +1 -1
- package/browser/{chunk-USD2ALDX.js → chunk-K355XAWO.js} +1 -1
- package/browser/{chunk-WFQIMZGL.js → chunk-KBLVOO4J.js} +1 -1
- package/browser/{chunk-7L5VMLEF.js → chunk-KEILLJ6G.js} +1 -1
- package/browser/{chunk-FHB5KLDR.js → chunk-KFOEUAQT.js} +1 -1
- package/browser/chunk-KOZYTEZI.js +1 -0
- package/browser/{chunk-KUG5VVV4.js → chunk-KRBFME4B.js} +1 -1
- package/browser/chunk-L3U6V3BF.js +5 -0
- package/browser/{chunk-45E6XCHN.js → chunk-LB5UXGDG.js} +1 -1
- package/browser/{chunk-NM3IQUNN.js → chunk-LGD5WUG2.js} +1 -1
- package/browser/{chunk-M4EQZHIE.js → chunk-LKVUZZ5J.js} +1 -1
- package/browser/{chunk-4ZITX27A.js → chunk-LMUFX64W.js} +1 -1
- package/browser/{chunk-53VS5DA7.js → chunk-MM4IJDHI.js} +1 -1
- package/browser/chunk-MTUBVUM5.js +1 -0
- package/browser/{chunk-QZRMHLML.js → chunk-MUWJSYXR.js} +1 -1
- package/browser/{chunk-LNDHYAFW.js → chunk-MWGICBEB.js} +1 -1
- package/browser/{chunk-ZTD4APMR.js → chunk-N5RDRDT7.js} +1 -1
- package/browser/{chunk-BZ3GMUQ7.js → chunk-N6EBK52R.js} +3 -3
- package/browser/{chunk-7P3L3ODB.js → chunk-N7OS7SFI.js} +1 -1
- package/browser/{chunk-RACYAEOL.js → chunk-NFWYR26Q.js} +1 -1
- package/browser/{chunk-S27D5MBU.js → chunk-NJ4KEQKH.js} +1 -1
- package/browser/chunk-NQQB5U5S.js +4 -0
- package/browser/{chunk-PVBS6SYW.js → chunk-NRTKHF45.js} +1 -1
- package/browser/{chunk-72RZBOHX.js → chunk-NS6IC2PT.js} +1 -1
- package/browser/{chunk-BNNKSBQ6.js → chunk-O22HDFH6.js} +1 -1
- package/browser/{chunk-IPPIH4F4.js → chunk-OAVGNXY4.js} +1 -1
- package/browser/{chunk-7YUPYNWQ.js → chunk-OB6KFXD6.js} +2 -2
- package/browser/{chunk-5ZD6KTDH.js → chunk-ODYEJFNJ.js} +1 -1
- package/browser/{chunk-EHXF34TI.js → chunk-OEOAWKXA.js} +1 -1
- package/browser/{chunk-LIX7XJ55.js → chunk-OR4H5IKL.js} +1 -1
- package/browser/chunk-OTLU2WY3.js +3 -0
- package/browser/{chunk-TSH564VU.js → chunk-OUJXEQKL.js} +1 -1
- package/browser/{chunk-UZN4OKOJ.js → chunk-OURNAI65.js} +2 -2
- package/browser/chunk-OZ2R2K2V.js +1 -0
- package/browser/{chunk-PRVQ3NAP.js → chunk-P3TFDLWR.js} +2 -2
- package/browser/{chunk-PV4YHZX5.js → chunk-P5XKSQ34.js} +1 -1
- package/browser/{chunk-COA4UL2V.js → chunk-P7KMHPVN.js} +1 -1
- package/browser/{chunk-7JULWG2B.js → chunk-PCRUTQ3T.js} +1 -1
- package/browser/{chunk-T7XU5W5A.js → chunk-PNFJVQUF.js} +1 -1
- package/browser/{chunk-A6Z5ZHVO.js → chunk-PQSGJR4P.js} +1 -1
- package/browser/{chunk-WKM2QOAU.js → chunk-PSFQWURP.js} +1 -1
- package/browser/{chunk-3CUT73ZP.js → chunk-PV27CMZ2.js} +1 -1
- package/browser/{chunk-7MJWZXSK.js → chunk-QERITLZK.js} +2 -2
- package/browser/{chunk-2CL5FM3P.js → chunk-QJ3CWKQT.js} +1 -1
- package/browser/{chunk-PS7477UG.js → chunk-QLSGGWTW.js} +1 -1
- package/browser/{chunk-A5CTHLE4.js → chunk-QS2AUXB7.js} +1 -1
- package/browser/{chunk-TEGIL5RZ.js → chunk-QWLNF7VL.js} +1 -1
- package/browser/chunk-R3HIQ5AX.js +1 -0
- package/browser/{chunk-HFDJ5XSI.js → chunk-RF5FWMSR.js} +1 -1
- package/browser/{chunk-RE6SQEP6.js → chunk-RHDU4PR2.js} +1 -1
- package/browser/{chunk-FU2ZGMX4.js → chunk-RIZ4YVMH.js} +1 -1
- package/browser/chunk-RJYFOAYX.js +1 -0
- package/browser/{chunk-2KI73XNT.js → chunk-RU3GD3GY.js} +1 -1
- package/browser/{chunk-IZLEZJ6U.js → chunk-SCAKRK4B.js} +1 -1
- package/browser/{chunk-THT6CY5E.js → chunk-SCGKVOSE.js} +1 -1
- package/browser/{chunk-S65MPEJS.js → chunk-SCHTN7VQ.js} +1 -1
- package/browser/chunk-SMEVWRVE.js +1 -0
- package/browser/{chunk-CZHWPDAM.js → chunk-SUCJCOST.js} +1 -1
- package/browser/{chunk-BQ7QT5RB.js → chunk-SVUFU2AS.js} +1 -1
- package/browser/{chunk-IKKPP4JS.js → chunk-SWF6XISV.js} +1 -1
- package/browser/{chunk-VVWAYTKN.js → chunk-SWVQK6HM.js} +1 -1
- package/browser/{chunk-7DAPNQYU.js → chunk-SXRKKO75.js} +1 -1
- package/browser/{chunk-KZBVWICA.js → chunk-T5IJP474.js} +1 -1
- package/browser/{chunk-G5JGQBAG.js → chunk-T6GXIGYG.js} +1 -1
- package/browser/{chunk-LGOSIAUC.js → chunk-TANYEHMZ.js} +1 -1
- package/browser/chunk-TCW7SVU5.js +22 -0
- package/browser/{chunk-PQ6W7KXC.js → chunk-TDHDQRJN.js} +1 -1
- package/browser/{chunk-CXWICNFP.js → chunk-TOJPS7BJ.js} +1 -1
- package/browser/{chunk-6P2ASCNY.js → chunk-TP6ZUC53.js} +1 -1
- package/browser/{chunk-ZKOARDC2.js → chunk-TPJWIEYA.js} +1 -1
- package/browser/{chunk-L6PKNRWO.js → chunk-TRK4LJDS.js} +1 -1
- package/browser/{chunk-32QBWLTN.js → chunk-U4MC22BG.js} +1 -1
- package/browser/{chunk-QJUU75N6.js → chunk-U56LRRCE.js} +1 -1
- package/browser/{chunk-B7AC4RMR.js → chunk-UIVJ2JQT.js} +1 -1
- package/browser/chunk-UMFN4AJF.js +1 -0
- package/browser/{chunk-ZTU3TIGR.js → chunk-UPZZHMG6.js} +1 -1
- package/browser/{chunk-MZITJQAC.js → chunk-UX4QS4XQ.js} +1 -1
- package/browser/{chunk-CCJ6SHBL.js → chunk-V36Z6WRV.js} +1 -1
- package/browser/{chunk-PPVORSJQ.js → chunk-V4LDEQZZ.js} +1 -1
- package/browser/chunk-V4V55JMO.js +1 -0
- package/browser/{chunk-JBS5UYZC.js → chunk-V6D6TV7B.js} +1 -1
- package/browser/{chunk-M2HEFQUY.js → chunk-V6NXOOJA.js} +1 -1
- package/browser/{chunk-4MQZXTMM.js → chunk-VA6MHJ5E.js} +1 -1
- package/browser/{chunk-KYXB2UQI.js → chunk-VEQJR5VL.js} +1 -1
- package/browser/{chunk-5USF4MRW.js → chunk-VGHEGWAM.js} +1 -1
- package/browser/{chunk-7BQKGIZM.js → chunk-VL7THV5U.js} +1 -1
- package/browser/{chunk-GESNWWTD.js → chunk-VOY3BJZP.js} +9 -9
- package/browser/{chunk-HFOJZ3B5.js → chunk-VQKO557Q.js} +1 -1
- package/browser/chunk-VRKJC53Z.js +10 -0
- package/browser/{chunk-FSOHJLXB.js → chunk-WFTIOB7Q.js} +1 -1
- package/browser/{chunk-4CPRMZL6.js → chunk-WFVMID6Q.js} +1 -1
- package/browser/{chunk-Z6X5UYRZ.js → chunk-WFWUOLEG.js} +1 -1
- package/browser/{chunk-ARYZHNFV.js → chunk-WGOUSPMF.js} +1 -1
- package/browser/{chunk-3CSCTT6I.js → chunk-WOAKN4QZ.js} +1 -1
- package/browser/chunk-WQMYMJLR.js +4 -0
- package/browser/chunk-WR54IKY6.js +1 -0
- package/browser/{chunk-GDNVMJOU.js → chunk-WSFSSHIX.js} +1 -1
- package/browser/{chunk-ZZBF7AOW.js → chunk-WSWTWRKJ.js} +1 -1
- package/browser/{chunk-COGKLKKE.js → chunk-XEPEGKS2.js} +1 -1
- package/browser/{chunk-O3ENARQZ.js → chunk-XPN6EISF.js} +1 -1
- package/browser/{chunk-XFAV2VZL.js → chunk-XVTXHAKW.js} +1 -1
- package/browser/{chunk-LIXEWT4U.js → chunk-XWV7AI2C.js} +16 -16
- package/browser/{chunk-4W3WYXI2.js → chunk-XWYCNPUZ.js} +1 -1
- package/browser/{chunk-PJ3DTEH2.js → chunk-Y4MERAVA.js} +1 -1
- package/browser/{chunk-363IDTE3.js → chunk-Y7ZKGM5U.js} +1 -1
- package/browser/{chunk-KUF3JPB2.js → chunk-YC2LQSY3.js} +1 -1
- package/browser/{chunk-SIDUUVNA.js → chunk-YDL2MTWE.js} +1 -1
- package/browser/{chunk-JTZHHVPI.js → chunk-YMKZUNJH.js} +1 -1
- package/browser/{chunk-VXPORXGI.js → chunk-YQ5PAXUW.js} +1 -1
- package/browser/{chunk-PIAQ4TBN.js → chunk-YXRJV3RQ.js} +1 -1
- package/browser/{chunk-C5N3GKEC.js → chunk-Z4WEJMVU.js} +1 -1
- package/browser/{chunk-IISHJIET.js → chunk-Z5BFBI3D.js} +1 -1
- package/browser/{chunk-SLX34TWD.js → chunk-Z76C52NM.js} +1 -1
- package/browser/{chunk-A2EVMYAR.js → chunk-ZBHPM2JC.js} +1 -1
- package/browser/{chunk-Q3DS2RLM.js → chunk-ZNJ4JTTS.js} +1 -1
- package/browser/chunk-ZNPC63ZV.js +380 -0
- package/browser/{chunk-G3DZI5XK.js → chunk-ZO3XZXWW.js} +2 -2
- package/browser/{chunk-LGINK7BD.js → chunk-ZOYWCF3Q.js} +1 -1
- package/browser/{chunk-VZBXT2TV.js → chunk-ZRC22L45.js} +1 -1
- package/browser/{chunk-BQUL7SGN.js → chunk-ZV4K4PP6.js} +3 -3
- package/browser/chunk-ZVWC6CBP.js +1 -0
- package/browser/index.html +2 -2
- package/browser/main-4BFS7RVV.css +1 -0
- package/browser/main-PHIUFC5R.js +3 -0
- package/browser/{styles-URIEURGQ.css → styles-LFDMQGKE.css} +1 -1
- package/package.json +1 -1
- package/browser/chunk-2FJNMKCN.js +0 -1
- package/browser/chunk-2SZZVWQD.js +0 -137
- package/browser/chunk-2VE2WNSA.js +0 -21
- package/browser/chunk-4HEJOI53.js +0 -1
- package/browser/chunk-4KYROBKJ.js +0 -4
- package/browser/chunk-4SRWAPD4.js +0 -1
- package/browser/chunk-COL56R4A.js +0 -22
- package/browser/chunk-CQLZHUT4.js +0 -9
- package/browser/chunk-DOCQN2VL.js +0 -1
- package/browser/chunk-DTX2BFBV.js +0 -1
- package/browser/chunk-EAEOJMTA.js +0 -4
- package/browser/chunk-F765TCAS.js +0 -149
- package/browser/chunk-GBSRXCWH.js +0 -380
- package/browser/chunk-IEVGW2RT.js +0 -5
- package/browser/chunk-JB7Y2263.js +0 -1
- package/browser/chunk-JCLYKROE.js +0 -1
- package/browser/chunk-M3DKYPGC.js +0 -1
- package/browser/chunk-MFJH22SW.js +0 -1
- package/browser/chunk-NBMH5YL2.css +0 -1
- package/browser/chunk-PHYDJ3P5.js +0 -1
- package/browser/chunk-PMDFKXZY.js +0 -1
- package/browser/chunk-Q7YUJXQP.js +0 -1
- package/browser/chunk-QWB3USYP.js +0 -3
- package/browser/chunk-V432I4ZE.js +0 -21
- package/browser/chunk-VM4K4MNV.js +0 -1
- package/browser/chunk-XSZJISVJ.js +0 -1
- package/browser/chunk-XY3FCZN2.js +0 -1
- package/browser/chunk-ZCQDZKFQ.js +0 -1
- package/browser/main-4PHVOJ3C.js +0 -3
- package/browser/main-WPNH2WGQ.css +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{a as ii,b as Nr}from"./chunk-C3STDN73.js";import{a as Wr}from"./chunk-KB4247J2.js";import{a as Mt,b as Ar}from"./chunk-RSNEHVIM.js";import{a as Gt,b as Gr}from"./chunk-4ZITX27A.js";import{a as ti}from"./chunk-MLBTUOHX.js";import{a as De}from"./chunk-YBUERVXV.js";import{a as An}from"./chunk-GTPQNPNO.js";import{a as Hr}from"./chunk-3ZWJMFYL.js";import{a as ze}from"./chunk-KYXB2UQI.js";import{a as Gn,b as Bi}from"./chunk-GDRHD33K.js";import{a as gt}from"./chunk-3HZIDGPN.js";import{a as pr}from"./chunk-VVWAYTKN.js";import{b as dr}from"./chunk-COA4UL2V.js";import"./chunk-32QBWLTN.js";import{a as Vi}from"./chunk-A5CTHLE4.js";import"./chunk-WKM2QOAU.js";import{a as kr}from"./chunk-ZMJLTU5O.js";import{a as Br,b as Or,d as Lr,g as Rr}from"./chunk-PRVQ3NAP.js";import"./chunk-BYXBJQAS.js";import{a as Mi}from"./chunk-4SRWAPD4.js";import{a as Tr,b as Pr}from"./chunk-4OEDK7YE.js";import"./chunk-GWKBJZYT.js";import"./chunk-B5IABJO5.js";import{e as cr}from"./chunk-O2VVATBW.js";import{a as Fr,b as Ir,c as br,d as Er,e as Mr,f as Vr}from"./chunk-DYBRYTEM.js";import"./chunk-PHH2AA3W.js";import"./chunk-Y7KCHRMM.js";import"./chunk-DTVCBHPA.js";import"./chunk-5USF4MRW.js";import{a as ne}from"./chunk-363IDTE3.js";import{a as Z}from"./chunk-QZZ2NRA3.js";import"./chunk-FAED643P.js";import{a as bi,b as wr,c as Nn,d as J,e as Ei}from"./chunk-WMZLH4YK.js";import{a as En,b as Di}from"./chunk-72RZBOHX.js";import"./chunk-3RK6DDJD.js";import{a as bn}from"./chunk-M3DKYPGC.js";import{a as Sn,b as yn,c as Dn,f as Tn,g as Pn,h as Fn,p as yi,q as In}from"./chunk-6WATOQG3.js";import"./chunk-VM4K4MNV.js";import"./chunk-XTCEZONP.js";import"./chunk-LNDHYAFW.js";import{c as sr,d as Te,e as Wn}from"./chunk-5ZD6KTDH.js";import"./chunk-ZZBF7AOW.js";import{a as vi}from"./chunk-GRLVYPPM.js";import{a as pe,b as ge,c as lr}from"./chunk-AQW4VS3Y.js";import{a as Et,b as vr}from"./chunk-4W3WYXI2.js";import{d as Sr,f as Ce}from"./chunk-GBSRXCWH.js";import{a as yr,b as Dr,c as U}from"./chunk-B7BVEOOI.js";import{b as K}from"./chunk-VXPORXGI.js";import{a as me}from"./chunk-T3ZHKT2K.js";import{a as rr}from"./chunk-HFOJZ3B5.js";import"./chunk-L6PKNRWO.js";import"./chunk-SIQZO2WM.js";import{a as q}from"./chunk-J6M7UWVR.js";import{e as A,f as Ii}from"./chunk-BFNGPKGX.js";import"./chunk-G3DZI5XK.js";import"./chunk-7YUPYNWQ.js";import"./chunk-2CL5FM3P.js";import"./chunk-LGINK7BD.js";import{c as ur}from"./chunk-IKKPP4JS.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-KZFNI67M.js";import"./chunk-4BXCIT62.js";import{a as _r,c as Ue}from"./chunk-D4FCXEV4.js";import"./chunk-6P2ASCNY.js";import{d as hr}from"./chunk-OZ3MKU4C.js";import{b as N}from"./chunk-JCLYKROE.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import{C as Rn,F as Ae,G as kn,j as vn,m as wn,t as mr,u as Vn,v as Pi,w as Bn}from"./chunk-26YFRPR2.js";import{b as ie,c as hn}from"./chunk-JBS5UYZC.js";import{A as Ln,B as fr,C as ei,K as Fi,N as xr,g as se,o as gr,s as On,z as Cr}from"./chunk-TEGIL5RZ.js";import"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import{a as Mn,d as $}from"./chunk-THT6CY5E.js";import{b as Cn,e as wi,f as Ti,g as z}from"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import{a as nr}from"./chunk-S7FOJJP2.js";import{c as ir,j as ar,k as Ki,l as or}from"./chunk-FU2ZGMX4.js";import{a as zi}from"./chunk-2FWFPV5I.js";import{oa as fn,pa as xn,xa as tr}from"./chunk-SLX34TWD.js";import{F as At,G as gn,a as Xo,b as Jo,c as Qe,h as L,l as Zo,o as R,q as $o,s as er}from"./chunk-DWZ5JTI2.js";import"./chunk-KZBVWICA.js";import"./chunk-SBTTKQ4L.js";import"./chunk-36GWLMZX.js";import{b as j}from"./chunk-WFQIMZGL.js";import{a as V}from"./chunk-WUV22SZ4.js";import"./chunk-EAEOJMTA.js";import{p as qe,s as k}from"./chunk-LGOSIAUC.js";import{$c as fo,Ab as y,Ac as _t,Bb as Yi,Bc as Ut,Ca as dt,Cb as Y,Cc as cn,Db as G,Dc as Ao,E as ri,Eb as H,Fb as c,Fc as d,Gb as n,Gc as g,Hb as a,Hc as v,I as Qi,Ia as go,Ib as b,Ic as fi,Ja as Ro,Jd as Ko,K as Vo,Lc as O,M as Bo,Ma as ko,Mb as pt,Nb as mt,Nc as Go,Nd as Ne,Ob as Wo,Oc as xi,Pb as I,Pc as dn,Pd as _n,Q as nn,Qa as Ee,Qd as Q,Sa as rn,Sb as P,Sc as Ho,Sd as Ui,Tc as hi,Ub as m,Xa as o,Xb as Co,Xc as un,Y as jt,Ya as ln,Yb as sn,Zb as _i,Zc as Qo,_b as gi,aa as _o,ad as Yo,bd as jo,cc as Dt,dc as qt,eb as w,ec as ji,fa as Nt,fc as No,gc as qi,gd as tt,hc as p,ib as B,ic as F,id as st,jb as ui,jc as D,jd as it,ka as Oo,kb as pn,kc as $t,la as an,ma as di,mb as W,mc as C,na as Zt,nb as mn,nc as f,nd as qo,o as ci,ob as E,oc as x,od as Uo,pa as Pe,qd as oe,sc as Ct,sd as re,t as oi,ta as u,u as uo,ua as _,vd as Si,wb as li,wc as Ci,xa as on,xc as M,xd as zo,yb as S,yc as X,za as Lo,zc as fe}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import{a as et,b as nt,f as Gl,h as Jt,k as Hi}from"./chunk-SNAKHGZS.js";var Po=Gl((Xi,To)=>{(function(i,s){typeof Xi=="object"&&typeof To=="object"?To.exports=s(i._Highcharts,i._Highcharts.Templating):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts/highcharts"],function(e){return s(e,e.Templating)}):typeof Xi=="object"?Xi["highcharts/modules/series-label"]=s(i._Highcharts,i._Highcharts.Templating):i.Highcharts=s(i.Highcharts,i.Highcharts.Templating)})(typeof window>"u"?Xi:window,(i,s)=>(()=>{"use strict";var e={944:ye=>{ye.exports=i},984:ye=>{ye.exports=s}},r={};function t(ye){var ae=r[ye];if(ae!==void 0)return ae.exports;var Ve=r[ye]={exports:{}};return e[ye](Ve,Ve.exports,t),Ve.exports}t.n=ye=>{var ae=ye&&ye.__esModule?()=>ye.default:()=>ye;return t.d(ae,{a:ae}),ae},t.d=(ye,ae)=>{for(var Ve in ae)t.o(ae,Ve)&&!t.o(ye,Ve)&&Object.defineProperty(ye,Ve,{enumerable:!0,get:ae[Ve]})},t.o=(ye,ae)=>Object.prototype.hasOwnProperty.call(ye,ae);var l={};t.d(l,{default:()=>Al});var h=t(944),T=t.n(h),Ze=t(984),Ni=t.n(Ze);let Ai={enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]};function Zi(ye,ae,Ve,he,at,Ge){let ee=(Ge-ae)*(Ve-ye)-(he-ae)*(at-ye);return ee>0||!(ee<0)}function $i(ye,ae,Ve,he,at,Ge,ee,Le){return Zi(ye,ae,at,Ge,ee,Le)!==Zi(Ve,he,at,Ge,ee,Le)&&Zi(ye,ae,Ve,he,at,Ge)!==Zi(ye,ae,Ve,he,ee,Le)}let{animObject:co}=T(),{format:Vl}=Ni(),{setOptions:Bl}=T(),{composed:Ol}=T(),{boxIntersectLine:Fo,intersectRect:Ll}={boxIntersectLine:function(ye,ae,Ve,he,at,Ge,ee,Le){return $i(ye,ae,ye+Ve,ae,at,Ge,ee,Le)||$i(ye+Ve,ae,ye+Ve,ae+he,at,Ge,ee,Le)||$i(ye,ae+he,ye+Ve,ae+he,at,Ge,ee,Le)||$i(ye,ae,ye,ae+he,at,Ge,ee,Le)},intersectRect:function(ye,ae){return!(ae.left>ye.right||ae.right<ye.left||ae.top>ye.bottom||ae.bottom<ye.top)}},{addEvent:Io,extend:bo,fireEvent:Rl,isNumber:en,pick:zt,pushUnique:kl,syncTimeout:Wl}=T();function mi(ye,ae,Ve,he,at){let Ge=ye.chart,ee=ye.options.label||{},Le=zt(ee.onArea,!!ye.area),Ke=Le||ee.connectorAllowed,ct=Ge.boxesToAvoid,Bt=Number.MAX_VALUE,Ft=Number.MAX_VALUE,St,ft,xt,Kt,It,$e,Be;for($e=0;ct&&$e<ct.length;$e+=1)if(Ll(ct[$e],{left:ae,right:ae+he.width,top:Ve,bottom:Ve+he.height}))return!1;for($e=0;$e<Ge.series.length;$e+=1){let ut=Ge.series[$e],Re=ut.interpolatedPoints&&[...ut.interpolatedPoints];if(ut.visible&&Re){let Je=Ge.plotHeight/10;for(let ot=Ge.plotTop;ot<=Ge.plotTop+Ge.plotHeight;ot+=Je)Re.unshift({chartX:Ge.plotLeft,chartY:ot}),Re.push({chartX:Ge.plotLeft+Ge.plotWidth,chartY:ot});for(Be=1;Be<Re.length;Be+=1){if(Re[Be].chartX>=ae-16&&Re[Be-1].chartX<=ae+he.width+16){if(Fo(ae,Ve,he.width,he.height,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))return!1;ye===ut&&!xt&&at&&(xt=Fo(ae-16,Ve-16,he.width+32,he.height+32,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))}(Ke||xt)&&(ye!==ut||Le)&&(Bt=Math.min(Bt,(Kt=ae+he.width/2-Re[Be].chartX)*Kt+(It=Ve+he.height/2-Re[Be].chartY)*It))}if(!Le&&Ke&&ye===ut&&(at&&!xt||Bt<Math.pow(ee.connectorNeighbourDistance||1,2))){for(Be=1;Be<Re.length;Be+=1)(St=Math.min(Math.pow(ae+he.width/2-Re[Be].chartX,2)+Math.pow(Ve+he.height/2-Re[Be].chartY,2),Math.pow(ae-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(ae+he.width-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(ae+he.width-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2),Math.pow(ae-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2)))<Ft&&(Ft=St,ft=Re[Be]);xt=!0}}}return(!at||!!xt)&&{x:ae,y:Ve,weight:Bt-(ft?Ft:0),connectorPoint:ft}}function Eo(ye){if(this.renderer){let ae=this,Ve=co(ae.renderer.globalAnimation).duration;ae.labelSeries=[],ae.labelSeriesMaxSum=0,ae.seriesLabelTimer&&T().clearTimeout(ae.seriesLabelTimer),ae.series.forEach(function(he){let at=he.options.label||{},Ge=he.labelBySeries,ee=Ge&&Ge.closest,Le=he.getColumn("y");at.enabled&&he.visible&&(he.graph||he.area)&&!he.boosted&&ae.labelSeries&&(ae.labelSeries.push(he),at.minFontSize&&at.maxFontSize&&Le.length&&(he.sum=Le.reduce((Ke,ct)=>(Ke||0)+(ct||0),0),ae.labelSeriesMaxSum=Math.max(ae.labelSeriesMaxSum||0,he.sum||0)),ye.type==="load"&&(Ve=Math.max(Ve,co(he.options.animation).duration)),ee&&(ee[0].plotX!==void 0?Ge.animate({x:ee[0].plotX+ee[1],y:ee[0].plotY+ee[2]}):Ge.attr({opacity:0})))}),ae.seriesLabelTimer=Wl(function(){ae.series&&ae.labelSeries&&(function(he){he.boxesToAvoid=[];let at=he.labelSeries||[],Ge=he.boxesToAvoid;he.series.forEach(ee=>(ee.points||[]).forEach(Le=>(Le.dataLabels||[]).forEach(Ke=>{let{width:ct,height:Bt}=Ke.getBBox(),Ft=(Ke.translateX||0)+(ee.xAxis?ee.xAxis.pos:ee.chart.plotLeft),St=(Ke.translateY||0)+(ee.yAxis?ee.yAxis.pos:ee.chart.plotTop);Ge.push({left:Ft,top:St,right:Ft+ct,bottom:St+Bt})}))),at.forEach(function(ee){let Le=ee.options.label||{};ee.interpolatedPoints=(function(Ke){let ct,Bt,Ft,St,ft;if(!Ke.xAxis&&!Ke.yAxis)return;let xt=Ke.points,Kt=[],It=Ke.graph||Ke.area,$e=It&&It.element,Be=Ke.chart.inverted,ut=Ke.xAxis,Re=Ke.yAxis,Je=Be?Re.pos:ut.pos,ot=Be?ut.pos:Re.pos,wt=Be?ut.len:Re.len,Gi=Be?Re.len:ut.len,ht=zt((Ke.options.label||{}).onArea,!!Ke.area),je=Re.getThreshold(Ke.options.threshold),Tt={},Xt=Be?"chartCenterX":"chartCenterY";function ai(lt){let yt=Math.round((lt.plotX||0)/8)+","+Math.round((lt.plotY||0)/8);Tt[yt]||(Tt[yt]=1,Kt.push(lt))}if(Ke.getPointSpline&&$e&&$e.getPointAtLength&&!ht&&xt.length<(Ke.chart.plotSizeX||0)/16){let lt=It.toD&&It.attr("d");for(It.toD&&It.attr({d:It.toD}),Ft=$e.getTotalLength(),ct=0;ct<Ft;ct+=16){let Lt=$e.getPointAtLength(ct),Rt=Be?Gi-Lt.y:Lt.x,kt=Be?wt-Lt.x:Lt.y;ai({chartX:Je+Rt,chartY:ot+kt,plotX:Rt,plotY:kt})}lt&&It.attr({d:lt});let yt=xt[xt.length-1].pos();ai({chartX:Je+(yt?.[0]||0),chartY:ot+(yt?.[1]||0)})}else{let lt;for(ct=0,Ft=xt.length;ct<Ft;ct+=1){let yt=xt[ct],[Lt,Rt]=yt.pos()||[],{plotHigh:kt}=yt;if(en(Lt)&&en(Rt)){let bt={plotX:Lt,plotY:Rt,chartX:Je+Lt,chartY:ot+Rt};if(ht&&(kt&&(bt.plotY=kt,bt.chartY=ot+kt),Be?bt.chartCenterX=Je+Gi-((kt||yt.plotY||0)+zt(yt.yBottom,je))/2:bt.chartCenterY=ot+((kt||Rt)+zt(yt.yBottom,je))/2),lt&&(Bt=Math.max(Math.abs(bt.chartX-lt.chartX),Math.abs(bt.chartY-lt.chartY)))>16&&Bt<999)for(ft=1,St=Math.ceil(Bt/16);ft<St;ft+=1)ai({chartX:lt.chartX+(bt.chartX-lt.chartX)*(ft/St),chartY:lt.chartY+(bt.chartY-lt.chartY)*(ft/St),[Xt]:(lt[Xt]||0)+((bt[Xt]||0)-(lt[Xt]||0))*(ft/St),plotX:(lt.plotX||0)+(Lt-(lt.plotX||0))*(ft/St),plotY:(lt.plotY||0)+(Rt-(lt.plotY||0))*(ft/St)});ai(bt),lt=bt}}}return Kt})(ee),Ge.push(...Le.boxesToAvoid||[])}),he.series.forEach(function(ee){let Le=ee.options.label;if(!Le||!ee.xAxis&&!ee.yAxis)return;let Ke="highcharts-color-"+zt(ee.colorIndex,"none"),ct=!ee.labelBySeries,Bt=Le.minFontSize,Ft=Le.maxFontSize,St=he.inverted,ft=St?ee.yAxis.pos:ee.xAxis.pos,xt=St?ee.xAxis.pos:ee.yAxis.pos,Kt=he.inverted?ee.yAxis.len:ee.xAxis.len,It=he.inverted?ee.xAxis.len:ee.yAxis.len,$e=ee.interpolatedPoints,Be=zt(Le.onArea,!!ee.area),ut=[],Re=ee.getColumn("x"),Je,ot,wt,Gi,ht,je,Tt=ee.labelBySeries,Xt,ai,lt;function yt(Qt,Wt,Yt){let tn=Math.max(ft,zt(ai,-1/0)),si=Math.min(ft+Kt,zt(lt,1/0));return Qt>tn&&Qt<=si-Yt.width&&Wt>=xt&&Wt<=xt+It-Yt.height}function Lt(){Tt&&(ee.labelBySeries=Tt.destroy())}if(Be&&!St&&(Xt=[ee.xAxis.toPixels(Re[0]),ee.xAxis.toPixels(Re[Re.length-1])],ai=Math.min.apply(Math,Xt),lt=Math.max.apply(Math,Xt)),ee.visible&&!ee.boosted&&$e){if(!Tt){var Rt,kt,bt;let Qt=ee.name;if(typeof Le.format=="string"?Qt=Vl(Le.format,ee,he):Le.formatter&&(Qt=Le.formatter.call(ee)),ee.labelBySeries=Tt=he.renderer.label(Qt,0,0,"connector",0,0,Le.useHTML).addClass("highcharts-series-label highcharts-series-label-"+ee.index+" "+(ee.options.className||"")+" "+Ke),!he.renderer.styledMode){let Wt=typeof ee.color=="string"?ee.color:"#666666";Tt.css(bo({color:Be?he.renderer.getContrast(Wt):Wt},Le.style||{})),Tt.attr({opacity:+!!he.renderer.forExport,stroke:ee.color,"stroke-width":1})}Bt&&Ft&&Tt.css({fontSize:(Rt=ee,kt=Bt,bt=Ft,kt+(Rt.sum||0)/(Rt.chart.labelSeriesMaxSum||0)*(bt-kt)+"px")}),Tt.attr({padding:0,zIndex:3}).add()}for((Je=Tt.getBBox()).width=Math.round(Je.width),ht=$e.length-1;ht>0;ht-=1)Be?yt(ot=($e[ht].chartCenterX??$e[ht].chartX)-Je.width/2,wt=($e[ht].chartCenterY??$e[ht].chartY)-Je.height/2,Je)&&(je=mi(ee,ot,wt,Je)):(yt(ot=$e[ht].chartX+3,wt=$e[ht].chartY-Je.height-3,Je)&&(je=mi(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX+3,wt=$e[ht].chartY+3,Je)&&(je=mi(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX-Je.width-3,wt=$e[ht].chartY+3,Je)&&(je=mi(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX-Je.width-3,wt=$e[ht].chartY-Je.height-3,Je)&&(je=mi(ee,ot,wt,Je,!0))),je&&ut.push(je);if(Le.connectorAllowed&&!ut.length&&!Be)for(ot=ft+Kt-Je.width;ot>=ft;ot-=16)for(wt=xt;wt<xt+It-Je.height;wt+=16)(Gi=mi(ee,ot,wt,Je,!0))&&ut.push(Gi);if(ut.length){ut.sort((Wt,Yt)=>Yt.weight-Wt.weight),je=ut[0],(he.boxesToAvoid||[]).push({left:je.x,right:je.x+Je.width,top:je.y,bottom:je.y+Je.height});let Qt=Math.sqrt(Math.pow(Math.abs(je.x-(Tt.x||0)),2)+Math.pow(Math.abs(je.y-(Tt.y||0)),2));if(Qt&&ee.labelBySeries){let Wt,Yt={opacity:+!!he.renderer.forExport,x:je.x,y:je.y},tn={opacity:1};Qt<=10&&(tn={x:Yt.x,y:Yt.y},Yt={}),ct&&(Wt=co(ee.options.animation),Wt.duration*=.2),ee.labelBySeries.attr(bo(Yt,{anchorX:je.connectorPoint&&(je.connectorPoint.plotX||0)+ft,anchorY:je.connectorPoint&&(je.connectorPoint.plotY||0)+xt})).animate(tn,Wt),ee.options.kdNow=!0,ee.buildKDTree();let si=ee.searchPoint({chartX:je.x,chartY:je.y},!0);si&&(Tt.closest=[si,je.x-(si.plotX||0),je.y-(si.plotY||0)])}}else Lt()}else Lt()}),Rl(he,"afterDrawSeriesLabels")})(ae)},ae.renderer.forExport||!Ve?0:Ve)}}function Nl(ye,ae,Ve,he,at){let Ge=at&&at.anchorX,ee=at&&at.anchorY,Le,Ke,ct=Ve/2;return en(Ge)&&en(ee)&&(Le=[["M",Ge,ee]],(Ke=ae-ee)<0&&(Ke=-he-Ke),Ke<Ve&&(ct=Ge<ye+Ve/2?Ke:Ve-Ke),ee>ae+he?Le.push(["L",ye+ct,ae+he]):ee<ae?Le.push(["L",ye+ct,ae]):Ge<ye?Le.push(["L",ye,ae+he/2]):Ge>ye+Ve&&Le.push(["L",ye+Ve,ae+he/2])),Le||[]}let Mo=T();({compose:function(ye,ae){kl(Ol,"SeriesLabel")&&(Io(ye,"load",Eo),Io(ye,"redraw",Eo),ae.prototype.symbols.connector=Nl,Bl({plotOptions:{series:{label:Ai}}}))}}).compose(Mo.Chart,Mo.SVGRenderer);let Al=T();return l.default})())});var Hl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Qr=i=>({ID:i});function Ql(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Yl(i,s){if(i&1&&(n(0,"div",2),S(1,Ql,3,0,"button",3),a()),i&2){let e=m();o(),y(e.roleService.global.Export?1:-1)}}function jl(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",10)(11,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",14),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",19),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",20),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),b(41,"i",21),a(),n(42,"ng-select",22),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",23),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),c("items",e.pageData.Options.ContactGroups),C("ngModel",e.pageData.Filter.ContactGroupID),o(3),C("model",e.pageData.Filter.Bin),o(3),c("items",e.pageData.Options.Types),C("ngModel",e.pageData.Filter.TypeID),o(3),c("items",e.pageData.Options.Currencies),C("ngModel",e.pageData.Filter.CurrencyID),o(3),c("items",e.pageData.Options.Deliveries),C("ngModel",e.pageData.Filter.DeliveryStateID),o(3),C("ngModel",e.pageData.Filter.PaymentStateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),C("ngModel",e.pageData.Filter.CreatorID),c("renderThumbnail",!1),o(3),C("model",e.pageData.Filter.NoteVisible),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),C("ngModel",e.pageData.Filter.QueryOption),o(3),C("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function ql(i,s){i&1&&(n(0,"th",32),p(1," @ Cost "),a())}function Ul(i,s){if(i&1&&(n(0,"small",46),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.CustomerNameDisplay," - {0}"))}}function zl(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.SalesName," - Sales: {0}"))}}function Kl(i,s){if(i&1&&(n(0,"span",46),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" "," - Profit: "+g(2,1,e.Profit)," ")}}function Xl(i,s){if(i&1&&(n(0,"i",49),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function Jl(i,s){if(i&1&&(n(0,"span",50),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function Zl(i,s){i&1&&(n(0,"span"),p(1,"-"),a())}function $l(i,s){if(i&1&&(b(0,"div",51),d(1,"newlines")),i&2){let e=m().$implicit;c("innerHTML",g(1,1,e.SONote),Ee)}}function ep(i,s){if(i&1&&(n(0,"div")(1,"a",57),p(2),a()()),i&2){let e=m().$implicit;o(),c("queryParams",X(2,Qr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function tp(i,s){if(i&1&&(n(0,"i",60),p(1),a()),i&2){let e=m().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function ip(i,s){if(i&1&&(n(0,"th",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitCost)," ")}}function np(i,s){if(i&1&&(n(0,"tr",55)(1,"th",28)(2,"div",58)(3,"span",59),p(4),a(),S(5,tp,2,1,"i",60),b(6,"small",61),a()(),n(7,"th",62),p(8),a(),n(9,"th",63),p(10),d(11,"quantityFraction"),a(),n(12,"th",64),p(13),a(),S(14,ip,3,3,"th",65),n(15,"th",66),p(16),d(17,"amountFraction"),a(),n(18,"th",67)(19,"div",68),p(20),a(),n(21,"div",69),p(22),d(23,"amountFraction"),a()(),n(24,"th",66),p(25),d(26,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),y((e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName?5:-1),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(11,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?14:-1),o(2),D(" ",g(17,13,e==null?null:e.UnitPrice)," "),o(4),D(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),D(" ",(e==null?null:e.DiscountAmount)==0?"":g(23,15,e==null?null:e.DiscountAmount)," "),o(3),D(" ",g(26,17,e==null?null:e.Total)," ")}}function ap(i,s){if(i&1&&(n(0,"tr")(1,"th",70),p(2),a(),n(3,"th",71),p(4),a(),n(5,"th",72),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e.CurrencySymbol," "),o(2),D(" ",g(7,3,e.Amount)," ")}}function op(i,s){if(i&1&&(n(0,"div")(1,"div",41)(2,"div",42)(3,"div")(4,"a",43)(5,"span",44),p(6),a()(),n(7,"span"),p(8),d(9,"date"),b(10,"small",45),d(11,"date"),S(12,Ul,3,4,"small",46),a()(),n(13,"div",47)(14,"strong",48),p(15),S(16,zl,3,4,"span"),a(),S(17,Kl,3,3,"span",46),S(18,Xl,2,1,"i",49),S(19,Jl,2,1,"span",50),S(20,Zl,2,0,"span"),a(),S(21,$l,2,3,"div",51),S(22,ep,3,4,"div"),a(),n(23,"div",52),p(24),a()(),n(25,"table",53)(26,"tbody",54),G(27,np,27,19,"tr",55,Y),a()(),n(29,"table",56),G(30,ap,8,5,"tr",null,Y),a()()),i&2){let e=s.$implicit,r=m(2);o(4),c("routerLink",M(21,Hl))("queryParams",X(22,Qr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number),o(2),D(" "," - "+v(9,15,e.Date,"dd MMM yyyy")," "),o(2),c("innerHtml","("+v(11,18,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Ee),o(2),y(r.isNotEmpty(e.CustomerNameDisplay)?12:-1),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),y(r.isNotEmpty(e.SalesName)?16:-1),o(),y(r.roleService.report.Profit?17:-1),o(),y(r.isNotEmpty(e.DeliveryOutlet)?18:-1),o(),y(r.isNotEmpty(e.PromotionCoupon)?19:-1),o(),y(e.SONote&&e.PromotionCoupon?20:-1),o(),y(r.isNotEmpty(e.SONote)?21:-1),o(),y(r.isNotEmpty(e.ReferenceInvoiceID)?22:-1),o(2),D(" ",e.PaymentStateLabel," "),o(3),H(e.Items),o(3),H(e.Aggregate)}}function rp(i,s){if(i&1){let e=I();n(0,"span",73),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",74),p(2,"?"),a()()}}function lp(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function pp(i,s){if(i&1){let e=I();n(0,"div",2)(1,"a",75),P("click",function(){u(e);let t=m(2);return t.currentRowCount=100,_(t.NextPage(!0))}),b(2,"i",76),p(3," Next 100"),a()()}}function mp(i,s){if(i&1){let e=I();n(0,"content")(1,"div",24)(2,"div",25)(3,"table",26)(4,"thead",27)(5,"tr")(6,"th",28),p(7,"Name"),a(),n(8,"th",29),p(9,"Code"),a(),n(10,"th",30),p(11,"Qty"),a(),n(12,"th",31),p(13,"UOM"),a(),S(14,ql,2,0,"th",32),n(15,"th",33),p(16,"@ Price"),a(),n(17,"th",30),p(18,"Disc."),a(),n(19,"th",33),p(20,"Total"),a()()(),n(21,"tbody")(22,"tr")(23,"td",34),G(24,op,32,24,"div",null,Y),a()()()()(),n(26,"div",35)(27,"button",36),P("click",function(){u(e);let t=m();return _(t.showSummaryReport())}),p(28," View Report Summary "),a()(),n(29,"div",37)(30,"div",38)(31,"div",39),p(32),d(33,"number"),S(34,rp,3,0,"span",40),S(35,lp,3,3,"span"),p(36),a()(),S(37,pp,4,0,"div",2),a()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(9),li("colspan",e.roleService.product.Cost?8:7),o(),H(e.infiniteList),o(8),D(" Showing 1 - ",g(33,7,e.infiniteList.length)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:34),o(),y(e.pageData.HideStoreApiCount?35:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),y(e.nextPageDisabled?37:-1)}}var Hn=class i extends De{constructor(e,r,t,l,h,T,Ze,Ni){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,h);this.csvConverter=t;this.datePipe=l;this.activatedRoute=h;this.matDialog=T;this.toaster=Ze;this.roleService=Ni}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,V.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),V.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),V.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return V.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(h=>h):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(K,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(Wr,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(Ne),w(z),w(qe),w(j))};static \u0275cmp=B({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],[1,"fw-bold"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table","table-sm","table-borderless"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"lh-base"],[1,"fw-normal"],[1,"text-warning","inlineMarginLeft"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Yl,2,1,"div",2),a(),n(3,"filters"),E(4,jl,46,26,"ng-template",null,0,O),a(),S(6,mp,38,9,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,ie,Te,Ae,U,ze,gr,On,re,oe,Z,ne],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media (max-width: 992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var Qn=class i{constructor(s,e){this._dialogRef=s;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Vn;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(w(wi),w(Ti))};static \u0275cmp=B({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),x("ngModelChange",function(l){return f(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),x("ngModelChange",function(l){return f(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(c("title","Export Report")("config",r.modalConfig),o(6),C("ngModel",r.ExportPageNumber),o(4),C("ngModel",r.ExportRowCount),c("max",1e4))},dependencies:[Qe,L,R,Ue,Pi],encapsulation:2})};var cp=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],jr=i=>({ID:i}),dp=()=>["/menu/Contacts/Contact/Customers/Info"],up=(i,s,e)=>({"text-success":i,"text-warning":s,"text-danger":e});function _p(i,s){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function gp(i,s){if(i&1){let e=I();pt(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),x("timeChange",function(t){u(e);let l=m(2);return f(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=m(2);return _(l.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),x("timeChange",function(t){u(e);let l=m(2);return f(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=m(2);return _(l.timeToChange(t))}),a()()(),mt()}if(i&2){let e=m(2);o(3),C("date",e.pageData.Filter.From),o(2),C("time",e.timeFrom),o(3),C("date",e.pageData.Filter.To),o(2),C("time",e.timeTo)}}function Cp(i,s){if(i&1){let e=I();n(0,"datepicker",26),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=m(2);C("date",e.pageData.Filter.From),c("appearance","outline")("width",100),o(2),C("date",e.pageData.Filter.To),c("appearance","outline")("width",100)}}function fp(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",12),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),E(18,gp,11,4,"ng-container",13)(19,Cp,3,6,"ng-template",null,1,O),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(24,"h6"),p(25,"Customer Groups"),a(),n(26,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Dt(20),r=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",r.pageData.Filter.ListIDs),c("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),C("ngModel",r.pageData.Filter.CustomerID),c("inputTextValue",r.pageData.CustomerName),o(3),C("ngModel",r.pageData.Filter.SalesID),o(3),C("ngModel",r.pageData.Filter.SalesOrderTagID),c("items",r.pageData.Options.SalesOrderTags),o(3),c("options",r.pageData.Options.DefaultFilterColumnOptions),C("model",r.pageData.Filter.DefaultFilterColumn),o(3),c("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),C("ngModel",r.pageData.Filter.RegisterID),c("items",r.pageData.Options.Registers),o(3),C("ngModel",r.pageData.Filter.CustomerGroupID),c("items",r.pageData.Options.Groups),o(3),C("ngModel",r.pageData.Filter.PaymentState),c("items",r.pageData.Options.States),o(3),C("ngModel",r.pageData.Filter.CreatorID),o(3),c("max",1e4),C("ngModel",r.pageData.Filter.RowCount)}}function xp(i,s){i&1&&(n(0,"th",57),p(1,"DATE"),a())}function hp(i,s){i&1&&(n(0,"th",58),p(1," CUSTOMER "),a())}function Sp(i,s){i&1&&(n(0,"th",45),p(1,"JOIN DATE"),a())}function yp(i,s){i&1&&(n(0,"th",46),p(1,"GROUPS"),a())}function Dp(i,s){i&1&&(n(0,"th",59),p(1," SALES PERSON "),a())}function vp(i,s){i&1&&(n(0,"th",60),p(1," COST "),a())}function wp(i,s){i&1&&(n(0,"th",61),p(1," GROSS "),a())}function Tp(i,s){i&1&&(n(0,"th",62),p(1," SALES "),a())}function Pp(i,s){i&1&&(n(0,"th",63),p(1," TAX "),a())}function Fp(i,s){i&1&&(n(0,"th",64),p(1," SURCHARGE "),a())}function Ip(i,s){i&1&&(n(0,"th",65),p(1," TOTAL "),a())}function bp(i,s){i&1&&(n(0,"th",66),p(1," PAYMENT "),a())}function Ep(i,s){i&1&&b(0,"br")}function Mp(i,s){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Note)}}function Vp(i,s){if(i&1&&(n(0,"td")(1,"div"),p(2),d(3,"date"),a(),n(4,"div"),p(5),d(6,"date"),a()()),i&2){let e=m().$implicit;o(2),D(" ",v(3,2,e.Date,"dd MMM yy")," "),o(3),D(" ",v(6,5,e.Created,"HH:mm")," ")}}function Bp(i,s){if(i&1&&(n(0,"td")(1,"a",72),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,dp))("queryParams",X(4,jr,e.CustomerID)),o(),F(e.CustomerName)}}function Op(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.JoinDate!=="0001-01-01T00:00:00"?v(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function Lp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Groups," ")}}function Rp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.SalesName," ")}}function kp(i,s){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Wp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function Np(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Ap(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Gp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SurchargeAmount)," ")}}function Hp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNSurcharge)," ")}}function Qp(i,s){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=m().$implicit;c("ngClass",_t(2,up,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function Yp(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",67),p(5),a(),E(6,Ep,1,0,"br",4)(7,Mp,2,1,"i",4),a(),E(8,Vp,7,8,"td",4)(9,Bp,3,6,"td",4),S(10,Op,3,4,"td"),S(11,Lp,2,1,"td"),E(12,Rp,2,1,"td",4)(13,kp,3,3,"td",68)(14,Wp,3,3,"td",69)(15,Np,3,3,"td",69)(16,Ap,3,3,"td",70)(17,Gp,3,3,"td",69)(18,Hp,3,3,"td",69)(19,Qp,2,6,"td",71),a()),i&2){let e=s.$implicit,r=m(3);o(2),F(e.EntityName),o(2),c("routerLink",M(18,cp))("queryParams",X(19,jr,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",e.Note),o(),c("ngIf",e.Note),o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Customer.selected),o(),y(r.column.JoinDate.selected?10:-1),o(),y(r.column.Groups.selected?11:-1),o(),c("ngIf",r.column.SalesPerson.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.column.Gross.selected),o(),c("ngIf",r.column.Sales.selected),o(),c("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),c("ngIf",r.data.SurchargeVisible),o(),c("ngIf",r.column.Total.selected),o(),c("ngIf",r.column.Payment.selected)}}function jp(i,s){i&1&&b(0,"td",79)}function qp(i,s){i&1&&b(0,"td",79)}function Up(i,s){i&1&&b(0,"td",79)}function zp(i,s){i&1&&(n(0,"td",82),p(1," Total: "),a())}function Kp(i,s){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Cost"))," ")}}function Xp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function Jp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function Zp(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function $p(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function em(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function tm(i,s){if(i&1&&(n(0,"tfoot",77)(1,"tr",78),b(2,"td",79),E(3,jp,1,0,"td",80)(4,qp,1,0,"td",80)(5,Up,1,0,"td",80)(6,zp,2,0,"td",81)(7,Kp,4,6,"td",68)(8,Xp,4,6,"td",69)(9,Jp,4,6,"td",69)(10,Zp,4,6,"td",70)(11,$p,4,6,"td",69)(12,em,4,6,"td",69),a()()),i&2){let e=m(3);o(3),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected)}}function im(i,s){if(i&1){let e=I();n(0,"div",38)(1,"table",39),P("matSortChange",function(t){u(e);let l=m(2);return _(l.sortData(t))}),n(2,"thead",40)(3,"tr")(4,"th",41),p(5,"OUTLET"),a(),n(6,"th",42),p(7,"NUMBER"),a(),E(8,xp,2,0,"th",43)(9,hp,2,0,"th",44),S(10,Sp,2,0,"th",45),S(11,yp,2,0,"th",46),E(12,Dp,2,0,"th",47)(13,vp,2,0,"th",48)(14,wp,2,0,"th",49)(15,Tp,2,0,"th",50)(16,Pp,2,0,"th",51)(17,Fp,2,0,"th",52)(18,Ip,2,0,"th",53)(19,bp,2,0,"th",54),a()(),n(20,"tbody"),E(21,Yp,20,21,"tr",55),a(),E(22,tm,13,10,"tfoot",56),a()()}if(i&2){let e=m(2);o(8),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),y(e.column.JoinDate.selected?10:-1),o(),y(e.column.Groups.selected?11:-1),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected),o(),c("ngIf",e.column.Payment.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data)}}function nm(i,s){if(i&1){let e=I();n(0,"span",83),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",84),p(2,"?"),a()()}}function am(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function om(i,s){if(i&1){let e=I();n(0,"a",85),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",86),p(2," Next"),a()}}function rm(i,s){if(i&1){let e=I();n(0,"a",87),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),b(1,"i",88),p(2," Show All"),a()}}function lm(i,s){if(i&1&&(n(0,"content")(1,"div",29),E(2,im,23,14,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),E(8,nm,3,0,"span",34)(9,am,3,3,"span",4),p(10),a()(),n(11,"div",35),E(12,om,3,0,"a",36)(13,rm,3,0,"a",37),a()()()()),i&2){let e=m();o(2),c("ngIf",e.data),o(4),D(" Showing 1 - ",g(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Yn=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=h}roleService=Pe(j);columnService=Pe(gt);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>V.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(Qn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,l.CustomerName=l.CustomerName==null?"":l.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,l.SalesName=l.SalesName==null?"":l.SalesName,e.active){case"outlet":return this.compare(t.EntityName?.toLowerCase(),l.EntityName?.toLowerCase(),h);case"number":return this.compare(t.Number,l.Number,h);case"date":return this.compare(t.Date,l.Date,h);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),h);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),h);case"cost":return this.compare(t.Cost,l.Cost,h);case"gross":return this.compare(t.Gross,l.Gross,h);case"sales":return this.compare(t.Sales,l.Sales,h);case"tax":return this.compare(t.Tax,l.Tax,h);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,h);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,h);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,h);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,h);case"groups":return this.compare(t.Groups,l.Groups,h);default:return 0}})}openExportModal(){this._matDialog.open(K,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");V.IsNotEmpty(r)&&(this.pageData.Filter.From=V.MinDate,this.pageData.Filter.To=V.MinDate),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["placeholder","Search Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Is Created",3,"modelChange","options","model"],[4,"ngIf","ngIfElse"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["name","From",3,"dateChange","date","appearance","width"],[1,"mt-4"],["name","To",3,"dateChange","date","appearance","width"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more forders",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date",4,"ngIf"],["mat-sort-header","customer",4,"ngIf"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson",4,"ngIf"],["mat-sort-header","cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","gross","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","sales","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","tax","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","surcharge","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","total","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","payment","style","width: 50px",4,"ngIf"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],["class","text-end text-danger",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-start",3,"ngClass",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-start",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],["class","empty-column",4,"ngIf"],["class","text-end empty-column",4,"ngIf"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,_p,3,0,"button",3),a(),n(3,"filters"),E(4,fp,36,22,"ng-template",null,0,O),a(),E(6,lm,14,9,"content",4),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,Qe,L,R,ie,pe,ge,Ue,Te,Ae,Mi,U,ze,se,re,oe,Z],encapsulation:2})};var pm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],mm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],sm=()=>["/menu/Products/Setup/Brand/Brand_Form"],cm=i=>({ID:i}),dm=(i,s)=>({BrandID:i,Name:s});function um(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export"),a()}}function _m(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function gm(i,s){i&1&&(n(0,"th",18),p(1,"Code"),a())}function Cm(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function fm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",22),p(3),a()(),S(4,Cm,2,1,"td"),n(5,"td",23)(6,"a",24),p(7),d(8,"quantityFraction"),a()(),n(9,"td",23),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(11,sm))("queryParams",X(12,cm,e.ID)),o(),D("",e.BrandName," "),o(),y(e.Countcode>0?4:-1),o(2),c("queryParams",fe(14,dm,e.ID,e.BrandName)),o(),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.Total))}}function xm(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",15),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",16)(3,"tr")(4,"th",17),p(5,"Brand"),a(),S(6,gm,2,0,"th",18),n(7,"th",19),p(8,"Sold"),a(),n(9,"th",20),p(10,"Total"),a()()(),n(11,"tbody"),G(12,fm,12,17,"tr",null,Y),a(),n(14,"tfoot")(15,"tr",21)(16,"td"),p(17,"Total"),a(),n(18,"td"),p(19),d(20,"sum"),d(21,"quantityFraction"),a(),n(22,"td"),p(23),d(24,"sum"),d(25,"amountFraction"),a()()()()()}if(i&2){let e=m();o(6),y(e.data.Countcode>0?6:-1),o(6),H(e.data.Data),o(7),F(g(21,6,v(20,3,e.data.Data,"Quantity"))),o(4),F(g(25,11,v(24,8,e.data.Data,"Total")))}}var jn=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=h;this.matDialog=T}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,h);case"Code":return this.compare(t.Code,l.Code,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Total":return this.compare(t.Total,l.Total,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[W],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[1,"footer","text-end","fw-bold"],[3,"routerLink","queryParams"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,um,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Pie Chart "),a()(),n(10,"li")(11,"a",6),p(12," Brand Sales Analysis "),a()()()()(),n(13,"filters"),E(14,_m,9,6,"ng-template",null,0,O),a(),n(16,"content"),S(17,xm,26,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,pm)),o(3),c("routerLink",M(9,mm)),o(6),y(t.data?17:-1))},dependencies:[A,Q,J,L,R,ie,pe,ge,U,se,Z,ne],encapsulation:2})};function hm(i,s){if(i&1){let e=I();n(0,"label",2),P("click",function(){let t=u(e).$implicit,l=m();return _(l.updateSelectedGroups(t.ID))}),b(1,"input",3),n(2,"span"),p(3),a()()}if(i&2){let e=s.$implicit,r=m();o(),c("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),F(e.Name)}}var qn=class i{constructor(s,e){this.dialogRef=s;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(s){let e=this.IDGroups.indexOf(s);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(s)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(w(wi),w(Ti))};static \u0275cmp=B({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:5,vars:1,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),G(3,hm,4,3,"label",null,Y),a()()()),e&2&&(c("title","Edit Groups"),o(3),H(r.options))},dependencies:[Pi],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var Sm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],ym=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Dm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],vm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],wm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],Tm=()=>["/menu/Contacts/Contact/Customers/Info"],Pm=i=>({ID:i});function Fm(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Im(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function bm(i,s){i&1&&(n(0,"th",22),p(1," ORDERS "),a())}function Em(i,s){i&1&&(n(0,"th",23),p(1," QTY "),a())}function Mm(i,s){i&1&&(n(0,"th",24),p(1," COST "),a())}function Vm(i,s){i&1&&(n(0,"th",25),p(1," SALES "),a())}function Bm(i,s){i&1&&(n(0,"th",26),p(1," TAX "),a())}function Om(i,s){i&1&&(n(0,"th",27),p(1," SALES + TAX "),a())}function Lm(i,s){if(i&1){let e=I();n(0,"span")(1,"span"),p(2),a(),n(3,"a",37),P("click",function(){u(e);let t=m(2).$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=s.$implicit,r=s.$index;o(2),F(r==0?"":" , "),o(2),F(e.GroupName)}}function Rm(i,s){if(i&1&&(n(0,"span"),G(1,Lm,5,2,"span",null,Y),a()),i&2){let e=m().$implicit;o(),H(e.Groups)}}function km(i,s){if(i&1){let e=I();n(0,"a",37),P("click",function(){u(e);let t=m().$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function Wm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Orders)," ")}}function Nm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Am(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Gm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Hm(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Qm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales+e.Tax)," ")}}function Ym(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",30),p(3),a(),n(4,"div",31),S(5,Rm,3,0,"span"),S(6,km,2,0,"a",32),a()(),n(7,"td")(8,"span",33),p(9),a()(),S(10,Wm,3,3,"td",34),S(11,Nm,3,3,"td",34),S(12,Am,3,3,"td",35),S(13,Gm,3,3,"td",34),S(14,Hm,3,3,"td",36),S(15,Qm,3,3,"td",34),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("routerLink",M(13,Tm))("queryParams",X(14,Pm,e.CustomerID)),o(),D(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),y(e.Groups.length>0?5:-1),o(),y(e.Groups.length>0?-1:6),o(2),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),D("",e.Code," "),o(),y(r.column.Orders.selected?10:-1),o(),y(r.column.QTY.selected?11:-1),o(),y(r.roleService.product.Cost&&r.column.Cost.selected?12:-1),o(),y(r.column.Sales.selected?13:-1),o(),y(r.column.Tax.selected?14:-1),o(),y(r.column.SalesNTax.selected?15:-1)}}function jm(i,s){if(i&1&&(n(0,"tbody",28),G(1,Ym,16,16,"tr",null,Y),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function qm(i,s){if(i&1){let e=I();n(0,"div",7)(1,"div",17)(2,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",19)(4,"tr")(5,"th",20),p(6,"CUSTOMER"),a(),n(7,"th",21),p(8," CODE "),a(),S(9,bm,2,0,"th",22),S(10,Em,2,0,"th",23),S(11,Mm,2,0,"th",24),S(12,Vm,2,0,"th",25),S(13,Bm,2,0,"th",26),S(14,Om,2,0,"th",27),a()(),S(15,jm,3,0,"tbody",28),a()(),n(16,"infinite-pagination",29),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=m();o(9),y(e.column.Orders.selected?9:-1),o(),y(e.column.QTY.selected?10:-1),o(),y(e.roleService.product.Cost&&e.column.Cost.selected?11:-1),o(),y(e.column.Sales.selected?12:-1),o(),y(e.column.Tax.selected?13:-1),o(),y(e.column.SalesNTax.selected?14:-1),o(),y(e.data.Data?15:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",!e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Un=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=h}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=Rn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(jt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Code":return this.compare(t.Code,l.Code,h);case"Orders":return this.compare(t.Orders,l.Orders,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,h);case"Cost":return this.compare(t.Cost,l.Cost,h);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(qn,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let h={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",h).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(K,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[W],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],[1,"pointer"],[1,"text-primary"],["matTooltipPosition","above",3,"matTooltip"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"],[1,"text-primary",3,"click"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,Fm,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," By Age "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),b(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),E(24,Im,16,10,"ng-template",null,0,O),a(),n(26,"content"),S(27,qm,17,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Sm)),o(3),c("routerLink",M(13,ym)),o(3),c("routerLink",M(14,Dm)),o(3),c("routerLink",M(15,vm)),o(4),c("routerLink",M(16,wm)),o(6),y(t.data?27:-1))},dependencies:[A,Q,$,J,Qe,L,R,ie,pe,ge,Ue,U,ti,re,Z,ne],encapsulation:2})};var Um=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],zm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Xm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Jm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Zm(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function $m(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function es(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),n(6,"td",23),p(7),d(8,"amountFraction"),a(),n(9,"td",24),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D(" ",e.Name," "),o(2),F(g(5,4,e.TotalOrders)),o(3),F(g(8,6,e.TotalCost)),o(3),F(g(11,8,e.TotalAmount))}}function ts(i,s){if(i&1&&(n(0,"tbody",22),G(1,es,12,10,"tr",null,Y),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function is(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"AGE"),a(),n(6,"th",19),p(7," ORDERS"),a(),n(8,"th",20),p(9," COST"),a(),n(10,"th",21),p(11," AMOUNT"),a()()(),S(12,ts,3,0,"tbody",22),a()()}if(i&2){let e=m();o(12),y(e.data.Data?12:-1)}}var zn=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.datePipe=T}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,h);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,h);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,h);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,h);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[W],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Zm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,$m,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,is,13,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,Um)),o(3),c("routerLink",M(12,zm)),o(3),c("routerLink",M(13,Km)),o(3),c("routerLink",M(14,Xm)),o(3),c("routerLink",M(15,Jm)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,U,re,Z],encapsulation:2})};var ns=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],as=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],os=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],rs=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],ls=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function ps(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function ms(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function ss(i,s){i&1&&(n(0,"th",19),p(1," ORDERS"),a())}function cs(i,s){i&1&&(n(0,"th",20),p(1," QUANTITY"),a())}function ds(i,s){i&1&&(n(0,"th",21),p(1," AMOUNT"),a())}function us(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalOrders))}}function _s(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalQuantity)," ")}}function gs(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalAmount))}}function Cs(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,us,3,3,"td",23),S(4,_s,3,3,"td",23),S(5,gs,3,3,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),D(" ",e.Name," "),o(),y(r.column.Orders.selected?3:-1),o(),y(r.column.QTY.selected?4:-1),o(),y(r.column.Amount.selected?5:-1)}}function fs(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"GENDER"),a(),S(6,ss,2,0,"th",19),S(7,cs,2,0,"th",20),S(8,ds,2,0,"th",21),a()(),n(9,"tbody",22),G(10,Cs,6,4,"tr",null,Y),a()()()}if(i&2){let e=m();o(6),y(e.column.Orders.selected?6:-1),o(),y(e.column.QTY.selected?7:-1),o(),y(e.column.Amount.selected?8:-1),o(2),H(e.data==null?null:e.data.Data)}}var Kn=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=h}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,h);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,h);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,h);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,h);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(jt(1))}openExportModal(){this.matDialog.open(K,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[W],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,ps,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,ms,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,fs,12,3,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,ns)),o(3),c("routerLink",M(13,as)),o(3),c("routerLink",M(14,os)),o(3),c("routerLink",M(15,rs)),o(3),c("routerLink",M(16,ls)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,U,re,Z,ne],encapsulation:2})};var Ur=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],xs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],hs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Ss=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],ys=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Ds=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],vs=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],ws=i=>({ID:i}),Ts=(i,s,e)=>({From:i,SupplierID:s,To:e});function Ps(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Fs(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function Is(i,s){if(i&1&&(n(0,"tr",24)(1,"td"),p(2),a(),n(3,"td",25)(4,"a",26),p(5),a()(),n(6,"td",27),p(7),a(),n(8,"td",28),p(9),d(10,"quantityFraction"),a(),n(11,"td",27)(12,"a",26),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",M(19,vs))("queryParams",X(20,ws,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,9,e.Quantity)," "),o(3),c("routerLink",M(22,Ur))("queryParams",_t(23,Ts,v(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,v(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),D(" ",g(16,17,e.Total))}}function bs(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",29),b(2,"th",30),n(3,"th",27),p(4,"Total Quantity"),a(),n(5,"th",27),p(6,"Total Sales"),a()(),n(7,"tr"),b(8,"td",31),n(9,"td",27),p(10),a(),n(11,"td",27),p(12),a()()()),i&2){let e=m(2);o(10),F(e.data.TotalQty),o(2),F(e.data.TotalSales)}}function Es(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"RANK"),a(),n(6,"th",20),p(7,"SUPPLIER"),a(),n(8,"th",21),p(9," CODE "),a(),n(10,"th",22),p(11," QUANTITY "),a(),n(12,"th",23),p(13," TOTAL "),a()()(),n(14,"tbody"),G(15,Is,17,27,"tr",24,Y),a(),S(17,bs,13,2,"tfoot"),a()()}if(i&2){let e=m();o(15),H(e.data.Data),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?17:-1)}}var Xn=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,h);case"Supplier":return this.compare(t.Name,l.Name,h);case"Code":return this.compare(t.Code,l.Code,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Total":return this.compare(t.Total,l.Total,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[W],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Ps,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Compare with Transfer Order "),a()(),n(19,"li")(20,"a",6),p(21," Product Tags Analysis "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Fs,16,10,"ng-template",null,0,O),a(),n(28,"content"),S(29,Es,18,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Ur)),o(3),c("routerLink",M(13,xs)),o(3),c("routerLink",M(14,hs)),o(3),c("routerLink",M(15,Ss)),o(3),c("routerLink",M(16,ys)),o(3),c("routerLink",M(17,Ds)),o(6),y(t.data?29:-1))},dependencies:[A,Q,$,J,Qe,L,R,pe,ge,Ue,U,oe,Z,ne],encapsulation:2})};var zr=Jt(bi());var Vs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Bs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Os=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Ls=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Rs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],ks=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Ws=(i,s,e,r,t)=>({From:i,To:s,ListIDs:e,ListVariantID:r,GroupByVariant:t}),Ns=i=>[i],As=i=>({ID:i}),Gs=(i,s,e,r,t,l)=>({ID:i,From:s,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Kr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],Hs=(i,s,e)=>({VariantID:i,From:s,To:e}),Qs=(i,s,e)=>({ProductID:i,From:s,To:e});function Ys(i,s){if(i&1&&(n(0,"a",9),b(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=m();c("queryParams",cn(1,Ws,(e=r.queryParams())==null?null:e.From,(e=r.queryParams())==null?null:e.To,(e=r.queryParams())==null?null:e.ListIDs,(e=r.queryParams())==null?null:e.ListVariantID,(e=r.queryParams())==null?null:e.GroupByVariant))}}function js(i,s){if(i&1){let e=I();n(0,"button",11),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",12),p(2," Export "),a()}}function qs(i,s){if(i&1){let e=I();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(15,"h6"),p(16,"Product Tag"),a(),n(17,"ng-select",20),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(18,"h6"),p(19,"Sales Person"),a(),n(20,"sales-person-selector",21),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(27,"h6"),p(28,"Logistics Service"),a(),n(29,"ng-select",24),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(33,"h6"),p(34,"Customer Group"),a(),n(35,"ng-select",26),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",28),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",29),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),C("date",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(2),C("date",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(3),c("multiple",!0)("multiple",!0),C("ngModel",e.pageData.Filter.BrandIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),C("ngModel",e.pageData.Filter.TagID),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),C("ngModel",e.pageData.Filter.LogisticsServiceID),c("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),C("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.pageData.supplierName),o(3),c("items",e.pageData.Options.ContactGroups),C("ngModel",e.pageData.Filter.ContactGroupID),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(3),C("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function Us(i,s){if(i&1){let e=I();n(0,"th",48)(1,"div",49)(2,"input",50),P("change",function(t){u(e);let l=m(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=m(2);o(2),c("checked",e.isAllCheckBoxChecked())}}function zs(i,s){if(i&1&&(n(0,"th",51),p(1," Qty "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Quantity.start)}}function Ks(i,s){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function Xs(i,s){i&1&&(n(0,"th",53),p(1," Cost "),a())}function Js(i,s){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function Zs(i,s){if(i&1&&(n(0,"th",55),p(1," Sales "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function $s(i,s){i&1&&(n(0,"th",56),p(1," Tax "),a())}function e0(i,s){if(i&1&&(n(0,"th",57),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function t0(i,s){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function i0(i,s){i&1&&(n(0,"th",59),p(1," % "),a())}function n0(i,s){if(i&1){let e=I();n(0,"td")(1,"div",49)(2,"input",71),x("ngModelChange",function(t){u(e);let l=m().$implicit;return f(l.checked,t)||(l.checked=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=m().$implicit;o(2),c("value",e.ID),C("ngModel",e.checked)}}function a0(i,s){if(i&1){let e=I();pt(0),n(1,"img",72),P("click",function(t){u(e);let l=m().$implicit,h=m(2);return _(h.openBigPicture(l==null?null:l.ImageURL,t))}),a(),mt()}if(i&2){let e=m().$implicit;o(),c("src",e.ThumbnailUrl,rn)}}function o0(i,s){if(i&1){let e=I();n(0,"a",73)(1,"img",74),P("click",function(t){u(e);let l=m().$implicit,h=m(2);return _(h.openBigPicture(l,t))}),a()()}if(i&2){let e=m(3);c("target",e.pageData.LinkTarget)}}function r0(i,s){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=m().$implicit,t=m(2);o(),c("queryParams",Ao(4,Gs,r.ID,(e=t.queryParams())==null?null:e.From,(e=t.queryParams())==null?null:e.To,(e=t.queryParams())==null?null:e.ListIDs,(e=t.queryParams())==null?null:e.ListVariantID,(e=t.queryParams())==null?null:e.GroupByVariant)),o(),F(g(3,2,r.Quantity))}}function l0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.OnHand)," ")}}function p0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.UnitCost)," ")}}function m0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function s0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Kr))("queryParams",_t(12,Hs,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function c0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Kr))("queryParams",_t(12,Qs,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function d0(i,s){if(i&1&&(n(0,"td",75),E(1,s0,5,16,"a",78)(2,c0,5,16,"a",78),a()),i&2){let e=m(3);o(),c("ngIf",e.pageData.Filter.GroupByVariant),o(),c("ngIf",!e.pageData.Filter.GroupByVariant)}}function u0(i,s){if(i&1&&(n(0,"td",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function _0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNTax)," ")}}function g0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit)," ")}}function C0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Margin)," ")}}function f0(i,s){if(i&1&&(n(0,"tr",60),E(1,n0,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),E(7,a0,2,1,"ng-container",8)(8,o0,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),E(14,r0,4,11,"td",67)(15,l0,3,3,"td",67)(16,p0,3,3,"td",68)(17,m0,3,3,"td",67)(18,d0,3,2,"td",67)(19,u0,3,3,"td",69)(20,_0,3,3,"td",67)(21,g0,3,4,"td",70)(22,C0,3,4,"td",70),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(),c("ngIf",t.column.CompareQtySold.selected),o(2),F(r+1),o(4),c("ngIf",e.ImageURL),o(),c("ngIf",!e.ImageURL),o(2),c("routerLink",X(17,Ns,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(19,As,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.OnHand.selected),o(),c("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function x0(i,s){i&1&&b(0,"td",75)}function h0(i,s){i&1&&(n(0,"td",75),p(1," Total : "),a())}function S0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Quantity"))," ")}}function y0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"OnHand"))," ")}}function D0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"UnitCost"))," ")}}function v0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function w0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Sales")))}}function T0(i,s){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Tax")))}}function P0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"SalesNTax")))}}function F0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.infiniteList,"Profit"))," ")}}function I0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")/v(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),D(" ",g(6,14,v(4,8,e.infiniteList,"Profit")/v(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function b0(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",81),b(2,"td",75),E(3,x0,1,0,"td",67)(4,h0,2,0,"td",67)(5,S0,4,6,"td",67)(6,y0,4,6,"td",67)(7,D0,4,6,"td",68)(8,v0,4,6,"td",67)(9,w0,5,6,"td",82)(10,T0,5,6,"td",69)(11,P0,5,6,"td",82)(12,F0,5,10,"td",70)(13,I0,7,16,"td",70),a()()),i&2){let e=m(2);o(3),c("ngIf",e.column.CompareQtySold.selected),o(),c("ngIf",e.column.CompareQtySold.selected||e.column.QTY.selected||e.column.OnHand.selected||e.column.Cost.selected||e.column.Gross.selected||e.column.Sales.selected||e.column.SalesNTax.selected||e.column.Tax.selected||e.column.Profit.selected&&e.column.Profit.role||e.column.Margin.selected&&e.column.Profit.role),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function E0(i,s){if(i&1){let e=I();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",33)(5,"tr"),E(6,Us,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),E(11,zs,2,1,"th",37)(12,Ks,2,0,"th",38)(13,Xs,2,0,"th",39)(14,Js,2,0,"th",40)(15,Zs,2,1,"th",41)(16,$s,2,0,"th",42)(17,e0,2,1,"th",43)(18,t0,2,0,"th",44)(19,i0,2,0,"th",45),a()(),n(20,"tbody"),E(21,f0,23,21,"tr",46),a(),E(22,b0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.CompareQtySold.selected),o(5),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Jn=class i extends De{constructor(e,r,t,l,h,T,Ze){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,h);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=h;this.matDialog=T;this.bigPicture=Ze}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Pe(j);columnService=Pe(gt);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=dt([]);queryParams=dt(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=nt(et({},this.data),{Data:e.Data.map(t=>nt(et({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=nt(et({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=nt(et({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>nt(et({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;V.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,zi.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=nt(et({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),h);case"Brand":return V.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),h);case"Quantity":return V.compare(t.Quantity,l.Quantity,h);case"Total_Cost":return V.compare(t.UnitCost,l.UnitCost,h);case"Inventory":return V.compare(t.OnHand,l.OnHand,h);case"Total_Sales":return V.compare(t.Total,l.Total,h);case"Total_Tax":return V.compare(t.Tax,l.Tax,h);case"Total_Tax_Sales":return V.compare(t.SalesNTax,l.SalesNTax,h);case"ReOrder":return V.compare(t.MinStock,l.MinStock,h);case"Gross":return V.compare(t.Gross,l.Gross,h);case"Margin":return V.compare(t.Margin,l.Margin,h);case"Profit":return V.compare(t.Profit,l.Profit,h);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,zr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(qe),w(Ne),w(z),w(An))};static \u0275cmp=B({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[W],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Ys,3,7,"a",2),S(3,js,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",7),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",7),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",7),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",7),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",7),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),E(27,qs,45,36,"ng-template",null,0,O),a(),E(29,E0,24,18,"content",8),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.isAnyItemChecked),o(),y(t.roleService.global.Export?3:-1),o(6),c("routerLink",M(14,Vs)),o(3),c("routerLink",M(15,Bs)),o(3),c("routerLink",M(16,Os)),o(3),c("routerLink",M(17,Ls)),o(3),c("routerLink",M(18,Rs)),o(3),c("routerLink",M(19,ks)),o(5),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,Jo,L,R,ie,pe,ge,Te,Ae,Ce,U,ze,ti,se,oe,Z,ne],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var V0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],B0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],O0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],L0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],R0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],k0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],W0=i=>({ID:i}),N0=(i,s)=>s.Name,A0=(i,s)=>s.ID;function G0(i,s){if(i&1){let e=I();n(0,"a",16),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",17),p(2," Export "),a()}}function H0(i,s){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet Group"),a(),n(3,"POS-outlet-group-tree-select",19),x("selectedOutletGroupIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",20),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",21),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Category"),a(),n(12,"POS-product-category-select",22),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(13,"h6"),p(14,"Brand"),a(),n(15,"ng-select",23),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(16,"h6"),p(17,"Supplier"),a(),n(18,"autocompleteV2",24),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(19,"h6"),p(20,"Product Tags"),a(),n(21,"ng-select",25),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductTagID,t)||(l.pageData.Filter.ProductTagID=t),_(t)}),a(),n(22,"h6"),p(23,"From - To"),a(),n(24,"div")(25,"datepicker",26),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(26,"div",27)(27,"datepicker",28),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(28,"h6"),p(29,"Scope"),a(),n(30,"radio-options",29),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("showClear",!0),C("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),C("ngModel",e.pageData.Filter.BrandID),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.ProductTags),C("ngModel",e.pageData.Filter.ProductTagID),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function Q0(i,s){i&1&&(n(0,"th",30),p(1,"Code"),a()),i&2&&qt("text-align","right")}function Y0(i,s){i&1&&(n(0,"th",31),p(1,"Cost"),a()),i&2&&qt("text-align","right")}function j0(i,s){i&1&&(n(0,"th",31),p(1,"Sales"),a()),i&2&&qt("text-align","right")}function q0(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit;c("matTooltip",Ct(e.Name)),o(),D(" ",e.Code??e.Name," ")}}function U0(i,s){i&1&&(n(0,"th",14),p(1,"Total"),a())}function z0(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),F(e.Code)}}function K0(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),D(" ",g(2,3,e.UnitCost)," ")}}function X0(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),D(" ",g(2,3,e.UnitPrice)," ")}}function J0(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e," ")}}function Z0(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Total)}}function $0(i,s){if(i&1&&(n(0,"tr",15)(1,"td")(2,"a",32),p(3),a()(),S(4,z0,2,3,"td",33),S(5,K0,3,5,"td",33),S(6,X0,3,5,"td",33),G(7,J0,2,1,"td",14,Yi),S(9,Z0,2,1,"td",14),a()),i&2){let e=s.$implicit,r=m();o(2),c("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",X(7,W0,e.ID)),o(),D(" ",e.Name),o(),y(r.column.code.selected?4:-1),o(),y(r.column.cost&&r.column.cost.selected?5:-1),o(),y(r.column.sales&&r.column.sales.selected?6:-1),o(),H(e.Quantities),o(2),y(r.column.total.selected?9:-1)}}var Zn=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=h}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];column={code:{selected:!0,name:"Code"},cost:{selected:!1,name:"Cost"},sales:{selected:!1,name:"Sales"},total:{selected:!0,name:"Total"}};openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}submit(){this.pageData.Filter.Product?(delete this.column.cost,delete this.column.sales):(this.column.cost={selected:!1,name:"Cost"},this.column.sales={selected:!1,name:"Sales"}),super.searchFromPageOne()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[W],decls:44,vars:22,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%",3,"text-align"],[1,"text-end",2,"width","10%",3,"text-align"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"text-end"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[3,"routerLink","queryParams"],[3,"text-align"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.submit())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,G0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,H0,31,18,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),S(35,Q0,2,2,"th",11),S(36,Y0,2,2,"th",12),S(37,j0,2,2,"th",12),G(38,q0,2,3,"th",13,N0),S(40,U0,2,0,"th",14),a()(),n(41,"tbody"),G(42,$0,10,9,"tr",15,A0),a()()()()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(16,V0)),o(3),c("routerLink",M(17,B0)),o(3),c("routerLink",M(18,O0)),o(3),c("routerLink",M(19,L0)),o(3),c("routerLink",M(20,R0)),o(3),c("routerLink",M(21,k0)),o(12),y(t.column.code.selected?35:-1),o(),y(t.column.cost&&t.column.cost.selected?36:-1),o(),y(t.column.sales&&t.column.sales.selected?37:-1),o(),H(t.data==null?null:t.data.Outlet),o(2),y(t.column.total.selected?40:-1),o(2),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,$,J,L,R,ie,Te,Ae,Ce,U,ze,Vi,Z],encapsulation:2})};var xo=Jt(bi());var ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],tc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],ic=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],nc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ac=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],oc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Xr=()=>({standalone:!0}),Jr=()=>({overflow:"visible"}),rc=i=>[i],lc=i=>({ID:i});function pc(i,s){if(i&1){let e=I();n(0,"a",17),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",18),p(2," Export"),a()}}function mc(i,s){if(i&1){let e=I();n(0,"div",19)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",20),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListOutletID,t)||(l.pageData.Filter.ListOutletID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",21),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",22)(8,"div",23)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",24),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a()(),n(12,"div",25)(13,"h6"),p(14,"Compare Month To"),a(),n(15,"p-datepicker",24),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",26),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListOutletID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(5),C("ngModel",e.pageData.Filter.MonthFrom),c("ngModelOptions",M(18,Xr))("contentStyle",M(19,Jr))("appendTo","body")("baseZIndex",99999),o(4),C("ngModel",e.pageData.Filter.MonthTo),c("ngModelOptions",M(20,Xr))("contentStyle",M(21,Jr))("appendTo","body")("baseZIndex",99999),o(3),C("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter)}}function sc(i,s){i&1&&(n(0,"th",11),p(1," Name "),a())}function cc(i,s){i&1&&(n(0,"th",12),p(1," Code "),a())}function dc(i,s){i&1&&(n(0,"th",13)(1,"span",27),p(2," On Hand "),a()())}function uc(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=m();o(),D(" ",r.months[e.Month-1].ColumnLabel," ")}}function _c(i,s){i&1&&(n(0,"th",13)(1,"span",28),p(2," Total "),a()())}function gc(i,s){if(i&1&&(n(0,"td")(1,"a",31),p(2),a()()),i&2){let e=m().$implicit,r=m();o(),c("routerLink",X(3,rc,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(5,lc,e.ID)),o(),D(" ",e.Name," ")}}function Cc(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function fc(i,s){if(i&1&&(n(0,"td",29)(1,"span",27),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",e.OnHand?v(3,1,e.OnHand,r.pageData.FractionDigit):"0"," ")}}function xc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m();o(),D(" ",t.findKey(r.Sold,e.Month)?v(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):"0"," ")}}function hc(i,s){if(i&1&&(n(0,"td",29)(1,"span",28),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",v(4,4,v(3,1,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function Sc(i,s){if(i&1&&(n(0,"tr"),S(1,gc,3,7,"td"),S(2,Cc,2,1,"td"),S(3,fc,4,4,"td",29),E(4,xc,3,4,"td",30),S(5,hc,5,7,"td",29),a()),i&2){let e=m();o(),y(e.column.name.selected?1:-1),o(),y(e.column.code.selected?2:-1),o(),y(e.column.OnHand.selected?3:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?5:-1)}}function yc(i,s){i&1&&b(0,"td")}function Dc(i,s){i&1&&(n(0,"td",29),p(1,"Total :"),a())}function vc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),D(" ",v(2,1,e.getOnHandTotal(),e.pageData.FractionDigit)," ")}}function wc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function Tc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}function Pc(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",32),S(2,yc,1,0,"td"),S(3,Dc,2,0,"td",29),S(4,vc,3,4,"td",29),E(5,wc,3,4,"td",30),S(6,Tc,4,7,"td",29),a()()),i&2){let e=m();o(2),y(e.column.name.selected?2:-1),o(),y(e.column.code.selected?3:-1),o(),y(e.column.OnHand.selected?4:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?6:-1)}}var $n=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date().getFullYear(),Ze=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(T,Ze)}_toastrService=Pe(qe);columnService=Pe(gt);years=V.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];column={name:{selected:!0,name:"Name"},code:{selected:!0,name:"Code"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/GetProductSalesMonthlyOnHand",responseProperty:"OnHand"},total:{selected:!0,name:"Total"}};MonthFrom;MonthTo;preGetList(){if(this.pageData&&this.pageData.Filter&&this.pageData.Filter.MonthFrom&&this.pageData.Filter.MonthTo){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs;return}super.preGetList()}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),h);default:return 0}})}preInitList(){super.preInitList?.(),this.pageData.Filter.MonthFrom=new Date(this.pageData.Filter.MonthFrom),this.pageData.Filter.MonthTo=new Date(this.pageData.Filter.MonthTo)}onSubmit(){delete this.pageData.Filter.ListDynamicID;let e=(0,xo.default)(this.pageData.Filter.MonthFrom),r=(0,xo.default)(this.pageData.Filter.MonthTo);if(r.diff(e,"months")>5)this._toastrService.warning("Selected month range exceeds the maximum of 6 months.","Warning");else{let l=e.format("YYYY-MM")+"-01",h=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(h),delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs,this.searchFromPageOne()}}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.pageData.Filter.ListDynamicID=this.infiniteList.map(e=>e.ID),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter,"OnHand",e=>this.mappingDataOnAdvancedColumn(e))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList.map(r=>{let t=e.find(l=>l.ID==r.ID);return t&&(r.OnHand=t.OnHand),r}))}getOnHandTotal(){return!this.infiniteList||this.infiniteList.length===0?0:this.infiniteList.reduce((r,t)=>{let l=Number(t.OnHand)||0;return r+l},0)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[W],decls:41,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table","table-fixed","table-bordered",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left","border-end",2,"width","250px"],["mat-sort-header","Code",1,"align-left","border-end",2,"width","150px"],[1,"text-end","border-end",2,"width","90px"],["class","text-end border-end","style","width: 90px",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"row",2,"margin-top","15px"],[1,"col-6","pe-2"],["view","month","dateFormat","M yy",3,"ngModelChange","ngModel","ngModelOptions","contentStyle","appendTo","baseZIndex"],[1,"col-6"],["name","Scope",3,"modelChange","model","options"],["matTooltip","Current OnHand Inventory","matTooltipPosition","left",1,"cursor-pointer"],["matTooltip","Total Quantity Sold Based on Filtered Month","matTooltipPosition","left",1,"cursor-pointer"],[1,"text-end"],["class","text-end",4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.onSubmit())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,pc,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,mc,19,22,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(T){return u(l),_(t.sortData(T))}),n(31,"thead",9)(32,"tr",10),S(33,sc,2,0,"th",11),S(34,cc,2,0,"th",12),S(35,dc,3,0,"th",13),E(36,uc,2,1,"th",14),S(37,_c,3,0,"th",13),a()(),n(38,"tbody"),E(39,Sc,6,5,"tr",15),a(),E(40,Pc,7,5,"tfoot",16),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(19,ec)),o(3),c("routerLink",M(20,tc)),o(3),c("routerLink",M(21,ic)),o(3),c("routerLink",M(22,nc)),o(3),c("routerLink",M(23,ac)),o(3),c("routerLink",M(24,oc)),o(10),y(t.column.name.selected?33:-1),o(),y(t.column.code.selected?34:-1),o(),y(t.column.OnHand.selected?35:-1),o(),c("ngForOf",t.data==null?null:t.data.MonthlySales),o(),y(t.column.total.selected?37:-1),o(2),c("ngForOf",t.data==null?null:t.data.Data),o(),c("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[A,st,it,Q,L,R,ie,pe,ge,Te,Ce,U,Tr,se,re],encapsulation:2})};var Fc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Ic=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],bc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Mc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Vc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Bc=i=>[i],Oc=i=>({ID:i});function Lc(i,s){if(i&1){let e=I();n(0,"button",13),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",14),p(2," Export"),a()}}function Rc(i,s){if(i&1){let e=I();n(0,"div",15)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",17),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",18),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",19)(12,"datepicker",20),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",21),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function kc(i,s){if(i&1&&(n(0,"th",22),p(1),a()),i&2){let e=s.$implicit;o(),F(e)}}function Wc(i,s){if(i&1&&(n(0,"tr"),b(1,"th")(2,"th"),G(3,kc,2,1,"th",22,Y),a()),i&2){let e=m();o(3),H(e.data==null?null:e.data.Outlet)}}function Nc(i,s){if(i&1&&(n(0,"th",12),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e)}}function Ac(i,s){if(i&1&&(n(0,"a",23),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m();c("routerLink",X(3,Bc,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(5,Oc,r[1])),o(),F(r[e])}}function Gc(i,s){if(i&1&&p(0),i&2){let e=m().$implicit,r=m().$implicit;D(" ",r[e]," ")}}function Hc(i,s){if(i&1&&(n(0,"td",11),S(1,Ac,2,7,"a",23)(2,Gc,1,1),a()),i&2){let e=s.$index;o(),y(e===0?1:2)}}function Qc(i,s){if(i&1&&(n(0,"tr",11),G(1,Hc,3,1,"td",11,Y),a()),i&2){let e=s.$implicit,r=m();o(),H(r.getFilteredKeys(e))}}var ea=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[W],decls:43,vars:18,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border",2,"width","15%"],[1,"border"],[1,"border",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2",1,"text-center","border"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Lc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Rc,16,10,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9),S(32,Wc,5,0,"tr"),n(33,"tr")(34,"th",10),p(35,"Name"),a(),n(36,"th",11),p(37,"Code"),a(),G(38,Nc,2,1,"th",12,Y),a()(),n(40,"tbody"),G(41,Qc,3,0,"tr",11,Y),a()()()()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Fc)),o(3),c("routerLink",M(13,Ic)),o(3),c("routerLink",M(14,bc)),o(3),c("routerLink",M(15,Ec)),o(3),c("routerLink",M(16,Mc)),o(3),c("routerLink",M(17,Vc)),o(9),y((t.data==null?null:t.data.Outlet.length)>0?32:-1),o(6),H(t.data==null?null:t.data.Header),o(3),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,J,L,R,Te,Ce,U],encapsulation:2})};var Yc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],jc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],qc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],Uc=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Zr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],zc=(i,s,e)=>({CategoryID:i,From:s,To:e}),Kc=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],$r=i=>({CategoryID:i});function Xc(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Jc(i,s){if(i&1&&(n(0,"span",23),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function Zc(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),E(10,Jc,2,3,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Hide Zero & Negative"),a(),n(28,"radio-options",21),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a(),n(29,"h6"),p(30,"Product Type"),a(),n(31,"radio-options",22),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),C("ngModel",e.pageData.Filter.BrandID),o(5),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),C("model",e.pageData.Filter.ExcludeZero),o(3),C("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes)}}function $c(i,s){i&1&&(n(0,"th",43),p(1," Cost "),b(2,"p-treeTableSortIcon",44),a())}function ed(i,s){i&1&&(n(0,"th",45),p(1," Profit "),b(2,"p-treeTableSortIcon",46),a())}function td(i,s){i&1&&(n(0,"th",47),p(1," % "),b(2,"p-treeTableSortIcon",48),a())}function id(i,s){if(i&1&&(n(0,"tr",29)(1,"th",30),p(2," Category "),b(3,"p-treeTableSortIcon",31),a(),n(4,"th",32),p(5," Qty "),b(6,"p-treeTableSortIcon",33),a(),E(7,$c,3,0,"th",34),n(8,"th",35),p(9," Gross "),b(10,"p-treeTableSortIcon",36),a(),n(11,"th",37),p(12," Disc "),b(13,"p-treeTableSortIcon",38),a(),n(14,"th",39),p(15," Sales "),b(16,"p-treeTableSortIcon",40),a(),E(17,ed,3,0,"th",41)(18,td,3,0,"th",42),a()),i&2){let e=m(2);o(7),c("ngIf",e.roleService.product.Cost),o(10),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function nd(i,s){if(i&1&&(n(0,"td",57)(1,"span",23),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.CostInDirect&&e.Cost?"Direct ("+g(2,3,e.Cost)+") Indirect ("+g(3,5,e.CostInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedCost))}}function ad(i,s){if(i&1&&(n(0,"td",58)(1,"span",23),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.ProfitInDirect&&e.Profit?"Direct ("+g(2,3,e.Profit)+") Indirect ("+g(3,5,e.ProfitInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedProfit))}}function od(i,s){if(i&1&&(n(0,"span",23),d(1,"number"),d(2,"number"),p(3),d(4,"number"),a()),i&2){let e=m(2).rowData;c("matTooltip",Ct(e.PercentageInDirect&&e.Percentage?"Direct ("+v(1,3,e.Percentage,"1.0-2")+") Indirect ("+v(2,6,e.PercentageInDirect,"1.0-2")+")":"")),o(3),D("",g(4,9,e.DisplayedPercentage),"%")}}function rd(i,s){if(i&1&&(n(0,"td"),E(1,od,5,11,"span",59),a()),i&2){let e=m(3);o(),c("ngIf",e.roleService.report.Profit)}}function ld(i,s){if(i&1&&(n(0,"tr",49)(1,"td"),b(2,"p-treeTableToggler",50),n(3,"a",51),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",23),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),E(13,nd,6,9,"td",52),n(14,"td",53)(15,"span",23),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",54)(21,"a",55),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",53)(27,"span",23),d(28,"number"),d(29,"number"),n(30,"a",51),p(31),d(32,"amountFraction"),a()()(),E(33,ad,6,9,"td",56)(34,rd,2,1,"td",7),a()),i&2){let e=s.$implicit,r=s.rowData,t=m(2);c("ttRow",e),o(2),c("rowNode",e),o(),c("routerLink",M(54,Zr))("queryParams",_t(55,zc,r.ID,v(4,24,t.pageData.Filter.From,"yyyy-MM-dd"),v(5,27,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(r.Name),o(2),c("matTooltip",Ct(r.QuantityIndirect&&r.Quantity?"Direct ("+g(9,30,r.Quantity)+") Indirect ("+g(10,32,r.QuantityIndirect)+")":"")),o(3),F(g(12,34,r.DisplayedQuantity)),o(2),c("ngIf",t.roleService.product.Cost),o(2),c("matTooltip",Ct(r.GrossIndirect&&r.GrossSales?"Direct ("+g(16,36,r.GrossSales)+") Indirect ("+g(17,38,r.GrossIndirect)+")":"")),o(3),F(g(19,40,r.DisplayedGross)),o(3),c("matTooltip",Ct(r.DiscountIndirect&&r.Discount?"Direct ("+g(22,42,r.Discount)+") Indirect ("+g(23,44,r.DiscountIndirect)+")":""))("routerLink",M(59,Kc))("queryParams",X(60,$r,r.ID)),o(3),F(g(25,46,r.DisplayedTotalDiscount)),o(3),c("matTooltip",Ct(r.NetSalesIndirect&&r.Sales?"Direct ("+g(28,48,r.Sales)+") Indirect ("+g(29,50,r.NetSalesIndirect)+")":"")),o(3),c("routerLink",M(62,Zr))("queryParams",X(63,$r,r.ID)),o(),F(g(32,52,r.DisplayedNetSales)),o(2),c("ngIf",t.roleService.report.Profit),o(),c("ngIf",t.roleService.report.Profit)}}function pd(i,s){if(i&1&&(n(0,"td",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function md(i,s){if(i&1&&(n(0,"td",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalProfit)," ")}}function sd(i,s){if(i&1&&(n(0,"td",61),p(1),d(2,"number"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function cd(i,s){if(i&1&&(n(0,"tr",60)(1,"td",61),p(2,"Total :"),a(),n(3,"td",61),p(4),d(5,"quantityFraction"),a(),E(6,pd,3,3,"td",62),n(7,"td",63)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",61),p(12),d(13,"amountFraction"),a(),n(14,"td",63),p(15),d(16,"amountFraction"),a(),E(17,md,3,3,"td",62)(18,sd,3,3,"td",64),a()),i&2){let e=m(2);o(4),D(" ",g(5,7,e.data.Aggregate.TotalQuantity)," "),o(2),c("ngIf",e.roleService.product.Cost),o(3),F(g(10,9,e.data.Aggregate.TotalGross)),o(3),D(" ",g(13,11,e.data.Aggregate.TotalDiscount)," "),o(3),D(" ",g(16,13,e.data.Aggregate.TotalNetSales)," "),o(2),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function dd(i,s){if(i&1&&(n(0,"content")(1,"div",24)(2,"p-treeTable",25),E(3,id,19,3,"ng-template",26)(4,ld,35,65,"ng-template",27)(5,cd,19,15,"ng-template",28),a()()()),i&2){let e=m();o(2),c("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",M(4,Uc))}}var ta=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["name","render-ProductType",3,"modelChange","model","options"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],[1,"text-danger",2,"width","120px"],[1,"text-success",2,"width","120px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","120px"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,Xc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," List View "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),E(17,Zc,32,17,"ng-template",null,0,O),a(),E(19,dd,6,5,"content",7),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(10,Yc)),o(3),c("routerLink",M(11,jc)),o(3),c("routerLink",M(12,qc)),o(5),c("ngIf",t.data))},dependencies:[A,it,Q,$,J,L,R,ie,Te,Ae,Fr,fn,Mr,Ir,br,Er,Ce,U,ze,Mn,re,oe,Z,ne],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var ud=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],_d=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],gd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function Cd(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function fd(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.CustomerID)}}function xd(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function hd(i,s){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Value)}}function Sd(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Value))}}function yd(i,s){if(i&1&&(n(0,"td"),S(1,hd,2,1,"span"),S(2,Sd,3,3,"span"),a()),i&2){let e=s.$implicit;o(),y(e.Key=="Category"?1:-1),o(),y(e.Key!="Category"?2:-1)}}function Dd(i,s){if(i&1&&(n(0,"tr"),G(1,yd,3,2,"td",null,Y),a()),i&2){let e=s.$implicit;o(),H(e)}}function vd(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e))}}function wd(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",20)(2,"td"),p(3,"Total : "),a(),G(4,vd,3,3,"td",null,Y),a()()),i&2){let e=m(2);o(4),H(e.data.Sum)}}function Td(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr"),G(4,xd,2,2,"th",19,Y),a()(),n(6,"tbody"),G(7,Dd,3,0,"tr",null,Y),a(),S(9,wd,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var ia=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}openExportModal(){this.matDialog.open(K,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T]){let Ze=t.find(Ai=>Ai.Key===[this.data.Dataheader[T]].toString()).Value,Ni=l.find(Ai=>Ai.Key===[this.data.Dataheader[T]].toString()).Value;return this.compare(Ze,Ni,h)}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Cd,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Tree View "),a()(),n(10,"li")(11,"a",6),p(12," List View "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,fd,16,9,"ng-template",null,0,O),a(),n(19,"content"),S(20,Td,10,1,"div",7),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(10,ud)),o(3),c("routerLink",M(11,_d)),o(3),c("routerLink",M(12,gd)),o(6),y(t.data?20:-1))},dependencies:[A,Q,J,L,R,pe,ge,Ae,Ce,U,Z],encapsulation:2})};var Pd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Fd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Id=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function bd(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),C("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies)}}function Ed(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",11),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var na=class i extends me{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=V.Months;Years=V.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(w(N),w(k))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),E(16,bd,10,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,Ed,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(8,Pd)),o(3),c("routerLink",M(9,Fd)),o(3),c("routerLink",M(10,Id)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,R,ii],encapsulation:2})};var Md=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Vd(i,s){if(i&1){let e=I();n(0,"div",4)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",5),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",6),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",7)(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("items",e.pageData.Options.SalesOrderTagIDs),C("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("multiple",!0)}}function Bd(i,s){if(i&1&&(n(0,"content")(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div",14)(6,"div",15)(7,"p",16),p(8,"Transaction Per Hour"),a()(),n(9,"div",17),b(10,"POS-line-chart",18),a()()()(),n(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15)(15,"p",16),p(16,"Transaction Per Session"),a()(),n(17,"div",17),b(18,"POS-pie-chart",18),a()()()()()()()),i&2){let e=m();o(10),c("config",e.chartConfig)("data",e.ChartData),o(8),c("config",e.pieConfig)("data",e.PieData)}}var aa=class i extends De{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let h={name:l.Name+": "+l.Description,y:l.Transaction};t.push(h)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(l,h){return l+"<br/>"+h.series.name+": <b>"+h.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[W],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),E(6,Vd,13,9,"ng-template",null,0,O),a(),S(8,Bd,19,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("routerLink",M(6,Md)),o(6),y(t.data?8:-1))},dependencies:[A,Q,$,J,L,R,ii,Mt,U],encapsulation:2})};function Od(i,s){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Ld(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function Rd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"number"),a(),n(10,"td",17),p(11),d(12,"amountFraction"),a(),n(13,"td",17),p(14),d(15,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(g(3,5,e.Visitor)),o(3),F(g(6,7,e.Orders)),o(3),F(g(9,9,e.TotalVisitor)),o(3),F(g(12,11,e.Sales)),o(3),F(g(15,13,e.Sales/(e.Visitor*e.Orders)))}}function kd(i,s){if(i&1&&(n(0,"div",3)(1,"table",11)(2,"thead",12)(3,"tr")(4,"th",13),p(5,"Number of Person"),a(),n(6,"th",14),p(7,"Orders"),a(),n(8,"th",14),p(9,"Total Visitor"),a(),n(10,"th",14),p(11,"Sales"),a(),n(12,"th",15),p(13,"Average Spending"),a()()(),n(14,"tbody"),G(15,Rd,16,15,"tr",null,Y),a(),n(17,"tfoot")(18,"tr",16)(19,"td",17),p(20,"Total"),a(),n(21,"td",17),p(22),d(23,"sum"),d(24,"number"),a(),n(25,"td",17),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",17),p(30),d(31,"sum"),d(32,"amountFraction"),a(),n(33,"td",17),p(34),d(35,"amountFraction"),a()()()()()),i&2){let e=m();o(15),H(e.data),o(7),F(g(24,7,v(23,4,e.data,"Orders"))),o(4),F(g(28,12,v(27,9,e.data,"TotalVisitor"))),o(4),F(g(32,17,v(31,14,e.data,"Sales"))),o(4),F(g(35,19,e.getSpendingPerPersonSum(e.data)))}}var oa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(K,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Od,3,0,"a",2),a(),n(3,"filters"),E(4,Ld,10,6,"ng-template",null,0,O),a(),n(6,"content"),S(7,kd,36,21,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,J,L,R,U,se,re,Z],encapsulation:2})};var Wd=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function Nd(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function Ad(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",19),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",20)(9,"datepicker",21),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function Gd(i,s){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Hd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Revenue))}}function Qd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",13),p(4),d(5,"number"),a(),n(6,"td",13),p(7),d(8,"quantityFraction"),a(),n(9,"td",13),p(10),d(11,"amountFraction"),a(),n(12,"td",14),p(13),d(14,"RoundUp"),d(15,"amountFraction"),a(),n(16,"td",13),p(17),d(18,"RoundUp"),d(19,"amountFraction"),a(),S(20,Hd,3,3,"td",13),a()),i&2){let e=s.$implicit,r=m();o(2),F(e.TimeFormat),o(2),F(g(5,7,e.Count)),o(3),F(g(8,9,e.Quantity)),o(3),F(g(11,11,e.Sales)),o(3),F(g(15,15,g(14,13,e.Tax))),o(4),F(g(19,19,g(18,17,e.SalesWithTax))),o(3),y(r.roleService.product.Cost||r.roleService.report.Profit?20:-1)}}function Yd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m();o(),F(g(3,4,v(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var ra=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(K,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[W],decls:56,vars:43,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Nd,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Ad,10,6,"ng-template",null,0,O),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),S(26,Gd,2,0,"th",10),a()(),n(27,"tbody"),G(28,Qd,21,21,"tr",null,Y),a(),n(30,"tfoot")(31,"tr",11),b(32,"td",12),n(33,"td",13),p(34),d(35,"sum"),d(36,"number"),a(),n(37,"td",13),p(38),d(39,"sum"),d(40,"quantityFraction"),a(),n(41,"td",13),p(42),d(43,"sum"),d(44,"amountFraction"),a(),n(45,"td",14),p(46),d(47,"sum"),d(48,"RoundUp"),d(49,"amountFraction"),a(),n(50,"td",13),p(51),d(52,"sum"),d(53,"RoundUp"),d(54,"amountFraction"),a(),S(55,Yd,4,6,"td",13),a()()()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(42,Wd)),o(23),y(t.roleService.product.Cost||t.roleService.report.Profit?26:-1),o(2),H(t.data==null?null:t.data.Data),o(6),F(g(36,16,v(35,13,t.data==null?null:t.data.Data,"Count"))),o(4),F(g(40,21,v(39,18,t.data==null?null:t.data.Data,"Quantity"))),o(4),F(g(44,26,v(43,23,t.data==null?null:t.data.Data,"Sales"))),o(4),F(g(49,33,g(48,31,v(47,28,t.data==null?null:t.data.Data,"Tax")))),o(5),F(g(54,40,g(53,38,v(52,35,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),y(t.roleService.product.Cost||t.roleService.report.Profit?55:-1))},dependencies:[A,Q,J,L,R,U,se,Cr,re,Z,ne],encapsulation:2})};var jd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],So=(i,s)=>({From:i,To:s}),qd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Ud=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function zd(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",10),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function Kd(i,s){if(i&1&&(n(0,"content")(1,"div",11),b(2,"POS-line-chart",12),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var la=class i extends me{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(s,e,r){super(s,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let s=this.route.snapshot.queryParams;s.From&&(this.pageData.Filter.From=s.From,this.pageData.Filter.To=s.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let s=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return V.getDatesInRange(s,e).map(l=>`${l.getDate()} ${V.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(s){this.pageData.Filter.From=s.from,this.pageData.Filter.To=s.to}static \u0275fac=function(e){return new(e||i)(w(N),w(k),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[W],decls:19,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,r){if(e&1){let t=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(t),_(r.searchFromPageOne())}),x("filterChange",function(h){return u(t),f(r.pageData.Filter,h)||(r.pageData.Filter=h),_(h)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),E(16,zd,13,11,"ng-template",null,0,O),a(),S(18,Kd,3,2,"content"),a()}e&2&&(c("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",r.pageData.Filter),o(7),c("routerLink",M(11,jd))("queryParams",fe(12,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(15,qd))("queryParams",fe(16,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(19,Ud))("queryParams",fe(20,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),y(r.data?18:-1))},dependencies:[A,Q,$,L,R,Mt,Gt,Ce,U],encapsulation:2})};var $d={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},pi=class i{date;dateChange=new ln;width;minDate=V.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(s,e){let r=null;s&&(r=s.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(s){let e=null;s&&(e=s.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(s,e){let r=new Date(s.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[Ci([{provide:yn,useClass:Nn,deps:[Sn,wr]},{provide:Dn,useValue:$d}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(h){return u(t),_(r.onDateChange(h.value))}),a(),b(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(h){u(t);let T=Dt(4);return _(r.chosenYearHandler(h,T))})("monthSelected",function(h){u(t);let T=Dt(4);return _(r.setMonthAndYear(h,T))})("opened",function(){return u(t),_(r.onOpenDatepicker())})("closed",function(){return u(t),_(r.onCloseDatepicker())}),a()()}if(e&2){let t=Dt(4);qt("width",r.width||100,"%"),o(),c("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),c("for",t)}},dependencies:[At,In,yi,Tn,Pn,Fn,Di,En,wn,vn,bn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
2
|
-
`],encapsulation:2})};var
|
|
1
|
+
import{a as ii,b as Nr}from"./chunk-JEZMYDZR.js";import{a as Wr}from"./chunk-BHQZXJKQ.js";import{a as Mt,b as Ar}from"./chunk-C22G4JGX.js";import{a as Gt,b as Gr}from"./chunk-LMUFX64W.js";import{a as ti}from"./chunk-4467AQLM.js";import{a as De}from"./chunk-DX56EYRS.js";import{a as An}from"./chunk-DSXOFWO7.js";import{a as Hr}from"./chunk-5ZPO7V26.js";import{a as ze}from"./chunk-VEQJR5VL.js";import{a as Gn,b as Bi}from"./chunk-GDRHD33K.js";import{a as gt}from"./chunk-AXCTEREY.js";import{a as pr}from"./chunk-SWVQK6HM.js";import{b as dr}from"./chunk-P7KMHPVN.js";import"./chunk-U4MC22BG.js";import{a as Vi}from"./chunk-QS2AUXB7.js";import"./chunk-PSFQWURP.js";import{a as kr}from"./chunk-3XH2STFE.js";import{a as Br,b as Or,d as Lr,g as Rr}from"./chunk-P3TFDLWR.js";import"./chunk-BYXBJQAS.js";import{a as Mi}from"./chunk-V4V55JMO.js";import{a as Tr,b as Pr}from"./chunk-IDJEXQ5I.js";import"./chunk-DODZXMH2.js";import"./chunk-EZNBK62W.js";import{e as cr}from"./chunk-3MAZIRSX.js";import{a as Fr,b as Ir,c as br,d as Er,e as Mr,f as Vr}from"./chunk-HHCNN3XR.js";import"./chunk-3Q5WV3VF.js";import"./chunk-HIA4J5DB.js";import"./chunk-GFSJZHCB.js";import"./chunk-VGHEGWAM.js";import{a as ne}from"./chunk-Y7ZKGM5U.js";import{a as Z}from"./chunk-75FYOZH7.js";import"./chunk-CVN6ZXXJ.js";import{a as bi,b as wr,c as Nn,d as J,e as Ei}from"./chunk-AHTR7XKG.js";import{a as En,b as Di}from"./chunk-NS6IC2PT.js";import"./chunk-3RK6DDJD.js";import{a as bn}from"./chunk-SMEVWRVE.js";import{a as Sn,b as yn,c as Dn,f as Tn,g as Pn,h as Fn,p as yi,q as In}from"./chunk-JQDS4BXR.js";import"./chunk-F3HDP5CA.js";import"./chunk-AJAUI7BA.js";import"./chunk-MWGICBEB.js";import{c as sr,d as Te,e as Wn}from"./chunk-ODYEJFNJ.js";import"./chunk-WSWTWRKJ.js";import{a as vi}from"./chunk-BVOUQJCA.js";import{a as pe,b as ge,c as lr}from"./chunk-ACXQ2FOW.js";import{a as Et,b as vr}from"./chunk-XWYCNPUZ.js";import{d as Sr,f as Ce}from"./chunk-ZNPC63ZV.js";import{a as yr,b as Dr,c as U}from"./chunk-6UY42XOC.js";import{b as K}from"./chunk-YQ5PAXUW.js";import{a as me}from"./chunk-HQGZC4Y3.js";import{a as rr}from"./chunk-VQKO557Q.js";import"./chunk-TRK4LJDS.js";import"./chunk-B4TZQBTN.js";import{a as q}from"./chunk-JT4M6AIA.js";import{e as A,f as Ii}from"./chunk-2GIDUMXS.js";import"./chunk-ZO3XZXWW.js";import"./chunk-OB6KFXD6.js";import"./chunk-QJ3CWKQT.js";import"./chunk-ZOYWCF3Q.js";import{c as ur}from"./chunk-SWF6XISV.js";import"./chunk-GXAF3JUO.js";import"./chunk-LB5UXGDG.js";import"./chunk-YDL2MTWE.js";import"./chunk-7YYWBCWJ.js";import"./chunk-CCIHCGP5.js";import{a as _r,c as Ue}from"./chunk-FM7BHGBW.js";import"./chunk-TP6ZUC53.js";import{d as hr}from"./chunk-3PKJLXTC.js";import{b as N}from"./chunk-ECW7GAZQ.js";import"./chunk-E634BI4W.js";import"./chunk-BAXZ74LK.js";import{C as Rn,F as Ae,G as kn,j as vn,m as wn,t as mr,u as Vn,v as Pi,w as Bn}from"./chunk-3ZH3XK5V.js";import{b as ie,c as hn}from"./chunk-V6D6TV7B.js";import{A as Ln,B as fr,C as ei,K as Fi,N as xr,g as se,o as gr,s as On,z as Cr}from"./chunk-QWLNF7VL.js";import"./chunk-UIVJ2JQT.js";import"./chunk-EQLHPWVB.js";import{a as Mn,d as $}from"./chunk-SCGKVOSE.js";import{b as Cn,e as wi,f as Ti,g as z}from"./chunk-N5RDRDT7.js";import"./chunk-N7OS7SFI.js";import{a as nr}from"./chunk-4HLKKTIV.js";import{c as ir,j as ar,k as Ki,l as or}from"./chunk-RIZ4YVMH.js";import{a as zi}from"./chunk-2FWFPV5I.js";import{oa as fn,pa as xn,xa as tr}from"./chunk-Z76C52NM.js";import{F as At,G as gn,a as Xo,b as Jo,c as Qe,h as L,l as Zo,o as R,q as $o,s as er}from"./chunk-7MRUPBXU.js";import"./chunk-T5IJP474.js";import"./chunk-DJUOMCAV.js";import"./chunk-5RYL4EJ2.js";import{b as j}from"./chunk-KBLVOO4J.js";import{a as V}from"./chunk-WUV22SZ4.js";import"./chunk-NQQB5U5S.js";import{p as qe,s as k}from"./chunk-TANYEHMZ.js";import{$b as _i,$c as Qo,Ab as S,Ac as X,Bc as fe,Ca as dt,Cb as y,Cc as _t,Db as Yi,Dc as Ut,E as ri,Eb as Y,Ec as cn,Fb as G,Fc as Ao,Gb as H,Hb as c,Hc as d,I as Qi,Ia as go,Ib as n,Ic as g,Ja as Ro,Jb as a,Jc as v,K as Vo,Kb as b,Kc as fi,Ld as Ko,M as Bo,Ma as ko,Nc as O,Ob as pt,Pb as mt,Pc as Go,Pd as Ne,Q as nn,Qa as Ee,Qb as Wo,Qc as xi,Rb as I,Rc as dn,Rd as _n,Sa as rn,Sd as Q,Ub as P,Uc as Ho,Ud as Ui,Vc as hi,Wb as m,Xa as o,Y as jt,Ya as ln,Zb as Co,Zc as un,_b as sn,aa as _o,ac as gi,bd as fo,cd as Yo,dd as jo,eb as w,ec as Tt,fa as Nt,fc as qt,gc as ji,hc as No,ib as B,ic as qi,id as tt,jb as ui,jc as p,ka as Oo,kb as pn,kc as F,kd as st,la as an,lc as D,ld as it,ma as di,mb as W,mc as $t,na as Zt,nb as mn,o as ci,ob as E,oc as f,pa as Pe,pc as x,pd as qo,qc as h,qd as Uo,sd as oe,t as oi,ta as u,u as uo,ua as _,uc as Ct,ud as re,wb as li,xa as on,xd as Si,yc as Ci,za as Lo,zc as M,zd as zo}from"./chunk-L3U6V3BF.js";import"./chunk-WFMAM73Y.js";import{a as et,b as nt,f as Gl,h as Jt,k as Hi}from"./chunk-SNAKHGZS.js";var Po=Gl((Xi,To)=>{(function(i,s){typeof Xi=="object"&&typeof To=="object"?To.exports=s(i._Highcharts,i._Highcharts.Templating):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts/highcharts"],function(e){return s(e,e.Templating)}):typeof Xi=="object"?Xi["highcharts/modules/series-label"]=s(i._Highcharts,i._Highcharts.Templating):i.Highcharts=s(i.Highcharts,i.Highcharts.Templating)})(typeof window>"u"?Xi:window,(i,s)=>(()=>{"use strict";var e={944:ye=>{ye.exports=i},984:ye=>{ye.exports=s}},r={};function t(ye){var ae=r[ye];if(ae!==void 0)return ae.exports;var Ve=r[ye]={exports:{}};return e[ye](Ve,Ve.exports,t),Ve.exports}t.n=ye=>{var ae=ye&&ye.__esModule?()=>ye.default:()=>ye;return t.d(ae,{a:ae}),ae},t.d=(ye,ae)=>{for(var Ve in ae)t.o(ae,Ve)&&!t.o(ye,Ve)&&Object.defineProperty(ye,Ve,{enumerable:!0,get:ae[Ve]})},t.o=(ye,ae)=>Object.prototype.hasOwnProperty.call(ye,ae);var l={};t.d(l,{default:()=>Al});var C=t(944),T=t.n(C),Ze=t(984),Ni=t.n(Ze);let Ai={enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]};function Zi(ye,ae,Ve,he,at,Ge){let ee=(Ge-ae)*(Ve-ye)-(he-ae)*(at-ye);return ee>0||!(ee<0)}function $i(ye,ae,Ve,he,at,Ge,ee,Le){return Zi(ye,ae,at,Ge,ee,Le)!==Zi(Ve,he,at,Ge,ee,Le)&&Zi(ye,ae,Ve,he,at,Ge)!==Zi(ye,ae,Ve,he,ee,Le)}let{animObject:co}=T(),{format:Vl}=Ni(),{setOptions:Bl}=T(),{composed:Ol}=T(),{boxIntersectLine:Fo,intersectRect:Ll}={boxIntersectLine:function(ye,ae,Ve,he,at,Ge,ee,Le){return $i(ye,ae,ye+Ve,ae,at,Ge,ee,Le)||$i(ye+Ve,ae,ye+Ve,ae+he,at,Ge,ee,Le)||$i(ye,ae+he,ye+Ve,ae+he,at,Ge,ee,Le)||$i(ye,ae,ye,ae+he,at,Ge,ee,Le)},intersectRect:function(ye,ae){return!(ae.left>ye.right||ae.right<ye.left||ae.top>ye.bottom||ae.bottom<ye.top)}},{addEvent:Io,extend:bo,fireEvent:Rl,isNumber:en,pick:zt,pushUnique:kl,syncTimeout:Wl}=T();function mi(ye,ae,Ve,he,at){let Ge=ye.chart,ee=ye.options.label||{},Le=zt(ee.onArea,!!ye.area),Ke=Le||ee.connectorAllowed,ct=Ge.boxesToAvoid,Bt=Number.MAX_VALUE,Ft=Number.MAX_VALUE,St,ft,xt,Kt,It,$e,Be;for($e=0;ct&&$e<ct.length;$e+=1)if(Ll(ct[$e],{left:ae,right:ae+he.width,top:Ve,bottom:Ve+he.height}))return!1;for($e=0;$e<Ge.series.length;$e+=1){let ut=Ge.series[$e],Re=ut.interpolatedPoints&&[...ut.interpolatedPoints];if(ut.visible&&Re){let Je=Ge.plotHeight/10;for(let ot=Ge.plotTop;ot<=Ge.plotTop+Ge.plotHeight;ot+=Je)Re.unshift({chartX:Ge.plotLeft,chartY:ot}),Re.push({chartX:Ge.plotLeft+Ge.plotWidth,chartY:ot});for(Be=1;Be<Re.length;Be+=1){if(Re[Be].chartX>=ae-16&&Re[Be-1].chartX<=ae+he.width+16){if(Fo(ae,Ve,he.width,he.height,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))return!1;ye===ut&&!xt&&at&&(xt=Fo(ae-16,Ve-16,he.width+32,he.height+32,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))}(Ke||xt)&&(ye!==ut||Le)&&(Bt=Math.min(Bt,(Kt=ae+he.width/2-Re[Be].chartX)*Kt+(It=Ve+he.height/2-Re[Be].chartY)*It))}if(!Le&&Ke&&ye===ut&&(at&&!xt||Bt<Math.pow(ee.connectorNeighbourDistance||1,2))){for(Be=1;Be<Re.length;Be+=1)(St=Math.min(Math.pow(ae+he.width/2-Re[Be].chartX,2)+Math.pow(Ve+he.height/2-Re[Be].chartY,2),Math.pow(ae-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(ae+he.width-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(ae+he.width-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2),Math.pow(ae-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2)))<Ft&&(Ft=St,ft=Re[Be]);xt=!0}}}return(!at||!!xt)&&{x:ae,y:Ve,weight:Bt-(ft?Ft:0),connectorPoint:ft}}function Eo(ye){if(this.renderer){let ae=this,Ve=co(ae.renderer.globalAnimation).duration;ae.labelSeries=[],ae.labelSeriesMaxSum=0,ae.seriesLabelTimer&&T().clearTimeout(ae.seriesLabelTimer),ae.series.forEach(function(he){let at=he.options.label||{},Ge=he.labelBySeries,ee=Ge&&Ge.closest,Le=he.getColumn("y");at.enabled&&he.visible&&(he.graph||he.area)&&!he.boosted&&ae.labelSeries&&(ae.labelSeries.push(he),at.minFontSize&&at.maxFontSize&&Le.length&&(he.sum=Le.reduce((Ke,ct)=>(Ke||0)+(ct||0),0),ae.labelSeriesMaxSum=Math.max(ae.labelSeriesMaxSum||0,he.sum||0)),ye.type==="load"&&(Ve=Math.max(Ve,co(he.options.animation).duration)),ee&&(ee[0].plotX!==void 0?Ge.animate({x:ee[0].plotX+ee[1],y:ee[0].plotY+ee[2]}):Ge.attr({opacity:0})))}),ae.seriesLabelTimer=Wl(function(){ae.series&&ae.labelSeries&&(function(he){he.boxesToAvoid=[];let at=he.labelSeries||[],Ge=he.boxesToAvoid;he.series.forEach(ee=>(ee.points||[]).forEach(Le=>(Le.dataLabels||[]).forEach(Ke=>{let{width:ct,height:Bt}=Ke.getBBox(),Ft=(Ke.translateX||0)+(ee.xAxis?ee.xAxis.pos:ee.chart.plotLeft),St=(Ke.translateY||0)+(ee.yAxis?ee.yAxis.pos:ee.chart.plotTop);Ge.push({left:Ft,top:St,right:Ft+ct,bottom:St+Bt})}))),at.forEach(function(ee){let Le=ee.options.label||{};ee.interpolatedPoints=(function(Ke){let ct,Bt,Ft,St,ft;if(!Ke.xAxis&&!Ke.yAxis)return;let xt=Ke.points,Kt=[],It=Ke.graph||Ke.area,$e=It&&It.element,Be=Ke.chart.inverted,ut=Ke.xAxis,Re=Ke.yAxis,Je=Be?Re.pos:ut.pos,ot=Be?ut.pos:Re.pos,vt=Be?ut.len:Re.len,Gi=Be?Re.len:ut.len,ht=zt((Ke.options.label||{}).onArea,!!Ke.area),je=Re.getThreshold(Ke.options.threshold),wt={},Xt=Be?"chartCenterX":"chartCenterY";function ai(lt){let yt=Math.round((lt.plotX||0)/8)+","+Math.round((lt.plotY||0)/8);wt[yt]||(wt[yt]=1,Kt.push(lt))}if(Ke.getPointSpline&&$e&&$e.getPointAtLength&&!ht&&xt.length<(Ke.chart.plotSizeX||0)/16){let lt=It.toD&&It.attr("d");for(It.toD&&It.attr({d:It.toD}),Ft=$e.getTotalLength(),ct=0;ct<Ft;ct+=16){let Lt=$e.getPointAtLength(ct),Rt=Be?Gi-Lt.y:Lt.x,kt=Be?vt-Lt.x:Lt.y;ai({chartX:Je+Rt,chartY:ot+kt,plotX:Rt,plotY:kt})}lt&&It.attr({d:lt});let yt=xt[xt.length-1].pos();ai({chartX:Je+(yt?.[0]||0),chartY:ot+(yt?.[1]||0)})}else{let lt;for(ct=0,Ft=xt.length;ct<Ft;ct+=1){let yt=xt[ct],[Lt,Rt]=yt.pos()||[],{plotHigh:kt}=yt;if(en(Lt)&&en(Rt)){let bt={plotX:Lt,plotY:Rt,chartX:Je+Lt,chartY:ot+Rt};if(ht&&(kt&&(bt.plotY=kt,bt.chartY=ot+kt),Be?bt.chartCenterX=Je+Gi-((kt||yt.plotY||0)+zt(yt.yBottom,je))/2:bt.chartCenterY=ot+((kt||Rt)+zt(yt.yBottom,je))/2),lt&&(Bt=Math.max(Math.abs(bt.chartX-lt.chartX),Math.abs(bt.chartY-lt.chartY)))>16&&Bt<999)for(ft=1,St=Math.ceil(Bt/16);ft<St;ft+=1)ai({chartX:lt.chartX+(bt.chartX-lt.chartX)*(ft/St),chartY:lt.chartY+(bt.chartY-lt.chartY)*(ft/St),[Xt]:(lt[Xt]||0)+((bt[Xt]||0)-(lt[Xt]||0))*(ft/St),plotX:(lt.plotX||0)+(Lt-(lt.plotX||0))*(ft/St),plotY:(lt.plotY||0)+(Rt-(lt.plotY||0))*(ft/St)});ai(bt),lt=bt}}}return Kt})(ee),Ge.push(...Le.boxesToAvoid||[])}),he.series.forEach(function(ee){let Le=ee.options.label;if(!Le||!ee.xAxis&&!ee.yAxis)return;let Ke="highcharts-color-"+zt(ee.colorIndex,"none"),ct=!ee.labelBySeries,Bt=Le.minFontSize,Ft=Le.maxFontSize,St=he.inverted,ft=St?ee.yAxis.pos:ee.xAxis.pos,xt=St?ee.xAxis.pos:ee.yAxis.pos,Kt=he.inverted?ee.yAxis.len:ee.xAxis.len,It=he.inverted?ee.xAxis.len:ee.yAxis.len,$e=ee.interpolatedPoints,Be=zt(Le.onArea,!!ee.area),ut=[],Re=ee.getColumn("x"),Je,ot,vt,Gi,ht,je,wt=ee.labelBySeries,Xt,ai,lt;function yt(Qt,Wt,Yt){let tn=Math.max(ft,zt(ai,-1/0)),si=Math.min(ft+Kt,zt(lt,1/0));return Qt>tn&&Qt<=si-Yt.width&&Wt>=xt&&Wt<=xt+It-Yt.height}function Lt(){wt&&(ee.labelBySeries=wt.destroy())}if(Be&&!St&&(Xt=[ee.xAxis.toPixels(Re[0]),ee.xAxis.toPixels(Re[Re.length-1])],ai=Math.min.apply(Math,Xt),lt=Math.max.apply(Math,Xt)),ee.visible&&!ee.boosted&&$e){if(!wt){var Rt,kt,bt;let Qt=ee.name;if(typeof Le.format=="string"?Qt=Vl(Le.format,ee,he):Le.formatter&&(Qt=Le.formatter.call(ee)),ee.labelBySeries=wt=he.renderer.label(Qt,0,0,"connector",0,0,Le.useHTML).addClass("highcharts-series-label highcharts-series-label-"+ee.index+" "+(ee.options.className||"")+" "+Ke),!he.renderer.styledMode){let Wt=typeof ee.color=="string"?ee.color:"#666666";wt.css(bo({color:Be?he.renderer.getContrast(Wt):Wt},Le.style||{})),wt.attr({opacity:+!!he.renderer.forExport,stroke:ee.color,"stroke-width":1})}Bt&&Ft&&wt.css({fontSize:(Rt=ee,kt=Bt,bt=Ft,kt+(Rt.sum||0)/(Rt.chart.labelSeriesMaxSum||0)*(bt-kt)+"px")}),wt.attr({padding:0,zIndex:3}).add()}for((Je=wt.getBBox()).width=Math.round(Je.width),ht=$e.length-1;ht>0;ht-=1)Be?yt(ot=($e[ht].chartCenterX??$e[ht].chartX)-Je.width/2,vt=($e[ht].chartCenterY??$e[ht].chartY)-Je.height/2,Je)&&(je=mi(ee,ot,vt,Je)):(yt(ot=$e[ht].chartX+3,vt=$e[ht].chartY-Je.height-3,Je)&&(je=mi(ee,ot,vt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX+3,vt=$e[ht].chartY+3,Je)&&(je=mi(ee,ot,vt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX-Je.width-3,vt=$e[ht].chartY+3,Je)&&(je=mi(ee,ot,vt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX-Je.width-3,vt=$e[ht].chartY-Je.height-3,Je)&&(je=mi(ee,ot,vt,Je,!0))),je&&ut.push(je);if(Le.connectorAllowed&&!ut.length&&!Be)for(ot=ft+Kt-Je.width;ot>=ft;ot-=16)for(vt=xt;vt<xt+It-Je.height;vt+=16)(Gi=mi(ee,ot,vt,Je,!0))&&ut.push(Gi);if(ut.length){ut.sort((Wt,Yt)=>Yt.weight-Wt.weight),je=ut[0],(he.boxesToAvoid||[]).push({left:je.x,right:je.x+Je.width,top:je.y,bottom:je.y+Je.height});let Qt=Math.sqrt(Math.pow(Math.abs(je.x-(wt.x||0)),2)+Math.pow(Math.abs(je.y-(wt.y||0)),2));if(Qt&&ee.labelBySeries){let Wt,Yt={opacity:+!!he.renderer.forExport,x:je.x,y:je.y},tn={opacity:1};Qt<=10&&(tn={x:Yt.x,y:Yt.y},Yt={}),ct&&(Wt=co(ee.options.animation),Wt.duration*=.2),ee.labelBySeries.attr(bo(Yt,{anchorX:je.connectorPoint&&(je.connectorPoint.plotX||0)+ft,anchorY:je.connectorPoint&&(je.connectorPoint.plotY||0)+xt})).animate(tn,Wt),ee.options.kdNow=!0,ee.buildKDTree();let si=ee.searchPoint({chartX:je.x,chartY:je.y},!0);si&&(wt.closest=[si,je.x-(si.plotX||0),je.y-(si.plotY||0)])}}else Lt()}else Lt()}),Rl(he,"afterDrawSeriesLabels")})(ae)},ae.renderer.forExport||!Ve?0:Ve)}}function Nl(ye,ae,Ve,he,at){let Ge=at&&at.anchorX,ee=at&&at.anchorY,Le,Ke,ct=Ve/2;return en(Ge)&&en(ee)&&(Le=[["M",Ge,ee]],(Ke=ae-ee)<0&&(Ke=-he-Ke),Ke<Ve&&(ct=Ge<ye+Ve/2?Ke:Ve-Ke),ee>ae+he?Le.push(["L",ye+ct,ae+he]):ee<ae?Le.push(["L",ye+ct,ae]):Ge<ye?Le.push(["L",ye,ae+he/2]):Ge>ye+Ve&&Le.push(["L",ye+Ve,ae+he/2])),Le||[]}let Mo=T();({compose:function(ye,ae){kl(Ol,"SeriesLabel")&&(Io(ye,"load",Eo),Io(ye,"redraw",Eo),ae.prototype.symbols.connector=Nl,Bl({plotOptions:{series:{label:Ai}}}))}}).compose(Mo.Chart,Mo.SVGRenderer);let Al=T();return l.default})())});var Hl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Qr=i=>({ID:i});function Ql(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Yl(i,s){if(i&1&&(n(0,"div",2),S(1,Ql,3,0,"button",3),a()),i&2){let e=m();o(),y(e.roleService.global.Export?1:-1)}}function jl(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",14),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",20),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),b(41,"i",21),a(),n(42,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(3),f("model",e.pageData.Filter.Bin),o(3),c("items",e.pageData.Options.Types),f("ngModel",e.pageData.Filter.TypeID),o(3),c("items",e.pageData.Options.Currencies),f("ngModel",e.pageData.Filter.CurrencyID),o(3),c("items",e.pageData.Options.Deliveries),f("ngModel",e.pageData.Filter.DeliveryStateID),o(3),f("ngModel",e.pageData.Filter.PaymentStateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),c("renderThumbnail",!1),o(3),f("model",e.pageData.Filter.NoteVisible),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),f("ngModel",e.pageData.Filter.QueryOption),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function ql(i,s){i&1&&(n(0,"th",32),p(1," @ Cost "),a())}function Ul(i,s){if(i&1&&(n(0,"small",46),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.CustomerNameDisplay," - {0}"))}}function zl(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.SalesName," - Sales: {0}"))}}function Kl(i,s){if(i&1&&(n(0,"span",46),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" "," - Profit: "+g(2,1,e.Profit)," ")}}function Xl(i,s){if(i&1&&(n(0,"i",49),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function Jl(i,s){if(i&1&&(n(0,"span",50),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function Zl(i,s){i&1&&(n(0,"span"),p(1,"-"),a())}function $l(i,s){if(i&1&&(b(0,"div",51),d(1,"newlines")),i&2){let e=m().$implicit;c("innerHTML",g(1,1,e.SONote),Ee)}}function ep(i,s){if(i&1&&(n(0,"div")(1,"a",57),p(2),a()()),i&2){let e=m().$implicit;o(),c("queryParams",X(2,Qr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function tp(i,s){if(i&1&&(n(0,"i",60),p(1),a()),i&2){let e=m().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function ip(i,s){if(i&1&&(n(0,"th",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitCost)," ")}}function np(i,s){if(i&1&&(n(0,"tr",55)(1,"th",28)(2,"div",58)(3,"span",59),p(4),a(),S(5,tp,2,1,"i",60),b(6,"small",61),a()(),n(7,"th",62),p(8),a(),n(9,"th",63),p(10),d(11,"quantityFraction"),a(),n(12,"th",64),p(13),a(),S(14,ip,3,3,"th",65),n(15,"th",66),p(16),d(17,"amountFraction"),a(),n(18,"th",67)(19,"div",68),p(20),a(),n(21,"div",69),p(22),d(23,"amountFraction"),a()(),n(24,"th",66),p(25),d(26,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),y((e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName?5:-1),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(11,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?14:-1),o(2),D(" ",g(17,13,e==null?null:e.UnitPrice)," "),o(4),D(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),D(" ",(e==null?null:e.DiscountAmount)==0?"":g(23,15,e==null?null:e.DiscountAmount)," "),o(3),D(" ",g(26,17,e==null?null:e.Total)," ")}}function ap(i,s){if(i&1&&(n(0,"tr")(1,"th",70),p(2),a(),n(3,"th",71),p(4),a(),n(5,"th",72),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e.CurrencySymbol," "),o(2),D(" ",g(7,3,e.Amount)," ")}}function op(i,s){if(i&1&&(n(0,"div")(1,"div",41)(2,"div",42)(3,"div")(4,"a",43)(5,"span",44),p(6),a()(),n(7,"span"),p(8),d(9,"date"),b(10,"small",45),d(11,"date"),S(12,Ul,3,4,"small",46),a()(),n(13,"div",47)(14,"strong",48),p(15),S(16,zl,3,4,"span"),a(),S(17,Kl,3,3,"span",46),S(18,Xl,2,1,"i",49),S(19,Jl,2,1,"span",50),S(20,Zl,2,0,"span"),a(),S(21,$l,2,3,"div",51),S(22,ep,3,4,"div"),a(),n(23,"div",52),p(24),a()(),n(25,"table",53)(26,"tbody",54),G(27,np,27,19,"tr",55,Y),a()(),n(29,"table",56),G(30,ap,8,5,"tr",null,Y),a()()),i&2){let e=s.$implicit,r=m(2);o(4),c("routerLink",M(21,Hl))("queryParams",X(22,Qr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number),o(2),D(" "," - "+v(9,15,e.Date,"dd MMM yyyy")," "),o(2),c("innerHtml","("+v(11,18,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Ee),o(2),y(r.isNotEmpty(e.CustomerNameDisplay)?12:-1),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),y(r.isNotEmpty(e.SalesName)?16:-1),o(),y(r.roleService.report.Profit?17:-1),o(),y(r.isNotEmpty(e.DeliveryOutlet)?18:-1),o(),y(r.isNotEmpty(e.PromotionCoupon)?19:-1),o(),y(e.SONote&&e.PromotionCoupon?20:-1),o(),y(r.isNotEmpty(e.SONote)?21:-1),o(),y(r.isNotEmpty(e.ReferenceInvoiceID)?22:-1),o(2),D(" ",e.PaymentStateLabel," "),o(3),H(e.Items),o(3),H(e.Aggregate)}}function rp(i,s){if(i&1){let e=I();n(0,"span",73),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",74),p(2,"?"),a()()}}function lp(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function pp(i,s){if(i&1){let e=I();n(0,"div",2)(1,"a",75),P("click",function(){u(e);let t=m(2);return t.currentRowCount=100,_(t.NextPage(!0))}),b(2,"i",76),p(3," Next 100"),a()()}}function mp(i,s){if(i&1){let e=I();n(0,"content")(1,"div",24)(2,"div",25)(3,"table",26)(4,"thead",27)(5,"tr")(6,"th",28),p(7,"Name"),a(),n(8,"th",29),p(9,"Code"),a(),n(10,"th",30),p(11,"Qty"),a(),n(12,"th",31),p(13,"UOM"),a(),S(14,ql,2,0,"th",32),n(15,"th",33),p(16,"@ Price"),a(),n(17,"th",30),p(18,"Disc."),a(),n(19,"th",33),p(20,"Total"),a()()(),n(21,"tbody")(22,"tr")(23,"td",34),G(24,op,32,24,"div",null,Y),a()()()()(),n(26,"div",35)(27,"button",36),P("click",function(){u(e);let t=m();return _(t.showSummaryReport())}),p(28," View Report Summary "),a()(),n(29,"div",37)(30,"div",38)(31,"div",39),p(32),d(33,"number"),S(34,rp,3,0,"span",40),S(35,lp,3,3,"span"),p(36),a()(),S(37,pp,4,0,"div",2),a()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(9),li("colspan",e.roleService.product.Cost?8:7),o(),H(e.infiniteList),o(8),D(" Showing 1 - ",g(33,7,e.infiniteList.length)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:34),o(),y(e.pageData.HideStoreApiCount?35:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),y(e.nextPageDisabled?37:-1)}}var Hn=class i extends De{constructor(e,r,t,l,C,T,Ze,Ni){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,C);this.csvConverter=t;this.datePipe=l;this.activatedRoute=C;this.matDialog=T;this.toaster=Ze;this.roleService=Ni}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,V.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),V.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),V.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return V.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(C=>C):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(K,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(Wr,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(Ne),w(z),w(qe),w(j))};static \u0275cmp=B({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],[1,"fw-bold"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table","table-sm","table-borderless"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"lh-base"],[1,"fw-normal"],[1,"text-warning","inlineMarginLeft"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Yl,2,1,"div",2),a(),n(3,"filters"),E(4,jl,46,26,"ng-template",null,0,O),a(),S(6,mp,38,9,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,ie,Te,Ae,U,ze,gr,On,re,oe,Z,ne],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media (max-width: 992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var Qn=class i{constructor(s,e){this._dialogRef=s;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Vn;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(w(wi),w(Ti))};static \u0275cmp=B({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),h("ngModelChange",function(l){return x(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),h("ngModelChange",function(l){return x(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(c("title","Export Report")("config",r.modalConfig),o(6),f("ngModel",r.ExportPageNumber),o(4),f("ngModel",r.ExportRowCount),c("max",1e4))},dependencies:[Qe,L,R,Ue,Pi],encapsulation:2})};var cp=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],jr=i=>({ID:i}),dp=()=>["/menu/Contacts/Contact/Customers/Info"],up=(i,s,e)=>({"text-success":i,"text-warning":s,"text-danger":e});function _p(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function gp(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",11),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),pt(18),n(19,"div",12)(20,"div",13)(21,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(22,"div",15)(23,"app-timepicker",16),h("timeChange",function(t){u(e);let l=m();return x(l.pageData.Filter.FromTime,t)||(l.pageData.Filter.FromTime=t),_(t)}),P("timeChange",function(t){u(e);let l=m();return _(l.timeFromChange(t))}),a()()(),n(24,"div",17)(25,"div",13)(26,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(27,"div",15)(28,"app-timepicker",16),h("timeChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ToTime,t)||(l.pageData.Filter.ToTime=t),_(t)}),P("timeChange",function(t){u(e);let l=m();return _(l.timeToChange(t))}),a()()(),mt(),n(29,"h6"),p(30,"Register"),a(),n(31,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(32,"h6"),p(33,"Customer Groups"),a(),n(34,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(35,"h6"),p(36,"Payment"),a(),n(37,"ng-select",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(38,"h6"),p(39,"Creator"),a(),n(40,"autocompleteV2",22),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(41,"h6"),p(42,"RowCount"),a(),n(43,"input",23),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),c("inputTextValue",e.pageData.CustomerName),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.SalesOrderTagID),c("items",e.pageData.Options.SalesOrderTags),o(3),c("options",e.pageData.Options.DefaultFilterColumnOptions),f("model",e.pageData.Filter.DefaultFilterColumn),o(6),f("date",e.pageData.Filter.From),o(2),f("time",e.pageData.Filter.FromTime),c("customStyle","height: 50px"),o(3),f("date",e.pageData.Filter.To),o(2),f("time",e.pageData.Filter.ToTime),c("customStyle","height: 50px"),o(3),f("ngModel",e.pageData.Filter.RegisterID),c("items",e.pageData.Options.Registers),o(3),f("ngModel",e.pageData.Filter.CustomerGroupID),c("items",e.pageData.Options.Groups),o(3),f("ngModel",e.pageData.Filter.PaymentState),c("items",e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Cp(i,s){i&1&&(n(0,"th",52),p(1,"DATE"),a())}function fp(i,s){i&1&&(n(0,"th",53),p(1," CUSTOMER "),a())}function xp(i,s){i&1&&(n(0,"th",40),p(1,"JOIN DATE"),a())}function hp(i,s){i&1&&(n(0,"th",41),p(1,"GROUPS"),a())}function Sp(i,s){i&1&&(n(0,"th",54),p(1," SALES PERSON "),a())}function yp(i,s){i&1&&(n(0,"th",55),p(1," COST "),a())}function Dp(i,s){i&1&&(n(0,"th",56),p(1," GROSS "),a())}function vp(i,s){i&1&&(n(0,"th",57),p(1," SALES "),a())}function wp(i,s){i&1&&(n(0,"th",58),p(1," TAX "),a())}function Tp(i,s){i&1&&(n(0,"th",59),p(1," SURCHARGE "),a())}function Pp(i,s){i&1&&(n(0,"th",60),p(1," TOTAL "),a())}function Fp(i,s){i&1&&(n(0,"th",61),p(1," PAYMENT "),a())}function Ip(i,s){i&1&&b(0,"br")}function bp(i,s){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Note)}}function Ep(i,s){if(i&1&&(n(0,"td")(1,"div"),p(2),d(3,"date"),a(),n(4,"div"),p(5),d(6,"date"),a()()),i&2){let e=m().$implicit;o(2),D(" ",v(3,2,e.Date,"dd MMM yy")," "),o(3),D(" ",v(6,5,e.Created,"HH:mm")," ")}}function Mp(i,s){if(i&1&&(n(0,"td")(1,"a",67),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,dp))("queryParams",X(4,jr,e.CustomerID)),o(),F(e.CustomerName)}}function Vp(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.JoinDate!=="0001-01-01T00:00:00"?v(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function Bp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Groups," ")}}function Op(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.SalesName," ")}}function Lp(i,s){if(i&1&&(n(0,"td",68),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Rp(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function kp(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Wp(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Np(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SurchargeAmount)," ")}}function Ap(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNSurcharge)," ")}}function Gp(i,s){if(i&1&&(n(0,"td",71),p(1),a()),i&2){let e=m().$implicit;c("ngClass",_t(2,up,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function Hp(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",62),p(5),a(),E(6,Ip,1,0,"br",3)(7,bp,2,1,"i",3),a(),E(8,Ep,7,8,"td",3)(9,Mp,3,6,"td",3),S(10,Vp,3,4,"td"),S(11,Bp,2,1,"td"),E(12,Op,2,1,"td",3)(13,Lp,3,3,"td",63)(14,Rp,3,3,"td",64)(15,kp,3,3,"td",64)(16,Wp,3,3,"td",65)(17,Np,3,3,"td",64)(18,Ap,3,3,"td",64)(19,Gp,2,6,"td",66),a()),i&2){let e=s.$implicit,r=m(3);o(2),F(e.EntityName),o(2),c("routerLink",M(18,cp))("queryParams",X(19,jr,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",e.Note),o(),c("ngIf",e.Note),o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Customer.selected),o(),y(r.column.JoinDate.selected?10:-1),o(),y(r.column.Groups.selected?11:-1),o(),c("ngIf",r.column.SalesPerson.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.column.Gross.selected),o(),c("ngIf",r.column.Sales.selected),o(),c("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),c("ngIf",r.data.SurchargeVisible),o(),c("ngIf",r.column.Total.selected),o(),c("ngIf",r.column.Payment.selected)}}function Qp(i,s){i&1&&b(0,"td",74)}function Yp(i,s){i&1&&b(0,"td",74)}function jp(i,s){i&1&&b(0,"td",74)}function qp(i,s){i&1&&(n(0,"td",77),p(1," Total: "),a())}function Up(i,s){if(i&1&&(n(0,"td",68),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Cost"))," ")}}function zp(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function Kp(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function Xp(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function Jp(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function Zp(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function $p(i,s){if(i&1&&(n(0,"tfoot",72)(1,"tr",73),b(2,"td",74),E(3,Qp,1,0,"td",75)(4,Yp,1,0,"td",75)(5,jp,1,0,"td",75)(6,qp,2,0,"td",76)(7,Up,4,6,"td",63)(8,zp,4,6,"td",64)(9,Kp,4,6,"td",64)(10,Xp,4,6,"td",65)(11,Jp,4,6,"td",64)(12,Zp,4,6,"td",64),a()()),i&2){let e=m(3);o(3),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected)}}function em(i,s){if(i&1){let e=I();n(0,"div",33)(1,"table",34),P("matSortChange",function(t){u(e);let l=m(2);return _(l.sortData(t))}),n(2,"thead",35)(3,"tr")(4,"th",36),p(5,"OUTLET"),a(),n(6,"th",37),p(7,"NUMBER"),a(),E(8,Cp,2,0,"th",38)(9,fp,2,0,"th",39),S(10,xp,2,0,"th",40),S(11,hp,2,0,"th",41),E(12,Sp,2,0,"th",42)(13,yp,2,0,"th",43)(14,Dp,2,0,"th",44)(15,vp,2,0,"th",45)(16,wp,2,0,"th",46)(17,Tp,2,0,"th",47)(18,Pp,2,0,"th",48)(19,Fp,2,0,"th",49),a()(),n(20,"tbody"),E(21,Hp,20,21,"tr",50),a(),E(22,$p,13,10,"tfoot",51),a()()}if(i&2){let e=m(2);o(8),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),y(e.column.JoinDate.selected?10:-1),o(),y(e.column.Groups.selected?11:-1),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected),o(),c("ngIf",e.column.Payment.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data)}}function tm(i,s){if(i&1){let e=I();n(0,"span",78),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",79),p(2,"?"),a()()}}function im(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function nm(i,s){if(i&1){let e=I();n(0,"a",80),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",81),p(2," Next"),a()}}function am(i,s){if(i&1){let e=I();n(0,"a",82),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),b(1,"i",83),p(2," Show All"),a()}}function om(i,s){if(i&1&&(n(0,"content")(1,"div",24),E(2,em,23,14,"div",25),n(3,"div",26)(4,"div",27)(5,"div",28),p(6),d(7,"number"),E(8,tm,3,0,"span",29)(9,im,3,3,"span",3),p(10),a()(),n(11,"div",30),E(12,nm,3,0,"a",31)(13,am,3,0,"a",32),a()()()()),i&2){let e=m();o(2),c("ngIf",e.data),o(4),D(" Showing 1 - ",g(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Yn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=C}roleService=Pe(j);columnService=Pe(gt);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>V.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(Qn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,l.CustomerName=l.CustomerName==null?"":l.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,l.SalesName=l.SalesName==null?"":l.SalesName,e.active){case"outlet":return this.compare(t.EntityName?.toLowerCase(),l.EntityName?.toLowerCase(),C);case"number":return this.compare(t.Number,l.Number,C);case"date":return this.compare(t.Date,l.Date,C);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),C);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),C);case"cost":return this.compare(t.Cost,l.Cost,C);case"gross":return this.compare(t.Gross,l.Gross,C);case"sales":return this.compare(t.Sales,l.Sales,C);case"tax":return this.compare(t.Tax,l.Tax,C);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,C);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,C);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,C);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,C);case"groups":return this.compare(t.Groups,l.Groups,C);default:return 0}})}openExportModal(){this._matDialog.open(K,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");V.IsNotEmpty(r)&&(this.pageData.Filter.From=V.MinDate,this.pageData.Filter.To=V.MinDate),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["placeholder","Search Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Is Created",3,"modelChange","options","model"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time","customStyle"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more forders",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date",4,"ngIf"],["mat-sort-header","customer",4,"ngIf"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson",4,"ngIf"],["mat-sort-header","cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","gross","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","sales","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","tax","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","surcharge","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","total","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","payment","style","width: 50px",4,"ngIf"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],["class","text-end text-danger",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-start",3,"ngClass",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-start",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],["class","empty-column",4,"ngIf"],["class","text-end empty-column",4,"ngIf"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,_p,3,0,"button",2),a(),n(3,"filters"),E(4,gp,44,26,"ng-template",null,0,O),a(),E(6,om,14,9,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,Qe,L,R,ie,pe,ge,Ue,Te,Ae,Mi,U,ze,se,re,oe,Z],encapsulation:2})};var rm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],lm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],pm=()=>["/menu/Products/Setup/Brand/Brand_Form"],mm=i=>({ID:i}),sm=(i,s)=>({BrandID:i,Name:s});function cm(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export"),a()}}function dm(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function um(i,s){i&1&&(n(0,"th",18),p(1,"Code"),a())}function _m(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function gm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",22),p(3),a()(),S(4,_m,2,1,"td"),n(5,"td",23)(6,"a",24),p(7),d(8,"quantityFraction"),a()(),n(9,"td",23),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(11,pm))("queryParams",X(12,mm,e.ID)),o(),D("",e.BrandName," "),o(),y(e.Countcode>0?4:-1),o(2),c("queryParams",fe(14,sm,e.ID,e.BrandName)),o(),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.Total))}}function Cm(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",15),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",16)(3,"tr")(4,"th",17),p(5,"Brand"),a(),S(6,um,2,0,"th",18),n(7,"th",19),p(8,"Sold"),a(),n(9,"th",20),p(10,"Total"),a()()(),n(11,"tbody"),G(12,gm,12,17,"tr",null,Y),a(),n(14,"tfoot")(15,"tr",21)(16,"td"),p(17,"Total"),a(),n(18,"td"),p(19),d(20,"sum"),d(21,"quantityFraction"),a(),n(22,"td"),p(23),d(24,"sum"),d(25,"amountFraction"),a()()()()()}if(i&2){let e=m();o(6),y(e.data.Countcode>0?6:-1),o(6),H(e.data.Data),o(7),F(g(21,6,v(20,3,e.data.Data,"Quantity"))),o(4),F(g(25,11,v(24,8,e.data.Data,"Total")))}}var jn=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=C;this.matDialog=T}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[W],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[1,"footer","text-end","fw-bold"],[3,"routerLink","queryParams"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,cm,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Pie Chart "),a()(),n(10,"li")(11,"a",6),p(12," Brand Sales Analysis "),a()()()()(),n(13,"filters"),E(14,dm,9,6,"ng-template",null,0,O),a(),n(16,"content"),S(17,Cm,26,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,rm)),o(3),c("routerLink",M(9,lm)),o(6),y(t.data?17:-1))},dependencies:[A,Q,J,L,R,ie,pe,ge,U,se,Z,ne],encapsulation:2})};function fm(i,s){if(i&1){let e=I();n(0,"label",2),P("click",function(){let t=u(e).$implicit,l=m();return _(l.updateSelectedGroups(t.ID))}),b(1,"input",3),n(2,"span"),p(3),a()()}if(i&2){let e=s.$implicit,r=m();o(),c("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),F(e.Name)}}var qn=class i{constructor(s,e){this.dialogRef=s;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(s){let e=this.IDGroups.indexOf(s);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(s)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(w(wi),w(Ti))};static \u0275cmp=B({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:5,vars:1,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),G(3,fm,4,3,"label",null,Y),a()()()),e&2&&(c("title","Edit Groups"),o(3),H(r.options))},dependencies:[Pi],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var xm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],hm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Sm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],ym=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Dm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],vm=()=>["/menu/Contacts/Contact/Customers/Info"],wm=i=>({ID:i});function Tm(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Pm(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Fm(i,s){i&1&&(n(0,"th",22),p(1," ORDERS "),a())}function Im(i,s){i&1&&(n(0,"th",23),p(1," QTY "),a())}function bm(i,s){i&1&&(n(0,"th",24),p(1," COST "),a())}function Em(i,s){i&1&&(n(0,"th",25),p(1," SALES "),a())}function Mm(i,s){i&1&&(n(0,"th",26),p(1," TAX "),a())}function Vm(i,s){i&1&&(n(0,"th",27),p(1," SALES + TAX "),a())}function Bm(i,s){if(i&1){let e=I();n(0,"span")(1,"span"),p(2),a(),n(3,"a",37),P("click",function(){u(e);let t=m(2).$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=s.$implicit,r=s.$index;o(2),F(r==0?"":" , "),o(2),F(e.GroupName)}}function Om(i,s){if(i&1&&(n(0,"span"),G(1,Bm,5,2,"span",null,Y),a()),i&2){let e=m().$implicit;o(),H(e.Groups)}}function Lm(i,s){if(i&1){let e=I();n(0,"a",37),P("click",function(){u(e);let t=m().$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function Rm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Orders)," ")}}function km(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Wm(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Nm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Am(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Gm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales+e.Tax)," ")}}function Hm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",30),p(3),a(),n(4,"div",31),S(5,Om,3,0,"span"),S(6,Lm,2,0,"a",32),a()(),n(7,"td")(8,"span",33),p(9),a()(),S(10,Rm,3,3,"td",34),S(11,km,3,3,"td",34),S(12,Wm,3,3,"td",35),S(13,Nm,3,3,"td",34),S(14,Am,3,3,"td",36),S(15,Gm,3,3,"td",34),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("routerLink",M(13,vm))("queryParams",X(14,wm,e.CustomerID)),o(),D(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),y(e.Groups.length>0?5:-1),o(),y(e.Groups.length>0?-1:6),o(2),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),D("",e.Code," "),o(),y(r.column.Orders.selected?10:-1),o(),y(r.column.QTY.selected?11:-1),o(),y(r.roleService.product.Cost&&r.column.Cost.selected?12:-1),o(),y(r.column.Sales.selected?13:-1),o(),y(r.column.Tax.selected?14:-1),o(),y(r.column.SalesNTax.selected?15:-1)}}function Qm(i,s){if(i&1&&(n(0,"tbody",28),G(1,Hm,16,16,"tr",null,Y),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function Ym(i,s){if(i&1){let e=I();n(0,"div",7)(1,"div",17)(2,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",19)(4,"tr")(5,"th",20),p(6,"CUSTOMER"),a(),n(7,"th",21),p(8," CODE "),a(),S(9,Fm,2,0,"th",22),S(10,Im,2,0,"th",23),S(11,bm,2,0,"th",24),S(12,Em,2,0,"th",25),S(13,Mm,2,0,"th",26),S(14,Vm,2,0,"th",27),a()(),S(15,Qm,3,0,"tbody",28),a()(),n(16,"infinite-pagination",29),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=m();o(9),y(e.column.Orders.selected?9:-1),o(),y(e.column.QTY.selected?10:-1),o(),y(e.roleService.product.Cost&&e.column.Cost.selected?11:-1),o(),y(e.column.Sales.selected?12:-1),o(),y(e.column.Tax.selected?13:-1),o(),y(e.column.SalesNTax.selected?14:-1),o(),y(e.data.Data?15:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",!e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Un=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=C}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=Rn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(jt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Orders":return this.compare(t.Orders,l.Orders,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,C);case"Cost":return this.compare(t.Cost,l.Cost,C);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(qn,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let C={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",C).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(K,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[W],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],[1,"pointer"],[1,"text-primary"],["matTooltipPosition","above",3,"matTooltip"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"],[1,"text-primary",3,"click"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,Tm,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," By Age "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),b(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),E(24,Pm,16,10,"ng-template",null,0,O),a(),n(26,"content"),S(27,Ym,17,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,xm)),o(3),c("routerLink",M(13,hm)),o(3),c("routerLink",M(14,Sm)),o(3),c("routerLink",M(15,ym)),o(4),c("routerLink",M(16,Dm)),o(6),y(t.data?27:-1))},dependencies:[A,Q,$,J,Qe,L,R,ie,pe,ge,Ue,U,ti,re,Z,ne],encapsulation:2})};var jm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],qm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Um=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],zm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Xm(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Jm(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Zm(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),n(6,"td",23),p(7),d(8,"amountFraction"),a(),n(9,"td",24),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D(" ",e.Name," "),o(2),F(g(5,4,e.TotalOrders)),o(3),F(g(8,6,e.TotalCost)),o(3),F(g(11,8,e.TotalAmount))}}function $m(i,s){if(i&1&&(n(0,"tbody",22),G(1,Zm,12,10,"tr",null,Y),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function es(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"AGE"),a(),n(6,"th",19),p(7," ORDERS"),a(),n(8,"th",20),p(9," COST"),a(),n(10,"th",21),p(11," AMOUNT"),a()()(),S(12,$m,3,0,"tbody",22),a()()}if(i&2){let e=m();o(12),y(e.data.Data?12:-1)}}var zn=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.datePipe=T}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,C);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,C);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,C);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,C);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[W],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Xm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,Jm,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,es,13,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,jm)),o(3),c("routerLink",M(12,qm)),o(3),c("routerLink",M(13,Um)),o(3),c("routerLink",M(14,zm)),o(3),c("routerLink",M(15,Km)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,U,re,Z],encapsulation:2})};var ts=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],is=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],ns=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],as=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],os=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function rs(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function ls(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function ps(i,s){i&1&&(n(0,"th",19),p(1," ORDERS"),a())}function ms(i,s){i&1&&(n(0,"th",20),p(1," QUANTITY"),a())}function ss(i,s){i&1&&(n(0,"th",21),p(1," AMOUNT"),a())}function cs(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalOrders))}}function ds(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalQuantity)," ")}}function us(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalAmount))}}function _s(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,cs,3,3,"td",23),S(4,ds,3,3,"td",23),S(5,us,3,3,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),D(" ",e.Name," "),o(),y(r.column.Orders.selected?3:-1),o(),y(r.column.QTY.selected?4:-1),o(),y(r.column.Amount.selected?5:-1)}}function gs(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"GENDER"),a(),S(6,ps,2,0,"th",19),S(7,ms,2,0,"th",20),S(8,ss,2,0,"th",21),a()(),n(9,"tbody",22),G(10,_s,6,4,"tr",null,Y),a()()()}if(i&2){let e=m();o(6),y(e.column.Orders.selected?6:-1),o(),y(e.column.QTY.selected?7:-1),o(),y(e.column.Amount.selected?8:-1),o(2),H(e.data==null?null:e.data.Data)}}var Kn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=C}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,C);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,C);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,C);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,C);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(jt(1))}openExportModal(){this.matDialog.open(K,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[W],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,rs,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,ls,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,gs,12,3,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,ts)),o(3),c("routerLink",M(13,is)),o(3),c("routerLink",M(14,ns)),o(3),c("routerLink",M(15,as)),o(3),c("routerLink",M(16,os)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,U,re,Z,ne],encapsulation:2})};var Ur=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Cs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],fs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],xs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],hs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Ss=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],ys=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],Ds=i=>({ID:i}),vs=(i,s,e)=>({From:i,SupplierID:s,To:e});function ws(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Ts(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Ps(i,s){if(i&1&&(n(0,"tr",24)(1,"td"),p(2),a(),n(3,"td",25)(4,"a",26),p(5),a()(),n(6,"td",27),p(7),a(),n(8,"td",28),p(9),d(10,"quantityFraction"),a(),n(11,"td",27)(12,"a",26),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",M(19,ys))("queryParams",X(20,Ds,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,9,e.Quantity)," "),o(3),c("routerLink",M(22,Ur))("queryParams",_t(23,vs,v(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,v(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),D(" ",g(16,17,e.Total))}}function Fs(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",29),b(2,"th",30),n(3,"th",27),p(4,"Total Quantity"),a(),n(5,"th",27),p(6,"Total Sales"),a()(),n(7,"tr"),b(8,"td",31),n(9,"td",27),p(10),a(),n(11,"td",27),p(12),a()()()),i&2){let e=m(2);o(10),F(e.data.TotalQty),o(2),F(e.data.TotalSales)}}function Is(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"RANK"),a(),n(6,"th",20),p(7,"SUPPLIER"),a(),n(8,"th",21),p(9," CODE "),a(),n(10,"th",22),p(11," QUANTITY "),a(),n(12,"th",23),p(13," TOTAL "),a()()(),n(14,"tbody"),G(15,Ps,17,27,"tr",24,Y),a(),S(17,Fs,13,2,"tfoot"),a()()}if(i&2){let e=m();o(15),H(e.data.Data),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?17:-1)}}var Xn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,C);case"Supplier":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[W],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ws,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Compare with Transfer Order "),a()(),n(19,"li")(20,"a",6),p(21," Product Tags Analysis "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Ts,16,10,"ng-template",null,0,O),a(),n(28,"content"),S(29,Is,18,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Ur)),o(3),c("routerLink",M(13,Cs)),o(3),c("routerLink",M(14,fs)),o(3),c("routerLink",M(15,xs)),o(3),c("routerLink",M(16,hs)),o(3),c("routerLink",M(17,Ss)),o(6),y(t.data?29:-1))},dependencies:[A,Q,$,J,Qe,L,R,pe,ge,Ue,U,oe,Z,ne],encapsulation:2})};var zr=Jt(bi());var Es=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Ms=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Vs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Bs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Os=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Ls=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Rs=(i,s,e,r,t)=>({From:i,To:s,ListIDs:e,ListVariantID:r,GroupByVariant:t}),ks=i=>[i],Ws=i=>({ID:i}),Ns=(i,s,e,r,t,l)=>({ID:i,From:s,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Kr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],As=(i,s,e)=>({VariantID:i,From:s,To:e}),Gs=(i,s,e)=>({ProductID:i,From:s,To:e});function Hs(i,s){if(i&1&&(n(0,"a",9),b(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=m();c("queryParams",cn(1,Rs,(e=r.queryParams())==null?null:e.From,(e=r.queryParams())==null?null:e.To,(e=r.queryParams())==null?null:e.ListIDs,(e=r.queryParams())==null?null:e.ListVariantID,(e=r.queryParams())==null?null:e.GroupByVariant))}}function Qs(i,s){if(i&1){let e=I();n(0,"button",11),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",12),p(2," Export "),a()}}function Ys(i,s){if(i&1){let e=I();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(15,"h6"),p(16,"Product Tag"),a(),n(17,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(18,"h6"),p(19,"Sales Person"),a(),n(20,"sales-person-selector",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(27,"h6"),p(28,"Logistics Service"),a(),n(29,"ng-select",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(33,"h6"),p(34,"Customer Group"),a(),n(35,"ng-select",26),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",28),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",29),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),f("date",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(2),f("date",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(3),c("multiple",!0)("multiple",!0),f("ngModel",e.pageData.Filter.BrandIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),f("ngModel",e.pageData.Filter.TagID),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),f("ngModel",e.pageData.Filter.LogisticsServiceID),c("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),f("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.pageData.supplierName),o(3),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(3),f("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function js(i,s){if(i&1){let e=I();n(0,"th",48)(1,"div",49)(2,"input",50),P("change",function(t){u(e);let l=m(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=m(2);o(2),c("checked",e.isAllCheckBoxChecked())}}function qs(i,s){if(i&1&&(n(0,"th",51),p(1," Qty "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Quantity.start)}}function Us(i,s){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function zs(i,s){i&1&&(n(0,"th",53),p(1," Cost "),a())}function Ks(i,s){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function Xs(i,s){if(i&1&&(n(0,"th",55),p(1," Sales "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function Js(i,s){i&1&&(n(0,"th",56),p(1," Tax "),a())}function Zs(i,s){if(i&1&&(n(0,"th",57),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function $s(i,s){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function e0(i,s){i&1&&(n(0,"th",59),p(1," % "),a())}function t0(i,s){if(i&1){let e=I();n(0,"td")(1,"div",49)(2,"input",71),h("ngModelChange",function(t){u(e);let l=m().$implicit;return x(l.checked,t)||(l.checked=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=m().$implicit;o(2),c("value",e.ID),f("ngModel",e.checked)}}function i0(i,s){if(i&1){let e=I();pt(0),n(1,"img",72),P("click",function(t){u(e);let l=m().$implicit,C=m(2);return _(C.openBigPicture(l==null?null:l.ImageURL,t))}),a(),mt()}if(i&2){let e=m().$implicit;o(),c("src",e.ThumbnailUrl,rn)}}function n0(i,s){if(i&1){let e=I();n(0,"a",73)(1,"img",74),P("click",function(t){u(e);let l=m().$implicit,C=m(2);return _(C.openBigPicture(l,t))}),a()()}if(i&2){let e=m(3);c("target",e.pageData.LinkTarget)}}function a0(i,s){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=m().$implicit,t=m(2);o(),c("queryParams",Ao(4,Ns,r.ID,(e=t.queryParams())==null?null:e.From,(e=t.queryParams())==null?null:e.To,(e=t.queryParams())==null?null:e.ListIDs,(e=t.queryParams())==null?null:e.ListVariantID,(e=t.queryParams())==null?null:e.GroupByVariant)),o(),F(g(3,2,r.Quantity))}}function o0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.OnHand)," ")}}function r0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.UnitCost)," ")}}function l0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function p0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Kr))("queryParams",_t(12,As,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function m0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Kr))("queryParams",_t(12,Gs,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function s0(i,s){if(i&1&&(n(0,"td",75),E(1,p0,5,16,"a",78)(2,m0,5,16,"a",78),a()),i&2){let e=m(3);o(),c("ngIf",e.pageData.Filter.GroupByVariant),o(),c("ngIf",!e.pageData.Filter.GroupByVariant)}}function c0(i,s){if(i&1&&(n(0,"td",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function d0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNTax)," ")}}function u0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit)," ")}}function _0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Margin)," ")}}function g0(i,s){if(i&1&&(n(0,"tr",60),E(1,t0,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),E(7,i0,2,1,"ng-container",8)(8,n0,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),E(14,a0,4,11,"td",67)(15,o0,3,3,"td",67)(16,r0,3,3,"td",68)(17,l0,3,3,"td",67)(18,s0,3,2,"td",67)(19,c0,3,3,"td",69)(20,d0,3,3,"td",67)(21,u0,3,4,"td",70)(22,_0,3,4,"td",70),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(),c("ngIf",t.column.CompareQtySold.selected),o(2),F(r+1),o(4),c("ngIf",e.ImageURL),o(),c("ngIf",!e.ImageURL),o(2),c("routerLink",X(17,ks,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(19,Ws,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.OnHand.selected),o(),c("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function C0(i,s){i&1&&b(0,"td",75)}function f0(i,s){i&1&&(n(0,"td",75),p(1," Total : "),a())}function x0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Quantity"))," ")}}function h0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"OnHand"))," ")}}function S0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"UnitCost"))," ")}}function y0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function D0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Sales")))}}function v0(i,s){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Tax")))}}function w0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"SalesNTax")))}}function T0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.infiniteList,"Profit"))," ")}}function P0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")/v(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),D(" ",g(6,14,v(4,8,e.infiniteList,"Profit")/v(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function F0(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",81),b(2,"td",75),E(3,C0,1,0,"td",67)(4,f0,2,0,"td",67)(5,x0,4,6,"td",67)(6,h0,4,6,"td",67)(7,S0,4,6,"td",68)(8,y0,4,6,"td",67)(9,D0,5,6,"td",82)(10,v0,5,6,"td",69)(11,w0,5,6,"td",82)(12,T0,5,10,"td",70)(13,P0,7,16,"td",70),a()()),i&2){let e=m(2);o(3),c("ngIf",e.column.CompareQtySold.selected),o(),c("ngIf",e.column.CompareQtySold.selected||e.column.QTY.selected||e.column.OnHand.selected||e.column.Cost.selected||e.column.Gross.selected||e.column.Sales.selected||e.column.SalesNTax.selected||e.column.Tax.selected||e.column.Profit.selected&&e.column.Profit.role||e.column.Margin.selected&&e.column.Profit.role),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function I0(i,s){if(i&1){let e=I();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",33)(5,"tr"),E(6,js,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),E(11,qs,2,1,"th",37)(12,Us,2,0,"th",38)(13,zs,2,0,"th",39)(14,Ks,2,0,"th",40)(15,Xs,2,1,"th",41)(16,Js,2,0,"th",42)(17,Zs,2,1,"th",43)(18,$s,2,0,"th",44)(19,e0,2,0,"th",45),a()(),n(20,"tbody"),E(21,g0,23,21,"tr",46),a(),E(22,F0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.CompareQtySold.selected),o(5),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Jn=class i extends De{constructor(e,r,t,l,C,T,Ze){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,C);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=C;this.matDialog=T;this.bigPicture=Ze}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Pe(j);columnService=Pe(gt);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=dt([]);queryParams=dt(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=nt(et({},this.data),{Data:e.Data.map(t=>nt(et({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=nt(et({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=nt(et({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>nt(et({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;V.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,zi.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=nt(et({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);case"Brand":return V.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),C);case"Quantity":return V.compare(t.Quantity,l.Quantity,C);case"Total_Cost":return V.compare(t.UnitCost,l.UnitCost,C);case"Inventory":return V.compare(t.OnHand,l.OnHand,C);case"Total_Sales":return V.compare(t.Total,l.Total,C);case"Total_Tax":return V.compare(t.Tax,l.Tax,C);case"Total_Tax_Sales":return V.compare(t.SalesNTax,l.SalesNTax,C);case"ReOrder":return V.compare(t.MinStock,l.MinStock,C);case"Gross":return V.compare(t.Gross,l.Gross,C);case"Margin":return V.compare(t.Margin,l.Margin,C);case"Profit":return V.compare(t.Profit,l.Profit,C);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,zr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(qe),w(Ne),w(z),w(An))};static \u0275cmp=B({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[W],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Hs,3,7,"a",2),S(3,Qs,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",7),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",7),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",7),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",7),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",7),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),E(27,Ys,45,36,"ng-template",null,0,O),a(),E(29,I0,24,18,"content",8),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.isAnyItemChecked),o(),y(t.roleService.global.Export?3:-1),o(6),c("routerLink",M(14,Es)),o(3),c("routerLink",M(15,Ms)),o(3),c("routerLink",M(16,Vs)),o(3),c("routerLink",M(17,Bs)),o(3),c("routerLink",M(18,Os)),o(3),c("routerLink",M(19,Ls)),o(5),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,Jo,L,R,ie,pe,ge,Te,Ae,Ce,U,ze,ti,se,oe,Z,ne],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var E0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],M0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],V0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],B0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],O0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],L0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],R0=i=>({ID:i}),k0=(i,s)=>s.Name,W0=(i,s)=>s.ID;function N0(i,s){if(i&1){let e=I();n(0,"a",16),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",17),p(2," Export "),a()}}function A0(i,s){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet Group"),a(),n(3,"POS-outlet-group-tree-select",19),h("selectedOutletGroupIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Category"),a(),n(12,"POS-product-category-select",22),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(13,"h6"),p(14,"Brand"),a(),n(15,"ng-select",23),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(16,"h6"),p(17,"Supplier"),a(),n(18,"autocompleteV2",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(19,"h6"),p(20,"Product Tags"),a(),n(21,"ng-select",25),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductTagID,t)||(l.pageData.Filter.ProductTagID=t),_(t)}),a(),n(22,"h6"),p(23,"From - To"),a(),n(24,"div")(25,"datepicker",26),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(26,"div",27)(27,"datepicker",28),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(28,"h6"),p(29,"Scope"),a(),n(30,"radio-options",29),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("showClear",!0),f("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.ProductTags),f("ngModel",e.pageData.Filter.ProductTagID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function G0(i,s){i&1&&(n(0,"th",30),p(1,"Code"),a()),i&2&&qt("text-align","right")}function H0(i,s){i&1&&(n(0,"th",31),p(1,"Cost"),a()),i&2&&qt("text-align","right")}function Q0(i,s){i&1&&(n(0,"th",31),p(1,"Sales"),a()),i&2&&qt("text-align","right")}function Y0(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit;c("matTooltip",Ct(e.Name)),o(),D(" ",e.Code??e.Name," ")}}function j0(i,s){i&1&&(n(0,"th",14),p(1,"Total"),a())}function q0(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),F(e.Code)}}function U0(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),D(" ",g(2,3,e.UnitCost)," ")}}function z0(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),D(" ",g(2,3,e.UnitPrice)," ")}}function K0(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e," ")}}function X0(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Total)}}function J0(i,s){if(i&1&&(n(0,"tr",15)(1,"td")(2,"a",32),p(3),a()(),S(4,q0,2,3,"td",33),S(5,U0,3,5,"td",33),S(6,z0,3,5,"td",33),G(7,K0,2,1,"td",14,Yi),S(9,X0,2,1,"td",14),a()),i&2){let e=s.$implicit,r=m();o(2),c("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",X(7,R0,e.ID)),o(),D(" ",e.Name),o(),y(r.column.code.selected?4:-1),o(),y(r.column.cost&&r.column.cost.selected?5:-1),o(),y(r.column.sales&&r.column.sales.selected?6:-1),o(),H(e.Quantities),o(2),y(r.column.total.selected?9:-1)}}var Zn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=C}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];column={code:{selected:!0,name:"Code"},cost:{selected:!1,name:"Cost"},sales:{selected:!1,name:"Sales"},total:{selected:!0,name:"Total"}};openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}submit(){this.pageData.Filter.Product?(delete this.column.cost,delete this.column.sales):(this.column.cost={selected:!1,name:"Cost"},this.column.sales={selected:!1,name:"Sales"}),super.searchFromPageOne()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[W],decls:44,vars:22,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%",3,"text-align"],[1,"text-end",2,"width","10%",3,"text-align"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"text-end"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[3,"routerLink","queryParams"],[3,"text-align"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.submit())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,N0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,A0,31,18,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),S(35,G0,2,2,"th",11),S(36,H0,2,2,"th",12),S(37,Q0,2,2,"th",12),G(38,Y0,2,3,"th",13,k0),S(40,j0,2,0,"th",14),a()(),n(41,"tbody"),G(42,J0,10,9,"tr",15,W0),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(16,E0)),o(3),c("routerLink",M(17,M0)),o(3),c("routerLink",M(18,V0)),o(3),c("routerLink",M(19,B0)),o(3),c("routerLink",M(20,O0)),o(3),c("routerLink",M(21,L0)),o(12),y(t.column.code.selected?35:-1),o(),y(t.column.cost&&t.column.cost.selected?36:-1),o(),y(t.column.sales&&t.column.sales.selected?37:-1),o(),H(t.data==null?null:t.data.Outlet),o(2),y(t.column.total.selected?40:-1),o(2),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,$,J,L,R,ie,Te,Ae,Ce,U,ze,Vi,Z],encapsulation:2})};var xo=Jt(bi());var Z0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],$0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],tc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ic=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],nc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Xr=()=>({standalone:!0}),Jr=()=>({overflow:"visible"}),ac=i=>[i],oc=i=>({ID:i});function rc(i,s){if(i&1){let e=I();n(0,"a",17),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",18),p(2," Export"),a()}}function lc(i,s){if(i&1){let e=I();n(0,"div",19)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListOutletID,t)||(l.pageData.Filter.ListOutletID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",21),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",22)(8,"div",23)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a()(),n(12,"div",25)(13,"h6"),p(14,"Compare Month To"),a(),n(15,"p-datepicker",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",26),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListOutletID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(5),f("ngModel",e.pageData.Filter.MonthFrom),c("ngModelOptions",M(18,Xr))("contentStyle",M(19,Jr))("appendTo","body")("baseZIndex",99999),o(4),f("ngModel",e.pageData.Filter.MonthTo),c("ngModelOptions",M(20,Xr))("contentStyle",M(21,Jr))("appendTo","body")("baseZIndex",99999),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter)}}function pc(i,s){i&1&&(n(0,"th",11),p(1," Name "),a())}function mc(i,s){i&1&&(n(0,"th",12),p(1," Code "),a())}function sc(i,s){i&1&&(n(0,"th",13)(1,"span",27),p(2," On Hand "),a()())}function cc(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=m();o(),D(" ",r.months[e.Month-1].ColumnLabel," ")}}function dc(i,s){i&1&&(n(0,"th",13)(1,"span",28),p(2," Total "),a()())}function uc(i,s){if(i&1&&(n(0,"td")(1,"a",31),p(2),a()()),i&2){let e=m().$implicit,r=m();o(),c("routerLink",X(3,ac,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(5,oc,e.ID)),o(),D(" ",e.Name," ")}}function _c(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function gc(i,s){if(i&1&&(n(0,"td",29)(1,"span",27),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",e.OnHand?v(3,1,e.OnHand,r.pageData.FractionDigit):"0"," ")}}function Cc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m();o(),D(" ",t.findKey(r.Sold,e.Month)?v(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):"0"," ")}}function fc(i,s){if(i&1&&(n(0,"td",29)(1,"span",28),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",v(4,4,v(3,1,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function xc(i,s){if(i&1&&(n(0,"tr"),S(1,uc,3,7,"td"),S(2,_c,2,1,"td"),S(3,gc,4,4,"td",29),E(4,Cc,3,4,"td",30),S(5,fc,5,7,"td",29),a()),i&2){let e=m();o(),y(e.column.name.selected?1:-1),o(),y(e.column.code.selected?2:-1),o(),y(e.column.OnHand.selected?3:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?5:-1)}}function hc(i,s){i&1&&b(0,"td")}function Sc(i,s){i&1&&(n(0,"td",29),p(1,"Total :"),a())}function yc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),D(" ",v(2,1,e.getOnHandTotal(),e.pageData.FractionDigit)," ")}}function Dc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function vc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}function wc(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",32),S(2,hc,1,0,"td"),S(3,Sc,2,0,"td",29),S(4,yc,3,4,"td",29),E(5,Dc,3,4,"td",30),S(6,vc,4,7,"td",29),a()()),i&2){let e=m();o(2),y(e.column.name.selected?2:-1),o(),y(e.column.code.selected?3:-1),o(),y(e.column.OnHand.selected?4:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?6:-1)}}var $n=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date().getFullYear(),Ze=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(T,Ze)}_toastrService=Pe(qe);columnService=Pe(gt);years=V.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];column={name:{selected:!0,name:"Name"},code:{selected:!0,name:"Code"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/GetProductSalesMonthlyOnHand",responseProperty:"OnHand"},total:{selected:!0,name:"Total"}};MonthFrom;MonthTo;preGetList(){if(this.pageData&&this.pageData.Filter&&this.pageData.Filter.MonthFrom&&this.pageData.Filter.MonthTo){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs;return}super.preGetList()}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);default:return 0}})}preInitList(){super.preInitList?.(),this.pageData.Filter.MonthFrom=new Date(this.pageData.Filter.MonthFrom),this.pageData.Filter.MonthTo=new Date(this.pageData.Filter.MonthTo)}onSubmit(){delete this.pageData.Filter.ListDynamicID;let e=(0,xo.default)(this.pageData.Filter.MonthFrom),r=(0,xo.default)(this.pageData.Filter.MonthTo);if(r.diff(e,"months")>5)this._toastrService.warning("Selected month range exceeds the maximum of 6 months.","Warning");else{let l=e.format("YYYY-MM")+"-01",C=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(C),delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs,this.searchFromPageOne()}}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.pageData.Filter.ListDynamicID=this.infiniteList.map(e=>e.ID),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter,"OnHand",e=>this.mappingDataOnAdvancedColumn(e))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList.map(r=>{let t=e.find(l=>l.ID==r.ID);return t&&(r.OnHand=t.OnHand),r}))}getOnHandTotal(){return!this.infiniteList||this.infiniteList.length===0?0:this.infiniteList.reduce((r,t)=>{let l=Number(t.OnHand)||0;return r+l},0)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[W],decls:41,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table","table-fixed","table-bordered",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left","border-end",2,"width","250px"],["mat-sort-header","Code",1,"align-left","border-end",2,"width","150px"],[1,"text-end","border-end",2,"width","90px"],["class","text-end border-end","style","width: 90px",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"row",2,"margin-top","15px"],[1,"col-6","pe-2"],["view","month","dateFormat","M yy",3,"ngModelChange","ngModel","ngModelOptions","contentStyle","appendTo","baseZIndex"],[1,"col-6"],["name","Scope",3,"modelChange","model","options"],["matTooltip","Current OnHand Inventory","matTooltipPosition","left",1,"cursor-pointer"],["matTooltip","Total Quantity Sold Based on Filtered Month","matTooltipPosition","left",1,"cursor-pointer"],[1,"text-end"],["class","text-end",4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.onSubmit())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,rc,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,lc,19,22,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(T){return u(l),_(t.sortData(T))}),n(31,"thead",9)(32,"tr",10),S(33,pc,2,0,"th",11),S(34,mc,2,0,"th",12),S(35,sc,3,0,"th",13),E(36,cc,2,1,"th",14),S(37,dc,3,0,"th",13),a()(),n(38,"tbody"),E(39,xc,6,5,"tr",15),a(),E(40,wc,7,5,"tfoot",16),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(19,Z0)),o(3),c("routerLink",M(20,$0)),o(3),c("routerLink",M(21,ec)),o(3),c("routerLink",M(22,tc)),o(3),c("routerLink",M(23,ic)),o(3),c("routerLink",M(24,nc)),o(10),y(t.column.name.selected?33:-1),o(),y(t.column.code.selected?34:-1),o(),y(t.column.OnHand.selected?35:-1),o(),c("ngForOf",t.data==null?null:t.data.MonthlySales),o(),y(t.column.total.selected?37:-1),o(2),c("ngForOf",t.data==null?null:t.data.Data),o(),c("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[A,st,it,Q,L,R,ie,pe,ge,Te,Ce,U,Tr,se,re],encapsulation:2})};var Tc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Pc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Fc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Ic=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],bc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Mc=i=>[i],Vc=i=>({ID:i});function Bc(i,s){if(i&1){let e=I();n(0,"button",13),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",14),p(2," Export"),a()}}function Oc(i,s){if(i&1){let e=I();n(0,"div",15)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",17),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",19)(12,"datepicker",20),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",21),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function Lc(i,s){if(i&1&&(n(0,"th",22),p(1),a()),i&2){let e=s.$implicit;o(),F(e)}}function Rc(i,s){if(i&1&&(n(0,"tr"),b(1,"th")(2,"th"),G(3,Lc,2,1,"th",22,Y),a()),i&2){let e=m();o(3),H(e.data==null?null:e.data.Outlet)}}function kc(i,s){if(i&1&&(n(0,"th",12),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e)}}function Wc(i,s){if(i&1&&(n(0,"a",23),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m();c("routerLink",X(3,Mc,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(5,Vc,r[1])),o(),F(r[e])}}function Nc(i,s){if(i&1&&p(0),i&2){let e=m().$implicit,r=m().$implicit;D(" ",r[e]," ")}}function Ac(i,s){if(i&1&&(n(0,"td",11),S(1,Wc,2,7,"a",23)(2,Nc,1,1),a()),i&2){let e=s.$index;o(),y(e===0?1:2)}}function Gc(i,s){if(i&1&&(n(0,"tr",11),G(1,Ac,3,1,"td",11,Y),a()),i&2){let e=s.$implicit,r=m();o(),H(r.getFilteredKeys(e))}}var ea=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[W],decls:43,vars:18,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border",2,"width","15%"],[1,"border"],[1,"border",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2",1,"text-center","border"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Bc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Oc,16,10,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9),S(32,Rc,5,0,"tr"),n(33,"tr")(34,"th",10),p(35,"Name"),a(),n(36,"th",11),p(37,"Code"),a(),G(38,kc,2,1,"th",12,Y),a()(),n(40,"tbody"),G(41,Gc,3,0,"tr",11,Y),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Tc)),o(3),c("routerLink",M(13,Pc)),o(3),c("routerLink",M(14,Fc)),o(3),c("routerLink",M(15,Ic)),o(3),c("routerLink",M(16,bc)),o(3),c("routerLink",M(17,Ec)),o(9),y((t.data==null?null:t.data.Outlet.length)>0?32:-1),o(6),H(t.data==null?null:t.data.Header),o(3),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,J,L,R,Te,Ce,U],encapsulation:2})};var Hc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Qc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],Yc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],jc=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Zr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],qc=(i,s,e)=>({CategoryID:i,From:s,To:e}),Uc=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],$r=i=>({CategoryID:i});function zc(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Kc(i,s){if(i&1&&(n(0,"span",23),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function Xc(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),E(10,Kc,2,3,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Hide Zero & Negative"),a(),n(28,"radio-options",21),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a(),n(29,"h6"),p(30,"Product Type"),a(),n(31,"radio-options",22),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(5),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),f("model",e.pageData.Filter.ExcludeZero),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes)}}function Jc(i,s){i&1&&(n(0,"th",43),p(1," Cost "),b(2,"p-treeTableSortIcon",44),a())}function Zc(i,s){i&1&&(n(0,"th",45),p(1," Profit "),b(2,"p-treeTableSortIcon",46),a())}function $c(i,s){i&1&&(n(0,"th",47),p(1," % "),b(2,"p-treeTableSortIcon",48),a())}function ed(i,s){if(i&1&&(n(0,"tr",29)(1,"th",30),p(2," Category "),b(3,"p-treeTableSortIcon",31),a(),n(4,"th",32),p(5," Qty "),b(6,"p-treeTableSortIcon",33),a(),E(7,Jc,3,0,"th",34),n(8,"th",35),p(9," Gross "),b(10,"p-treeTableSortIcon",36),a(),n(11,"th",37),p(12," Disc "),b(13,"p-treeTableSortIcon",38),a(),n(14,"th",39),p(15," Sales "),b(16,"p-treeTableSortIcon",40),a(),E(17,Zc,3,0,"th",41)(18,$c,3,0,"th",42),a()),i&2){let e=m(2);o(7),c("ngIf",e.roleService.product.Cost),o(10),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function td(i,s){if(i&1&&(n(0,"td",57)(1,"span",23),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.CostInDirect&&e.Cost?"Direct ("+g(2,3,e.Cost)+") Indirect ("+g(3,5,e.CostInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedCost))}}function id(i,s){if(i&1&&(n(0,"td",58)(1,"span",23),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.ProfitInDirect&&e.Profit?"Direct ("+g(2,3,e.Profit)+") Indirect ("+g(3,5,e.ProfitInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedProfit))}}function nd(i,s){if(i&1&&(n(0,"span",23),d(1,"number"),d(2,"number"),p(3),d(4,"number"),a()),i&2){let e=m(2).rowData;c("matTooltip",Ct(e.PercentageInDirect&&e.Percentage?"Direct ("+v(1,3,e.Percentage,"1.0-2")+") Indirect ("+v(2,6,e.PercentageInDirect,"1.0-2")+")":"")),o(3),D("",g(4,9,e.DisplayedPercentage),"%")}}function ad(i,s){if(i&1&&(n(0,"td"),E(1,nd,5,11,"span",59),a()),i&2){let e=m(3);o(),c("ngIf",e.roleService.report.Profit)}}function od(i,s){if(i&1&&(n(0,"tr",49)(1,"td"),b(2,"p-treeTableToggler",50),n(3,"a",51),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",23),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),E(13,td,6,9,"td",52),n(14,"td",53)(15,"span",23),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",54)(21,"a",55),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",53)(27,"span",23),d(28,"number"),d(29,"number"),n(30,"a",51),p(31),d(32,"amountFraction"),a()()(),E(33,id,6,9,"td",56)(34,ad,2,1,"td",7),a()),i&2){let e=s.$implicit,r=s.rowData,t=m(2);c("ttRow",e),o(2),c("rowNode",e),o(),c("routerLink",M(54,Zr))("queryParams",_t(55,qc,r.ID,v(4,24,t.pageData.Filter.From,"yyyy-MM-dd"),v(5,27,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(r.Name),o(2),c("matTooltip",Ct(r.QuantityIndirect&&r.Quantity?"Direct ("+g(9,30,r.Quantity)+") Indirect ("+g(10,32,r.QuantityIndirect)+")":"")),o(3),F(g(12,34,r.DisplayedQuantity)),o(2),c("ngIf",t.roleService.product.Cost),o(2),c("matTooltip",Ct(r.GrossIndirect&&r.GrossSales?"Direct ("+g(16,36,r.GrossSales)+") Indirect ("+g(17,38,r.GrossIndirect)+")":"")),o(3),F(g(19,40,r.DisplayedGross)),o(3),c("matTooltip",Ct(r.DiscountIndirect&&r.Discount?"Direct ("+g(22,42,r.Discount)+") Indirect ("+g(23,44,r.DiscountIndirect)+")":""))("routerLink",M(59,Uc))("queryParams",X(60,$r,r.ID)),o(3),F(g(25,46,r.DisplayedTotalDiscount)),o(3),c("matTooltip",Ct(r.NetSalesIndirect&&r.Sales?"Direct ("+g(28,48,r.Sales)+") Indirect ("+g(29,50,r.NetSalesIndirect)+")":"")),o(3),c("routerLink",M(62,Zr))("queryParams",X(63,$r,r.ID)),o(),F(g(32,52,r.DisplayedNetSales)),o(2),c("ngIf",t.roleService.report.Profit),o(),c("ngIf",t.roleService.report.Profit)}}function rd(i,s){if(i&1&&(n(0,"td",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function ld(i,s){if(i&1&&(n(0,"td",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalProfit)," ")}}function pd(i,s){if(i&1&&(n(0,"td",61),p(1),d(2,"number"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function md(i,s){if(i&1&&(n(0,"tr",60)(1,"td",61),p(2,"Total :"),a(),n(3,"td",61),p(4),d(5,"quantityFraction"),a(),E(6,rd,3,3,"td",62),n(7,"td",63)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",61),p(12),d(13,"amountFraction"),a(),n(14,"td",63),p(15),d(16,"amountFraction"),a(),E(17,ld,3,3,"td",62)(18,pd,3,3,"td",64),a()),i&2){let e=m(2);o(4),D(" ",g(5,7,e.data.Aggregate.TotalQuantity)," "),o(2),c("ngIf",e.roleService.product.Cost),o(3),F(g(10,9,e.data.Aggregate.TotalGross)),o(3),D(" ",g(13,11,e.data.Aggregate.TotalDiscount)," "),o(3),D(" ",g(16,13,e.data.Aggregate.TotalNetSales)," "),o(2),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function sd(i,s){if(i&1&&(n(0,"content")(1,"div",24)(2,"p-treeTable",25),E(3,ed,19,3,"ng-template",26)(4,od,35,65,"ng-template",27)(5,md,19,15,"ng-template",28),a()()()),i&2){let e=m();o(2),c("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",M(4,jc))}}var ta=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["name","render-ProductType",3,"modelChange","model","options"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],[1,"text-danger",2,"width","120px"],[1,"text-success",2,"width","120px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","120px"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,zc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," List View "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),E(17,Xc,32,17,"ng-template",null,0,O),a(),E(19,sd,6,5,"content",7),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(10,Hc)),o(3),c("routerLink",M(11,Qc)),o(3),c("routerLink",M(12,Yc)),o(5),c("ngIf",t.data))},dependencies:[A,it,Q,$,J,L,R,ie,Te,Ae,Fr,fn,Mr,Ir,br,Er,Ce,U,ze,Mn,re,oe,Z,ne],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var cd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],dd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],ud=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function _d(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function gd(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.CustomerID)}}function Cd(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function fd(i,s){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Value)}}function xd(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Value))}}function hd(i,s){if(i&1&&(n(0,"td"),S(1,fd,2,1,"span"),S(2,xd,3,3,"span"),a()),i&2){let e=s.$implicit;o(),y(e.Key=="Category"?1:-1),o(),y(e.Key!="Category"?2:-1)}}function Sd(i,s){if(i&1&&(n(0,"tr"),G(1,hd,3,2,"td",null,Y),a()),i&2){let e=s.$implicit;o(),H(e)}}function yd(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e))}}function Dd(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",20)(2,"td"),p(3,"Total : "),a(),G(4,yd,3,3,"td",null,Y),a()()),i&2){let e=m(2);o(4),H(e.data.Sum)}}function vd(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr"),G(4,Cd,2,2,"th",19,Y),a()(),n(6,"tbody"),G(7,Sd,3,0,"tr",null,Y),a(),S(9,Dd,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var ia=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}openExportModal(){this.matDialog.open(K,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T]){let Ze=t.find(Ai=>Ai.Key===[this.data.Dataheader[T]].toString()).Value,Ni=l.find(Ai=>Ai.Key===[this.data.Dataheader[T]].toString()).Value;return this.compare(Ze,Ni,C)}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,_d,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Tree View "),a()(),n(10,"li")(11,"a",6),p(12," List View "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,gd,16,9,"ng-template",null,0,O),a(),n(19,"content"),S(20,vd,10,1,"div",7),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(10,cd)),o(3),c("routerLink",M(11,dd)),o(3),c("routerLink",M(12,ud)),o(6),y(t.data?20:-1))},dependencies:[A,Q,J,L,R,pe,ge,Ae,Ce,U,Z],encapsulation:2})};var wd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Td=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Pd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function Fd(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies)}}function Id(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",11),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var na=class i extends me{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=V.Months;Years=V.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(w(N),w(k))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),E(16,Fd,10,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,Id,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(8,wd)),o(3),c("routerLink",M(9,Td)),o(3),c("routerLink",M(10,Pd)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,R,ii],encapsulation:2})};var bd=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Ed(i,s){if(i&1){let e=I();n(0,"div",4)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",5),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",6),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",7)(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("items",e.pageData.Options.SalesOrderTagIDs),f("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("multiple",!0)}}function Md(i,s){if(i&1&&(n(0,"content")(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div",14)(6,"div",15)(7,"p",16),p(8,"Transaction Per Hour"),a()(),n(9,"div",17),b(10,"POS-line-chart",18),a()()()(),n(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15)(15,"p",16),p(16,"Transaction Per Session"),a()(),n(17,"div",17),b(18,"POS-pie-chart",18),a()()()()()()()),i&2){let e=m();o(10),c("config",e.chartConfig)("data",e.ChartData),o(8),c("config",e.pieConfig)("data",e.PieData)}}var aa=class i extends De{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let C={name:l.Name+": "+l.Description,y:l.Transaction};t.push(C)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(l,C){return l+"<br/>"+C.series.name+": <b>"+C.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[W],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),E(6,Ed,13,9,"ng-template",null,0,O),a(),S(8,Md,19,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",M(6,bd)),o(6),y(t.data?8:-1))},dependencies:[A,Q,$,J,L,R,ii,Mt,U],encapsulation:2})};function Vd(i,s){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Bd(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Od(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"number"),a(),n(10,"td",17),p(11),d(12,"amountFraction"),a(),n(13,"td",17),p(14),d(15,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(g(3,5,e.Visitor)),o(3),F(g(6,7,e.Orders)),o(3),F(g(9,9,e.TotalVisitor)),o(3),F(g(12,11,e.Sales)),o(3),F(g(15,13,e.Sales/(e.Visitor*e.Orders)))}}function Ld(i,s){if(i&1&&(n(0,"div",3)(1,"table",11)(2,"thead",12)(3,"tr")(4,"th",13),p(5,"Number of Person"),a(),n(6,"th",14),p(7,"Orders"),a(),n(8,"th",14),p(9,"Total Visitor"),a(),n(10,"th",14),p(11,"Sales"),a(),n(12,"th",15),p(13,"Average Spending"),a()()(),n(14,"tbody"),G(15,Od,16,15,"tr",null,Y),a(),n(17,"tfoot")(18,"tr",16)(19,"td",17),p(20,"Total"),a(),n(21,"td",17),p(22),d(23,"sum"),d(24,"number"),a(),n(25,"td",17),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",17),p(30),d(31,"sum"),d(32,"amountFraction"),a(),n(33,"td",17),p(34),d(35,"amountFraction"),a()()()()()),i&2){let e=m();o(15),H(e.data),o(7),F(g(24,7,v(23,4,e.data,"Orders"))),o(4),F(g(28,12,v(27,9,e.data,"TotalVisitor"))),o(4),F(g(32,17,v(31,14,e.data,"Sales"))),o(4),F(g(35,19,e.getSpendingPerPersonSum(e.data)))}}var oa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(K,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Vd,3,0,"a",2),a(),n(3,"filters"),E(4,Bd,10,6,"ng-template",null,0,O),a(),n(6,"content"),S(7,Ld,36,21,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,J,L,R,U,se,re,Z],encapsulation:2})};var Rd=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function kd(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function Wd(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",19),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",20)(9,"datepicker",21),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Nd(i,s){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Ad(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Revenue))}}function Gd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",13),p(4),d(5,"number"),a(),n(6,"td",13),p(7),d(8,"quantityFraction"),a(),n(9,"td",13),p(10),d(11,"amountFraction"),a(),n(12,"td",14),p(13),d(14,"RoundUp"),d(15,"amountFraction"),a(),n(16,"td",13),p(17),d(18,"RoundUp"),d(19,"amountFraction"),a(),S(20,Ad,3,3,"td",13),a()),i&2){let e=s.$implicit,r=m();o(2),F(e.TimeFormat),o(2),F(g(5,7,e.Count)),o(3),F(g(8,9,e.Quantity)),o(3),F(g(11,11,e.Sales)),o(3),F(g(15,15,g(14,13,e.Tax))),o(4),F(g(19,19,g(18,17,e.SalesWithTax))),o(3),y(r.roleService.product.Cost||r.roleService.report.Profit?20:-1)}}function Hd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m();o(),F(g(3,4,v(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var ra=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(K,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[W],decls:56,vars:43,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,kd,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Wd,10,6,"ng-template",null,0,O),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),S(26,Nd,2,0,"th",10),a()(),n(27,"tbody"),G(28,Gd,21,21,"tr",null,Y),a(),n(30,"tfoot")(31,"tr",11),b(32,"td",12),n(33,"td",13),p(34),d(35,"sum"),d(36,"number"),a(),n(37,"td",13),p(38),d(39,"sum"),d(40,"quantityFraction"),a(),n(41,"td",13),p(42),d(43,"sum"),d(44,"amountFraction"),a(),n(45,"td",14),p(46),d(47,"sum"),d(48,"RoundUp"),d(49,"amountFraction"),a(),n(50,"td",13),p(51),d(52,"sum"),d(53,"RoundUp"),d(54,"amountFraction"),a(),S(55,Hd,4,6,"td",13),a()()()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(42,Rd)),o(23),y(t.roleService.product.Cost||t.roleService.report.Profit?26:-1),o(2),H(t.data==null?null:t.data.Data),o(6),F(g(36,16,v(35,13,t.data==null?null:t.data.Data,"Count"))),o(4),F(g(40,21,v(39,18,t.data==null?null:t.data.Data,"Quantity"))),o(4),F(g(44,26,v(43,23,t.data==null?null:t.data.Data,"Sales"))),o(4),F(g(49,33,g(48,31,v(47,28,t.data==null?null:t.data.Data,"Tax")))),o(5),F(g(54,40,g(53,38,v(52,35,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),y(t.roleService.product.Cost||t.roleService.report.Profit?55:-1))},dependencies:[A,Q,J,L,R,U,se,Cr,re,Z,ne],encapsulation:2})};var Qd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],So=(i,s)=>({From:i,To:s}),Yd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],jd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function qd(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",10),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function Ud(i,s){if(i&1&&(n(0,"content")(1,"div",11),b(2,"POS-line-chart",12),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var la=class i extends me{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(s,e,r){super(s,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let s=this.route.snapshot.queryParams;s.From&&(this.pageData.Filter.From=s.From,this.pageData.Filter.To=s.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let s=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return V.getDatesInRange(s,e).map(l=>`${l.getDate()} ${V.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(s){this.pageData.Filter.From=s.from,this.pageData.Filter.To=s.to}static \u0275fac=function(e){return new(e||i)(w(N),w(k),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[W],decls:19,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,r){if(e&1){let t=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(t),_(r.searchFromPageOne())}),h("filterChange",function(C){return u(t),x(r.pageData.Filter,C)||(r.pageData.Filter=C),_(C)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),E(16,qd,13,11,"ng-template",null,0,O),a(),S(18,Ud,3,2,"content"),a()}e&2&&(c("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",r.pageData.Filter),o(7),c("routerLink",M(11,Qd))("queryParams",fe(12,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(15,Yd))("queryParams",fe(16,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(19,jd))("queryParams",fe(20,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),y(r.data?18:-1))},dependencies:[A,Q,$,L,R,Mt,Gt,Ce,U],encapsulation:2})};var Jd={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},pi=class i{date;dateChange=new ln;width;minDate=V.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(s,e){let r=null;s&&(r=s.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(s){let e=null;s&&(e=s.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(s,e){let r=new Date(s.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[Ci([{provide:yn,useClass:Nn,deps:[Sn,wr]},{provide:Dn,useValue:Jd}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(C){return u(t),_(r.onDateChange(C.value))}),a(),b(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(C){u(t);let T=Tt(4);return _(r.chosenYearHandler(C,T))})("monthSelected",function(C){u(t);let T=Tt(4);return _(r.setMonthAndYear(C,T))})("opened",function(){return u(t),_(r.onOpenDatepicker())})("closed",function(){return u(t),_(r.onCloseDatepicker())}),a()()}if(e&2){let t=Tt(4);qt("width",r.width||100,"%"),o(),c("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),c("for",t)}},dependencies:[At,In,yi,Tn,Pn,Fn,Di,En,wn,vn,bn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
2
|
+
`],encapsulation:2})};var $d=()=>["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"];function eu(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker-year-month",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker-year-month",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(10,"h6"),p(11,"Compare To Year"),a(),n(12,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.LastYear,t)||(l.pageData.Filter.LastYear=t),_(t)}),a(),n(13,"h6"),p(14,"Category"),a(),n(15,"POS-product-category-select",11),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(19,"h6"),p(20,"Multiply Unit Qty"),a(),n(21,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.LastYear),c("items",e.optionsCompareYear),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),f("model",e.pageData.Filter.MultiplyUnitQuantity)}}function tu(i,s){if(i&1&&(n(0,"div",5),b(1,"POS-line-chart",14),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var ma=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance");this.httpService=r;this.csvConverter=t}chartData={Series:[]};chartConfig;currency=-1;optionsCompareYear=[{value:1,label:"Last one year"},{value:2,label:"Last two year"}];onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=this.generateSeries();this.chartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:void 0},labels:{formatter:function(){return V.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r,t="",l=Math.abs(this.total);return l>999&&l<1e10?(t="K",r=(l/1e3).toFixed(0)):l>=1e10?(t="M",r=(l/1e6).toFixed(0)):l<999&&(r=l.toString()),this.total<0&&(r="-"+r),r.replace(/\B(?=(\d{3})+(?!\d))/g,",")+t}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series,t=this.point?.stackTotal;r=r.filter(Ze=>this.series?.name==Ze?.name);let l=[],C="",T=this.point.index;return r.forEach(Ze=>{Ze.options.stack===this.point.series.options.stack&&(l=Ze.name.split(" "),C+=`
|
|
3
3
|
<b>${this.point.category}</b></br>Total:
|
|
4
4
|
${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(t)}</br>${l[0]}:
|
|
5
5
|
${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(Ze.points[T].y)}</br>
|
|
6
|
-
`)}),h}}}}generateSeries(){let e,r=[];return r=this.data.MonthlySalesRank.map(t=>(e={name:`${t.Name} ${t.CompareYear}`,data:t.Sales,stack:t.Year},e)),r}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-sales"]],standalone:!1,features:[W],decls:11,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"dateChange","date"],[1,"mt-4"],["appendTo","body","bindValue","value","bindLabel","label","placeholder","Compare To Year",3,"ngModelChange","ngModel","items"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],["name","Inventory",3,"modelChange","model"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"a",3),b(4,"i",4),p(5,"Table View"),a()()(),n(6,"filters"),E(7,iu,22,13,"ng-template",null,0,O),a(),n(9,"content"),S(10,nu,2,2,"div",5),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(3),c("routerLink",M(6,tu)),o(7),y(t.data?10:-1))},dependencies:[A,Q,$,L,R,ie,Te,Mt,pi,Ce,U],encapsulation:2})};var au=()=>["/menu/Reports/Sales_Report/Standard/Yearly"],ou=(i,s)=>({"text-success":i,"text-danger":s}),el=(i,s)=>({"text-success fw-bold":i,"text-danger fw-bold":s});function ru(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function lu(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year to Compare"),a(),n(12,"div",12)(13,"div",13)(14,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(15,"div",13)(16,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()(),n(17,"h6"),p(18,"Sales Order Tag"),a(),n(19,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(20,"h6"),p(21,"Currency"),a(),n(22,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Option.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SalesID),o(5),C("ngModel",e.pageData.Filter.FromYear),c("items",e.Years),o(2),C("ngModel",e.pageData.Filter.ToYear),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Option==null?null:e.pageData.Option.Types),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Option.Currencies)}}function pu(i,s){if(i&1&&(n(0,"th",21),d(1,"GetChildrenArray"),d(2,"sum"),p(3),a()),i&2){let e=s.$implicit,r=m(2);c("colSpan",v(2,5,r.filterSales(v(1,2,r.data.Data,"Sales"),"Year",e),"Tax")==0?1:3),o(3),D(" ",e)}}function mu(i,s){i&1&&(n(0,"th",27),p(1," Sales"),a())}function su(i,s){i&1&&(n(0,"th",28),p(1," Tax"),a())}function cu(i,s){if(i&1&&(S(0,mu,2,0,"th",27),d(1,"GetChildrenArray"),d(2,"sum"),S(3,su,2,0,"th",28),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"th",28),p(7," Sales + Tax"),a()),i&2){let e=s.$implicit,r=m(2);y(v(2,5,r.filterSales(v(1,2,r.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,11,r.filterSales(v(4,8,r.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1)}}function du(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m(2);o(),D(" ",g(3,4,v(2,1,t.filterSales(r.Sales,"Year",e),"Sales")))}}function uu(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m(2);o(),D(" ",g(3,4,v(2,1,t.filterSales(r.Sales,"Year",e),"Tax"))," ")}}function _u(i,s){if(i&1&&(S(0,du,4,6,"td",28),d(1,"GetChildrenArray"),d(2,"sum"),S(3,uu,4,6,"td",28),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"td",28),p(7),d(8,"sum"),d(9,"amountFraction"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m(2);y(v(2,6,t.filterSales(v(1,3,t.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,12,t.filterSales(v(4,9,t.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1),o(4),D(" ",g(9,18,v(8,15,t.filterSales(r.Sales,"Year",e),"SalesWithTax")))}}function gu(i,s){if(i&1&&(n(0,"tr",23)(1,"td"),p(2),d(3,"Month"),a(),G(4,_u,10,20,null,null,Y),n(6,"td",26),d(7,"sum"),d(8,"sum"),p(9),d(10,"sum"),d(11,"number"),a(),n(12,"td",26),d(13,"sum"),d(14,"sum"),p(15),d(16,"sum"),d(17,"number"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(g(3,5,e.Month)),o(2),H(r.data.HeaderList),o(2),c("ngClass",fe(29,el,v(7,7,r.filterSales(e.Difference,"Month",e.Month),"Difference")>0,v(8,10,r.filterSales(e.Difference,"Month",e.Month),"Difference")<0)),o(3),D(" ",g(11,16,v(10,13,r.filterSales(e.Difference,"Month",e.Month),"Difference"))," "),o(3),c("ngClass",fe(32,el,v(13,18,r.filterSales(e.Difference,"Month",e.Month),"Percentage")>0,v(14,21,r.filterSales(e.Difference,"Month",e.Month),"Percentage")<0)),o(3),D(" ",g(17,27,v(16,24,r.filterSales(e.Difference,"Month",e.Month),"Percentage"))," ")}}function Cu(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(4,7,v(3,4,r.filterSales(v(2,1,r.data.Data,"Sales"),"Year",e),"Sales")))}}function fu(i,s){if(i&1&&(n(0,"td",30),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(4,7,v(3,4,r.filterSales(v(2,1,r.data.Data,"Sales"),"Year",e),"Tax")))}}function xu(i,s){if(i&1&&(S(0,Cu,5,9,"td",29),d(1,"GetChildrenArray"),d(2,"sum"),S(3,fu,5,9,"td",30),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"td",29),p(7),d(8,"GetChildrenArray"),d(9,"sum"),d(10,"amountFraction"),a()),i&2){let e=s.$implicit,r=m(2);y(v(2,6,r.filterSales(v(1,3,r.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,12,r.filterSales(v(4,9,r.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1),o(4),D(" ",g(10,21,v(9,18,r.filterSales(v(8,15,r.data.Data,"Sales"),"Year",e),"SalesWithTax")))}}function hu(i,s){if(i&1&&(n(0,"div",5)(1,"table",18)(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Month"),a(),G(6,pu,4,8,"th",21,Y),n(8,"th",22),p(9,"Diff"),a(),n(10,"th",22),p(11,"%"),a()(),n(12,"tr"),G(13,cu,8,14,null,null,Y),a()(),n(15,"tbody"),G(16,gu,18,35,"tr",23,Y),a(),n(18,"tfoot",24)(19,"tr")(20,"td",25),p(21,"Total :"),a(),G(22,xu,11,23,null,null,Y),n(24,"td",26),p(25),d(26,"number"),a()()()()()),i&2){let e=m();o(6),H(e.data.HeaderList),o(7),H(e.data.HeaderList),o(3),H(e.data.Data),o(6),H(e.data.HeaderList),o(2),c("ngClass",fe(4,ou,e.data.TotalDiff>0,e.data.TotalDiff<0)),o(),D(" ",g(26,2,e.data.TotalDiff))}}var sa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/YearlySalesList","ReportLoader/YearlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}subheader=["Sales","Tax","Sales+Tax"];prop=["Sales","Tax","SalesWithTax"];Years=V.GenerateYears(new Date().getFullYear(),11,!0);filterSales(e,r,t){return e.filter(function(l){return l[r]==t})}openExportModal(){this.matDialog.open(K,{data:{title:"Yearly",exportTypes:[{ID:"ReportExport/YearlySalesList",Value:"Default",FileName:"Yearly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-yearly"]],standalone:!1,features:[W],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[1,"row"],[1,"col-6"],["appendTo","body","placeholder","Choose Year From",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year To",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["rowspan","2"],[1,"text-center","border-start","border-end",3,"colSpan"],["rowspan","2",1,"text-end"],[1,"border-bottom"],[1,"table-footer"],[1,"fw-bold","text-success"],[1,"text-end",3,"ngClass"],[1,"text-end","border-start"],[1,"text-end"],[1,"text-end","text-success"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ru,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,lu,23,15,"ng-template",null,0,O),a(),n(9,"content"),S(10,hu,27,7,"div",5),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,au)),o(7),y(t.data?10:-1))},dependencies:[A,tt,Q,$,L,R,ie,Ce,U,ze,se,Ln,fr,re,Z],encapsulation:2})};var Su=()=>["/menu/Reports/Sales_Report/Standard/Daily"],yo=(i,s)=>({From:i,To:s}),yu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Du=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"],tl=i=>({"is-weekend":i});function vu(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function wu(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",14),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(19,"h6"),p(20,"Sales Order Tag"),a(),n(21,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate),o(3),C("ngModel",e.pageData.Filter.DeliveryID),c("items",e.pageData.Options==null?null:e.pageData.Options.Deliveries),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function Tu(i,s){i&1&&(n(0,"th",26),p(1," Tax "),a())}function Pu(i,s){i&1&&(n(0,"th",27),p(1,"Net Sales + Tax"),a())}function Fu(i,s){i&1&&(n(0,"th",28),p(1,"Cost"),a())}function Iu(i,s){i&1&&(n(0,"th",29),p(1," Profit "),a())}function bu(i,s){i&1&&(n(0,"th",30),p(1," Profit + Tax Include "),a())}function Eu(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Tax))}}function Mu(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D("",g(2,1,e.SalesNetWithTax)," ")}}function Vu(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost))}}function Bu(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit))}}function Ou(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.ProfitWithTax>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.ProfitWithTax))}}function Lu(i,s){if(i&1&&(n(0,"tr",31)(1,"td",31),p(2),d(3,"date"),a(),n(4,"td"),p(5),d(6,"date"),a(),n(7,"td",33),p(8),d(9,"number"),a(),n(10,"td",33),p(11),d(12,"quantityFraction"),a(),n(13,"td",33),p(14),d(15,"amountFraction"),a(),n(16,"td",33),p(17),d(18,"amountFraction"),a(),S(19,Eu,3,3,"td",37),S(20,Mu,3,3,"td",33),S(21,Vu,3,3,"td",34),S(22,Bu,3,4,"td",36),S(23,Ou,3,4,"td",36),a()),i&2){let e=s.$implicit,r=m(2);c("ngClass",X(27,tl,r.data.DayOfWeekend)),o(),c("ngClass",X(29,tl,e.DayOfWeekend)),o(),D(" ",v(3,13,e.Day,"EEEE")," "),o(3),F(v(6,16,e.Day,"dd")),o(3),F(g(9,19,e.Count)),o(3),F(g(12,21,e.Quantity)),o(3),F(g(15,23,e.Gross)),o(3),F(g(18,25,e.SalesNet)),o(2),y(r.data.ShowTax?19:-1),o(),y(r.data.ShowTax?20:-1),o(),y(r.roleService.product.Cost?21:-1),o(),y(r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost?22:-1),o(),y(!r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost?23:-1)}}function Ru(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax")))}}function ku(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"SalesNetWithTax")))}}function Wu(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost")))}}function Nu(i,s){if(i&1&&(n(0,"td",35),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",v(1,2,e.data.Data,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.data.Data,"Profit")))}}function Au(i,s){if(i&1&&(n(0,"td",36),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",v(1,2,e.data.Data,"ProfitWithTax")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.data.Data,"ProfitWithTax")))}}function Gu(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Day"),a(),n(6,"th",21),p(7,"Dt."),a(),n(8,"th",22),p(9,"Orders "),a(),n(10,"th",23),p(11," Quantity"),a(),n(12,"th",24),p(13," Gross"),a(),n(14,"th",25),p(15," Net Sales"),a(),S(16,Tu,2,0,"th",26),S(17,Pu,2,0,"th",27),S(18,Fu,2,0,"th",28),S(19,Iu,2,0,"th",29),S(20,bu,2,0,"th",30),a()(),n(21,"tbody"),G(22,Lu,24,31,"tr",31,Y),a(),n(24,"tfoot")(25,"tr"),b(26,"td",32)(27,"td",32),n(28,"td",33),p(29),d(30,"sum"),d(31,"number"),a(),n(32,"td",33),p(33),d(34,"sum"),d(35,"quantityFraction"),a(),n(36,"td",33),p(37),d(38,"sum"),d(39,"amountFraction"),a(),n(40,"td",33),p(41),d(42,"sum"),d(43,"amountFraction"),a(),S(44,Ru,4,6,"td",33),S(45,ku,4,6,"td",33),S(46,Wu,4,6,"td",34),S(47,Nu,5,10,"td",35),S(48,Au,5,10,"td",36),a()()()()}if(i&2){let e=m();o(16),y(e.data.ShowTax?16:-1),o(),y(e.data.ShowTax?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?19:-1),o(),y(!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?20:-1),o(2),H(e.data.Data),o(7),F(g(31,17,v(30,14,e.data.Data,"Count"))),o(4),F(g(35,22,v(34,19,e.data.Data,"Quantity"))),o(4),F(g(39,27,v(38,24,e.data.Data,"Gross"))),o(4),F(g(43,32,v(42,29,e.data.Data,"SalesNet"))),o(3),y(e.data.ShowTax?44:-1),o(),y(e.data.ShowTax?45:-1),o(),y(e.roleService.product.Cost?46:-1),o(),y(e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?47:-1),o(),y(!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?48:-1)}}var ca=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/DailySalesList","ReportLoader/DailyReportSales",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.activatedRoute=T}maxFilterDate=new Date;originalData;hideMore=!0;postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data}preInitList(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";return this.compare(t[e.active],l[e.active],h)})}onFilterDateChange(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to}openExportModal(){this.matDialog.open(K,{data:{title:"Daily Sales Report",exportTypes:[{ID:"ReportExport/DailySalesExport",Value:"Default",FileName:"Daily Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily"]],standalone:!1,features:[W],decls:21,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to","maxDate"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["id","tableGrid","api","Report/DailySalesList","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Day",2,"width","90px"],["mat-sort-header","Date",1,"align-left",2,"width","42px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Gross","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNetWithTax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","ProfitWithTax","arrowPosition","before",1,"flex-right",2,"width","160px"],[3,"ngClass"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-danger",3,"ngClass"],[1,"text-end",3,"ngClass"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,vu,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Sales Chart "),a()(),n(10,"li")(11,"a",6),p(12," Daily Quantity Sold "),a()(),n(13,"li")(14,"a",6),p(15," Monthly Quantity Sold "),a()()()()(),n(16,"filters"),E(17,wu,22,16,"ng-template",null,0,O),a(),n(19,"content"),S(20,Gu,49,34,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Su))("queryParams",fe(13,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(16,yu))("queryParams",fe(17,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(20,Du))("queryParams",fe(21,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(6),y(t.data?20:-1))},dependencies:[A,tt,Q,$,L,R,pe,ge,Gt,Ce,U,ze,se,re,oe,Z,ne],encapsulation:2})};var Hu=()=>["/menu/Reports/Sales_Report/Standard/Monthly"];function Qu(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function Yu(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year"),a(),n(12,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(13,"h6"),p(14,"Multiply Unit Qty"),a(),n(15,"radio-options",13),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("model",e.pageData.Filter.MultiplyUnitQuantity)}}function ju(i,s){i&1&&(n(0,"th",19),p(1," Cost "),a())}function qu(i,s){i&1&&(n(0,"th",19),p(1," Profit "),a())}function Uu(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function zu(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Profit)," ")}}function Ku(i,s){if(i&1&&(n(0,"tr",28)(1,"td"),p(2),d(3,"Month"),a(),n(4,"td",23),p(5),d(6,"number"),a(),n(7,"td",23),p(8),d(9,"quantityFraction"),a(),E(10,Uu,3,3,"td",24),n(11,"td",23),p(12),d(13,"amountFraction"),a(),n(14,"td",23),p(15),d(16,"amountFraction"),a(),n(17,"td",25),p(18),d(19,"amountFraction"),a(),n(20,"td",26),p(21),d(22,"amountFraction"),a(),E(23,zu,3,3,"td",27),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(g(3,9,e.Month)),o(3),F(g(6,11,e.Count)),o(3),D(" ",g(9,13,e.Quantity)," "),o(2),c("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit),o(2),D(" ",g(13,15,e.Gross)," "),o(3),D(" ",g(16,17,e.Sales)," "),o(3),D(" ",g(19,19,e.Tax)," "),o(3),F(g(22,21,e.SalesNetWithTax)),o(2),c("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit)}}function Xu(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function Ju(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Profit"))," ")}}function Zu(i,s){if(i&1&&(n(0,"div",14)(1,"table",15)(2,"thead",16)(3,"tr")(4,"th",17),p(5,"Month"),a(),n(6,"th",18),p(7,"Orders"),a(),n(8,"th",19),p(9,"Quantity"),a(),E(10,ju,2,0,"th",20),n(11,"th",19),p(12,"Gross"),a(),n(13,"th",19),p(14,"Sales"),a(),n(15,"th",19),p(16,"Tax"),a(),n(17,"th",19),p(18,"Sales + Tax"),a(),E(19,qu,2,0,"th",20),a()(),n(20,"tbody"),E(21,Ku,24,23,"tr",21),a(),n(22,"tfoot")(23,"tr",22),b(24,"td"),n(25,"td",23),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",23),p(30),d(31,"sum"),d(32,"quantityFraction"),a(),E(33,Xu,4,6,"td",24),n(34,"td",23),p(35),d(36,"sum"),d(37,"amountFraction"),a(),n(38,"td",23),p(39),d(40,"sum"),d(41,"amountFraction"),a(),n(42,"td",25),p(43),d(44,"sum"),d(45,"amountFraction"),a(),n(46,"td",26),p(47),d(48,"sum"),d(49,"amountFraction"),a(),E(50,Ju,4,6,"td",27),a()()()()),i&2){let e=m();o(10),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(9),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),c("ngForOf",e.data.Data),o(5),D(" ",g(28,14,v(27,11,e.data.Data,"Count"))," "),o(4),D(" ",g(32,19,v(31,16,e.data.Data,"Quantity"))," "),o(3),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),D(" ",g(37,24,v(36,21,e.data.Data,"Gross"))," "),o(4),D(" ",g(41,29,v(40,26,e.data.Data,"Sales"))," "),o(4),D(" ",g(45,34,v(44,31,e.data.Data,"Tax"))," "),o(4),D(" ",g(49,39,v(48,36,e.data.Data,"SalesNetWithTax"))," "),o(3),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit)}}var da=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/MonthlySalesList","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}Years=V.GenerateYears(new Date().getFullYear(),11,!0);preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Monthly",exportTypes:[{ID:"ReportExport/MonthlySalesList",Value:"Default",FileName:"Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly"]],standalone:!1,features:[W],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["name","Inventory",3,"modelChange","model"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","90px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end"],["class","text-end text-success",4,"ngIf"],[1,"border-bottom"],[1,"text-end","text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Qu,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Yu,16,10,"ng-template",null,0,O),a(),n(9,"content"),E(10,Zu,51,41,"div",5),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,Hu)),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,L,R,ie,Te,Ce,U,ze,se,Ln,re,Z,ne],encapsulation:2})};var $u=()=>["/menu/Reports/Sales_Report/Standard/Daily"],il=(i,s)=>({From:i,To:s}),e_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],t_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function i_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)("minDate",e.minFilterDate)}}function n_(i,s){if(i&1&&(n(0,"content")(1,"div",12),b(2,"POS-line-chart",13),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var ua=class i extends me{constructor(e,r,t,l){super(e,r,"Report/DailySalesVolume","ReportLoader/DailyReportSales",null,l);this.httpService=r;this.csvConverter=t;this.initValidateFilterDate()}maxFilterDate;minFilterDate;Years=V.GenerateYears(new Date().getFullYear(),11,!0);chartConfig;currency=-1;Months=V.Months;ChartData={};initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,45)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.getQueryParams(),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}getQueryParams(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To)}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){this.menuData.H=this.data.PageTitle,this.initChart()}initChart(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},yAxis:{title:{text:""}},xAxis:{categories:this.generateChartCategories()},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return V.getDatesInRange(e,r).map(h=>`${h.getDate()} ${V.Months[h.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(e){this.pageData.Filter.From=e.from?.toISOString(),this.pageData.Filter.To=e.to?.toISOString()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-volume"]],standalone:!1,features:[W],decls:19,vars:19,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dropdown-item",3,"routerLink"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"dateChange","from","to","maxDate","minDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",6),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),E(16,i_,13,12,"ng-template",null,0,O),a(),S(18,n_,3,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(10,$u))("queryParams",fe(11,il,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(14,e_))("queryParams",fe(15,il,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(18,t_)),o(5),y(t.data?18:-1))},dependencies:[A,Q,$,L,R,Mt,Gt,Ce,U],encapsulation:2})};var a_=()=>["/menu/Reports/Sales_Report/Standard/Daily"],o_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],r_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"];function l_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Year"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function p_(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-line-chart",12),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.ChartData)}}var _a=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthtlySalesVolume","ReportLoader/MonthlySalesVolume");this.httpService=r;this.csvConverter=t}currency=-1;Years=V.GenerateYears(new Date().getFullYear(),11,!0);ChartData={};chartConfig;preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=[];this.data.MonthlySalesRank.forEach(r=>{let t=r.Sales.map(h=>parseInt(h)),l={name:r.Name,data:t};e.push(l)}),this.ChartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-volume"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",5),p(14," Daily Quantity Sold "),a()()()()(),n(15,"filters"),E(16,l_,13,9,"ng-template",null,0,O),a(),n(18,"content"),S(19,p_,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(8,a_)),o(3),c("routerLink",M(9,o_)),o(3),c("routerLink",M(10,r_)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,R,Mt,Ce,U],encapsulation:2})};var m_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],s_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],c_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"];function d_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",8),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",11)(12,"datepicker",12),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function u_(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",13),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var ga=class i extends me{constructor(e,r){super(e,r,"Report/OutletPerformanceCart","ReportLoader/OutletPerformance");this.httpService=r}PieData={};pieConfig={title:"",dataLabels:!0,labelTooltips:"Sales",height:400,legend:{}};postInit(){this.getPieData(),this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getPieData(){let e=[],r=[];this.data.DataWithoutCategory.length>0&&this.data.DataWithoutCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.data.DataWithCategory.length>0&&this.data.DataWithCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.PieData=r}static \u0275fac=function(r){return new(r||i)(w(N),w(k))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-graphic"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Outlet Performance "),a()(),n(9,"li")(10,"a",5),p(11," Compare by Outlet Group "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Month "),a()()()()(),n(15,"filters"),E(16,d_,13,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,u_,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(8,m_)),o(3),c("routerLink",M(9,s_)),o(3),c("routerLink",M(10,c_)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,J,L,R,ii,Ce],encapsulation:2})};var Do=Jt(bi());var __=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],g_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],C_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],f_=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),nl=(i,s,e)=>({ListIDs:i,From:s,To:e}),Li=(i,s)=>({"text-danger":i,"text-success":s}),x_=()=>["/menu/Reports/Sales_Report/Standard/Summary"],al=(i,s)=>({"text-warning":i,"text-success":s,"text-end":!0}),ol=(i,s)=>({"text-success":i,"text-danger":s});function h_(i,s){if(i&1){let e=I();n(0,"a",12),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function S_(i,s){if(i&1){let e=I();n(0,"div",14)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",15),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TagIDs,t)||(l.pageData.Filter.TagIDs=t),_(t)}),a(),n(7,"h6"),p(8,"Outlet Group"),a(),n(9,"POS-outlet-group-tree-select",17),x("selectedOutletGroupIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"datepicker",18),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(14,"div",19)(15,"datepicker",20),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(16,"h6"),p(17,"Brand"),a(),n(18,"ng-select",21),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(19,"h6"),p(20,"Product Type"),a(),n(21,"radio-options",22),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(22,"h6"),p(23," Query Option "),b(24,"i",23),a(),n(25,"ng-select",24),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a()()}if(i&2){let e=m();o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),C("ngModel",e.pageData.Filter.TagIDs),o(3),c("showClear",!0),C("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("multiple",!0),C("ngModel",e.pageData.Filter.BrandIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),C("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),C("ngModel",e.pageData.Filter.QueryOption)}}function y_(i,s){i&1&&(n(0,"th",55),p(1," Prev "),a())}function D_(i,s){i&1&&(n(0,"th",56),p(1," Now "),a())}function v_(i,s){i&1&&(n(0,"th",57),p(1," Orders "),a())}function w_(i,s){i&1&&(n(0,"th",58),p(1," Qty "),a())}function T_(i,s){i&1&&(n(0,"th",59),p(1," Gross "),a())}function P_(i,s){i&1&&(n(0,"th",60),p(1," Basket Size "),a())}function F_(i,s){i&1&&(n(0,"th",61),p(1," Sales "),a())}function I_(i,s){i&1&&(n(0,"th",62),p(1," Avg Daily Sales "),a())}function b_(i,s){i&1&&(n(0,"th",63),p(1," Inventory "),a())}function E_(i,s){i&1&&(pt(0),n(1,"th",64),p(2," Target "),a(),mt())}function M_(i,s){i&1&&(n(0,"th",66),p(1," Ach(%) "),a())}function V_(i,s){if(i&1&&(pt(0),E(1,M_,2,0,"th",65),d(2,"HideSumZero"),d(3,"HideSumZero"),mt()),i&2){let e=m(2);o(),c("ngIf",v(2,1,e.data.Data,"AchievementWithTax")||v(3,4,e.data.Data,"Achievement"))}}function B_(i,s){i&1&&(n(0,"th",67),p(1," Daily Target "),a())}function O_(i,s){i&1&&(n(0,"th",68),p(1," Tax "),a())}function L_(i,s){if(i&1&&(n(0,"th",69),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function R_(i,s){i&1&&(n(0,"th",70),p(1,"\xB1 (%)"),a())}function k_(i,s){i&1&&(n(0,"th",71),p(1," Cost "),a())}function W_(i,s){if(i&1&&(n(0,"th",69),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function N_(i,s){i&1&&(n(0,"th",72),p(1," Expense "),a())}function A_(i,s){if(i&1&&(n(0,"td",75),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function G_(i,s){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.index;c("ngClass",fe(2,f_,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function H_(i,s){if(i&1&&(n(0,"td",70)(1,"a",77),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(5,nl,e.EntityID,r.convertToDateString(r.pageData.Filter.From),r.convertFromDateString(r.pageData.Filter.To))),o(),F(v(3,2,e.Count,"1.0-0"))}}function Q_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Y_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function j_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.BasketSize,"1.0-2")," ")}}function q_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function U_(i,s){if(i&1&&(n(0,"td",70)(1,"div"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.AverageDailySales))}}function z_(i,s){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.InventoryValue))}}function K_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.RangeSalesTarget)," ")}}function X_(i,s){if(i&1&&(pt(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m(2).$implicit;o(),c("ngClass",fe(4,Li,e.AchievementWithTax<100,e.AchievementWithTax>100)),o(),D(" ",g(3,2,e.AchievementWithTax)," ")}}function J_(i,s){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Li,e.Achievement<100,e.Achievement>100)),o(),D(" ",g(2,2,e.Achievement)," ")}}function Z_(i,s){if(i&1&&(n(0,"td",70),E(1,X_,4,7,"ng-container",78)(2,J_,3,7,"ng-template",null,1,O),a()),i&2){let e=Dt(3),r=m(3);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function $_(i,s){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.SalesTarget))}}function e1(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function t1(i,s){if(i&1&&(n(0,"td",70)(1,"a",81),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(11,x_))("queryParams",_t(12,nl,e.EntityID,v(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),v(3,6,r.pageData.Filter.To,"yyyy-MM-dd"))),o(4),F(g(6,9,e.SalesWithTax))}}function i1(i,s){if(i&1&&(pt(0),p(1),d(2,"number"),mt()),i&2){let e=m(2).$implicit;o(),D(" ",v(2,1,e.Increase,"1.0-0")," ")}}function n1(i,s){if(i&1&&p(0),i&2){let e=m(2).$implicit;D(" ",e.Increase," ")}}function a1(i,s){if(i&1&&(n(0,"td",79),E(1,i1,3,4,"ng-container",78)(2,n1,1,1,"ng-template",null,2,O),a()),i&2){let e=Dt(3),r=m().$implicit;c("ngClass",fe(3,al,r.IsNegative,r.IsPositive)),o(),c("ngIf",r.Increase!=="-")("ngIfElse",e)}}function o1(i,s){if(i&1&&(n(0,"td",82),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function r1(i,s){if(i&1&&(pt(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m(2).$implicit;o(),c("ngClass",fe(4,Li,e.ProfitWithTax<0,e.ProfitWithTax>0)),o(),D(" ",g(3,2,e.ProfitWithTax))}}function l1(i,s){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Li,e.Profit<0,e.Profit>0)),o(),D(" ",g(2,2,e.Profit))}}function p1(i,s){if(i&1&&(n(0,"td",70),E(1,r1,4,7,"ng-container",78)(2,l1,3,7,"ng-template",null,3,O),a()),i&2){let e=Dt(3),r=m(3);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function m1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Expense)," ")}}function s1(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",48),p(4),a(),E(5,A_,2,1,"td",73)(6,G_,2,5,"td",74)(7,H_,4,9,"td",43)(8,Q_,3,3,"td",43)(9,Y_,3,3,"td",43)(10,j_,3,4,"td",43)(11,q_,3,3,"td",43)(12,U_,4,3,"td",43)(13,z_,4,3,"td",43)(14,K_,3,3,"td",43),pt(15),E(16,Z_,4,2,"td",43),d(17,"HideSumZero"),d(18,"HideSumZero"),mt(),E(19,$_,4,3,"td",43)(20,e1,3,3,"td",51)(21,t1,7,16,"td",43)(22,a1,4,6,"td",53)(23,o1,3,3,"td",54)(24,p1,4,2,"td",43)(25,m1,3,3,"td",43),d(26,"sum"),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(2),F(r+1),o(2),F(e.Name),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",t.column.Orders.selected),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.Gross.selected),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.Sales.selected),o(),c("ngIf",t.column.AvgDaily.selected),o(),c("ngIf",t.column.Inventory.selected),o(),c("ngIf",t.column.TargetDaily.selected),o(2),c("ngIf",v(17,20,t.data.Data,"AchievementWithTax")||v(18,23,t.data.Data,"Achievement")),o(3),c("ngIf",t.column.DailyTarget.selected),o(),c("ngIf",t.column.Tax.selected),o(),c("ngIf",t.column.SalesNTax.selected),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",(t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost)&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.product.Expense&&t.column.QTY.selected&&v(26,26,t.data.Data,"Expense")!=0)}}function c1(i,s){i&1&&b(0,"td",50)}function d1(i,s){i&1&&b(0,"td",50)}function u1(i,s){if(i&1&&(n(0,"td",70)(1,"a",83),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m(2);o(2),D(" ",v(4,4,v(3,1,e.data.Data,"Count"),"1.0-0"))}}function _1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function g1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Gross"))," ")}}function C1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"BasketSize")/(e.data==null||e.data.Data==null?null:e.data.Data.length),"1.0-2")," ")}}function f1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Sales"))," ")}}function x1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"AverageDailySales"))," ")}}function h1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"InventoryValue"))," ")}}function S1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"RangeSalesTarget"))," ")}}function y1(i,s){if(i&1&&(pt(0),n(1,"span",79),d(2,"sum"),d(3,"sum"),p(4),d(5,"sum"),d(6,"amountFraction"),a(),mt()),i&2){let e=m(3);o(),c("ngClass",fe(13,Li,v(2,2,e.data.Data,"AchievementWithTax")<100,v(3,5,e.data.Data,"AchievementWithTax")>100)),o(3),D(" ",g(6,11,v(5,8,e.data.Data,"AchievementWithTax")/(e.data==null||e.data.Data==null?null:e.data.Data.length))," ")}}function D1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,Li,v(1,2,e.data.Data,"Achievement")<100,v(2,5,e.data.Data,"Achievement")>100)),o(3),D(" ",g(5,11,v(4,8,e.data.Data,"Achievement")/(e.data==null||e.data.Data==null?null:e.data.Data.length)))}}function v1(i,s){if(i&1&&(n(0,"td",70),E(1,y1,7,16,"ng-container",78)(2,D1,6,16,"ng-template",null,4,O),a()),i&2){let e=Dt(3),r=m(2);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function w1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"SalesTarget"))," ")}}function T1(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function P1(i,s){if(i&1&&(n(0,"td",84)(1,"a",85),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function F1(i,s){if(i&1&&(n(0,"td",79),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,al,e.comparation<0,e.comparation>0)),o(),D(" ",v(2,2,e.comparation,"1.0-0")," ")}}function I1(i,s){if(i&1&&(n(0,"td",82),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function b1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,ol,v(1,2,e.data.Data,"Profit")>0,v(2,5,e.data.Data,"Profit")<0)),o(3),F(g(5,11,v(4,8,e.data.Data,"Profit")))}}function E1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,ol,v(1,2,e.data.Data,"ProfitWithTax")>0,v(2,5,e.data.Data,"ProfitWithTax")<0)),o(3),D("",g(5,11,v(4,8,e.data.Data,"ProfitWithTax"))," ")}}function M1(i,s){if(i&1&&(n(0,"td",70),E(1,b1,6,16,"span",53)(2,E1,6,16,"span",53),a()),i&2){let e=m(2);o(),c("ngIf",e.pageData.IgnoreTax),o(),c("ngIf",!e.pageData.IgnoreTax)}}function V1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Expense"))," ")}}function B1(i,s){if(i&1){let e=I();n(0,"div",25)(1,"table",26),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",27)(3,"tr")(4,"th",28),p(5,"No"),a(),n(6,"th",29),p(7," Outlet "),a(),E(8,y_,2,0,"th",30)(9,D_,2,0,"th",31)(10,v_,2,0,"th",32)(11,w_,2,0,"th",33)(12,T_,2,0,"th",34)(13,P_,2,0,"th",35)(14,F_,2,0,"th",36)(15,I_,2,0,"th",37)(16,b_,2,0,"th",38)(17,E_,3,0,"ng-container",39)(18,V_,4,7,"ng-container",39)(19,B_,2,0,"th",40)(20,O_,2,0,"th",41)(21,L_,2,1,"th",42)(22,R_,2,0,"th",43)(23,k_,2,0,"th",44)(24,W_,2,1,"th",42)(25,N_,2,0,"th",45),d(26,"sum"),a()(),n(27,"tbody"),E(28,s1,27,29,"tr",46),a(),n(29,"tfoot")(30,"tr",47),b(31,"td",48),E(32,c1,1,0,"td",49)(33,d1,1,0,"td",49),b(34,"td",50),E(35,u1,5,7,"td",43)(36,_1,4,6,"td",43)(37,g1,4,6,"td",43)(38,C1,4,7,"td",43)(39,f1,4,6,"td",43)(40,x1,4,6,"td",43)(41,h1,4,6,"td",43)(42,S1,4,6,"td",43),pt(43),E(44,v1,4,2,"td",43),d(45,"HideSumZero"),d(46,"HideSumZero"),mt(),E(47,w1,4,6,"td",43)(48,T1,4,6,"td",51)(49,P1,5,6,"td",52)(50,F1,3,8,"td",53)(51,I1,4,6,"td",54)(52,M1,3,2,"td",43)(53,V1,4,6,"td",43),d(54,"sum"),a()()()()}if(i&2){let e=m();o(8),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.column.Orders.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.column.AvgDaily.selected),o(),c("ngIf",e.column.Inventory.selected),o(),c("ngIf",e.column.TargetDaily.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.DailyTarget.selected),o(),c("ngIf",e.column.Tax.selected),o(),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&v(26,37,e.data.Data,"Expense")!=0),o(3),c("ngForOf",e.data.Data),o(4),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.showCompareColumn),o(2),c("ngIf",e.column.Orders.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.column.AvgDaily.selected),o(),c("ngIf",e.column.Inventory.selected),o(),c("ngIf",e.column.TargetDaily.selected),o(2),c("ngIf",v(45,40,e.data.Data,"AchievementWithTax")||v(46,43,e.data.Data,"Achievement")),o(3),c("ngIf",e.column.DailyTarget.selected),o(),c("ngIf",e.column.Tax.selected),o(),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&v(54,46,e.data.Data,"Expense")!=0)}}var Ca=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/OutletPerformanceDetail","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=h}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Quantity",responseProperty:"Quantity"},Gross:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Gross",responseProperty:"Gross"},Sales:{selected:!0},AvgDaily:{selected:!1,name:"Avg Daily Sales"},Inventory:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_InventoryValue",responseProperty:"InventoryValue"},TargetDaily:{selected:!1,name:"Target"},DailyTarget:{selected:!1,name:"Daily Target"},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:this.roleService.product.Cost,role:this.roleService.product.Cost},Profit:{selected:this.roleService.report.Profit&&this.roleService.product.Cost,role:this.roleService.report.Profit&&this.roleService.product.Cost}};isCompare=!1;showCompareColumn=!1;totalDays=1;selectetOutletGroup;isShowOutletTarget=!0;postInit(e){this.menuData.H=e.PageTitle;var r=new Date(this.pageData.Filter.To),t=new Date(this.pageData.Filter.From);this.totalDays=V.differentInDays(t,r)+1,this.initShowSalesTarget(),this.checkForAdvancedColumn(),this.onCompareData(),this.data.Data=this.data.Data.map(l=>(l.AverageDailySales=l.Sales/this.totalDays,l.BasketSize=l.Quantity/l.Count,l.Achievement=this.calculateAchievement(l.SalesTarget,l.Sales,this.totalDays),l.AchievementWithTax=this.calculateAchievement(l.SalesTarget,l.SalesWithTax,this.totalDays),l)),this.hideTaxRelatedColumn(e.Data)}hideTaxRelatedColumn(e){e.map(t=>t.Tax).reduce((t,l)=>t+l,0)==0&&(this.column.Tax.selected=!1,this.column.SalesNTax.selected=!1)}calculateAchievement(e=0,r=0,t=1){let l=0;return e!=0&&r!=0&&(l=r/(e*t)*100),l}initShowSalesTarget(){let e=this.data.Data.reduce((r,t)=>r+t.SalesTarget,0);this.isShowOutletTarget=e>0}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Count":return this.compare(t.Count,l.Count,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Gross":return this.compare(t.Gross,l.Gross,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,h);case"Expense":return this.compare(t.Expense,l.Expense,h);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,h);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,h);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,h);case"Achievement":return this.compare(t.Achievement,l.Achievement,h);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,h);case"AverageDailySales":return this.compare(t.AverageDailySales,l.AverageDailySales,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Performance Detail",exportTypes:[{ID:"ReportExport/OutletPerformanceDefault",Value:"Default",FileName:"Outlet Performance"},{ID:"ReportExport/OutletPerformanceDetail",Value:"Detail",FileName:"Outlet Performance Detail "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onSelectOutletGroup(e){this.pageData.Filter.OutletGroupID=e?.id,this.selectetOutletGroup=e}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data.map(e=>{let r=e;return r.ID=e.EntityID,r}),this.pageData.Filter,"ID",()=>{this.data.Data=this.data.Data.map(e=>(e.AverageDailySales=e.Sales/this.totalDays,e.BasketSize=e.Quantity/e.Count,e.Achievement=this.calculateAchievement(e.SalesTarget,e.Sales,this.totalDays),e.AchievementWithTax=this.calculateAchievement(e.SalesTarget,e.SalesWithTax,this.totalDays),e))})}get entityIDs(){return this.data&&Object.prototype.hasOwnProperty.call(this.data,"Data")&&this.data.Data.length>0?this.data.Data.map(e=>e.EntityID).join(","):null}convertToDateString(e){return(0,Do.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}convertFromDateString(e){return(0,Do.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-detail-outlet-performance"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],["IGNORE_TAX_ITEM",""],["INCREASE",""],["IGNORE_PROFIT_TAX",""],["IGNORE_TAX",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","multiple","ngModel"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["name","render-ProductType",3,"modelChange","model","options"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["mat-sort-header","Name",1,"align-left","freeze","header"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Gross","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","AverageDailySales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",4,"ngIf"],[4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before","class","text-end",4,"ngIf"],["arrowPosition","before","class","text-end",3,"mat-sort-header",4,"ngIf"],["class","text-end",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Expense","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end"],["mat-sort-header","AverageDailySales","arrowPosition","before",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",1,"text-end"],["matTooltip","Daily Target * Number of Days","matTooltipPosition","above","mat-sort-header","Target","arrowPosition","before",1,"text-end"],["mat-sort-header","Achievement","arrowPosition","before","class","text-end","matTooltipPosition","above","matTooltip","Achievement",4,"ngIf"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before",1,"text-end"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end"],["arrowPosition","before",1,"text-end",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end"],["mat-sort-header","Expense","arrowPosition","before",1,"text-end"],["style","width: 35px; text-align: center",4,"ngIf"],["style","width: 35px; text-align: center",3,"ngClass",4,"ngIf"],[2,"width","35px","text-align","center"],[2,"width","35px","text-align","center",3,"ngClass"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary",3,"queryParams"],[4,"ngIf","ngIfElse"],[3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary","target","_blank"],[1,"text-end","text-primary"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",5),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,h_,3,0,"a",6),n(3,"div",7)(4,"button",8),p(5," More "),a(),n(6,"ul",9)(7,"li")(8,"a",10),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",10),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",10),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,S_,26,16,"ng-template",null,0,O),a(),n(19,"content"),E(20,B1,55,49,"div",11),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(10,__)),o(3),c("routerLink",M(11,g_)),o(3),c("routerLink",M(12,C_)),o(6),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,L,R,ie,pe,ge,Te,Ce,Vi,se,ei,re,oe,Z,ne],styles:["table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{width:0!important}"]})};var O1=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],L1=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],R1=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],k1=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),rl=(i,s)=>({"text-danger":i,"text-success":s,"text-end":!0});function W1(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function N1(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(5,"div",12)(6,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(10,"h6"),p(11,"Compare with Prev Month"),a(),n(12,"radio-options",15),x("modelChange",function(t){u(e);let l=m();return f(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=m();o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),C("model",e.isCompare)}}function A1(i,s){i&1&&(n(0,"th",19),p(1," Prev "),a())}function G1(i,s){i&1&&(n(0,"th",20),p(1," Now "),a())}function H1(i,s){i&1&&(n(0,"th",27),p(1," \xB1 (%) "),a())}function Q1(i,s){i&1&&(n(0,"th",28),p(1," Cost "),a())}function Y1(i,s){if(i&1&&(n(0,"th",25),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function j1(i,s){if(i&1&&(n(0,"td",31),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function q1(i,s){if(i&1&&(n(0,"td",37),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,k1,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function U1(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,rl,e.IsNegative,e.IsPositive)),o(),D(" ",g(2,2,e.Increase)," ")}}function z1(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function K1(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function X1(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,j1,2,1,"td",31),S(4,q1,2,5,"td",37),n(5,"td",31),p(6),d(7,"number"),a(),n(8,"td",31),p(9),d(10,"quantityFraction"),a(),n(11,"td",31),p(12),d(13,"amountFraction"),a(),n(14,"td",31),p(15),d(16,"amountFraction"),a(),n(17,"td",32),p(18),d(19,"amountFraction"),a(),n(20,"td",33),p(21),d(22,"amountFraction"),a(),S(23,U1,3,7,"td",34),S(24,z1,3,3,"td",35),S(25,K1,3,3,"td",36),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(2),F(v(7,12,e.Count,".0-0")),o(3),F(g(10,15,e.Quantity)),o(3),F(g(13,17,e.Gross)),o(3),F(g(16,19,e.SalesNet)),o(3),D(" ",g(19,21,e.Tax)," "),o(3),D(" ",g(22,23,e.SalesWithTax)," "),o(2),y(r.showCompareColumn&&r.roleService.report.Profit?23:-1),o(),y(r.roleService.product.Cost?24:-1),o(),y(r.roleService.report.Profit?25:-1)}}function J1(i,s){i&1&&b(0,"td",30)}function Z1(i,s){i&1&&b(0,"td",30)}function $1(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,rl,e.comparation,e.comparation)),o(),D(" ",v(2,2,e.comparation,".0-0")," ")}}function eg(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data==null?null:e.data.Data,"Cost"))," ")}}function tg(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"sum"),d(3,"amountFraction"),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",e.pageData.IgnoreTax?g(3,4,v(2,1,e.data==null?null:e.data.Data,"Profit")):g(5,9,v(4,6,e.data==null?null:e.data.Data,"ProfitWithTax"))," ")}}function ig(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"Outlet"),a(),S(6,A1,2,0,"th",19),S(7,G1,2,0,"th",20),n(8,"th",21),p(9," Orders "),a(),n(10,"th",22),p(11," Quantity "),a(),n(12,"th",23),p(13," Gross "),a(),n(14,"th",24),p(15," Sales "),a(),n(16,"th",25),p(17," Tax "),a(),n(18,"th",26),p(19," Sales + Tax "),a(),S(20,H1,2,0,"th",27),S(21,Q1,2,0,"th",28),S(22,Y1,2,1,"th",25),a()(),n(23,"tbody"),G(24,X1,26,25,"tr",null,Y),a(),n(26,"tfoot")(27,"tr",29),S(28,J1,1,0,"td",30),S(29,Z1,1,0,"td",30),b(30,"td",30),n(31,"td",31),p(32),d(33,"sum"),d(34,"number"),a(),n(35,"td",31),p(36),d(37,"sum"),d(38,"quantityFraction"),a(),n(39,"td",31),p(40),d(41,"sum"),d(42,"amountFraction"),a(),n(43,"td",31),p(44),d(45,"sum"),d(46,"amountFraction"),a(),n(47,"td",32),p(48),d(49,"sum"),d(50,"amountFraction"),a(),n(51,"td",33)(52,"a"),p(53),d(54,"sum"),d(55,"amountFraction"),a()(),S(56,$1,3,8,"td",34),S(57,eg,4,6,"td",35),S(58,tg,6,11,"td",36),a()()()()}if(i&2){let e=m();o(6),y(e.showCompareColumn?6:-1),o(),y(e.showCompareColumn?7:-1),o(9),c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesTaxNet"),o(2),c("altpropcond",Ct(e.pageData.IgnoreTax)),o(2),y(e.showCompareColumn&&e.roleService.report.Profit?20:-1),o(),y(e.roleService.product.Cost?21:-1),o(),y(e.roleService.report.Profit?22:-1),o(2),H(e.data==null?null:e.data.Data),o(4),y(e.showCompareColumn?28:-1),o(),y(e.showCompareColumn?29:-1),o(3),D(" ",v(34,22,v(33,19,e.data==null?null:e.data.Data,"Count"),".0-0")," "),o(4),D(" ",g(38,28,v(37,25,e.data==null?null:e.data.Data,"Quantity"))," "),o(4),D(" ",g(42,33,v(41,30,e.data==null?null:e.data.Data,"Gross"))," "),o(4),D(" ",g(46,38,v(45,35,e.data==null?null:e.data.Data,"SalesNet"))," "),o(4),D(" ",g(50,43,v(49,40,e.data==null?null:e.data.Data,"Tax"))," "),o(5),F(g(55,48,v(54,45,e.data==null?null:e.data.Data,"SalesWithTax"))),o(3),y(e.showCompareColumn&&e.roleService.report.Profit?56:-1),o(),y(e.roleService.product.Cost?57:-1),o(),y(e.roleService.report.Profit?58:-1)}}var fa=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/OutletGroupPerformance","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}isCompare=!1;showCompareColumn=!1;postInit(e){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Name=t.Name?t.Name:"",l.Name=l.Name?l.Name:"",e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Count":return this.compare(t.Count,l.Count,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Gross":return this.compare(t.Gross,l.Gross,h);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,h);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"SalesTaxNet":return this.compare(t.SalesTaxNet,l.SalesTaxNet,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformance",Value:"Default",FileName:"Outlet Group Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-group-performance"]],standalone:!1,features:[W],decls:21,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Compare",3,"modelChange","model"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px"],["arrowPosition","before",1,"text-end",2,"width","120px",3,"mat-sort-header"],["mat-sort-header","SalesWithTax","altprop","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px",3,"altpropcond"],[1,"text-end",2,"width","60px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","100px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,W1,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,N1,13,5,"ng-template",null,0,O),a(),n(19,"content"),S(20,ig,59,50,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(9,O1)),o(3),c("routerLink",M(10,L1)),o(3),c("routerLink",M(11,R1)),o(6),y(t.data?20:-1))},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,se,re,Z,ne],encapsulation:2})};var ng=()=>["/menu/Reports/Sales_Report/Standard/Compare"],ag=i=>({"flex-right":i});function og(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function rg(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Sales Person"),a(),n(3,"sales-person-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function lg(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=s.$index;c("arrowPosition",Ct(r?"before":"after"))("mat-sort-header",e)("ngClass",X(5,ag,e!="Outlet")),o(),D(" ",e)}}function pg(i,s){if(i&1&&(n(0,"div",14),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(r[e])}}function mg(i,s){if(i&1&&(n(0,"div",15),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),D("",g(2,1,r[e])," ")}}function sg(i,s){if(i&1&&(n(0,"td"),S(1,pg,2,1,"div",14),S(2,mg,3,3,"div",15),a()),i&2){let e=s.$implicit;o(),y(e=="Outlet"?1:-1),o(),y(e!="Outlet"?2:-1)}}function cg(i,s){if(i&1&&(n(0,"tr"),G(1,sg,3,2,"td",null,Y),a()),i&2){let e=s.$implicit,r=m(2);o(),H(r.getKeys(e))}}function dg(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),F(g(2,1,e))}}function ug(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",16)(2,"td"),p(3,"Total : "),a(),G(4,dg,3,3,"td",17,Y),a()()),i&2){let e=m(2);o(4),H(e.data.DataFooter)}}function _g(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",11),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",12)(3,"tr"),G(4,lg,2,7,"th",13,Y),a()(),n(6,"tbody"),G(7,cg,3,0,"tr",null,Y),a(),S(9,ug,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var xa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/MonthlyOutletPerformance","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}Years=V.GenerateYears(new Date().getFullYear(),11,!0);getKeys(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T])return this.compare(t[this.data.Dataheader[T]],l[this.data.Dataheader[T]],h)})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Monthly Comparison",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformance",Value:"Default",FileName:"Outlet Monthly Comparison"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-monthly-performance"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Range Compare",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"table-light","sticky-top-thead"],[3,"mat-sort-header","arrowPosition","ngClass"],[2,"color","black"],[2,"color","black","text-align","right"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,og,3,0,"a",2),n(3,"a",3),p(4," View Range"),a()(),n(5,"filters"),E(6,rg,10,5,"ng-template",null,0,O),a(),n(8,"content"),S(9,_g,10,1,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,ng)),o(6),y(t.data?9:-1))},dependencies:[A,tt,Q,$,L,R,ie,pe,ge,ze,Z],encapsulation:2})};var gg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],Cg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],fg=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],xg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],hg=(i,s)=>({From:i,To:s}),Sg=()=>["/menu/Contacts/Contact/Sales_Person/Info"],yg=i=>({ID:i}),Dg=()=>["/menu/Reports/Sales_Report/Standard/Detail"],vg=(i,s,e,r,t)=>({SalesPersonID:i,From:s,To:e,ListIDs:r,IncludeComplementary:t}),wg=(i,s,e,r)=>({ID:i,from:s,to:e,IncludeComplementary:r}),Tg=i=>({SalesID:i});function Pg(i,s){if(i&1){let e=I();n(0,"button",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function Fg(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person Group"),a(),n(6,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesGroupID,t)||(l.pageData.Filter.SalesGroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",16)(12,"datepicker",17),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Sales Order Tag"),a(),n(18,"ng-select",19),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(19,"h6"),p(20,"Include Zero Amount Transaction"),a(),n(21,"radio-options",20),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.IncludeZeroAmountTransaction,t)||(l.pageData.Filter.IncludeZeroAmountTransaction=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData==null||e.pageData.List==null?null:e.pageData.List.Entities),o(3),C("ngModel",e.pageData.Filter.SalesGroupID),c("items",e.pageData.List==null?null:e.pageData.List.SalesGroup),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.DeliveryID),c("items",e.pageData.List==null?null:e.pageData.List.Deliveries),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.List==null?null:e.pageData.List.Types),o(3),C("model",e.pageData.Filter.IncludeZeroAmountTransaction)}}function Ig(i,s){i&1&&(n(0,"th",45),p(1," Sales Group "),a())}function bg(i,s){i&1&&(n(0,"th",46),p(1," Orders "),a())}function Eg(i,s){i&1&&(n(0,"th",47),p(1," Sales "),a())}function Mg(i,s){i&1&&(pt(0),n(1,"th",48),p(2," Avg. Daily "),a(),mt())}function Vg(i,s){i&1&&(n(0,"th",49),p(1," Tax "),a())}function Bg(i,s){i&1&&(n(0,"th",50),p(1," Sales + Tax "),a())}function Og(i,s){i&1&&(n(0,"th",51),p(1," Cost "),a())}function Lg(i,s){i&1&&(n(0,"th",52),p(1," Profit "),a())}function Rg(i,s){i&1&&(n(0,"th",55),p(1," Target "),a())}function kg(i,s){i&1&&(n(0,"th",56),p(1," Ach(%) "),a())}function Wg(i,s){if(i&1&&(pt(0),E(1,Rg,2,0,"th",53)(2,kg,2,0,"th",54),mt()),i&2){let e=m(2);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function Ng(i,s){i&1&&(n(0,"th",57),p(1," Quantity "),a())}function Ag(i,s){i&1&&(n(0,"th",58),p(1," Basket Size "),a())}function Gg(i,s){i&1&&(n(0,"th",59),p(1," Product Commission "),a())}function Hg(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Group)}}function Qg(i,s){if(i&1&&(n(0,"td",62)(1,"a",61),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(12,Dg))("queryParams",cn(13,vg,e.ID,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.ListIDs,r.pageData.Filter.IncludeComplementary)),o(3),F(v(5,9,e.Orders,".0-0"))}}function Yg(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function jg(i,s){if(i&1&&(pt(0),n(1,"td",63),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m().$implicit;o(2),D(" ",g(3,1,e.AvgDailySales)," ")}}function qg(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Ug(i,s){if(i&1&&(n(0,"td",62)(1,"a",65),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",Ut(10,wg,e.ID,v(2,2,r.pageData.Filter.From,"ddMMyyyy"),v(3,5,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.IncludeComplementary)),o(3),D(" ",g(5,8,e.SalesNTax)," ")}}function zg(i,s){if(i&1&&(n(0,"td",66),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Kg(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Profit)," ")}}function Xg(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e.Target)," ")}}function Jg(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e.Achievement)," ")}}function Zg(i,s){if(i&1&&(pt(0),E(1,Xg,3,3,"td",44)(2,Jg,3,3,"td",44),mt()),i&2){let e=m(3);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function $g(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Quantity,"1.0-2")," ")}}function eC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.BasketSize,"1.0-2")," ")}}function tC(i,s){if(i&1&&(n(0,"td",63)(1,"span")(2,"a",68),p(3),d(4,"amountFraction"),a()()()),i&2){let e=m().$implicit;o(2),c("queryParams",X(4,Tg,e.ID)),o(),F(g(4,2,e.Commission))}}function iC(i,s){if(i&1&&(n(0,"tr")(1,"td",60)(2,"a",61),p(3),a()(),E(4,Hg,2,1,"td",9)(5,Qg,6,19,"td",40)(6,Yg,3,3,"td",41),d(7,"HideSumZero"),E(8,jg,4,3,"ng-container",9)(9,qg,3,3,"td",42),d(10,"HideSumZero"),E(11,Ug,6,15,"td",40)(12,zg,3,3,"td",43)(13,Kg,3,3,"td",44)(14,Zg,3,2,"ng-container",9)(15,$g,3,4,"td",41)(16,eC,3,4,"td",41)(17,tC,5,6,"td",41),a()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(21,Sg))("queryParams",X(22,yg,e.ID)),o(),F(e.Name),o(),c("ngIf",r.data.Show),o(),c("ngIf",r.column.Orders.selected),o(),c("ngIf",v(7,15,r.data.List,"Tax")&&r.column.Sales.selected),o(2),c("ngIf",r.isShowOutletTarget),o(),c("ngIf",v(10,18,r.data.List,"Tax")&&r.column.Tax.selected),o(2),c("ngIf",r.column.SalesNTax.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.roleService.report.Profit&&r.column.Profit.selected),o(),c("ngIf",r.isShowOutletTarget),o(),c("ngIf",r.column.QTY.selected),o(),c("ngIf",r.column.QTY.selected),o(),c("ngIf",r.column.Commission.selected&&r.roleService.product.CommissionView)}}function nC(i,s){i&1&&b(0,"td")}function aC(i,s){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Orders"),".0-0")," ")}}function oC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Sales"))," ")}}function rC(i,s){if(i&1&&(pt(0),n(1,"td",63),p(2),d(3,"sum"),d(4,"amountFraction"),a(),mt()),i&2){let e=m(2);o(2),D(" ",g(4,4,v(3,1,e.data.List,"AvgDailySales"))," ")}}function lC(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Tax"),e.pageData.FractionDigit)," ")}}function pC(i,s){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"SalesNTax"))," ")}}function mC(i,s){if(i&1&&(n(0,"td",66),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Cost"))," ")}}function sC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Profit"))," ")}}function cC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.data.List,"Target"))," ")}}function dC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(4,7,v(2,1,e.data.List,"Sales")/v(3,4,e.data.List,"Target")*100)," ")}}function uC(i,s){if(i&1&&(pt(0),E(1,cC,4,6,"td",44)(2,dC,5,9,"td",44),mt()),i&2){let e=m(2);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function _C(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Quantity"),"1.0-2")," ")}}function gC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"BasketSize"),"1.0-2")," ")}}function CC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Commission"))," ")}}function fC(i,s){if(i&1){let e=I();n(0,"content")(1,"div",21)(2,"div",22)(3,"table",23),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",24)(5,"tr",25)(6,"th",26),p(7,"Sales Person"),a(),E(8,Ig,2,0,"th",27)(9,bg,2,0,"th",28)(10,Eg,2,0,"th",29),d(11,"HideSumZero"),E(12,Mg,3,0,"ng-container",9)(13,Vg,2,0,"th",30),d(14,"HideSumZero"),E(15,Bg,2,0,"th",31)(16,Og,2,0,"th",32)(17,Lg,2,0,"th",33)(18,Wg,3,2,"ng-container",9)(19,Ng,2,0,"th",34)(20,Ag,2,0,"th",35)(21,Gg,2,0,"th",36),a()(),n(22,"tbody"),E(23,iC,18,24,"tr",37),a(),n(24,"tfoot")(25,"tr",38),S(26,nC,1,0,"td"),n(27,"td",39),p(28,"Total:"),a(),E(29,aC,4,7,"td",40)(30,oC,4,6,"td",41),d(31,"HideSumZero"),E(32,rC,5,6,"ng-container",9)(33,lC,4,7,"td",42),d(34,"HideSumZero"),E(35,pC,4,6,"td",40)(36,mC,4,6,"td",43)(37,sC,4,6,"td",44)(38,uC,3,2,"ng-container",9)(39,_C,4,7,"td",41)(40,gC,4,7,"td",41)(41,CC,4,6,"td",41),a()()()()()()}if(i&2){let e=m();o(8),c("ngIf",e.data.Show),o(),c("ngIf",e.column.Orders.selected),o(),c("ngIf",v(11,25,e.data.List,"Tax")&&e.column.Sales.selected),o(2),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",v(14,28,e.data.List,"Tax")&&e.column.Tax.selected),o(2),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.column.Commission.selected),o(2),c("ngForOf",e.data.List),o(3),y(e.data.Show?26:-1),o(3),c("ngIf",e.column.Orders.selected),o(),c("ngIf",v(31,31,e.data.List,"Tax")&&e.column.Sales.selected),o(2),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",v(34,34,e.data.List,"Tax")&&e.column.Tax.selected),o(2),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Commission.selected&&e.roleService.product.CommissionView)}}var ha=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/SalesPerson","ReportLoader/SalesPerson");this.httpService=r;this.csvConverter=t;this.reportFilterService=l;this.matDialog=h}isShowCommission=!1;roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},Sales:{selected:!0},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:!0,role:this.roleService.product.Cost},Target:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/SalesPersonOrderQuantity",responseProperty:"Quantity"},Commission:{selected:!1,advanced:!0,endpoint:"/api/Report/SalesPersonOrderCommission",responseProperty:"Commission",role:this.roleService.product.CommissionView},Profit:{selected:!0,role:this.roleService.report.Profit}};isShowOutletTarget=!0;postInit(){this.menuData.H=this.data.PageTitle,this.isShowCommission=!1,this.initShowSalesTarget();let e=this.getTotalDays();this.data.List=this.data.List.map(r=>(r.AvgDailySales=r.Sales/e,r)),this.checkForAdvancedColumn()}initShowSalesTarget(){let e=this.data?.List?.reduce((r,t)=>r+t.Target,0);this.isShowOutletTarget=e>0}getTotalDays(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return V.differentInDays(e,r)+1}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.Group=t.Group==null?"":t.Group,l.Group=l.Group==null?"":l.Group,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Group":return this.compare(t.Group.toLocaleLowerCase(),l.Group.toLocaleLowerCase(),h);case"Orders":return this.compare(t.Orders,l.Orders,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,h);case"Target":return this.compare(t.Target,l.Target,h);case"Achievement":return this.compare(t.Achievement,l.Achievement,h);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,h);case"AvgDailySales":return this.compare(t.AvgDailySales,l.AvgDailySales,h);case"Commission":return this.compare(t.Commission,l.Commission,h);default:return 0}})}getCommission(){this.httpService.post("/api/Report/SalesPersonComission",this.pageData.Filter).pipe(oi(e=>e?.List)).subscribe(e=>{let r=0;this.data.List=this.data.List.map(t=>(r=e.findIndex(l=>l.SalesPersonID===t.ID),r!=-1&&(t.Commission=e[r].Commission,t.Quantity=e[r].Quantity),t)),this.isShowCommission=!0})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Sales Person",exportTypes:[{ID:"ReportExport/SalesPerson",Value:"Default",FileName:"Sales by Sales Person"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.List,this.pageData.Filter,"ID",()=>{this.data.List=this.data.List.map(e=>nt(et({},e),{BasketSize:e.Quantity/e.Orders}))})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(rr),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-person"]],standalone:!1,features:[W],decls:26,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"d-flex"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Person Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Transaction",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left"],["mat-sort-header","Group","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Orders","style","width: 80px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","style","width: 90px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesNTax","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Cost","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Profit","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","style","width: 100px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","style","width: 110px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Commission","style","width: 200px","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column","text-end"],["class","text-end text-primary",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["mat-sort-header","Group","arrowPosition","before",1,"text-end"],["mat-sort-header","Orders","arrowPosition","before",1,"text-end",2,"width","80px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","AvgDailySales","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Target","style","width: 120px","arrowPosition","before","class","align-l",4,"ngIf"],["mat-sort-header","Achievement","style","width: 60px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Target","arrowPosition","before",1,"align-l",2,"width","120px"],["mat-sort-header","Achievement","arrowPosition","before",1,"text-end",2,"width","60px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end",2,"width","110px"],["mat-sort-header","Commission","arrowPosition","before",1,"text-end",2,"width","200px"],[1,"text-primary"],[3,"routerLink","queryParams"],[1,"text-end","text-primary"],[1,"text-end"],[1,"text-end","text-warning"],["routerLink","Commission_Report",3,"queryParams"],[1,"text-end","text-danger"],[1,"text-end","text-success"],["routerLink","/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions")(2,"div",2),E(3,Pg,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"By Outlet"),a()(),n(11,"li")(12,"a",7),p(13,"By Employee"),a()(),n(14,"li")(15,"a",7),p(16,"By Sales Group"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),E(23,Fg,22,13,"ng-template",null,0,O),a(),E(25,fC,42,37,"content",9),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(3),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(18,gg)),o(3),c("routerLink",M(19,Cg)),o(3),c("routerLink",M(20,fg)),o(3),c("routerLink",M(21,xg))("queryParams",fe(22,hg,v(19,12,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),v(20,15,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,L,R,ie,pe,ge,Te,U,se,ei,re,oe,Z],encapsulation:2})};var xC=()=>["/menu/Reports/Sales_Report/Standard/Person"],hC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],SC=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],yC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],DC=(i,s)=>({From:i,To:s}),ll=i=>({ID:i}),pl=(i,s,e,r)=>({SalesID:i,From:s,To:e,VariantName:r});function vC(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function wC(i,s){if(i&1){let e=I();n(0,"div",21)(1,"div",22)(2,"datepicker",23),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(3,"div",24)(4,"app-timepicker",25),x("timeChange",function(t){u(e);let l=m(3);return f(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=m(3);return _(l.timeFromChange(t))}),a()()(),n(5,"div",26)(6,"div",22)(7,"datepicker",27),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(8,"div",24)(9,"app-timepicker",25),x("timeChange",function(t){u(e);let l=m(3);return f(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=m(3);return _(l.timeToChange(t))}),a()()()}if(i&2){let e=m(3);o(2),c("width",100),C("date",e.pageData.Filter.From),o(2),C("time",e.timeFrom),o(3),c("width",100),C("date",e.pageData.Filter.To),o(2),C("time",e.timeTo)}}function TC(i,s){if(i&1){let e=I();n(0,"div")(1,"datepicker",28),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(3);return _(t.onFilterFromDate())}),a()(),n(2,"div",29)(3,"datepicker",30),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(3);return _(t.onFilterToDate())}),a()()}if(i&2){let e=m(3);o(),C("date",e.pageData.Filter.From),c("width",100),o(2),C("date",e.pageData.Filter.To),c("width",100)}}function PC(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",19),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ID,t)||(l.pageData.Filter.ID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),S(9,wC,10,6)(10,TC,4,4),n(11,"h6"),p(12,"Filter Invoice By"),a(),n(13,"radio-options",20),x("modelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.isCreated,t)||(l.pageData.Filter.isCreated=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.ID),o(3),y(e.pageData.Filter.isCreated?9:10),o(4),c("options",e.filterInvoiceBy),C("model",e.pageData.Filter.isCreated)}}function FC(i,s){i&1&&b(0,"app-empty-state")}function IC(i,s){i&1&&(n(0,"th",36),p(1," Commission "),a())}function bC(i,s){i&1&&(n(0,"th",36),p(1," Total Commission "),a())}function EC(i,s){if(i&1&&(n(0,"thead",31)(1,"tr",32)(2,"th",33)(3,"h2")(4,"a",34),p(5),a()()()(),n(6,"tr")(7,"th",35),p(8,"Product"),a(),n(9,"th",36),p(10,"Qty"),a(),n(11,"th",36),p(12,"Sales"),a(),S(13,IC,2,0,"th",36),S(14,bC,2,0,"th",36),a()()),i&2){let e=m().$implicit,r=m(2);o(4),c("queryParams",X(5,ll,e.ID)),o(),$t("",e.Name," - ",e.Code),o(8),y(r.roleService.product.CommissionView?13:-1),o(),y(r.roleService.product.CommissionView?14:-1)}}function MC(i,s){if(i&1&&(n(0,"div")(1,"a",40),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m(2).$implicit,r=m(4);ji("text-decoration-line-through",e.VariantCommission&&e.GroupCommission)("text-danger",e.VariantCommission&&e.GroupCommission),o(),c("queryParams",Ut(14,pl,e.SalesID,v(2,6,r.pageData.Filter.From,"ddMMyyyy"),v(3,9,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),F(g(5,12,e.VariantCommission))}}function VC(i,s){if(i&1&&(n(0,"div")(1,"a",41),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m(2).$implicit,r=m(4);o(),c("queryParams",Ut(10,pl,e.SalesID,v(2,2,r.pageData.Filter.From,"ddMMyyyy"),v(3,5,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),F(g(5,8,e.GroupCommission))}}function BC(i,s){if(i&1&&(n(0,"td",38),S(1,MC,6,19,"div",39),S(2,VC,6,15,"div"),a()),i&2){let e=m().$implicit;o(),y(e.VariantCommission||!e.GroupCommission?1:-1),o(),y(e.GroupCommission?2:-1)}}function OC(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalCommission)," ")}}function LC(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",37),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",38),p(7),d(8,"quantityFraction"),a(),n(9,"td",38),p(10),d(11,"amountFraction"),a(),S(12,BC,3,2,"td",38),S(13,OC,3,3,"td",38),a()),i&2){let e=s.$implicit,r=m(4);o(2),c("queryParams",X(11,ll,e.VariantID)),o(),F(e.Name),o(2),F(e.Code),o(2),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.NettSales)),o(2),y(r.roleService.product.CommissionView?12:-1),o(),y(r.roleService.product.CommissionView?13:-1)}}function RC(i,s){if(i&1&&(n(0,"tbody"),G(1,LC,14,13,"tr",null,Y),a()),i&2){let e=m().$implicit;o(),H(e.Item)}}function kC(i,s){if(i&1&&(n(0,"div"),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),n(5,"span",43),p(6),d(7,"sum"),d(8,"amountFraction"),a()()),i&2){let e=m(3).$implicit;ji("text-decoration-line-through",v(1,5,e.Item,"VariantCommission")&&v(2,8,e.Item,"GroupCommission"))("text-danger",v(3,11,e.Item,"VariantCommission")&&v(4,14,e.Item,"GroupCommission")),o(6),F(g(8,20,v(7,17,e.Item,"VariantCommission")))}}function WC(i,s){if(i&1&&(n(0,"div"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3).$implicit;o(),D(" ",g(3,4,v(2,1,e.Item,"GroupCommission"))," ")}}function NC(i,s){if(i&1&&(n(0,"td",38),S(1,kC,9,22,"div",39),d(2,"sum"),d(3,"sum"),S(4,WC,4,6,"div"),d(5,"sum"),a()),i&2){let e=m(2).$implicit;o(),y(v(2,2,e.Item,"VariantCommission")||!v(3,5,e.Item,"GroupCommission")?1:-1),o(3),y(v(5,8,e.Item,"GroupCommission")?4:-1)}}function AC(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(3,4,v(2,1,e.Item,"TotalCommission"))," ")}}function GC(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",42)(2,"td"),p(3,"Total"),a(),n(4,"td",38),p(5),d(6,"sum"),d(7,"quantityFraction"),a(),n(8,"td",38),p(9),d(10,"sum"),d(11,"amountFraction"),a(),S(12,NC,6,11,"td",38),S(13,AC,4,6,"td",38),a()()),i&2){let e=m().$implicit,r=m(2);o(5),D(" ",g(7,7,v(6,4,e.Item,"Quantity"))," "),o(4),D(" ",g(11,12,v(10,9,e.Item,"NettSales"))," "),o(3),y(r.roleService.product.CommissionView?12:-1),o(),y(r.roleService.product.CommissionView?13:-1)}}function HC(i,s){if(i&1&&(n(0,"table",14),S(1,EC,15,7,"thead",31),S(2,RC,3,0,"tbody"),S(3,GC,14,14,"tfoot"),a()),i&2){let e=s.$implicit;o(),y(e.Name?1:-1),o(),y(e.Name?2:-1),o(),y(e.Name?3:-1)}}function QC(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",3)(3,"a",4),P("click",function(){u(e);let t=m();return _(t.print())}),b(4,"i",5),p(5," Print"),a(),S(6,vC,3,0,"a",6),n(7,"div",7)(8,"button",8),p(9," More "),a(),n(10,"ul",9)(11,"li")(12,"a",10),p(13,"Summary"),a()(),n(14,"li")(15,"a",10),p(16,"By Outlet"),a()(),n(17,"li")(18,"a",10),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",11),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),E(26,PC,14,8,"ng-template",null,0,O),a(),n(28,"content")(29,"div",12),S(30,FC,1,0,"app-empty-state"),n(31,"div",13),G(32,HC,4,3,"table",14,Y),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(6),y(e.roleService!=null&&e.roleService.global.Export?6:-1),o(6),c("routerLink",M(17,xC)),o(3),c("routerLink",M(18,hC)),o(3),c("routerLink",M(19,SC)),o(3),c("routerLink",M(20,yC))("queryParams",fe(21,DC,v(22,11,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),v(23,14,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(9),y((e.data==null||e.data.Data==null?null:e.data.Data.length)==0?30:-1),o(2),H(e.data.Data)}}var Sa=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/GetSalesPersonCommissionGroupByProduct","ReportLoader/SalesCommissionLoader",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.activatedRoute=T}filterInvoiceBy=[{Key:!1,Value:"Date"},{Key:!0,Value:"Created"}];timeFrom;timeTo;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(K,{data:{title:"Employee Commission Report",exportTypes:[{ID:"ReportExport/SalesPersonGroupByProduct",Value:"Default",FileName:"Employee Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To),this.onFilterToDate()}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From),this.onFilterFromDate()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-commision-report"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],[1,"btn","btn-outline-secondary","ms-3"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","mb-10"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","Is Created",3,"modelChange","options","model"],[1,"w-100","d-flex","mt-2","align-items-center"],[1,"w-100"],["name","From","appearance","outline",3,"dateChange","width","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","mt-4"],["name","To","appearance","outline",3,"dateChange","width","date"],["name","From","appearance","outline",3,"dateChange","date","width"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date","width"],[1,"thead-light"],[2,"border","none !important"],["colspan","5",1,"text-center","bg-white","border-none"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],[2,"width","200px"],[1,"text-end",2,"width","100px"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"text-end"],[3,"text-decoration-line-through","text-danger"],["routerLink","Commission_Report_Detail","matTooltipPosition","above","matTooltip","variant commission",3,"queryParams"],["routerLink","Commission_Report_Detail",3,"queryParams"],[1,"table-footer","fw-bold"],["matTooltipPosition","above","matTooltip","Total variant commission"]],template:function(r,t){r&1&&S(0,QC,34,24,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,J,L,R,ie,Te,Mi,U,ze,kr,se,oe,Z,ne],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}} datepicker.timepicker>mat-form-field{width:140px!important}"]})};var YC=()=>["/menu/Reports/Sales_Report/Standard/Person"],jC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],qC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],UC=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],zC=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],vo=i=>({ID:i}),KC=()=>["/menu/Products/Catalog/Variants/Info"],XC=()=>["/menu/Contacts/Contact/Sales_Person/Info"];function JC(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function ZC(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Outlets),o(3),C("ngModel",e.pageData.Filter.SalesID),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function $C(i,s){i&1&&(n(0,"th",34),p(1,"Date"),a())}function ef(i,s){i&1&&(n(0,"th",34),p(1,"Outlet"),a())}function tf(i,s){i&1&&(n(0,"th",34),p(1," Number "),a())}function nf(i,s){i&1&&(n(0,"th"),p(1,"Product"),a())}function af(i,s){i&1&&(n(0,"th"),p(1,"Sales Person"),a())}function of(i,s){i&1&&(n(0,"th",35),p(1," Quantity "),a())}function rf(i,s){i&1&&(n(0,"th",35),p(1," Commission "),a())}function lf(i,s){i&1&&(n(0,"th",35),p(1," Total Commission "),a())}function pf(i,s){i&1&&(n(0,"th",35),p(1," Cost "),a())}function mf(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Date,"dd MMM yyyy")," ")}}function sf(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.EntityName)}}function cf(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,zC))("queryParams",X(4,vo,e.ID)),o(),F(e.Number)}}function df(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,KC))("queryParams",X(4,vo,e.VariantID)),o(),F(e.VariantName)}}function uf(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,XC))("queryParams",X(4,vo,e.SalesID)),o(),F(e.SalesName)}}function _f(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function gf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.SalesCommission,r.pageData.FractionDigit)," ")}}function Cf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.Total,r.pageData.FractionDigit)," ")}}function ff(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.UnitCost,r.pageData.FractionDigit)," ")}}function xf(i,s){if(i&1&&(n(0,"tr"),E(1,mf,3,4,"td",21)(2,sf,2,1,"td",21)(3,cf,3,6,"td",21)(4,df,3,6,"td",21)(5,uf,3,6,"td",21)(6,_f,3,3,"td",27)(7,gf,3,4,"td",27)(8,Cf,3,4,"td",27)(9,ff,3,4,"td",28),a()),i&2){let e=m(2);o(),c("ngIf",e.columns.Date.selected),o(),c("ngIf",e.columns.Outlet.selected),o(),c("ngIf",e.columns.InvoiceNumber.selected),o(),c("ngIf",e.columns.VariantName.selected),o(),c("ngIf",e.columns.SalesName.selected),o(),c("ngIf",e.columns.Quantity.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected)}}function hf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"SalesCommission"),e.pageData.FractionDigit)," ")}}function Sf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function yf(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"UnitCost"),e.pageData.FractionDigit)," ")}}function Df(i,s){if(i&1){let e=I();n(0,"span",38),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail"))}),n(1,"i",39),p(2,"?"),a()()}}function vf(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"quantityFraction"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function wf(i,s){if(i&1){let e=I();n(0,"div",40)(1,"a",41),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(2,"i",42),p(3," Next"),a(),n(4,"a",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail",!0))}),b(5,"i",44),p(6," Show All"),a()()}}function Tf(i,s){if(i&1&&(n(0,"div",16)(1,"table",17)(2,"thead",18)(3,"tr",19),E(4,$C,2,0,"th",20)(5,ef,2,0,"th",20)(6,tf,2,0,"th",20)(7,nf,2,0,"th",21)(8,af,2,0,"th",21)(9,of,2,0,"th",22)(10,rf,2,0,"th",22)(11,lf,2,0,"th",22)(12,pf,2,0,"th",22),a()(),n(13,"tbody"),E(14,xf,10,9,"tr",23),a(),n(15,"tfoot")(16,"tr",24)(17,"td",25),p(18,"Total:"),a(),n(19,"td",26),p(20),d(21,"sum"),d(22,"number"),a(),E(23,hf,4,7,"td",27)(24,Sf,4,7,"td",27)(25,yf,4,7,"td",28),a()()(),n(26,"div",29)(27,"div",30)(28,"div",31),p(29),d(30,"number"),E(31,Df,3,0,"span",32)(32,vf,3,3,"span",21),p(33),a()(),E(34,wf,7,0,"div",33),a()()),i&2){let e=m();o(4),c("ngIf",e.columns.Date.selected),o(),c("ngIf",e.columns.Outlet.selected),o(),c("ngIf",e.columns.InvoiceNumber.selected),o(),c("ngIf",e.columns.VariantName.selected),o(),c("ngIf",e.columns.SalesName.selected),o(),c("ngIf",e.columns.Quantity.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected),o(2),c("ngForOf",e.infiniteList),o(6),D(" ",g(22,22,v(21,19,e.data.Data,"Quantity"))," "),o(3),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected),o(4),D(" Showing 1 - ",g(30,24,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var ya=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/GetSalesPersonCommissionDetail","ReportLoader/SalesCommissionDetailLoader",null,h);this.httpService=r;this.csvConverter=t;this.datePipe=l;this.activatedRoute=h;this.matDialog=T}roleService=Pe(j);columnService=Pe(gt);datasource=[];columns={Date:{selected:!0,name:"Date",width:null,class:"w-100",visible:!0},Outlet:{selected:!0,name:"Outlet",width:null,class:"w-100",visible:!0},InvoiceNumber:{selected:!0,name:"Number",width:null,class:"w-100",visible:!0},VariantName:{selected:!0,name:"Name",width:null,class:"w-100",visible:!0},SalesName:{selected:!0,name:"Sales Person",width:null,class:"w-100",visible:!0},Quantity:{selected:!0,name:"Qty",width:null,class:"w-100",visible:!0},Commission:{selected:!0,name:"Commission",width:null,class:"w-100",visible:!0,role:this.roleService.product.CommissionView},TotalCommission:{selected:!0,name:"Total Commission",width:null,class:"w-100",visible:!0,role:this.roleService.product.CommissionView},UnitCost:{selected:!1,name:"Cost",width:null,class:"w-100",visible:!1,role:this.roleService.product.Cost}};onColumnSelectedChange(e){let r=this.columns[e.key];r&&(r.visible=!e.value.visible)}get displayedColumns(){return Object.keys(this.columns).filter(e=>this.columns[e].selected)}transformDate(e,r){return this.datePipe.transform(e,r)}getFilterData(e){this.infiniteList=this.originalData.filter(r=>Object.keys(r).some(t=>r[t]==null?!1:r[t].toString().toLowerCase().includes(e.toLowerCase())))}openExportModal(){this.matDialog.open(K,{data:{title:"Commission Report Detail",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionDetail",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountSalesPersonCommissionDetail",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(Ne),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-commision-report-detail"]],standalone:!1,features:[W],decls:24,vars:15,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 120px",4,"ngIf"],[4,"ngIf"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end"],[1,"text-end","text-success"],["class","text-end text-success",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],[2,"width","120px"],[1,"text-end",2,"width","120px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.VariantName,T)||(t.pageData.Filter.VariantName=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())})("textChange",function(T){return u(l),_(t.getFilterData(T))}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,JC,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9,"Summary"),a()(),n(10,"li")(11,"a",6),p(12,"By Outlet"),a()(),n(13,"li")(14,"a",6),p(15,"By Employee"),a()(),n(16,"li")(17,"a",6),p(18,"By Sales Group"),a()()()()(),n(19,"filters"),E(20,ZC,13,7,"ng-template",null,0,O),a(),n(22,"content"),E(23,Tf,35,26,"div",7),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.VariantName),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.columns),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(11,YC)),o(3),c("routerLink",M(12,jC)),o(3),c("routerLink",M(13,qC)),o(3),c("routerLink",M(14,UC)),o(6),c("ngIf",t.infiniteList&&t.data&&t.data.Data))},dependencies:[A,st,it,Q,J,L,R,ie,U,ze,se,re,oe,ne],encapsulation:2})};var ml=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],sl=i=>({ID:i});function Pf(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Ff(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Supplier"),a(),n(10,"autocompleteV2",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",10)(16,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Currency"),a(),n(19,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(20,"h6"),p(21,"Sort"),a(),n(22,"radio-options",13),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.IsDesc,t)||(l.pageData.Filter.IsDesc=t),_(t)}),a(),n(23,"h6"),p(24,"Purchase Order Tag"),a(),n(25,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Note Visible"),a(),n(28,"radio-options",15),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(29,"h6"),p(30,"Order By"),a(),n(31,"radio-options",16),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(4),c("isFloatingLabel",!1),C("date",e.pageData.Filter.From),o(2),c("isFloatingLabel",!1),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),C("model",e.pageData.Filter.IsDesc),c("options",e.AscDscRadio),o(3),c("items",e.pageData.Options.Tags),C("ngModel",e.pageData.Filter.TagID),o(3),C("model",e.pageData.Filter.NoteVisible),o(3),C("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function If(i,s){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=m(2);o(),D(" Cost(",e.data.Symbol,") ")}}function bf(i,s){i&1&&(n(0,"th",27),p(1," Disc "),a())}function Ef(i,s){if(i&1&&(n(0,"th",28),p(1),a()),i&2){let e=m(2);o(),D(" Total(",e.data.Symbol,") ")}}function Mf(i,s){i&1&&(n(0,"span"),p(1," /"),a())}function Vf(i,s){if(i&1&&(n(0,"a",33)(1,"span",42),p(2),a()()),i&2){let e=m().$implicit;c("routerLink",M(3,ml))("queryParams",X(4,sl,e.Data.ID)),o(2),F("#"+e.PONumber)}}function Bf(i,s){if(i&1&&(n(0,"th",50),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitPrice)," ")}}function Of(i,s){if(i&1&&(n(0,"div",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e==null?null:e.DiscountAmount)," ")}}function Lf(i,s){if(i&1&&(n(0,"th",51),p(1),d(2,"amountFraction"),S(3,Of,3,3,"div",53),a()),i&2){let e=m().$implicit;o(),D(" ",(e==null?null:e.Discount)==0?"":g(2,2,e==null?null:e.Discount)+"%"," "),o(2),y((e==null?null:e.DiscountAmount)>0?3:-1)}}function Rf(i,s){if(i&1&&(n(0,"th",52),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.Total)," ")}}function kf(i,s){if(i&1&&(n(0,"tr")(1,"th",43)(2,"div",44)(3,"span"),p(4),a(),b(5,"small",45),a()(),n(6,"th",46),p(7),a(),n(8,"th",47),p(9),d(10,"quantityFraction"),a(),n(11,"th",48),p(12),d(13,"quantityFraction"),a(),n(14,"th",49),p(15),a(),S(16,Bf,3,3,"th",50),S(17,Lf,4,4,"th",51),S(18,Rf,3,3,"th",52),a()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(10,9,e==null?null:e.QtyRequested)," "),o(3),D(" ",g(13,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?16:-1),o(),y(r.roleService.product.Cost?17:-1),o(),y(r.roleService.product.Cost?18:-1)}}function Wf(i,s){if(i&1&&(n(0,"tr")(1,"th",59),p(2),a(),n(3,"th",60),p(4),a(),n(5,"th",61),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e==null?null:e.CurrencySymbol," "),o(2),D(" ",g(7,3,e==null?null:e.Amount)," ")}}function Nf(i,s){if(i&1&&(n(0,"table",41),G(1,Wf,8,5,"tr",null,Y),a()),i&2){let e=m(2).$implicit;o(),H(e==null?null:e.Aggregate)}}function Af(i,s){if(i&1&&(n(0,"tfoot",41)(1,"tr",54)(2,"td",55),p(3,"Total"),a(),n(4,"td",56)(5,"b"),p(6),d(7,"sum"),d(8,"quantityFraction"),a()(),b(9,"td",57),n(10,"td",58),S(11,Nf,3,0,"table",41),a()()()),i&2){let e=m().$implicit,r=m(2);o(6),F(g(8,5,v(7,2,e.Items,"Quantity"))),o(5),y(r.roleService.product.Cost?11:-1)}}function Gf(i,s){if(i&1&&(n(0,"div")(1,"div",31)(2,"div",32)(3,"a",33)(4,"span",34),p(5),a()(),S(6,Mf,2,0,"span"),S(7,Vf,3,6,"a",33),n(8,"span"),p(9),d(10,"date"),a(),b(11,"span",23),n(12,"strong",35),p(13),d(14,"sum"),d(15,"sum"),d(16,"quantityFraction"),a(),b(17,"small",36),a(),n(18,"div",37)(19,"label",38),p(20),a()()(),n(21,"table",39),b(22,"thead"),n(23,"tbody",40),G(24,kf,19,13,"tr",null,Y),a(),S(26,Af,12,7,"tfoot",41),a()()),i&2){let e=s.$implicit,r=m(2);o(3),c("routerLink",M(21,ml))("queryParams",X(22,sl,e.Data.ID)),o(2),F(e.Data.EntityName+" #"+e.Data.Number),o(),y(r.pageData.DualReceiptNumber?6:-1),o(),y(r.pageData.DualReceiptNumber?7:-1),o(2),F(" - "+v(10,10,e.Data.Date,"dd MMM yyyy")+(e.Data.Name==null?"":" : "+e.Data.Name)),o(4),D(" ","[Q: "+v(14,13,e.Items,"Quantity")+", T: "+g(16,19,v(15,16,e.Items,"Total"))+"]"," "),o(4),c("innerHtml",e==null||e.Data==null?null:e.Data.Note,Ee),o(3),F(e.Data==null?null:e.Data.PaymentStateLabel),o(4),H(e.Items),o(2),y(r.roleService.product.Cost?26:-1)}}function Hf(i,s){if(i&1&&(n(0,"div",62)(1,"div")(2,"strong"),p(3,"Tax Added"),a(),n(4,"span",59),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Purchases with Tax"),a(),n(10,"span",59),p(11),d(12,"amountFraction"),a()()()),i&2){let e=m(3);o(5),F(g(6,2,e.data.Aggregate.TaxAdd)),o(6),F(g(12,4,e.data.Aggregate.PurchaseWithTax))}}function Qf(i,s){if(i&1&&(n(0,"div",62)(1,"div")(2,"strong"),p(3,"Gross Purchase"),a(),n(4,"span",59),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Discount"),a(),n(10,"span",59),p(11),d(12,"amountFraction"),a()(),n(13,"div")(14,"strong"),p(15,"Tax Incl."),a(),n(16,"span",59),p(17),d(18,"amountFraction"),a()(),n(19,"div")(20,"strong"),p(21,"Net Purchase"),a(),n(22,"span",59),p(23),d(24,"amountFraction"),a()()()),i&2){let e=m(3);o(5),F(g(6,4,e.data.Aggregate.Gross)),o(6),F(g(12,6,e.data.Aggregate.Discount)),o(6),F(g(18,8,e.data.Aggregate.TaxInclude)),o(6),F(g(24,10,e.data.Aggregate.NetPurchase))}}function Yf(i,s){if(i&1&&(n(0,"div",30),S(1,Hf,13,6,"div",62),n(2,"div",62)(3,"div")(4,"strong"),p(5,"Orders"),a(),n(6,"span",59),p(7),d(8,"amountFraction"),a()(),n(9,"div")(10,"strong"),p(11,"Qty"),a(),n(12,"span",59),p(13),d(14,"quantityFraction"),a()()(),S(15,Qf,25,12,"div",62),a()),i&2){let e=m(2);o(),y(e.roleService.product.Cost?1:-1),o(6),F(g(8,4,e.data.Aggregate.TotalTransaction)),o(6),F(g(14,6,e.data.Aggregate.UnitQuantity)),o(2),y(e.roleService.product.Cost?15:-1)}}function jf(i,s){if(i&1&&(n(0,"content")(1,"div",17)(2,"table",18)(3,"thead",19)(4,"tr")(5,"th",20),p(6,"Name"),a(),n(7,"th",21),p(8,"Code"),a(),n(9,"th",22)(10,"span",23),p(11,"Requested"),a(),p(12," qty "),a(),n(13,"th",24),p(14,"Qty"),a(),n(15,"th",25),p(16,"UOM"),a(),S(17,If,2,1,"th",26),S(18,bf,2,0,"th",27),S(19,Ef,2,1,"th",28),a()(),n(20,"tbody")(21,"tr")(22,"td",29),G(23,Gf,27,24,"div",null,Y),a()()()(),S(25,Yf,16,8,"div",30),a()()),i&2){let e=m();o(17),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(3),li("colspan",e.roleService.product.Cost?8:6),o(),H(e.data.Data),o(2),y(e.data.Data.length>0?25:-1)}}var Da=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetPurchaseTransactionDetail","ReportLoader/GetPurchaseTransactionDetail");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.roleService=h;this.matDialog=T}hideMore=!0;AscDscRadio=[{Key:!1,Value:"Asc"},{Key:!0,Value:"Desc"}];SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];openExportModal(){this.matDialog.open(K,{data:{title:"Product Transaction Detail",exportTypes:[{ID:"ReportExport/ReportPurchaseDetail",Value:"Default",FileName:"Product Transaction Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty),this.datePipe.transform(this.pageData.Filter.From,"MMM")===this.datePipe.transform(this.pageData.Filter.To,"MMM")&&this.datePipe.transform(this.pageData.Filter.From,"yyyy")===this.datePipe.transform(this.pageData.Filter.To,"yyyy")?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d")}`:this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`,this.pageData.Filter.From==this.pageData.Filter.To?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`:this.menuData.H+=` - ${this.datePipe.transform(this.pageData.Filter.To,"d MMM yyyy")}`,this.menuData.H+=" ]"}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search 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"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","AscDesc",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","items","ngModel"],["name","NoteVisible",3,"modelChange","model"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","355px"],[2,"width","50px"],[1,"text-end",2,"width","55px"],[1,"d-block"],[1,"text-end",2,"width","33px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"red",2,"width","30px"],[1,"text-end",2,"width","150px"],[1,"px-0","border-bottom-0"],[1,"row","justify-content-end"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","mt-2","mb-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-3"],[1,"text-danger","ms-3"],[1,"d-block","fw-normal","fst-italic","ms-3",2,"word-break","break-all",3,"innerHtml"],[1,"d-lg-block","mt-2","me-5","fw-bold","fst-italic"],["runat","server",1,"status"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"table","table-sm","table-borderless"],["id","PONumber"],[1,"fw-normal","border-start","border-end",2,"width","325px"],[1,"lh-base"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","50px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","65px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","30px"],[1,"fst-italic","border-start","border-end","small",2,"width","40px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","80px"],[1,"fw-normal","border-start","border-end","text-end","text-danger",2,"width","30px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","140px"],[1,"text-danger"],[1,"grid_footer"],["colspan","2",1,"text-end","fw-bold"],["colspan","2",1,"text-end"],["colspan","3"],[1,"text-end","d-flex","justify-content-end","fw-bold"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[1,"zebra","col-auto"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Pf,3,0,"button",2),a(),n(3,"filters"),E(4,Ff,32,20,"ng-template",null,0,O),a(),S(6,jf,26,5,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,Te,Ae,Ce,U,se,oe,Z,ne],encapsulation:2})};var cl=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],wo=i=>({ID:i}),qf=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"];function Uf(i,s){if(i&1){let e=I();n(0,"button",31),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",32),p(2," Export "),a()}}function zf(i,s){if(i&1){let e=I();n(0,"div")(1,"div",33)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",34),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",35),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",36)(10,"datepicker",37),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Payment"),a(),n(13,"ng-select",38),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.StateID,t)||(l.pageData.Filter.StateID=t),_(t)}),a(),n(14,"h6"),p(15,"Supplier"),a(),n(16,"autocompleteV2",39),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(17,"h6"),p(18,"RowCount"),a(),n(19,"input",40),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(20,"h6"),p(21,"Order By"),a(),n(22,"radio-options",41),x("modelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m(2);return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=m(2);o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.StateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),C("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.contactDisplay),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount),o(3),C("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Kf(i,s){i&1&&(n(0,"th",13),p(1," Purchase "),a())}function Xf(i,s){i&1&&(n(0,"th",14),p(1," Tax "),a())}function Jf(i,s){i&1&&(n(0,"th",15),p(1," Purchase+Tax "),a())}function Zf(i,s){i&1&&(n(0,"th",16),p(1," Payment "),a())}function $f(i,s){i&1&&b(0,"br")}function ex(i,s){if(i&1&&(n(0,"a",42),p(1),a()),i&2){let e=m().$implicit;c("routerLink",M(3,cl))("queryParams",X(4,wo,e.PurchaseOrderID)),o(),F(e.PONumber)}}function tx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function ix(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function nx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalAmount)," ")}}function ax(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PaymentAmount)," ")}}function ox(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",42),p(5),a(),S(6,$f,1,0,"br"),S(7,ex,2,6,"a",42),a(),n(8,"td"),p(9),d(10,"date"),a(),n(11,"td")(12,"a",42),p(13),a()(),n(14,"td",21),p(15),d(16,"quantityFraction"),a(),S(17,tx,3,3,"td",21),S(18,ix,3,3,"td",22),S(19,nx,3,3,"td",21),S(20,ax,3,3,"td",21),n(21,"td"),p(22),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(25,cl))("queryParams",X(26,wo,e.ID)),o(),F(e.Number),o(),y(r.pageData.DualNumber?6:-1),o(),y(r.pageData.DualNumber?7:-1),o(2),F(v(10,20,e.Date,"dd MMM yyyy")),o(3),c("routerLink",M(28,qf))("queryParams",X(29,wo,e.SupplierID)),o(),D(" ",e.SupplierNameDisplay," "),o(2),D(" ",g(16,23,e.TotalItemQuantity)," "),o(2),y(r.roleService.product.Cost?17:-1),o(),y(r.roleService.product.Cost?18:-1),o(),y(r.roleService.product.Cost?19:-1),o(),y(r.roleService.product.Cost?20:-1),o(),ji("text-danger",e.PaymentStateLabel==="Unpaid")("text-success",e.PaymentStateLabel==="Paid"),o(),D(" ",e.PaymentStateLabel," ")}}function rx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function lx(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function px(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"TotalAmount"))," ")}}function mx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"PaymentAmount"))," ")}}function sx(i,s){if(i&1){let e=I();n(0,"span",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountReportPurchaseSummary"))}),n(1,"i",44),p(2,"?"),a()()}}function cx(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function dx(i,s){if(i&1){let e=I();n(0,"a",45),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",46),p(2," Next"),a()}}function ux(i,s){if(i&1){let e=I();n(0,"a",47),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountReportPurchaseSummary",!0))}),b(1,"i",48),p(2," Show All"),a()}}function _x(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),x("textChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Number,t)||(l.pageData.Filter.Number=t),_(t)}),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,Uf,3,0,"button",3),a(),n(3,"filters"),E(4,zf,23,14,"ng-template",null,0,O),a(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Outlet"),a(),n(14,"th",9),p(15,"Number"),a(),n(16,"th",10),p(17,"Date"),a(),n(18,"th",11),p(19," Supplier "),a(),n(20,"th",12),p(21," Qty "),a(),S(22,Kf,2,0,"th",13),S(23,Xf,2,0,"th",14),S(24,Jf,2,0,"th",15),S(25,Zf,2,0,"th",16),n(26,"th",17),p(27,"State"),a()()(),n(28,"tbody"),G(29,ox,23,31,"tr",null,Y),a(),n(31,"tfoot")(32,"tr",18),b(33,"td",19),n(34,"td",20),p(35,"Total :"),a(),n(36,"td",21),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),S(40,rx,4,6,"td",21),S(41,lx,4,6,"td",22),S(42,px,4,6,"td",21),S(43,mx,4,6,"td",21),b(44,"td",23),a()()()(),n(45,"div",24)(46,"div",25)(47,"div",26),p(48),d(49,"number"),E(50,sx,3,0,"span",27)(51,cx,3,3,"span",28),p(52),a()(),E(53,dx,3,0,"a",29)(54,ux,3,0,"a",30),a()()()()}if(i&2){let e=m();c("pageData",e.menuData),C("text",e.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(20),y(e.roleService.product.Cost?22:-1),o(),y(e.roleService.product.Cost?23:-1),o(),y(e.roleService.product.Cost?24:-1),o(),y(e.roleService.product.Cost?25:-1),o(4),H(e.infiniteList),o(8),D(" ",g(39,23,v(38,20,e.infiniteList,"TotalItemQuantity"))," "),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.product.Cost?41:-1),o(),y(e.roleService.product.Cost?42:-1),o(),y(e.roleService.product.Cost?43:-1),o(5),D(" Showing 1 - ",g(49,25,e.infiniteList.length)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var va=class i extends vi{constructor(e,r,t,l,h,T){super(e,r,"Report/ReportPurchaseSummary","ReportLoader/GetReportPurchaseSummary",null,l);this.httpService=r;this.csvConverter=t;this.url=l;this.roleService=h;this.matDialog=T}contactDisplay;preInitLoader(){let e=this.loaderPayload.ListIDs;typeof e=="string"&&V.IsNotEmpty(e)&&(this.loaderPayload.ListIDs=[e])}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Report Summary",exportTypes:[{ID:"ReportExport/ReportPurchaseSummary",Value:"Default",FileName:"Purchase Report Summary"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.menuData.H=e.PageTitle}preInitList(){V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null),V.IsNotEmpty(this.pageData.Filter.SupplierID)&&(this.pageData.Filter.From=V.MinDate),V.IsNotEmpty(this.pageData.SupplierName)&&(this.contactDisplay=this.pageData.SupplierName)}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,t.SupplierNameDisplay=t.SupplierNameDisplay==null?"":t.SupplierNameDisplay,l.SupplierNameDisplay=l.SupplierNameDisplay==null?"":l.SupplierNameDisplay,e.active){case"EntityName":return V.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),h);case"Number":return V.compare(t.Number,l.Number,h);case"Date":return V.compare(t.Date,l.Date,h);case"SupplierNameDisplay":return V.compare(t.SupplierNameDisplay.toLocaleLowerCase(),l.SupplierNameDisplay.toLocaleLowerCase(),h);case"TotalItemQuantity":return V.compare(t.TotalItemQuantity,l.TotalItemQuantity,h);case"Total":return V.compare(t.TotalAmount,l.TotalAmount,h);case"Sales":return V.compare(t.Sales,l.Sales,h);case"Tax":return V.compare(t.Tax,l.Tax,h);case"PaymentAmount":return V.compare(t.PaymentAmount,l.PaymentAmount,h);case"PaymentState":return V.compare(t.PaymentStateLabel,l.PaymentStateLabel,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-detail-summary"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName"],["mat-sort-header","Number"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","SupplierNameDisplay",2,"width","118px"],["mat-sort-header","TotalItemQuantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right","text-end",2,"width","118px"],["mat-sort-header","PaymentAmount","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","PaymentState",2,"width","70px"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end","empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"empty-column"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more data",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Sort",3,"modelChange","model","options"],[3,"routerLink","queryParams"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){r&1&&S(0,_x,55,27,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,it,Q,$,J,Qe,L,R,ie,pe,ge,Ue,Te,Ae,U,se,re,oe,Z,ne],encapsulation:2})};var gx=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],Cx=i=>({ID:i}),fx=(i,s,e)=>({SupplierID:i,From:s,To:e}),xx=()=>["/menu/Reports/Purchases_Report/Summary"];function hx(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Sx(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier Group"),a(),n(7,"ng-select",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",9)(13,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function yx(i,s){i&1&&(n(0,"th",20),p(1," Purchase "),a())}function Dx(i,s){if(i&1&&(n(0,"td",24)(1,"a",30),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(11,fx,e.SupplierID,v(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),v(3,6,r.pageData.Filter.To,"yyyy-MM-dd")))("routerLink",M(15,xx)),o(3),F(g(5,9,e.Total))}}function vx(i,s){if(i&1&&(n(0,"tr",21)(1,"td"),p(2),a(),n(3,"td",27)(4,"a",28),p(5),a()(),n(6,"td",24),p(7),a(),n(8,"td",29),p(9),d(10,"quantityFraction"),a(),S(11,Dx,6,16,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",M(9,gx))("queryParams",X(10,Cx,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,7,e.Quantity)," "),o(2),y(r.roleService.product.Cost?11:-1)}}function wx(i,s){i&1&&(n(0,"th",24),p(1," Total Purchase "),a())}function Tx(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(2,1,e.data.TotalSales)," ")}}function Px(i,s){if(i&1){let e=I();n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",15)(5,"tr")(6,"th",16),p(7,"Rank"),a(),n(8,"th",17),p(9,"Supplier"),a(),n(10,"th",18),p(11," Code "),a(),n(12,"th",19),p(13," Quantity "),a(),S(14,yx,2,0,"th",20),a()(),n(15,"tbody"),G(16,vx,12,12,"tr",21,Y),a(),n(18,"tfoot")(19,"tr",22),b(20,"th",23),n(21,"th",24),p(22,"Total Quantity"),a(),S(23,wx,2,0,"th",24),a(),n(24,"tr"),b(25,"td",25),n(26,"td",24),p(27),d(28,"quantityFraction"),a(),S(29,Tx,3,3,"td",24),a()()(),n(30,"POS-complex-pagination",26),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(2),H(e.data.Data),o(7),y(e.roleService.product.Cost?23:-1),o(4),F(g(28,6,e.data.TotalQty)),o(2),y(e.roleService.product.Cost?29:-1),o(),c("total",e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var wa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/TopSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopPurchaseExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/TopSupplierCount",pagination:!0}})}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Code":return this.compare(t.Code,l.Code,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Total":return this.compare(t.Total,l.Total,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-top-supplier"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","35px"],["mat-sort-header","Name"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"thead-light"],["colspan","3"],[1,"text-end"],["colspan","3",1,"bg-white","border-top-0"],["api","Report/TopSupplierCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end","text-success"],[3,"queryParams","routerLink"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,hx,3,0,"button",2),a(),n(3,"filters"),E(4,Sx,17,11,"ng-template",null,0,O),a(),S(6,Px,31,8,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,Qe,L,R,pe,ge,Ue,Et,U,oe,Z,ne],encapsulation:2})};var Fx=i=>[i],Ix=i=>({ID:i}),bx=(i,s,e,r)=>({VariantID:i,ProductID:s,From:e,To:r});function Ex(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Mx(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Currency"),a(),n(10,"ng-select",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",10)(16,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Group By"),a(),n(19,"radio-options",12),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(20,"h6"),p(21,"Brand"),a(),n(22,"ng-select",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.GroupByProduct),c("options",e.GroupByRadio),o(3),c("multiple",!1),C("ngModel",e.pageData.Filter.BrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function Vx(i,s){i&1&&(n(0,"th"),p(1,"Variant"),a())}function Bx(i,s){i&1&&(n(0,"th",22),p(1," Cost "),a())}function Ox(i,s){i&1&&(n(0,"th",23),p(1," Gross "),a())}function Lx(i,s){i&1&&(n(0,"th",24),p(1," Purchase "),a())}function Rx(i,s){i&1&&(n(0,"th",25),p(1," Tax "),a())}function kx(i,s){i&1&&(n(0,"th",26),p(1," Purchase+Tax "),a())}function Wx(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.VariantName)}}function Nx(i,s){if(i&1&&(n(0,"td",29)(1,"a",32),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",Ut(4,bx,r.pageData.Filter.GroupByProduct?null:e.ID,r.pageData.Filter.GroupByProduct?e.ID:null,r.dateFromString(),r.dateToString())),o(),D(" ",g(3,2,e.UnitPrice)," ")}}function Ax(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function Gx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetPrice)," ")}}function Hx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Qx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PurchaseNTax)," ")}}function Yx(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",31),p(5),a()(),S(6,Wx,2,1,"td"),n(7,"td"),p(8),a(),n(9,"td",29),p(10),d(11,"number"),a(),n(12,"td",29),p(13),d(14,"quantityFraction"),a(),S(15,Nx,4,9,"td",29),S(16,Ax,3,3,"td",29),S(17,Gx,3,3,"td",29),S(18,Hx,3,3,"td",29),S(19,Qx,3,3,"td",29),a()),i&2){let e=s.$implicit,r=s.$index,t=m(2);o(2),F(r+1),o(2),c("routerLink",X(17,Fx,t.pageData.Filter.GroupByProduct?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(19,Ix,e.ID)),o(),F(e.Name),o(),y(t.pageData.Filter.GroupByProduct?-1:6),o(2),D(" ",t.pageData.Filter.GroupByProduct?e.ProductCode:e.VariantCode," "),o(2),F(g(11,13,e.Order)),o(3),F(g(14,15,e.Quantity)),o(2),y(t.roleService.product.Cost?15:-1),o(),y(t.roleService.product.Cost?16:-1),o(),y(t.roleService.product.Cost?17:-1),o(),y(t.roleService.product.Cost?18:-1),o(),y(t.roleService.product.Cost?19:-1)}}function jx(i,s){i&1&&b(0,"td")}function qx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"UnitPrice"))," ")}}function Ux(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function zx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"NetPrice"))," ")}}function Kx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function Xx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"PurchaseNTax"))," ")}}function Jx(i,s){if(i&1){let e=I();n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16)(4,"thead",17),P("matSortChange",function(t){u(e);let l=m();return _(l.onSortChange(t))}),n(5,"tr")(6,"th",18),p(7,"No"),a(),n(8,"th"),p(9,"Product"),a(),S(10,Vx,2,0,"th"),n(11,"th",19),p(12,"Code"),a(),n(13,"th",20),p(14," Orders "),a(),n(15,"th",21),p(16," Quantity "),a(),S(17,Bx,2,0,"th",22),S(18,Ox,2,0,"th",23),S(19,Lx,2,0,"th",24),S(20,Rx,2,0,"th",25),S(21,kx,2,0,"th",26),a()(),n(22,"tbody"),G(23,Yx,20,21,"tr",null,Y),a(),n(25,"tfoot")(26,"tr",27),b(27,"td"),S(28,jx,1,0,"td"),b(29,"td",28),n(30,"td"),p(31,"Total :"),a(),n(32,"td",29),p(33),d(34,"sum"),d(35,"number"),a(),n(36,"td",29),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),S(40,qx,4,6,"td",29),S(41,Ux,4,6,"td",29),S(42,zx,4,6,"td",29),S(43,Kx,4,6,"td",29),S(44,Xx,4,6,"td",29),a()()()(),n(45,"infinite-pagination",30),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount",!0))}),a()()()}if(i&2){let e=m();o(10),y(e.pageData.Filter.GroupByProduct?-1:10),o(7),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(),y(e.roleService.product.Cost?20:-1),o(),y(e.roleService.product.Cost?21:-1),o(2),H(e.infiniteList),o(5),y(e.pageData.Filter.GroupByProduct?-1:28),o(5),D(" ",g(35,23,v(34,20,e.infiniteList,"Order"))," "),o(4),D(" ",g(39,28,v(38,25,e.infiniteList,"Quantity"))," "),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.product.Cost?41:-1),o(),y(e.roleService.product.Cost?42:-1),o(),y(e.roleService.product.Cost?43:-1),o(),y(e.roleService.product.Cost?44:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Ta=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/PurchasesByProductList","ReportLoader/PurchasesByProductLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}GroupByRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];dateFromString=xi(()=>{let e=this.pageData.Filter.From;return e?new Date(e).toJSON():null});dateToString=xi(()=>{let e=this.pageData.Filter.To;return e?new Date(e).toJSON():null});openExportModal(){this.matDialog.open(K,{data:{title:"Product Bought Report",exportTypes:[{ID:"ReportExport/PurchasesByProductExport",Value:"Default",FileName:"Product Bought Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}onSortChange(e){let r=this.infiniteList.slice();if(!e.active||e.direction===""){this.infiniteList=this.originalData;return}this.infiniteList=r.sort((t,l)=>{let h=e.direction==="asc";return this.compare(t[e.active],l[e.active],h)})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-bought"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","GroupBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],["matSort","",1,"thead-light","sticky-top-thead",3,"matSortChange"],[2,"width","10px"],[2,"width","100px"],["mat-sort-header","Order","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","140px"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Purchase","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","PurchaseNTax","arrowPosition","before",1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],["routerLink","/menu/Reports/Purchases_Report/History",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Ex,3,0,"button",2),a(),n(3,"filters"),E(4,Mx,23,15,"ng-template",null,0,O),a(),S(6,Jx,46,30,"content"),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,Te,Ce,U,ti,se,re,Z,ne],encapsulation:2})};var Zx=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Pa=i=>({ID:i}),$x=()=>["/menu/Products/Catalog/Variants/Info"],eh=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],th=()=>["/menu/Products/Catalog/Products/Info"];function ih(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function nh(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product"),a(),n(3,"autocompleteV2",16),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("ngModel",e.pageData.Filter.ProductID),c("inputTextValue",e.pageData.ProductName)}}function ah(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Variant"),a(),n(3,"autocompleteV2",17),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("ngModel",e.pageData.Filter.VariantID),c("renderThumbnail",!0)("inputTextValue",e.pageData.VariantName)}}function oh(i,s){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier"),a(),n(7,"autocompleteV2",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(8,"h6"),p(9,"Scope"),a(),n(10,"radio-options",9),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ByProduct,t)||(l.pageData.Filter.ByProduct=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()(),E(11,nh,4,2,"div",3)(12,ah,4,3,"div",3),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(17,"div",11)(18,"datepicker",12),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(19,"h6"),p(20,"Order By"),a(),n(21,"radio-options",13),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.OrderByNumber,t)||(l.pageData.Filter.OrderByNumber=t),_(t)}),a(),n(22,"h6"),p(23,"Currency"),a(),n(24,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(25,"h6"),p(26,"Brand"),a(),n(27,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()}if(i&2){let e=m();o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(3),C("model",e.pageData.Filter.ByProduct),c("options",e.ScopeRadio),o(),c("ngIf",e.pageData.Filter.ByProduct),o(),c("ngIf",!e.pageData.Filter.ByProduct),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.OrderByNumber),c("options",e.OrderByRadio),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("multiple",!1),C("ngModel",e.pageData.Filter.BrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function rh(i,s){i&1&&(n(0,"th",38),p(1,"Date"),a())}function lh(i,s){i&1&&(n(0,"th"),p(1,"Outlet"),a())}function ph(i,s){i&1&&(n(0,"th"),p(1," Supplier "),a())}function mh(i,s){i&1&&(n(0,"th",39),p(1," Fulfillment "),a())}function sh(i,s){i&1&&(n(0,"th"),p(1,"Product"),a())}function ch(i,s){i&1&&(n(0,"th",40),p(1," Qty "),a())}function dh(i,s){i&1&&(n(0,"th",41),p(1," Unit Quantity "),a())}function uh(i,s){i&1&&(n(0,"th",42)(1,"span",43),p(2," Cost "),a()())}function _h(i,s){i&1&&(n(0,"th",44)(1,"span",45),p(2," Gross "),a()())}function gh(i,s){i&1&&(n(0,"th",40),p(1," Item (%) "),a())}function Ch(i,s){i&1&&(n(0,"th",46),p(1," Item Disc "),a())}function fh(i,s){i&1&&(n(0,"th",40),p(1," Bill(%) "),a())}function xh(i,s){i&1&&(n(0,"th",46),p(1," Bill Disc "),a())}function hh(i,s){i&1&&(n(0,"th",47)(1,"span",48),p(2," Purchase + Tax "),a()())}function Sh(i,s){i&1&&(n(0,"th"),p(1,"Item Note"),a())}function yh(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Date,"dd MMM yyyy")," ")}}function Dh(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.EntityName)}}function vh(i,s){if(i&1&&(n(0,"td")(1,"a",50),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,eh))("queryParams",X(4,Pa,e.SupplierID)),o(),F(e.SupplierName)}}function wh(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryStatus," ")}}function Th(i,s){if(i&1&&(n(0,"td")(1,"a",50),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,th))("queryParams",X(4,Pa,e.ProductID)),o(),F(e.Name)}}function Ph(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Fh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.VariantUnitQuantity)," ")}}function Ih(i,s){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.UnitPrice)," ")}}function bh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function Eh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.Discount>0?g(2,1,e.Discount):"0"," ")}}function Mh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.ItemDiscountAmount>0?g(2,1,e.ItemDiscountAmount):"0"," ")}}function Vh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DiscountInvoice>0?g(2,1,e.DiscountInvoice):"0"," ")}}function Bh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.OrderDiscountAmount>0?g(2,1,e.OrderDiscountAmount):"0"," ")}}function Oh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PurchaseNTax)," ")}}function Lh(i,s){if(i&1&&b(0,"td",53),i&2){let e=m().$implicit;c("innerHTML",e.Note,Ee)}}function Rh(i,s){if(i&1&&(n(0,"tr",49),E(1,yh,3,4,"td",3)(2,Dh,2,1,"td",3),n(3,"td")(4,"a",50),p(5),a()(),E(6,vh,3,6,"td",3)(7,wh,2,1,"td",3)(8,Th,3,6,"td",3),n(9,"td")(10,"a",50),p(11),a()(),E(12,Ph,3,3,"td",30)(13,Fh,3,3,"td",30)(14,Ih,3,3,"td",35)(15,bh,3,3,"td",30)(16,Eh,3,3,"td",30)(17,Mh,3,3,"td",30)(18,Vh,3,3,"td",30)(19,Bh,3,3,"td",30)(20,Oh,3,3,"td",30)(21,Lh,1,1,"td",51),a()),i&2){let e=s.$implicit,r=m(2);o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Outlet.selected),o(2),c("routerLink",M(21,Zx))("queryParams",X(22,Pa,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",r.column.Supplier.selected),o(),c("ngIf",r.column.Fulfillment.selected),o(),c("ngIf",r.pageData.Filter.ByProduct),o(2),c("routerLink",M(24,$x))("queryParams",X(25,Pa,e.VariantID)),o(),F(e.Model),o(),c("ngIf",r.column.Qty.selected),o(),c("ngIf",r.column.UnitQty.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.UnitCost.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Gross.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.ItemPercentage.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.ItemDiscount.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.BillPercentage.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.BillDiscount.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.PurchaseNTax.selected),o(),c("ngIf",r.column.ItemNote.selected)}}function kh(i,s){i&1&&b(0,"td",34)}function Wh(i,s){i&1&&b(0,"td",34)}function Nh(i,s){i&1&&b(0,"td",34)}function Ah(i,s){i&1&&b(0,"td",34)}function Gh(i,s){i&1&&b(0,"td",34)}function Hh(i,s){i&1&&(n(0,"td",47),p(1," Total : "),a())}function Qh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function Yh(i,s){i&1&&b(0,"td",34)}function jh(i,s){if(i&1&&(n(0,"td",52),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"UnitPrice"))," ")}}function qh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Gross"))," ")}}function Uh(i,s){i&1&&b(0,"td",34)}function zh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ItemDiscountAmount"))," ")}}function Kh(i,s){i&1&&b(0,"td",34)}function Xh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"OrderDiscountAmount"))," ")}}function Jh(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"PurchaseNTax"))," ")}}function Zh(i,s){i&1&&b(0,"td",34)}function $h(i,s){if(i&1){let e=I();n(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr"),E(6,rh,2,0,"th",22)(7,lh,2,0,"th",3),n(8,"th",23),p(9,"Number"),a(),E(10,ph,2,0,"th",3)(11,mh,2,0,"th",24)(12,sh,2,0,"th",3),n(13,"th"),p(14,"Variant"),a(),E(15,ch,2,0,"th",25)(16,dh,2,0,"th",26)(17,uh,3,0,"th",27)(18,_h,3,0,"th",28)(19,gh,2,0,"th",25)(20,Ch,2,0,"th",29)(21,fh,2,0,"th",25)(22,xh,2,0,"th",29)(23,hh,3,0,"th",30)(24,Sh,2,0,"th",3),a()(),n(25,"tbody"),E(26,Rh,22,27,"tr",31),a(),n(27,"tfoot")(28,"tr",32),E(29,kh,1,0,"td",33)(30,Wh,1,0,"td",33),b(31,"td",34),E(32,Nh,1,0,"td",33)(33,Ah,1,0,"td",33)(34,Gh,1,0,"td",33)(35,Hh,2,0,"td",30)(36,Qh,4,6,"td",30)(37,Yh,1,0,"td",33)(38,jh,4,6,"td",35)(39,qh,4,6,"td",30)(40,Uh,1,0,"td",33)(41,zh,4,6,"td",30)(42,Kh,1,0,"td",33)(43,Xh,4,6,"td",30)(44,Jh,4,6,"td",36)(45,Zh,1,0,"td",33),a()()()(),n(46,"POS-complex-pagination",37),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Outlet.selected),o(3),c("ngIf",e.column.Supplier.selected&&e.column.Supplier.selected),o(),c("ngIf",e.column.Fulfillment.selected),o(),c("ngIf",e.pageData.Filter.ByProduct),o(3),c("ngIf",e.column.Qty.selected),o(),c("ngIf",e.column.UnitQty.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.UnitCost.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Gross.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.ItemPercentage.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.ItemDiscount.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.BillPercentage.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.BillDiscount.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.PurchaseNTax.selected),o(),c("ngIf",e.column.ItemNote.selected),o(2),c("ngForOf",e.data.Data),o(3),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Outlet.selected),o(2),c("ngIf",e.column.Supplier.selected),o(),c("ngIf",e.column.Fulfillment.selected),o(),c("ngIf",e.pageData.Filter.ByProduct),o(),c("ngIf",e.column.Qty.selected||e.column.PurchaseNTax.selected),o(),c("ngIf",e.column.Qty.selected),o(),c("ngIf",e.column.UnitQty.selected),o(),c("ngIf",e.column.UnitCost.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.Gross.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.ItemPercentage.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.ItemDiscount.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.BillPercentage.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.BillDiscount.selected&&e.roleService.product.Cost),o(),c("ngIf",e.roleService.product.Cost&&e.column.PurchaseNTax.selected),o(),c("ngIf",e.column.ItemNote.selected),o(),c("total",e.data.Data.length)("pageData",e.pageData)}}var Fa=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/ProductPurchaseHistory","ReportLoader/ProductPurchaseHistoryLoader",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=h;this.matDialog=T}columnService=Pe(gt);column={Date:{selected:!0},Outlet:{selected:!0},Supplier:{selected:!0},Fulfillment:{selected:!1},Qty:{selected:!0,name:"Quantity"},UnitQty:{selected:!1,name:"Unit Quantity"},UnitCost:{selected:!1,name:"Unit Cost"},Gross:{selected:!0,name:"Gross Purchase"},ItemPercentage:{selected:!1,name:"Item (%)"},ItemDiscount:{selected:!1,name:"Item Disc"},BillPercentage:{selected:!1,name:"Bill (%)"},BillDiscount:{selected:!1,name:"Bill Disc"},PurchaseNTax:{selected:!0,name:"Purchase N Tax"},ItemNote:{selected:!1,name:"Item Note"}};ScopeRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];OrderByRadio=[{Key:!0,Value:"Date & Number"},{Key:!1,Value:"Supplier"}];hideMore=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Product Purchase History",exportTypes:[{ID:"ReportExport/ProductPurchaseHistory",Value:"Default",FileName:"Product Purchase History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){let e=this.activatedRoute.snapshot?.queryParams;this.pageData.Filter.From=!e.VariantID&&e.From?e.From:e.VariantID?null:this.pageData.Filter.From,this.pageData.Filter.To=!e.VariantID&&e.To?e.To:e.VariantID?null:this.pageData.Filter.To,this.pageData.Filter.VariantID=V.IsNotEmpty(e.VariantID)?e.VariantID:V.GuidEmpty,this.pageData.Filter.ProductID=V.IsNotEmpty(e.ProductID)?e.ProductID:V.GuidEmpty,this.pageData.Filter.ByProduct=V.IsNotEmpty(e.ProductID),V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-purchase-history"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","OrderBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search Product",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail","inputTextValue"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 100px",4,"ngIf"],[2,"width","70px"],["style","width: 80px",4,"ngIf"],["style","width: 50px","class","text-end",4,"ngIf"],["style","width: 60px","class","text-end",4,"ngIf"],["style","width: 75px","class","text-end",4,"ngIf"],["style","width: 75px","class","text-end","title","Original cost multiplied by quantity",4,"ngIf"],["style","width: 70px","class","text-end",4,"ngIf"],["class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end text-danger",4,"ngIf"],["class","text-end","colspan","6",4,"ngIf"],["api","report/ProductPurchaseHistoryCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[2,"width","100px"],[2,"width","80px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","60px"],[1,"text-end",2,"width","75px"],["matTooltip","Original Cost for One Quantity Before Discount & Tax","matTooltipPosition","above"],["title","Original cost multiplied by quantity",1,"text-end",2,"width","75px"],["matTooltip","Unit Cost Multiplied by Quantity","matTooltipPosition","above"],[1,"text-end",2,"width","70px"],[1,"text-end"],["matTooltip","Gross Purchase After Discount & Tax","matTooltipPosition","above"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"innerHTML",4,"ngIf"],[1,"text-end","text-danger"],[3,"innerHTML"],["colspan","6",1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,ih,3,0,"button",2),a(),n(3,"filters"),E(4,oh,28,18,"ng-template",null,0,O),a(),E(6,$h,47,34,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,L,R,ie,Te,Ae,Et,U,se,oe,Z,ne],encapsulation:2})};var e2=()=>["/menu/Reports/Purchases_Report/Daily/Monthly"];function t2(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function i2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",8),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Month"),a(),n(13,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(14,"h6"),p(15,"Currency"),a(),n(16,"ng-select",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(17,"h6"),p(18,"Multiply Unit Qty"),a(),n(19,"radio-options",12),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),C("model",e.pageData.Filter.MultiplyUnitQuantity),c("options",e.YesNoRadio)}}function n2(i,s){i&1&&(n(0,"th",17),p(1," Purchases "),a())}function a2(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PurchaseTotal)," ")}}function o2(i,s){if(i&1&&(n(0,"tr",18)(1,"td"),p(2),d(3,"date"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"quantityFraction"),a(),S(10,a2,3,3,"td",17),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(v(3,4,e.Date,"EEEE")),o(3),F(g(6,7,e.Day)),o(3),F(g(9,9,e.Quantity)),o(2),y(r.roleService.product.Cost?10:-1)}}function r2(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"PurchaseTotal"))," ")}}function l2(i,s){if(i&1&&(n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15)(4,"thead",16)(5,"tr")(6,"th"),p(7,"Day"),a(),n(8,"th",17),p(9,"Date (Day)"),a(),n(10,"th",17),p(11,"Quantity"),a(),S(12,n2,2,0,"th",17),a()(),n(13,"tbody"),G(14,o2,11,11,"tr",18,Y),a(),n(16,"tr")(17,"td",19),p(18,"Total"),a(),n(19,"td",17),p(20),d(21,"sum"),d(22,"quantityFraction"),a(),S(23,r2,4,6,"td",17),a()()()()()),i&2){let e=m();o(12),y(e.roleService.product.Cost?12:-1),o(2),H(e.data.Data),o(6),D(" ",g(22,6,v(21,3,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?23:-1)}}var Ia=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/GetPurchasePeriodDaily","ReportLoader/GetReportPurchaseDaily");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Months=V.Months}Years=[];Months=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Daily",exportTypes:[{ID:"ReportExport/DailyPurchaseReport",Value:"Default",FileName:"Purchase Daily"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily-purchases"]],standalone:!1,features:[W],decls:9,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Month","bindLabel","Label","bindValue","ID",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"border-bottom"],["colspan","2",1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,t2,3,0,"button",2),n(3,"a",3),p(4,"View Month"),a()(),n(5,"filters"),E(6,i2,20,14,"ng-template",null,0,O),a(),S(8,l2,24,8,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,e2)),o(5),y(t.data?8:-1))},dependencies:[A,Q,$,L,R,ie,Te,Ce,U,se,re,oe,Z,ne],encapsulation:2})};var p2=()=>["/menu/Reports/Purchases_Report/Daily"];function m2(i,s){if(i&1){let e=I();n(0,"button",12),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function s2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",14)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",15),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",16),x("selectedCategoryIDChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Currency"),a(),n(13,"ng-select",18),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(14,"h6"),p(15,"Multiply Unit Qty"),a(),n(16,"radio-options",19),x("modelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a(),n(17,"h6"),p(18,"Supplier"),a(),n(19,"autocompleteV2",20),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),C("model",e.pageData.Filter.MultiplyUnitQuantity),c("options",e.YesNoRadio),o(3),C("ngModel",e.pageData.Filter.SupplierID)}}function c2(i,s){i&1&&(n(0,"th",8),p(1,"Purchases"),a())}function d2(i,s){if(i&1&&(n(0,"td",8),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Income)," ")}}function u2(i,s){if(i&1&&(n(0,"tr",9)(1,"td"),p(2),a(),n(3,"td",8),p(4),d(5,"quantityFraction"),a(),S(6,d2,3,3,"td",8),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.MonthLabel),o(2),F(g(5,3,e.Quantity)),o(2),y(r.roleService.product.Cost?6:-1)}}function _2(i,s){if(i&1&&(n(0,"td",8),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Income"))," ")}}function g2(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,m2,3,0,"button",3),n(3,"a",4),p(4,"View Daily"),a()(),n(5,"filters"),E(6,s2,20,13,"ng-template",null,0,O),a(),n(8,"content")(9,"div",5)(10,"table",6)(11,"thead",7)(12,"tr")(13,"th"),p(14,"Month"),a(),n(15,"th",8),p(16,"Quantity"),a(),S(17,c2,2,0,"th",8),a()(),n(18,"tbody"),G(19,u2,7,5,"tr",9,Y),a(),n(21,"tr",10)(22,"td",11),p(23,"Total"),a(),n(24,"td",8),p(25),d(26,"sum"),d(27,"quantityFraction"),a(),S(28,_2,4,6,"td",8),a()()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(),c("routerLink",M(14,p2)),o(14),y(e.roleService.product.Cost?17:-1),o(2),H(e.data.Data),o(6),D(" ",g(27,12,v(26,9,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?28:-1)}}var ba=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/GetPurchasePeriodMonthly","ReportLoader/GetReportPurchaseMonthly");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0)}Years=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Monthly",exportTypes:[{ID:"ReportExport/MonthlyPurchaseReport",Value:"Default",FileName:"Purchase Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-purchase"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"border-bottom"],[1,"table-footer"],["colspan","1",1,"fw-bold","text-start","ps-4"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"]],template:function(r,t){r&1&&S(0,g2,29,15,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,$,L,R,ie,Te,Ae,Ce,U,se,Z,ne],encapsulation:2})};function C2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",2)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",3),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",4),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",5),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years)}}function f2(i,s){if(i&1&&(n(0,"content")(1,"div",6),b(2,"POS-line-chart",7),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var Ea=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthlyPurchasesVolume","ReportLoader/GetMonthlyPurchaseVolume");this.httpService=r;let l=new Date;this.Years=V.GenerateYears(l.getFullYear(),11,!0)}Years=[];ChartData={};chartConfig;preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}preInitList(){let e={ID:0,Symbol:"All"};this.pageData.Options.Currencies.unshift(e),this.pageData.Filter.CurrencyID=0}postInit(){let e=[];this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.Data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}},this.data.PageTitle!=null&&(this.menuData.H=this.data.PageTitle),this.data.Data.MonthlySalesRank.forEach((r,t)=>{let l={name:this.data.Data.MonthName[t],data:r.Sales};e.push(l)}),this.ChartData={series:e}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-volume"]],standalone:!1,features:[W],decls:6,vars:5,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet","appendTo","body",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),b(1,"actions"),n(2,"filters"),E(3,C2,11,8,"ng-template",null,0,O),a(),S(5,f2,3,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(5),y(t.data?5:-1))},dependencies:[A,$,L,R,Mt,Ce,U],encapsulation:2})};var x2=()=>["/menu/Products/Catalog/Products/Info"],h2=i=>({ID:i});function S2(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export"),a()}}function y2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",9)(13,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function D2(i,s){if(i&1&&(n(0,"tr",20)(1,"td"),p(2),a(),n(3,"td")(4,"a",21),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a(),n(11,"td",22),p(12),d(13,"quantityFraction"),a(),n(14,"td",23),p(15),d(16,"number"),a()()),i&2){let e=s.$implicit,r=s.$index;o(2),F(r+1),o(2),c("routerLink",M(14,x2))("queryParams",X(15,h2,e.ID)),o(),D(" ",e.Name," "),o(2),F(e.Code),o(2),F(g(10,8,e.PurchaseQuantity)),o(3),F(g(13,10,e.SellQuantity)),o(3),F(g(16,12,e.Ratio))}}function v2(i,s){if(i&1&&(n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),p(7," Now "),a(),n(8,"th",17),p(9,"Name"),a(),n(10,"th",18),p(11,"Code"),a(),n(12,"th",19),p(13,"Purchase"),a(),n(14,"th",19),p(15,"Sold"),a(),n(16,"th",19),p(17,"Sold Percentage(%)"),a()()(),n(18,"tbody"),G(19,D2,17,17,"tr",20,Y),a()()()()()),i&2){let e=m();o(19),H(e.data.Data)}}var Ma=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/PruchasedSalesReportList","ReportLoader/PurchaseSalesReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}GroupRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Sales Report",exportTypes:[{ID:"ReportExport/PurchasedSalesReportList",Value:"Default",FileName:"Purchase Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-sales-report"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","55px"],[2,"width","320px"],[2,"width","100px"],[1,"text-end",2,"width","80px"],[1,"border-bottom"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,S2,3,0,"button",2),a(),n(3,"filters"),E(4,y2,17,10,"ng-template",null,0,O),a(),S(6,v2,21,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,Qe,L,R,Ue,Ce,U,re,ne],encapsulation:2})};var w2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"],T2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],P2=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),F2=(i,s,e)=>({EntityID:i,From:s,To:e}),I2=()=>["/menu/Reports/Purchases_Report/Summary"];function b2(i,s){if(i&1){let e=I();n(0,"button",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function E2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Compare with Prev Month"),a(),n(3,"radio-options",14),x("modelChange",function(t){u(e);let l=m(2);return f(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("model",e.isCompare)}}function M2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",15),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(5,"div",16)(6,"datepicker",17),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function V2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",18)(4,"div",19)(5,"ng-select",20),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Year=null)}),a()(),n(6,"div",21)(7,"ng-select",22),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Month=null)}),a()()()()}if(i&2){let e=m(2);o(5),C("ngModel",e.Year),c("items",e.Years),o(2),C("ngModel",e.Month),c("items",e.Months)}}function B2(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",10),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Purchase Order Tag"),a(),n(6,"ng-select",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"Date Filter"),a(),n(9,"radio-options",12),x("modelChange",function(t){u(e);let l=m();return f(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.YearMonthToDateRange())}),a(),S(10,E2,4,1,"div"),S(11,M2,7,2,"div"),S(12,V2,8,4,"div"),n(13,"h6"),p(14,"Exclude Complementary"),a(),n(15,"radio-options",13),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ExcludeComplementary,t)||(l.pageData.Filter.ExcludeComplementary=t),_(t)}),a()()}if(i&2){let e=m();o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),C("model",e.IsPredefined),c("options",e.RadioDateFilterType),o(),y(e.IsPredefined?10:-1),o(),y(e.IsPredefined?-1:11),o(),y(e.IsPredefined?12:-1),o(3),C("model",e.pageData.Filter.ExcludeComplementary)}}function O2(i,s){i&1&&(n(0,"th",28),p(1," Prev "),a())}function L2(i,s){i&1&&(n(0,"th",29),p(1," Now "),a())}function R2(i,s){i&1&&(n(0,"th",30),p(1," Orders "),a())}function k2(i,s){i&1&&(n(0,"th",32),p(1," Purchase "),a())}function W2(i,s){if(i&1&&(n(0,"th",33),p(1," Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function N2(i,s){if(i&1&&(n(0,"th",34),p(1," Purchase+Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function A2(i,s){if(i&1&&(n(0,"td",38),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function G2(i,s){if(i&1&&(n(0,"td",40),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,P2,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function H2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Count,".0-0")," ")}}function Q2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Y2(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function j2(i,s){if(i&1&&(n(0,"td",38)(1,"a",41),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(11,F2,e.EntityID,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy")))("routerLink",M(15,I2)),o(4),F(g(6,9,e.SalesWithTax))}}function q2(i,s){if(i&1&&(n(0,"tr")(1,"td",36),p(2),a(),S(3,A2,2,1,"td",38),S(4,G2,2,5,"td",40),S(5,H2,3,4,"td",38),n(6,"td",38),p(7),d(8,"quantityFraction"),a(),S(9,Q2,3,3,"td",38),S(10,Y2,3,3,"td",39),d(11,"HideSumZero"),S(12,j2,7,16,"td",38),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(),y(r.data.WithCategory?-1:5),o(2),F(g(8,8,e.Quantity)),o(2),y(r.roleService.product.Cost?9:-1),o(),y(!r.data.WithCategory&&v(11,10,r.data.Data,"Tax")&&r.roleService.product.Cost?10:-1),o(2),y(!r.data.WithCategory&&r.roleService.product.Cost?12:-1)}}function U2(i,s){i&1&&b(0,"td",37)}function z2(i,s){i&1&&b(0,"td",37)}function K2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Count"),".0-0")," ")}}function X2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Sales"))," ")}}function J2(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function Z2(i,s){if(i&1&&(n(0,"td",38)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function $2(i,s){if(i&1){let e=I();n(0,"content")(1,"div",23)(2,"div",24)(3,"table",25),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",26)(5,"tr")(6,"th",27),p(7,"Outlet"),a(),S(8,O2,2,0,"th",28),S(9,L2,2,0,"th",29),S(10,R2,2,0,"th",30),n(11,"th",31),p(12," Qty "),a(),S(13,k2,2,0,"th",32),S(14,W2,2,1,"th",33),d(15,"HideSumZero"),S(16,N2,2,1,"th",34),a()(),n(17,"tbody"),G(18,q2,13,13,"tr",null,Y),a(),n(20,"tfoot")(21,"tr",35),b(22,"td",36),S(23,U2,1,0,"td",37),S(24,z2,1,0,"td",37),S(25,K2,4,7,"td",38),n(26,"td",38),p(27),d(28,"sum"),d(29,"quantityFraction"),a(),S(30,X2,4,6,"td",38),S(31,J2,4,6,"td",39),d(32,"HideSumZero"),S(33,Z2,5,6,"td",38),a()()()()()()}if(i&2){let e=m();o(8),y(e.showCompareColumn?8:-1),o(),y(e.showCompareColumn?9:-1),o(),y(e.data.WithCategory?-1:10),o(3),y(e.roleService.product.Cost?13:-1),o(),y(!e.data.WithCategory&&v(15,13,e.data.Data,"Tax")&&e.roleService.product.Cost?14:-1),o(2),y(!e.data.WithCategory&&e.roleService.product.Cost?16:-1),o(2),H(e.data.Data),o(5),y(e.showCompareColumn?23:-1),o(),y(e.showCompareColumn?24:-1),o(),y(e.data.WithCategory?-1:25),o(2),D(" ",g(29,19,v(28,16,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?30:-1),o(),y(!e.data.WithCategory&&v(32,21,e.data.Data,"Tax")&&e.roleService.product.Cost?31:-1),o(2),y(!e.data.WithCategory&&e.roleService.product.Cost?33:-1)}}var Va=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/OutletPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Year=T.getFullYear(),this.Month=T.getMonth()+1,this.Months=V.Months,this.Months.forEach(Ze=>Ze.Label=Ze.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Comparison=0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Purchase Performance",exportTypes:[{ID:"ReportExport/OutletPerformancePurchase",Value:"Default",FileName:"Outlet Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){this.YearMonthToDateRange()}postInit(e){this.menuData.H=e?.PageTitle,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month-1,1),this.pageData.Filter.To=new Date(this.Year,this.Month,0)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Count":return V.compare(t.Count,l.Count,h);case"SalesWithTax":return V.compare(t.SalesWithTax,l.SalesWithTax,h);case"Quantity":return V.compare(t.Quantity,l.Quantity,h);case"SalesNet":return V.compare(t.Sales,l.Sales,h);case"SalesTaxNet":return V.compare(t.Sales,l.Sales,h);case"Tax":return V.compare(t.Tax,l.Tax,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-performance"]],standalone:!1,features:[W],decls:17,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","Date Filter",3,"modelChange","model","options"],["name","complementary",3,"modelChange","model"],["name","compare",3,"modelChange","model"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"freeze","header"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","100px"],["arrowPosition","before",1,"flex-right",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"flex-right",2,"width","150px",3,"mat-sort-header"],[1,"footer"],[1,"freeze","body"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[3,"queryParams","routerLink"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,b2,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()()()()(),n(13,"filters"),E(14,B2,16,10,"ng-template",null,0,O),a(),S(16,$2,34,24,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,w2)),o(3),c("routerLink",M(9,T2)),o(5),y(t.data?16:-1))},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,Ce,se,ei,re,oe,Z,ne],encapsulation:2})};var eS=()=>["/menu/Reports/Purchases_Report/Outlet"],tS=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],iS=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),nS=(i,s)=>({"text-danger":i,"text-success":s,"text-end":!0});function aS(i,s){if(i&1){let e=I();n(0,"button",24),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",25),p(2," Export"),a()}}function oS(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"From - To"),a(),n(2,"div")(3,"datepicker",29),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(4,"div",30)(5,"datepicker",31),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()}if(i&2){let e=m(3);o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function rS(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Year - Month"),a(),n(2,"div",32)(3,"div",33)(4,"ng-select",34),x("ngModelChange",function(t){u(e);let l=m(3);return f(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(3);return _(t.Year=null)}),a()(),n(5,"div",35)(6,"ng-select",36),x("ngModelChange",function(t){u(e);let l=m(3);return f(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(3);return _(t.Month=null)}),a()()()}if(i&2){let e=m(3);o(4),C("ngModel",e.Year),c("items",e.Years),o(2),C("ngModel",e.Month),c("items",e.Months)}}function lS(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Compare with Prev Month"),a(),n(2,"radio-options",37),x("modelChange",function(t){u(e);let l=m(3);return f(l.isCompare,t)||(l.isCompare=t),_(t)}),a()}if(i&2){let e=m(3);o(2),C("model",e.isCompare)}}function pS(i,s){if(i&1){let e=I();n(0,"div")(1,"div",26)(2,"h6"),p(3,"Date Filter"),a(),n(4,"radio-options",27),x("modelChange",function(t){u(e);let l=m(2);return f(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),a(),S(5,oS,6,2),S(6,rS,7,4),n(7,"h6"),p(8,"Purchase Order Tag"),a(),n(9,"ng-select",28),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),S(10,lS,3,1),a()()}if(i&2){let e=m(2);o(4),C("model",e.IsPredefined),c("options",e.RadioDateFilterType),o(),y(e.IsPredefined?-1:5),o(),y(e.IsPredefined?6:-1),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(),y(e.IsPredefined?10:-1)}}function mS(i,s){i&1&&(n(0,"th",12),p(1,"Prev"),a())}function sS(i,s){i&1&&(n(0,"th",13),p(1,"Now"),a())}function cS(i,s){i&1&&(n(0,"th",17),p(1," \xB1 (%) "),a())}function dS(i,s){if(i&1&&(n(0,"td",22),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function uS(i,s){if(i&1&&(n(0,"td",38),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,iS,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function _S(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;c("ngClass",fe(5,nS,e.IsNegative,e.IsPositive)),o(),D(" ",v(2,2,e.Increase,".0-0")," ")}}function gS(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,dS,2,1,"td",22),S(4,uS,2,5,"td",38),n(5,"td",22),p(6),d(7,"number"),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a(),n(11,"td",22),p(12),d(13,"amountFraction"),a(),S(14,_S,3,8,"td",39),n(15,"td",23),p(16),d(17,"amountFraction"),a(),n(18,"td",22),p(19),d(20,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(2),F(v(7,9,e.Count,".0-0")),o(3),F(g(10,12,e.Quantity)),o(3),F(g(13,14,e.Sales)),o(2),y(r.showCompareColumn?14:-1),o(2),F(g(17,16,e.Tax)),o(3),D(" ",g(20,18,e.SalesWithTax)," ")}}function CS(i,s){i&1&&b(0,"td",21)}function fS(i,s){i&1&&b(0,"td",21)}function xS(i,s){i&1&&b(0,"td")}function hS(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,aS,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Month "),a()()()()(),n(13,"filters"),E(14,pS,11,7,"ng-template",null,0,O),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr")(21,"th",11),p(22,"Outlet"),a(),S(23,mS,2,0,"th",12),S(24,sS,2,0,"th",13),n(25,"th",14),p(26,"Orders "),a(),n(27,"th",15),p(28," Quantity"),a(),n(29,"th",16),p(30," Purchase"),a(),S(31,cS,2,0,"th",17),n(32,"th",18),p(33,"Tax"),a(),n(34,"th",19),p(35,"Purchase + Tax"),a()()(),n(36,"tbody"),G(37,gS,21,20,"tr",null,Y),a(),n(39,"tfoot")(40,"tr",20),S(41,CS,1,0,"td",21),S(42,fS,1,0,"td",21),b(43,"td",21),n(44,"td",22),p(45),d(46,"sum"),d(47,"number"),a(),n(48,"td",22),p(49),d(50,"sum"),d(51,"quantityFraction"),a(),n(52,"td",22),p(53),d(54,"sum"),d(55,"amountFraction"),a(),S(56,xS,1,0,"td"),n(57,"td",23),p(58),d(59,"sum"),d(60,"amountFraction"),a(),n(61,"td",22)(62,"a"),p(63),d(64,"sum"),d(65,"amountFraction"),a()()()()()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(6),c("routerLink",M(46,eS)),o(3),c("routerLink",M(47,tS)),o(12),y(e.showCompareColumn?23:-1),o(),y(e.showCompareColumn?24:-1),o(7),y(e.showCompareColumn?31:-1),o(),c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet"),o(2),c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet"),o(3),H(e.data==null?null:e.data.Data),o(4),y(e.showCompareColumn?41:-1),o(),y(e.showCompareColumn?42:-1),o(3),F(v(47,23,v(46,20,e.data==null?null:e.data.Data,"Count"),".0-0")),o(4),F(g(51,29,v(50,26,e.data==null?null:e.data.Data,"Quantity"))),o(4),D(" ",g(55,34,v(54,31,e.data==null?null:e.data.Data,"Sales"))," "),o(3),y(e.showCompareColumn?56:-1),o(2),D(" ",g(60,39,v(59,36,e.data==null?null:e.data.Data,"Tax"))," "),o(5),F(g(65,44,v(64,41,e.data==null?null:e.data.Data,"SalesWithTax")))}}var Ba=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/OutletGroupPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Year=T.getFullYear(),this.Month=T.getMonth(),this.Months=V.Months,this.Months.forEach(Ze=>Ze.Label=Ze.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}];first=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Purchase Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformancePurchase",Value:"Default",FileName:"Outlet Group Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.first&&(this.YearMonthToDateRange(),this.first=!1)}postInit(){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Count":return this.compare(t.Count,l.Count,h);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"SalesNet":return this.compare(t.Sales,l.Sales,h);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-group-performance"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],[1,"text-end",2,"width","100px"],["arrowPosition","before",1,"text-end",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"text-end",2,"width","150px",3,"mat-sort-header"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","Date Filter",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModelChange","change","clear","ngModel","items"],["name","compare",3,"modelChange","model"],[1,"text-end",3,"ngClass"],[3,"ngClass"]],template:function(r,t){r&1&&S(0,hS,66,48,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,se,re,Z,ne],encapsulation:2})};var SS=()=>["/menu/Reports/Purchases_Report/Outlet"],yS=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"];function DS(i,s){if(i&1){let e=I();n(0,"button",12),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",13),p(2," Export"),a()}}function vS(i,s){if(i&1){let e=I();n(0,"div")(1,"div",14)(2,"h6"),p(3,"Year"),a(),n(4,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(5,"h6"),p(6,"Purchase Order Tag"),a(),n(7,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function wS(i,s){if(i&1&&(n(0,"th",11),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function TS(i,s){if(i&1&&(n(0,"p",17),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(r[e])}}function PS(i,s){if(i&1&&(n(0,"p",17),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(g(2,1,r[e]))}}function FS(i,s){if(i&1&&(n(0,"td"),S(1,TS,2,1,"p",17),S(2,PS,3,3,"p",17),a()),i&2){let e=s.$implicit;o(),y(e=="Outlet"?1:-1),o(),y(e!="Outlet"?2:-1)}}function IS(i,s){if(i&1&&(n(0,"tr"),G(1,FS,3,2,"td",null,Y),a()),i&2){let e=s.$implicit,r=m(2);o(),H(r.getKey(e))}}function bS(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),F(g(2,1,e))}}function ES(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",18)(2,"td"),p(3,"Total : "),a(),G(4,bS,3,3,"td",null,Y),a()()),i&2){let e=m(2);o(4),H(e.data.DataFooter)}}function MS(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,DS,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," Outlet Report By "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Outlet Group "),a()()()()(),n(13,"filters"),E(14,vS,8,4,"ng-template",null,0,O),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr"),G(21,wS,2,2,"th",11,Y),a()(),n(23,"tbody"),G(24,IS,3,0,"tr",null,Y),a(),S(26,ES,6,0,"tfoot"),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,SS)),o(3),c("routerLink",M(9,yS)),o(10),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?26:-1)}}var Oa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/MonthlyOutletPerformancePurchase","ReportLoader/MonthlyReportPurchase");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0)}Years;openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Monthly Purchase Performance",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformancePurchase",Value:"Default",FileName:"Outlet Group Monthly Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((l,h)=>{let T=e.direction==="asc";for(let Ze=0;Ze<this.data.Dataheader.length;Ze++)if(e.active==this.data.Dataheader[Ze])return typeof l[this.data.Dataheader[Ze]]=="string"?t(l[this.data.Dataheader[Ze]].toLocaleLowerCase(),h[this.data.Dataheader[Ze]].toLocaleLowerCase(),T):t(l[this.data.Dataheader[Ze]],h[this.data.Dataheader[Ze]],T)});function t(l,h,T){return(l<h?-1:1)*(T?1:-1)}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-monthly-performance"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","","id","tableGrid",1,"table",3,"matSortChange"],[1,"table-light"],[3,"mat-sort-header"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],[2,"color","black"],[1,"table-footer"]],template:function(r,t){r&1&&S(0,MS,27,10,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,$,L,R,pe,ge,Z],encapsulation:2})};var VS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],BS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],OS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],LS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],RS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],kS=i=>({ID:i});function WS(i,s){if(i&1){let e=I();n(0,"a",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function NS(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",10),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",12)(8,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a(),n(9,"div")(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()()()}if(i&2){let e=m();o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(4),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function AS(i,s){if(i&1&&(n(0,"a",26),p(1),a()),i&2){let e=m().$implicit;c("queryParams",X(2,kS,e.CityID)),o(),F(e.CityName)}}function GS(i,s){if(i&1&&p(0),i&2){let e=m().$implicit;D(" ",e.CityName," ")}}function HS(i,s){if(i&1&&(n(0,"tr"),b(1,"td",25),n(2,"td"),S(3,AS,2,4,"a",26),S(4,GS,1,1),a(),b(5,"td",27),d(6,"number"),b(7,"td",27),d(8,"number"),b(9,"td",27),d(10,"number"),a()),i&2){let e=s.$implicit;o(),c("innerHtml",e.CityCode,Ee),o(2),y(e.CityID?3:-1),o(),y(e.CityID?-1:4),o(),c("innerHtml",g(6,6,e.Quantity),Ee),o(2),c("innerHtml",g(8,8,e.Total),Ee),o(2),c("innerHtml",g(10,10,e.Average),Ee)}}function QS(i,s){if(i&1){let e=I();n(0,"content")(1,"div",15)(2,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",17)(4,"tr")(5,"th",18),p(6,"Code"),a(),n(7,"th",19),p(8," Regional Name "),a(),n(9,"th",20),p(10," Quantity "),a(),n(11,"th",21),p(12," Total "),a(),n(13,"th",22),p(14," Avg. Price "),a()()(),n(15,"tbody"),G(16,HS,11,12,"tr",null,Y),a(),n(18,"tfoot")(19,"tr",23),b(20,"td",24),n(21,"td",24),p(22,"Total :"),a(),n(23,"td",24),p(24),d(25,"sum"),d(26,"quantityFraction"),a(),n(27,"td",24),p(28),d(29,"sum"),d(30,"amountFraction"),a(),n(31,"td",24),p(32),d(33,"sum"),d(34,"sum"),d(35,"amountFraction"),a()()()()()()}if(i&2){let e=m();o(16),H(e.data.List),o(8),D(" ",g(26,6,v(25,3,e.data.List,"Quantity"))," "),o(4),D(" ",g(30,11,v(29,8,e.data.List,"Total"))," "),o(4),D(" ",g(35,19,v(33,13,e.data.List,"Total")/v(34,16,e.data.List,"Quantity"))," ")}}var La=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/CitySales","ReportLoader/CitySalesLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}postInit(e){this.menuData.H=e.PageTitle}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"CityCode":return this.compare(t.CityCode,l.CityCode,h);case"CityName":return this.compare(t.CityName,l.CityName,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Average":return this.compare(t.Average,l.Average,h);case"Total":return this.compare(t.Total,l.Total,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"City Report",exportTypes:[{ID:"ReportExport/CitySalesExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-city"]],standalone:!1,features:[W],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","CityCode",2,"width","80px"],["mat-sort-header","CityName",2,"width","220px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Average","arrowPosition","before",1,"flex-right",2,"width","100px"],[1,"table-footer"],[1,"text-end"],[3,"innerHtml"],["routerLink","/menu/Contacts/Option_Values/City/Form",3,"queryParams"],[1,"text-end",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,WS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,NS,13,6,"ng-template",null,0,O),a(),S(25,QS,36,21,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,VS)),o(3),c("routerLink",M(12,BS)),o(3),c("routerLink",M(13,OS)),o(3),c("routerLink",M(14,LS)),o(3),c("routerLink",M(15,RS)),o(5),y(t.data?25:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,Ce,se,re,Z,ne],encapsulation:2})};var YS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],jS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],qS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],US=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],zS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function KS(i,s){if(i&1){let e=I();n(0,"a",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function XS(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",12)(8,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function JS(i,s){i&1&&(n(0,"th",20),p(1,"Cost"),a())}function ZS(i,s){i&1&&(n(0,"th",20),p(1,"Profit"),a())}function $S(i,s){if(i&1&&(b(0,"td",28),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.Cost),Ee)}}function ey(i,s){if(i&1&&(b(0,"td",27),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.Profit),Ee)}}function ty(i,s){if(i&1&&(n(0,"tr"),b(1,"td",25)(2,"td",26),d(3,"number"),b(4,"td",26),d(5,"quantityFraction"),b(6,"td",26),d(7,"amountFraction"),b(8,"td",27),d(9,"amountFraction"),S(10,$S,2,3,"td",28),S(11,ey,2,3,"td",27),a()),i&2){let e=s.$implicit,r=m(2);o(),c("innerHtml",e.GroupName,Ee),o(),c("innerHtml",g(3,7,e.Count),Ee),o(2),c("innerHtml",g(5,9,e.Quantity),Ee),o(2),c("innerHtml",g(7,11,e.Gross),Ee),o(2),c("innerHtml",g(9,13,e.Sales),Ee),o(2),y(r.roleService.product.Cost?10:-1),o(),y(r.roleService.report.Profit?11:-1)}}function iy(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(3,4,v(2,1,e.data.Data,"Cost")))}}function ny(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(3,4,v(2,1,e.data.Data,"Profit")))}}function ay(i,s){if(i&1){let e=I();n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",17)(5,"tr")(6,"th",18),p(7,"Group Name"),a(),n(8,"th",19),p(9,"Orders"),a(),n(10,"th",20),p(11,"Quantity"),a(),n(12,"th",20),p(13,"Gross"),a(),n(14,"th",20),p(15,"Sales"),a(),S(16,JS,2,0,"th",20),S(17,ZS,2,0,"th",20),a()(),n(18,"tbody"),G(19,ty,12,15,"tr",null,Y),a(),n(21,"tfoot")(22,"tr",21),b(23,"td",22),n(24,"td",22),p(25),d(26,"sum"),d(27,"number"),a(),n(28,"td",22),p(29),d(30,"sum"),d(31,"quantityFraction"),a(),n(32,"td",22),p(33),d(34,"sum"),d(35,"amountFraction"),a(),n(36,"td",23),p(37),d(38,"sum"),d(39,"amountFraction"),a(),S(40,iy,4,6,"td",24),S(41,ny,4,6,"td",23),a()()()()()()}if(i&2){let e=m();o(16),y(e.roleService.product.Cost?16:-1),o(),y(e.roleService.report.Profit?17:-1),o(2),H(e.data.Data),o(6),F(g(27,11,v(26,8,e.data.Data,"Count"))),o(4),F(g(31,16,v(30,13,e.data.Data,"Quantity"))),o(4),F(g(35,21,v(34,18,e.data.Data,"Gross"))),o(4),F(g(39,26,v(38,23,e.data.Data,"Sales"))),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.report.Profit?41:-1)}}var Ra=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/CustomerGroup","ReportLoader/CustomerGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}first=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Customer Group",exportTypes:[{ID:"ReportExport/CustomerGroup",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"GroupName":return this.compare(t.GroupName,l.GroupName,h);case"Trans":return this.compare(t.Trans,l.Trans,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Gross":return this.compare(t.Gross,l.Gross,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-customer-group"]],standalone:!1,features:[W],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],[1,"text-end","text-success",3,"innerHtml"],[1,"text-end","text-danger",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,KS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,XS,9,5,"ng-template",null,0,O),a(),S(25,ay,42,28,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,YS)),o(3),c("routerLink",M(12,jS)),o(3),c("routerLink",M(13,qS)),o(3),c("routerLink",M(14,US)),o(3),c("routerLink",M(15,zS)),o(5),y(t.data?25:-1))},dependencies:[A,Q,J,L,R,pe,U,se,re,Z,ne],encapsulation:2})};var oy=()=>["/menu/Reports/Sales_Report/Standard/Person"],ry=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],ly=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],py=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],my=(i,s)=>({From:i,To:s});function sy(i,s){if(i&1){let e=I();n(0,"a",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function cy(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",14),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",15)(8,"datepicker",16),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function dy(i,s){i&1&&(n(0,"th",22),p(1," Profit "),a())}function uy(i,s){if(i&1&&(b(0,"td",33),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.ActualProfit),Ee)}}function _y(i,s){if(i&1&&(n(0,"tr"),b(1,"td",30)(2,"td",31),d(3,"number"),b(4,"td",31),d(5,"amountFraction"),b(6,"td",31),d(7,"amountFraction"),b(8,"td",31),d(9,"number"),E(10,uy,2,3,"td",32),a()),i&2){let e=s.$implicit,r=m(2);o(),c("innerHtml",e.Name,Ee),o(),c("innerHtml",g(3,6,e.InvoiceCount),Ee),o(2),c("innerHtml",g(5,8,e.NetRevenue),Ee),o(2),c("innerHtml",g(7,10,e.SalesTarget),Ee),o(2),c("innerHtml",v(9,12,e.Percentage,"1.0-2"),Ee),o(2),c("ngIf",r.roleService.report.Profit)}}function gy(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ActualProfit"))," ")}}function Cy(i,s){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr",21)(6,"th"),p(7,"Group Name"),a(),n(8,"th",22),p(9,"Count"),a(),n(10,"th",22),p(11,"Actual"),a(),n(12,"th",22),p(13,"Target"),a(),n(14,"th",22)(15,"span",23),p(16," % "),a()(),E(17,dy,2,0,"th",24),a()(),n(18,"tbody"),E(19,_y,11,15,"tr",25),a(),n(20,"tfoot")(21,"tr",26),b(22,"td",27)(23,"td",27),n(24,"td",28),p(25),d(26,"sum"),d(27,"amountFraction"),a(),b(28,"td",27)(29,"td",27),E(30,gy,4,6,"td",29),a()()()()()()}if(i&2){let e=m();o(17),c("ngIf",e.roleService.report.Profit),o(2),c("ngForOf",e.data.Data),o(6),D(" ",g(27,7,v(26,4,e.data.Data,"GrossRevenue"))," "),o(5),c("ngIf",e.roleService.report.Profit)}}var ka=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/SalesGroup","ReportLoader/SalesGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}first=!0;preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/SalesGroup",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-group"]],standalone:!1,features:[W],decls:26,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"btn","btn-outline-secondary"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end",2,"width","120px"],["matTooltip","(Actual / Target) * 100","matTooltipPosition","above"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],["class","text-end text-success",3,"innerHtml",4,"ngIf"],[1,"text-end","text-success",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2),S(3,sy,3,0,"a",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"Summary"),a()(),n(11,"li")(12,"a",7),p(13,"By Outlet"),a()(),n(14,"li")(15,"a",7),p(16,"By Employee"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),E(23,cy,9,5,"ng-template",null,0,O),a(),E(25,Cy,31,9,"content",9),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(3),y(t.roleService!=null&&t.roleService.global.Export?3:-1),o(6),c("routerLink",M(17,oy)),o(3),c("routerLink",M(18,ry)),o(3),c("routerLink",M(19,ly)),o(3),c("routerLink",M(20,py))("queryParams",fe(21,my,v(19,11,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),v(20,14,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,J,L,R,ie,pe,U,se,re,oe,Z],encapsulation:2})};var fy=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report/By_Outlet"],xy=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],hy=i=>({ID:i});function Sy(i,s){i&1&&(n(0,"a",5),p(1,"By Outlet"),a()),i&2&&c("routerLink",M(1,fy))}function yy(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function Dy(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div",10)(7,"div",11)(8,"datepicker",12),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()()(),n(9,"div",13)(10,"div",11)(11,"datepicker",14),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()(),n(12,"h6"),p(13,"Tax"),a(),n(14,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(15,"h6"),p(16,"Page Size"),a(),n(17,"input",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(5),C("date",e.pageData.Filter.From),o(3),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function vy(i,s){if(i&1&&b(0,"th",41),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function wy(i,s){if(i&1&&(b(0,"td",46),d(1,"TaxDefault"),d(2,"amountFraction")),i&2){let e=s.index,r=m().$implicit,t=m(2);c("innerHtml",g(2,5,fi(1,1,t.data.Compenents,r,e)),Ee)}}function Ty(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",42),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td"),p(9),a(),n(10,"td"),p(11),d(12,"date"),a(),n(13,"td",43),p(14),d(15,"amountFraction"),a(),n(16,"td",44),p(17),d(18,"amountFraction"),a(),E(19,wy,3,7,"td",45),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(17,xy))("queryParams",X(18,hy,e.ID)),o(),F(e.Number),o(2),F(e.Name),o(2),F(e.TaxName),o(2),F(v(12,10,e.Date,"dd MMM yyyy")),o(3),F(g(15,13,e.Sales)),o(3),D(" ",g(18,15,e.Tax)," "),o(2),c("ngForOf",r.getComponent(r.data))}}function Py(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e.SumTaxAmount)," ")}}function Fy(i,s){if(i&1){let e=I();n(0,"span",48),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport"))}),n(1,"i",49),p(2,"?"),a()()}}function Iy(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function by(i,s){if(i&1){let e=I();n(0,"a",50),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",51),p(2," Next"),a()}}function Ey(i,s){if(i&1){let e=I();n(0,"a",52),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport",!0))}),b(1,"i",53),p(2," Show All"),a()}}function My(i,s){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr")(6,"th",21),p(7,"Outlet"),a(),n(8,"th",22),p(9,"Number"),a(),n(10,"th",23),p(11,"Name"),a(),n(12,"th",24),p(13," Type "),a(),n(14,"th",25),p(15,"Date"),a(),n(16,"th",26),p(17," Sales "),a(),n(18,"th",27),p(19," Tax "),a(),E(20,vy,1,1,"th",28),a()(),n(21,"tbody"),E(22,Ty,20,20,"tr",29),a(),n(23,"tfoot")(24,"tr",30),b(25,"td",31),n(26,"td",32),p(27),d(28,"sum"),d(29,"amountFraction"),a(),n(30,"td",32),p(31),d(32,"sum"),d(33,"amountFraction"),a(),E(34,Py,3,3,"td",33),a()()()(),n(35,"div",34)(36,"div",35)(37,"div",36),p(38),d(39,"number"),E(40,Fy,3,0,"span",37)(41,Iy,3,3,"span",4),p(42),a()(),n(43,"div",38),E(44,by,3,0,"a",39)(45,Ey,3,0,"a",40),a()()()()}if(i&2){let e=m();o(20),c("ngForOf",e.data.Compenents),o(2),c("ngForOf",e.infiniteList),o(5),D(" ",g(29,14,v(28,11,e.infiniteList,"Sales"))," "),o(4),D(" ",g(33,19,v(32,16,e.infiniteList,"Tax"))," "),o(3),c("ngForOf",e.data.Compenents),o(4),D(" Showing 1 - ",g(39,21,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Wa=class i extends vi{constructor(e,r,t,l,h,T){super(e,r,"Report/GetSalesTaxReport","ReportLoader/GetTaxReport",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.toastrService=T}timeTo;timeFrom;getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),h);case"Number":return this.compare(t.Number,l.Number,h);case"Date":return this.compare(t.Date,l.Date,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Tax Report",exportTypes:[{ID:"ReportExport/GetSalesTaxReport",Value:"Default",FileName:"Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-tax-report"]],standalone:!1,features:[W],decls:8,vars:7,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3","matTooltipPosition","above","matTooltip","Tax Report By Outlet",3,"routerLink",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-3",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],["style","width: 150px","class","align-right text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more reports",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all reports",3,"click",4,"ngIf"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end",2,"width","150px"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more reports",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all reports",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,Sy,2,2,"a",2)(3,yy,3,0,"a",3),a(),n(4,"filters"),E(5,Dy,18,10,"ng-template",null,0,O),a(),E(7,My,46,23,"content",4),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,Qe,L,R,ie,pe,ge,Ue,U,se,Fi,re,oe,Z],encapsulation:2})};var Vy=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report"];function By(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function Oy(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",10)(8,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Tax"),a(),n(11,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("clearable",!1)}}function Ly(i,s){i&1&&(n(0,"th",17),p(1,"Total Tax"),a())}function Ry(i,s){if(i&1&&b(0,"th",18),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function ky(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),F(v(2,1,e.Tax,r.pageData.FractionDigit))}}function Wy(i,s){if(i&1&&(b(0,"td",18),d(1,"TaxDefault"),d(2,"number")),i&2){let e=s.$index,r=m().$implicit,t=m(2);c("innerHtml",v(2,5,fi(1,1,t.data.Compenents,r,e),t.pageData.FractionDigit),Ee)}}function Ny(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),S(6,ky,3,4,"td",23),G(7,Wy,3,8,"td",18,Y),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),F(v(5,3,e.Sales,r.pageData.FractionDigit)),o(2),y(r.data.Compenents.length==0?6:-1),o(),H(r.getComponent(e))}}function Ay(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Tax"),e.pageData.FractionDigit))}}function Gy(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.SumTaxAmount,r.pageData.FractionDigit)," ")}}function Hy(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",13),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",14)(3,"tr")(4,"th",15),p(5,"Outlet"),a(),n(6,"th",16),p(7,"Sales"),a(),S(8,Ly,2,0,"th",17),G(9,Ry,1,1,"th",18,Y),a()(),n(11,"tbody"),G(12,Ny,9,6,"tr",null,Y),a(),n(14,"tfoot")(15,"tr",19),b(16,"td",20),n(17,"td",21),p(18),d(19,"sum"),d(20,"number"),a(),S(21,Ay,4,7,"td",21),G(22,Gy,3,4,"td",22,Y),a()()()()}if(i&2){let e=m();o(8),y(e.data.Compenents.length==0?8:-1),o(),H(e.data.Compenents),o(3),H(e.data.Data),o(6),F(v(20,6,v(19,3,e.data.Data,"Sales"),e.pageData.FractionDigit)),o(3),y(e.data.Compenents.length==0?21:-1),o(),H(e.data.Compenents)}}var Na=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetTaxReportbyOutlet","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}openExportModal(){this.matDialog.open(K,{data:{title:"Tax Report by Outlet",exportTypes:[{ID:"ReportExport/GetTaxReportbyOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.EntityName,l.EntityName,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-tax-report-by-outlet"]],standalone:!1,features:[W],decls:10,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-6",3,"routerLink"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items","clearable"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),p(3,"Tax Report"),a(),S(4,By,3,0,"a",3),a(),n(5,"filters"),E(6,Oy,12,8,"ng-template",null,0,O),a(),n(8,"content"),S(9,Hy,24,9,"div",4),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("routerLink",M(8,Vy)),o(2),y(t.roleService!=null&&t.roleService.global.Export?4:-1),o(5),y(t.data?9:-1))},dependencies:[A,Q,$,J,L,R,ie,pe,ge,U,se,Fi,re],encapsulation:2})};var Qy=()=>["/menu/Products/Catalog/Variants/Info"],Yy=i=>({ID:i});function jy(i,s){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function qy(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.SalesID)}}function Uy(i,s){i&1&&(n(0,"th",26),p(1," Category "),a())}function zy(i,s){i&1&&(n(0,"th",27),p(1,"Code"),a())}function Ky(i,s){i&1&&(n(0,"th",28),p(1," Release Date "),a())}function Xy(i,s){i&1&&(n(0,"th",29),p(1," Days Count "),a())}function Jy(i,s){i&1&&(n(0,"th",30),p(1," Last Sold "),a())}function Zy(i,s){i&1&&(n(0,"th",31),p(1," Last Purchased "),a())}function $y(i,s){i&1&&(n(0,"th",32),p(1," Days Purchased "),a())}function eD(i,s){i&1&&(n(0,"th",33),p(1," Qty "),a())}function tD(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Category)}}function iD(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function nD(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.Released?v(2,1,e.Released,"dd MMM yyyy"):"-"," ")}}function aD(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DaysCount!=null?g(2,1,e.DaysCount):"-"," ")}}function oD(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.LastSold?v(2,1,e.LastSold,"dd MMM yyyy"):"-"," ")}}function rD(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.LastPurchased?v(2,1,e.LastPurchased,"dd MMM yyyy"):"-"," ")}}function lD(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DaysSinceLastPurchased!=null?g(2,1,e.DaysSinceLastPurchased):"-"," ")}}function pD(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function mD(i,s){if(i&1&&(n(0,"tr",34),E(1,tD,2,1,"td",3),n(2,"td")(3,"a",35),p(4),a()(),E(5,iD,2,1,"td",3)(6,nD,3,4,"td",3)(7,aD,3,3,"td",36)(8,oD,3,4,"td",3)(9,rD,3,4,"td",3)(10,lD,3,3,"td",37)(11,pD,3,3,"td",38),a()),i&2){let e=s.$implicit,r=m(2);o(),c("ngIf",r.column.Category.selected),o(2),c("routerLink",M(11,Qy))("queryParams",X(12,Yy,e.ID)),o(),F(e.Name),o(),c("ngIf",r.column.Code.selected),o(),c("ngIf",r.column.ReleaseDate.selected),o(),c("ngIf",r.column.DaysCount.selected),o(),c("ngIf",r.column.LastSold.selected),o(),c("ngIf",r.column.LastPurchased.selected),o(),c("ngIf",r.column.DaysPurchased.selected),o(),c("ngIf",r.column.QTY.selected)}}function sD(i,s){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",15)(4,"tr"),E(5,Uy,2,0,"th",16),n(6,"th",17),p(7,"Name"),a(),E(8,zy,2,0,"th",18)(9,Ky,2,0,"th",19)(10,Xy,2,0,"th",20)(11,Jy,2,0,"th",21)(12,Zy,2,0,"th",22)(13,$y,2,0,"th",23)(14,eD,2,0,"th",24),a()(),n(15,"tbody"),E(16,mD,12,14,"tr",25),a()()()()}if(i&2){let e=m();o(5),c("ngIf",e.column.Category.selected),o(3),c("ngIf",e.column.Code.selected),o(),c("ngIf",e.column.ReleaseDate.selected),o(),c("ngIf",e.column.DaysCount.selected),o(),c("ngIf",e.column.LastSold.selected),o(),c("ngIf",e.column.LastPurchased.selected),o(),c("ngIf",e.column.DaysPurchased.selected),o(),c("ngIf",e.column.QTY.selected),o(2),c("ngForOf",e.oriData.Data)}}var Aa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/ProductLifeCycle","ReportLoader/ProductLifeCycle",h);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.toastrService=h}roleService=Pe(j);columnService=Pe(gt);column={Category:{selected:!1,name:"Category"},Code:{selected:!0,name:"Code"},ReleaseDate:{selected:!0,name:"Release Date"},DaysCount:{selected:!1,name:"Days Count"},LastSold:{selected:!0,name:"Last Sold"},LastPurchased:{selected:!0,name:"Last Purchased"},DaysPurchased:{selected:!1,name:"Days Purchased"},QTY:{selected:!0,name:"Quantity"}};oriData;sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.oriData;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc",T=typeof t[e.active];switch(V.IsEmpty(t.Code)&&(t.Code=""),V.IsEmpty(l.Code)&&(l.Code=""),V.IsEmpty(t.Released)&&(t.Release=""),V.IsEmpty(l.Released)&&(l.Release=""),V.IsEmpty(t.LastPurchased)&&(t.LastPurchased=""),V.IsEmpty(l.LastPurchased)&&(l.LastPurchased=""),V.IsEmpty(t.LastSold)&&(t.LastSold=""),V.IsEmpty(l.LastSold)&&(l.LastSold=""),T){case"string":return this.compare(t[e.active].toLocaleLowerCase(),l[e.active].toLocaleLowerCase(),h);case"number":return this.compare(t[e.active],l[e.active],h);default:return 0}})}preGetList(){this.pageData.Filter.EntityID||delete this.pageData.Filter.EntityID}postInit(e){this.oriData=e,console.log(e),this.menuData=nt(et({},this.menuData),{SH:e.PageTitle})}openExportModal(){this.matDialog.open(K,{data:{title:"Product Life Cycle",exportTypes:[{ID:"ReportExport/ProductLifeCycle",Value:"Default",FileName:"Product Life Cycle"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-life-cycle"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Category",4,"ngIf"],["mat-sort-header","Name"],["mat-sort-header","Code",4,"ngIf"],["mat-sort-header","Released",4,"ngIf"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above","mat-sort-header","DaysCount",4,"ngIf"],["mat-sort-header","LastSold",4,"ngIf"],["mat-sort-header","LastPurchased",4,"ngIf"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above","mat-sort-header","DaysSinceLastPurchased",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","flex-right text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["mat-sort-header","Category"],["mat-sort-header","Code"],["mat-sort-header","Released"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above","mat-sort-header","DaysCount"],["mat-sort-header","LastSold"],["mat-sort-header","LastPurchased"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above","mat-sort-header","DaysSinceLastPurchased"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right","text-end"],[1,"border-bottom"],[3,"routerLink","queryParams"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above",4,"ngIf"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above",4,"ngIf"],["class","text-end",4,"ngIf"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,jy,3,0,"a",2),a(),n(3,"filters"),E(4,qy,15,8,"ng-template",null,0,O),a(),E(6,sD,17,9,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,J,L,R,ie,pe,ge,Ce,U,ze,re,oe,ne],encapsulation:2})};function cD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function dD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Supplier"),a(),n(14,"autocompleteV2",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(15,"h6"),p(16,"Row Count"),a(),n(17,"input",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function uD(i,s){i&1&&(n(0,"th",21),p(1,"Total Cost"),a())}function _D(i,s){i&1&&(n(0,"th",21),p(1,"Total profit "),a())}function gD(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalCost))}}function CD(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalProfit))}}function fD(i,s){if(i&1&&(n(0,"tr",23)(1,"td",24),p(2),a(),n(3,"td",24),p(4),a(),n(5,"td"),p(6),a(),n(7,"td"),p(8),a(),n(9,"td",25),p(10),d(11,"quantityFraction"),a(),n(12,"td",25),p(13),d(14,"quantityFraction"),a(),n(15,"td",25),p(16),d(17,"amountFraction"),a(),S(18,gD,3,3,"td",26),S(19,CD,3,3,"td",25),n(20,"td",25),p(21),d(22,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.PrevRank||"-"),o(2),F(e.Rank),o(2),F(e.Name),o(2),F(e.Code),o(2),F(g(11,10,e.Quantity)),o(3),F(g(14,12,e.OnHand)),o(3),F(g(17,14,e.TotalAmount)),o(2),y(r.roleService.product.Cost?18:-1),o(),y(r.roleService.report.Profit?19:-1),o(2),F(g(22,16,e.Margin))}}function xD(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data,"TotalCost")))}}function hD(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data,"TotalProfit")))}}function SD(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",27),b(2,"td",28),n(3,"td",29),p(4,"Total:"),a(),n(5,"td",29),p(6),d(7,"sum"),d(8,"quantityFraction"),a(),n(9,"td",29),p(10),d(11,"sum"),d(12,"quantityFraction"),a(),n(13,"td",29),p(14),d(15,"sum"),d(16,"amountFraction"),a(),S(17,xD,4,6,"td",29),S(18,hD,4,6,"td",29),a()()),i&2){let e=m(2);o(6),F(g(8,8,v(7,5,e.data,"Quantity"))),o(4),F(g(12,13,v(11,10,e.data,"OnHand"))),o(4),F(g(16,18,v(15,15,e.data,"TotalAmount"))),o(3),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.report.Profit?18:-1)}}function yD(i,s){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",16)(5,"tr")(6,"th",17),p(7,"Prev"),a(),n(8,"th",17),p(9,"Now"),a(),n(10,"th",18),p(11,"Name"),a(),n(12,"th",19),p(13,"Code"),a(),n(14,"th",17),p(15,"Sold"),a(),n(16,"th",20),p(17,"On Hand"),a(),n(18,"th",21),p(19,"Total Amount"),a(),S(20,uD,2,0,"th",21),S(21,_D,2,0,"th",21),n(22,"th",22),p(23,"%"),a()()(),n(24,"tbody"),G(25,fD,23,18,"tr",23,Y),a(),S(27,SD,19,20,"tfoot"),a()()()()}if(i&2){let e=m();o(20),y(e.roleService.product.Cost?20:-1),o(),y(e.roleService.report.Profit?21:-1),o(4),H(e.data.Data),o(2),y(e.data.length>0?27:-1)}}var Ga=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetReportProductProfit","ReportLoader/GetReportProductProfit",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.toastrService=T}RadioGroupBy=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];originalData;openExportModal(){this.matDialog.open(K,{data:{title:"Product Profit Report",exportTypes:[{ID:"ReportExport/GetReportProductProfit",Value:"Default",FileName:"Product Profit Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.originalData=e.Data}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";return this.compare(t[e.active],l[e.active],h)})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-profit"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","100px"],[2,"width","600px"],[2,"width","100px"],["matTooltip","On Hand Inventory",1,"text-end",2,"width","200px"],[1,"text-end",2,"width","200px"],["mat-sort-header","Margin",1,"text-end","align-right",2,"width","200px"],[1,"border-bottom"],[1,"text-end",2,"width","35px"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,cD,3,0,"a",2),a(),n(3,"filters"),E(4,dD,18,10,"ng-template",null,0,O),a(),S(6,yD,28,3,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,ie,pe,ge,Ue,Ae,Ce,U,se,Z,ne],encapsulation:2})};var DD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],vD=i=>({ID:i});function wD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function TD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function PD(i,s){if(i&1&&(n(0,"tr",14)(1,"td")(2,"a",15),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),a(),n(8,"td"),p(9),d(10,"quantityFraction"),a(),n(11,"td"),p(12),d(13,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(11,DD))("queryParams",X(12,vD,e.ID)),o(),F(e.InvoiceNumber),o(2),F(e.Name),o(2),F(e.Code),o(2),F(g(10,7,e.Quantity)),o(3),F(g(13,9,e.Price))}}function FD(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"table",12)(3,"thead",13)(4,"tr")(5,"th"),p(6,"Number"),a(),n(7,"th"),p(8,"Name"),a(),n(9,"th"),p(10,"Code"),a(),n(11,"th"),p(12,"Quantity"),a(),n(13,"th"),p(14,"Price"),a()()(),n(15,"tbody"),G(16,PD,14,14,"tr",14,Y),a()()()()),i&2){let e=m();o(16),H(e.data.Data)}}var Ha=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetExchangedSales","ReportLoader/GetExchangedSales",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.toastrService=T}openExportModal(){this.matDialog.open(K,{data:{title:"Exchanged Sales Report",exportTypes:[{ID:"ReportExport/GetExchangedSales",Value:"Default",FileName:"Exchanged Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-exchanged-sales"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border-bottom"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,wD,3,0,"a",2),a(),n(3,"filters"),E(4,TD,12,7,"ng-template",null,0,O),a(),S(6,FD,18,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ce,U,Z,ne],encapsulation:2})};function ID(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function bD(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product by Name"),a(),n(3,"autocompleteV2",12),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("ngModel",e.pageData.Filter.ProductID)}}function ED(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product by Code"),a(),n(3,"autocompleteV2",13),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("ngModel",e.pageData.Filter.ProductID)}}function MD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",7),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",8)(8,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Search By"),a(),n(11,"radio-options",10),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SearchBy,t)||(l.pageData.Filter.SearchBy=t),_(t)}),a(),S(12,bD,4,1,"div"),S(13,ED,4,1,"div"),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.SearchBy),c("options",e.RadioSearchBy),o(),y(e.pageData.Filter.SearchBy?12:-1),o(),y(e.pageData.Filter.SearchBy?-1:13),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function VD(i,s){if(i&1&&(n(0,"tr",20)(1,"td",21),p(2),a(),n(3,"td"),p(4),a(),n(5,"td",21),p(6),d(7,"quantityFraction"),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a()()),i&2){let e=s.$implicit;o(2),F(e.Rank),o(2),F(e.Name),o(2),F(g(7,4,e.Quantity)),o(3),F(g(10,6,e.OnHand))}}function BD(i,s){if(i&1&&(n(0,"content")(1,"div",14)(2,"table",15)(3,"thead",16)(4,"tr")(5,"th",17),p(6,"Rank"),a(),n(7,"th",18),p(8,"Name"),a(),n(9,"th",19),p(10,"Sold"),a(),n(11,"th",19),p(12,"Inventory"),a()()(),n(13,"tbody"),G(14,VD,11,8,"tr",20,Y),a()()()()),i&2){let e=m();o(14),H(e.data.Data)}}var Qa=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetSalesRankByVariantModel","ReportLoader/GetSalesRankByVariantModel",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.toastrService=T}RadioSearchBy=[{Key:!0,Value:"Name"},{Key:!1,Value:"Code"}];openExportModal(){this.matDialog.open(K,{data:{title:"Variant Model Rank Report",exportTypes:[{ID:"ReportExport/GetSalesRankByVariantModel",Value:"Default",FileName:"Variant Model Rank Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-variant-model-rank"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Search By",3,"modelChange","model","options"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestion","placeholder","Search by Name",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCode","placeholder","Search by Code",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","70px"],[2,"width","800px"],[1,"text-end",2,"width","100px"],[1,"border-bottom"],[1,"text-end"],[1,"text-success","text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ID,3,0,"a",2),a(),n(3,"filters"),E(4,MD,17,11,"ng-template",null,0,O),a(),S(6,BD,16,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,Ue,Te,Ae,U,ne],encapsulation:2})};var OD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],LD=i=>({ID:i});function RD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function kD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function WD(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",20),p(5),a()(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),a(),n(11,"td"),p(12),a(),n(13,"td",16),p(14),d(15,"quantityFraction"),a(),n(16,"td",16),p(17),d(18,"amountFraction"),a(),n(19,"td",21),p(20),a(),n(21,"td",16),p(22),d(23,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(e.EntityName),o(2),c("routerLink",M(20,OD))("queryParams",X(21,LD,e.InvoiceID)),o(),F(e.Number),o(2),F(v(8,11,e.Date,"dd MMM yyyy")),o(3),F(e.Name),o(2),F(e.Code),o(2),D("(",g(15,14,e.Quantity),")"),o(3),F(g(18,16,e.UnitPrice)),o(3),D("",e.Discount&&e.Discount!=0?-e.Discount+"%":""," "),o(2),D("(",g(23,18,e.Total),")")}}function ND(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"div",12)(3,"table",13)(4,"thead",14)(5,"tr")(6,"th"),p(7,"Outlet"),a(),n(8,"th",15),p(9,"Number"),a(),n(10,"th"),p(11,"Date"),a(),n(12,"th"),p(13,"Name"),a(),n(14,"th"),p(15,"Code"),a(),n(16,"th",16),p(17,"Quantity"),a(),n(18,"th",16),p(19),a(),n(20,"th",17),p(21,"%"),a(),n(22,"th",16),p(23),a()()(),n(24,"tbody"),G(25,WD,24,23,"tr",null,Y),a(),n(27,"tfoot")(28,"tr",18),b(29,"td",19)(30,"td",19)(31,"td",19)(32,"td",19)(33,"td",19),n(34,"td",16),p(35),d(36,"sum"),d(37,"quantityFraction"),a(),b(38,"td",19)(39,"td",19),n(40,"td",16),p(41),d(42,"sum"),d(43,"amountFraction"),a()()()()()()()),i&2){let e=m();o(19),D("Price (",e.data.CurrencySymbol,")"),o(4),D("Total(",e.data.CurrencySymbol,")"),o(2),H(e.data.Data),o(10),F(g(37,7,v(36,4,e.data.Data,"Quantity"))),o(6),F(g(43,12,v(42,9,e.data.Data,"Total")))}}var Ya=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/SalesReturnList","ReportLoader/ReturnReportLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}month;year;openExportModal(){this.matDialog.open(K,{data:{title:"Sales Return",exportTypes:[{ID:"ReportExport/SalesReturnExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.menuData.H=e.PageTitle}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-return"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end"],[2,"width","30px"],[1,"table-footer"],[1,"empty-column"],[3,"routerLink","queryParams"],[1,"text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,RD,3,0,"a",2),a(),n(3,"filters"),E(4,kD,12,6,"ng-template",null,0,O),a(),S(6,ND,44,14,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ae,U,se,oe,Z,ne],encapsulation:2})};var AD=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],GD=i=>({ID:i});function HD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function QD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Supplier"),a(),n(6,"autocompleteV2",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function YD(i,s){i&1&&(n(0,"th",15),p(1,"Unit Cost"),a())}function jD(i,s){if(i&1&&(b(0,"td",36),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.UnitPrice),Ee)}}function qD(i,s){if(i&1&&(n(0,"tr",24)(1,"td",31),b(2,"span",32),a(),b(3,"td",33),n(4,"td",34),p(5),d(6,"quantityFraction"),a(),b(7,"td",35),S(8,jD,2,3,"td",36),n(9,"td",37),p(10),d(11,"amountFraction"),a(),b(12,"td",36),d(13,"amountFraction"),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("innerHtml",e.Name,Ee),o(),c("innerHtml",e.Code,Ee),o(2),D("(",g(6,7,e.Quantity),")"),o(2),c("innerHtml",e.UOMName,Ee),o(),y(r.roleService.product.Cost?8:-1),o(2),D(" ",e.Discount==0?"":"-"+g(11,9,e.Discount)+"%"),o(2),c("innerHtml",g(13,11,e.Total),Ee)}}function UD(i,s){i&1&&(n(0,"td",28),p(1,"\xA0"),a())}function zD(i,s){if(i&1&&(n(0,"div")(1,"div",18)(2,"a",19),b(3,"span",20),d(4,"date"),d(5,"date"),a(),n(6,"span"),p(7),d(8,"showIfNotNullOrEmptyString"),a()(),b(9,"span",21),n(10,"div",22)(11,"div")(12,"table",23),b(13,"thead"),n(14,"tbody"),G(15,qD,14,13,"tr",24,Y),a()()()(),n(17,"table",25)(18,"thead")(19,"tr",26)(20,"td",27),p(21,"Total"),a(),n(22,"td",28),p(23,"\xA0"),a(),n(24,"td",15),p(25),d(26,"sum"),d(27,"quantityFraction"),a(),b(28,"td",29),S(29,UD,2,0,"td",28),n(30,"td",30),p(31,"\xA0"),a(),n(32,"td",15),p(33),d(34,"sum"),d(35,"amountFraction"),a()()()()()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(27,AD))("queryParams",X(28,GD,e.InvoiceID)),o(),c("innerHtml",e.EntityName+" #"+e.Number+" - "+v(4,8,e.Date,"dd MMM yyyy")+" ("+v(5,11,e.Created,"HH:mm")+")",Ee),o(4),D(" ",v(8,14,e.CustomerNameDisplay," - {0}")," "),o(2),c("innerHtml",e.Note,Ee),o(6),H(e.Item),o(10),D("",g(27,20,v(26,17,e.Item,"Quantity")),"\xA0"),o(4),y(r.roleService.product.Cost?29:-1),o(4),D("",g(35,25,v(34,22,e.Item,"Total")),"\xA0 ")}}function KD(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"table",12)(3,"thead",13)(4,"tr")(5,"th"),p(6,"Name"),a(),n(7,"th",14),p(8,"Code"),a(),n(9,"th",15),p(10,"Quantity"),a(),n(11,"th",16),p(12,"UOM"),a(),S(13,YD,2,0,"th",15),n(14,"th",17),p(15,"%"),a(),n(16,"th",15),p(17,"Total(Rp.)"),a()()()(),G(18,zD,36,30,"div",null,Y),a()()),i&2){let e=m();o(13),y(e.roleService.product.Cost?13:-1),o(5),H(e.data.Data)}}var ja=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/PurchaseReturnList","ReportLoader/ReturnReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Return",exportTypes:[{ID:"ReportExport/PurchaseReturnList",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-return"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"UOMWidth",2,"width","50px"],[2,"width","5%"],[1,"mt-7"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHtml"],[1,"mt-3","mb-3",3,"innerHtml"],[1,"items"],["cellspacing","0",1,"table","table-sm"],[1,"border-top"],[1,"w-100"],[1,"table-footer"],[1,"empty-column"],[1,"empty-column",2,"width","10%"],[1,"empty-column",2,"width","50px"],[1,"empty-column",2,"width","5%"],[1,"border-start","border-end"],[3,"innerHtml"],[1,"border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%"],[1,"UOMWidth","border-start","border-end",2,"width","50px",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"small","text-danger","border-start","border-end",2,"width","5%"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,HD,3,0,"a",2),a(),n(3,"filters"),E(4,QD,12,6,"ng-template",null,0,O),a(),S(6,KD,20,1,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ae,U,se,On,oe,Z,ne],encapsulation:2})};var XD=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],JD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],dl=i=>({ID:i});function ZD(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.exportCSV(t.csvConverter,"Report/ProductSalesByInvoice","Invoice_Item_Details.csv"))}),b(1,"i",6),p(2," Export"),a()}}function $D(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Customer"),a(),n(12,"autocompleteV2",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(13,"h6"),p(14,"Page Size"),a(),n(15,"input",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(20,"div",14)(21,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(22,"h6"),p(23,"Product"),a(),n(24,"autocompleteV2",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a(),n(25,"h6"),p(26,"Variant"),a(),n(27,"autocompleteV2",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("ngModel",e.pageData.Filter.RowCount),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("inputTextValue",e.pageData.Filter.ProductName),C("ngModel",e.pageData.Filter.ProductID),o(3),c("inputTextValue",e.pageData.Filter.VariantName)("renderThumbnail",!0),C("ngModel",e.pageData.Filter.VariantID)}}function ev(i,s){i&1&&(n(0,"th",23),p(1," Batch Number "),a())}function tv(i,s){i&1&&(n(0,"th",27),p(1," Cost "),a())}function iv(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.SerialBatchNumber)}}function nv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.UnitCost,r.pageData.FractionDigit)," ")}}function av(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td"),p(4),d(5,"date"),a(),n(6,"td")(7,"a",32),p(8),a()(),S(9,iv,2,1,"td"),n(10,"td")(11,"div",33)(12,"a",34),p(13),a(),n(14,"small",35),p(15),a()()(),n(16,"td"),p(17),a(),n(18,"td",36),p(19),d(20,"number"),a(),S(21,nv,3,4,"td",36),n(22,"td",36),p(23),d(24,"number"),a(),n(25,"td",36),p(26),d(27,"number"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Outlet),o(2),F(v(5,16,e.Date,"dd MMM yy")),o(3),c("routerLink",M(27,JD))("queryParams",X(28,dl,e.InvoiceID)),o(),F(e.Number),o(),y(r.showBatchNumber?9:-1),o(3),c("queryParams",X(30,dl,e.CustomerID)),o(),F(e.CustomerName),o(),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),F(e.Code),o(2),F(e.SalesPerson),o(2),$t(" ",g(20,19,e.Quantity),"",e.UnitQuantity!=1?" x "+e.UnitQuantity:""," "),o(2),y(r.roleService.product.Cost?21:-1),o(2),D(" ",v(24,21,e.UnitPrice,r.pageData.FractionDigit)," "),o(3),D(" ",v(27,24,e.Total,r.pageData.FractionDigit)," ")}}function ov(i,s){i&1&&b(0,"td",39)}function rv(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",37)(2,"td",38),p(3," Total: "),a(),n(4,"td",36),p(5),d(6,"sum"),d(7,"number"),a(),S(8,ov,1,0,"td",39),b(9,"td",39),n(10,"td",36),p(11),d(12,"sum"),d(13,"number"),a()()()),i&2){let e=m(2);o(2),c("colSpan",e.showBatchNumber?6:5),o(3),F(g(7,7,v(6,4,e.data.Data,"Quantity"))),o(3),y(e.roleService.product.Cost?8:-1),o(3),D(" ",v(13,12,v(12,9,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function lv(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5," Outlet "),a(),n(6,"th",21),p(7," Date "),a(),n(8,"th",22),p(9," Invoice # "),a(),S(10,ev,2,0,"th",23),n(11,"th",24),p(12,"Customer"),a(),n(13,"th",25),p(14," SALES PERSON "),a(),n(15,"th",26),p(16," Qty "),a(),S(17,tv,2,0,"th",27),n(18,"th",28),p(19," Price "),a(),n(20,"th",29),p(21," Total "),a()()(),n(22,"tbody"),G(23,av,28,32,"tr",null,Y),a(),S(25,rv,14,15,"tfoot"),a(),n(26,"div",30)(27,"POS-complex-pagination",31),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=m();o(10),y(e.showBatchNumber?10:-1),o(7),y(e.roleService.product.Cost?17:-1),o(6),H(e.data.Data),o(2),y(e.data.Data.length>0?25:-1),o(2),c("total",e.data.Data.length)("pageData",e.pageData)}}var qa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/ProductSalesByInvoice","ReportLoader/ProductSalesByInvoice",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=h}originalData;showBatchNumber=!0;maskingFields;maskingFieldMsg=Rn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.menuData.H=this.pageData.PageTitle,this.originalData=e.Data,this.initShowBatchNumber()}initShowBatchNumber(){let e=this.data?.Data[0]?.SerialBatchNumber;this.showBatchNumber=e!=null}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.Outlet,l.Outlet,h);case"Date":return this.compare(t.Date,l.Date,h);case"Number":return this.compare(t.Number,l.Number,h);case"SerialBatchNumber":return this.compare(t.SerialBatchNumber,l.SerialBatchNumber,h);case"CustomerName":return this.compare(t.CustomerName,l.CustomerName,h);case"SalesPerson":return this.compare(t.SalesPerson,l.SalesPerson,h);case"UnitCost":return this.compare(t.UnitCost,l.UnitCost,h);case"UnitPrice":return this.compare(t.UnitPrice,l.UnitPrice,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Discount":return this.compare(t.Discount,l.Discount,h);case"Total":return this.compare(t.TotalAfterDiscount,l.TotalAfterDiscount,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-invoice-items"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100",3,"ngModelChange","ngModel"],["type","text","autoNum","","min","0",1,"w-100",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search by Product",1,"w-100",3,"ngModelChange","inputTextValue","ngModel"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search by Variant",1,"w-100",3,"ngModelChange","inputTextValue","renderThumbnail","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet","width","100px",1,"align-left"],["mat-sort-header","Date",1,"align-left",2,"width","80px"],["mat-sort-header","Number",1,"align-left",2,"width","120px"],["mat-sort-header","SerialBatchNumber",1,"align-left"],["mat-sort-header","CustomerName",1,"align-left"],["mat-sort-header","SalesPerson",1,"align-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","60px"],["mat-sort-header","UnitCost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"d-sm-block","mt-2"],["api","Report/ProductSalesByInvoiceCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["target","_blank",3,"routerLink","queryParams"],[1,"w-100"],["routerLink","/menu/Contacts/Contact/Customers/Info","target","_blank",1,"d-block",3,"queryParams"],["matTooltipPosition","above",1,"opacity-75","d-inline",3,"matTooltip"],[1,"text-end"],[1,"table-footer"],[1,"text-end","empty-column",3,"colSpan"],[1,"empty-column"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ZD,3,0,"a",2),n(3,"a",3),p(4,"Group by Product"),a()(),n(5,"filters"),E(6,$D,28,16,"ng-template",null,0,O),a(),n(8,"content"),S(9,lv,28,5,"div",4),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,XD)),o(6),y(t.data?9:-1))},dependencies:[A,Q,J,Qe,L,R,ie,pe,ge,Ue,Ae,Et,Ce,U,ze,se,re,oe],encapsulation:2})};var pv=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],mv=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],sv=()=>["/menu/Contacts/Contact/Customers/Info"],cv=i=>({ID:i}),ul=(i,s)=>({"text-danger":i,"text-success":s});function dv(i,s){if(i&1){let e=I();n(0,"a",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function uv(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Brand"),a(),n(3,"ng-select",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListBrandID,t)||(l.pageData.Filter.ListBrandID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",14),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",15)(9,"datepicker",16),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Row Count"),a(),n(12,"input",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0),C("ngModel",e.pageData.Filter.ListBrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brand),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function _v(i,s){i&1&&(n(0,"th",27),p(1,"Total Cost "),a())}function gv(i,s){i&1&&(n(0,"th",28),p(1,"Profit"),a())}function Cv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalCost?e.TotalCost:0))}}function fv(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,ul,e.Profit<0,e.Profit>0)),o(),D(" ",g(2,2,e.Profit))}}function xv(i,s){if(i&1&&(n(0,"tr")(1,"td",33),p(2),a(),n(3,"td",34),p(4),d(5,"quantityFraction"),a(),n(6,"td",35),p(7),d(8,"amountFraction"),a(),S(9,Cv,3,3,"td",36),S(10,fv,3,7,"td",37),a()),i&2){let e=s.$implicit,r=m(3);o(2),D("",e.BrandName," "),o(2),D(" ",g(5,5,e.Quantity?e.Quantity:0)),o(3),D(" ",g(8,7,e.TotalSales?e.TotalSales:0)),o(2),y(r.roleService.product.Cost?9:-1),o(),y(r.roleService.report.Profit?10:-1)}}function hv(i,s){if(i&1&&(n(0,"tr",29)(1,"td")(2,"a",30),p(3),a()(),n(4,"td",21),p(5),a(),n(6,"td",22),p(7),a(),n(8,"td",23),p(9),a(),n(10,"td",31)(11,"table",32),G(12,xv,11,9,"tr",null,Y),a()()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(7,sv))("queryParams",X(8,cv,e.CustomerID)),o(),$t(" ",e.Name," ",e.Title," "),o(2),F(e.Email),o(2),F(e.Mobile),o(2),F(e.City),o(3),H(e.Detail)}}function Sv(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Total.TotalCost)," ")}}function yv(i,s){if(i&1&&(n(0,"td",42),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(4,ul,e.data.Total.Profit<0,e.data.Total.Profit>0)),o(),D(" ",g(2,2,e.data.Total.Profit)," ")}}function Dv(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",38),b(2,"td",39),n(3,"td",40),p(4),d(5,"quantityFraction"),a(),n(6,"td",40),p(7),d(8,"amountFraction"),a(),S(9,Sv,3,3,"td",41),S(10,yv,3,7,"td",42),a()()),i&2){let e=m(2);o(4),D(" ",g(5,4,e.data.Total.Quantity)," "),o(3),D(" ",g(8,6,e.data.Total.TotalSales)," "),o(2),y(e.roleService.product.Cost?9:-1),o(),y(e.roleService.report.Profit?10:-1)}}function vv(i,s){if(i&1){let e=I();n(0,"div",8)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Customer "),a(),n(6,"th",21),p(7,"Email"),a(),n(8,"th",22),p(9,"Mobile"),a(),n(10,"th",23),p(11,"City"),a(),n(12,"th",24),p(13,"Brand"),a(),n(14,"th",25),p(15," Qty "),a(),n(16,"th",26),p(17,"Total Sales "),a(),S(18,_v,2,0,"th",27),S(19,gv,2,0,"th",28),a()(),n(20,"tbody"),G(21,hv,14,10,"tr",29,Y),a(),S(23,Dv,11,8,"tfoot"),a()()}if(i&2){let e=m();o(18),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.report.Profit?19:-1),o(2),H(e.data.Data),o(2),y(e.data?23:-1)}}var Ua=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CustomerBrand","ReportLoader/CustomerBrand");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);default:return 0}}),this.data.Detail=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"SalesNTax":return this.compare(t.TotalSales,l.TotalSales,h);case"Cost":return this.compare(t.TotalCost,l.TotalCost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Brand Sales Analysis",exportTypes:[{ID:"ReportExport/CustomerBrand",Value:"Default",FileName:"Brand Sales Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"SalesReport/CustomerBrandCount",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-brand-sales-analysis"]],standalone:!1,features:[W],decls:20,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["api","SalesReport/CustomerBrandCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Brand",1,"ng-select-multiple",3,"ngModelChange","multiple","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name","text","Customer",1,"align-left",2,"width","280px"],[2,"width","190px"],[2,"width","155px"],[2,"width","130px"],[2,"min-width","124px"],["mat-sort-header","Quantity","text","Qty",1,"align-left","text-end",2,"min-width","66px"],["mat-sort-header","SalesNTax","text","Total Sales","arrowPosition","before",1,"flex-right","text-end",2,"min-width","112px"],["mat-sort-header","Cost","text","Total Cost","arrowPosition","before",1,"flex-right","text-end",2,"min-width","113px"],["mat-sort-header","Profit","text","Profit","arrowPosition","before",1,"flex-right","text-end",2,"min-width","114px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["colspan","5",1,"p-0"],[1,"w-100","border-top-0"],[1,"border-top-0","text-start",2,"min-width","124px"],[1,"border-top-0","text-end",2,"min-width","66px"],[1,"border-top-0","text-end",2,"min-width","112px"],[1,"border-top-0","text-end","text-danger",2,"min-width","113px"],[1,"border-top-0","text-end",2,"min-width","114px",3,"ngClass"],[1,"footer"],["colspan","5"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,dv,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Brand "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()()()()(),n(13,"filters"),E(14,uv,13,7,"ng-template",null,0,O),a(),n(16,"content")(17,"div",7),S(18,vv,24,3,"div",8),n(19,"POS-complex-pagination",9),P("jumpToPage",function(){return u(l),_(t.getListData())})("previousPage",function(){return u(l),_(t.getListData())})("nextPage",function(){return u(l),_(t.getListData())}),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(10,pv)),o(3),c("routerLink",M(11,mv)),o(7),y(t.data?18:-1),o(),c("total",t.data.TransactionCount)("pageData",t.pageData))},dependencies:[A,tt,Q,$,J,Qe,L,R,pe,ge,Ue,Et,Z,ne],encapsulation:2})};var wv=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),Tv=()=>["/menu/Reports/Sales_Report/Standard/Detail"],Pv=(i,s,e)=>({From:i,To:s,TypeID:e}),_l=(i,s)=>({"text-warning":i,"text-success":s,"text-end":!0}),Ka=(i,s)=>({"text-danger":i,"text-success":s});function Fv(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export"),a()}}function Iv(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Year - Month"),a(),n(2,"div",13)(3,"div",14)(4,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Year=null)}),a()(),n(5,"div",16)(6,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Month=null)}),a()()()}if(i&2){let e=m(2);o(4),C("ngModel",e.Year),c("items",e.Years),o(2),C("ngModel",e.Month),c("items",e.Months)}}function bv(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",10)(12,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Compare with Prev Month"),a(),n(15,"radio-options",12),x("modelChange",function(t){u(e);let l=m();return f(l.isCompare,t)||(l.isCompare=t),_(t)}),a(),S(16,Iv,7,4),a()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.isCompare),o(),y(e.isCompare?16:-1)}}function Ev(i,s){i&1&&(n(0,"th",22),p(1,"Prev"),a())}function Mv(i,s){i&1&&(n(0,"th",23),p(1,"Now"),a())}function Vv(i,s){i&1&&(n(0,"th",24),p(1," Trans "),a())}function Bv(i,s){i&1&&(n(0,"th",25),p(1,"Qty"),a())}function Ov(i,s){i&1&&(n(0,"th",27),p(1,"Tax"),a())}function Lv(i,s){if(i&1&&(n(0,"th",28),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Rv(i,s){i&1&&(n(0,"th",29),p(1,"\xB1 (%)"),a())}function kv(i,s){i&1&&(n(0,"th",30),p(1,"Cost"),a())}function Wv(i,s){if(i&1&&(n(0,"th",28),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function Nv(i,s){i&1&&(n(0,"th",31),p(1," Target "),a())}function Av(i,s){i&1&&(n(0,"th",32),p(1," Ach(%) "),a())}function Gv(i,s){if(i&1&&(n(0,"td",29),p(1),a()),i&2){let e=m().$implicit;o(),F(e.PrevIndex)}}function Hv(i,s){if(i&1&&(n(0,"td",41),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,wv,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function Qv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Quantity))}}function Yv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.Count,".0-0"))}}function jv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function qv(i,s){if(i&1&&(n(0,"td",29)(1,"a",42),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(11,Tv))("queryParams",_t(12,Pv,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy"),e.TypeID)),o(4),F(g(6,9,e.SalesWithTax))}}function Uv(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,_l,e.IsNegative,e.IsPositive)),o(),D(" ",g(2,2,e.Increase)," ")}}function zv(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Kv(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function Xv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesTarget)," ")}}function Jv(i,s){if(i&1&&(n(0,"span",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Ka,e.Achievement<0,e.Achievement>0)),o(),D(" ",g(2,2,e.Achievement)," ")}}function Zv(i,s){if(i&1&&(n(0,"span",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Ka,e.AchievementWithTax<0,e.AchievementWithTax>0)),o(),D(" ",g(2,2,e.AchievementWithTax)," ")}}function $v(i,s){if(i&1&&(n(0,"td",29),S(1,Jv,3,7,"span",38),S(2,Zv,3,7,"span",38),a()),i&2){let e=m(3);o(),y(e.pageData.IgnoreTax?-1:1),o(),y(e.pageData.IgnoreTax?2:-1)}}function e3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",34),p(4),a(),S(5,Gv,2,1,"td",29),S(6,Hv,2,5,"td",41),S(7,Qv,3,3,"td",29),S(8,Yv,3,4,"td",29),n(9,"td",29),p(10),d(11,"amountFraction"),a(),S(12,jv,3,3,"td",36),d(13,"HideSumZero"),S(14,qv,7,16,"td",29),S(15,Uv,3,7,"td",38),S(16,zv,3,3,"td",39),S(17,Kv,3,3,"td",40),S(18,Xv,3,3,"td",29),d(19,"HideSumZero"),S(20,$v,3,2,"td",29),d(21,"HideSumZero"),d(22,"HideSumZero"),a()),i&2){let e=s.$implicit,r=s.$index,t=m(2);o(2),F(r+1),o(2),F(e.Name),o(),y(t.showCompareColumn?5:-1),o(),y(t.showCompareColumn?6:-1),o(),y(t.data.WithCategory?7:-1),o(),y(t.data.WithCategory?-1:8),o(2),F(g(11,14,e.SalesNet)),o(2),y(!t.data.WithCategory&&v(13,16,t.data.Data,"Tax")?12:-1),o(2),y(t.data.WithCategory?-1:14),o(),y(t.showCompareColumn?15:-1),o(),y(t.roleService.product.Cost?16:-1),o(),y(t.roleService.report.Profit?17:-1),o(),y(v(19,19,t.data.Data,"SalesTarget")?18:-1),o(2),y(v(21,22,t.roleService.report.Profit&&t.data.Data,"AchievementWithTax")||v(22,25,t.data.Data,"Achievement")?20:-1)}}function t3(i,s){i&1&&b(0,"td",35)}function i3(i,s){i&1&&b(0,"td",35)}function n3(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Count"),".0-0")," ")}}function a3(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function o3(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function r3(i,s){if(i&1&&(n(0,"td",37)(1,"a",43),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function l3(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,_l,e.comparation<0,e.comparation>0)),o(),D(" ",v(2,2,e.comparation,".0-0")," ")}}function p3(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function m3(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data.Data,"Profit")))}}function s3(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ProfitWithTax"))," ")}}function c3(i,s){if(i&1&&(n(0,"td",40),S(1,m3,4,6,"span"),S(2,s3,4,6,"span"),a()),i&2){let e=m(2);o(),y(e.pageData.IgnoreTax?1:-1),o(),y(e.pageData.IgnoreTax?-1:2)}}function d3(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Expense"))," ")}}function u3(i,s){if(i&1&&(n(0,"span",38),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(22,Ka,v(1,2,e.data.Data,"Sales")/v(2,5,e.data.Data,"SalesTarget")<0,v(3,8,e.data.Data,"Sales")/v(4,11,e.data.Data,"SalesTarget")>0)),o(5),D(" ",g(8,20,v(6,14,e.data.Data,"Sales")/v(7,17,e.data.Data,"SalesTarget"))," ")}}function _3(i,s){if(i&1&&(n(0,"span",38),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(22,Ka,v(1,2,e.data.Data,"SalesWithTax")/v(2,5,e.data.Data,"SalesTarget")<0,v(3,8,e.data.Data,"SalesWithTax")/v(4,11,e.data.Data,"SalesTarget")>0)),o(5),D(" ",g(8,20,v(6,14,e.data.Data,"SalesWithTax")/v(7,17,e.data.Data,"SalesTarget"))," ")}}function g3(i,s){if(i&1&&(n(0,"td",29),S(1,u3,9,25,"span",38),S(2,_3,9,25,"span",38),a()),i&2){let e=m(2);o(),y(e.pageData.IgnoreTax?-1:1),o(),y(e.pageData.IgnoreTax?2:-1)}}function C3(i,s){if(i&1){let e=I();n(0,"div",3)(1,"div",18)(2,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",20)(4,"tr")(5,"th"),p(6,"No."),a(),n(7,"th",21),p(8,"Tag"),a(),S(9,Ev,2,0,"th",22),S(10,Mv,2,0,"th",23),S(11,Vv,2,0,"th",24),S(12,Bv,2,0,"th",25),n(13,"th",26),p(14,"Sales"),a(),S(15,Ov,2,0,"th",27),d(16,"HideSumZero"),S(17,Lv,2,1,"th",28),S(18,Rv,2,0,"th",29),S(19,kv,2,0,"th",30),S(20,Wv,2,1,"th",28),S(21,Nv,2,0,"th",31),d(22,"HideSumZero"),S(23,Av,2,0,"th",32),d(24,"HideSumZero"),d(25,"HideSumZero"),a()(),n(26,"tbody"),G(27,e3,23,28,"tr",null,Y),a(),n(29,"tfoot")(30,"tr",33),b(31,"td")(32,"td",34),S(33,t3,1,0,"td",35),S(34,i3,1,0,"td",35),S(35,n3,4,7,"td",29),S(36,a3,4,6,"td",29),n(37,"td",29),p(38),d(39,"sum"),d(40,"amountFraction"),a(),S(41,o3,4,6,"td",36),d(42,"HideSumZero"),S(43,r3,5,6,"td",37),S(44,l3,3,8,"td",38),S(45,p3,4,6,"td",39),S(46,c3,3,2,"td",40),S(47,d3,4,6,"td",29),d(48,"HideSumZero"),S(49,g3,3,2,"td",29),d(50,"HideSumZero"),d(51,"HideSumZero"),a()()()()()}if(i&2){let e=m();o(9),y(e.showCompareColumn?9:-1),o(),y(e.showCompareColumn?10:-1),o(),y(e.data.WithCategory?-1:11),o(),y(e.data.WithCategory?12:-1),o(3),y(!e.data.WithCategory&&v(16,23,e.data.Data,"Tax")?15:-1),o(2),y(e.data.WithCategory?-1:17),o(),y(e.showCompareColumn?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(),y(e.roleService.report.Profit?20:-1),o(),y(v(22,26,e.data.Data,"SalesTarget")?21:-1),o(2),y(v(24,29,e.data.Data,"AchievementWithTax")||v(25,32,e.data.Data,"Achievement")&&e.roleService.report.Profit?23:-1),o(4),H(e.data.Data),o(6),y(e.showCompareColumn?33:-1),o(),y(e.showCompareColumn?34:-1),o(),y(e.data.WithCategory?-1:35),o(),y(e.data.WithCategory?36:-1),o(2),D(" ",g(40,38,v(39,35,e.data.Data,"SalesNet"))," "),o(3),y(!e.data.WithCategory&&v(42,40,e.data.Data,"Tax")?41:-1),o(2),y(e.data.WithCategory?-1:43),o(),y(e.showCompareColumn?44:-1),o(),y(e.roleService.product.Cost?45:-1),o(),y(e.roleService.report.Profit?46:-1),o(),y(e.roleService.product.Expense&&v(48,43,e.data.Data,"Expense")?47:-1),o(2),y(v(50,46,e.roleService.report.Profit&&e.data.Data,"AchievementWithTax")||v(51,49,e.data.Data,"Achievement")?49:-1)}}var za=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/OutletPerformanceByType","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Year=T.getFullYear(),this.Month=T.getMonth()}isCompare=!1;showCompareColumn=!1;DateFilterType=!1;Year;Month;Months=[{ID:0,Label:"Jan"},{ID:1,Label:"Feb"},{ID:2,Label:"Mar"},{ID:3,Label:"Apr"},{ID:4,Label:"May"},{ID:5,Label:"Jun"},{ID:6,Label:"Jul"},{ID:7,Label:"Aug"},{ID:8,Label:"Sep"},{ID:9,Label:"Oct"},{ID:10,Label:"Nov"},{ID:11,Label:"Dec"}];Years=V.GenerateYears(new Date().getFullYear(),11,!0);RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];postInit(e){this.originalData=e.Data,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1).toDateString(),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0).toDateString()}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Count":return this.compare(t.Count,l.Count,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Gross":return this.compare(t.Gross,l.Gross,h);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,h);case"SalesTaxNet":return this.compare(t.SalesNet,l.SalesNet,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,h);case"Expense":return this.compare(t.Expense,l.Expense,h);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,h);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,h);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,h);case"Achievement":return this.compare(t.Achievement,l.Achievement,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales Order Tag",exportTypes:[{ID:"ReportExport/OutletPerformanceByType",Value:"Default",FileName:"Sales Order Tag"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-by-sales-order-type"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Compare",3,"modelChange","model"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"align-left"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-left"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left"],["arrowPosition","before",1,"flex-left",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left"],["mat-sort-header","Target","arrowPosition","before",1,"align-left"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"align-left"],[1,"footer"],[1,"freeze","body"],[1,"empty-column"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"text-end",3,"ngClass"],[3,"routerLink","queryParams"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Fv,3,0,"button",2),a(),n(3,"filters"),E(4,bv,17,10,"ng-template",null,0,O),a(),n(6,"content"),S(7,C3,52,52,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,U,se,ei,re,oe,Z,ne],encapsulation:2})};var gl=Jt(Po());var f3=new Zt("HIGHCHARTS_LOADER"),x3=new Zt("HIGHCHARTS_ROOT_MODULES"),h3=new Zt("HIGHCHARTS_OPTIONS"),S3=new Zt("HIGHCHARTS_CONFIG"),y3=new Zt("HIGHCHARTS_TIMEOUT"),D3=(()=>{let s=class s{constructor(){this.highcharts=dt(null),this.loader=Pe(f3),this.globalOptions=Pe(h3,{optional:!0}),this.globalModules=Pe(x3,{optional:!0})}loadHighchartsWithModules(r){return Hi(this,null,function*(){let t=yield this.loader();return yield Promise.allSettled([...this.globalModules?.()??[],...r?.modules?.()??[]]),t})}load(r){this.loadHighchartsWithModules(r).then(t=>{this.globalOptions&&t.setOptions(this.globalOptions),this.highcharts.set(t)})}};s.\u0275fac=function(t){return new(t||s)},s.\u0275prov=an({token:s,factory:s.\u0275fac,providedIn:"root"});let i=s;return i})(),v3=(()=>{let s=class s{delay(r){return new Promise(t=>setTimeout(t,r))}keepChartUpToDate(){dn(()=>Hi(this,null,function*(){this.update();let r=yield this.chart();this.chartCreated?r?.update(this.options(),!0,this.oneToOne()):r&&(this.chartCreated=!0)}))}destroyChart(){return Hi(this,null,function*(){let r=yield this.chart();r&&r.destroy()})}constructor(){this.constructorType=hi("chart"),this.oneToOne=hi(!1),this.options=hi.required(),this.update=un(),this.chartInstance=Ho(),this.destroyRef=Pe(Lo),this.el=Pe(Ro),this.platformId=Pe(ko),this.relativeConfig=Pe(S3,{optional:!0}),this.timeout=Pe(y3,{optional:!0}),this.highchartsChartService=Pe(D3),this.chartCreated=!1,this.constructorChart=xi(()=>{let r=this.highchartsChartService.highcharts();if(r)return r[this.constructorType()]}),this.chart=xi(()=>Hi(this,null,function*(){return yield this.delay(this.relativeConfig?.timeout??this.timeout??500),this.constructorChart()?.(this.el.nativeElement,Go(()=>this.options()),r=>this.chartInstance.emit(r))})),!(this.platformId&&zo(this.platformId))&&(this.highchartsChartService.load(this.relativeConfig),this.destroyRef.onDestroy(()=>this.destroyChart()),jo(()=>{this.update()&&this.update.set(!1)}),this.keepChartUpToDate())}};s.\u0275fac=function(t){return new(t||s)},s.\u0275dir=pn({type:s,selectors:[["","highchartsChart",""]],inputs:{constructorType:[1,"constructorType"],oneToOne:[1,"oneToOne"],options:[1,"options"],update:[1,"update"]},outputs:{update:"updateChange",chartInstance:"chartInstance"}});let i=s;return i})(),Xa=(()=>{let s=class s{};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=B({type:s,selectors:[["highcharts-chart"]],features:[mn([{directive:v3,inputs:["constructorType","constructorType","oneToOne","oneToOne","options","options","update","update"],outputs:["chartInstance","chartInstance","updateChange","updateChange"]}])],decls:0,vars:0,template:function(t,l){},encapsulation:2,changeDetection:0});let i=s;return i})();function T3(i,s){if(i&1){let e=I();n(0,"div",3)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",4),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Date From - To"),a(),n(6,"div",5)(7,"div",6)(8,"datepicker",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(9,"div",6)(10,"datepicker",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()(),n(11,"h6"),p(12,"Price Range"),a(),n(13,"input",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.PriceRange,t)||(l.pageData.Filter.PriceRange=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),C("ngModel",e.pageData.Filter.ListIDs),o(5),C("ngModel",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(2),C("ngModel",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(3),C("ngModel",e.pageData.Filter.PriceRange)}}function P3(i,s){if(i&1){let e=I();n(0,"button",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function F3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),d(4,"number"),a(),n(5,"td",21),p(6),d(7,"quantityFraction"),a(),n(8,"td",21),p(9),d(10,"quantityFraction"),a()()),i&2){let e=s.$implicit;o(2),$t(" ",g(3,4,e.KeyValue.Key.StartNumber)," - ",g(4,6,e.KeyValue.Key.EndNumber)," "),o(4),D(" ",e.KeyValue.Value!=0?g(7,8,e.KeyValue.Value):"-"," "),o(3),F(g(10,10,e.Sales))}}function I3(i,s){if(i&1&&(n(0,"content")(1,"div",12)(2,"div",5)(3,"div",6)(4,"table",13)(5,"thead",14)(6,"tr",15)(7,"th",16),p(8,"Price"),a(),n(9,"th",17),p(10,"Qty"),a(),n(11,"th"),p(12,"Sales"),a()()(),n(13,"tbody"),G(14,F3,11,12,"tr",null,Y),a()()(),n(16,"div",6)(17,"div",18)(18,"div",19),b(19,"highcharts-chart",20),a()()()()()()),i&2){let e=m();o(14),H(e.data.Data),o(5),c("Highcharts",e.Highcharts)("options",e.chartOptions())}}Gn(gl.default);var Ja=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/UnitPriceAnalysis","ReportLoader/PriceAnalysis",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}Highcharts=Bi;chartOptions=dt(null);openExportModal(){this.matDialog.open(K,{data:{title:"Price Analysis",exportTypes:[{ID:"ReportExport/PriceAnalysis",Value:"Default",FileName:"Price Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.chartOptions.set({chart:{type:"pie",style:{fontFamily:'"Roboto-Slab", sans-serif'}},title:{text:"Price Analysis Chart"},credits:{enabled:!1},tooltip:{headerFormat:"",pointFormat:'<span style="color:{point.color}">\u25CF</span> {point.name}: <b>{point.y:.1f}</b>'},plotOptions:{pie:{allowPointSelect:!0,borderWidth:2,cursor:"pointer",dataLabels:{enabled:!0,format:"<b>{point.name}</b><br>{point.y}",distance:20},showInLegend:!0}},series:[{type:"pie",data:[...e.PieChartData.map(r=>({name:r.Name,y:r.Qty}))]}]})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-price-analysis"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"row"],[1,"col-6"],["appearance","outline","name","From",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["appearance","outline","name","To",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","table-bordered"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","250px"],[2,"width","150px"],[1,"card"],[1,"card-body"],[2,"width","100%","height","400px","display","block",3,"Highcharts","options"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"filters"),E(2,T3,14,11,"ng-template",null,0,O),a(),n(4,"actions"),S(5,P3,3,0,"button",2),a(),S(6,I3,20,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(5),y(t.roleService.global.Export?5:-1),o(),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,Ue,U,Xa,re,ne],encapsulation:2})};var b3=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Cl=i=>({ID:i});function E3(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function M3(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",7),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",8)(10,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Tax"),a(),n(13,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(14,"h6"),p(15,"Page Size"),a(),n(16,"input",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function V3(i,s){i&1&&(n(0,"th",21),p(1," Purchase "),a())}function B3(i,s){i&1&&(n(0,"th",22),p(1," Tax "),a())}function O3(i,s){if(i&1&&b(0,"th",23),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function L3(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function R3(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function k3(i,s){if(i&1&&(b(0,"td",40),d(1,"TaxDefault"),d(2,"number")),i&2){let e=s.$index,r=m().$implicit,t=m(2);c("innerHtml",g(2,5,fi(1,1,t.data.Compenents,r,e)),Ee)}}function W3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",36),p(5),a()(),n(6,"td")(7,"a",37),p(8),a()(),n(9,"td"),p(10),a(),n(11,"td"),p(12),d(13,"date"),a(),S(14,L3,3,3,"td",38),S(15,R3,3,3,"td",39),G(16,k3,3,7,"td",40,Y),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(13,b3))("queryParams",X(14,Cl,e.ID)),o(),F(e.Number),o(2),c("queryParams",X(16,Cl,e.SupplierID)),o(),D(" ",e.Name," "),o(2),F(e.TaxName),o(2),F(v(13,10,e.Date,"dd MMM yyyy")),o(2),y(r.roleService.product.Cost?14:-1),o(),y(r.roleService.product.Cost?15:-1),o(),H(r.getComponent(r.data))}}function N3(i,s){if(i&1&&(n(0,"td",27)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.infiniteList,"Sales")))}}function A3(i,s){if(i&1&&(n(0,"td",27)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.infiniteList,"Tax")))}}function G3(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e.SumTaxAmount)," ")}}function H3(i,s){if(i&1){let e=I();n(0,"span",41),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport"))}),n(1,"i",42),p(2,"?"),a()()}}function Q3(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function Y3(i,s){if(i&1){let e=I();n(0,"a",43),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",44),p(2," Next"),a()}}function j3(i,s){if(i&1){let e=I();n(0,"a",45),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport",!0))}),b(1,"i",46),p(2," Show All"),a()}}function q3(i,s){if(i&1){let e=I();n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",15)(5,"tr")(6,"th",16),p(7,"Outlet"),a(),n(8,"th",17),p(9,"Number"),a(),n(10,"th",18),p(11,"Supplier"),a(),n(12,"th",19),p(13," Type "),a(),n(14,"th",20),p(15,"Date"),a(),S(16,V3,2,0,"th",21),S(17,B3,2,0,"th",22),G(18,O3,1,1,"th",23,Y),a()(),n(20,"tbody"),G(21,W3,18,18,"tr",null,Y),a(),n(23,"tfoot")(24,"tr",24),b(25,"td",25),n(26,"td",26),p(27,"Total :"),a(),S(28,N3,5,6,"td",27),S(29,A3,5,6,"td",27),G(30,G3,3,3,"td",28,Y),a()()()(),n(32,"div",29)(33,"div",30)(34,"div",31),p(35),d(36,"number"),S(37,H3,3,0,"span",32),S(38,Q3,3,3,"span"),p(39),a()(),n(40,"div",33),S(41,Y3,3,0,"a",34),S(42,j3,3,0,"a",35),a()()()()}if(i&2){let e=m();o(16),y(e.roleService.product.Cost?16:-1),o(),y(e.roleService.product.Cost?17:-1),o(),H(e.data.Compenents),o(3),H(e.infiniteList),o(7),y(e.roleService.product.Cost?28:-1),o(),y(e.roleService.product.Cost?29:-1),o(),H(e.data.Compenents),o(5),D(" Showing 1 - ",g(36,10,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:37),o(),y(e.pageData.HideStoreApiCount?38:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),y(!e.nextPageDisabled&&!e.goToLast?41:-1),o(),y(!e.nextPageDisabled&&!e.goToLast?42:-1)}}var Za=class i extends vi{constructor(e,r,t,l,h,T){super(e,r,"Report/GetPurchaseTaxReport","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Tax Report",exportTypes:[{ID:"ReportExport/GetPurchaseTaxReport",Value:"Default",FileName:"Purchase Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountPurchaseTaxReport",pagination:!0}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.TaxTax=t==0?e.Tax:this.data.Compenents[t-1].TaxTax,r.TaxTax=t==0?r.TaxTax:r.TaxTax+r.TaxTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.TaxTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),h);case"Number":return this.compare(t.Number,l.Number,h);case"Date":return this.compare(t.Date,l.Date,h);case"Tax":return this.compare(t.Tax,l.Tax,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-purchase-tax-report"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[1,"table-footer"],["colspan","4",1,"text-end","empty-column"],[1,"text-end","empty-column"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","matTooltipPosition","above","matTooltip","Load all data",1,"btn","btn-outline-secondary","btn-sm","text-primary"],[3,"routerLink","queryParams"],["routerLink","/menu/Contacts/Contact/Suppliers/Info/V2","target","_blank",3,"queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",2,"width","150px",3,"innerHtml"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,E3,3,0,"button",2),a(),n(3,"filters"),E(4,M3,17,10,"ng-template",null,0,O),a(),S(6,q3,43,12,"content"),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,Qe,L,R,ie,pe,ge,Ue,U,se,Fi,re,oe,Z],encapsulation:2})};var U3=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],z3=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"];function K3(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",10)(9,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function X3(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",12),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var $a=class i extends De{constructor(e,r,t){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,t);this.httpService=r}chartData;chartConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};postInit(){this.menuData.H=this.data.PageTitle,this.initChartSeries()}initChartSeries(){let e=[];this.data?.Data?.forEach(r=>{let t={name:r.BrandName,y:r.Total};e.push(t)}),this.chartData=e}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(Ne))};static \u0275cmp=B({type:i,selectors:[["app-top-brand-chart"]],standalone:!1,features:[W],decls:17,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Top Brand "),a()(),n(9,"li")(10,"a",5),p(11," Brand Sales Analysis "),a()()()()(),n(12,"filters"),E(13,K3,10,6,"ng-template",null,0,O),a(),n(15,"content"),S(16,X3,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(7,U3)),o(3),c("routerLink",M(8,z3)),o(6),y(t.data?16:-1))},dependencies:[A,Q,J,L,R,ii,U],encapsulation:2})};var J3=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],ki=i=>[i],fl=(i,s)=>({"text-danger":i,"text-success":s});function Z3(i,s){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function $3(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onChangeFilterDate1(t))}),a(),n(13,"h6"),p(14,"Compare With"),a(),n(15,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("multiple",!0),C("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.SalesOrderTags),o(3),c("from",e.pageData.Filter.From_range1)("to",e.pageData.Filter.To_range1),o(3),c("from",e.pageData.Filter.From_range2)("to",e.pageData.Filter.To_range2)}}function ew(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=m(2);o(),D(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function tw(i,s){if(i&1&&(n(0,"th",21),p(1),a()),i&2){let e=m(2);o(),D(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function iw(i,s){i&1&&(n(0,"th",23),p(1," Profit "),a())}function nw(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetProfit1)," ")}}function aw(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetProfit2)," ")}}function ow(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,fl,e.Growth<0,e.Growth>0)),o(),D(" ",g(2,2,e.Growth),"% ")}}function rw(i,s){if(i&1&&(n(0,"tr")(1,"td",26),p(2),a(),n(3,"td",27),p(4),d(5,"amountFraction"),a(),S(6,nw,3,3,"td",28),n(7,"td",27),p(8),d(9,"amountFraction"),a(),S(10,aw,3,3,"td",28),n(11,"td",29),p(12),d(13,"amountFraction"),a(),S(14,ow,3,7,"td",29),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(),c("colSpan",r.roleService.report.Profit?1:2),o(),D(" ",g(5,10,e.SalesNTax1)," "),o(2),y(r.roleService.report.Profit?6:-1),o(),c("colSpan",r.roleService.report.Profit?1:2),o(),D(" ",g(9,12,e.SalesNTax2)," "),o(2),y(r.roleService.report.Profit?10:-1),o(),c("ngClass",fe(16,fl,e.Revenue<0,e.Revenue>0)),o(),D(" ",g(13,14,e.Revenue),"% "),o(2),y(r.roleService.report.Profit?14:-1)}}function lw(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.netProfit1Total>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.netProfit1Total)," ")}}function pw(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.netProfit2Total>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.netProfit2Total)," ")}}function mw(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.profitPercentage>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.profitPercentage),"% ")}}function sw(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",12),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",13)(3,"tr")(4,"th",14),p(5," Outlet "),a(),n(6,"th",15)(7,"span"),p(8),d(9,"date"),a(),p(10," - "),n(11,"span"),p(12),d(13,"date"),a()(),n(14,"th",16)(15,"span"),p(16),d(17,"date"),a(),p(18," - "),n(19,"span"),p(20),d(21,"date"),a()(),n(22,"th",16),p(23,"YOY Growth"),a()(),n(24,"tr",17)(25,"th",18),p(26),a(),S(27,ew,2,1,"th",19),n(28,"th",20),p(29),a(),S(30,tw,2,1,"th",21),n(31,"th",22),p(32,"Revenue"),a(),S(33,iw,2,0,"th",23),a()(),n(34,"tbody"),G(35,rw,15,19,"tr",null,Y),a(),n(37,"tfoot")(38,"tr"),b(39,"td"),n(40,"td",24),p(41),d(42,"amountFraction"),a(),S(43,lw,3,6,"td",25),n(44,"td",24),p(45),d(46,"amountFraction"),a(),S(47,pw,3,6,"td",25),n(48,"td",25),p(49),d(50,"amountFraction"),a(),S(51,mw,3,6,"td",25),a()()()()}if(i&2){let e=m();o(8),F(v(9,22,e.pageData.Filter.From_range1,"dd MMMM yyyy")),o(4),F(v(13,25,e.pageData.Filter.To_range1,"dd MMMM yyyy")),o(4),F(v(17,28,e.pageData.Filter.From_range2,"dd MMMM yyyy")),o(4),F(v(21,31,e.pageData.Filter.To_range2,"dd MMMM yyyy")),o(5),c("colSpan",e.roleService.report.Profit?1:2),o(),D(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),y(e.roleService.report.Profit?27:-1),o(),c("colSpan",e.roleService.report.Profit?1:2),o(),D(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),y(e.roleService.report.Profit?30:-1),o(3),y(e.roleService.report.Profit?33:-1),o(2),H(e.data),o(5),c("colSpan",e.roleService.report.Profit?1:2)("ngClass",X(40,ki,e.salesNTax1Total>0?"text-success":"text-danger")),o(),D(" ",g(42,34,e.salesNTax1Total)," "),o(2),y(e.roleService.report.Profit?43:-1),o(),c("colSpan",e.roleService.report.Profit?1:2)("ngClass",X(42,ki,e.salesNTax2Total>0?"text-success":"text-danger")),o(),D(" ",g(46,36,e.salesNTax2Total)," "),o(2),y(e.roleService.report.Profit?47:-1),o(),c("ngClass",X(44,ki,e.salesNTaxPercentage>0?"text-success":"text-danger")),o(),D(" ",g(50,38,e.salesNTaxPercentage),"% "),o(2),y(e.roleService.report.Profit?51:-1)}}var eo=class i extends me{constructor(e,r,t,l,h,T){super(t,l,"Report/SalesCompareByRange","ReportLoader/SalesCompareByRange");this.csvConverter=e;this.roleService=r;this.sumPipe=h;this.matDialog=T}salesNTax1Total=0;salesNTax2Total=0;netProfit1Total=0;netProfit2Total=0;salesNTaxPercentage=0;profitPercentage=0;originalData;ngOnInit(){}postInit(e){this.menuData.H="Sales Compare By Outlet",this.salesNTax1Total=this.sumPipe.transform(this.data,"SalesNTax1"),this.salesNTax2Total=this.sumPipe.transform(this.data,"SalesNTax2"),this.netProfit1Total=this.sumPipe.transform(this.data,"NetProfit1"),this.netProfit2Total=this.sumPipe.transform(this.data,"NetProfit2"),this.salesNTaxPercentage=this.calculatePercentage(this.salesNTax1Total,this.salesNTax2Total),this.profitPercentage=this.calculatePercentage(this.netProfit1Total,this.netProfit2Total),this.originalData=e}calculatePercentage(e,r){return(r-e)/e*100}preGetList(){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.PageNumber}onChangeFilterDate1(e){this.pageData.Filter.From_range1=e.from,this.pageData.Filter.To_range1=e.to}onChangeFilterDate2(e){this.pageData.Filter.From_range2=e.from,this.pageData.Filter.To_range2=e.to}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.originalData;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc";switch(typeof t[e.active]){case"number":return this.compare(t[e.active],l[e.active],h);case"string":return this.compare(t[e.active],l[e.active],h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales Compare by Outlet",exportTypes:[{ID:"ReportExport/SalesCompareByRange",Value:"Default",FileName:"Sales Compare by Outlet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(q),w(j),w(N),w(k),w(se),w(z))};static \u0275cmp=B({type:i,selectors:[["app-sales-compare-by-outlet"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["matTooltipPosition","above","matTooltip","12 Months Compare",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindValue","ID","bindLabel","Name","placeholder","Choose Sales Order Tag",3,"ngModelChange","multiple","ngModel","items"],[3,"dateChange","from","to"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-header"],["rowspan","2","colspan","1","mat-sort-header","EntityName",1,"border-end","text-center"],["colspan","2",1,"text-center"],["colspan","2",1,"text-center","border-start"],[1,"border-top-2"],["mat-sort-header","SalesNTax1",1,"align-center",3,"colSpan"],["mat-sort-header","NetProfit1",1,"align-center","border-end"],["mat-sort-header","SalesNTax2",1,"align-center",3,"colSpan"],["mat-sort-header","NetProfit2",1,"align-center","border-end"],["mat-sort-header","Revenue",1,"align-center"],["mat-sort-header","Growth",1,"align-center"],[1,"text-end",3,"colSpan","ngClass"],[1,"text-end",3,"ngClass"],[1,"border-start","border-end"],[1,"text-end","border-end",3,"colSpan"],[1,"text-end","border-end"],[1,"text-end","border-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Z3,3,0,"button",2),n(3,"a",3),p(4," View Monthly"),a()(),n(5,"filters"),E(6,$3,16,13,"ng-template",null,0,O),a(),n(8,"content"),S(9,sw,52,46,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,J3)),o(6),y(t.data?9:-1))},dependencies:[A,tt,Q,$,L,R,ie,pe,ge,Gt,Ce,U,oe,Z],styles:["thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:60px;z-index:1020}@media only screen and (max-width: 768px){thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1020}}"]})};var Ji=Jt(bi());var cw={parse:{dateInput:"YYYY"},display:{dateInput:"YYYY",monthYearLabel:"YYYY",dateA11yLabel:"YYYY",monthYearA11yLabel:"YYYY"}},Wi=class i{yearCtrl=new Zo(null);year=un(null);minDate=(0,Ji.default)().subtract(100,"years");maxDate=(0,Ji.default)();constructor(){dn(()=>{this.year()&&this.yearCtrl.setValue((0,Ji.default)().year(this.year()).startOf("year"))})}chosenYearHandler(s,e){let r=s.year(),t=(0,Ji.default)().year(r).startOf("year");this.yearCtrl.setValue(t),this.year.set(r),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["pos-datepicker-year"]],inputs:{year:[1,"year"]},outputs:{year:"yearChange"},features:[Ci([{provide:yn,useClass:Nn,deps:[Sn]},{provide:Dn,useValue:cw}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker","w-100"],["matInput","",3,"click","matDatepicker","formControl","min","max"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("click",function(){u(t);let h=Dt(4);return _(h.open())}),a(),b(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(h){u(t);let T=Dt(4);return _(r.chosenYearHandler(h,T))}),a()()}if(e&2){let t=Dt(4);o(),c("matDatepicker",t)("formControl",r.yearCtrl)("min",r.minDate)("max",r.maxDate),o(),c("for",t)}},dependencies:[bn,wn,vn,Di,En,yi,Tn,Pn,Fn,At,Qe,L,gn,er],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
7
|
-
`],encapsulation:2,changeDetection:0})};var
|
|
8
|
-
${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(T.points[h]?.y)} <br/><br/>`)}),l}},total:this.generateStackTotal()}}generateStackTotal(){let e=[];return this.data.Series.filter(t=>t.Name=="Sales").forEach(t=>{e=[...e,t.Amount]}),e}generateSeries(){let e=[],r=this.data.Series.filter(h=>h.Name=="Sales").map(h=>h.Amount),t=this.data.Series.filter(h=>h.Name=="Profit").map(h=>h.Amount),l=this.data.Series.filter(h=>h.Name=="Cost").map(h=>h.Amount);return e=[{name:"Sales",data:r},{name:"Profit",data:t,visible:!1,showInLegend:!1},{name:"Cost",data:l}],this.role.report.Profit||e.splice(1,1),e}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j))};static \u0275cmp=B({type:i,selectors:[["app-yearly-bar-chart"]],standalone:!1,features:[W],decls:10,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"yearChange","year"],[1,"mt-4"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.getListData())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4,"Table View"),a()(),n(5,"filters"),E(6,_w,16,10,"ng-template",null,0,O),a(),n(8,"content"),S(9,gw,2,2,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("routerLink",M(6,uw)),o(7),y(t.data?9:-1))},dependencies:[A,Q,$,L,R,ie,Mt,Ce,U,Wi],encapsulation:2})};var Cw=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],fw=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],xw=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],hw=i=>({id:i}),Sw=i=>[i],xl=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],yw=(i,s,e)=>({CategoryID:i,From:s,To:e}),hl=i=>({CategoryID:i}),Dw=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"];function vw(i,s){if(i&1){let e=I();n(0,"button",9),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",10),p(2," Export "),a()}}function ww(i,s){if(i&1&&(n(0,"span",25),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function Tw(i,s){if(i&1){let e=I();n(0,"div",11)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",13),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),E(10,ww,2,3,"ng-template",15),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",16),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(15,"div",17)(16,"datepicker",18),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",19),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",20),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Sales Order Tag"),a(),n(25,"ng-select",21),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Discount Calculation"),a(),n(28,"ng-select",22),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(29,"h6"),p(30,"Hide Zero & Negative"),a(),n(31,"radio-options",23),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a(),n(32,"h6"),p(33,"Product Type"),a(),n(34,"radio-options",24),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",X(23,Sw,X(21,hw,e.pageData.Filter.CategoryID)))("isInitializedCategoryLabel",!0)("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),C("ngModel",e.pageData.Filter.BrandID),o(5),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("ngModel",e.pageData.Filter.TagID),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),o(3),C("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),C("model",e.pageData.Filter.ExcludeZero),o(3),C("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes)}}function Pw(i,s){i&1&&(n(0,"th",48),p(1," DISCOUNT "),a())}function Fw(i,s){i&1&&(n(0,"th",49),p(1," DISCOUNT (%) "),a(),n(2,"th",50),p(3," DISCOUNT (AMOUNT) "),a())}function Iw(i,s){i&1&&(n(0,"th",51),p(1," COST "),a())}function bw(i,s){i&1&&(n(0,"th",52),p(1," PROFIT "),a())}function Ew(i,s){i&1&&(n(0,"th",53),p(1," % "),a())}function Mw(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Vw(i,s){if(i&1&&(n(0,"td",56),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit)," ")}}function Bw(i,s){if(i&1&&(n(0,"td",56),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;c("ngClass",e.Percentage>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Percentage),"% ")}}function Ow(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",54),d(3,"date"),d(4,"date"),p(5),a()(),n(6,"td",42),p(7),d(8,"quantityFraction"),a(),n(9,"td",42)(10,"a",54),p(11),d(12,"amountFraction"),a()(),n(13,"td",42)(14,"a",54),p(15),d(16,"amountFraction"),a()(),n(17,"td",42),p(18),d(19,"amountFraction"),a(),n(20,"td",44),p(21),d(22,"amountFraction"),a(),n(23,"td",42),p(24),d(25,"amountFraction"),a(),E(26,Mw,3,3,"td",45)(27,Vw,3,4,"td",46)(28,Bw,3,4,"td",46),a()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(34,xl))("queryParams",_t(35,yw,e.ID,v(3,16,r.pageData.Filter.From,"yyyy-MM-dd"),v(4,19,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(e.Name),o(2),F(g(8,22,e.Quantity)),o(3),c("routerLink",M(39,xl))("queryParams",X(40,hl,e.ID)),o(),D(" ",g(12,24,e.GrossSales)," "),o(3),c("routerLink",M(42,Dw))("queryParams",X(43,hl,e.ID)),o(),F(g(16,26,e.Discount)),o(3),F(g(19,28,e.Sales)),o(3),D(" ",g(22,30,e.Tax)," "),o(3),F(g(25,32,e.SalesNTax)),o(2),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit)}}function Lw(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function Rw(i,s){if(i&1&&(n(0,"td",56),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",e.data.Aggregate.TotalProfit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.data.Aggregate.TotalProfit)," ")}}function kw(i,s){if(i&1&&(n(0,"td",56),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",e.data.Aggregate.TotalPercentage>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.data.Aggregate.TotalPercentage),"% ")}}function Ww(i,s){if(i&1){let e=I();n(0,"content")(1,"div",26)(2,"div",27)(3,"table",28),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",29)(5,"tr")(6,"th",30),p(7,"CATEGORY"),a(),n(8,"th",31),p(9," QUANTITY "),a(),n(10,"th",32),p(11," GROSS SALES "),a(),E(12,Pw,2,0,"th",33)(13,Fw,4,0,"ng-template",null,1,O),n(15,"th",34),p(16," NET SALES "),a(),n(17,"th",35),p(18," Tax "),a(),n(19,"th",36),p(20," Sales + Tax "),a(),E(21,Iw,2,0,"th",37)(22,bw,2,0,"th",38)(23,Ew,2,0,"th",39),a()(),n(24,"tbody"),E(25,Ow,29,45,"tr",40),a(),n(26,"tfoot")(27,"tr",41)(28,"td",42),p(29,"Total :"),a(),n(30,"td",42),p(31),d(32,"quantityFraction"),a(),n(33,"td",43)(34,"a"),p(35),d(36,"amountFraction"),a()(),n(37,"td",42),p(38),d(39,"amountFraction"),a(),n(40,"td",42),p(41),d(42,"amountFraction"),a(),n(43,"td",44),p(44),d(45,"amountFraction"),a(),n(46,"td",42),p(47),d(48,"amountFraction"),a(),E(49,Lw,3,3,"td",45)(50,Rw,3,4,"td",46)(51,kw,3,4,"td",46),a()()()(),n(52,"POS-complex-pagination",47),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=Dt(14),r=m();o(12),c("ngIf",!r.pageData.Filter.BreakdownDiscountAmount)("ngIfElse",e),o(9),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit),o(2),c("ngForOf",r.data.Data),o(6),D(" ",g(32,17,r.data.Aggregate.TotalQuantity)," "),o(4),F(g(36,19,r.data.Aggregate.TotalGross)),o(3),D(" ",g(39,21,r.data.Aggregate.TotalDiscount)," "),o(3),D(" ",g(42,23,r.data.Aggregate.TotalNetSales)," "),o(3),D(" ",g(45,25,r.data.Aggregate.TotalTax)," "),o(3),D(" ",g(48,27,r.data.Aggregate.TotalSalesNTax)," "),o(2),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit),o(),c("total",r.data.Count)("pageData",r.pageData)}}var io=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CategorySales","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Total":return this.compare(t.Total,l.Total,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Discount":return this.compare(t.Discount,l.Discount,h);case"NetSales":return this.compare(t.NetSales,l.NetSales,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);case"Percentage":return this.compare(t.Percentage,l.Percentage,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,h);case"GrossSales":return this.compare(t.GrossSales,l.GrossSales,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-category-sales-table"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],["BREAKDOWN_HEADER",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["name","render-ProductType",3,"modelChange","model","options"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"text-start"],["arrowPosition","before","mat-sort-header","Quantity",1,"flex-right",2,"width","120px"],["mat-sort-header","GrossSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["class","flex-right","style","width: 120px","mat-sort-header","Discount","arrowPosition","before",4,"ngIf","ngIfElse"],["mat-sort-header","NetSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-right",2,"width","150px"],["class","flex-right","style","width: 120px","mat-sort-header","Cost","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 120px","mat-sort-header","Profit","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 80px","mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-primary"],[1,"text-end","text-warning-emphasis"],["class","text-end text-danger",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["api","Report/GetTotalCountCategorySales",3,"jumpToPage","previousPage","nextPage","total","pageData"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","DiscountAmount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",1,"flex-right",2,"width","80px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",2),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,vw,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Tree View "),a()(),n(10,"li")(11,"a",7),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",7),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),E(17,Tw,35,25,"ng-template",null,0,O),a(),E(19,Ww,53,29,"content",8),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(10,Cw)),o(3),c("routerLink",M(11,fw)),o(3),c("routerLink",M(12,xw)),o(5),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,L,R,ie,pe,ge,Te,Ae,Et,Ce,U,ze,Mn,re,oe,Z,ne],encapsulation:2})};var yl=(i,s)=>({"text-danger":i,"text-success":s}),Nw=()=>["/menu/Products/Catalog/Variants/Info"],Sl=i=>({ID:i}),Aw=()=>["/menu/Orders/Orders/Customer_Invoice/Info"];function Gw(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Hw(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Discount Comparator"),a(),n(9,"ng-select",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CompareDifference,t)||(l.pageData.Filter.CompareDifference=t),_(t)}),a(),n(10,"h6"),p(11,"Variant"),a(),n(12,"autocompleteV2",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a(),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(17,"div",11)(18,"datepicker",12),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(19,"h6"),p(20,"Note"),a(),n(21,"input",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Note,t)||(l.pageData.Filter.Note=t),_(t)}),a(),n(22,"h6"),p(23,"Disc %"),a(),n(24,"div",14)(25,"input",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DiscountFrom,t)||(l.pageData.Filter.DiscountFrom=t),_(t)}),a(),n(26,"input",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DiscountTo,t)||(l.pageData.Filter.DiscountTo=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.CompareDifference),c("clearable",!1)("items",e.pageData.Options==null?null:e.pageData.Options.DiscountReportCompareType),o(3),C("ngModel",e.pageData.Filter.VariantID),c("renderThumbnail",!0),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.Note),o(4),C("ngModel",e.pageData.Filter.DiscountFrom),o(),C("ngModel",e.pageData.Filter.DiscountTo)}}function Qw(i,s){i&1&&(n(0,"th",26),p(1,"Cost"),a())}function Yw(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.UnitCost))}}function jw(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",38),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td")(9,"a",38),p(10),a(),b(11,"span",39),a(),n(12,"td"),p(13),d(14,"date"),a(),n(15,"td",33),p(16),d(17,"quantityFraction"),a(),S(18,Yw,3,3,"td",34),n(19,"td",33),p(20),d(21,"amountFraction"),a(),n(22,"td",33),p(23),d(24,"amountFraction"),a(),n(25,"td",35),p(26),d(27,"amountFraction"),a(),n(28,"td",34),p(29),d(30,"amountFraction"),a(),n(31,"td",36),p(32),d(33,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(33,Nw))("queryParams",X(34,Sl,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(2),c("routerLink",M(36,Aw))("queryParams",X(37,Sl,e.InvoiceID)),o(),F(e.Number),o(),c("innerHTML",e.Note,Ee),o(2),F(v(14,18,e.Date,"dd MMM yyyy")),o(3),F(g(17,21,e.Quantity)),o(2),y(r.roleService.product.Cost?18:-1),o(2),F(g(21,23,e.UnitPriceOriginal)),o(3),F(g(24,25,e.UnitPrice)),o(2),c("ngClass",fe(39,yl,!e.NetPriceIsGreaterThanOriginalPrice,e.NetPriceIsGreaterThanOriginalPrice)),o(),D(" ",g(27,27,e.Discount)),o(3),D(" ",g(30,29,e.DiscountPercentage),"% "),o(3),F(g(33,31,e.Sales))}}function qw(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(2,1,e.data.Aggregate.TotalUnitCost))}}function Uw(i,s){if(i&1){let e=I();n(0,"POS-complex-pagination",40),P("jumpToPage",function(){u(e);let t=m(2);return _(t.getListData())})("previousPage",function(){u(e);let t=m(2);return _(t.getListData())})("nextPage",function(){u(e);let t=m(2);return _(t.getListData())}),a()}if(i&2){let e=m(2);c("total",e.data.Data.length)("pageData",e.pageData)}}function zw(i,s){if(i&1){let e=I();n(0,"content")(1,"div",16)(2,"div",17)(3,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",19)(5,"tr")(6,"th",20),p(7,"Outlet"),a(),n(8,"th",21),p(9,"Variant"),a(),n(10,"th",22),p(11,"Code"),a(),n(12,"th",23),p(13,"Number / Note"),a(),n(14,"th",24),p(15,"Date"),a(),n(16,"th",25),p(17,"Quantity"),a(),S(18,Qw,2,0,"th",26),n(19,"th",27),p(20," Original Price"),a(),n(21,"th",28),p(22,"Price"),a(),n(23,"th",29),p(24,"Discount"),a(),n(25,"th",30),p(26," Disc%"),a(),n(27,"th",31),p(28,"Net Sales "),a()()(),n(29,"tbody"),G(30,jw,34,42,"tr",null,Y),a(),n(32,"tfoot")(33,"tr"),b(34,"td",32),n(35,"td",33),p(36,"Total :"),a(),n(37,"td",33),p(38),d(39,"quantityFraction"),a(),S(40,qw,3,3,"td",34),n(41,"td",33),p(42),d(43,"amountFraction"),a(),n(44,"td",33),p(45),d(46,"amountFraction"),a(),n(47,"td",35),p(48),d(49,"amountFraction"),a(),n(50,"td",34),p(51),d(52,"amountFraction"),a(),n(53,"td",36),p(54),d(55,"amountFraction"),a()()()()(),S(56,Uw,1,2,"POS-complex-pagination",37),a()()}if(i&2){let e=m();o(18),y(e.roleService.product.Cost?18:-1),o(12),H(e.data.Data),o(8),F(g(39,10,e.data.Aggregate.TotalQuantity)),o(2),y(e.roleService.product.Cost?40:-1),o(2),F(g(43,12,e.data.Aggregate.TotalUnitPriceOriginal)),o(3),F(g(46,14,e.data.Aggregate.TotalUnitPrice)),o(2),c("ngClass",fe(22,yl,e.data.Aggregate.TotalDiscount>0,e.data.Aggregate.TotalDiscount<0)),o(),D(" ",g(49,16,e.data.Aggregate.TotalDiscount<0?e.data.Aggregate.TotalDiscount*-1:e.data.Aggregate.TotalDiscount)),o(3),D(" ",g(52,18,e.data.Aggregate.DiscountPercentage),"% "),o(3),F(g(55,20,e.data.Aggregate.TotalNetSales)),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?56:-1)}}var no=class i extends De{constructor(e,r,t,l,h){super(e,r,"SalesReport/Discount","SalesReportLoader/DiscountLoader",null,t);this.roleService=l;this.dialog=h}postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data,this.initDiscountPercentage()}initDiscountPercentage(){this.data.Aggregate.DiscountPercentage=0;for(let e of this.data.Data)this.data.Aggregate.DiscountPercentage+=e.DiscountPercentage}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"EntityName":return V.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),h);case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),h);case"Number":return V.compare(t.Number,l.Number,h);case"Date":return V.compare(t.Date,l.Date,h);case"Quantity":return V.compare(t.Quantity,l.Quantity,h);case"UnitCost":return V.compare(t.UnitCost,l.UnitCost,h);case"UnitPriceOriginal":return V.compare(t.UnitPriceOriginal,l.UnitPriceOriginal,h);case"UnitPrice":return V.compare(t.UnitPrice,l.UnitPrice,h);case"Discount":return V.compare(t.Discount,l.Discount,h);case"Sales":return V.compare(t.Sales,l.Sales,h);case"DiscountPercentage":return V.compare(t.DiscountPercentage,l.DiscountPercentage,h);case"Note":return V.compare(t.Note,l.Note,h);default:return 0}})}openExportModal(){this.dialog.open(K,{data:{title:"Discounted Report",exportTypes:[{ID:"SalesReportExport/Discount",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["app-discount-sales"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose Discount Comparator",3,"ngModelChange","ngModel","clearable","items"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"d-flex",2,"column-gap","10px"],["type","text","autoNum","","percentage","",1,"form-control","w-100",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName",2,"width","150px"],["mat-sort-header","Name",2,"width","150px"],["mat-sort-header","Code",2,"width","100px"],["mat-sort-header","Number",2,"width","100px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitCost","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPriceOriginal","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Discount","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","DiscountPercentage","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],["colspan","4"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"],[1,"text-end","text-success"],["api","SalesReport/TotalDiscount",3,"total","pageData"],["target","_blank",3,"routerLink","queryParams"],[1,"d-block",3,"innerHTML"],["api","SalesReport/TotalDiscount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Gw,3,0,"a",2),a(),n(3,"filters"),E(4,Hw,27,16,"ng-template",null,0,O),a(),S(6,zw,57,25,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,tt,Q,$,J,Qe,L,R,pe,ge,Ue,Ae,Et,Ce,U,oe,Z,ne],encapsulation:2})};var Kw=()=>["/menu/Reports/Sales_Report/Standard/Person"],Xw=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],Jw=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],Zw=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],$w=(i,s)=>({From:i,To:s}),vl=i=>({ID:i}),Dl=i=>[i],eT=(i,s)=>({SalesPersonID:i,ListIDs:s}),tT=(i,s,e,r)=>({SalesPersonID:i,ListIDs:s,From:e,To:r});function iT(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function nT(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",19),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Date"),a(),n(9,"app-datepicker-range",20),P("dateChange",function(t){u(e);let l=m(2);return _(l.onChangeFilterDate1(t))}),a(),n(10,"h6",21),p(11,"Compare With"),a(),n(12,"app-datepicker-range",20),P("dateChange",function(t){u(e);let l=m(2);return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=m(2);o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To),o(3),c("from",e.pageData.Filter.CompareFrom)("to",e.pageData.Filter.CompareTo)}}function aT(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",37),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",36)(7,"a",38),p(8),d(9,"number"),a()(),n(10,"td",36),p(11),d(12,"quantityFraction"),a(),n(13,"td",36),p(14),d(15,"quantityFraction"),a(),n(16,"td",36),p(17),d(18,"quantityFraction"),a(),n(19,"td",36),p(20),d(21,"amountFraction"),a(),n(22,"td",36),p(23),d(24,"amountFraction"),a(),n(25,"td",36)(26,"a",38),d(27,"date"),d(28,"date"),p(29),d(30,"quantityFraction"),a()(),n(31,"td",36),p(32),d(33,"quantityFraction"),a(),n(34,"td",36),p(35),d(36,"quantityFraction"),a(),n(37,"td",36),p(38),d(39,"quantityFraction"),a(),n(40,"td",36),p(41),d(42,"amountFraction"),a(),n(43,"td",36),p(44),d(45,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m().$implicit,t=m(2);o(2),c("queryParams",X(47,vl,e.PersonID)),o(),F(e.PersonName),o(2),F(e.PersonCode),o(2),c("queryParams",fe(51,eT,e.PersonID,X(49,Dl,r.EntityID))),o(),F(g(9,17,e.CountOrder)),o(3),F(g(12,19,e.Quantity)),o(3),F(g(15,21,e.BasketSize)),o(3),F(g(18,23,e.BasketValue)),o(3),F(g(21,25,e.Sales)),o(3),F(g(24,27,e.AverageDailySales)),o(3),c("queryParams",Ut(56,tT,e.PersonID,X(54,Dl,r.EntityID),v(27,29,t.pageData.Filter.CompareFrom,"ddMMyyyy"),v(28,32,t.pageData.Filter.CompareTo,"ddMMyyyy"))),o(3),D(" ",g(30,35,e.CountOrder1)),o(3),F(g(33,37,e.Quantity1)),o(3),F(g(36,39,e.BasketSize1)),o(3),F(g(39,41,e.BasketValue1)),o(3),F(g(42,43,e.Sales1)),o(3),F(g(45,45,e.AverageDailySales1))}}function oT(i,s){if(i&1&&(n(0,"table",14)(1,"thead",22)(2,"tr",23)(3,"th",24)(4,"h2")(5,"a",25),p(6),a()()()(),n(7,"tr")(8,"th",26),p(9," Sales Person"),a(),n(10,"th",27)(11,"span"),p(12),d(13,"date"),a(),p(14," - "),n(15,"span"),p(16),d(17,"date"),a()(),n(18,"th",28)(19,"span"),p(20),d(21,"date"),a(),p(22," - "),n(23,"span"),p(24),d(25,"date"),a()()(),n(26,"tr",29)(27,"th",30),p(28," Ordr"),a(),n(29,"th",31),p(30,"Qty"),a(),n(31,"th",31),b(32,"i",32),a(),n(33,"th",33),p(34,"Basket Value"),a(),n(35,"th",33),p(36,"Sales"),a(),n(37,"th",33),p(38,"Avg Daily"),a(),n(39,"th",34),p(40,"Ordr"),a(),n(41,"th",31),p(42,"Qty"),a(),n(43,"th",31),b(44,"i",32),a(),n(45,"th",33),p(46,"Basket Value"),a(),n(47,"th",33),p(48,"Sales"),a(),n(49,"th",33),p(50,"Avg Daily"),a()()(),n(51,"tbody"),G(52,aT,46,61,"tr",null,Y),a(),n(54,"tfoot")(55,"tr",35)(56,"td"),p(57,"Total"),a(),n(58,"td",36),p(59),d(60,"sum"),d(61,"number"),a(),n(62,"td",36),p(63),d(64,"sum"),d(65,"quantityFraction"),a(),n(66,"td",36),p(67),d(68,"sum"),d(69,"quantityFraction"),a(),n(70,"td",36),p(71),d(72,"sum"),d(73,"quantityFraction"),a(),n(74,"td",36),p(75),d(76,"sum"),d(77,"amountFraction"),a(),n(78,"td",36),p(79),d(80,"sum"),d(81,"amountFraction"),a(),n(82,"td",36),p(83),d(84,"sum"),d(85,"number"),a(),n(86,"td",36),p(87),d(88,"sum"),d(89,"quantityFraction"),a(),n(90,"td",36),p(91),d(92,"sum"),d(93,"quantityFraction"),a(),n(94,"td",36),p(95),d(96,"sum"),d(97,"quantityFraction"),a(),n(98,"td",36),p(99),d(100,"sum"),d(101,"amountFraction"),a(),n(102,"td",36),p(103),d(104,"sum"),d(105,"amountFraction"),a()()()()),i&2){let e=s.$implicit,r=m(2);o(5),c("queryParams",X(90,vl,e.EntityID)),o(),F(e.EntityName),o(6),F(v(13,18,r.pageData.Filter.From,"dd MMMM yyyy")),o(4),F(v(17,21,r.pageData.Filter.To,"dd MMMM yyyy")),o(4),F(v(21,24,r.pageData.Filter.CompareFrom,"dd MMMM yyyy")),o(4),F(v(25,27,r.pageData.Filter.CompareTo,"dd MMMM yyyy")),o(28),H(e.SalesCommison),o(7),F(g(61,33,v(60,30,e.SalesCommison,"CountOrder"))),o(4),F(g(65,38,v(64,35,e.SalesCommison,"Quantity"))),o(4),F(g(69,43,v(68,40,e.SalesCommison,"BasketSize"))),o(4),F(g(73,48,v(72,45,e.SalesCommison,"BasketValue"))),o(4),F(g(77,53,v(76,50,e.SalesCommison,"Sales"))),o(4),F(g(81,58,v(80,55,e.SalesCommison,"AverageDailySales"))),o(4),F(g(85,63,v(84,60,e.SalesCommison,"CountOrder1"))),o(4),F(g(89,68,v(88,65,e.SalesCommison,"Quantity1"))),o(4),F(g(93,73,v(92,70,e.SalesCommison,"BasketSize1"))),o(4),F(g(97,78,v(96,75,e.SalesCommison,"BasketValue1"))),o(4),F(g(101,83,v(100,80,e.SalesCommison,"Sales1"))),o(4),F(g(105,88,v(104,85,e.SalesCommison,"AverageDailySales1")))}}function rT(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",3)(3,"a",4),P("click",function(){u(e);let t=m();return _(t.print())}),b(4,"i",5),p(5," Print"),a(),S(6,iT,3,0,"a",6),n(7,"div",7)(8,"button",8),p(9," More "),a(),n(10,"ul",9)(11,"li")(12,"a",10),p(13,"Summary"),a()(),n(14,"li")(15,"a",10),p(16,"By Employee"),a()(),n(17,"li")(18,"a",10),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",11),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),E(26,nT,13,9,"ng-template",null,0,O),a(),n(28,"content")(29,"div",12)(30,"div",13),G(31,oT,106,92,"table",14,Y),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(6),y(e.roleService!=null&&e.roleService.global.Export?6:-1),o(6),c("routerLink",M(16,Kw)),o(3),c("routerLink",M(17,Xw)),o(3),c("routerLink",M(18,Jw)),o(3),c("routerLink",M(19,Zw))("queryParams",fe(20,$w,v(22,10,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),v(23,13,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(10),H(e.data==null?null:e.data.Data)}}var ao=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/GetSalesPersonCommissionGroupByOutlet","ReportLoader/GetSalesPersonCommissionGroupByOutlet",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.loaderPayload.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Commission Report",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionGroupByOutlet",Value:"Default",FileName:"Outlet Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}onChangeFilterDate1(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to,this.onFilterFromDate(),this.onFilterToDate()}onChangeFilterDate2(e){this.pageData.Filter.CompareFrom=e.from,this.pageData.Filter.CompareTo=e.to}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(Ne))};static \u0275cmp=B({type:i,selectors:[["POS-sales-person-by-outlet"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],[1,"btn","btn-outline-secondary","ms-3"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","mb-10"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to"],[1,"mt-0"],[1,"thead-light"],[2,"border","none !important"],["colspan","14",1,"text-center","bg-white","border-none"],["routerLink","/menu/Outlets/Master/Outlets/Info",3,"queryParams"],["rowspan","2","colspan","1",1,"border-end","text-center",2,"width","280px"],["colspan","6",1,"text-center"],["colspan","6",1,"text-center","border-start"],[1,"border-top-2"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end",2,"width","50px"],[1,"text-end",2,"width","50px"],["matTooltip","Basket Size","matTooltipPosition","above",1,"fa-solid","fa-cart-shopping"],[1,"text-end",2,"width","100px"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end","border-start",2,"width","50px"],[1,"table-footer","fw-bold"],[1,"text-end"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],["routerLink","/menu/Reports/Sales_Report/Standard/Detail",3,"queryParams"]],template:function(r,t){r&1&&S(0,rT,33,23,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,L,R,ie,Gt,U,ze,se,re,oe,Z,ne],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}}"]})};var oo=class i{onPanelShow(){setTimeout(()=>{let s=document.querySelector(".p-multiselect-filter-container input.p-multiselect-filter");s&&(s.focus(),s.select?.())},0)}static \u0275fac=function(e){return new(e||i)};static \u0275dir=pn({type:i,selectors:[["","autoFocusMultiselect",""]],hostBindings:function(e,r){e&1&&P("onPanelShow",function(){return r.onPanelShow()})}})};var pT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],mT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],sT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],cT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],dT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],uT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],wl=i=>({ID:i});function _T(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Date Value"),a(),n(2,"radio-options",35),x("modelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ReleasedType,t)||(l.pageData.Filter.ReleasedType=t),_(t)}),a()}if(i&2){let e=m(2);o(2),C("model",e.pageData.Filter.ReleasedType),c("options",e.pageData.Options==null?null:e.pageData.Options.ReleasedType)}}function gT(i,s){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Product Tag"),a(),n(9,"p-multiselect",21),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListTagID,t)||(l.pageData.Filter.ListTagID=t),_(t)}),a(),S(10,_T,3,2),n(11,"h6"),p(12,"Release Date"),a(),n(13,"div",22)(14,"datepicker",23),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ReleasedFrom,t)||(l.pageData.Filter.ReleasedFrom=t),_(t)}),a(),n(15,"datepicker",24),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ReleasedTo,t)||(l.pageData.Filter.ReleasedTo=t),_(t)}),a()(),n(16,"h6",25)(17,"div",26),p(18,"Number Of Interval"),a(),n(19,"div",26),p(20,"Interval Of"),a()(),n(21,"div",27)(22,"input",28),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.IntervalCount,t)||(l.pageData.Filter.IntervalCount=t),_(t)}),a(),n(23,"div",29)(24,"input",30),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.IntervalDays,t)||(l.pageData.Filter.IntervalDays=t),_(t)}),a(),n(25,"span",31),p(26,"Days"),a()()(),n(27,"h6"),p(28,"Page Size"),a(),n(29,"input",32),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(30,"h6"),p(31,"Purchased"),a(),n(32,"radio-options",33),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.PurchaseType,t)||(l.pageData.Filter.PurchaseType=t),_(t)}),a(),n(33,"h6"),p(34,"Scope"),a(),n(35,"radio-options",33),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(36,"h6"),p(37,"Options"),a(),n(38,"radio-options",34),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.HideZero,t)||(l.pageData.Filter.HideZero=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("isInitializedCategoryLabel",!0)("showClear",!0),o(3),C("ngModel",e.pageData.Filter.ListTagID),c("options",e.pageData.Options.Tags)("showClear",!0)("maxSelectedLabels",5),o(),y((e.pageData.Filter.ListTagID==null?null:e.pageData.Filter.ListTagID.length)<=1?10:-1),o(4),C("date",e.pageData.Filter.ReleasedFrom),o(),C("date",e.pageData.Filter.ReleasedTo),o(7),C("ngModel",e.pageData.Filter.IntervalCount),o(2),C("ngModel",e.pageData.Filter.IntervalDays),o(5),c("max",1e3),C("ngModel",e.pageData.Filter.RowCount),o(3),C("model",e.pageData.Filter.PurchaseType),c("options",e.pageData.Options==null?null:e.pageData.Options.PurchaseType),o(3),C("model",e.pageData.Filter.GroupByProduct),c("options",e.scopeFilter),o(3),C("model",e.pageData.Filter.HideZero),c("options",e.hideZeroOptions)}}function CT(i,s){if(i&1){let e=I();n(0,"button",36),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",37),p(2," Export "),a()}}function fT(i,s){if(i&1&&(n(0,"th",38),p(1),a(),n(2,"th",39),p(3," % "),a()),i&2){let e=s.$index,r=m();c("mat-sort-header","Interval"+e)("matTooltip"," Quantity Sold "+(e*r.intervalDays()+1)+" - "+(e+1)*r.intervalDays()+" Days since Release Date"),o(),D(" ",e*r.intervalDays()+1+"-"+(e+1)*r.intervalDays()," "),o(),c("mat-sort-header","Percentage"+e)("matTooltip"," Percentage Sold "+(e*r.intervalDays()+1)+" - "+(e+1)*r.intervalDays()+" Days since Release Date")}}function xT(i,s){if(i&1&&(n(0,"th",40),d(1,"date"),d(2,"date"),p(3," TOT "),a(),n(4,"th",41),d(5,"date"),d(6,"date"),p(7," % "),a()),i&2){let e=m();c("matTooltip","Total items sold"+(e.pageData.Filter.ReleasedFrom&&e.pageData.Filter.ReleasedTo?` in this period
|
|
6
|
+
`)}),C}}}}generateSeries(){let e,r=[];return r=this.data.MonthlySalesRank.map(t=>(e={name:`${t.Name} ${t.CompareYear}`,data:t.Sales,stack:t.Year},e)),r}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-sales"]],standalone:!1,features:[W],decls:11,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"dateChange","date"],[1,"mt-4"],["appendTo","body","bindValue","value","bindLabel","label","placeholder","Compare To Year",3,"ngModelChange","ngModel","items"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],["name","Inventory",3,"modelChange","model"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"a",3),b(4,"i",4),p(5,"Table View"),a()()(),n(6,"filters"),E(7,eu,22,13,"ng-template",null,0,O),a(),n(9,"content"),S(10,tu,2,2,"div",5),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(3),c("routerLink",M(6,$d)),o(7),y(t.data?10:-1))},dependencies:[A,Q,$,L,R,ie,Te,Mt,pi,Ce,U],encapsulation:2})};var iu=()=>["/menu/Reports/Sales_Report/Standard/Yearly"],nu=(i,s)=>({"text-success":i,"text-danger":s}),el=(i,s)=>({"text-success fw-bold":i,"text-danger fw-bold":s});function au(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function ou(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year to Compare"),a(),n(12,"div",12)(13,"div",13)(14,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(15,"div",13)(16,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()(),n(17,"h6"),p(18,"Sales Order Tag"),a(),n(19,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(20,"h6"),p(21,"Currency"),a(),n(22,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Option.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SalesID),o(5),f("ngModel",e.pageData.Filter.FromYear),c("items",e.Years),o(2),f("ngModel",e.pageData.Filter.ToYear),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Option==null?null:e.pageData.Option.Types),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Option.Currencies)}}function ru(i,s){if(i&1&&(n(0,"th",21),d(1,"GetChildrenArray"),d(2,"sum"),p(3),a()),i&2){let e=s.$implicit,r=m(2);c("colSpan",v(2,5,r.filterSales(v(1,2,r.data.Data,"Sales"),"Year",e),"Tax")==0?1:3),o(3),D(" ",e)}}function lu(i,s){i&1&&(n(0,"th",27),p(1," Sales"),a())}function pu(i,s){i&1&&(n(0,"th",28),p(1," Tax"),a())}function mu(i,s){if(i&1&&(S(0,lu,2,0,"th",27),d(1,"GetChildrenArray"),d(2,"sum"),S(3,pu,2,0,"th",28),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"th",28),p(7," Sales + Tax"),a()),i&2){let e=s.$implicit,r=m(2);y(v(2,5,r.filterSales(v(1,2,r.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,11,r.filterSales(v(4,8,r.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1)}}function su(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m(2);o(),D(" ",g(3,4,v(2,1,t.filterSales(r.Sales,"Year",e),"Sales")))}}function cu(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m(2);o(),D(" ",g(3,4,v(2,1,t.filterSales(r.Sales,"Year",e),"Tax"))," ")}}function du(i,s){if(i&1&&(S(0,su,4,6,"td",28),d(1,"GetChildrenArray"),d(2,"sum"),S(3,cu,4,6,"td",28),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"td",28),p(7),d(8,"sum"),d(9,"amountFraction"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m(2);y(v(2,6,t.filterSales(v(1,3,t.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,12,t.filterSales(v(4,9,t.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1),o(4),D(" ",g(9,18,v(8,15,t.filterSales(r.Sales,"Year",e),"SalesWithTax")))}}function uu(i,s){if(i&1&&(n(0,"tr",23)(1,"td"),p(2),d(3,"Month"),a(),G(4,du,10,20,null,null,Y),n(6,"td",26),d(7,"sum"),d(8,"sum"),p(9),d(10,"sum"),d(11,"number"),a(),n(12,"td",26),d(13,"sum"),d(14,"sum"),p(15),d(16,"sum"),d(17,"number"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(g(3,5,e.Month)),o(2),H(r.data.HeaderList),o(2),c("ngClass",fe(29,el,v(7,7,r.filterSales(e.Difference,"Month",e.Month),"Difference")>0,v(8,10,r.filterSales(e.Difference,"Month",e.Month),"Difference")<0)),o(3),D(" ",g(11,16,v(10,13,r.filterSales(e.Difference,"Month",e.Month),"Difference"))," "),o(3),c("ngClass",fe(32,el,v(13,18,r.filterSales(e.Difference,"Month",e.Month),"Percentage")>0,v(14,21,r.filterSales(e.Difference,"Month",e.Month),"Percentage")<0)),o(3),D(" ",g(17,27,v(16,24,r.filterSales(e.Difference,"Month",e.Month),"Percentage"))," ")}}function _u(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(4,7,v(3,4,r.filterSales(v(2,1,r.data.Data,"Sales"),"Year",e),"Sales")))}}function gu(i,s){if(i&1&&(n(0,"td",30),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(4,7,v(3,4,r.filterSales(v(2,1,r.data.Data,"Sales"),"Year",e),"Tax")))}}function Cu(i,s){if(i&1&&(S(0,_u,5,9,"td",29),d(1,"GetChildrenArray"),d(2,"sum"),S(3,gu,5,9,"td",30),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"td",29),p(7),d(8,"GetChildrenArray"),d(9,"sum"),d(10,"amountFraction"),a()),i&2){let e=s.$implicit,r=m(2);y(v(2,6,r.filterSales(v(1,3,r.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,12,r.filterSales(v(4,9,r.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1),o(4),D(" ",g(10,21,v(9,18,r.filterSales(v(8,15,r.data.Data,"Sales"),"Year",e),"SalesWithTax")))}}function fu(i,s){if(i&1&&(n(0,"div",5)(1,"table",18)(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Month"),a(),G(6,ru,4,8,"th",21,Y),n(8,"th",22),p(9,"Diff"),a(),n(10,"th",22),p(11,"%"),a()(),n(12,"tr"),G(13,mu,8,14,null,null,Y),a()(),n(15,"tbody"),G(16,uu,18,35,"tr",23,Y),a(),n(18,"tfoot",24)(19,"tr")(20,"td",25),p(21,"Total :"),a(),G(22,Cu,11,23,null,null,Y),n(24,"td",26),p(25),d(26,"number"),a()()()()()),i&2){let e=m();o(6),H(e.data.HeaderList),o(7),H(e.data.HeaderList),o(3),H(e.data.Data),o(6),H(e.data.HeaderList),o(2),c("ngClass",fe(4,nu,e.data.TotalDiff>0,e.data.TotalDiff<0)),o(),D(" ",g(26,2,e.data.TotalDiff))}}var sa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/YearlySalesList","ReportLoader/YearlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}subheader=["Sales","Tax","Sales+Tax"];prop=["Sales","Tax","SalesWithTax"];Years=V.GenerateYears(new Date().getFullYear(),11,!0);filterSales(e,r,t){return e.filter(function(l){return l[r]==t})}openExportModal(){this.matDialog.open(K,{data:{title:"Yearly",exportTypes:[{ID:"ReportExport/YearlySalesList",Value:"Default",FileName:"Yearly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-yearly"]],standalone:!1,features:[W],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[1,"row"],[1,"col-6"],["appendTo","body","placeholder","Choose Year From",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year To",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["rowspan","2"],[1,"text-center","border-start","border-end",3,"colSpan"],["rowspan","2",1,"text-end"],[1,"border-bottom"],[1,"table-footer"],[1,"fw-bold","text-success"],[1,"text-end",3,"ngClass"],[1,"text-end","border-start"],[1,"text-end"],[1,"text-end","text-success"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,au,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,ou,23,15,"ng-template",null,0,O),a(),n(9,"content"),S(10,fu,27,7,"div",5),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,iu)),o(7),y(t.data?10:-1))},dependencies:[A,tt,Q,$,L,R,ie,Ce,U,ze,se,Ln,fr,re,Z],encapsulation:2})};var xu=()=>["/menu/Reports/Sales_Report/Standard/Daily"],yo=(i,s)=>({From:i,To:s}),hu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Su=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"],tl=i=>({"is-weekend":i});function yu(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Du(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",14),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(19,"h6"),p(20,"Sales Order Tag"),a(),n(21,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate),o(3),f("ngModel",e.pageData.Filter.DeliveryID),c("items",e.pageData.Options==null?null:e.pageData.Options.Deliveries),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function vu(i,s){i&1&&(n(0,"th",26),p(1," Tax "),a())}function wu(i,s){i&1&&(n(0,"th",27),p(1,"Net Sales + Tax"),a())}function Tu(i,s){i&1&&(n(0,"th",28),p(1,"Cost"),a())}function Pu(i,s){i&1&&(n(0,"th",29),p(1," Profit "),a())}function Fu(i,s){i&1&&(n(0,"th",30),p(1," Profit + Tax Include "),a())}function Iu(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Tax))}}function bu(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D("",g(2,1,e.SalesNetWithTax)," ")}}function Eu(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost))}}function Mu(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit))}}function Vu(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.ProfitWithTax>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.ProfitWithTax))}}function Bu(i,s){if(i&1&&(n(0,"tr",31)(1,"td",31),p(2),d(3,"date"),a(),n(4,"td"),p(5),d(6,"date"),a(),n(7,"td",33),p(8),d(9,"number"),a(),n(10,"td",33),p(11),d(12,"quantityFraction"),a(),n(13,"td",33),p(14),d(15,"amountFraction"),a(),n(16,"td",33),p(17),d(18,"amountFraction"),a(),S(19,Iu,3,3,"td",37),S(20,bu,3,3,"td",33),S(21,Eu,3,3,"td",34),S(22,Mu,3,4,"td",36),S(23,Vu,3,4,"td",36),a()),i&2){let e=s.$implicit,r=m(2);c("ngClass",X(27,tl,r.data.DayOfWeekend)),o(),c("ngClass",X(29,tl,e.DayOfWeekend)),o(),D(" ",v(3,13,e.Day,"EEEE")," "),o(3),F(v(6,16,e.Day,"dd")),o(3),F(g(9,19,e.Count)),o(3),F(g(12,21,e.Quantity)),o(3),F(g(15,23,e.Gross)),o(3),F(g(18,25,e.SalesNet)),o(2),y(r.data.ShowTax?19:-1),o(),y(r.data.ShowTax?20:-1),o(),y(r.roleService.product.Cost?21:-1),o(),y(r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost?22:-1),o(),y(!r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost?23:-1)}}function Ou(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax")))}}function Lu(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"SalesNetWithTax")))}}function Ru(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost")))}}function ku(i,s){if(i&1&&(n(0,"td",35),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",v(1,2,e.data.Data,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.data.Data,"Profit")))}}function Wu(i,s){if(i&1&&(n(0,"td",36),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",v(1,2,e.data.Data,"ProfitWithTax")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.data.Data,"ProfitWithTax")))}}function Nu(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Day"),a(),n(6,"th",21),p(7,"Dt."),a(),n(8,"th",22),p(9,"Orders "),a(),n(10,"th",23),p(11," Quantity"),a(),n(12,"th",24),p(13," Gross"),a(),n(14,"th",25),p(15," Net Sales"),a(),S(16,vu,2,0,"th",26),S(17,wu,2,0,"th",27),S(18,Tu,2,0,"th",28),S(19,Pu,2,0,"th",29),S(20,Fu,2,0,"th",30),a()(),n(21,"tbody"),G(22,Bu,24,31,"tr",31,Y),a(),n(24,"tfoot")(25,"tr"),b(26,"td",32)(27,"td",32),n(28,"td",33),p(29),d(30,"sum"),d(31,"number"),a(),n(32,"td",33),p(33),d(34,"sum"),d(35,"quantityFraction"),a(),n(36,"td",33),p(37),d(38,"sum"),d(39,"amountFraction"),a(),n(40,"td",33),p(41),d(42,"sum"),d(43,"amountFraction"),a(),S(44,Ou,4,6,"td",33),S(45,Lu,4,6,"td",33),S(46,Ru,4,6,"td",34),S(47,ku,5,10,"td",35),S(48,Wu,5,10,"td",36),a()()()()}if(i&2){let e=m();o(16),y(e.data.ShowTax?16:-1),o(),y(e.data.ShowTax?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?19:-1),o(),y(!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?20:-1),o(2),H(e.data.Data),o(7),F(g(31,17,v(30,14,e.data.Data,"Count"))),o(4),F(g(35,22,v(34,19,e.data.Data,"Quantity"))),o(4),F(g(39,27,v(38,24,e.data.Data,"Gross"))),o(4),F(g(43,32,v(42,29,e.data.Data,"SalesNet"))),o(3),y(e.data.ShowTax?44:-1),o(),y(e.data.ShowTax?45:-1),o(),y(e.roleService.product.Cost?46:-1),o(),y(e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?47:-1),o(),y(!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?48:-1)}}var ca=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/DailySalesList","ReportLoader/DailyReportSales",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.activatedRoute=T}maxFilterDate=new Date;originalData;hideMore=!0;postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data}preInitList(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";return this.compare(t[e.active],l[e.active],C)})}onFilterDateChange(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to}openExportModal(){this.matDialog.open(K,{data:{title:"Daily Sales Report",exportTypes:[{ID:"ReportExport/DailySalesExport",Value:"Default",FileName:"Daily Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily"]],standalone:!1,features:[W],decls:21,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to","maxDate"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["id","tableGrid","api","Report/DailySalesList","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Day",2,"width","90px"],["mat-sort-header","Date",1,"align-left",2,"width","42px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Gross","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNetWithTax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","ProfitWithTax","arrowPosition","before",1,"flex-right",2,"width","160px"],[3,"ngClass"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-danger",3,"ngClass"],[1,"text-end",3,"ngClass"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,yu,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Sales Chart "),a()(),n(10,"li")(11,"a",6),p(12," Daily Quantity Sold "),a()(),n(13,"li")(14,"a",6),p(15," Monthly Quantity Sold "),a()()()()(),n(16,"filters"),E(17,Du,22,16,"ng-template",null,0,O),a(),n(19,"content"),S(20,Nu,49,34,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,xu))("queryParams",fe(13,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(16,hu))("queryParams",fe(17,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(20,Su))("queryParams",fe(21,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(6),y(t.data?20:-1))},dependencies:[A,tt,Q,$,L,R,pe,ge,Gt,Ce,U,ze,se,re,oe,Z,ne],encapsulation:2})};var Au=()=>["/menu/Reports/Sales_Report/Standard/Monthly"];function Gu(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function Hu(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year"),a(),n(12,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(13,"h6"),p(14,"Multiply Unit Qty"),a(),n(15,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("model",e.pageData.Filter.MultiplyUnitQuantity)}}function Qu(i,s){i&1&&(n(0,"th",19),p(1," Cost "),a())}function Yu(i,s){i&1&&(n(0,"th",19),p(1," Profit "),a())}function ju(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function qu(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Profit)," ")}}function Uu(i,s){if(i&1&&(n(0,"tr",28)(1,"td"),p(2),d(3,"Month"),a(),n(4,"td",23),p(5),d(6,"number"),a(),n(7,"td",23),p(8),d(9,"quantityFraction"),a(),E(10,ju,3,3,"td",24),n(11,"td",23),p(12),d(13,"amountFraction"),a(),n(14,"td",23),p(15),d(16,"amountFraction"),a(),n(17,"td",25),p(18),d(19,"amountFraction"),a(),n(20,"td",26),p(21),d(22,"amountFraction"),a(),E(23,qu,3,3,"td",27),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(g(3,9,e.Month)),o(3),F(g(6,11,e.Count)),o(3),D(" ",g(9,13,e.Quantity)," "),o(2),c("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit),o(2),D(" ",g(13,15,e.Gross)," "),o(3),D(" ",g(16,17,e.Sales)," "),o(3),D(" ",g(19,19,e.Tax)," "),o(3),F(g(22,21,e.SalesNetWithTax)),o(2),c("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit)}}function zu(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function Ku(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Profit"))," ")}}function Xu(i,s){if(i&1&&(n(0,"div",14)(1,"table",15)(2,"thead",16)(3,"tr")(4,"th",17),p(5,"Month"),a(),n(6,"th",18),p(7,"Orders"),a(),n(8,"th",19),p(9,"Quantity"),a(),E(10,Qu,2,0,"th",20),n(11,"th",19),p(12,"Gross"),a(),n(13,"th",19),p(14,"Sales"),a(),n(15,"th",19),p(16,"Tax"),a(),n(17,"th",19),p(18,"Sales + Tax"),a(),E(19,Yu,2,0,"th",20),a()(),n(20,"tbody"),E(21,Uu,24,23,"tr",21),a(),n(22,"tfoot")(23,"tr",22),b(24,"td"),n(25,"td",23),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",23),p(30),d(31,"sum"),d(32,"quantityFraction"),a(),E(33,zu,4,6,"td",24),n(34,"td",23),p(35),d(36,"sum"),d(37,"amountFraction"),a(),n(38,"td",23),p(39),d(40,"sum"),d(41,"amountFraction"),a(),n(42,"td",25),p(43),d(44,"sum"),d(45,"amountFraction"),a(),n(46,"td",26),p(47),d(48,"sum"),d(49,"amountFraction"),a(),E(50,Ku,4,6,"td",27),a()()()()),i&2){let e=m();o(10),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(9),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),c("ngForOf",e.data.Data),o(5),D(" ",g(28,14,v(27,11,e.data.Data,"Count"))," "),o(4),D(" ",g(32,19,v(31,16,e.data.Data,"Quantity"))," "),o(3),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),D(" ",g(37,24,v(36,21,e.data.Data,"Gross"))," "),o(4),D(" ",g(41,29,v(40,26,e.data.Data,"Sales"))," "),o(4),D(" ",g(45,34,v(44,31,e.data.Data,"Tax"))," "),o(4),D(" ",g(49,39,v(48,36,e.data.Data,"SalesNetWithTax"))," "),o(3),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit)}}var da=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/MonthlySalesList","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}Years=V.GenerateYears(new Date().getFullYear(),11,!0);preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Monthly",exportTypes:[{ID:"ReportExport/MonthlySalesList",Value:"Default",FileName:"Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly"]],standalone:!1,features:[W],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["name","Inventory",3,"modelChange","model"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","90px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end"],["class","text-end text-success",4,"ngIf"],[1,"border-bottom"],[1,"text-end","text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Gu,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Hu,16,10,"ng-template",null,0,O),a(),n(9,"content"),E(10,Xu,51,41,"div",5),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,Au)),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,L,R,ie,Te,Ce,U,ze,se,Ln,re,Z,ne],encapsulation:2})};var Ju=()=>["/menu/Reports/Sales_Report/Standard/Daily"],il=(i,s)=>({From:i,To:s}),Zu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],$u=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function e_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)("minDate",e.minFilterDate)}}function t_(i,s){if(i&1&&(n(0,"content")(1,"div",12),b(2,"POS-line-chart",13),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var ua=class i extends me{constructor(e,r,t,l){super(e,r,"Report/DailySalesVolume","ReportLoader/DailyReportSales",null,l);this.httpService=r;this.csvConverter=t;this.initValidateFilterDate()}maxFilterDate;minFilterDate;Years=V.GenerateYears(new Date().getFullYear(),11,!0);chartConfig;currency=-1;Months=V.Months;ChartData={};initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,45)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.getQueryParams(),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}getQueryParams(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To)}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){this.menuData.H=this.data.PageTitle,this.initChart()}initChart(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},yAxis:{title:{text:""}},xAxis:{categories:this.generateChartCategories()},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return V.getDatesInRange(e,r).map(C=>`${C.getDate()} ${V.Months[C.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(e){this.pageData.Filter.From=e.from?.toISOString(),this.pageData.Filter.To=e.to?.toISOString()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-volume"]],standalone:!1,features:[W],decls:19,vars:19,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dropdown-item",3,"routerLink"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"dateChange","from","to","maxDate","minDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",6),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),E(16,e_,13,12,"ng-template",null,0,O),a(),S(18,t_,3,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(10,Ju))("queryParams",fe(11,il,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(14,Zu))("queryParams",fe(15,il,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(18,$u)),o(5),y(t.data?18:-1))},dependencies:[A,Q,$,L,R,Mt,Gt,Ce,U],encapsulation:2})};var i_=()=>["/menu/Reports/Sales_Report/Standard/Daily"],n_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],a_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"];function o_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Year"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function r_(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-line-chart",12),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.ChartData)}}var _a=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthtlySalesVolume","ReportLoader/MonthlySalesVolume");this.httpService=r;this.csvConverter=t}currency=-1;Years=V.GenerateYears(new Date().getFullYear(),11,!0);ChartData={};chartConfig;preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=[];this.data.MonthlySalesRank.forEach(r=>{let t=r.Sales.map(C=>parseInt(C)),l={name:r.Name,data:t};e.push(l)}),this.ChartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-volume"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",5),p(14," Daily Quantity Sold "),a()()()()(),n(15,"filters"),E(16,o_,13,9,"ng-template",null,0,O),a(),n(18,"content"),S(19,r_,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(8,i_)),o(3),c("routerLink",M(9,n_)),o(3),c("routerLink",M(10,a_)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,R,Mt,Ce,U],encapsulation:2})};var l_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],p_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],m_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"];function s_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",11)(12,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function c_(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",13),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var ga=class i extends me{constructor(e,r){super(e,r,"Report/OutletPerformanceCart","ReportLoader/OutletPerformance");this.httpService=r}PieData={};pieConfig={title:"",dataLabels:!0,labelTooltips:"Sales",height:400,legend:{}};postInit(){this.getPieData(),this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getPieData(){let e=[],r=[];this.data.DataWithoutCategory.length>0&&this.data.DataWithoutCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.data.DataWithCategory.length>0&&this.data.DataWithCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.PieData=r}static \u0275fac=function(r){return new(r||i)(w(N),w(k))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-graphic"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Outlet Performance "),a()(),n(9,"li")(10,"a",5),p(11," Compare by Outlet Group "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Month "),a()()()()(),n(15,"filters"),E(16,s_,13,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,c_,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(8,l_)),o(3),c("routerLink",M(9,p_)),o(3),c("routerLink",M(10,m_)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,J,L,R,ii,Ce],encapsulation:2})};var Do=Jt(bi());var d_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],u_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],__=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],g_=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),nl=(i,s,e)=>({ListIDs:i,From:s,To:e}),Li=(i,s)=>({"text-danger":i,"text-success":s}),C_=()=>["/menu/Reports/Sales_Report/Standard/Summary"],al=(i,s)=>({"text-warning":i,"text-success":s,"text-end":!0}),ol=(i,s)=>({"text-success":i,"text-danger":s});function f_(i,s){if(i&1){let e=I();n(0,"a",12),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function x_(i,s){if(i&1){let e=I();n(0,"div",14)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",15),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TagIDs,t)||(l.pageData.Filter.TagIDs=t),_(t)}),a(),n(7,"h6"),p(8,"Outlet Group"),a(),n(9,"POS-outlet-group-tree-select",17),h("selectedOutletGroupIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(14,"div",19)(15,"datepicker",20),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(16,"h6"),p(17,"Brand"),a(),n(18,"ng-select",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(19,"h6"),p(20,"Product Type"),a(),n(21,"radio-options",22),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(22,"h6"),p(23," Query Option "),b(24,"i",23),a(),n(25,"ng-select",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),f("ngModel",e.pageData.Filter.TagIDs),o(3),c("showClear",!0),f("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("multiple",!0),f("ngModel",e.pageData.Filter.BrandIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),f("ngModel",e.pageData.Filter.QueryOption)}}function h_(i,s){i&1&&(n(0,"th",55),p(1," Prev "),a())}function S_(i,s){i&1&&(n(0,"th",56),p(1," Now "),a())}function y_(i,s){i&1&&(n(0,"th",57),p(1," Orders "),a())}function D_(i,s){i&1&&(n(0,"th",58),p(1," Qty "),a())}function v_(i,s){i&1&&(n(0,"th",59),p(1," Gross "),a())}function w_(i,s){i&1&&(n(0,"th",60),p(1," Basket Size "),a())}function T_(i,s){i&1&&(n(0,"th",61),p(1," Sales "),a())}function P_(i,s){i&1&&(n(0,"th",62),p(1," Avg Daily Sales "),a())}function F_(i,s){i&1&&(n(0,"th",63),p(1," Inventory "),a())}function I_(i,s){i&1&&(pt(0),n(1,"th",64),p(2," Target "),a(),mt())}function b_(i,s){i&1&&(n(0,"th",66),p(1," Ach(%) "),a())}function E_(i,s){if(i&1&&(pt(0),E(1,b_,2,0,"th",65),d(2,"HideSumZero"),d(3,"HideSumZero"),mt()),i&2){let e=m(2);o(),c("ngIf",v(2,1,e.data.Data,"AchievementWithTax")||v(3,4,e.data.Data,"Achievement"))}}function M_(i,s){i&1&&(n(0,"th",67),p(1," Daily Target "),a())}function V_(i,s){i&1&&(n(0,"th",68),p(1," Tax "),a())}function B_(i,s){if(i&1&&(n(0,"th",69),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function O_(i,s){i&1&&(n(0,"th",70),p(1,"\xB1 (%)"),a())}function L_(i,s){i&1&&(n(0,"th",71),p(1," Cost "),a())}function R_(i,s){if(i&1&&(n(0,"th",69),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function k_(i,s){i&1&&(n(0,"th",72),p(1," Expense "),a())}function W_(i,s){if(i&1&&(n(0,"td",75),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function N_(i,s){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.index;c("ngClass",fe(2,g_,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function A_(i,s){if(i&1&&(n(0,"td",70)(1,"a",77),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(5,nl,e.EntityID,r.convertToDateString(r.pageData.Filter.From),r.convertFromDateString(r.pageData.Filter.To))),o(),F(v(3,2,e.Count,"1.0-0"))}}function G_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function H_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function Q_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.BasketSize,"1.0-2")," ")}}function Y_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function j_(i,s){if(i&1&&(n(0,"td",70)(1,"div"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.AverageDailySales))}}function q_(i,s){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.InventoryValue))}}function U_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.RangeSalesTarget)," ")}}function z_(i,s){if(i&1&&(pt(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m(2).$implicit;o(),c("ngClass",fe(4,Li,e.AchievementWithTax<100,e.AchievementWithTax>100)),o(),D(" ",g(3,2,e.AchievementWithTax)," ")}}function K_(i,s){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Li,e.Achievement<100,e.Achievement>100)),o(),D(" ",g(2,2,e.Achievement)," ")}}function X_(i,s){if(i&1&&(n(0,"td",70),E(1,z_,4,7,"ng-container",78)(2,K_,3,7,"ng-template",null,1,O),a()),i&2){let e=Tt(3),r=m(3);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function J_(i,s){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.SalesTarget))}}function Z_(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function $_(i,s){if(i&1&&(n(0,"td",70)(1,"a",81),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(11,C_))("queryParams",_t(12,nl,e.EntityID,v(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),v(3,6,r.pageData.Filter.To,"yyyy-MM-dd"))),o(4),F(g(6,9,e.SalesWithTax))}}function e1(i,s){if(i&1&&(pt(0),p(1),d(2,"number"),mt()),i&2){let e=m(2).$implicit;o(),D(" ",v(2,1,e.Increase,"1.0-0")," ")}}function t1(i,s){if(i&1&&p(0),i&2){let e=m(2).$implicit;D(" ",e.Increase," ")}}function i1(i,s){if(i&1&&(n(0,"td",79),E(1,e1,3,4,"ng-container",78)(2,t1,1,1,"ng-template",null,2,O),a()),i&2){let e=Tt(3),r=m().$implicit;c("ngClass",fe(3,al,r.IsNegative,r.IsPositive)),o(),c("ngIf",r.Increase!=="-")("ngIfElse",e)}}function n1(i,s){if(i&1&&(n(0,"td",82),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function a1(i,s){if(i&1&&(pt(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m(2).$implicit;o(),c("ngClass",fe(4,Li,e.ProfitWithTax<0,e.ProfitWithTax>0)),o(),D(" ",g(3,2,e.ProfitWithTax))}}function o1(i,s){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Li,e.Profit<0,e.Profit>0)),o(),D(" ",g(2,2,e.Profit))}}function r1(i,s){if(i&1&&(n(0,"td",70),E(1,a1,4,7,"ng-container",78)(2,o1,3,7,"ng-template",null,3,O),a()),i&2){let e=Tt(3),r=m(3);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function l1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Expense)," ")}}function p1(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",48),p(4),a(),E(5,W_,2,1,"td",73)(6,N_,2,5,"td",74)(7,A_,4,9,"td",43)(8,G_,3,3,"td",43)(9,H_,3,3,"td",43)(10,Q_,3,4,"td",43)(11,Y_,3,3,"td",43)(12,j_,4,3,"td",43)(13,q_,4,3,"td",43)(14,U_,3,3,"td",43),pt(15),E(16,X_,4,2,"td",43),d(17,"HideSumZero"),d(18,"HideSumZero"),mt(),E(19,J_,4,3,"td",43)(20,Z_,3,3,"td",51)(21,$_,7,16,"td",43)(22,i1,4,6,"td",53)(23,n1,3,3,"td",54)(24,r1,4,2,"td",43)(25,l1,3,3,"td",43),d(26,"sum"),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(2),F(r+1),o(2),F(e.Name),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",t.column.Orders.selected),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.Gross.selected),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.Sales.selected),o(),c("ngIf",t.column.AvgDaily.selected),o(),c("ngIf",t.column.Inventory.selected),o(),c("ngIf",t.column.TargetDaily.selected),o(2),c("ngIf",v(17,20,t.data.Data,"AchievementWithTax")||v(18,23,t.data.Data,"Achievement")),o(3),c("ngIf",t.column.DailyTarget.selected),o(),c("ngIf",t.column.Tax.selected),o(),c("ngIf",t.column.SalesNTax.selected),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",(t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost)&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.product.Expense&&t.column.QTY.selected&&v(26,26,t.data.Data,"Expense")!=0)}}function m1(i,s){i&1&&b(0,"td",50)}function s1(i,s){i&1&&b(0,"td",50)}function c1(i,s){if(i&1&&(n(0,"td",70)(1,"a",83),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m(2);o(2),D(" ",v(4,4,v(3,1,e.data.Data,"Count"),"1.0-0"))}}function d1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function u1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Gross"))," ")}}function _1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"BasketSize")/(e.data==null||e.data.Data==null?null:e.data.Data.length),"1.0-2")," ")}}function g1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Sales"))," ")}}function C1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"AverageDailySales"))," ")}}function f1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"InventoryValue"))," ")}}function x1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"RangeSalesTarget"))," ")}}function h1(i,s){if(i&1&&(pt(0),n(1,"span",79),d(2,"sum"),d(3,"sum"),p(4),d(5,"sum"),d(6,"amountFraction"),a(),mt()),i&2){let e=m(3);o(),c("ngClass",fe(13,Li,v(2,2,e.data.Data,"AchievementWithTax")<100,v(3,5,e.data.Data,"AchievementWithTax")>100)),o(3),D(" ",g(6,11,v(5,8,e.data.Data,"AchievementWithTax")/(e.data==null||e.data.Data==null?null:e.data.Data.length))," ")}}function S1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,Li,v(1,2,e.data.Data,"Achievement")<100,v(2,5,e.data.Data,"Achievement")>100)),o(3),D(" ",g(5,11,v(4,8,e.data.Data,"Achievement")/(e.data==null||e.data.Data==null?null:e.data.Data.length)))}}function y1(i,s){if(i&1&&(n(0,"td",70),E(1,h1,7,16,"ng-container",78)(2,S1,6,16,"ng-template",null,4,O),a()),i&2){let e=Tt(3),r=m(2);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function D1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"SalesTarget"))," ")}}function v1(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function w1(i,s){if(i&1&&(n(0,"td",84)(1,"a",85),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function T1(i,s){if(i&1&&(n(0,"td",79),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,al,e.comparation<0,e.comparation>0)),o(),D(" ",v(2,2,e.comparation,"1.0-0")," ")}}function P1(i,s){if(i&1&&(n(0,"td",82),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function F1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,ol,v(1,2,e.data.Data,"Profit")>0,v(2,5,e.data.Data,"Profit")<0)),o(3),F(g(5,11,v(4,8,e.data.Data,"Profit")))}}function I1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,ol,v(1,2,e.data.Data,"ProfitWithTax")>0,v(2,5,e.data.Data,"ProfitWithTax")<0)),o(3),D("",g(5,11,v(4,8,e.data.Data,"ProfitWithTax"))," ")}}function b1(i,s){if(i&1&&(n(0,"td",70),E(1,F1,6,16,"span",53)(2,I1,6,16,"span",53),a()),i&2){let e=m(2);o(),c("ngIf",e.pageData.IgnoreTax),o(),c("ngIf",!e.pageData.IgnoreTax)}}function E1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Expense"))," ")}}function M1(i,s){if(i&1){let e=I();n(0,"div",25)(1,"table",26),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",27)(3,"tr")(4,"th",28),p(5,"No"),a(),n(6,"th",29),p(7," Outlet "),a(),E(8,h_,2,0,"th",30)(9,S_,2,0,"th",31)(10,y_,2,0,"th",32)(11,D_,2,0,"th",33)(12,v_,2,0,"th",34)(13,w_,2,0,"th",35)(14,T_,2,0,"th",36)(15,P_,2,0,"th",37)(16,F_,2,0,"th",38)(17,I_,3,0,"ng-container",39)(18,E_,4,7,"ng-container",39)(19,M_,2,0,"th",40)(20,V_,2,0,"th",41)(21,B_,2,1,"th",42)(22,O_,2,0,"th",43)(23,L_,2,0,"th",44)(24,R_,2,1,"th",42)(25,k_,2,0,"th",45),d(26,"sum"),a()(),n(27,"tbody"),E(28,p1,27,29,"tr",46),a(),n(29,"tfoot")(30,"tr",47),b(31,"td",48),E(32,m1,1,0,"td",49)(33,s1,1,0,"td",49),b(34,"td",50),E(35,c1,5,7,"td",43)(36,d1,4,6,"td",43)(37,u1,4,6,"td",43)(38,_1,4,7,"td",43)(39,g1,4,6,"td",43)(40,C1,4,6,"td",43)(41,f1,4,6,"td",43)(42,x1,4,6,"td",43),pt(43),E(44,y1,4,2,"td",43),d(45,"HideSumZero"),d(46,"HideSumZero"),mt(),E(47,D1,4,6,"td",43)(48,v1,4,6,"td",51)(49,w1,5,6,"td",52)(50,T1,3,8,"td",53)(51,P1,4,6,"td",54)(52,b1,3,2,"td",43)(53,E1,4,6,"td",43),d(54,"sum"),a()()()()}if(i&2){let e=m();o(8),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.column.Orders.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.column.AvgDaily.selected),o(),c("ngIf",e.column.Inventory.selected),o(),c("ngIf",e.column.TargetDaily.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.DailyTarget.selected),o(),c("ngIf",e.column.Tax.selected),o(),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&v(26,37,e.data.Data,"Expense")!=0),o(3),c("ngForOf",e.data.Data),o(4),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.showCompareColumn),o(2),c("ngIf",e.column.Orders.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.column.AvgDaily.selected),o(),c("ngIf",e.column.Inventory.selected),o(),c("ngIf",e.column.TargetDaily.selected),o(2),c("ngIf",v(45,40,e.data.Data,"AchievementWithTax")||v(46,43,e.data.Data,"Achievement")),o(3),c("ngIf",e.column.DailyTarget.selected),o(),c("ngIf",e.column.Tax.selected),o(),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&v(54,46,e.data.Data,"Expense")!=0)}}var Ca=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/OutletPerformanceDetail","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=C}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Quantity",responseProperty:"Quantity"},Gross:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Gross",responseProperty:"Gross"},Sales:{selected:!0},AvgDaily:{selected:!1,name:"Avg Daily Sales"},Inventory:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_InventoryValue",responseProperty:"InventoryValue"},TargetDaily:{selected:!1,name:"Target"},DailyTarget:{selected:!1,name:"Daily Target"},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:this.roleService.product.Cost,role:this.roleService.product.Cost},Profit:{selected:this.roleService.report.Profit&&this.roleService.product.Cost,role:this.roleService.report.Profit&&this.roleService.product.Cost}};isCompare=!1;showCompareColumn=!1;totalDays=1;selectetOutletGroup;isShowOutletTarget=!0;postInit(e){this.menuData.H=e.PageTitle;var r=new Date(this.pageData.Filter.To),t=new Date(this.pageData.Filter.From);this.totalDays=V.differentInDays(t,r)+1,this.initShowSalesTarget(),this.checkForAdvancedColumn(),this.onCompareData(),this.data.Data=this.data.Data.map(l=>(l.AverageDailySales=l.Sales/this.totalDays,l.BasketSize=l.Quantity/l.Count,l.Achievement=this.calculateAchievement(l.SalesTarget,l.Sales,this.totalDays),l.AchievementWithTax=this.calculateAchievement(l.SalesTarget,l.SalesWithTax,this.totalDays),l)),this.hideTaxRelatedColumn(e.Data)}hideTaxRelatedColumn(e){e.map(t=>t.Tax).reduce((t,l)=>t+l,0)==0&&(this.column.Tax.selected=!1,this.column.SalesNTax.selected=!1)}calculateAchievement(e=0,r=0,t=1){let l=0;return e!=0&&r!=0&&(l=r/(e*t)*100),l}initShowSalesTarget(){let e=this.data.Data.reduce((r,t)=>r+t.SalesTarget,0);this.isShowOutletTarget=e>0}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Count":return this.compare(t.Count,l.Count,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Gross":return this.compare(t.Gross,l.Gross,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,C);case"Expense":return this.compare(t.Expense,l.Expense,C);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,C);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,C);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,C);case"Achievement":return this.compare(t.Achievement,l.Achievement,C);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,C);case"AverageDailySales":return this.compare(t.AverageDailySales,l.AverageDailySales,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Performance Detail",exportTypes:[{ID:"ReportExport/OutletPerformanceDefault",Value:"Default",FileName:"Outlet Performance"},{ID:"ReportExport/OutletPerformanceDetail",Value:"Detail",FileName:"Outlet Performance Detail "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onSelectOutletGroup(e){this.pageData.Filter.OutletGroupID=e?.id,this.selectetOutletGroup=e}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data.map(e=>{let r=e;return r.ID=e.EntityID,r}),this.pageData.Filter,"ID",()=>{this.data.Data=this.data.Data.map(e=>(e.AverageDailySales=e.Sales/this.totalDays,e.BasketSize=e.Quantity/e.Count,e.Achievement=this.calculateAchievement(e.SalesTarget,e.Sales,this.totalDays),e.AchievementWithTax=this.calculateAchievement(e.SalesTarget,e.SalesWithTax,this.totalDays),e))})}get entityIDs(){return this.data&&Object.prototype.hasOwnProperty.call(this.data,"Data")&&this.data.Data.length>0?this.data.Data.map(e=>e.EntityID).join(","):null}convertToDateString(e){return(0,Do.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}convertFromDateString(e){return(0,Do.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-detail-outlet-performance"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],["IGNORE_TAX_ITEM",""],["INCREASE",""],["IGNORE_PROFIT_TAX",""],["IGNORE_TAX",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","multiple","ngModel"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["name","render-ProductType",3,"modelChange","model","options"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["mat-sort-header","Name",1,"align-left","freeze","header"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Gross","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","AverageDailySales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",4,"ngIf"],[4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before","class","text-end",4,"ngIf"],["arrowPosition","before","class","text-end",3,"mat-sort-header",4,"ngIf"],["class","text-end",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Expense","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end"],["mat-sort-header","AverageDailySales","arrowPosition","before",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",1,"text-end"],["matTooltip","Daily Target * Number of Days","matTooltipPosition","above","mat-sort-header","Target","arrowPosition","before",1,"text-end"],["mat-sort-header","Achievement","arrowPosition","before","class","text-end","matTooltipPosition","above","matTooltip","Achievement",4,"ngIf"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before",1,"text-end"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end"],["arrowPosition","before",1,"text-end",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end"],["mat-sort-header","Expense","arrowPosition","before",1,"text-end"],["style","width: 35px; text-align: center",4,"ngIf"],["style","width: 35px; text-align: center",3,"ngClass",4,"ngIf"],[2,"width","35px","text-align","center"],[2,"width","35px","text-align","center",3,"ngClass"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary",3,"queryParams"],[4,"ngIf","ngIfElse"],[3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary","target","_blank"],[1,"text-end","text-primary"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",5),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,f_,3,0,"a",6),n(3,"div",7)(4,"button",8),p(5," More "),a(),n(6,"ul",9)(7,"li")(8,"a",10),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",10),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",10),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,x_,26,16,"ng-template",null,0,O),a(),n(19,"content"),E(20,M1,55,49,"div",11),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(10,d_)),o(3),c("routerLink",M(11,u_)),o(3),c("routerLink",M(12,__)),o(6),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,L,R,ie,pe,ge,Te,Ce,Vi,se,ei,re,oe,Z,ne],styles:["table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{width:0!important}"]})};var V1=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],B1=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],O1=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],L1=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),rl=(i,s)=>({"text-danger":i,"text-success":s,"text-end":!0});function R1(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function k1(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(5,"div",12)(6,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(10,"h6"),p(11,"Compare with Prev Month"),a(),n(12,"radio-options",15),h("modelChange",function(t){u(e);let l=m();return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=m();o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),f("model",e.isCompare)}}function W1(i,s){i&1&&(n(0,"th",19),p(1," Prev "),a())}function N1(i,s){i&1&&(n(0,"th",20),p(1," Now "),a())}function A1(i,s){i&1&&(n(0,"th",27),p(1," \xB1 (%) "),a())}function G1(i,s){i&1&&(n(0,"th",28),p(1," Cost "),a())}function H1(i,s){if(i&1&&(n(0,"th",25),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function Q1(i,s){if(i&1&&(n(0,"td",31),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function Y1(i,s){if(i&1&&(n(0,"td",37),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,L1,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function j1(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,rl,e.IsNegative,e.IsPositive)),o(),D(" ",g(2,2,e.Increase)," ")}}function q1(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function U1(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function z1(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,Q1,2,1,"td",31),S(4,Y1,2,5,"td",37),n(5,"td",31),p(6),d(7,"number"),a(),n(8,"td",31),p(9),d(10,"quantityFraction"),a(),n(11,"td",31),p(12),d(13,"amountFraction"),a(),n(14,"td",31),p(15),d(16,"amountFraction"),a(),n(17,"td",32),p(18),d(19,"amountFraction"),a(),n(20,"td",33),p(21),d(22,"amountFraction"),a(),S(23,j1,3,7,"td",34),S(24,q1,3,3,"td",35),S(25,U1,3,3,"td",36),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(2),F(v(7,12,e.Count,".0-0")),o(3),F(g(10,15,e.Quantity)),o(3),F(g(13,17,e.Gross)),o(3),F(g(16,19,e.SalesNet)),o(3),D(" ",g(19,21,e.Tax)," "),o(3),D(" ",g(22,23,e.SalesWithTax)," "),o(2),y(r.showCompareColumn&&r.roleService.report.Profit?23:-1),o(),y(r.roleService.product.Cost?24:-1),o(),y(r.roleService.report.Profit?25:-1)}}function K1(i,s){i&1&&b(0,"td",30)}function X1(i,s){i&1&&b(0,"td",30)}function J1(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,rl,e.comparation,e.comparation)),o(),D(" ",v(2,2,e.comparation,".0-0")," ")}}function Z1(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data==null?null:e.data.Data,"Cost"))," ")}}function $1(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"sum"),d(3,"amountFraction"),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",e.pageData.IgnoreTax?g(3,4,v(2,1,e.data==null?null:e.data.Data,"Profit")):g(5,9,v(4,6,e.data==null?null:e.data.Data,"ProfitWithTax"))," ")}}function eg(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"Outlet"),a(),S(6,W1,2,0,"th",19),S(7,N1,2,0,"th",20),n(8,"th",21),p(9," Orders "),a(),n(10,"th",22),p(11," Quantity "),a(),n(12,"th",23),p(13," Gross "),a(),n(14,"th",24),p(15," Sales "),a(),n(16,"th",25),p(17," Tax "),a(),n(18,"th",26),p(19," Sales + Tax "),a(),S(20,A1,2,0,"th",27),S(21,G1,2,0,"th",28),S(22,H1,2,1,"th",25),a()(),n(23,"tbody"),G(24,z1,26,25,"tr",null,Y),a(),n(26,"tfoot")(27,"tr",29),S(28,K1,1,0,"td",30),S(29,X1,1,0,"td",30),b(30,"td",30),n(31,"td",31),p(32),d(33,"sum"),d(34,"number"),a(),n(35,"td",31),p(36),d(37,"sum"),d(38,"quantityFraction"),a(),n(39,"td",31),p(40),d(41,"sum"),d(42,"amountFraction"),a(),n(43,"td",31),p(44),d(45,"sum"),d(46,"amountFraction"),a(),n(47,"td",32),p(48),d(49,"sum"),d(50,"amountFraction"),a(),n(51,"td",33)(52,"a"),p(53),d(54,"sum"),d(55,"amountFraction"),a()(),S(56,J1,3,8,"td",34),S(57,Z1,4,6,"td",35),S(58,$1,6,11,"td",36),a()()()()}if(i&2){let e=m();o(6),y(e.showCompareColumn?6:-1),o(),y(e.showCompareColumn?7:-1),o(9),c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesTaxNet"),o(2),c("altpropcond",Ct(e.pageData.IgnoreTax)),o(2),y(e.showCompareColumn&&e.roleService.report.Profit?20:-1),o(),y(e.roleService.product.Cost?21:-1),o(),y(e.roleService.report.Profit?22:-1),o(2),H(e.data==null?null:e.data.Data),o(4),y(e.showCompareColumn?28:-1),o(),y(e.showCompareColumn?29:-1),o(3),D(" ",v(34,22,v(33,19,e.data==null?null:e.data.Data,"Count"),".0-0")," "),o(4),D(" ",g(38,28,v(37,25,e.data==null?null:e.data.Data,"Quantity"))," "),o(4),D(" ",g(42,33,v(41,30,e.data==null?null:e.data.Data,"Gross"))," "),o(4),D(" ",g(46,38,v(45,35,e.data==null?null:e.data.Data,"SalesNet"))," "),o(4),D(" ",g(50,43,v(49,40,e.data==null?null:e.data.Data,"Tax"))," "),o(5),F(g(55,48,v(54,45,e.data==null?null:e.data.Data,"SalesWithTax"))),o(3),y(e.showCompareColumn&&e.roleService.report.Profit?56:-1),o(),y(e.roleService.product.Cost?57:-1),o(),y(e.roleService.report.Profit?58:-1)}}var fa=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/OutletGroupPerformance","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}isCompare=!1;showCompareColumn=!1;postInit(e){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name?t.Name:"",l.Name=l.Name?l.Name:"",e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Count":return this.compare(t.Count,l.Count,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Gross":return this.compare(t.Gross,l.Gross,C);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,C);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesTaxNet":return this.compare(t.SalesTaxNet,l.SalesTaxNet,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformance",Value:"Default",FileName:"Outlet Group Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-group-performance"]],standalone:!1,features:[W],decls:21,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Compare",3,"modelChange","model"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px"],["arrowPosition","before",1,"text-end",2,"width","120px",3,"mat-sort-header"],["mat-sort-header","SalesWithTax","altprop","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px",3,"altpropcond"],[1,"text-end",2,"width","60px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","100px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,R1,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,k1,13,5,"ng-template",null,0,O),a(),n(19,"content"),S(20,eg,59,50,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(9,V1)),o(3),c("routerLink",M(10,B1)),o(3),c("routerLink",M(11,O1)),o(6),y(t.data?20:-1))},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,se,re,Z,ne],encapsulation:2})};var tg=()=>["/menu/Reports/Sales_Report/Standard/Compare"],ig=i=>({"flex-right":i});function ng(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function ag(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Sales Person"),a(),n(3,"sales-person-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function og(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=s.$index;c("arrowPosition",Ct(r?"before":"after"))("mat-sort-header",e)("ngClass",X(5,ig,e!="Outlet")),o(),D(" ",e)}}function rg(i,s){if(i&1&&(n(0,"div",14),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(r[e])}}function lg(i,s){if(i&1&&(n(0,"div",15),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),D("",g(2,1,r[e])," ")}}function pg(i,s){if(i&1&&(n(0,"td"),S(1,rg,2,1,"div",14),S(2,lg,3,3,"div",15),a()),i&2){let e=s.$implicit;o(),y(e=="Outlet"?1:-1),o(),y(e!="Outlet"?2:-1)}}function mg(i,s){if(i&1&&(n(0,"tr"),G(1,pg,3,2,"td",null,Y),a()),i&2){let e=s.$implicit,r=m(2);o(),H(r.getKeys(e))}}function sg(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),F(g(2,1,e))}}function cg(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",16)(2,"td"),p(3,"Total : "),a(),G(4,sg,3,3,"td",17,Y),a()()),i&2){let e=m(2);o(4),H(e.data.DataFooter)}}function dg(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",11),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",12)(3,"tr"),G(4,og,2,7,"th",13,Y),a()(),n(6,"tbody"),G(7,mg,3,0,"tr",null,Y),a(),S(9,cg,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var xa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/MonthlyOutletPerformance","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}Years=V.GenerateYears(new Date().getFullYear(),11,!0);getKeys(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T])return this.compare(t[this.data.Dataheader[T]],l[this.data.Dataheader[T]],C)})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Monthly Comparison",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformance",Value:"Default",FileName:"Outlet Monthly Comparison"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-monthly-performance"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Range Compare",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"table-light","sticky-top-thead"],[3,"mat-sort-header","arrowPosition","ngClass"],[2,"color","black"],[2,"color","black","text-align","right"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ng,3,0,"a",2),n(3,"a",3),p(4," View Range"),a()(),n(5,"filters"),E(6,ag,10,5,"ng-template",null,0,O),a(),n(8,"content"),S(9,dg,10,1,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,tg)),o(6),y(t.data?9:-1))},dependencies:[A,tt,Q,$,L,R,ie,pe,ge,ze,Z],encapsulation:2})};var ug=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],_g=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],gg=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],Cg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],fg=(i,s)=>({From:i,To:s}),xg=()=>["/menu/Contacts/Contact/Sales_Person/Info"],hg=i=>({ID:i}),Sg=()=>["/menu/Reports/Sales_Report/Standard/Detail"],yg=(i,s,e,r,t)=>({SalesPersonID:i,From:s,To:e,ListIDs:r,IncludeComplementary:t}),Dg=(i,s,e,r)=>({ID:i,from:s,to:e,IncludeComplementary:r}),vg=i=>({SalesID:i});function wg(i,s){if(i&1){let e=I();n(0,"button",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function Tg(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person Group"),a(),n(6,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesGroupID,t)||(l.pageData.Filter.SalesGroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",16)(12,"datepicker",17),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Sales Order Tag"),a(),n(18,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(19,"h6"),p(20,"Include Zero Amount Transaction"),a(),n(21,"radio-options",20),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.IncludeZeroAmountTransaction,t)||(l.pageData.Filter.IncludeZeroAmountTransaction=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData==null||e.pageData.List==null?null:e.pageData.List.Entities),o(3),f("ngModel",e.pageData.Filter.SalesGroupID),c("items",e.pageData.List==null?null:e.pageData.List.SalesGroup),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.DeliveryID),c("items",e.pageData.List==null?null:e.pageData.List.Deliveries),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.List==null?null:e.pageData.List.Types),o(3),f("model",e.pageData.Filter.IncludeZeroAmountTransaction)}}function Pg(i,s){i&1&&(n(0,"th",45),p(1," Sales Group "),a())}function Fg(i,s){i&1&&(n(0,"th",46),p(1," Orders "),a())}function Ig(i,s){i&1&&(n(0,"th",47),p(1," Sales "),a())}function bg(i,s){i&1&&(pt(0),n(1,"th",48),p(2," Avg. Daily "),a(),mt())}function Eg(i,s){i&1&&(n(0,"th",49),p(1," Tax "),a())}function Mg(i,s){i&1&&(n(0,"th",50),p(1," Sales + Tax "),a())}function Vg(i,s){i&1&&(n(0,"th",51),p(1," Cost "),a())}function Bg(i,s){i&1&&(n(0,"th",52),p(1," Profit "),a())}function Og(i,s){i&1&&(n(0,"th",55),p(1," Target "),a())}function Lg(i,s){i&1&&(n(0,"th",56),p(1," Ach(%) "),a())}function Rg(i,s){if(i&1&&(pt(0),E(1,Og,2,0,"th",53)(2,Lg,2,0,"th",54),mt()),i&2){let e=m(2);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function kg(i,s){i&1&&(n(0,"th",57),p(1," Quantity "),a())}function Wg(i,s){i&1&&(n(0,"th",58),p(1," Basket Size "),a())}function Ng(i,s){i&1&&(n(0,"th",59),p(1," Product Commission "),a())}function Ag(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Group)}}function Gg(i,s){if(i&1&&(n(0,"td",62)(1,"a",61),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(12,Sg))("queryParams",cn(13,yg,e.ID,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.ListIDs,r.pageData.Filter.IncludeComplementary)),o(3),F(v(5,9,e.Orders,".0-0"))}}function Hg(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Qg(i,s){if(i&1&&(pt(0),n(1,"td",63),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m().$implicit;o(2),D(" ",g(3,1,e.AvgDailySales)," ")}}function Yg(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function jg(i,s){if(i&1&&(n(0,"td",62)(1,"a",65),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",Ut(10,Dg,e.ID,v(2,2,r.pageData.Filter.From,"ddMMyyyy"),v(3,5,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.IncludeComplementary)),o(3),D(" ",g(5,8,e.SalesNTax)," ")}}function qg(i,s){if(i&1&&(n(0,"td",66),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Ug(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Profit)," ")}}function zg(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e.Target)," ")}}function Kg(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e.Achievement)," ")}}function Xg(i,s){if(i&1&&(pt(0),E(1,zg,3,3,"td",44)(2,Kg,3,3,"td",44),mt()),i&2){let e=m(3);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function Jg(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Quantity,"1.0-2")," ")}}function Zg(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.BasketSize,"1.0-2")," ")}}function $g(i,s){if(i&1&&(n(0,"td",63)(1,"span")(2,"a",68),p(3),d(4,"amountFraction"),a()()()),i&2){let e=m().$implicit;o(2),c("queryParams",X(4,vg,e.ID)),o(),F(g(4,2,e.Commission))}}function eC(i,s){if(i&1&&(n(0,"tr")(1,"td",60)(2,"a",61),p(3),a()(),E(4,Ag,2,1,"td",9)(5,Gg,6,19,"td",40)(6,Hg,3,3,"td",41),d(7,"HideSumZero"),E(8,Qg,4,3,"ng-container",9)(9,Yg,3,3,"td",42),d(10,"HideSumZero"),E(11,jg,6,15,"td",40)(12,qg,3,3,"td",43)(13,Ug,3,3,"td",44)(14,Xg,3,2,"ng-container",9)(15,Jg,3,4,"td",41)(16,Zg,3,4,"td",41)(17,$g,5,6,"td",41),a()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(21,xg))("queryParams",X(22,hg,e.ID)),o(),F(e.Name),o(),c("ngIf",r.data.Show),o(),c("ngIf",r.column.Orders.selected),o(),c("ngIf",v(7,15,r.data.List,"Tax")&&r.column.Sales.selected),o(2),c("ngIf",r.isShowOutletTarget),o(),c("ngIf",v(10,18,r.data.List,"Tax")&&r.column.Tax.selected),o(2),c("ngIf",r.column.SalesNTax.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.roleService.report.Profit&&r.column.Profit.selected),o(),c("ngIf",r.isShowOutletTarget),o(),c("ngIf",r.column.QTY.selected),o(),c("ngIf",r.column.QTY.selected),o(),c("ngIf",r.column.Commission.selected&&r.roleService.product.CommissionView)}}function tC(i,s){i&1&&b(0,"td")}function iC(i,s){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Orders"),".0-0")," ")}}function nC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Sales"))," ")}}function aC(i,s){if(i&1&&(pt(0),n(1,"td",63),p(2),d(3,"sum"),d(4,"amountFraction"),a(),mt()),i&2){let e=m(2);o(2),D(" ",g(4,4,v(3,1,e.data.List,"AvgDailySales"))," ")}}function oC(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Tax"),e.pageData.FractionDigit)," ")}}function rC(i,s){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"SalesNTax"))," ")}}function lC(i,s){if(i&1&&(n(0,"td",66),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Cost"))," ")}}function pC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Profit"))," ")}}function mC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.data.List,"Target"))," ")}}function sC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(4,7,v(2,1,e.data.List,"Sales")/v(3,4,e.data.List,"Target")*100)," ")}}function cC(i,s){if(i&1&&(pt(0),E(1,mC,4,6,"td",44)(2,sC,5,9,"td",44),mt()),i&2){let e=m(2);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function dC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Quantity"),"1.0-2")," ")}}function uC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"BasketSize"),"1.0-2")," ")}}function _C(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Commission"))," ")}}function gC(i,s){if(i&1){let e=I();n(0,"content")(1,"div",21)(2,"div",22)(3,"table",23),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",24)(5,"tr",25)(6,"th",26),p(7,"Sales Person"),a(),E(8,Pg,2,0,"th",27)(9,Fg,2,0,"th",28)(10,Ig,2,0,"th",29),d(11,"HideSumZero"),E(12,bg,3,0,"ng-container",9)(13,Eg,2,0,"th",30),d(14,"HideSumZero"),E(15,Mg,2,0,"th",31)(16,Vg,2,0,"th",32)(17,Bg,2,0,"th",33)(18,Rg,3,2,"ng-container",9)(19,kg,2,0,"th",34)(20,Wg,2,0,"th",35)(21,Ng,2,0,"th",36),a()(),n(22,"tbody"),E(23,eC,18,24,"tr",37),a(),n(24,"tfoot")(25,"tr",38),S(26,tC,1,0,"td"),n(27,"td",39),p(28,"Total:"),a(),E(29,iC,4,7,"td",40)(30,nC,4,6,"td",41),d(31,"HideSumZero"),E(32,aC,5,6,"ng-container",9)(33,oC,4,7,"td",42),d(34,"HideSumZero"),E(35,rC,4,6,"td",40)(36,lC,4,6,"td",43)(37,pC,4,6,"td",44)(38,cC,3,2,"ng-container",9)(39,dC,4,7,"td",41)(40,uC,4,7,"td",41)(41,_C,4,6,"td",41),a()()()()()()}if(i&2){let e=m();o(8),c("ngIf",e.data.Show),o(),c("ngIf",e.column.Orders.selected),o(),c("ngIf",v(11,25,e.data.List,"Tax")&&e.column.Sales.selected),o(2),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",v(14,28,e.data.List,"Tax")&&e.column.Tax.selected),o(2),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.column.Commission.selected),o(2),c("ngForOf",e.data.List),o(3),y(e.data.Show?26:-1),o(3),c("ngIf",e.column.Orders.selected),o(),c("ngIf",v(31,31,e.data.List,"Tax")&&e.column.Sales.selected),o(2),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",v(34,34,e.data.List,"Tax")&&e.column.Tax.selected),o(2),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Commission.selected&&e.roleService.product.CommissionView)}}var ha=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/SalesPerson","ReportLoader/SalesPerson");this.httpService=r;this.csvConverter=t;this.reportFilterService=l;this.matDialog=C}isShowCommission=!1;roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},Sales:{selected:!0},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:!0,role:this.roleService.product.Cost},Target:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/SalesPersonOrderQuantity",responseProperty:"Quantity"},Commission:{selected:!1,advanced:!0,endpoint:"/api/Report/SalesPersonOrderCommission",responseProperty:"Commission",role:this.roleService.product.CommissionView},Profit:{selected:!0,role:this.roleService.report.Profit}};isShowOutletTarget=!0;postInit(){this.menuData.H=this.data.PageTitle,this.isShowCommission=!1,this.initShowSalesTarget();let e=this.getTotalDays();this.data.List=this.data.List.map(r=>(r.AvgDailySales=r.Sales/e,r)),this.checkForAdvancedColumn()}initShowSalesTarget(){let e=this.data?.List?.reduce((r,t)=>r+t.Target,0);this.isShowOutletTarget=e>0}getTotalDays(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return V.differentInDays(e,r)+1}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.Group=t.Group==null?"":t.Group,l.Group=l.Group==null?"":l.Group,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Group":return this.compare(t.Group.toLocaleLowerCase(),l.Group.toLocaleLowerCase(),C);case"Orders":return this.compare(t.Orders,l.Orders,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,C);case"Target":return this.compare(t.Target,l.Target,C);case"Achievement":return this.compare(t.Achievement,l.Achievement,C);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,C);case"AvgDailySales":return this.compare(t.AvgDailySales,l.AvgDailySales,C);case"Commission":return this.compare(t.Commission,l.Commission,C);default:return 0}})}getCommission(){this.httpService.post("/api/Report/SalesPersonComission",this.pageData.Filter).pipe(oi(e=>e?.List)).subscribe(e=>{let r=0;this.data.List=this.data.List.map(t=>(r=e.findIndex(l=>l.SalesPersonID===t.ID),r!=-1&&(t.Commission=e[r].Commission,t.Quantity=e[r].Quantity),t)),this.isShowCommission=!0})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Sales Person",exportTypes:[{ID:"ReportExport/SalesPerson",Value:"Default",FileName:"Sales by Sales Person"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.List,this.pageData.Filter,"ID",()=>{this.data.List=this.data.List.map(e=>nt(et({},e),{BasketSize:e.Quantity/e.Orders}))})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(rr),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-person"]],standalone:!1,features:[W],decls:26,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"d-flex"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Person Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Transaction",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left"],["mat-sort-header","Group","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Orders","style","width: 80px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","style","width: 90px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesNTax","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Cost","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Profit","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","style","width: 100px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","style","width: 110px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Commission","style","width: 200px","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column","text-end"],["class","text-end text-primary",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["mat-sort-header","Group","arrowPosition","before",1,"text-end"],["mat-sort-header","Orders","arrowPosition","before",1,"text-end",2,"width","80px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","AvgDailySales","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Target","style","width: 120px","arrowPosition","before","class","align-l",4,"ngIf"],["mat-sort-header","Achievement","style","width: 60px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Target","arrowPosition","before",1,"align-l",2,"width","120px"],["mat-sort-header","Achievement","arrowPosition","before",1,"text-end",2,"width","60px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end",2,"width","110px"],["mat-sort-header","Commission","arrowPosition","before",1,"text-end",2,"width","200px"],[1,"text-primary"],[3,"routerLink","queryParams"],[1,"text-end","text-primary"],[1,"text-end"],[1,"text-end","text-warning"],["routerLink","Commission_Report",3,"queryParams"],[1,"text-end","text-danger"],[1,"text-end","text-success"],["routerLink","/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions")(2,"div",2),E(3,wg,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"By Outlet"),a()(),n(11,"li")(12,"a",7),p(13,"By Employee"),a()(),n(14,"li")(15,"a",7),p(16,"By Sales Group"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),E(23,Tg,22,13,"ng-template",null,0,O),a(),E(25,gC,42,37,"content",9),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(3),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(18,ug)),o(3),c("routerLink",M(19,_g)),o(3),c("routerLink",M(20,gg)),o(3),c("routerLink",M(21,Cg))("queryParams",fe(22,fg,v(19,12,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),v(20,15,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,L,R,ie,pe,ge,Te,U,se,ei,re,oe,Z],encapsulation:2})};var CC=()=>["/menu/Reports/Sales_Report/Standard/Person"],fC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],xC=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],hC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],SC=(i,s)=>({From:i,To:s}),ll=i=>({ID:i}),pl=(i,s,e,r)=>({SalesID:i,From:s,To:e,VariantName:r});function yC(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function DC(i,s){if(i&1){let e=I();n(0,"div",21)(1,"div",22)(2,"datepicker",23),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(3,"div",24)(4,"app-timepicker",25),h("timeChange",function(t){u(e);let l=m(3);return x(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=m(3);return _(l.timeFromChange(t))}),a()()(),n(5,"div",26)(6,"div",22)(7,"datepicker",27),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(8,"div",24)(9,"app-timepicker",25),h("timeChange",function(t){u(e);let l=m(3);return x(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=m(3);return _(l.timeToChange(t))}),a()()()}if(i&2){let e=m(3);o(2),c("width",100),f("date",e.pageData.Filter.From),o(2),f("time",e.timeFrom),o(3),c("width",100),f("date",e.pageData.Filter.To),o(2),f("time",e.timeTo)}}function vC(i,s){if(i&1){let e=I();n(0,"div")(1,"datepicker",28),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(3);return _(t.onFilterFromDate())}),a()(),n(2,"div",29)(3,"datepicker",30),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(3);return _(t.onFilterToDate())}),a()()}if(i&2){let e=m(3);o(),f("date",e.pageData.Filter.From),c("width",100),o(2),f("date",e.pageData.Filter.To),c("width",100)}}function wC(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",19),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ID,t)||(l.pageData.Filter.ID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),S(9,DC,10,6)(10,vC,4,4),n(11,"h6"),p(12,"Filter Invoice By"),a(),n(13,"radio-options",20),h("modelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.isCreated,t)||(l.pageData.Filter.isCreated=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.ID),o(3),y(e.pageData.Filter.isCreated?9:10),o(4),c("options",e.filterInvoiceBy),f("model",e.pageData.Filter.isCreated)}}function TC(i,s){i&1&&b(0,"app-empty-state")}function PC(i,s){i&1&&(n(0,"th",36),p(1," Commission "),a())}function FC(i,s){i&1&&(n(0,"th",36),p(1," Total Commission "),a())}function IC(i,s){if(i&1&&(n(0,"thead",31)(1,"tr",32)(2,"th",33)(3,"h2")(4,"a",34),p(5),a()()()(),n(6,"tr")(7,"th",35),p(8,"Product"),a(),n(9,"th",36),p(10,"Qty"),a(),n(11,"th",36),p(12,"Sales"),a(),S(13,PC,2,0,"th",36),S(14,FC,2,0,"th",36),a()()),i&2){let e=m().$implicit,r=m(2);o(4),c("queryParams",X(5,ll,e.ID)),o(),$t("",e.Name," - ",e.Code),o(8),y(r.roleService.product.CommissionView?13:-1),o(),y(r.roleService.product.CommissionView?14:-1)}}function bC(i,s){if(i&1&&(n(0,"div")(1,"a",40),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m(2).$implicit,r=m(4);ji("text-decoration-line-through",e.VariantCommission&&e.GroupCommission)("text-danger",e.VariantCommission&&e.GroupCommission),o(),c("queryParams",Ut(14,pl,e.SalesID,v(2,6,r.pageData.Filter.From,"ddMMyyyy"),v(3,9,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),F(g(5,12,e.VariantCommission))}}function EC(i,s){if(i&1&&(n(0,"div")(1,"a",41),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m(2).$implicit,r=m(4);o(),c("queryParams",Ut(10,pl,e.SalesID,v(2,2,r.pageData.Filter.From,"ddMMyyyy"),v(3,5,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),F(g(5,8,e.GroupCommission))}}function MC(i,s){if(i&1&&(n(0,"td",38),S(1,bC,6,19,"div",39),S(2,EC,6,15,"div"),a()),i&2){let e=m().$implicit;o(),y(e.VariantCommission||!e.GroupCommission?1:-1),o(),y(e.GroupCommission?2:-1)}}function VC(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalCommission)," ")}}function BC(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",37),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",38),p(7),d(8,"quantityFraction"),a(),n(9,"td",38),p(10),d(11,"amountFraction"),a(),S(12,MC,3,2,"td",38),S(13,VC,3,3,"td",38),a()),i&2){let e=s.$implicit,r=m(4);o(2),c("queryParams",X(11,ll,e.VariantID)),o(),F(e.Name),o(2),F(e.Code),o(2),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.NettSales)),o(2),y(r.roleService.product.CommissionView?12:-1),o(),y(r.roleService.product.CommissionView?13:-1)}}function OC(i,s){if(i&1&&(n(0,"tbody"),G(1,BC,14,13,"tr",null,Y),a()),i&2){let e=m().$implicit;o(),H(e.Item)}}function LC(i,s){if(i&1&&(n(0,"div"),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),n(5,"span",43),p(6),d(7,"sum"),d(8,"amountFraction"),a()()),i&2){let e=m(3).$implicit;ji("text-decoration-line-through",v(1,5,e.Item,"VariantCommission")&&v(2,8,e.Item,"GroupCommission"))("text-danger",v(3,11,e.Item,"VariantCommission")&&v(4,14,e.Item,"GroupCommission")),o(6),F(g(8,20,v(7,17,e.Item,"VariantCommission")))}}function RC(i,s){if(i&1&&(n(0,"div"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3).$implicit;o(),D(" ",g(3,4,v(2,1,e.Item,"GroupCommission"))," ")}}function kC(i,s){if(i&1&&(n(0,"td",38),S(1,LC,9,22,"div",39),d(2,"sum"),d(3,"sum"),S(4,RC,4,6,"div"),d(5,"sum"),a()),i&2){let e=m(2).$implicit;o(),y(v(2,2,e.Item,"VariantCommission")||!v(3,5,e.Item,"GroupCommission")?1:-1),o(3),y(v(5,8,e.Item,"GroupCommission")?4:-1)}}function WC(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(3,4,v(2,1,e.Item,"TotalCommission"))," ")}}function NC(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",42)(2,"td"),p(3,"Total"),a(),n(4,"td",38),p(5),d(6,"sum"),d(7,"quantityFraction"),a(),n(8,"td",38),p(9),d(10,"sum"),d(11,"amountFraction"),a(),S(12,kC,6,11,"td",38),S(13,WC,4,6,"td",38),a()()),i&2){let e=m().$implicit,r=m(2);o(5),D(" ",g(7,7,v(6,4,e.Item,"Quantity"))," "),o(4),D(" ",g(11,12,v(10,9,e.Item,"NettSales"))," "),o(3),y(r.roleService.product.CommissionView?12:-1),o(),y(r.roleService.product.CommissionView?13:-1)}}function AC(i,s){if(i&1&&(n(0,"table",14),S(1,IC,15,7,"thead",31),S(2,OC,3,0,"tbody"),S(3,NC,14,14,"tfoot"),a()),i&2){let e=s.$implicit;o(),y(e.Name?1:-1),o(),y(e.Name?2:-1),o(),y(e.Name?3:-1)}}function GC(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",3)(3,"a",4),P("click",function(){u(e);let t=m();return _(t.print())}),b(4,"i",5),p(5," Print"),a(),S(6,yC,3,0,"a",6),n(7,"div",7)(8,"button",8),p(9," More "),a(),n(10,"ul",9)(11,"li")(12,"a",10),p(13,"Summary"),a()(),n(14,"li")(15,"a",10),p(16,"By Outlet"),a()(),n(17,"li")(18,"a",10),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",11),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),E(26,wC,14,8,"ng-template",null,0,O),a(),n(28,"content")(29,"div",12),S(30,TC,1,0,"app-empty-state"),n(31,"div",13),G(32,AC,4,3,"table",14,Y),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(6),y(e.roleService!=null&&e.roleService.global.Export?6:-1),o(6),c("routerLink",M(17,CC)),o(3),c("routerLink",M(18,fC)),o(3),c("routerLink",M(19,xC)),o(3),c("routerLink",M(20,hC))("queryParams",fe(21,SC,v(22,11,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),v(23,14,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(9),y((e.data==null||e.data.Data==null?null:e.data.Data.length)==0?30:-1),o(2),H(e.data.Data)}}var Sa=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesPersonCommissionGroupByProduct","ReportLoader/SalesCommissionLoader",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.activatedRoute=T}filterInvoiceBy=[{Key:!1,Value:"Date"},{Key:!0,Value:"Created"}];timeFrom;timeTo;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(K,{data:{title:"Employee Commission Report",exportTypes:[{ID:"ReportExport/SalesPersonGroupByProduct",Value:"Default",FileName:"Employee Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To),this.onFilterToDate()}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From),this.onFilterFromDate()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-commision-report"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],[1,"btn","btn-outline-secondary","ms-3"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","mb-10"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","Is Created",3,"modelChange","options","model"],[1,"w-100","d-flex","mt-2","align-items-center"],[1,"w-100"],["name","From","appearance","outline",3,"dateChange","width","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","mt-4"],["name","To","appearance","outline",3,"dateChange","width","date"],["name","From","appearance","outline",3,"dateChange","date","width"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date","width"],[1,"thead-light"],[2,"border","none !important"],["colspan","5",1,"text-center","bg-white","border-none"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],[2,"width","200px"],[1,"text-end",2,"width","100px"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"text-end"],[3,"text-decoration-line-through","text-danger"],["routerLink","Commission_Report_Detail","matTooltipPosition","above","matTooltip","variant commission",3,"queryParams"],["routerLink","Commission_Report_Detail",3,"queryParams"],[1,"table-footer","fw-bold"],["matTooltipPosition","above","matTooltip","Total variant commission"]],template:function(r,t){r&1&&S(0,GC,34,24,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,J,L,R,ie,Te,Mi,U,ze,kr,se,oe,Z,ne],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}} datepicker.timepicker>mat-form-field{width:140px!important}"]})};var HC=()=>["/menu/Reports/Sales_Report/Standard/Person"],QC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],YC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],jC=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],qC=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],vo=i=>({ID:i}),UC=()=>["/menu/Products/Catalog/Variants/Info"],zC=()=>["/menu/Contacts/Contact/Sales_Person/Info"];function KC(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function XC(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Outlets),o(3),f("ngModel",e.pageData.Filter.SalesID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function JC(i,s){i&1&&(n(0,"th",34),p(1,"Date"),a())}function ZC(i,s){i&1&&(n(0,"th",34),p(1,"Outlet"),a())}function $C(i,s){i&1&&(n(0,"th",34),p(1," Number "),a())}function ef(i,s){i&1&&(n(0,"th"),p(1,"Product"),a())}function tf(i,s){i&1&&(n(0,"th"),p(1,"Sales Person"),a())}function nf(i,s){i&1&&(n(0,"th",35),p(1," Quantity "),a())}function af(i,s){i&1&&(n(0,"th",35),p(1," Commission "),a())}function of(i,s){i&1&&(n(0,"th",35),p(1," Total Commission "),a())}function rf(i,s){i&1&&(n(0,"th",35),p(1," Cost "),a())}function lf(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Date,"dd MMM yyyy")," ")}}function pf(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.EntityName)}}function mf(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,qC))("queryParams",X(4,vo,e.ID)),o(),F(e.Number)}}function sf(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,UC))("queryParams",X(4,vo,e.VariantID)),o(),F(e.VariantName)}}function cf(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,zC))("queryParams",X(4,vo,e.SalesID)),o(),F(e.SalesName)}}function df(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function uf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.SalesCommission,r.pageData.FractionDigit)," ")}}function _f(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.Total,r.pageData.FractionDigit)," ")}}function gf(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.UnitCost,r.pageData.FractionDigit)," ")}}function Cf(i,s){if(i&1&&(n(0,"tr"),E(1,lf,3,4,"td",21)(2,pf,2,1,"td",21)(3,mf,3,6,"td",21)(4,sf,3,6,"td",21)(5,cf,3,6,"td",21)(6,df,3,3,"td",27)(7,uf,3,4,"td",27)(8,_f,3,4,"td",27)(9,gf,3,4,"td",28),a()),i&2){let e=m(2);o(),c("ngIf",e.columns.Date.selected),o(),c("ngIf",e.columns.Outlet.selected),o(),c("ngIf",e.columns.InvoiceNumber.selected),o(),c("ngIf",e.columns.VariantName.selected),o(),c("ngIf",e.columns.SalesName.selected),o(),c("ngIf",e.columns.Quantity.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected)}}function ff(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"SalesCommission"),e.pageData.FractionDigit)," ")}}function xf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function hf(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"UnitCost"),e.pageData.FractionDigit)," ")}}function Sf(i,s){if(i&1){let e=I();n(0,"span",38),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail"))}),n(1,"i",39),p(2,"?"),a()()}}function yf(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"quantityFraction"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function Df(i,s){if(i&1){let e=I();n(0,"div",40)(1,"a",41),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(2,"i",42),p(3," Next"),a(),n(4,"a",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail",!0))}),b(5,"i",44),p(6," Show All"),a()()}}function vf(i,s){if(i&1&&(n(0,"div",16)(1,"table",17)(2,"thead",18)(3,"tr",19),E(4,JC,2,0,"th",20)(5,ZC,2,0,"th",20)(6,$C,2,0,"th",20)(7,ef,2,0,"th",21)(8,tf,2,0,"th",21)(9,nf,2,0,"th",22)(10,af,2,0,"th",22)(11,of,2,0,"th",22)(12,rf,2,0,"th",22),a()(),n(13,"tbody"),E(14,Cf,10,9,"tr",23),a(),n(15,"tfoot")(16,"tr",24)(17,"td",25),p(18,"Total:"),a(),n(19,"td",26),p(20),d(21,"sum"),d(22,"number"),a(),E(23,ff,4,7,"td",27)(24,xf,4,7,"td",27)(25,hf,4,7,"td",28),a()()(),n(26,"div",29)(27,"div",30)(28,"div",31),p(29),d(30,"number"),E(31,Sf,3,0,"span",32)(32,yf,3,3,"span",21),p(33),a()(),E(34,Df,7,0,"div",33),a()()),i&2){let e=m();o(4),c("ngIf",e.columns.Date.selected),o(),c("ngIf",e.columns.Outlet.selected),o(),c("ngIf",e.columns.InvoiceNumber.selected),o(),c("ngIf",e.columns.VariantName.selected),o(),c("ngIf",e.columns.SalesName.selected),o(),c("ngIf",e.columns.Quantity.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected),o(2),c("ngForOf",e.infiniteList),o(6),D(" ",g(22,22,v(21,19,e.data.Data,"Quantity"))," "),o(3),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected),o(4),D(" Showing 1 - ",g(30,24,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var ya=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesPersonCommissionDetail","ReportLoader/SalesCommissionDetailLoader",null,C);this.httpService=r;this.csvConverter=t;this.datePipe=l;this.activatedRoute=C;this.matDialog=T}roleService=Pe(j);columnService=Pe(gt);datasource=[];columns={Date:{selected:!0,name:"Date",width:null,class:"w-100",visible:!0},Outlet:{selected:!0,name:"Outlet",width:null,class:"w-100",visible:!0},InvoiceNumber:{selected:!0,name:"Number",width:null,class:"w-100",visible:!0},VariantName:{selected:!0,name:"Name",width:null,class:"w-100",visible:!0},SalesName:{selected:!0,name:"Sales Person",width:null,class:"w-100",visible:!0},Quantity:{selected:!0,name:"Qty",width:null,class:"w-100",visible:!0},Commission:{selected:!0,name:"Commission",width:null,class:"w-100",visible:!0,role:this.roleService.product.CommissionView},TotalCommission:{selected:!0,name:"Total Commission",width:null,class:"w-100",visible:!0,role:this.roleService.product.CommissionView},UnitCost:{selected:!1,name:"Cost",width:null,class:"w-100",visible:!1,role:this.roleService.product.Cost}};onColumnSelectedChange(e){let r=this.columns[e.key];r&&(r.visible=!e.value.visible)}get displayedColumns(){return Object.keys(this.columns).filter(e=>this.columns[e].selected)}transformDate(e,r){return this.datePipe.transform(e,r)}getFilterData(e){this.infiniteList=this.originalData.filter(r=>Object.keys(r).some(t=>r[t]==null?!1:r[t].toString().toLowerCase().includes(e.toLowerCase())))}openExportModal(){this.matDialog.open(K,{data:{title:"Commission Report Detail",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionDetail",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountSalesPersonCommissionDetail",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(Ne),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-commision-report-detail"]],standalone:!1,features:[W],decls:24,vars:15,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 120px",4,"ngIf"],[4,"ngIf"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end"],[1,"text-end","text-success"],["class","text-end text-success",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],[2,"width","120px"],[1,"text-end",2,"width","120px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.VariantName,T)||(t.pageData.Filter.VariantName=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())})("textChange",function(T){return u(l),_(t.getFilterData(T))}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,KC,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9,"Summary"),a()(),n(10,"li")(11,"a",6),p(12,"By Outlet"),a()(),n(13,"li")(14,"a",6),p(15,"By Employee"),a()(),n(16,"li")(17,"a",6),p(18,"By Sales Group"),a()()()()(),n(19,"filters"),E(20,XC,13,7,"ng-template",null,0,O),a(),n(22,"content"),E(23,vf,35,26,"div",7),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.VariantName),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.columns),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(11,HC)),o(3),c("routerLink",M(12,QC)),o(3),c("routerLink",M(13,YC)),o(3),c("routerLink",M(14,jC)),o(6),c("ngIf",t.infiniteList&&t.data&&t.data.Data))},dependencies:[A,st,it,Q,J,L,R,ie,U,ze,se,re,oe,ne],encapsulation:2})};var ml=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],sl=i=>({ID:i});function wf(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Tf(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Supplier"),a(),n(10,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",10)(16,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Currency"),a(),n(19,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(20,"h6"),p(21,"Sort"),a(),n(22,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.IsDesc,t)||(l.pageData.Filter.IsDesc=t),_(t)}),a(),n(23,"h6"),p(24,"Purchase Order Tag"),a(),n(25,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Note Visible"),a(),n(28,"radio-options",15),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(29,"h6"),p(30,"Order By"),a(),n(31,"radio-options",16),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(4),c("isFloatingLabel",!1),f("date",e.pageData.Filter.From),o(2),c("isFloatingLabel",!1),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),f("model",e.pageData.Filter.IsDesc),c("options",e.AscDscRadio),o(3),c("items",e.pageData.Options.Tags),f("ngModel",e.pageData.Filter.TagID),o(3),f("model",e.pageData.Filter.NoteVisible),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Pf(i,s){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=m(2);o(),D(" Cost(",e.data.Symbol,") ")}}function Ff(i,s){i&1&&(n(0,"th",27),p(1," Disc "),a())}function If(i,s){if(i&1&&(n(0,"th",28),p(1),a()),i&2){let e=m(2);o(),D(" Total(",e.data.Symbol,") ")}}function bf(i,s){i&1&&(n(0,"span"),p(1," /"),a())}function Ef(i,s){if(i&1&&(n(0,"a",33)(1,"span",42),p(2),a()()),i&2){let e=m().$implicit;c("routerLink",M(3,ml))("queryParams",X(4,sl,e.Data.ID)),o(2),F("#"+e.PONumber)}}function Mf(i,s){if(i&1&&(n(0,"th",50),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitPrice)," ")}}function Vf(i,s){if(i&1&&(n(0,"div",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e==null?null:e.DiscountAmount)," ")}}function Bf(i,s){if(i&1&&(n(0,"th",51),p(1),d(2,"amountFraction"),S(3,Vf,3,3,"div",53),a()),i&2){let e=m().$implicit;o(),D(" ",(e==null?null:e.Discount)==0?"":g(2,2,e==null?null:e.Discount)+"%"," "),o(2),y((e==null?null:e.DiscountAmount)>0?3:-1)}}function Of(i,s){if(i&1&&(n(0,"th",52),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.Total)," ")}}function Lf(i,s){if(i&1&&(n(0,"tr")(1,"th",43)(2,"div",44)(3,"span"),p(4),a(),b(5,"small",45),a()(),n(6,"th",46),p(7),a(),n(8,"th",47),p(9),d(10,"quantityFraction"),a(),n(11,"th",48),p(12),d(13,"quantityFraction"),a(),n(14,"th",49),p(15),a(),S(16,Mf,3,3,"th",50),S(17,Bf,4,4,"th",51),S(18,Of,3,3,"th",52),a()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(10,9,e==null?null:e.QtyRequested)," "),o(3),D(" ",g(13,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?16:-1),o(),y(r.roleService.product.Cost?17:-1),o(),y(r.roleService.product.Cost?18:-1)}}function Rf(i,s){if(i&1&&(n(0,"tr")(1,"th",59),p(2),a(),n(3,"th",60),p(4),a(),n(5,"th",61),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e==null?null:e.CurrencySymbol," "),o(2),D(" ",g(7,3,e==null?null:e.Amount)," ")}}function kf(i,s){if(i&1&&(n(0,"table",41),G(1,Rf,8,5,"tr",null,Y),a()),i&2){let e=m(2).$implicit;o(),H(e==null?null:e.Aggregate)}}function Wf(i,s){if(i&1&&(n(0,"tfoot",41)(1,"tr",54)(2,"td",55),p(3,"Total"),a(),n(4,"td",56)(5,"b"),p(6),d(7,"sum"),d(8,"quantityFraction"),a()(),b(9,"td",57),n(10,"td",58),S(11,kf,3,0,"table",41),a()()()),i&2){let e=m().$implicit,r=m(2);o(6),F(g(8,5,v(7,2,e.Items,"Quantity"))),o(5),y(r.roleService.product.Cost?11:-1)}}function Nf(i,s){if(i&1&&(n(0,"div")(1,"div",31)(2,"div",32)(3,"a",33)(4,"span",34),p(5),a()(),S(6,bf,2,0,"span"),S(7,Ef,3,6,"a",33),n(8,"span"),p(9),d(10,"date"),a(),b(11,"span",23),n(12,"strong",35),p(13),d(14,"sum"),d(15,"sum"),d(16,"quantityFraction"),a(),b(17,"small",36),a(),n(18,"div",37)(19,"label",38),p(20),a()()(),n(21,"table",39),b(22,"thead"),n(23,"tbody",40),G(24,Lf,19,13,"tr",null,Y),a(),S(26,Wf,12,7,"tfoot",41),a()()),i&2){let e=s.$implicit,r=m(2);o(3),c("routerLink",M(21,ml))("queryParams",X(22,sl,e.Data.ID)),o(2),F(e.Data.EntityName+" #"+e.Data.Number),o(),y(r.pageData.DualReceiptNumber?6:-1),o(),y(r.pageData.DualReceiptNumber?7:-1),o(2),F(" - "+v(10,10,e.Data.Date,"dd MMM yyyy")+(e.Data.Name==null?"":" : "+e.Data.Name)),o(4),D(" ","[Q: "+v(14,13,e.Items,"Quantity")+", T: "+g(16,19,v(15,16,e.Items,"Total"))+"]"," "),o(4),c("innerHtml",e==null||e.Data==null?null:e.Data.Note,Ee),o(3),F(e.Data==null?null:e.Data.PaymentStateLabel),o(4),H(e.Items),o(2),y(r.roleService.product.Cost?26:-1)}}function Af(i,s){if(i&1&&(n(0,"div",62)(1,"div")(2,"strong"),p(3,"Tax Added"),a(),n(4,"span",59),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Purchases with Tax"),a(),n(10,"span",59),p(11),d(12,"amountFraction"),a()()()),i&2){let e=m(3);o(5),F(g(6,2,e.data.Aggregate.TaxAdd)),o(6),F(g(12,4,e.data.Aggregate.PurchaseWithTax))}}function Gf(i,s){if(i&1&&(n(0,"div",62)(1,"div")(2,"strong"),p(3,"Gross Purchase"),a(),n(4,"span",59),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Discount"),a(),n(10,"span",59),p(11),d(12,"amountFraction"),a()(),n(13,"div")(14,"strong"),p(15,"Tax Incl."),a(),n(16,"span",59),p(17),d(18,"amountFraction"),a()(),n(19,"div")(20,"strong"),p(21,"Net Purchase"),a(),n(22,"span",59),p(23),d(24,"amountFraction"),a()()()),i&2){let e=m(3);o(5),F(g(6,4,e.data.Aggregate.Gross)),o(6),F(g(12,6,e.data.Aggregate.Discount)),o(6),F(g(18,8,e.data.Aggregate.TaxInclude)),o(6),F(g(24,10,e.data.Aggregate.NetPurchase))}}function Hf(i,s){if(i&1&&(n(0,"div",30),S(1,Af,13,6,"div",62),n(2,"div",62)(3,"div")(4,"strong"),p(5,"Orders"),a(),n(6,"span",59),p(7),d(8,"amountFraction"),a()(),n(9,"div")(10,"strong"),p(11,"Qty"),a(),n(12,"span",59),p(13),d(14,"quantityFraction"),a()()(),S(15,Gf,25,12,"div",62),a()),i&2){let e=m(2);o(),y(e.roleService.product.Cost?1:-1),o(6),F(g(8,4,e.data.Aggregate.TotalTransaction)),o(6),F(g(14,6,e.data.Aggregate.UnitQuantity)),o(2),y(e.roleService.product.Cost?15:-1)}}function Qf(i,s){if(i&1&&(n(0,"content")(1,"div",17)(2,"table",18)(3,"thead",19)(4,"tr")(5,"th",20),p(6,"Name"),a(),n(7,"th",21),p(8,"Code"),a(),n(9,"th",22)(10,"span",23),p(11,"Requested"),a(),p(12," qty "),a(),n(13,"th",24),p(14,"Qty"),a(),n(15,"th",25),p(16,"UOM"),a(),S(17,Pf,2,1,"th",26),S(18,Ff,2,0,"th",27),S(19,If,2,1,"th",28),a()(),n(20,"tbody")(21,"tr")(22,"td",29),G(23,Nf,27,24,"div",null,Y),a()()()(),S(25,Hf,16,8,"div",30),a()()),i&2){let e=m();o(17),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(3),li("colspan",e.roleService.product.Cost?8:6),o(),H(e.data.Data),o(2),y(e.data.Data.length>0?25:-1)}}var Da=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetPurchaseTransactionDetail","ReportLoader/GetPurchaseTransactionDetail");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.roleService=C;this.matDialog=T}hideMore=!0;AscDscRadio=[{Key:!1,Value:"Asc"},{Key:!0,Value:"Desc"}];SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];openExportModal(){this.matDialog.open(K,{data:{title:"Product Transaction Detail",exportTypes:[{ID:"ReportExport/ReportPurchaseDetail",Value:"Default",FileName:"Product Transaction Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty),this.datePipe.transform(this.pageData.Filter.From,"MMM")===this.datePipe.transform(this.pageData.Filter.To,"MMM")&&this.datePipe.transform(this.pageData.Filter.From,"yyyy")===this.datePipe.transform(this.pageData.Filter.To,"yyyy")?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d")}`:this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`,this.pageData.Filter.From==this.pageData.Filter.To?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`:this.menuData.H+=` - ${this.datePipe.transform(this.pageData.Filter.To,"d MMM yyyy")}`,this.menuData.H+=" ]"}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search 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"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","AscDesc",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","items","ngModel"],["name","NoteVisible",3,"modelChange","model"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","355px"],[2,"width","50px"],[1,"text-end",2,"width","55px"],[1,"d-block"],[1,"text-end",2,"width","33px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"red",2,"width","30px"],[1,"text-end",2,"width","150px"],[1,"px-0","border-bottom-0"],[1,"row","justify-content-end"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","mt-2","mb-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-3"],[1,"text-danger","ms-3"],[1,"d-block","fw-normal","fst-italic","ms-3",2,"word-break","break-all",3,"innerHtml"],[1,"d-lg-block","mt-2","me-5","fw-bold","fst-italic"],["runat","server",1,"status"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"table","table-sm","table-borderless"],["id","PONumber"],[1,"fw-normal","border-start","border-end",2,"width","325px"],[1,"lh-base"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","50px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","65px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","30px"],[1,"fst-italic","border-start","border-end","small",2,"width","40px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","80px"],[1,"fw-normal","border-start","border-end","text-end","text-danger",2,"width","30px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","140px"],[1,"text-danger"],[1,"grid_footer"],["colspan","2",1,"text-end","fw-bold"],["colspan","2",1,"text-end"],["colspan","3"],[1,"text-end","d-flex","justify-content-end","fw-bold"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[1,"zebra","col-auto"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,wf,3,0,"button",2),a(),n(3,"filters"),E(4,Tf,32,20,"ng-template",null,0,O),a(),S(6,Qf,26,5,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,Te,Ae,Ce,U,se,oe,Z,ne],encapsulation:2})};var cl=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],wo=i=>({ID:i}),Yf=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"];function jf(i,s){if(i&1){let e=I();n(0,"button",31),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",32),p(2," Export "),a()}}function qf(i,s){if(i&1){let e=I();n(0,"div")(1,"div",33)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",34),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",35),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",36)(10,"datepicker",37),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Payment"),a(),n(13,"ng-select",38),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.StateID,t)||(l.pageData.Filter.StateID=t),_(t)}),a(),n(14,"h6"),p(15,"Supplier"),a(),n(16,"autocompleteV2",39),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(17,"h6"),p(18,"RowCount"),a(),n(19,"input",40),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(20,"h6"),p(21,"Order By"),a(),n(22,"radio-options",41),h("modelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m(2);return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=m(2);o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.StateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.contactDisplay),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Uf(i,s){i&1&&(n(0,"th",13),p(1," Purchase "),a())}function zf(i,s){i&1&&(n(0,"th",14),p(1," Tax "),a())}function Kf(i,s){i&1&&(n(0,"th",15),p(1," Purchase+Tax "),a())}function Xf(i,s){i&1&&(n(0,"th",16),p(1," Payment "),a())}function Jf(i,s){i&1&&b(0,"br")}function Zf(i,s){if(i&1&&(n(0,"a",42),p(1),a()),i&2){let e=m().$implicit;c("routerLink",M(3,cl))("queryParams",X(4,wo,e.PurchaseOrderID)),o(),F(e.PONumber)}}function $f(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function ex(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function tx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalAmount)," ")}}function ix(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PaymentAmount)," ")}}function nx(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",42),p(5),a(),S(6,Jf,1,0,"br"),S(7,Zf,2,6,"a",42),a(),n(8,"td"),p(9),d(10,"date"),a(),n(11,"td")(12,"a",42),p(13),a()(),n(14,"td",21),p(15),d(16,"quantityFraction"),a(),S(17,$f,3,3,"td",21),S(18,ex,3,3,"td",22),S(19,tx,3,3,"td",21),S(20,ix,3,3,"td",21),n(21,"td"),p(22),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(25,cl))("queryParams",X(26,wo,e.ID)),o(),F(e.Number),o(),y(r.pageData.DualNumber?6:-1),o(),y(r.pageData.DualNumber?7:-1),o(2),F(v(10,20,e.Date,"dd MMM yyyy")),o(3),c("routerLink",M(28,Yf))("queryParams",X(29,wo,e.SupplierID)),o(),D(" ",e.SupplierNameDisplay," "),o(2),D(" ",g(16,23,e.TotalItemQuantity)," "),o(2),y(r.roleService.product.Cost?17:-1),o(),y(r.roleService.product.Cost?18:-1),o(),y(r.roleService.product.Cost?19:-1),o(),y(r.roleService.product.Cost?20:-1),o(),ji("text-danger",e.PaymentStateLabel==="Unpaid")("text-success",e.PaymentStateLabel==="Paid"),o(),D(" ",e.PaymentStateLabel," ")}}function ax(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function ox(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function rx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"TotalAmount"))," ")}}function lx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"PaymentAmount"))," ")}}function px(i,s){if(i&1){let e=I();n(0,"span",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountReportPurchaseSummary"))}),n(1,"i",44),p(2,"?"),a()()}}function mx(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function sx(i,s){if(i&1){let e=I();n(0,"a",45),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",46),p(2," Next"),a()}}function cx(i,s){if(i&1){let e=I();n(0,"a",47),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountReportPurchaseSummary",!0))}),b(1,"i",48),p(2," Show All"),a()}}function dx(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),h("textChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Number,t)||(l.pageData.Filter.Number=t),_(t)}),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,jf,3,0,"button",3),a(),n(3,"filters"),E(4,qf,23,14,"ng-template",null,0,O),a(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Outlet"),a(),n(14,"th",9),p(15,"Number"),a(),n(16,"th",10),p(17,"Date"),a(),n(18,"th",11),p(19," Supplier "),a(),n(20,"th",12),p(21," Qty "),a(),S(22,Uf,2,0,"th",13),S(23,zf,2,0,"th",14),S(24,Kf,2,0,"th",15),S(25,Xf,2,0,"th",16),n(26,"th",17),p(27,"State"),a()()(),n(28,"tbody"),G(29,nx,23,31,"tr",null,Y),a(),n(31,"tfoot")(32,"tr",18),b(33,"td",19),n(34,"td",20),p(35,"Total :"),a(),n(36,"td",21),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),S(40,ax,4,6,"td",21),S(41,ox,4,6,"td",22),S(42,rx,4,6,"td",21),S(43,lx,4,6,"td",21),b(44,"td",23),a()()()(),n(45,"div",24)(46,"div",25)(47,"div",26),p(48),d(49,"number"),E(50,px,3,0,"span",27)(51,mx,3,3,"span",28),p(52),a()(),E(53,sx,3,0,"a",29)(54,cx,3,0,"a",30),a()()()()}if(i&2){let e=m();c("pageData",e.menuData),f("text",e.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(20),y(e.roleService.product.Cost?22:-1),o(),y(e.roleService.product.Cost?23:-1),o(),y(e.roleService.product.Cost?24:-1),o(),y(e.roleService.product.Cost?25:-1),o(4),H(e.infiniteList),o(8),D(" ",g(39,23,v(38,20,e.infiniteList,"TotalItemQuantity"))," "),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.product.Cost?41:-1),o(),y(e.roleService.product.Cost?42:-1),o(),y(e.roleService.product.Cost?43:-1),o(5),D(" Showing 1 - ",g(49,25,e.infiniteList.length)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var va=class i extends vi{constructor(e,r,t,l,C,T){super(e,r,"Report/ReportPurchaseSummary","ReportLoader/GetReportPurchaseSummary",null,l);this.httpService=r;this.csvConverter=t;this.url=l;this.roleService=C;this.matDialog=T}contactDisplay;preInitLoader(){let e=this.loaderPayload.ListIDs;typeof e=="string"&&V.IsNotEmpty(e)&&(this.loaderPayload.ListIDs=[e])}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Report Summary",exportTypes:[{ID:"ReportExport/ReportPurchaseSummary",Value:"Default",FileName:"Purchase Report Summary"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.menuData.H=e.PageTitle}preInitList(){V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null),V.IsNotEmpty(this.pageData.Filter.SupplierID)&&(this.pageData.Filter.From=V.MinDate),V.IsNotEmpty(this.pageData.SupplierName)&&(this.contactDisplay=this.pageData.SupplierName)}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,t.SupplierNameDisplay=t.SupplierNameDisplay==null?"":t.SupplierNameDisplay,l.SupplierNameDisplay=l.SupplierNameDisplay==null?"":l.SupplierNameDisplay,e.active){case"EntityName":return V.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),C);case"Number":return V.compare(t.Number,l.Number,C);case"Date":return V.compare(t.Date,l.Date,C);case"SupplierNameDisplay":return V.compare(t.SupplierNameDisplay.toLocaleLowerCase(),l.SupplierNameDisplay.toLocaleLowerCase(),C);case"TotalItemQuantity":return V.compare(t.TotalItemQuantity,l.TotalItemQuantity,C);case"Total":return V.compare(t.TotalAmount,l.TotalAmount,C);case"Sales":return V.compare(t.Sales,l.Sales,C);case"Tax":return V.compare(t.Tax,l.Tax,C);case"PaymentAmount":return V.compare(t.PaymentAmount,l.PaymentAmount,C);case"PaymentState":return V.compare(t.PaymentStateLabel,l.PaymentStateLabel,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-detail-summary"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName"],["mat-sort-header","Number"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","SupplierNameDisplay",2,"width","118px"],["mat-sort-header","TotalItemQuantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right","text-end",2,"width","118px"],["mat-sort-header","PaymentAmount","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","PaymentState",2,"width","70px"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end","empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"empty-column"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more data",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Sort",3,"modelChange","model","options"],[3,"routerLink","queryParams"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){r&1&&S(0,dx,55,27,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,it,Q,$,J,Qe,L,R,ie,pe,ge,Ue,Te,Ae,U,se,re,oe,Z,ne],encapsulation:2})};var ux=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],_x=i=>({ID:i}),gx=(i,s,e)=>({SupplierID:i,From:s,To:e}),Cx=()=>["/menu/Reports/Purchases_Report/Summary"];function fx(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function xx(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier Group"),a(),n(7,"ng-select",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",9)(13,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function hx(i,s){i&1&&(n(0,"th",20),p(1," Purchase "),a())}function Sx(i,s){if(i&1&&(n(0,"td",24)(1,"a",30),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(11,gx,e.SupplierID,v(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),v(3,6,r.pageData.Filter.To,"yyyy-MM-dd")))("routerLink",M(15,Cx)),o(3),F(g(5,9,e.Total))}}function yx(i,s){if(i&1&&(n(0,"tr",21)(1,"td"),p(2),a(),n(3,"td",27)(4,"a",28),p(5),a()(),n(6,"td",24),p(7),a(),n(8,"td",29),p(9),d(10,"quantityFraction"),a(),S(11,Sx,6,16,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",M(9,ux))("queryParams",X(10,_x,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,7,e.Quantity)," "),o(2),y(r.roleService.product.Cost?11:-1)}}function Dx(i,s){i&1&&(n(0,"th",24),p(1," Total Purchase "),a())}function vx(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(2,1,e.data.TotalSales)," ")}}function wx(i,s){if(i&1){let e=I();n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",15)(5,"tr")(6,"th",16),p(7,"Rank"),a(),n(8,"th",17),p(9,"Supplier"),a(),n(10,"th",18),p(11," Code "),a(),n(12,"th",19),p(13," Quantity "),a(),S(14,hx,2,0,"th",20),a()(),n(15,"tbody"),G(16,yx,12,12,"tr",21,Y),a(),n(18,"tfoot")(19,"tr",22),b(20,"th",23),n(21,"th",24),p(22,"Total Quantity"),a(),S(23,Dx,2,0,"th",24),a(),n(24,"tr"),b(25,"td",25),n(26,"td",24),p(27),d(28,"quantityFraction"),a(),S(29,vx,3,3,"td",24),a()()(),n(30,"POS-complex-pagination",26),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(2),H(e.data.Data),o(7),y(e.roleService.product.Cost?23:-1),o(4),F(g(28,6,e.data.TotalQty)),o(2),y(e.roleService.product.Cost?29:-1),o(),c("total",e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var wa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/TopSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopPurchaseExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/TopSupplierCount",pagination:!0}})}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-top-supplier"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","35px"],["mat-sort-header","Name"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"thead-light"],["colspan","3"],[1,"text-end"],["colspan","3",1,"bg-white","border-top-0"],["api","Report/TopSupplierCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end","text-success"],[3,"queryParams","routerLink"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,fx,3,0,"button",2),a(),n(3,"filters"),E(4,xx,17,11,"ng-template",null,0,O),a(),S(6,wx,31,8,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,Qe,L,R,pe,ge,Ue,Et,U,oe,Z,ne],encapsulation:2})};var Tx=i=>[i],Px=i=>({ID:i}),Fx=(i,s,e,r)=>({VariantID:i,ProductID:s,From:e,To:r});function Ix(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function bx(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Currency"),a(),n(10,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",10)(16,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Group By"),a(),n(19,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(20,"h6"),p(21,"Brand"),a(),n(22,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.GroupByProduct),c("options",e.GroupByRadio),o(3),c("multiple",!1),f("ngModel",e.pageData.Filter.BrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function Ex(i,s){i&1&&(n(0,"th"),p(1,"Variant"),a())}function Mx(i,s){i&1&&(n(0,"th",22),p(1," Cost "),a())}function Vx(i,s){i&1&&(n(0,"th",23),p(1," Gross "),a())}function Bx(i,s){i&1&&(n(0,"th",24),p(1," Purchase "),a())}function Ox(i,s){i&1&&(n(0,"th",25),p(1," Tax "),a())}function Lx(i,s){i&1&&(n(0,"th",26),p(1," Purchase+Tax "),a())}function Rx(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.VariantName)}}function kx(i,s){if(i&1&&(n(0,"td",29)(1,"a",32),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",Ut(4,Fx,r.pageData.Filter.GroupByProduct?null:e.ID,r.pageData.Filter.GroupByProduct?e.ID:null,r.dateFromString(),r.dateToString())),o(),D(" ",g(3,2,e.UnitPrice)," ")}}function Wx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function Nx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetPrice)," ")}}function Ax(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Gx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PurchaseNTax)," ")}}function Hx(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",31),p(5),a()(),S(6,Rx,2,1,"td"),n(7,"td"),p(8),a(),n(9,"td",29),p(10),d(11,"number"),a(),n(12,"td",29),p(13),d(14,"quantityFraction"),a(),S(15,kx,4,9,"td",29),S(16,Wx,3,3,"td",29),S(17,Nx,3,3,"td",29),S(18,Ax,3,3,"td",29),S(19,Gx,3,3,"td",29),a()),i&2){let e=s.$implicit,r=s.$index,t=m(2);o(2),F(r+1),o(2),c("routerLink",X(17,Tx,t.pageData.Filter.GroupByProduct?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(19,Px,e.ID)),o(),F(e.Name),o(),y(t.pageData.Filter.GroupByProduct?-1:6),o(2),D(" ",t.pageData.Filter.GroupByProduct?e.ProductCode:e.VariantCode," "),o(2),F(g(11,13,e.Order)),o(3),F(g(14,15,e.Quantity)),o(2),y(t.roleService.product.Cost?15:-1),o(),y(t.roleService.product.Cost?16:-1),o(),y(t.roleService.product.Cost?17:-1),o(),y(t.roleService.product.Cost?18:-1),o(),y(t.roleService.product.Cost?19:-1)}}function Qx(i,s){i&1&&b(0,"td")}function Yx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"UnitPrice"))," ")}}function jx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function qx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"NetPrice"))," ")}}function Ux(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function zx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"PurchaseNTax"))," ")}}function Kx(i,s){if(i&1){let e=I();n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16)(4,"thead",17),P("matSortChange",function(t){u(e);let l=m();return _(l.onSortChange(t))}),n(5,"tr")(6,"th",18),p(7,"No"),a(),n(8,"th"),p(9,"Product"),a(),S(10,Ex,2,0,"th"),n(11,"th",19),p(12,"Code"),a(),n(13,"th",20),p(14," Orders "),a(),n(15,"th",21),p(16," Quantity "),a(),S(17,Mx,2,0,"th",22),S(18,Vx,2,0,"th",23),S(19,Bx,2,0,"th",24),S(20,Ox,2,0,"th",25),S(21,Lx,2,0,"th",26),a()(),n(22,"tbody"),G(23,Hx,20,21,"tr",null,Y),a(),n(25,"tfoot")(26,"tr",27),b(27,"td"),S(28,Qx,1,0,"td"),b(29,"td",28),n(30,"td"),p(31,"Total :"),a(),n(32,"td",29),p(33),d(34,"sum"),d(35,"number"),a(),n(36,"td",29),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),S(40,Yx,4,6,"td",29),S(41,jx,4,6,"td",29),S(42,qx,4,6,"td",29),S(43,Ux,4,6,"td",29),S(44,zx,4,6,"td",29),a()()()(),n(45,"infinite-pagination",30),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount",!0))}),a()()()}if(i&2){let e=m();o(10),y(e.pageData.Filter.GroupByProduct?-1:10),o(7),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(),y(e.roleService.product.Cost?20:-1),o(),y(e.roleService.product.Cost?21:-1),o(2),H(e.infiniteList),o(5),y(e.pageData.Filter.GroupByProduct?-1:28),o(5),D(" ",g(35,23,v(34,20,e.infiniteList,"Order"))," "),o(4),D(" ",g(39,28,v(38,25,e.infiniteList,"Quantity"))," "),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.product.Cost?41:-1),o(),y(e.roleService.product.Cost?42:-1),o(),y(e.roleService.product.Cost?43:-1),o(),y(e.roleService.product.Cost?44:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Ta=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/PurchasesByProductList","ReportLoader/PurchasesByProductLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}GroupByRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];dateFromString=xi(()=>{let e=this.pageData.Filter.From;return e?new Date(e).toJSON():null});dateToString=xi(()=>{let e=this.pageData.Filter.To;return e?new Date(e).toJSON():null});openExportModal(){this.matDialog.open(K,{data:{title:"Product Bought Report",exportTypes:[{ID:"ReportExport/PurchasesByProductExport",Value:"Default",FileName:"Product Bought Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}onSortChange(e){let r=this.infiniteList.slice();if(!e.active||e.direction===""){this.infiniteList=this.originalData;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";return this.compare(t[e.active],l[e.active],C)})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-bought"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","GroupBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],["matSort","",1,"thead-light","sticky-top-thead",3,"matSortChange"],[2,"width","10px"],[2,"width","100px"],["mat-sort-header","Order","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","140px"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Purchase","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","PurchaseNTax","arrowPosition","before",1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],["routerLink","/menu/Reports/Purchases_Report/History",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Ix,3,0,"button",2),a(),n(3,"filters"),E(4,bx,23,15,"ng-template",null,0,O),a(),S(6,Kx,46,30,"content"),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,Te,Ce,U,ti,se,re,Z,ne],encapsulation:2})};var Xx=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Pa=i=>({ID:i}),Jx=()=>["/menu/Products/Catalog/Variants/Info"],Zx=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],$x=()=>["/menu/Products/Catalog/Products/Info"];function eh(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function th(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product"),a(),n(3,"autocompleteV2",16),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("ngModel",e.pageData.Filter.ProductID),c("inputTextValue",e.pageData.ProductName)}}function ih(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Variant"),a(),n(3,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("ngModel",e.pageData.Filter.VariantID),c("renderThumbnail",!0)("inputTextValue",e.pageData.VariantName)}}function nh(i,s){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier"),a(),n(7,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(8,"h6"),p(9,"Scope"),a(),n(10,"radio-options",9),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ByProduct,t)||(l.pageData.Filter.ByProduct=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()(),E(11,th,4,2,"div",3)(12,ih,4,3,"div",3),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(17,"div",11)(18,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(19,"h6"),p(20,"Order By"),a(),n(21,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.OrderByNumber,t)||(l.pageData.Filter.OrderByNumber=t),_(t)}),a(),n(22,"h6"),p(23,"Currency"),a(),n(24,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(25,"h6"),p(26,"Brand"),a(),n(27,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()}if(i&2){let e=m();o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),f("model",e.pageData.Filter.ByProduct),c("options",e.ScopeRadio),o(),c("ngIf",e.pageData.Filter.ByProduct),o(),c("ngIf",!e.pageData.Filter.ByProduct),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.OrderByNumber),c("options",e.OrderByRadio),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("multiple",!1),f("ngModel",e.pageData.Filter.BrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function ah(i,s){i&1&&(n(0,"th",38),p(1,"Date"),a())}function oh(i,s){i&1&&(n(0,"th"),p(1,"Outlet"),a())}function rh(i,s){i&1&&(n(0,"th"),p(1," Supplier "),a())}function lh(i,s){i&1&&(n(0,"th",39),p(1," Fulfillment "),a())}function ph(i,s){i&1&&(n(0,"th"),p(1,"Product"),a())}function mh(i,s){i&1&&(n(0,"th",40),p(1," Qty "),a())}function sh(i,s){i&1&&(n(0,"th",41),p(1," Unit Quantity "),a())}function ch(i,s){i&1&&(n(0,"th",42)(1,"span",43),p(2," Cost "),a()())}function dh(i,s){i&1&&(n(0,"th",44)(1,"span",45),p(2," Gross "),a()())}function uh(i,s){i&1&&(n(0,"th",40),p(1," Item (%) "),a())}function _h(i,s){i&1&&(n(0,"th",46),p(1," Item Disc "),a())}function gh(i,s){i&1&&(n(0,"th",40),p(1," Bill(%) "),a())}function Ch(i,s){i&1&&(n(0,"th",46),p(1," Bill Disc "),a())}function fh(i,s){i&1&&(n(0,"th",47)(1,"span",48),p(2," Purchase + Tax "),a()())}function xh(i,s){i&1&&(n(0,"th"),p(1,"Item Note"),a())}function hh(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Date,"dd MMM yyyy")," ")}}function Sh(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.EntityName)}}function yh(i,s){if(i&1&&(n(0,"td")(1,"a",50),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,Zx))("queryParams",X(4,Pa,e.SupplierID)),o(),F(e.SupplierName)}}function Dh(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryStatus," ")}}function vh(i,s){if(i&1&&(n(0,"td")(1,"a",50),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,$x))("queryParams",X(4,Pa,e.ProductID)),o(),F(e.Name)}}function wh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Th(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.VariantUnitQuantity)," ")}}function Ph(i,s){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.UnitPrice)," ")}}function Fh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function Ih(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.Discount>0?g(2,1,e.Discount):"0"," ")}}function bh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.ItemDiscountAmount>0?g(2,1,e.ItemDiscountAmount):"0"," ")}}function Eh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DiscountInvoice>0?g(2,1,e.DiscountInvoice):"0"," ")}}function Mh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.OrderDiscountAmount>0?g(2,1,e.OrderDiscountAmount):"0"," ")}}function Vh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PurchaseNTax)," ")}}function Bh(i,s){if(i&1&&b(0,"td",53),i&2){let e=m().$implicit;c("innerHTML",e.Note,Ee)}}function Oh(i,s){if(i&1&&(n(0,"tr",49),E(1,hh,3,4,"td",3)(2,Sh,2,1,"td",3),n(3,"td")(4,"a",50),p(5),a()(),E(6,yh,3,6,"td",3)(7,Dh,2,1,"td",3)(8,vh,3,6,"td",3),n(9,"td")(10,"a",50),p(11),a()(),E(12,wh,3,3,"td",30)(13,Th,3,3,"td",30)(14,Ph,3,3,"td",35)(15,Fh,3,3,"td",30)(16,Ih,3,3,"td",30)(17,bh,3,3,"td",30)(18,Eh,3,3,"td",30)(19,Mh,3,3,"td",30)(20,Vh,3,3,"td",30)(21,Bh,1,1,"td",51),a()),i&2){let e=s.$implicit,r=m(2);o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Outlet.selected),o(2),c("routerLink",M(21,Xx))("queryParams",X(22,Pa,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",r.column.Supplier.selected),o(),c("ngIf",r.column.Fulfillment.selected),o(),c("ngIf",r.pageData.Filter.ByProduct),o(2),c("routerLink",M(24,Jx))("queryParams",X(25,Pa,e.VariantID)),o(),F(e.Model),o(),c("ngIf",r.column.Qty.selected),o(),c("ngIf",r.column.UnitQty.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.UnitCost.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Gross.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.ItemPercentage.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.ItemDiscount.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.BillPercentage.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.BillDiscount.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.PurchaseNTax.selected),o(),c("ngIf",r.column.ItemNote.selected)}}function Lh(i,s){i&1&&b(0,"td",34)}function Rh(i,s){i&1&&b(0,"td",34)}function kh(i,s){i&1&&b(0,"td",34)}function Wh(i,s){i&1&&b(0,"td",34)}function Nh(i,s){i&1&&b(0,"td",34)}function Ah(i,s){i&1&&(n(0,"td",47),p(1," Total : "),a())}function Gh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function Hh(i,s){i&1&&b(0,"td",34)}function Qh(i,s){if(i&1&&(n(0,"td",52),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"UnitPrice"))," ")}}function Yh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Gross"))," ")}}function jh(i,s){i&1&&b(0,"td",34)}function qh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ItemDiscountAmount"))," ")}}function Uh(i,s){i&1&&b(0,"td",34)}function zh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"OrderDiscountAmount"))," ")}}function Kh(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"PurchaseNTax"))," ")}}function Xh(i,s){i&1&&b(0,"td",34)}function Jh(i,s){if(i&1){let e=I();n(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr"),E(6,ah,2,0,"th",22)(7,oh,2,0,"th",3),n(8,"th",23),p(9,"Number"),a(),E(10,rh,2,0,"th",3)(11,lh,2,0,"th",24)(12,ph,2,0,"th",3),n(13,"th"),p(14,"Variant"),a(),E(15,mh,2,0,"th",25)(16,sh,2,0,"th",26)(17,ch,3,0,"th",27)(18,dh,3,0,"th",28)(19,uh,2,0,"th",25)(20,_h,2,0,"th",29)(21,gh,2,0,"th",25)(22,Ch,2,0,"th",29)(23,fh,3,0,"th",30)(24,xh,2,0,"th",3),a()(),n(25,"tbody"),E(26,Oh,22,27,"tr",31),a(),n(27,"tfoot")(28,"tr",32),E(29,Lh,1,0,"td",33)(30,Rh,1,0,"td",33),b(31,"td",34),E(32,kh,1,0,"td",33)(33,Wh,1,0,"td",33)(34,Nh,1,0,"td",33)(35,Ah,2,0,"td",30)(36,Gh,4,6,"td",30)(37,Hh,1,0,"td",33)(38,Qh,4,6,"td",35)(39,Yh,4,6,"td",30)(40,jh,1,0,"td",33)(41,qh,4,6,"td",30)(42,Uh,1,0,"td",33)(43,zh,4,6,"td",30)(44,Kh,4,6,"td",36)(45,Xh,1,0,"td",33),a()()()(),n(46,"POS-complex-pagination",37),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Outlet.selected),o(3),c("ngIf",e.column.Supplier.selected&&e.column.Supplier.selected),o(),c("ngIf",e.column.Fulfillment.selected),o(),c("ngIf",e.pageData.Filter.ByProduct),o(3),c("ngIf",e.column.Qty.selected),o(),c("ngIf",e.column.UnitQty.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.UnitCost.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Gross.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.ItemPercentage.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.ItemDiscount.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.BillPercentage.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.BillDiscount.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.PurchaseNTax.selected),o(),c("ngIf",e.column.ItemNote.selected),o(2),c("ngForOf",e.data.Data),o(3),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Outlet.selected),o(2),c("ngIf",e.column.Supplier.selected),o(),c("ngIf",e.column.Fulfillment.selected),o(),c("ngIf",e.pageData.Filter.ByProduct),o(),c("ngIf",e.column.Qty.selected||e.column.PurchaseNTax.selected),o(),c("ngIf",e.column.Qty.selected),o(),c("ngIf",e.column.UnitQty.selected),o(),c("ngIf",e.column.UnitCost.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.Gross.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.ItemPercentage.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.ItemDiscount.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.BillPercentage.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.BillDiscount.selected&&e.roleService.product.Cost),o(),c("ngIf",e.roleService.product.Cost&&e.column.PurchaseNTax.selected),o(),c("ngIf",e.column.ItemNote.selected),o(),c("total",e.data.Data.length)("pageData",e.pageData)}}var Fa=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/ProductPurchaseHistory","ReportLoader/ProductPurchaseHistoryLoader",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=C;this.matDialog=T}columnService=Pe(gt);column={Date:{selected:!0},Outlet:{selected:!0},Supplier:{selected:!0},Fulfillment:{selected:!1},Qty:{selected:!0,name:"Quantity"},UnitQty:{selected:!1,name:"Unit Quantity"},UnitCost:{selected:!1,name:"Unit Cost"},Gross:{selected:!0,name:"Gross Purchase"},ItemPercentage:{selected:!1,name:"Item (%)"},ItemDiscount:{selected:!1,name:"Item Disc"},BillPercentage:{selected:!1,name:"Bill (%)"},BillDiscount:{selected:!1,name:"Bill Disc"},PurchaseNTax:{selected:!0,name:"Purchase N Tax"},ItemNote:{selected:!1,name:"Item Note"}};ScopeRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];OrderByRadio=[{Key:!0,Value:"Date & Number"},{Key:!1,Value:"Supplier"}];hideMore=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Product Purchase History",exportTypes:[{ID:"ReportExport/ProductPurchaseHistory",Value:"Default",FileName:"Product Purchase History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){let e=this.activatedRoute.snapshot?.queryParams;this.pageData.Filter.From=!e.VariantID&&e.From?e.From:e.VariantID?null:this.pageData.Filter.From,this.pageData.Filter.To=!e.VariantID&&e.To?e.To:e.VariantID?null:this.pageData.Filter.To,this.pageData.Filter.VariantID=V.IsNotEmpty(e.VariantID)?e.VariantID:V.GuidEmpty,this.pageData.Filter.ProductID=V.IsNotEmpty(e.ProductID)?e.ProductID:V.GuidEmpty,this.pageData.Filter.ByProduct=V.IsNotEmpty(e.ProductID),V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-purchase-history"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","OrderBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search Product",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail","inputTextValue"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 100px",4,"ngIf"],[2,"width","70px"],["style","width: 80px",4,"ngIf"],["style","width: 50px","class","text-end",4,"ngIf"],["style","width: 60px","class","text-end",4,"ngIf"],["style","width: 75px","class","text-end",4,"ngIf"],["style","width: 75px","class","text-end","title","Original cost multiplied by quantity",4,"ngIf"],["style","width: 70px","class","text-end",4,"ngIf"],["class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end text-danger",4,"ngIf"],["class","text-end","colspan","6",4,"ngIf"],["api","report/ProductPurchaseHistoryCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[2,"width","100px"],[2,"width","80px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","60px"],[1,"text-end",2,"width","75px"],["matTooltip","Original Cost for One Quantity Before Discount & Tax","matTooltipPosition","above"],["title","Original cost multiplied by quantity",1,"text-end",2,"width","75px"],["matTooltip","Unit Cost Multiplied by Quantity","matTooltipPosition","above"],[1,"text-end",2,"width","70px"],[1,"text-end"],["matTooltip","Gross Purchase After Discount & Tax","matTooltipPosition","above"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"innerHTML",4,"ngIf"],[1,"text-end","text-danger"],[3,"innerHTML"],["colspan","6",1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,eh,3,0,"button",2),a(),n(3,"filters"),E(4,nh,28,18,"ng-template",null,0,O),a(),E(6,Jh,47,34,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,L,R,ie,Te,Ae,Et,U,se,oe,Z,ne],encapsulation:2})};var Zh=()=>["/menu/Reports/Purchases_Report/Daily/Monthly"];function $h(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function e2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Month"),a(),n(13,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(14,"h6"),p(15,"Currency"),a(),n(16,"ng-select",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(17,"h6"),p(18,"Multiply Unit Qty"),a(),n(19,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),f("model",e.pageData.Filter.MultiplyUnitQuantity),c("options",e.YesNoRadio)}}function t2(i,s){i&1&&(n(0,"th",17),p(1," Purchases "),a())}function i2(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PurchaseTotal)," ")}}function n2(i,s){if(i&1&&(n(0,"tr",18)(1,"td"),p(2),d(3,"date"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"quantityFraction"),a(),S(10,i2,3,3,"td",17),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(v(3,4,e.Date,"EEEE")),o(3),F(g(6,7,e.Day)),o(3),F(g(9,9,e.Quantity)),o(2),y(r.roleService.product.Cost?10:-1)}}function a2(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"PurchaseTotal"))," ")}}function o2(i,s){if(i&1&&(n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15)(4,"thead",16)(5,"tr")(6,"th"),p(7,"Day"),a(),n(8,"th",17),p(9,"Date (Day)"),a(),n(10,"th",17),p(11,"Quantity"),a(),S(12,t2,2,0,"th",17),a()(),n(13,"tbody"),G(14,n2,11,11,"tr",18,Y),a(),n(16,"tr")(17,"td",19),p(18,"Total"),a(),n(19,"td",17),p(20),d(21,"sum"),d(22,"quantityFraction"),a(),S(23,a2,4,6,"td",17),a()()()()()),i&2){let e=m();o(12),y(e.roleService.product.Cost?12:-1),o(2),H(e.data.Data),o(6),D(" ",g(22,6,v(21,3,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?23:-1)}}var Ia=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/GetPurchasePeriodDaily","ReportLoader/GetReportPurchaseDaily");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Months=V.Months}Years=[];Months=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Daily",exportTypes:[{ID:"ReportExport/DailyPurchaseReport",Value:"Default",FileName:"Purchase Daily"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily-purchases"]],standalone:!1,features:[W],decls:9,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Month","bindLabel","Label","bindValue","ID",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"border-bottom"],["colspan","2",1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,$h,3,0,"button",2),n(3,"a",3),p(4,"View Month"),a()(),n(5,"filters"),E(6,e2,20,14,"ng-template",null,0,O),a(),S(8,o2,24,8,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,Zh)),o(5),y(t.data?8:-1))},dependencies:[A,Q,$,L,R,ie,Te,Ce,U,se,re,oe,Z,ne],encapsulation:2})};var r2=()=>["/menu/Reports/Purchases_Report/Daily"];function l2(i,s){if(i&1){let e=I();n(0,"button",12),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function p2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",14)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",15),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",16),h("selectedCategoryIDChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Currency"),a(),n(13,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(14,"h6"),p(15,"Multiply Unit Qty"),a(),n(16,"radio-options",19),h("modelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a(),n(17,"h6"),p(18,"Supplier"),a(),n(19,"autocompleteV2",20),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),f("model",e.pageData.Filter.MultiplyUnitQuantity),c("options",e.YesNoRadio),o(3),f("ngModel",e.pageData.Filter.SupplierID)}}function m2(i,s){i&1&&(n(0,"th",8),p(1,"Purchases"),a())}function s2(i,s){if(i&1&&(n(0,"td",8),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Income)," ")}}function c2(i,s){if(i&1&&(n(0,"tr",9)(1,"td"),p(2),a(),n(3,"td",8),p(4),d(5,"quantityFraction"),a(),S(6,s2,3,3,"td",8),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.MonthLabel),o(2),F(g(5,3,e.Quantity)),o(2),y(r.roleService.product.Cost?6:-1)}}function d2(i,s){if(i&1&&(n(0,"td",8),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Income"))," ")}}function u2(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,l2,3,0,"button",3),n(3,"a",4),p(4,"View Daily"),a()(),n(5,"filters"),E(6,p2,20,13,"ng-template",null,0,O),a(),n(8,"content")(9,"div",5)(10,"table",6)(11,"thead",7)(12,"tr")(13,"th"),p(14,"Month"),a(),n(15,"th",8),p(16,"Quantity"),a(),S(17,m2,2,0,"th",8),a()(),n(18,"tbody"),G(19,c2,7,5,"tr",9,Y),a(),n(21,"tr",10)(22,"td",11),p(23,"Total"),a(),n(24,"td",8),p(25),d(26,"sum"),d(27,"quantityFraction"),a(),S(28,d2,4,6,"td",8),a()()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(),c("routerLink",M(14,r2)),o(14),y(e.roleService.product.Cost?17:-1),o(2),H(e.data.Data),o(6),D(" ",g(27,12,v(26,9,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?28:-1)}}var ba=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/GetPurchasePeriodMonthly","ReportLoader/GetReportPurchaseMonthly");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0)}Years=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Monthly",exportTypes:[{ID:"ReportExport/MonthlyPurchaseReport",Value:"Default",FileName:"Purchase Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-purchase"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"border-bottom"],[1,"table-footer"],["colspan","1",1,"fw-bold","text-start","ps-4"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"]],template:function(r,t){r&1&&S(0,u2,29,15,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,$,L,R,ie,Te,Ae,Ce,U,se,Z,ne],encapsulation:2})};function _2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",2)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",3),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",4),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",5),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years)}}function g2(i,s){if(i&1&&(n(0,"content")(1,"div",6),b(2,"POS-line-chart",7),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var Ea=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthlyPurchasesVolume","ReportLoader/GetMonthlyPurchaseVolume");this.httpService=r;let l=new Date;this.Years=V.GenerateYears(l.getFullYear(),11,!0)}Years=[];ChartData={};chartConfig;preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}preInitList(){let e={ID:0,Symbol:"All"};this.pageData.Options.Currencies.unshift(e),this.pageData.Filter.CurrencyID=0}postInit(){let e=[];this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.Data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}},this.data.PageTitle!=null&&(this.menuData.H=this.data.PageTitle),this.data.Data.MonthlySalesRank.forEach((r,t)=>{let l={name:this.data.Data.MonthName[t],data:r.Sales};e.push(l)}),this.ChartData={series:e}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-volume"]],standalone:!1,features:[W],decls:6,vars:5,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet","appendTo","body",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),b(1,"actions"),n(2,"filters"),E(3,_2,11,8,"ng-template",null,0,O),a(),S(5,g2,3,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(5),y(t.data?5:-1))},dependencies:[A,$,L,R,Mt,Ce,U],encapsulation:2})};var C2=()=>["/menu/Products/Catalog/Products/Info"],f2=i=>({ID:i});function x2(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export"),a()}}function h2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",9)(13,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function S2(i,s){if(i&1&&(n(0,"tr",20)(1,"td"),p(2),a(),n(3,"td")(4,"a",21),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a(),n(11,"td",22),p(12),d(13,"quantityFraction"),a(),n(14,"td",23),p(15),d(16,"number"),a()()),i&2){let e=s.$implicit,r=s.$index;o(2),F(r+1),o(2),c("routerLink",M(14,C2))("queryParams",X(15,f2,e.ID)),o(),D(" ",e.Name," "),o(2),F(e.Code),o(2),F(g(10,8,e.PurchaseQuantity)),o(3),F(g(13,10,e.SellQuantity)),o(3),F(g(16,12,e.Ratio))}}function y2(i,s){if(i&1&&(n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),p(7," Now "),a(),n(8,"th",17),p(9,"Name"),a(),n(10,"th",18),p(11,"Code"),a(),n(12,"th",19),p(13,"Purchase"),a(),n(14,"th",19),p(15,"Sold"),a(),n(16,"th",19),p(17,"Sold Percentage(%)"),a()()(),n(18,"tbody"),G(19,S2,17,17,"tr",20,Y),a()()()()()),i&2){let e=m();o(19),H(e.data.Data)}}var Ma=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/PruchasedSalesReportList","ReportLoader/PurchaseSalesReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}GroupRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Sales Report",exportTypes:[{ID:"ReportExport/PurchasedSalesReportList",Value:"Default",FileName:"Purchase Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-sales-report"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","55px"],[2,"width","320px"],[2,"width","100px"],[1,"text-end",2,"width","80px"],[1,"border-bottom"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,x2,3,0,"button",2),a(),n(3,"filters"),E(4,h2,17,10,"ng-template",null,0,O),a(),S(6,y2,21,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,Qe,L,R,Ue,Ce,U,re,ne],encapsulation:2})};var D2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"],v2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],w2=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),T2=(i,s,e)=>({EntityID:i,From:s,To:e}),P2=()=>["/menu/Reports/Purchases_Report/Summary"];function F2(i,s){if(i&1){let e=I();n(0,"button",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function I2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Compare with Prev Month"),a(),n(3,"radio-options",14),h("modelChange",function(t){u(e);let l=m(2);return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("model",e.isCompare)}}function b2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",15),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(5,"div",16)(6,"datepicker",17),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function E2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",18)(4,"div",19)(5,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Year=null)}),a()(),n(6,"div",21)(7,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Month=null)}),a()()()()}if(i&2){let e=m(2);o(5),f("ngModel",e.Year),c("items",e.Years),o(2),f("ngModel",e.Month),c("items",e.Months)}}function M2(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",10),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Purchase Order Tag"),a(),n(6,"ng-select",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"Date Filter"),a(),n(9,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.YearMonthToDateRange())}),a(),S(10,I2,4,1,"div"),S(11,b2,7,2,"div"),S(12,E2,8,4,"div"),n(13,"h6"),p(14,"Exclude Complementary"),a(),n(15,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ExcludeComplementary,t)||(l.pageData.Filter.ExcludeComplementary=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),f("model",e.IsPredefined),c("options",e.RadioDateFilterType),o(),y(e.IsPredefined?10:-1),o(),y(e.IsPredefined?-1:11),o(),y(e.IsPredefined?12:-1),o(3),f("model",e.pageData.Filter.ExcludeComplementary)}}function V2(i,s){i&1&&(n(0,"th",28),p(1," Prev "),a())}function B2(i,s){i&1&&(n(0,"th",29),p(1," Now "),a())}function O2(i,s){i&1&&(n(0,"th",30),p(1," Orders "),a())}function L2(i,s){i&1&&(n(0,"th",32),p(1," Purchase "),a())}function R2(i,s){if(i&1&&(n(0,"th",33),p(1," Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function k2(i,s){if(i&1&&(n(0,"th",34),p(1," Purchase+Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function W2(i,s){if(i&1&&(n(0,"td",38),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function N2(i,s){if(i&1&&(n(0,"td",40),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,w2,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function A2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Count,".0-0")," ")}}function G2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function H2(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Q2(i,s){if(i&1&&(n(0,"td",38)(1,"a",41),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(11,T2,e.EntityID,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy")))("routerLink",M(15,P2)),o(4),F(g(6,9,e.SalesWithTax))}}function Y2(i,s){if(i&1&&(n(0,"tr")(1,"td",36),p(2),a(),S(3,W2,2,1,"td",38),S(4,N2,2,5,"td",40),S(5,A2,3,4,"td",38),n(6,"td",38),p(7),d(8,"quantityFraction"),a(),S(9,G2,3,3,"td",38),S(10,H2,3,3,"td",39),d(11,"HideSumZero"),S(12,Q2,7,16,"td",38),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(),y(r.data.WithCategory?-1:5),o(2),F(g(8,8,e.Quantity)),o(2),y(r.roleService.product.Cost?9:-1),o(),y(!r.data.WithCategory&&v(11,10,r.data.Data,"Tax")&&r.roleService.product.Cost?10:-1),o(2),y(!r.data.WithCategory&&r.roleService.product.Cost?12:-1)}}function j2(i,s){i&1&&b(0,"td",37)}function q2(i,s){i&1&&b(0,"td",37)}function U2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Count"),".0-0")," ")}}function z2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Sales"))," ")}}function K2(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function X2(i,s){if(i&1&&(n(0,"td",38)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function J2(i,s){if(i&1){let e=I();n(0,"content")(1,"div",23)(2,"div",24)(3,"table",25),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",26)(5,"tr")(6,"th",27),p(7,"Outlet"),a(),S(8,V2,2,0,"th",28),S(9,B2,2,0,"th",29),S(10,O2,2,0,"th",30),n(11,"th",31),p(12," Qty "),a(),S(13,L2,2,0,"th",32),S(14,R2,2,1,"th",33),d(15,"HideSumZero"),S(16,k2,2,1,"th",34),a()(),n(17,"tbody"),G(18,Y2,13,13,"tr",null,Y),a(),n(20,"tfoot")(21,"tr",35),b(22,"td",36),S(23,j2,1,0,"td",37),S(24,q2,1,0,"td",37),S(25,U2,4,7,"td",38),n(26,"td",38),p(27),d(28,"sum"),d(29,"quantityFraction"),a(),S(30,z2,4,6,"td",38),S(31,K2,4,6,"td",39),d(32,"HideSumZero"),S(33,X2,5,6,"td",38),a()()()()()()}if(i&2){let e=m();o(8),y(e.showCompareColumn?8:-1),o(),y(e.showCompareColumn?9:-1),o(),y(e.data.WithCategory?-1:10),o(3),y(e.roleService.product.Cost?13:-1),o(),y(!e.data.WithCategory&&v(15,13,e.data.Data,"Tax")&&e.roleService.product.Cost?14:-1),o(2),y(!e.data.WithCategory&&e.roleService.product.Cost?16:-1),o(2),H(e.data.Data),o(5),y(e.showCompareColumn?23:-1),o(),y(e.showCompareColumn?24:-1),o(),y(e.data.WithCategory?-1:25),o(2),D(" ",g(29,19,v(28,16,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?30:-1),o(),y(!e.data.WithCategory&&v(32,21,e.data.Data,"Tax")&&e.roleService.product.Cost?31:-1),o(2),y(!e.data.WithCategory&&e.roleService.product.Cost?33:-1)}}var Va=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/OutletPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Year=T.getFullYear(),this.Month=T.getMonth()+1,this.Months=V.Months,this.Months.forEach(Ze=>Ze.Label=Ze.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Comparison=0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Purchase Performance",exportTypes:[{ID:"ReportExport/OutletPerformancePurchase",Value:"Default",FileName:"Outlet Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){this.YearMonthToDateRange()}postInit(e){this.menuData.H=e?.PageTitle,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month-1,1),this.pageData.Filter.To=new Date(this.Year,this.Month,0)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Count":return V.compare(t.Count,l.Count,C);case"SalesWithTax":return V.compare(t.SalesWithTax,l.SalesWithTax,C);case"Quantity":return V.compare(t.Quantity,l.Quantity,C);case"SalesNet":return V.compare(t.Sales,l.Sales,C);case"SalesTaxNet":return V.compare(t.Sales,l.Sales,C);case"Tax":return V.compare(t.Tax,l.Tax,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-performance"]],standalone:!1,features:[W],decls:17,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","Date Filter",3,"modelChange","model","options"],["name","complementary",3,"modelChange","model"],["name","compare",3,"modelChange","model"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"freeze","header"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","100px"],["arrowPosition","before",1,"flex-right",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"flex-right",2,"width","150px",3,"mat-sort-header"],[1,"footer"],[1,"freeze","body"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[3,"queryParams","routerLink"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,F2,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()()()()(),n(13,"filters"),E(14,M2,16,10,"ng-template",null,0,O),a(),S(16,J2,34,24,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,D2)),o(3),c("routerLink",M(9,v2)),o(5),y(t.data?16:-1))},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,Ce,se,ei,re,oe,Z,ne],encapsulation:2})};var Z2=()=>["/menu/Reports/Purchases_Report/Outlet"],$2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],eS=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),tS=(i,s)=>({"text-danger":i,"text-success":s,"text-end":!0});function iS(i,s){if(i&1){let e=I();n(0,"button",24),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",25),p(2," Export"),a()}}function nS(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"From - To"),a(),n(2,"div")(3,"datepicker",29),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(4,"div",30)(5,"datepicker",31),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()}if(i&2){let e=m(3);o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function aS(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Year - Month"),a(),n(2,"div",32)(3,"div",33)(4,"ng-select",34),h("ngModelChange",function(t){u(e);let l=m(3);return x(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(3);return _(t.Year=null)}),a()(),n(5,"div",35)(6,"ng-select",36),h("ngModelChange",function(t){u(e);let l=m(3);return x(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(3);return _(t.Month=null)}),a()()()}if(i&2){let e=m(3);o(4),f("ngModel",e.Year),c("items",e.Years),o(2),f("ngModel",e.Month),c("items",e.Months)}}function oS(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Compare with Prev Month"),a(),n(2,"radio-options",37),h("modelChange",function(t){u(e);let l=m(3);return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a()}if(i&2){let e=m(3);o(2),f("model",e.isCompare)}}function rS(i,s){if(i&1){let e=I();n(0,"div")(1,"div",26)(2,"h6"),p(3,"Date Filter"),a(),n(4,"radio-options",27),h("modelChange",function(t){u(e);let l=m(2);return x(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),a(),S(5,nS,6,2),S(6,aS,7,4),n(7,"h6"),p(8,"Purchase Order Tag"),a(),n(9,"ng-select",28),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),S(10,oS,3,1),a()()}if(i&2){let e=m(2);o(4),f("model",e.IsPredefined),c("options",e.RadioDateFilterType),o(),y(e.IsPredefined?-1:5),o(),y(e.IsPredefined?6:-1),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(),y(e.IsPredefined?10:-1)}}function lS(i,s){i&1&&(n(0,"th",12),p(1,"Prev"),a())}function pS(i,s){i&1&&(n(0,"th",13),p(1,"Now"),a())}function mS(i,s){i&1&&(n(0,"th",17),p(1," \xB1 (%) "),a())}function sS(i,s){if(i&1&&(n(0,"td",22),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function cS(i,s){if(i&1&&(n(0,"td",38),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,eS,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function dS(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;c("ngClass",fe(5,tS,e.IsNegative,e.IsPositive)),o(),D(" ",v(2,2,e.Increase,".0-0")," ")}}function uS(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,sS,2,1,"td",22),S(4,cS,2,5,"td",38),n(5,"td",22),p(6),d(7,"number"),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a(),n(11,"td",22),p(12),d(13,"amountFraction"),a(),S(14,dS,3,8,"td",39),n(15,"td",23),p(16),d(17,"amountFraction"),a(),n(18,"td",22),p(19),d(20,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(2),F(v(7,9,e.Count,".0-0")),o(3),F(g(10,12,e.Quantity)),o(3),F(g(13,14,e.Sales)),o(2),y(r.showCompareColumn?14:-1),o(2),F(g(17,16,e.Tax)),o(3),D(" ",g(20,18,e.SalesWithTax)," ")}}function _S(i,s){i&1&&b(0,"td",21)}function gS(i,s){i&1&&b(0,"td",21)}function CS(i,s){i&1&&b(0,"td")}function fS(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,iS,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Month "),a()()()()(),n(13,"filters"),E(14,rS,11,7,"ng-template",null,0,O),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr")(21,"th",11),p(22,"Outlet"),a(),S(23,lS,2,0,"th",12),S(24,pS,2,0,"th",13),n(25,"th",14),p(26,"Orders "),a(),n(27,"th",15),p(28," Quantity"),a(),n(29,"th",16),p(30," Purchase"),a(),S(31,mS,2,0,"th",17),n(32,"th",18),p(33,"Tax"),a(),n(34,"th",19),p(35,"Purchase + Tax"),a()()(),n(36,"tbody"),G(37,uS,21,20,"tr",null,Y),a(),n(39,"tfoot")(40,"tr",20),S(41,_S,1,0,"td",21),S(42,gS,1,0,"td",21),b(43,"td",21),n(44,"td",22),p(45),d(46,"sum"),d(47,"number"),a(),n(48,"td",22),p(49),d(50,"sum"),d(51,"quantityFraction"),a(),n(52,"td",22),p(53),d(54,"sum"),d(55,"amountFraction"),a(),S(56,CS,1,0,"td"),n(57,"td",23),p(58),d(59,"sum"),d(60,"amountFraction"),a(),n(61,"td",22)(62,"a"),p(63),d(64,"sum"),d(65,"amountFraction"),a()()()()()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(6),c("routerLink",M(46,Z2)),o(3),c("routerLink",M(47,$2)),o(12),y(e.showCompareColumn?23:-1),o(),y(e.showCompareColumn?24:-1),o(7),y(e.showCompareColumn?31:-1),o(),c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet"),o(2),c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet"),o(3),H(e.data==null?null:e.data.Data),o(4),y(e.showCompareColumn?41:-1),o(),y(e.showCompareColumn?42:-1),o(3),F(v(47,23,v(46,20,e.data==null?null:e.data.Data,"Count"),".0-0")),o(4),F(g(51,29,v(50,26,e.data==null?null:e.data.Data,"Quantity"))),o(4),D(" ",g(55,34,v(54,31,e.data==null?null:e.data.Data,"Sales"))," "),o(3),y(e.showCompareColumn?56:-1),o(2),D(" ",g(60,39,v(59,36,e.data==null?null:e.data.Data,"Tax"))," "),o(5),F(g(65,44,v(64,41,e.data==null?null:e.data.Data,"SalesWithTax")))}}var Ba=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/OutletGroupPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Year=T.getFullYear(),this.Month=T.getMonth(),this.Months=V.Months,this.Months.forEach(Ze=>Ze.Label=Ze.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}];first=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Purchase Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformancePurchase",Value:"Default",FileName:"Outlet Group Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.first&&(this.YearMonthToDateRange(),this.first=!1)}postInit(){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Count":return this.compare(t.Count,l.Count,C);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"SalesNet":return this.compare(t.Sales,l.Sales,C);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-group-performance"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],[1,"text-end",2,"width","100px"],["arrowPosition","before",1,"text-end",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"text-end",2,"width","150px",3,"mat-sort-header"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","Date Filter",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModelChange","change","clear","ngModel","items"],["name","compare",3,"modelChange","model"],[1,"text-end",3,"ngClass"],[3,"ngClass"]],template:function(r,t){r&1&&S(0,fS,66,48,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,se,re,Z,ne],encapsulation:2})};var xS=()=>["/menu/Reports/Purchases_Report/Outlet"],hS=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"];function SS(i,s){if(i&1){let e=I();n(0,"button",12),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",13),p(2," Export"),a()}}function yS(i,s){if(i&1){let e=I();n(0,"div")(1,"div",14)(2,"h6"),p(3,"Year"),a(),n(4,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(5,"h6"),p(6,"Purchase Order Tag"),a(),n(7,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function DS(i,s){if(i&1&&(n(0,"th",11),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function vS(i,s){if(i&1&&(n(0,"p",17),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(r[e])}}function wS(i,s){if(i&1&&(n(0,"p",17),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(g(2,1,r[e]))}}function TS(i,s){if(i&1&&(n(0,"td"),S(1,vS,2,1,"p",17),S(2,wS,3,3,"p",17),a()),i&2){let e=s.$implicit;o(),y(e=="Outlet"?1:-1),o(),y(e!="Outlet"?2:-1)}}function PS(i,s){if(i&1&&(n(0,"tr"),G(1,TS,3,2,"td",null,Y),a()),i&2){let e=s.$implicit,r=m(2);o(),H(r.getKey(e))}}function FS(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),F(g(2,1,e))}}function IS(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",18)(2,"td"),p(3,"Total : "),a(),G(4,FS,3,3,"td",null,Y),a()()),i&2){let e=m(2);o(4),H(e.data.DataFooter)}}function bS(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,SS,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," Outlet Report By "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Outlet Group "),a()()()()(),n(13,"filters"),E(14,yS,8,4,"ng-template",null,0,O),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr"),G(21,DS,2,2,"th",11,Y),a()(),n(23,"tbody"),G(24,PS,3,0,"tr",null,Y),a(),S(26,IS,6,0,"tfoot"),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,xS)),o(3),c("routerLink",M(9,hS)),o(10),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?26:-1)}}var Oa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/MonthlyOutletPerformancePurchase","ReportLoader/MonthlyReportPurchase");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0)}Years;openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Monthly Purchase Performance",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformancePurchase",Value:"Default",FileName:"Outlet Group Monthly Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((l,C)=>{let T=e.direction==="asc";for(let Ze=0;Ze<this.data.Dataheader.length;Ze++)if(e.active==this.data.Dataheader[Ze])return typeof l[this.data.Dataheader[Ze]]=="string"?t(l[this.data.Dataheader[Ze]].toLocaleLowerCase(),C[this.data.Dataheader[Ze]].toLocaleLowerCase(),T):t(l[this.data.Dataheader[Ze]],C[this.data.Dataheader[Ze]],T)});function t(l,C,T){return(l<C?-1:1)*(T?1:-1)}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-monthly-performance"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","","id","tableGrid",1,"table",3,"matSortChange"],[1,"table-light"],[3,"mat-sort-header"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],[2,"color","black"],[1,"table-footer"]],template:function(r,t){r&1&&S(0,bS,27,10,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,$,L,R,pe,ge,Z],encapsulation:2})};var ES=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],MS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],VS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],BS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],OS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],LS=i=>({ID:i});function RS(i,s){if(i&1){let e=I();n(0,"a",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function kS(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",10),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",12)(8,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a(),n(9,"div")(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()()()}if(i&2){let e=m();o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(4),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function WS(i,s){if(i&1&&(n(0,"a",26),p(1),a()),i&2){let e=m().$implicit;c("queryParams",X(2,LS,e.CityID)),o(),F(e.CityName)}}function NS(i,s){if(i&1&&p(0),i&2){let e=m().$implicit;D(" ",e.CityName," ")}}function AS(i,s){if(i&1&&(n(0,"tr"),b(1,"td",25),n(2,"td"),S(3,WS,2,4,"a",26),S(4,NS,1,1),a(),b(5,"td",27),d(6,"number"),b(7,"td",27),d(8,"number"),b(9,"td",27),d(10,"number"),a()),i&2){let e=s.$implicit;o(),c("innerHtml",e.CityCode,Ee),o(2),y(e.CityID?3:-1),o(),y(e.CityID?-1:4),o(),c("innerHtml",g(6,6,e.Quantity),Ee),o(2),c("innerHtml",g(8,8,e.Total),Ee),o(2),c("innerHtml",g(10,10,e.Average),Ee)}}function GS(i,s){if(i&1){let e=I();n(0,"content")(1,"div",15)(2,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",17)(4,"tr")(5,"th",18),p(6,"Code"),a(),n(7,"th",19),p(8," Regional Name "),a(),n(9,"th",20),p(10," Quantity "),a(),n(11,"th",21),p(12," Total "),a(),n(13,"th",22),p(14," Avg. Price "),a()()(),n(15,"tbody"),G(16,AS,11,12,"tr",null,Y),a(),n(18,"tfoot")(19,"tr",23),b(20,"td",24),n(21,"td",24),p(22,"Total :"),a(),n(23,"td",24),p(24),d(25,"sum"),d(26,"quantityFraction"),a(),n(27,"td",24),p(28),d(29,"sum"),d(30,"amountFraction"),a(),n(31,"td",24),p(32),d(33,"sum"),d(34,"sum"),d(35,"amountFraction"),a()()()()()()}if(i&2){let e=m();o(16),H(e.data.List),o(8),D(" ",g(26,6,v(25,3,e.data.List,"Quantity"))," "),o(4),D(" ",g(30,11,v(29,8,e.data.List,"Total"))," "),o(4),D(" ",g(35,19,v(33,13,e.data.List,"Total")/v(34,16,e.data.List,"Quantity"))," ")}}var La=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/CitySales","ReportLoader/CitySalesLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}postInit(e){this.menuData.H=e.PageTitle}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"CityCode":return this.compare(t.CityCode,l.CityCode,C);case"CityName":return this.compare(t.CityName,l.CityName,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Average":return this.compare(t.Average,l.Average,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"City Report",exportTypes:[{ID:"ReportExport/CitySalesExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-city"]],standalone:!1,features:[W],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","CityCode",2,"width","80px"],["mat-sort-header","CityName",2,"width","220px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Average","arrowPosition","before",1,"flex-right",2,"width","100px"],[1,"table-footer"],[1,"text-end"],[3,"innerHtml"],["routerLink","/menu/Contacts/Option_Values/City/Form",3,"queryParams"],[1,"text-end",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,RS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,kS,13,6,"ng-template",null,0,O),a(),S(25,GS,36,21,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,ES)),o(3),c("routerLink",M(12,MS)),o(3),c("routerLink",M(13,VS)),o(3),c("routerLink",M(14,BS)),o(3),c("routerLink",M(15,OS)),o(5),y(t.data?25:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,Ce,se,re,Z,ne],encapsulation:2})};var HS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],QS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],YS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],jS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],qS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function US(i,s){if(i&1){let e=I();n(0,"a",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function zS(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",12)(8,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function KS(i,s){i&1&&(n(0,"th",20),p(1,"Cost"),a())}function XS(i,s){i&1&&(n(0,"th",20),p(1,"Profit"),a())}function JS(i,s){if(i&1&&(b(0,"td",28),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.Cost),Ee)}}function ZS(i,s){if(i&1&&(b(0,"td",27),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.Profit),Ee)}}function $S(i,s){if(i&1&&(n(0,"tr"),b(1,"td",25)(2,"td",26),d(3,"number"),b(4,"td",26),d(5,"quantityFraction"),b(6,"td",26),d(7,"amountFraction"),b(8,"td",27),d(9,"amountFraction"),S(10,JS,2,3,"td",28),S(11,ZS,2,3,"td",27),a()),i&2){let e=s.$implicit,r=m(2);o(),c("innerHtml",e.GroupName,Ee),o(),c("innerHtml",g(3,7,e.Count),Ee),o(2),c("innerHtml",g(5,9,e.Quantity),Ee),o(2),c("innerHtml",g(7,11,e.Gross),Ee),o(2),c("innerHtml",g(9,13,e.Sales),Ee),o(2),y(r.roleService.product.Cost?10:-1),o(),y(r.roleService.report.Profit?11:-1)}}function ey(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(3,4,v(2,1,e.data.Data,"Cost")))}}function ty(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(3,4,v(2,1,e.data.Data,"Profit")))}}function iy(i,s){if(i&1){let e=I();n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",17)(5,"tr")(6,"th",18),p(7,"Group Name"),a(),n(8,"th",19),p(9,"Orders"),a(),n(10,"th",20),p(11,"Quantity"),a(),n(12,"th",20),p(13,"Gross"),a(),n(14,"th",20),p(15,"Sales"),a(),S(16,KS,2,0,"th",20),S(17,XS,2,0,"th",20),a()(),n(18,"tbody"),G(19,$S,12,15,"tr",null,Y),a(),n(21,"tfoot")(22,"tr",21),b(23,"td",22),n(24,"td",22),p(25),d(26,"sum"),d(27,"number"),a(),n(28,"td",22),p(29),d(30,"sum"),d(31,"quantityFraction"),a(),n(32,"td",22),p(33),d(34,"sum"),d(35,"amountFraction"),a(),n(36,"td",23),p(37),d(38,"sum"),d(39,"amountFraction"),a(),S(40,ey,4,6,"td",24),S(41,ty,4,6,"td",23),a()()()()()()}if(i&2){let e=m();o(16),y(e.roleService.product.Cost?16:-1),o(),y(e.roleService.report.Profit?17:-1),o(2),H(e.data.Data),o(6),F(g(27,11,v(26,8,e.data.Data,"Count"))),o(4),F(g(31,16,v(30,13,e.data.Data,"Quantity"))),o(4),F(g(35,21,v(34,18,e.data.Data,"Gross"))),o(4),F(g(39,26,v(38,23,e.data.Data,"Sales"))),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.report.Profit?41:-1)}}var Ra=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/CustomerGroup","ReportLoader/CustomerGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}first=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Customer Group",exportTypes:[{ID:"ReportExport/CustomerGroup",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"GroupName":return this.compare(t.GroupName,l.GroupName,C);case"Trans":return this.compare(t.Trans,l.Trans,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Gross":return this.compare(t.Gross,l.Gross,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-customer-group"]],standalone:!1,features:[W],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],[1,"text-end","text-success",3,"innerHtml"],[1,"text-end","text-danger",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,US,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,zS,9,5,"ng-template",null,0,O),a(),S(25,iy,42,28,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,HS)),o(3),c("routerLink",M(12,QS)),o(3),c("routerLink",M(13,YS)),o(3),c("routerLink",M(14,jS)),o(3),c("routerLink",M(15,qS)),o(5),y(t.data?25:-1))},dependencies:[A,Q,J,L,R,pe,U,se,re,Z,ne],encapsulation:2})};var ny=()=>["/menu/Reports/Sales_Report/Standard/Person"],ay=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],oy=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],ry=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],ly=(i,s)=>({From:i,To:s});function py(i,s){if(i&1){let e=I();n(0,"a",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function my(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",15)(8,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function sy(i,s){i&1&&(n(0,"th",22),p(1," Profit "),a())}function cy(i,s){if(i&1&&(b(0,"td",33),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.ActualProfit),Ee)}}function dy(i,s){if(i&1&&(n(0,"tr"),b(1,"td",30)(2,"td",31),d(3,"number"),b(4,"td",31),d(5,"amountFraction"),b(6,"td",31),d(7,"amountFraction"),b(8,"td",31),d(9,"number"),E(10,cy,2,3,"td",32),a()),i&2){let e=s.$implicit,r=m(2);o(),c("innerHtml",e.Name,Ee),o(),c("innerHtml",g(3,6,e.InvoiceCount),Ee),o(2),c("innerHtml",g(5,8,e.NetRevenue),Ee),o(2),c("innerHtml",g(7,10,e.SalesTarget),Ee),o(2),c("innerHtml",v(9,12,e.Percentage,"1.0-2"),Ee),o(2),c("ngIf",r.roleService.report.Profit)}}function uy(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ActualProfit"))," ")}}function _y(i,s){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr",21)(6,"th"),p(7,"Group Name"),a(),n(8,"th",22),p(9,"Count"),a(),n(10,"th",22),p(11,"Actual"),a(),n(12,"th",22),p(13,"Target"),a(),n(14,"th",22)(15,"span",23),p(16," % "),a()(),E(17,sy,2,0,"th",24),a()(),n(18,"tbody"),E(19,dy,11,15,"tr",25),a(),n(20,"tfoot")(21,"tr",26),b(22,"td",27)(23,"td",27),n(24,"td",28),p(25),d(26,"sum"),d(27,"amountFraction"),a(),b(28,"td",27)(29,"td",27),E(30,uy,4,6,"td",29),a()()()()()()}if(i&2){let e=m();o(17),c("ngIf",e.roleService.report.Profit),o(2),c("ngForOf",e.data.Data),o(6),D(" ",g(27,7,v(26,4,e.data.Data,"GrossRevenue"))," "),o(5),c("ngIf",e.roleService.report.Profit)}}var ka=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/SalesGroup","ReportLoader/SalesGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}first=!0;preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/SalesGroup",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-group"]],standalone:!1,features:[W],decls:26,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"btn","btn-outline-secondary"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end",2,"width","120px"],["matTooltip","(Actual / Target) * 100","matTooltipPosition","above"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],["class","text-end text-success",3,"innerHtml",4,"ngIf"],[1,"text-end","text-success",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2),S(3,py,3,0,"a",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"Summary"),a()(),n(11,"li")(12,"a",7),p(13,"By Outlet"),a()(),n(14,"li")(15,"a",7),p(16,"By Employee"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),E(23,my,9,5,"ng-template",null,0,O),a(),E(25,_y,31,9,"content",9),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(3),y(t.roleService!=null&&t.roleService.global.Export?3:-1),o(6),c("routerLink",M(17,ny)),o(3),c("routerLink",M(18,ay)),o(3),c("routerLink",M(19,oy)),o(3),c("routerLink",M(20,ry))("queryParams",fe(21,ly,v(19,11,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),v(20,14,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,J,L,R,ie,pe,U,se,re,oe,Z],encapsulation:2})};var gy=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report/By_Outlet"],Cy=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],fy=i=>({ID:i});function xy(i,s){i&1&&(n(0,"a",5),p(1,"By Outlet"),a()),i&2&&c("routerLink",M(1,gy))}function hy(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function Sy(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div",10)(7,"div",11)(8,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()()(),n(9,"div",13)(10,"div",11)(11,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()(),n(12,"h6"),p(13,"Tax"),a(),n(14,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(15,"h6"),p(16,"Page Size"),a(),n(17,"input",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(5),f("date",e.pageData.Filter.From),o(3),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function yy(i,s){if(i&1&&b(0,"th",41),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function Dy(i,s){if(i&1&&(b(0,"td",46),d(1,"TaxDefault"),d(2,"amountFraction")),i&2){let e=s.index,r=m().$implicit,t=m(2);c("innerHtml",g(2,5,fi(1,1,t.data.Compenents,r,e)),Ee)}}function vy(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",42),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td"),p(9),a(),n(10,"td"),p(11),d(12,"date"),a(),n(13,"td",43),p(14),d(15,"amountFraction"),a(),n(16,"td",44),p(17),d(18,"amountFraction"),a(),E(19,Dy,3,7,"td",45),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(17,Cy))("queryParams",X(18,fy,e.ID)),o(),F(e.Number),o(2),F(e.Name),o(2),F(e.TaxName),o(2),F(v(12,10,e.Date,"dd MMM yyyy")),o(3),F(g(15,13,e.Sales)),o(3),D(" ",g(18,15,e.Tax)," "),o(2),c("ngForOf",r.getComponent(r.data))}}function wy(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e.SumTaxAmount)," ")}}function Ty(i,s){if(i&1){let e=I();n(0,"span",48),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport"))}),n(1,"i",49),p(2,"?"),a()()}}function Py(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function Fy(i,s){if(i&1){let e=I();n(0,"a",50),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",51),p(2," Next"),a()}}function Iy(i,s){if(i&1){let e=I();n(0,"a",52),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport",!0))}),b(1,"i",53),p(2," Show All"),a()}}function by(i,s){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr")(6,"th",21),p(7,"Outlet"),a(),n(8,"th",22),p(9,"Number"),a(),n(10,"th",23),p(11,"Name"),a(),n(12,"th",24),p(13," Type "),a(),n(14,"th",25),p(15,"Date"),a(),n(16,"th",26),p(17," Sales "),a(),n(18,"th",27),p(19," Tax "),a(),E(20,yy,1,1,"th",28),a()(),n(21,"tbody"),E(22,vy,20,20,"tr",29),a(),n(23,"tfoot")(24,"tr",30),b(25,"td",31),n(26,"td",32),p(27),d(28,"sum"),d(29,"amountFraction"),a(),n(30,"td",32),p(31),d(32,"sum"),d(33,"amountFraction"),a(),E(34,wy,3,3,"td",33),a()()()(),n(35,"div",34)(36,"div",35)(37,"div",36),p(38),d(39,"number"),E(40,Ty,3,0,"span",37)(41,Py,3,3,"span",4),p(42),a()(),n(43,"div",38),E(44,Fy,3,0,"a",39)(45,Iy,3,0,"a",40),a()()()()}if(i&2){let e=m();o(20),c("ngForOf",e.data.Compenents),o(2),c("ngForOf",e.infiniteList),o(5),D(" ",g(29,14,v(28,11,e.infiniteList,"Sales"))," "),o(4),D(" ",g(33,19,v(32,16,e.infiniteList,"Tax"))," "),o(3),c("ngForOf",e.data.Compenents),o(4),D(" Showing 1 - ",g(39,21,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Wa=class i extends vi{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesTaxReport","ReportLoader/GetTaxReport",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.toastrService=T}timeTo;timeFrom;getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),C);case"Number":return this.compare(t.Number,l.Number,C);case"Date":return this.compare(t.Date,l.Date,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Tax Report",exportTypes:[{ID:"ReportExport/GetSalesTaxReport",Value:"Default",FileName:"Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-tax-report"]],standalone:!1,features:[W],decls:8,vars:7,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3","matTooltipPosition","above","matTooltip","Tax Report By Outlet",3,"routerLink",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-3",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],["style","width: 150px","class","align-right text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more reports",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all reports",3,"click",4,"ngIf"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end",2,"width","150px"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more reports",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all reports",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,xy,2,2,"a",2)(3,hy,3,0,"a",3),a(),n(4,"filters"),E(5,Sy,18,10,"ng-template",null,0,O),a(),E(7,by,46,23,"content",4),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,Qe,L,R,ie,pe,ge,Ue,U,se,Fi,re,oe,Z],encapsulation:2})};var Ey=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report"];function My(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function Vy(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",10)(8,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Tax"),a(),n(11,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("clearable",!1)}}function By(i,s){i&1&&(n(0,"th",17),p(1,"Total Tax"),a())}function Oy(i,s){if(i&1&&b(0,"th",18),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function Ly(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),F(v(2,1,e.Tax,r.pageData.FractionDigit))}}function Ry(i,s){if(i&1&&(b(0,"td",18),d(1,"TaxDefault"),d(2,"number")),i&2){let e=s.$index,r=m().$implicit,t=m(2);c("innerHtml",v(2,5,fi(1,1,t.data.Compenents,r,e),t.pageData.FractionDigit),Ee)}}function ky(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),S(6,Ly,3,4,"td",23),G(7,Ry,3,8,"td",18,Y),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),F(v(5,3,e.Sales,r.pageData.FractionDigit)),o(2),y(r.data.Compenents.length==0?6:-1),o(),H(r.getComponent(e))}}function Wy(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Tax"),e.pageData.FractionDigit))}}function Ny(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.SumTaxAmount,r.pageData.FractionDigit)," ")}}function Ay(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",13),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",14)(3,"tr")(4,"th",15),p(5,"Outlet"),a(),n(6,"th",16),p(7,"Sales"),a(),S(8,By,2,0,"th",17),G(9,Oy,1,1,"th",18,Y),a()(),n(11,"tbody"),G(12,ky,9,6,"tr",null,Y),a(),n(14,"tfoot")(15,"tr",19),b(16,"td",20),n(17,"td",21),p(18),d(19,"sum"),d(20,"number"),a(),S(21,Wy,4,7,"td",21),G(22,Ny,3,4,"td",22,Y),a()()()()}if(i&2){let e=m();o(8),y(e.data.Compenents.length==0?8:-1),o(),H(e.data.Compenents),o(3),H(e.data.Data),o(6),F(v(20,6,v(19,3,e.data.Data,"Sales"),e.pageData.FractionDigit)),o(3),y(e.data.Compenents.length==0?21:-1),o(),H(e.data.Compenents)}}var Na=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetTaxReportbyOutlet","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}openExportModal(){this.matDialog.open(K,{data:{title:"Tax Report by Outlet",exportTypes:[{ID:"ReportExport/GetTaxReportbyOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.EntityName,l.EntityName,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-tax-report-by-outlet"]],standalone:!1,features:[W],decls:10,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-6",3,"routerLink"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items","clearable"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),p(3,"Tax Report"),a(),S(4,My,3,0,"a",3),a(),n(5,"filters"),E(6,Vy,12,8,"ng-template",null,0,O),a(),n(8,"content"),S(9,Ay,24,9,"div",4),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",M(8,Ey)),o(2),y(t.roleService!=null&&t.roleService.global.Export?4:-1),o(5),y(t.data?9:-1))},dependencies:[A,Q,$,J,L,R,ie,pe,ge,U,se,Fi,re],encapsulation:2})};var Gy=()=>["/menu/Products/Catalog/Variants/Info"],Hy=i=>({ID:i});function Qy(i,s){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Yy(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID)}}function jy(i,s){i&1&&(n(0,"th",26),p(1," Category "),a())}function qy(i,s){i&1&&(n(0,"th",27),p(1,"Code"),a())}function Uy(i,s){i&1&&(n(0,"th",28),p(1," Release Date "),a())}function zy(i,s){i&1&&(n(0,"th",29),p(1," Days Count "),a())}function Ky(i,s){i&1&&(n(0,"th",30),p(1," Last Sold "),a())}function Xy(i,s){i&1&&(n(0,"th",31),p(1," Last Purchased "),a())}function Jy(i,s){i&1&&(n(0,"th",32),p(1," Days Purchased "),a())}function Zy(i,s){i&1&&(n(0,"th",33),p(1," Qty "),a())}function $y(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Category)}}function eD(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function tD(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.Released?v(2,1,e.Released,"dd MMM yyyy"):"-"," ")}}function iD(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DaysCount!=null?g(2,1,e.DaysCount):"-"," ")}}function nD(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.LastSold?v(2,1,e.LastSold,"dd MMM yyyy"):"-"," ")}}function aD(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.LastPurchased?v(2,1,e.LastPurchased,"dd MMM yyyy"):"-"," ")}}function oD(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DaysSinceLastPurchased!=null?g(2,1,e.DaysSinceLastPurchased):"-"," ")}}function rD(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function lD(i,s){if(i&1&&(n(0,"tr",34),E(1,$y,2,1,"td",3),n(2,"td")(3,"a",35),p(4),a()(),E(5,eD,2,1,"td",3)(6,tD,3,4,"td",3)(7,iD,3,3,"td",36)(8,nD,3,4,"td",3)(9,aD,3,4,"td",3)(10,oD,3,3,"td",37)(11,rD,3,3,"td",38),a()),i&2){let e=s.$implicit,r=m(2);o(),c("ngIf",r.column.Category.selected),o(2),c("routerLink",M(11,Gy))("queryParams",X(12,Hy,e.ID)),o(),F(e.Name),o(),c("ngIf",r.column.Code.selected),o(),c("ngIf",r.column.ReleaseDate.selected),o(),c("ngIf",r.column.DaysCount.selected),o(),c("ngIf",r.column.LastSold.selected),o(),c("ngIf",r.column.LastPurchased.selected),o(),c("ngIf",r.column.DaysPurchased.selected),o(),c("ngIf",r.column.QTY.selected)}}function pD(i,s){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",15)(4,"tr"),E(5,jy,2,0,"th",16),n(6,"th",17),p(7,"Name"),a(),E(8,qy,2,0,"th",18)(9,Uy,2,0,"th",19)(10,zy,2,0,"th",20)(11,Ky,2,0,"th",21)(12,Xy,2,0,"th",22)(13,Jy,2,0,"th",23)(14,Zy,2,0,"th",24),a()(),n(15,"tbody"),E(16,lD,12,14,"tr",25),a()()()()}if(i&2){let e=m();o(5),c("ngIf",e.column.Category.selected),o(3),c("ngIf",e.column.Code.selected),o(),c("ngIf",e.column.ReleaseDate.selected),o(),c("ngIf",e.column.DaysCount.selected),o(),c("ngIf",e.column.LastSold.selected),o(),c("ngIf",e.column.LastPurchased.selected),o(),c("ngIf",e.column.DaysPurchased.selected),o(),c("ngIf",e.column.QTY.selected),o(2),c("ngForOf",e.oriData.Data)}}var Aa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/ProductLifeCycle","ReportLoader/ProductLifeCycle",C);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.toastrService=C}roleService=Pe(j);columnService=Pe(gt);column={Category:{selected:!1,name:"Category"},Code:{selected:!0,name:"Code"},ReleaseDate:{selected:!0,name:"Release Date"},DaysCount:{selected:!1,name:"Days Count"},LastSold:{selected:!0,name:"Last Sold"},LastPurchased:{selected:!0,name:"Last Purchased"},DaysPurchased:{selected:!1,name:"Days Purchased"},QTY:{selected:!0,name:"Quantity"}};oriData;sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.oriData;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc",T=typeof t[e.active];switch(V.IsEmpty(t.Code)&&(t.Code=""),V.IsEmpty(l.Code)&&(l.Code=""),V.IsEmpty(t.Released)&&(t.Release=""),V.IsEmpty(l.Released)&&(l.Release=""),V.IsEmpty(t.LastPurchased)&&(t.LastPurchased=""),V.IsEmpty(l.LastPurchased)&&(l.LastPurchased=""),V.IsEmpty(t.LastSold)&&(t.LastSold=""),V.IsEmpty(l.LastSold)&&(l.LastSold=""),T){case"string":return this.compare(t[e.active].toLocaleLowerCase(),l[e.active].toLocaleLowerCase(),C);case"number":return this.compare(t[e.active],l[e.active],C);default:return 0}})}preGetList(){this.pageData.Filter.EntityID||delete this.pageData.Filter.EntityID}postInit(e){this.oriData=e,console.log(e),this.menuData=nt(et({},this.menuData),{SH:e.PageTitle})}openExportModal(){this.matDialog.open(K,{data:{title:"Product Life Cycle",exportTypes:[{ID:"ReportExport/ProductLifeCycle",Value:"Default",FileName:"Product Life Cycle"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-life-cycle"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Category",4,"ngIf"],["mat-sort-header","Name"],["mat-sort-header","Code",4,"ngIf"],["mat-sort-header","Released",4,"ngIf"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above","mat-sort-header","DaysCount",4,"ngIf"],["mat-sort-header","LastSold",4,"ngIf"],["mat-sort-header","LastPurchased",4,"ngIf"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above","mat-sort-header","DaysSinceLastPurchased",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","flex-right text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["mat-sort-header","Category"],["mat-sort-header","Code"],["mat-sort-header","Released"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above","mat-sort-header","DaysCount"],["mat-sort-header","LastSold"],["mat-sort-header","LastPurchased"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above","mat-sort-header","DaysSinceLastPurchased"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right","text-end"],[1,"border-bottom"],[3,"routerLink","queryParams"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above",4,"ngIf"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above",4,"ngIf"],["class","text-end",4,"ngIf"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Qy,3,0,"a",2),a(),n(3,"filters"),E(4,Yy,15,8,"ng-template",null,0,O),a(),E(6,pD,17,9,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,J,L,R,ie,pe,ge,Ce,U,ze,re,oe,ne],encapsulation:2})};function mD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function sD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Supplier"),a(),n(14,"autocompleteV2",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(15,"h6"),p(16,"Row Count"),a(),n(17,"input",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function cD(i,s){i&1&&(n(0,"th",21),p(1,"Total Cost"),a())}function dD(i,s){i&1&&(n(0,"th",21),p(1,"Total profit "),a())}function uD(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalCost))}}function _D(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalProfit))}}function gD(i,s){if(i&1&&(n(0,"tr",23)(1,"td",24),p(2),a(),n(3,"td",24),p(4),a(),n(5,"td"),p(6),a(),n(7,"td"),p(8),a(),n(9,"td",25),p(10),d(11,"quantityFraction"),a(),n(12,"td",25),p(13),d(14,"quantityFraction"),a(),n(15,"td",25),p(16),d(17,"amountFraction"),a(),S(18,uD,3,3,"td",26),S(19,_D,3,3,"td",25),n(20,"td",25),p(21),d(22,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.PrevRank||"-"),o(2),F(e.Rank),o(2),F(e.Name),o(2),F(e.Code),o(2),F(g(11,10,e.Quantity)),o(3),F(g(14,12,e.OnHand)),o(3),F(g(17,14,e.TotalAmount)),o(2),y(r.roleService.product.Cost?18:-1),o(),y(r.roleService.report.Profit?19:-1),o(2),F(g(22,16,e.Margin))}}function CD(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data,"TotalCost")))}}function fD(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data,"TotalProfit")))}}function xD(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",27),b(2,"td",28),n(3,"td",29),p(4,"Total:"),a(),n(5,"td",29),p(6),d(7,"sum"),d(8,"quantityFraction"),a(),n(9,"td",29),p(10),d(11,"sum"),d(12,"quantityFraction"),a(),n(13,"td",29),p(14),d(15,"sum"),d(16,"amountFraction"),a(),S(17,CD,4,6,"td",29),S(18,fD,4,6,"td",29),a()()),i&2){let e=m(2);o(6),F(g(8,8,v(7,5,e.data,"Quantity"))),o(4),F(g(12,13,v(11,10,e.data,"OnHand"))),o(4),F(g(16,18,v(15,15,e.data,"TotalAmount"))),o(3),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.report.Profit?18:-1)}}function hD(i,s){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",16)(5,"tr")(6,"th",17),p(7,"Prev"),a(),n(8,"th",17),p(9,"Now"),a(),n(10,"th",18),p(11,"Name"),a(),n(12,"th",19),p(13,"Code"),a(),n(14,"th",17),p(15,"Sold"),a(),n(16,"th",20),p(17,"On Hand"),a(),n(18,"th",21),p(19,"Total Amount"),a(),S(20,cD,2,0,"th",21),S(21,dD,2,0,"th",21),n(22,"th",22),p(23,"%"),a()()(),n(24,"tbody"),G(25,gD,23,18,"tr",23,Y),a(),S(27,xD,19,20,"tfoot"),a()()()()}if(i&2){let e=m();o(20),y(e.roleService.product.Cost?20:-1),o(),y(e.roleService.report.Profit?21:-1),o(4),H(e.data.Data),o(2),y(e.data.length>0?27:-1)}}var Ga=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetReportProductProfit","ReportLoader/GetReportProductProfit",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.toastrService=T}RadioGroupBy=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];originalData;openExportModal(){this.matDialog.open(K,{data:{title:"Product Profit Report",exportTypes:[{ID:"ReportExport/GetReportProductProfit",Value:"Default",FileName:"Product Profit Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.originalData=e.Data}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";return this.compare(t[e.active],l[e.active],C)})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-profit"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","100px"],[2,"width","600px"],[2,"width","100px"],["matTooltip","On Hand Inventory",1,"text-end",2,"width","200px"],[1,"text-end",2,"width","200px"],["mat-sort-header","Margin",1,"text-end","align-right",2,"width","200px"],[1,"border-bottom"],[1,"text-end",2,"width","35px"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,mD,3,0,"a",2),a(),n(3,"filters"),E(4,sD,18,10,"ng-template",null,0,O),a(),S(6,hD,28,3,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,ie,pe,ge,Ue,Ae,Ce,U,se,Z,ne],encapsulation:2})};var SD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],yD=i=>({ID:i});function DD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function vD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function wD(i,s){if(i&1&&(n(0,"tr",14)(1,"td")(2,"a",15),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),a(),n(8,"td"),p(9),d(10,"quantityFraction"),a(),n(11,"td"),p(12),d(13,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(11,SD))("queryParams",X(12,yD,e.ID)),o(),F(e.InvoiceNumber),o(2),F(e.Name),o(2),F(e.Code),o(2),F(g(10,7,e.Quantity)),o(3),F(g(13,9,e.Price))}}function TD(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"table",12)(3,"thead",13)(4,"tr")(5,"th"),p(6,"Number"),a(),n(7,"th"),p(8,"Name"),a(),n(9,"th"),p(10,"Code"),a(),n(11,"th"),p(12,"Quantity"),a(),n(13,"th"),p(14,"Price"),a()()(),n(15,"tbody"),G(16,wD,14,14,"tr",14,Y),a()()()()),i&2){let e=m();o(16),H(e.data.Data)}}var Ha=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetExchangedSales","ReportLoader/GetExchangedSales",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.toastrService=T}openExportModal(){this.matDialog.open(K,{data:{title:"Exchanged Sales Report",exportTypes:[{ID:"ReportExport/GetExchangedSales",Value:"Default",FileName:"Exchanged Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-exchanged-sales"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border-bottom"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,DD,3,0,"a",2),a(),n(3,"filters"),E(4,vD,12,7,"ng-template",null,0,O),a(),S(6,TD,18,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ce,U,Z,ne],encapsulation:2})};function PD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function FD(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product by Name"),a(),n(3,"autocompleteV2",12),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("ngModel",e.pageData.Filter.ProductID)}}function ID(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product by Code"),a(),n(3,"autocompleteV2",13),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("ngModel",e.pageData.Filter.ProductID)}}function bD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",7),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",8)(8,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Search By"),a(),n(11,"radio-options",10),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SearchBy,t)||(l.pageData.Filter.SearchBy=t),_(t)}),a(),S(12,FD,4,1,"div"),S(13,ID,4,1,"div"),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.SearchBy),c("options",e.RadioSearchBy),o(),y(e.pageData.Filter.SearchBy?12:-1),o(),y(e.pageData.Filter.SearchBy?-1:13),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function ED(i,s){if(i&1&&(n(0,"tr",20)(1,"td",21),p(2),a(),n(3,"td"),p(4),a(),n(5,"td",21),p(6),d(7,"quantityFraction"),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a()()),i&2){let e=s.$implicit;o(2),F(e.Rank),o(2),F(e.Name),o(2),F(g(7,4,e.Quantity)),o(3),F(g(10,6,e.OnHand))}}function MD(i,s){if(i&1&&(n(0,"content")(1,"div",14)(2,"table",15)(3,"thead",16)(4,"tr")(5,"th",17),p(6,"Rank"),a(),n(7,"th",18),p(8,"Name"),a(),n(9,"th",19),p(10,"Sold"),a(),n(11,"th",19),p(12,"Inventory"),a()()(),n(13,"tbody"),G(14,ED,11,8,"tr",20,Y),a()()()()),i&2){let e=m();o(14),H(e.data.Data)}}var Qa=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesRankByVariantModel","ReportLoader/GetSalesRankByVariantModel",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.toastrService=T}RadioSearchBy=[{Key:!0,Value:"Name"},{Key:!1,Value:"Code"}];openExportModal(){this.matDialog.open(K,{data:{title:"Variant Model Rank Report",exportTypes:[{ID:"ReportExport/GetSalesRankByVariantModel",Value:"Default",FileName:"Variant Model Rank Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-variant-model-rank"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Search By",3,"modelChange","model","options"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestion","placeholder","Search by Name",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCode","placeholder","Search by Code",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","70px"],[2,"width","800px"],[1,"text-end",2,"width","100px"],[1,"border-bottom"],[1,"text-end"],[1,"text-success","text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,PD,3,0,"a",2),a(),n(3,"filters"),E(4,bD,17,11,"ng-template",null,0,O),a(),S(6,MD,16,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,Ue,Te,Ae,U,ne],encapsulation:2})};var VD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],BD=i=>({ID:i});function OD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function LD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function RD(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",20),p(5),a()(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),a(),n(11,"td"),p(12),a(),n(13,"td",16),p(14),d(15,"quantityFraction"),a(),n(16,"td",16),p(17),d(18,"amountFraction"),a(),n(19,"td",21),p(20),a(),n(21,"td",16),p(22),d(23,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(e.EntityName),o(2),c("routerLink",M(20,VD))("queryParams",X(21,BD,e.InvoiceID)),o(),F(e.Number),o(2),F(v(8,11,e.Date,"dd MMM yyyy")),o(3),F(e.Name),o(2),F(e.Code),o(2),D("(",g(15,14,e.Quantity),")"),o(3),F(g(18,16,e.UnitPrice)),o(3),D("",e.Discount&&e.Discount!=0?-e.Discount+"%":""," "),o(2),D("(",g(23,18,e.Total),")")}}function kD(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"div",12)(3,"table",13)(4,"thead",14)(5,"tr")(6,"th"),p(7,"Outlet"),a(),n(8,"th",15),p(9,"Number"),a(),n(10,"th"),p(11,"Date"),a(),n(12,"th"),p(13,"Name"),a(),n(14,"th"),p(15,"Code"),a(),n(16,"th",16),p(17,"Quantity"),a(),n(18,"th",16),p(19),a(),n(20,"th",17),p(21,"%"),a(),n(22,"th",16),p(23),a()()(),n(24,"tbody"),G(25,RD,24,23,"tr",null,Y),a(),n(27,"tfoot")(28,"tr",18),b(29,"td",19)(30,"td",19)(31,"td",19)(32,"td",19)(33,"td",19),n(34,"td",16),p(35),d(36,"sum"),d(37,"quantityFraction"),a(),b(38,"td",19)(39,"td",19),n(40,"td",16),p(41),d(42,"sum"),d(43,"amountFraction"),a()()()()()()()),i&2){let e=m();o(19),D("Price (",e.data.CurrencySymbol,")"),o(4),D("Total(",e.data.CurrencySymbol,")"),o(2),H(e.data.Data),o(10),F(g(37,7,v(36,4,e.data.Data,"Quantity"))),o(6),F(g(43,12,v(42,9,e.data.Data,"Total")))}}var Ya=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/SalesReturnList","ReportLoader/ReturnReportLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}month;year;openExportModal(){this.matDialog.open(K,{data:{title:"Sales Return",exportTypes:[{ID:"ReportExport/SalesReturnExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.menuData.H=e.PageTitle}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-return"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end"],[2,"width","30px"],[1,"table-footer"],[1,"empty-column"],[3,"routerLink","queryParams"],[1,"text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,OD,3,0,"a",2),a(),n(3,"filters"),E(4,LD,12,6,"ng-template",null,0,O),a(),S(6,kD,44,14,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ae,U,se,oe,Z,ne],encapsulation:2})};var WD=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],ND=i=>({ID:i});function AD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function GD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Supplier"),a(),n(6,"autocompleteV2",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function HD(i,s){i&1&&(n(0,"th",15),p(1,"Unit Cost"),a())}function QD(i,s){if(i&1&&(b(0,"td",36),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.UnitPrice),Ee)}}function YD(i,s){if(i&1&&(n(0,"tr",24)(1,"td",31),b(2,"span",32),a(),b(3,"td",33),n(4,"td",34),p(5),d(6,"quantityFraction"),a(),b(7,"td",35),S(8,QD,2,3,"td",36),n(9,"td",37),p(10),d(11,"amountFraction"),a(),b(12,"td",36),d(13,"amountFraction"),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("innerHtml",e.Name,Ee),o(),c("innerHtml",e.Code,Ee),o(2),D("(",g(6,7,e.Quantity),")"),o(2),c("innerHtml",e.UOMName,Ee),o(),y(r.roleService.product.Cost?8:-1),o(2),D(" ",e.Discount==0?"":"-"+g(11,9,e.Discount)+"%"),o(2),c("innerHtml",g(13,11,e.Total),Ee)}}function jD(i,s){i&1&&(n(0,"td",28),p(1,"\xA0"),a())}function qD(i,s){if(i&1&&(n(0,"div")(1,"div",18)(2,"a",19),b(3,"span",20),d(4,"date"),d(5,"date"),a(),n(6,"span"),p(7),d(8,"showIfNotNullOrEmptyString"),a()(),b(9,"span",21),n(10,"div",22)(11,"div")(12,"table",23),b(13,"thead"),n(14,"tbody"),G(15,YD,14,13,"tr",24,Y),a()()()(),n(17,"table",25)(18,"thead")(19,"tr",26)(20,"td",27),p(21,"Total"),a(),n(22,"td",28),p(23,"\xA0"),a(),n(24,"td",15),p(25),d(26,"sum"),d(27,"quantityFraction"),a(),b(28,"td",29),S(29,jD,2,0,"td",28),n(30,"td",30),p(31,"\xA0"),a(),n(32,"td",15),p(33),d(34,"sum"),d(35,"amountFraction"),a()()()()()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(27,WD))("queryParams",X(28,ND,e.InvoiceID)),o(),c("innerHtml",e.EntityName+" #"+e.Number+" - "+v(4,8,e.Date,"dd MMM yyyy")+" ("+v(5,11,e.Created,"HH:mm")+")",Ee),o(4),D(" ",v(8,14,e.CustomerNameDisplay," - {0}")," "),o(2),c("innerHtml",e.Note,Ee),o(6),H(e.Item),o(10),D("",g(27,20,v(26,17,e.Item,"Quantity")),"\xA0"),o(4),y(r.roleService.product.Cost?29:-1),o(4),D("",g(35,25,v(34,22,e.Item,"Total")),"\xA0 ")}}function UD(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"table",12)(3,"thead",13)(4,"tr")(5,"th"),p(6,"Name"),a(),n(7,"th",14),p(8,"Code"),a(),n(9,"th",15),p(10,"Quantity"),a(),n(11,"th",16),p(12,"UOM"),a(),S(13,HD,2,0,"th",15),n(14,"th",17),p(15,"%"),a(),n(16,"th",15),p(17,"Total(Rp.)"),a()()()(),G(18,qD,36,30,"div",null,Y),a()()),i&2){let e=m();o(13),y(e.roleService.product.Cost?13:-1),o(5),H(e.data.Data)}}var ja=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/PurchaseReturnList","ReportLoader/ReturnReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Return",exportTypes:[{ID:"ReportExport/PurchaseReturnList",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-return"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"UOMWidth",2,"width","50px"],[2,"width","5%"],[1,"mt-7"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHtml"],[1,"mt-3","mb-3",3,"innerHtml"],[1,"items"],["cellspacing","0",1,"table","table-sm"],[1,"border-top"],[1,"w-100"],[1,"table-footer"],[1,"empty-column"],[1,"empty-column",2,"width","10%"],[1,"empty-column",2,"width","50px"],[1,"empty-column",2,"width","5%"],[1,"border-start","border-end"],[3,"innerHtml"],[1,"border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%"],[1,"UOMWidth","border-start","border-end",2,"width","50px",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"small","text-danger","border-start","border-end",2,"width","5%"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,AD,3,0,"a",2),a(),n(3,"filters"),E(4,GD,12,6,"ng-template",null,0,O),a(),S(6,UD,20,1,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ae,U,se,On,oe,Z,ne],encapsulation:2})};var zD=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],KD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],dl=i=>({ID:i});function XD(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.exportCSV(t.csvConverter,"Report/ProductSalesByInvoice","Invoice_Item_Details.csv"))}),b(1,"i",6),p(2," Export"),a()}}function JD(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Customer"),a(),n(12,"autocompleteV2",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(13,"h6"),p(14,"Page Size"),a(),n(15,"input",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(20,"div",14)(21,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(22,"h6"),p(23,"Product"),a(),n(24,"autocompleteV2",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a(),n(25,"h6"),p(26,"Variant"),a(),n(27,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.RowCount),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("inputTextValue",e.pageData.Filter.ProductName),f("ngModel",e.pageData.Filter.ProductID),o(3),c("inputTextValue",e.pageData.Filter.VariantName)("renderThumbnail",!0),f("ngModel",e.pageData.Filter.VariantID)}}function ZD(i,s){i&1&&(n(0,"th",23),p(1," Batch Number "),a())}function $D(i,s){i&1&&(n(0,"th",27),p(1," Cost "),a())}function ev(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.SerialBatchNumber)}}function tv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.UnitCost,r.pageData.FractionDigit)," ")}}function iv(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td"),p(4),d(5,"date"),a(),n(6,"td")(7,"a",32),p(8),a()(),S(9,ev,2,1,"td"),n(10,"td")(11,"div",33)(12,"a",34),p(13),a(),n(14,"small",35),p(15),a()()(),n(16,"td"),p(17),a(),n(18,"td",36),p(19),d(20,"number"),a(),S(21,tv,3,4,"td",36),n(22,"td",36),p(23),d(24,"number"),a(),n(25,"td",36),p(26),d(27,"number"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Outlet),o(2),F(v(5,16,e.Date,"dd MMM yy")),o(3),c("routerLink",M(27,KD))("queryParams",X(28,dl,e.InvoiceID)),o(),F(e.Number),o(),y(r.showBatchNumber?9:-1),o(3),c("queryParams",X(30,dl,e.CustomerID)),o(),F(e.CustomerName),o(),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),F(e.Code),o(2),F(e.SalesPerson),o(2),$t(" ",g(20,19,e.Quantity),"",e.UnitQuantity!=1?" x "+e.UnitQuantity:""," "),o(2),y(r.roleService.product.Cost?21:-1),o(2),D(" ",v(24,21,e.UnitPrice,r.pageData.FractionDigit)," "),o(3),D(" ",v(27,24,e.Total,r.pageData.FractionDigit)," ")}}function nv(i,s){i&1&&b(0,"td",39)}function av(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",37)(2,"td",38),p(3," Total: "),a(),n(4,"td",36),p(5),d(6,"sum"),d(7,"number"),a(),S(8,nv,1,0,"td",39),b(9,"td",39),n(10,"td",36),p(11),d(12,"sum"),d(13,"number"),a()()()),i&2){let e=m(2);o(2),c("colSpan",e.showBatchNumber?6:5),o(3),F(g(7,7,v(6,4,e.data.Data,"Quantity"))),o(3),y(e.roleService.product.Cost?8:-1),o(3),D(" ",v(13,12,v(12,9,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function ov(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5," Outlet "),a(),n(6,"th",21),p(7," Date "),a(),n(8,"th",22),p(9," Invoice # "),a(),S(10,ZD,2,0,"th",23),n(11,"th",24),p(12,"Customer"),a(),n(13,"th",25),p(14," SALES PERSON "),a(),n(15,"th",26),p(16," Qty "),a(),S(17,$D,2,0,"th",27),n(18,"th",28),p(19," Price "),a(),n(20,"th",29),p(21," Total "),a()()(),n(22,"tbody"),G(23,iv,28,32,"tr",null,Y),a(),S(25,av,14,15,"tfoot"),a(),n(26,"div",30)(27,"POS-complex-pagination",31),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=m();o(10),y(e.showBatchNumber?10:-1),o(7),y(e.roleService.product.Cost?17:-1),o(6),H(e.data.Data),o(2),y(e.data.Data.length>0?25:-1),o(2),c("total",e.data.Data.length)("pageData",e.pageData)}}var qa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/ProductSalesByInvoice","ReportLoader/ProductSalesByInvoice",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=C}originalData;showBatchNumber=!0;maskingFields;maskingFieldMsg=Rn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.menuData.H=this.pageData.PageTitle,this.originalData=e.Data,this.initShowBatchNumber()}initShowBatchNumber(){let e=this.data?.Data[0]?.SerialBatchNumber;this.showBatchNumber=e!=null}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.Outlet,l.Outlet,C);case"Date":return this.compare(t.Date,l.Date,C);case"Number":return this.compare(t.Number,l.Number,C);case"SerialBatchNumber":return this.compare(t.SerialBatchNumber,l.SerialBatchNumber,C);case"CustomerName":return this.compare(t.CustomerName,l.CustomerName,C);case"SalesPerson":return this.compare(t.SalesPerson,l.SalesPerson,C);case"UnitCost":return this.compare(t.UnitCost,l.UnitCost,C);case"UnitPrice":return this.compare(t.UnitPrice,l.UnitPrice,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Discount":return this.compare(t.Discount,l.Discount,C);case"Total":return this.compare(t.TotalAfterDiscount,l.TotalAfterDiscount,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-invoice-items"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100",3,"ngModelChange","ngModel"],["type","text","autoNum","","min","0",1,"w-100",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search by Product",1,"w-100",3,"ngModelChange","inputTextValue","ngModel"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search by Variant",1,"w-100",3,"ngModelChange","inputTextValue","renderThumbnail","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet","width","100px",1,"align-left"],["mat-sort-header","Date",1,"align-left",2,"width","80px"],["mat-sort-header","Number",1,"align-left",2,"width","120px"],["mat-sort-header","SerialBatchNumber",1,"align-left"],["mat-sort-header","CustomerName",1,"align-left"],["mat-sort-header","SalesPerson",1,"align-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","60px"],["mat-sort-header","UnitCost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"d-sm-block","mt-2"],["api","Report/ProductSalesByInvoiceCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["target","_blank",3,"routerLink","queryParams"],[1,"w-100"],["routerLink","/menu/Contacts/Contact/Customers/Info","target","_blank",1,"d-block",3,"queryParams"],["matTooltipPosition","above",1,"opacity-75","d-inline",3,"matTooltip"],[1,"text-end"],[1,"table-footer"],[1,"text-end","empty-column",3,"colSpan"],[1,"empty-column"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,XD,3,0,"a",2),n(3,"a",3),p(4,"Group by Product"),a()(),n(5,"filters"),E(6,JD,28,16,"ng-template",null,0,O),a(),n(8,"content"),S(9,ov,28,5,"div",4),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,zD)),o(6),y(t.data?9:-1))},dependencies:[A,Q,J,Qe,L,R,ie,pe,ge,Ue,Ae,Et,Ce,U,ze,se,re,oe],encapsulation:2})};var rv=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],lv=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],pv=()=>["/menu/Contacts/Contact/Customers/Info"],mv=i=>({ID:i}),ul=(i,s)=>({"text-danger":i,"text-success":s});function sv(i,s){if(i&1){let e=I();n(0,"a",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function cv(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Brand"),a(),n(3,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListBrandID,t)||(l.pageData.Filter.ListBrandID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",15)(9,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Row Count"),a(),n(12,"input",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0),f("ngModel",e.pageData.Filter.ListBrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brand),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function dv(i,s){i&1&&(n(0,"th",27),p(1,"Total Cost "),a())}function uv(i,s){i&1&&(n(0,"th",28),p(1,"Profit"),a())}function _v(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalCost?e.TotalCost:0))}}function gv(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,ul,e.Profit<0,e.Profit>0)),o(),D(" ",g(2,2,e.Profit))}}function Cv(i,s){if(i&1&&(n(0,"tr")(1,"td",33),p(2),a(),n(3,"td",34),p(4),d(5,"quantityFraction"),a(),n(6,"td",35),p(7),d(8,"amountFraction"),a(),S(9,_v,3,3,"td",36),S(10,gv,3,7,"td",37),a()),i&2){let e=s.$implicit,r=m(3);o(2),D("",e.BrandName," "),o(2),D(" ",g(5,5,e.Quantity?e.Quantity:0)),o(3),D(" ",g(8,7,e.TotalSales?e.TotalSales:0)),o(2),y(r.roleService.product.Cost?9:-1),o(),y(r.roleService.report.Profit?10:-1)}}function fv(i,s){if(i&1&&(n(0,"tr",29)(1,"td")(2,"a",30),p(3),a()(),n(4,"td",21),p(5),a(),n(6,"td",22),p(7),a(),n(8,"td",23),p(9),a(),n(10,"td",31)(11,"table",32),G(12,Cv,11,9,"tr",null,Y),a()()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(7,pv))("queryParams",X(8,mv,e.CustomerID)),o(),$t(" ",e.Name," ",e.Title," "),o(2),F(e.Email),o(2),F(e.Mobile),o(2),F(e.City),o(3),H(e.Detail)}}function xv(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Total.TotalCost)," ")}}function hv(i,s){if(i&1&&(n(0,"td",42),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(4,ul,e.data.Total.Profit<0,e.data.Total.Profit>0)),o(),D(" ",g(2,2,e.data.Total.Profit)," ")}}function Sv(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",38),b(2,"td",39),n(3,"td",40),p(4),d(5,"quantityFraction"),a(),n(6,"td",40),p(7),d(8,"amountFraction"),a(),S(9,xv,3,3,"td",41),S(10,hv,3,7,"td",42),a()()),i&2){let e=m(2);o(4),D(" ",g(5,4,e.data.Total.Quantity)," "),o(3),D(" ",g(8,6,e.data.Total.TotalSales)," "),o(2),y(e.roleService.product.Cost?9:-1),o(),y(e.roleService.report.Profit?10:-1)}}function yv(i,s){if(i&1){let e=I();n(0,"div",8)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Customer "),a(),n(6,"th",21),p(7,"Email"),a(),n(8,"th",22),p(9,"Mobile"),a(),n(10,"th",23),p(11,"City"),a(),n(12,"th",24),p(13,"Brand"),a(),n(14,"th",25),p(15," Qty "),a(),n(16,"th",26),p(17,"Total Sales "),a(),S(18,dv,2,0,"th",27),S(19,uv,2,0,"th",28),a()(),n(20,"tbody"),G(21,fv,14,10,"tr",29,Y),a(),S(23,Sv,11,8,"tfoot"),a()()}if(i&2){let e=m();o(18),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.report.Profit?19:-1),o(2),H(e.data.Data),o(2),y(e.data?23:-1)}}var Ua=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerBrand","ReportLoader/CustomerBrand");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);default:return 0}}),this.data.Detail=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"SalesNTax":return this.compare(t.TotalSales,l.TotalSales,C);case"Cost":return this.compare(t.TotalCost,l.TotalCost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Brand Sales Analysis",exportTypes:[{ID:"ReportExport/CustomerBrand",Value:"Default",FileName:"Brand Sales Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"SalesReport/CustomerBrandCount",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-brand-sales-analysis"]],standalone:!1,features:[W],decls:20,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["api","SalesReport/CustomerBrandCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Brand",1,"ng-select-multiple",3,"ngModelChange","multiple","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name","text","Customer",1,"align-left",2,"width","280px"],[2,"width","190px"],[2,"width","155px"],[2,"width","130px"],[2,"min-width","124px"],["mat-sort-header","Quantity","text","Qty",1,"align-left","text-end",2,"min-width","66px"],["mat-sort-header","SalesNTax","text","Total Sales","arrowPosition","before",1,"flex-right","text-end",2,"min-width","112px"],["mat-sort-header","Cost","text","Total Cost","arrowPosition","before",1,"flex-right","text-end",2,"min-width","113px"],["mat-sort-header","Profit","text","Profit","arrowPosition","before",1,"flex-right","text-end",2,"min-width","114px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["colspan","5",1,"p-0"],[1,"w-100","border-top-0"],[1,"border-top-0","text-start",2,"min-width","124px"],[1,"border-top-0","text-end",2,"min-width","66px"],[1,"border-top-0","text-end",2,"min-width","112px"],[1,"border-top-0","text-end","text-danger",2,"min-width","113px"],[1,"border-top-0","text-end",2,"min-width","114px",3,"ngClass"],[1,"footer"],["colspan","5"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,sv,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Brand "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()()()()(),n(13,"filters"),E(14,cv,13,7,"ng-template",null,0,O),a(),n(16,"content")(17,"div",7),S(18,yv,24,3,"div",8),n(19,"POS-complex-pagination",9),P("jumpToPage",function(){return u(l),_(t.getListData())})("previousPage",function(){return u(l),_(t.getListData())})("nextPage",function(){return u(l),_(t.getListData())}),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(10,rv)),o(3),c("routerLink",M(11,lv)),o(7),y(t.data?18:-1),o(),c("total",t.data.TransactionCount)("pageData",t.pageData))},dependencies:[A,tt,Q,$,J,Qe,L,R,pe,ge,Ue,Et,Z,ne],encapsulation:2})};var Dv=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),vv=()=>["/menu/Reports/Sales_Report/Standard/Detail"],wv=(i,s,e)=>({From:i,To:s,TypeID:e}),_l=(i,s)=>({"text-warning":i,"text-success":s,"text-end":!0}),Ka=(i,s)=>({"text-danger":i,"text-success":s});function Tv(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export"),a()}}function Pv(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Year - Month"),a(),n(2,"div",13)(3,"div",14)(4,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Year=null)}),a()(),n(5,"div",16)(6,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Month=null)}),a()()()}if(i&2){let e=m(2);o(4),f("ngModel",e.Year),c("items",e.Years),o(2),f("ngModel",e.Month),c("items",e.Months)}}function Fv(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",10)(12,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Compare with Prev Month"),a(),n(15,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a(),S(16,Pv,7,4),a()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.isCompare),o(),y(e.isCompare?16:-1)}}function Iv(i,s){i&1&&(n(0,"th",22),p(1,"Prev"),a())}function bv(i,s){i&1&&(n(0,"th",23),p(1,"Now"),a())}function Ev(i,s){i&1&&(n(0,"th",24),p(1," Trans "),a())}function Mv(i,s){i&1&&(n(0,"th",25),p(1,"Qty"),a())}function Vv(i,s){i&1&&(n(0,"th",27),p(1,"Tax"),a())}function Bv(i,s){if(i&1&&(n(0,"th",28),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Ov(i,s){i&1&&(n(0,"th",29),p(1,"\xB1 (%)"),a())}function Lv(i,s){i&1&&(n(0,"th",30),p(1,"Cost"),a())}function Rv(i,s){if(i&1&&(n(0,"th",28),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function kv(i,s){i&1&&(n(0,"th",31),p(1," Target "),a())}function Wv(i,s){i&1&&(n(0,"th",32),p(1," Ach(%) "),a())}function Nv(i,s){if(i&1&&(n(0,"td",29),p(1),a()),i&2){let e=m().$implicit;o(),F(e.PrevIndex)}}function Av(i,s){if(i&1&&(n(0,"td",41),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,Dv,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function Gv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Quantity))}}function Hv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.Count,".0-0"))}}function Qv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Yv(i,s){if(i&1&&(n(0,"td",29)(1,"a",42),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(11,vv))("queryParams",_t(12,wv,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy"),e.TypeID)),o(4),F(g(6,9,e.SalesWithTax))}}function jv(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,_l,e.IsNegative,e.IsPositive)),o(),D(" ",g(2,2,e.Increase)," ")}}function qv(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Uv(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function zv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesTarget)," ")}}function Kv(i,s){if(i&1&&(n(0,"span",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Ka,e.Achievement<0,e.Achievement>0)),o(),D(" ",g(2,2,e.Achievement)," ")}}function Xv(i,s){if(i&1&&(n(0,"span",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Ka,e.AchievementWithTax<0,e.AchievementWithTax>0)),o(),D(" ",g(2,2,e.AchievementWithTax)," ")}}function Jv(i,s){if(i&1&&(n(0,"td",29),S(1,Kv,3,7,"span",38),S(2,Xv,3,7,"span",38),a()),i&2){let e=m(3);o(),y(e.pageData.IgnoreTax?-1:1),o(),y(e.pageData.IgnoreTax?2:-1)}}function Zv(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",34),p(4),a(),S(5,Nv,2,1,"td",29),S(6,Av,2,5,"td",41),S(7,Gv,3,3,"td",29),S(8,Hv,3,4,"td",29),n(9,"td",29),p(10),d(11,"amountFraction"),a(),S(12,Qv,3,3,"td",36),d(13,"HideSumZero"),S(14,Yv,7,16,"td",29),S(15,jv,3,7,"td",38),S(16,qv,3,3,"td",39),S(17,Uv,3,3,"td",40),S(18,zv,3,3,"td",29),d(19,"HideSumZero"),S(20,Jv,3,2,"td",29),d(21,"HideSumZero"),d(22,"HideSumZero"),a()),i&2){let e=s.$implicit,r=s.$index,t=m(2);o(2),F(r+1),o(2),F(e.Name),o(),y(t.showCompareColumn?5:-1),o(),y(t.showCompareColumn?6:-1),o(),y(t.data.WithCategory?7:-1),o(),y(t.data.WithCategory?-1:8),o(2),F(g(11,14,e.SalesNet)),o(2),y(!t.data.WithCategory&&v(13,16,t.data.Data,"Tax")?12:-1),o(2),y(t.data.WithCategory?-1:14),o(),y(t.showCompareColumn?15:-1),o(),y(t.roleService.product.Cost?16:-1),o(),y(t.roleService.report.Profit?17:-1),o(),y(v(19,19,t.data.Data,"SalesTarget")?18:-1),o(2),y(v(21,22,t.roleService.report.Profit&&t.data.Data,"AchievementWithTax")||v(22,25,t.data.Data,"Achievement")?20:-1)}}function $v(i,s){i&1&&b(0,"td",35)}function e3(i,s){i&1&&b(0,"td",35)}function t3(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Count"),".0-0")," ")}}function i3(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function n3(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function a3(i,s){if(i&1&&(n(0,"td",37)(1,"a",43),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function o3(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,_l,e.comparation<0,e.comparation>0)),o(),D(" ",v(2,2,e.comparation,".0-0")," ")}}function r3(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function l3(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data.Data,"Profit")))}}function p3(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ProfitWithTax"))," ")}}function m3(i,s){if(i&1&&(n(0,"td",40),S(1,l3,4,6,"span"),S(2,p3,4,6,"span"),a()),i&2){let e=m(2);o(),y(e.pageData.IgnoreTax?1:-1),o(),y(e.pageData.IgnoreTax?-1:2)}}function s3(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Expense"))," ")}}function c3(i,s){if(i&1&&(n(0,"span",38),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(22,Ka,v(1,2,e.data.Data,"Sales")/v(2,5,e.data.Data,"SalesTarget")<0,v(3,8,e.data.Data,"Sales")/v(4,11,e.data.Data,"SalesTarget")>0)),o(5),D(" ",g(8,20,v(6,14,e.data.Data,"Sales")/v(7,17,e.data.Data,"SalesTarget"))," ")}}function d3(i,s){if(i&1&&(n(0,"span",38),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(22,Ka,v(1,2,e.data.Data,"SalesWithTax")/v(2,5,e.data.Data,"SalesTarget")<0,v(3,8,e.data.Data,"SalesWithTax")/v(4,11,e.data.Data,"SalesTarget")>0)),o(5),D(" ",g(8,20,v(6,14,e.data.Data,"SalesWithTax")/v(7,17,e.data.Data,"SalesTarget"))," ")}}function u3(i,s){if(i&1&&(n(0,"td",29),S(1,c3,9,25,"span",38),S(2,d3,9,25,"span",38),a()),i&2){let e=m(2);o(),y(e.pageData.IgnoreTax?-1:1),o(),y(e.pageData.IgnoreTax?2:-1)}}function _3(i,s){if(i&1){let e=I();n(0,"div",3)(1,"div",18)(2,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",20)(4,"tr")(5,"th"),p(6,"No."),a(),n(7,"th",21),p(8,"Tag"),a(),S(9,Iv,2,0,"th",22),S(10,bv,2,0,"th",23),S(11,Ev,2,0,"th",24),S(12,Mv,2,0,"th",25),n(13,"th",26),p(14,"Sales"),a(),S(15,Vv,2,0,"th",27),d(16,"HideSumZero"),S(17,Bv,2,1,"th",28),S(18,Ov,2,0,"th",29),S(19,Lv,2,0,"th",30),S(20,Rv,2,1,"th",28),S(21,kv,2,0,"th",31),d(22,"HideSumZero"),S(23,Wv,2,0,"th",32),d(24,"HideSumZero"),d(25,"HideSumZero"),a()(),n(26,"tbody"),G(27,Zv,23,28,"tr",null,Y),a(),n(29,"tfoot")(30,"tr",33),b(31,"td")(32,"td",34),S(33,$v,1,0,"td",35),S(34,e3,1,0,"td",35),S(35,t3,4,7,"td",29),S(36,i3,4,6,"td",29),n(37,"td",29),p(38),d(39,"sum"),d(40,"amountFraction"),a(),S(41,n3,4,6,"td",36),d(42,"HideSumZero"),S(43,a3,5,6,"td",37),S(44,o3,3,8,"td",38),S(45,r3,4,6,"td",39),S(46,m3,3,2,"td",40),S(47,s3,4,6,"td",29),d(48,"HideSumZero"),S(49,u3,3,2,"td",29),d(50,"HideSumZero"),d(51,"HideSumZero"),a()()()()()}if(i&2){let e=m();o(9),y(e.showCompareColumn?9:-1),o(),y(e.showCompareColumn?10:-1),o(),y(e.data.WithCategory?-1:11),o(),y(e.data.WithCategory?12:-1),o(3),y(!e.data.WithCategory&&v(16,23,e.data.Data,"Tax")?15:-1),o(2),y(e.data.WithCategory?-1:17),o(),y(e.showCompareColumn?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(),y(e.roleService.report.Profit?20:-1),o(),y(v(22,26,e.data.Data,"SalesTarget")?21:-1),o(2),y(v(24,29,e.data.Data,"AchievementWithTax")||v(25,32,e.data.Data,"Achievement")&&e.roleService.report.Profit?23:-1),o(4),H(e.data.Data),o(6),y(e.showCompareColumn?33:-1),o(),y(e.showCompareColumn?34:-1),o(),y(e.data.WithCategory?-1:35),o(),y(e.data.WithCategory?36:-1),o(2),D(" ",g(40,38,v(39,35,e.data.Data,"SalesNet"))," "),o(3),y(!e.data.WithCategory&&v(42,40,e.data.Data,"Tax")?41:-1),o(2),y(e.data.WithCategory?-1:43),o(),y(e.showCompareColumn?44:-1),o(),y(e.roleService.product.Cost?45:-1),o(),y(e.roleService.report.Profit?46:-1),o(),y(e.roleService.product.Expense&&v(48,43,e.data.Data,"Expense")?47:-1),o(2),y(v(50,46,e.roleService.report.Profit&&e.data.Data,"AchievementWithTax")||v(51,49,e.data.Data,"Achievement")?49:-1)}}var za=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/OutletPerformanceByType","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Year=T.getFullYear(),this.Month=T.getMonth()}isCompare=!1;showCompareColumn=!1;DateFilterType=!1;Year;Month;Months=[{ID:0,Label:"Jan"},{ID:1,Label:"Feb"},{ID:2,Label:"Mar"},{ID:3,Label:"Apr"},{ID:4,Label:"May"},{ID:5,Label:"Jun"},{ID:6,Label:"Jul"},{ID:7,Label:"Aug"},{ID:8,Label:"Sep"},{ID:9,Label:"Oct"},{ID:10,Label:"Nov"},{ID:11,Label:"Dec"}];Years=V.GenerateYears(new Date().getFullYear(),11,!0);RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];postInit(e){this.originalData=e.Data,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1).toDateString(),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0).toDateString()}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Count":return this.compare(t.Count,l.Count,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Gross":return this.compare(t.Gross,l.Gross,C);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,C);case"SalesTaxNet":return this.compare(t.SalesNet,l.SalesNet,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,C);case"Expense":return this.compare(t.Expense,l.Expense,C);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,C);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,C);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,C);case"Achievement":return this.compare(t.Achievement,l.Achievement,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales Order Tag",exportTypes:[{ID:"ReportExport/OutletPerformanceByType",Value:"Default",FileName:"Sales Order Tag"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-by-sales-order-type"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Compare",3,"modelChange","model"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"align-left"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-left"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left"],["arrowPosition","before",1,"flex-left",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left"],["mat-sort-header","Target","arrowPosition","before",1,"align-left"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"align-left"],[1,"footer"],[1,"freeze","body"],[1,"empty-column"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"text-end",3,"ngClass"],[3,"routerLink","queryParams"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Tv,3,0,"button",2),a(),n(3,"filters"),E(4,Fv,17,10,"ng-template",null,0,O),a(),n(6,"content"),S(7,_3,52,52,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,U,se,ei,re,oe,Z,ne],encapsulation:2})};var gl=Jt(Po());var g3=new Zt("HIGHCHARTS_LOADER"),C3=new Zt("HIGHCHARTS_ROOT_MODULES"),f3=new Zt("HIGHCHARTS_OPTIONS"),x3=new Zt("HIGHCHARTS_CONFIG"),h3=new Zt("HIGHCHARTS_TIMEOUT"),S3=(()=>{let s=class s{constructor(){this.highcharts=dt(null),this.loader=Pe(g3),this.globalOptions=Pe(f3,{optional:!0}),this.globalModules=Pe(C3,{optional:!0})}loadHighchartsWithModules(r){return Hi(this,null,function*(){let t=yield this.loader();return yield Promise.allSettled([...this.globalModules?.()??[],...r?.modules?.()??[]]),t})}load(r){this.loadHighchartsWithModules(r).then(t=>{this.globalOptions&&t.setOptions(this.globalOptions),this.highcharts.set(t)})}};s.\u0275fac=function(t){return new(t||s)},s.\u0275prov=an({token:s,factory:s.\u0275fac,providedIn:"root"});let i=s;return i})(),y3=(()=>{let s=class s{delay(r){return new Promise(t=>setTimeout(t,r))}keepChartUpToDate(){dn(()=>Hi(this,null,function*(){this.update();let r=yield this.chart();this.chartCreated?r?.update(this.options(),!0,this.oneToOne()):r&&(this.chartCreated=!0)}))}destroyChart(){return Hi(this,null,function*(){let r=yield this.chart();r&&r.destroy()})}constructor(){this.constructorType=hi("chart"),this.oneToOne=hi(!1),this.options=hi.required(),this.update=un(),this.chartInstance=Ho(),this.destroyRef=Pe(Lo),this.el=Pe(Ro),this.platformId=Pe(ko),this.relativeConfig=Pe(x3,{optional:!0}),this.timeout=Pe(h3,{optional:!0}),this.highchartsChartService=Pe(S3),this.chartCreated=!1,this.constructorChart=xi(()=>{let r=this.highchartsChartService.highcharts();if(r)return r[this.constructorType()]}),this.chart=xi(()=>Hi(this,null,function*(){return yield this.delay(this.relativeConfig?.timeout??this.timeout??500),this.constructorChart()?.(this.el.nativeElement,Go(()=>this.options()),r=>this.chartInstance.emit(r))})),!(this.platformId&&zo(this.platformId))&&(this.highchartsChartService.load(this.relativeConfig),this.destroyRef.onDestroy(()=>this.destroyChart()),jo(()=>{this.update()&&this.update.set(!1)}),this.keepChartUpToDate())}};s.\u0275fac=function(t){return new(t||s)},s.\u0275dir=pn({type:s,selectors:[["","highchartsChart",""]],inputs:{constructorType:[1,"constructorType"],oneToOne:[1,"oneToOne"],options:[1,"options"],update:[1,"update"]},outputs:{update:"updateChange",chartInstance:"chartInstance"}});let i=s;return i})(),Xa=(()=>{let s=class s{};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=B({type:s,selectors:[["highcharts-chart"]],features:[mn([{directive:y3,inputs:["constructorType","constructorType","oneToOne","oneToOne","options","options","update","update"],outputs:["chartInstance","chartInstance","updateChange","updateChange"]}])],decls:0,vars:0,template:function(t,l){},encapsulation:2,changeDetection:0});let i=s;return i})();function v3(i,s){if(i&1){let e=I();n(0,"div",3)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",4),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Date From - To"),a(),n(6,"div",5)(7,"div",6)(8,"datepicker",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(9,"div",6)(10,"datepicker",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()(),n(11,"h6"),p(12,"Price Range"),a(),n(13,"input",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PriceRange,t)||(l.pageData.Filter.PriceRange=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),f("ngModel",e.pageData.Filter.ListIDs),o(5),f("ngModel",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(2),f("ngModel",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(3),f("ngModel",e.pageData.Filter.PriceRange)}}function w3(i,s){if(i&1){let e=I();n(0,"button",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function T3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),d(4,"number"),a(),n(5,"td",21),p(6),d(7,"quantityFraction"),a(),n(8,"td",21),p(9),d(10,"quantityFraction"),a()()),i&2){let e=s.$implicit;o(2),$t(" ",g(3,4,e.KeyValue.Key.StartNumber)," - ",g(4,6,e.KeyValue.Key.EndNumber)," "),o(4),D(" ",e.KeyValue.Value!=0?g(7,8,e.KeyValue.Value):"-"," "),o(3),F(g(10,10,e.Sales))}}function P3(i,s){if(i&1&&(n(0,"content")(1,"div",12)(2,"div",5)(3,"div",6)(4,"table",13)(5,"thead",14)(6,"tr",15)(7,"th",16),p(8,"Price"),a(),n(9,"th",17),p(10,"Qty"),a(),n(11,"th"),p(12,"Sales"),a()()(),n(13,"tbody"),G(14,T3,11,12,"tr",null,Y),a()()(),n(16,"div",6)(17,"div",18)(18,"div",19),b(19,"highcharts-chart",20),a()()()()()()),i&2){let e=m();o(14),H(e.data.Data),o(5),c("Highcharts",e.Highcharts)("options",e.chartOptions())}}Gn(gl.default);var Ja=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/UnitPriceAnalysis","ReportLoader/PriceAnalysis",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}Highcharts=Bi;chartOptions=dt(null);openExportModal(){this.matDialog.open(K,{data:{title:"Price Analysis",exportTypes:[{ID:"ReportExport/PriceAnalysis",Value:"Default",FileName:"Price Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.chartOptions.set({chart:{type:"pie",style:{fontFamily:'"Roboto-Slab", sans-serif'}},title:{text:"Price Analysis Chart"},credits:{enabled:!1},tooltip:{headerFormat:"",pointFormat:'<span style="color:{point.color}">\u25CF</span> {point.name}: <b>{point.y:.1f}</b>'},plotOptions:{pie:{allowPointSelect:!0,borderWidth:2,cursor:"pointer",dataLabels:{enabled:!0,format:"<b>{point.name}</b><br>{point.y}",distance:20},showInLegend:!0}},series:[{type:"pie",data:[...e.PieChartData.map(r=>({name:r.Name,y:r.Qty}))]}]})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-price-analysis"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"row"],[1,"col-6"],["appearance","outline","name","From",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["appearance","outline","name","To",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","table-bordered"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","250px"],[2,"width","150px"],[1,"card"],[1,"card-body"],[2,"width","100%","height","400px","display","block",3,"Highcharts","options"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"filters"),E(2,v3,14,11,"ng-template",null,0,O),a(),n(4,"actions"),S(5,w3,3,0,"button",2),a(),S(6,P3,20,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(5),y(t.roleService.global.Export?5:-1),o(),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,Ue,U,Xa,re,ne],encapsulation:2})};var F3=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Cl=i=>({ID:i});function I3(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function b3(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",7),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",8)(10,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Tax"),a(),n(13,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(14,"h6"),p(15,"Page Size"),a(),n(16,"input",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function E3(i,s){i&1&&(n(0,"th",21),p(1," Purchase "),a())}function M3(i,s){i&1&&(n(0,"th",22),p(1," Tax "),a())}function V3(i,s){if(i&1&&b(0,"th",23),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function B3(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function O3(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function L3(i,s){if(i&1&&(b(0,"td",40),d(1,"TaxDefault"),d(2,"number")),i&2){let e=s.$index,r=m().$implicit,t=m(2);c("innerHtml",g(2,5,fi(1,1,t.data.Compenents,r,e)),Ee)}}function R3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",36),p(5),a()(),n(6,"td")(7,"a",37),p(8),a()(),n(9,"td"),p(10),a(),n(11,"td"),p(12),d(13,"date"),a(),S(14,B3,3,3,"td",38),S(15,O3,3,3,"td",39),G(16,L3,3,7,"td",40,Y),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(13,F3))("queryParams",X(14,Cl,e.ID)),o(),F(e.Number),o(2),c("queryParams",X(16,Cl,e.SupplierID)),o(),D(" ",e.Name," "),o(2),F(e.TaxName),o(2),F(v(13,10,e.Date,"dd MMM yyyy")),o(2),y(r.roleService.product.Cost?14:-1),o(),y(r.roleService.product.Cost?15:-1),o(),H(r.getComponent(r.data))}}function k3(i,s){if(i&1&&(n(0,"td",27)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.infiniteList,"Sales")))}}function W3(i,s){if(i&1&&(n(0,"td",27)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.infiniteList,"Tax")))}}function N3(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e.SumTaxAmount)," ")}}function A3(i,s){if(i&1){let e=I();n(0,"span",41),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport"))}),n(1,"i",42),p(2,"?"),a()()}}function G3(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function H3(i,s){if(i&1){let e=I();n(0,"a",43),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",44),p(2," Next"),a()}}function Q3(i,s){if(i&1){let e=I();n(0,"a",45),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport",!0))}),b(1,"i",46),p(2," Show All"),a()}}function Y3(i,s){if(i&1){let e=I();n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",15)(5,"tr")(6,"th",16),p(7,"Outlet"),a(),n(8,"th",17),p(9,"Number"),a(),n(10,"th",18),p(11,"Supplier"),a(),n(12,"th",19),p(13," Type "),a(),n(14,"th",20),p(15,"Date"),a(),S(16,E3,2,0,"th",21),S(17,M3,2,0,"th",22),G(18,V3,1,1,"th",23,Y),a()(),n(20,"tbody"),G(21,R3,18,18,"tr",null,Y),a(),n(23,"tfoot")(24,"tr",24),b(25,"td",25),n(26,"td",26),p(27,"Total :"),a(),S(28,k3,5,6,"td",27),S(29,W3,5,6,"td",27),G(30,N3,3,3,"td",28,Y),a()()()(),n(32,"div",29)(33,"div",30)(34,"div",31),p(35),d(36,"number"),S(37,A3,3,0,"span",32),S(38,G3,3,3,"span"),p(39),a()(),n(40,"div",33),S(41,H3,3,0,"a",34),S(42,Q3,3,0,"a",35),a()()()()}if(i&2){let e=m();o(16),y(e.roleService.product.Cost?16:-1),o(),y(e.roleService.product.Cost?17:-1),o(),H(e.data.Compenents),o(3),H(e.infiniteList),o(7),y(e.roleService.product.Cost?28:-1),o(),y(e.roleService.product.Cost?29:-1),o(),H(e.data.Compenents),o(5),D(" Showing 1 - ",g(36,10,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:37),o(),y(e.pageData.HideStoreApiCount?38:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),y(!e.nextPageDisabled&&!e.goToLast?41:-1),o(),y(!e.nextPageDisabled&&!e.goToLast?42:-1)}}var Za=class i extends vi{constructor(e,r,t,l,C,T){super(e,r,"Report/GetPurchaseTaxReport","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Tax Report",exportTypes:[{ID:"ReportExport/GetPurchaseTaxReport",Value:"Default",FileName:"Purchase Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountPurchaseTaxReport",pagination:!0}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.TaxTax=t==0?e.Tax:this.data.Compenents[t-1].TaxTax,r.TaxTax=t==0?r.TaxTax:r.TaxTax+r.TaxTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.TaxTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),C);case"Number":return this.compare(t.Number,l.Number,C);case"Date":return this.compare(t.Date,l.Date,C);case"Tax":return this.compare(t.Tax,l.Tax,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-purchase-tax-report"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[1,"table-footer"],["colspan","4",1,"text-end","empty-column"],[1,"text-end","empty-column"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","matTooltipPosition","above","matTooltip","Load all data",1,"btn","btn-outline-secondary","btn-sm","text-primary"],[3,"routerLink","queryParams"],["routerLink","/menu/Contacts/Contact/Suppliers/Info/V2","target","_blank",3,"queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",2,"width","150px",3,"innerHtml"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,I3,3,0,"button",2),a(),n(3,"filters"),E(4,b3,17,10,"ng-template",null,0,O),a(),S(6,Y3,43,12,"content"),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,Qe,L,R,ie,pe,ge,Ue,U,se,Fi,re,oe,Z],encapsulation:2})};var j3=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],q3=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"];function U3(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",10)(9,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function z3(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",12),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var $a=class i extends De{constructor(e,r,t){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,t);this.httpService=r}chartData;chartConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};postInit(){this.menuData.H=this.data.PageTitle,this.initChartSeries()}initChartSeries(){let e=[];this.data?.Data?.forEach(r=>{let t={name:r.BrandName,y:r.Total};e.push(t)}),this.chartData=e}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(Ne))};static \u0275cmp=B({type:i,selectors:[["app-top-brand-chart"]],standalone:!1,features:[W],decls:17,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Top Brand "),a()(),n(9,"li")(10,"a",5),p(11," Brand Sales Analysis "),a()()()()(),n(12,"filters"),E(13,U3,10,6,"ng-template",null,0,O),a(),n(15,"content"),S(16,z3,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(7,j3)),o(3),c("routerLink",M(8,q3)),o(6),y(t.data?16:-1))},dependencies:[A,Q,J,L,R,ii,U],encapsulation:2})};var K3=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],ki=i=>[i],fl=(i,s)=>({"text-danger":i,"text-success":s});function X3(i,s){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function J3(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onChangeFilterDate1(t))}),a(),n(13,"h6"),p(14,"Compare With"),a(),n(15,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("multiple",!0),f("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.SalesOrderTags),o(3),c("from",e.pageData.Filter.From_range1)("to",e.pageData.Filter.To_range1),o(3),c("from",e.pageData.Filter.From_range2)("to",e.pageData.Filter.To_range2)}}function Z3(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=m(2);o(),D(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function $3(i,s){if(i&1&&(n(0,"th",21),p(1),a()),i&2){let e=m(2);o(),D(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function ew(i,s){i&1&&(n(0,"th",23),p(1," Profit "),a())}function tw(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetProfit1)," ")}}function iw(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetProfit2)," ")}}function nw(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,fl,e.Growth<0,e.Growth>0)),o(),D(" ",g(2,2,e.Growth),"% ")}}function aw(i,s){if(i&1&&(n(0,"tr")(1,"td",26),p(2),a(),n(3,"td",27),p(4),d(5,"amountFraction"),a(),S(6,tw,3,3,"td",28),n(7,"td",27),p(8),d(9,"amountFraction"),a(),S(10,iw,3,3,"td",28),n(11,"td",29),p(12),d(13,"amountFraction"),a(),S(14,nw,3,7,"td",29),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(),c("colSpan",r.roleService.report.Profit?1:2),o(),D(" ",g(5,10,e.SalesNTax1)," "),o(2),y(r.roleService.report.Profit?6:-1),o(),c("colSpan",r.roleService.report.Profit?1:2),o(),D(" ",g(9,12,e.SalesNTax2)," "),o(2),y(r.roleService.report.Profit?10:-1),o(),c("ngClass",fe(16,fl,e.Revenue<0,e.Revenue>0)),o(),D(" ",g(13,14,e.Revenue),"% "),o(2),y(r.roleService.report.Profit?14:-1)}}function ow(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.netProfit1Total>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.netProfit1Total)," ")}}function rw(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.netProfit2Total>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.netProfit2Total)," ")}}function lw(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.profitPercentage>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.profitPercentage),"% ")}}function pw(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",12),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",13)(3,"tr")(4,"th",14),p(5," Outlet "),a(),n(6,"th",15)(7,"span"),p(8),d(9,"date"),a(),p(10," - "),n(11,"span"),p(12),d(13,"date"),a()(),n(14,"th",16)(15,"span"),p(16),d(17,"date"),a(),p(18," - "),n(19,"span"),p(20),d(21,"date"),a()(),n(22,"th",16),p(23,"YOY Growth"),a()(),n(24,"tr",17)(25,"th",18),p(26),a(),S(27,Z3,2,1,"th",19),n(28,"th",20),p(29),a(),S(30,$3,2,1,"th",21),n(31,"th",22),p(32,"Revenue"),a(),S(33,ew,2,0,"th",23),a()(),n(34,"tbody"),G(35,aw,15,19,"tr",null,Y),a(),n(37,"tfoot")(38,"tr"),b(39,"td"),n(40,"td",24),p(41),d(42,"amountFraction"),a(),S(43,ow,3,6,"td",25),n(44,"td",24),p(45),d(46,"amountFraction"),a(),S(47,rw,3,6,"td",25),n(48,"td",25),p(49),d(50,"amountFraction"),a(),S(51,lw,3,6,"td",25),a()()()()}if(i&2){let e=m();o(8),F(v(9,22,e.pageData.Filter.From_range1,"dd MMMM yyyy")),o(4),F(v(13,25,e.pageData.Filter.To_range1,"dd MMMM yyyy")),o(4),F(v(17,28,e.pageData.Filter.From_range2,"dd MMMM yyyy")),o(4),F(v(21,31,e.pageData.Filter.To_range2,"dd MMMM yyyy")),o(5),c("colSpan",e.roleService.report.Profit?1:2),o(),D(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),y(e.roleService.report.Profit?27:-1),o(),c("colSpan",e.roleService.report.Profit?1:2),o(),D(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),y(e.roleService.report.Profit?30:-1),o(3),y(e.roleService.report.Profit?33:-1),o(2),H(e.data),o(5),c("colSpan",e.roleService.report.Profit?1:2)("ngClass",X(40,ki,e.salesNTax1Total>0?"text-success":"text-danger")),o(),D(" ",g(42,34,e.salesNTax1Total)," "),o(2),y(e.roleService.report.Profit?43:-1),o(),c("colSpan",e.roleService.report.Profit?1:2)("ngClass",X(42,ki,e.salesNTax2Total>0?"text-success":"text-danger")),o(),D(" ",g(46,36,e.salesNTax2Total)," "),o(2),y(e.roleService.report.Profit?47:-1),o(),c("ngClass",X(44,ki,e.salesNTaxPercentage>0?"text-success":"text-danger")),o(),D(" ",g(50,38,e.salesNTaxPercentage),"% "),o(2),y(e.roleService.report.Profit?51:-1)}}var eo=class i extends me{constructor(e,r,t,l,C,T){super(t,l,"Report/SalesCompareByRange","ReportLoader/SalesCompareByRange");this.csvConverter=e;this.roleService=r;this.sumPipe=C;this.matDialog=T}salesNTax1Total=0;salesNTax2Total=0;netProfit1Total=0;netProfit2Total=0;salesNTaxPercentage=0;profitPercentage=0;originalData;ngOnInit(){}postInit(e){this.menuData.H="Sales Compare By Outlet",this.salesNTax1Total=this.sumPipe.transform(this.data,"SalesNTax1"),this.salesNTax2Total=this.sumPipe.transform(this.data,"SalesNTax2"),this.netProfit1Total=this.sumPipe.transform(this.data,"NetProfit1"),this.netProfit2Total=this.sumPipe.transform(this.data,"NetProfit2"),this.salesNTaxPercentage=this.calculatePercentage(this.salesNTax1Total,this.salesNTax2Total),this.profitPercentage=this.calculatePercentage(this.netProfit1Total,this.netProfit2Total),this.originalData=e}calculatePercentage(e,r){return(r-e)/e*100}preGetList(){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.PageNumber}onChangeFilterDate1(e){this.pageData.Filter.From_range1=e.from,this.pageData.Filter.To_range1=e.to}onChangeFilterDate2(e){this.pageData.Filter.From_range2=e.from,this.pageData.Filter.To_range2=e.to}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.originalData;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(typeof t[e.active]){case"number":return this.compare(t[e.active],l[e.active],C);case"string":return this.compare(t[e.active],l[e.active],C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales Compare by Outlet",exportTypes:[{ID:"ReportExport/SalesCompareByRange",Value:"Default",FileName:"Sales Compare by Outlet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(q),w(j),w(N),w(k),w(se),w(z))};static \u0275cmp=B({type:i,selectors:[["app-sales-compare-by-outlet"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["matTooltipPosition","above","matTooltip","12 Months Compare",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindValue","ID","bindLabel","Name","placeholder","Choose Sales Order Tag",3,"ngModelChange","multiple","ngModel","items"],[3,"dateChange","from","to"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-header"],["rowspan","2","colspan","1","mat-sort-header","EntityName",1,"border-end","text-center"],["colspan","2",1,"text-center"],["colspan","2",1,"text-center","border-start"],[1,"border-top-2"],["mat-sort-header","SalesNTax1",1,"align-center",3,"colSpan"],["mat-sort-header","NetProfit1",1,"align-center","border-end"],["mat-sort-header","SalesNTax2",1,"align-center",3,"colSpan"],["mat-sort-header","NetProfit2",1,"align-center","border-end"],["mat-sort-header","Revenue",1,"align-center"],["mat-sort-header","Growth",1,"align-center"],[1,"text-end",3,"colSpan","ngClass"],[1,"text-end",3,"ngClass"],[1,"border-start","border-end"],[1,"text-end","border-end",3,"colSpan"],[1,"text-end","border-end"],[1,"text-end","border-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,X3,3,0,"button",2),n(3,"a",3),p(4," View Monthly"),a()(),n(5,"filters"),E(6,J3,16,13,"ng-template",null,0,O),a(),n(8,"content"),S(9,pw,52,46,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,K3)),o(6),y(t.data?9:-1))},dependencies:[A,tt,Q,$,L,R,ie,pe,ge,Gt,Ce,U,oe,Z],styles:["thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:60px;z-index:1020}@media only screen and (max-width: 768px){thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1020}}"]})};var Ji=Jt(bi());var mw={parse:{dateInput:"YYYY"},display:{dateInput:"YYYY",monthYearLabel:"YYYY",dateA11yLabel:"YYYY",monthYearA11yLabel:"YYYY"}},Wi=class i{yearCtrl=new Zo(null);year=un(null);minDate=(0,Ji.default)().subtract(100,"years");maxDate=(0,Ji.default)();constructor(){dn(()=>{this.year()&&this.yearCtrl.setValue((0,Ji.default)().year(this.year()).startOf("year"))})}chosenYearHandler(s,e){let r=s.year(),t=(0,Ji.default)().year(r).startOf("year");this.yearCtrl.setValue(t),this.year.set(r),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["pos-datepicker-year"]],inputs:{year:[1,"year"]},outputs:{year:"yearChange"},features:[Ci([{provide:yn,useClass:Nn,deps:[Sn]},{provide:Dn,useValue:mw}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker","w-100"],["matInput","",3,"click","matDatepicker","formControl","min","max"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("click",function(){u(t);let C=Tt(4);return _(C.open())}),a(),b(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(C){u(t);let T=Tt(4);return _(r.chosenYearHandler(C,T))}),a()()}if(e&2){let t=Tt(4);o(),c("matDatepicker",t)("formControl",r.yearCtrl)("min",r.minDate)("max",r.maxDate),o(),c("for",t)}},dependencies:[bn,wn,vn,Di,En,yi,Tn,Pn,Fn,At,Qe,L,gn,er],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
7
|
+
`],encapsulation:2,changeDetection:0})};var cw=()=>["/menu/Reports/Sales_Report/Standard/Yearly/Comparison"];function dw(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"pos-datepicker-year",9),h("yearChange",function(t){u(e);let l=m();return x(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(14,"div",10)(15,"pos-datepicker-year",9),h("yearChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.currency),c("items",e.pageData.Options.Currencies),o(4),f("year",e.pageData.Filter.FromYear),o(2),f("year",e.pageData.Filter.ToYear)}}function uw(i,s){if(i&1&&(n(0,"div",4),b(1,"POS-line-chart",11),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var to=class i extends me{constructor(e,r,t,l){super(e,r,"SalesReport/YearlySalesListChart","ReportLoader/YearlySalesPerformance");this.httpService=r;this.csvConverter=t;this.role=l}chartData={series:[]};chartConfig;currency=-1;ngOnInit(){}preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}preGetList(){delete this.pageData.Filter?.From,delete this.pageData.Filter?.To,delete this.pageData.Filter?.PageNumber}postInit(e){this.chartData={series:this.generateSeries()},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.XAxis},yAxis:{title:{text:""},labels:{formatter:function(){return V.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r=this.axis.chart,t=r.userOptions.total,l,C="",T=Math.abs(t[this.x]?t[this.x]:0);return T>999&&T<1e10?(C="K",l=(T/1e3).toFixed(0)):T>=1e10?(C="M",l=(T/1e6).toFixed(0)):T<999&&(l=T.toString()),this.total<0&&(l="-"+l),l.replace(/\B(?=(\d{3})+(?!\d))/g,",")+C}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series;r=r.filter(T=>this.series?.name?.includes("Cost")?T?.name?.includes("Cost"):T?.name?.includes("Cost")==!1);let t=[],l="",C=this.point.index;return r.forEach(T=>{T.options.stack===this.point.series.options.stack&&(t=T.name.split(" "),l+=`<b>${t[0]}</b> <br/><br/>
|
|
8
|
+
${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(T.points[C]?.y)} <br/><br/>`)}),l}},total:this.generateStackTotal()}}generateStackTotal(){let e=[];return this.data.Series.filter(t=>t.Name=="Sales").forEach(t=>{e=[...e,t.Amount]}),e}generateSeries(){let e=[],r=this.data.Series.filter(C=>C.Name=="Sales").map(C=>C.Amount),t=this.data.Series.filter(C=>C.Name=="Profit").map(C=>C.Amount),l=this.data.Series.filter(C=>C.Name=="Cost").map(C=>C.Amount);return e=[{name:"Sales",data:r},{name:"Profit",data:t,visible:!1,showInLegend:!1},{name:"Cost",data:l}],this.role.report.Profit||e.splice(1,1),e}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j))};static \u0275cmp=B({type:i,selectors:[["app-yearly-bar-chart"]],standalone:!1,features:[W],decls:10,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"yearChange","year"],[1,"mt-4"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.getListData())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4,"Table View"),a()(),n(5,"filters"),E(6,dw,16,10,"ng-template",null,0,O),a(),n(8,"content"),S(9,uw,2,2,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",M(6,cw)),o(7),y(t.data?9:-1))},dependencies:[A,Q,$,L,R,ie,Mt,Ce,U,Wi],encapsulation:2})};var _w=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],gw=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],Cw=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],fw=i=>({id:i}),xw=i=>[i],xl=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],hw=(i,s,e)=>({CategoryID:i,From:s,To:e}),hl=i=>({CategoryID:i}),Sw=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"];function yw(i,s){if(i&1){let e=I();n(0,"button",9),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",10),p(2," Export "),a()}}function Dw(i,s){if(i&1&&(n(0,"span",25),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function vw(i,s){if(i&1){let e=I();n(0,"div",11)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",13),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),E(10,Dw,2,3,"ng-template",15),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(15,"div",17)(16,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Sales Order Tag"),a(),n(25,"ng-select",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Discount Calculation"),a(),n(28,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(29,"h6"),p(30,"Hide Zero & Negative"),a(),n(31,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a(),n(32,"h6"),p(33,"Product Type"),a(),n(34,"radio-options",24),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",X(23,xw,X(21,fw,e.pageData.Filter.CategoryID)))("isInitializedCategoryLabel",!0)("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(5),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.TagID),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),o(3),f("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),f("model",e.pageData.Filter.ExcludeZero),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes)}}function ww(i,s){i&1&&(n(0,"th",48),p(1," DISCOUNT "),a())}function Tw(i,s){i&1&&(n(0,"th",49),p(1," DISCOUNT (%) "),a(),n(2,"th",50),p(3," DISCOUNT (AMOUNT) "),a())}function Pw(i,s){i&1&&(n(0,"th",51),p(1," COST "),a())}function Fw(i,s){i&1&&(n(0,"th",52),p(1," PROFIT "),a())}function Iw(i,s){i&1&&(n(0,"th",53),p(1," % "),a())}function bw(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Ew(i,s){if(i&1&&(n(0,"td",56),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit)," ")}}function Mw(i,s){if(i&1&&(n(0,"td",56),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;c("ngClass",e.Percentage>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Percentage),"% ")}}function Vw(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",54),d(3,"date"),d(4,"date"),p(5),a()(),n(6,"td",42),p(7),d(8,"quantityFraction"),a(),n(9,"td",42)(10,"a",54),p(11),d(12,"amountFraction"),a()(),n(13,"td",42)(14,"a",54),p(15),d(16,"amountFraction"),a()(),n(17,"td",42),p(18),d(19,"amountFraction"),a(),n(20,"td",44),p(21),d(22,"amountFraction"),a(),n(23,"td",42),p(24),d(25,"amountFraction"),a(),E(26,bw,3,3,"td",45)(27,Ew,3,4,"td",46)(28,Mw,3,4,"td",46),a()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(34,xl))("queryParams",_t(35,hw,e.ID,v(3,16,r.pageData.Filter.From,"yyyy-MM-dd"),v(4,19,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(e.Name),o(2),F(g(8,22,e.Quantity)),o(3),c("routerLink",M(39,xl))("queryParams",X(40,hl,e.ID)),o(),D(" ",g(12,24,e.GrossSales)," "),o(3),c("routerLink",M(42,Sw))("queryParams",X(43,hl,e.ID)),o(),F(g(16,26,e.Discount)),o(3),F(g(19,28,e.Sales)),o(3),D(" ",g(22,30,e.Tax)," "),o(3),F(g(25,32,e.SalesNTax)),o(2),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit)}}function Bw(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function Ow(i,s){if(i&1&&(n(0,"td",56),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",e.data.Aggregate.TotalProfit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.data.Aggregate.TotalProfit)," ")}}function Lw(i,s){if(i&1&&(n(0,"td",56),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",e.data.Aggregate.TotalPercentage>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.data.Aggregate.TotalPercentage),"% ")}}function Rw(i,s){if(i&1){let e=I();n(0,"content")(1,"div",26)(2,"div",27)(3,"table",28),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",29)(5,"tr")(6,"th",30),p(7,"CATEGORY"),a(),n(8,"th",31),p(9," QUANTITY "),a(),n(10,"th",32),p(11," GROSS SALES "),a(),E(12,ww,2,0,"th",33)(13,Tw,4,0,"ng-template",null,1,O),n(15,"th",34),p(16," NET SALES "),a(),n(17,"th",35),p(18," Tax "),a(),n(19,"th",36),p(20," Sales + Tax "),a(),E(21,Pw,2,0,"th",37)(22,Fw,2,0,"th",38)(23,Iw,2,0,"th",39),a()(),n(24,"tbody"),E(25,Vw,29,45,"tr",40),a(),n(26,"tfoot")(27,"tr",41)(28,"td",42),p(29,"Total :"),a(),n(30,"td",42),p(31),d(32,"quantityFraction"),a(),n(33,"td",43)(34,"a"),p(35),d(36,"amountFraction"),a()(),n(37,"td",42),p(38),d(39,"amountFraction"),a(),n(40,"td",42),p(41),d(42,"amountFraction"),a(),n(43,"td",44),p(44),d(45,"amountFraction"),a(),n(46,"td",42),p(47),d(48,"amountFraction"),a(),E(49,Bw,3,3,"td",45)(50,Ow,3,4,"td",46)(51,Lw,3,4,"td",46),a()()()(),n(52,"POS-complex-pagination",47),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=Tt(14),r=m();o(12),c("ngIf",!r.pageData.Filter.BreakdownDiscountAmount)("ngIfElse",e),o(9),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit),o(2),c("ngForOf",r.data.Data),o(6),D(" ",g(32,17,r.data.Aggregate.TotalQuantity)," "),o(4),F(g(36,19,r.data.Aggregate.TotalGross)),o(3),D(" ",g(39,21,r.data.Aggregate.TotalDiscount)," "),o(3),D(" ",g(42,23,r.data.Aggregate.TotalNetSales)," "),o(3),D(" ",g(45,25,r.data.Aggregate.TotalTax)," "),o(3),D(" ",g(48,27,r.data.Aggregate.TotalSalesNTax)," "),o(2),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit),o(),c("total",r.data.Count)("pageData",r.pageData)}}var io=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySales","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Total":return this.compare(t.Total,l.Total,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Discount":return this.compare(t.Discount,l.Discount,C);case"NetSales":return this.compare(t.NetSales,l.NetSales,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"Percentage":return this.compare(t.Percentage,l.Percentage,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,C);case"GrossSales":return this.compare(t.GrossSales,l.GrossSales,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-category-sales-table"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],["BREAKDOWN_HEADER",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["name","render-ProductType",3,"modelChange","model","options"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"text-start"],["arrowPosition","before","mat-sort-header","Quantity",1,"flex-right",2,"width","120px"],["mat-sort-header","GrossSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["class","flex-right","style","width: 120px","mat-sort-header","Discount","arrowPosition","before",4,"ngIf","ngIfElse"],["mat-sort-header","NetSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-right",2,"width","150px"],["class","flex-right","style","width: 120px","mat-sort-header","Cost","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 120px","mat-sort-header","Profit","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 80px","mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-primary"],[1,"text-end","text-warning-emphasis"],["class","text-end text-danger",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["api","Report/GetTotalCountCategorySales",3,"jumpToPage","previousPage","nextPage","total","pageData"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","DiscountAmount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",1,"flex-right",2,"width","80px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",2),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,yw,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Tree View "),a()(),n(10,"li")(11,"a",7),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",7),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),E(17,vw,35,25,"ng-template",null,0,O),a(),E(19,Rw,53,29,"content",8),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(10,_w)),o(3),c("routerLink",M(11,gw)),o(3),c("routerLink",M(12,Cw)),o(5),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,L,R,ie,pe,ge,Te,Ae,Et,Ce,U,ze,Mn,re,oe,Z,ne],encapsulation:2})};var yl=(i,s)=>({"text-danger":i,"text-success":s}),kw=()=>["/menu/Products/Catalog/Variants/Info"],Sl=i=>({ID:i}),Ww=()=>["/menu/Orders/Orders/Customer_Invoice/Info"];function Nw(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Aw(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Discount Comparator"),a(),n(9,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CompareDifference,t)||(l.pageData.Filter.CompareDifference=t),_(t)}),a(),n(10,"h6"),p(11,"Variant"),a(),n(12,"autocompleteV2",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a(),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(17,"div",11)(18,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(19,"h6"),p(20,"Note"),a(),n(21,"input",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Note,t)||(l.pageData.Filter.Note=t),_(t)}),a(),n(22,"h6"),p(23,"Disc %"),a(),n(24,"div",14)(25,"input",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DiscountFrom,t)||(l.pageData.Filter.DiscountFrom=t),_(t)}),a(),n(26,"input",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DiscountTo,t)||(l.pageData.Filter.DiscountTo=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.CompareDifference),c("clearable",!1)("items",e.pageData.Options==null?null:e.pageData.Options.DiscountReportCompareType),o(3),f("ngModel",e.pageData.Filter.VariantID),c("renderThumbnail",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.Note),o(4),f("ngModel",e.pageData.Filter.DiscountFrom),o(),f("ngModel",e.pageData.Filter.DiscountTo)}}function Gw(i,s){i&1&&(n(0,"th",26),p(1,"Cost"),a())}function Hw(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.UnitCost))}}function Qw(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",38),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td")(9,"a",38),p(10),a(),b(11,"span",39),a(),n(12,"td"),p(13),d(14,"date"),a(),n(15,"td",33),p(16),d(17,"quantityFraction"),a(),S(18,Hw,3,3,"td",34),n(19,"td",33),p(20),d(21,"amountFraction"),a(),n(22,"td",33),p(23),d(24,"amountFraction"),a(),n(25,"td",35),p(26),d(27,"amountFraction"),a(),n(28,"td",34),p(29),d(30,"amountFraction"),a(),n(31,"td",36),p(32),d(33,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(33,kw))("queryParams",X(34,Sl,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(2),c("routerLink",M(36,Ww))("queryParams",X(37,Sl,e.InvoiceID)),o(),F(e.Number),o(),c("innerHTML",e.Note,Ee),o(2),F(v(14,18,e.Date,"dd MMM yyyy")),o(3),F(g(17,21,e.Quantity)),o(2),y(r.roleService.product.Cost?18:-1),o(2),F(g(21,23,e.UnitPriceOriginal)),o(3),F(g(24,25,e.UnitPrice)),o(2),c("ngClass",fe(39,yl,!e.NetPriceIsGreaterThanOriginalPrice,e.NetPriceIsGreaterThanOriginalPrice)),o(),D(" ",g(27,27,e.Discount)),o(3),D(" ",g(30,29,e.DiscountPercentage),"% "),o(3),F(g(33,31,e.Sales))}}function Yw(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(2,1,e.data.Aggregate.TotalUnitCost))}}function jw(i,s){if(i&1){let e=I();n(0,"POS-complex-pagination",40),P("jumpToPage",function(){u(e);let t=m(2);return _(t.getListData())})("previousPage",function(){u(e);let t=m(2);return _(t.getListData())})("nextPage",function(){u(e);let t=m(2);return _(t.getListData())}),a()}if(i&2){let e=m(2);c("total",e.data.Data.length)("pageData",e.pageData)}}function qw(i,s){if(i&1){let e=I();n(0,"content")(1,"div",16)(2,"div",17)(3,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",19)(5,"tr")(6,"th",20),p(7,"Outlet"),a(),n(8,"th",21),p(9,"Variant"),a(),n(10,"th",22),p(11,"Code"),a(),n(12,"th",23),p(13,"Number / Note"),a(),n(14,"th",24),p(15,"Date"),a(),n(16,"th",25),p(17,"Quantity"),a(),S(18,Gw,2,0,"th",26),n(19,"th",27),p(20," Original Price"),a(),n(21,"th",28),p(22,"Price"),a(),n(23,"th",29),p(24,"Discount"),a(),n(25,"th",30),p(26," Disc%"),a(),n(27,"th",31),p(28,"Net Sales "),a()()(),n(29,"tbody"),G(30,Qw,34,42,"tr",null,Y),a(),n(32,"tfoot")(33,"tr"),b(34,"td",32),n(35,"td",33),p(36,"Total :"),a(),n(37,"td",33),p(38),d(39,"quantityFraction"),a(),S(40,Yw,3,3,"td",34),n(41,"td",33),p(42),d(43,"amountFraction"),a(),n(44,"td",33),p(45),d(46,"amountFraction"),a(),n(47,"td",35),p(48),d(49,"amountFraction"),a(),n(50,"td",34),p(51),d(52,"amountFraction"),a(),n(53,"td",36),p(54),d(55,"amountFraction"),a()()()()(),S(56,jw,1,2,"POS-complex-pagination",37),a()()}if(i&2){let e=m();o(18),y(e.roleService.product.Cost?18:-1),o(12),H(e.data.Data),o(8),F(g(39,10,e.data.Aggregate.TotalQuantity)),o(2),y(e.roleService.product.Cost?40:-1),o(2),F(g(43,12,e.data.Aggregate.TotalUnitPriceOriginal)),o(3),F(g(46,14,e.data.Aggregate.TotalUnitPrice)),o(2),c("ngClass",fe(22,yl,e.data.Aggregate.TotalDiscount>0,e.data.Aggregate.TotalDiscount<0)),o(),D(" ",g(49,16,e.data.Aggregate.TotalDiscount<0?e.data.Aggregate.TotalDiscount*-1:e.data.Aggregate.TotalDiscount)),o(3),D(" ",g(52,18,e.data.Aggregate.DiscountPercentage),"% "),o(3),F(g(55,20,e.data.Aggregate.TotalNetSales)),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?56:-1)}}var no=class i extends De{constructor(e,r,t,l,C){super(e,r,"SalesReport/Discount","SalesReportLoader/DiscountLoader",null,t);this.roleService=l;this.dialog=C}postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data,this.initDiscountPercentage()}initDiscountPercentage(){this.data.Aggregate.DiscountPercentage=0;for(let e of this.data.Data)this.data.Aggregate.DiscountPercentage+=e.DiscountPercentage}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"EntityName":return V.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),C);case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);case"Number":return V.compare(t.Number,l.Number,C);case"Date":return V.compare(t.Date,l.Date,C);case"Quantity":return V.compare(t.Quantity,l.Quantity,C);case"UnitCost":return V.compare(t.UnitCost,l.UnitCost,C);case"UnitPriceOriginal":return V.compare(t.UnitPriceOriginal,l.UnitPriceOriginal,C);case"UnitPrice":return V.compare(t.UnitPrice,l.UnitPrice,C);case"Discount":return V.compare(t.Discount,l.Discount,C);case"Sales":return V.compare(t.Sales,l.Sales,C);case"DiscountPercentage":return V.compare(t.DiscountPercentage,l.DiscountPercentage,C);case"Note":return V.compare(t.Note,l.Note,C);default:return 0}})}openExportModal(){this.dialog.open(K,{data:{title:"Discounted Report",exportTypes:[{ID:"SalesReportExport/Discount",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["app-discount-sales"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose Discount Comparator",3,"ngModelChange","ngModel","clearable","items"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"d-flex",2,"column-gap","10px"],["type","text","autoNum","","percentage","",1,"form-control","w-100",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName",2,"width","150px"],["mat-sort-header","Name",2,"width","150px"],["mat-sort-header","Code",2,"width","100px"],["mat-sort-header","Number",2,"width","100px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitCost","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPriceOriginal","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Discount","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","DiscountPercentage","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],["colspan","4"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"],[1,"text-end","text-success"],["api","SalesReport/TotalDiscount",3,"total","pageData"],["target","_blank",3,"routerLink","queryParams"],[1,"d-block",3,"innerHTML"],["api","SalesReport/TotalDiscount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Nw,3,0,"a",2),a(),n(3,"filters"),E(4,Aw,27,16,"ng-template",null,0,O),a(),S(6,qw,57,25,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,tt,Q,$,J,Qe,L,R,pe,ge,Ue,Ae,Et,Ce,U,oe,Z,ne],encapsulation:2})};var Uw=()=>["/menu/Reports/Sales_Report/Standard/Person"],zw=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],Kw=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],Xw=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],Jw=(i,s)=>({From:i,To:s}),vl=i=>({ID:i}),Dl=i=>[i],Zw=(i,s)=>({SalesPersonID:i,ListIDs:s}),$w=(i,s,e,r)=>({SalesPersonID:i,ListIDs:s,From:e,To:r});function eT(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function tT(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",19),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Date"),a(),n(9,"app-datepicker-range",20),P("dateChange",function(t){u(e);let l=m(2);return _(l.onChangeFilterDate1(t))}),a(),n(10,"h6",21),p(11,"Compare With"),a(),n(12,"app-datepicker-range",20),P("dateChange",function(t){u(e);let l=m(2);return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=m(2);o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To),o(3),c("from",e.pageData.Filter.CompareFrom)("to",e.pageData.Filter.CompareTo)}}function iT(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",37),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",36)(7,"a",38),p(8),d(9,"number"),a()(),n(10,"td",36),p(11),d(12,"quantityFraction"),a(),n(13,"td",36),p(14),d(15,"quantityFraction"),a(),n(16,"td",36),p(17),d(18,"quantityFraction"),a(),n(19,"td",36),p(20),d(21,"amountFraction"),a(),n(22,"td",36),p(23),d(24,"amountFraction"),a(),n(25,"td",36)(26,"a",38),d(27,"date"),d(28,"date"),p(29),d(30,"quantityFraction"),a()(),n(31,"td",36),p(32),d(33,"quantityFraction"),a(),n(34,"td",36),p(35),d(36,"quantityFraction"),a(),n(37,"td",36),p(38),d(39,"quantityFraction"),a(),n(40,"td",36),p(41),d(42,"amountFraction"),a(),n(43,"td",36),p(44),d(45,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m().$implicit,t=m(2);o(2),c("queryParams",X(47,vl,e.PersonID)),o(),F(e.PersonName),o(2),F(e.PersonCode),o(2),c("queryParams",fe(51,Zw,e.PersonID,X(49,Dl,r.EntityID))),o(),F(g(9,17,e.CountOrder)),o(3),F(g(12,19,e.Quantity)),o(3),F(g(15,21,e.BasketSize)),o(3),F(g(18,23,e.BasketValue)),o(3),F(g(21,25,e.Sales)),o(3),F(g(24,27,e.AverageDailySales)),o(3),c("queryParams",Ut(56,$w,e.PersonID,X(54,Dl,r.EntityID),v(27,29,t.pageData.Filter.CompareFrom,"ddMMyyyy"),v(28,32,t.pageData.Filter.CompareTo,"ddMMyyyy"))),o(3),D(" ",g(30,35,e.CountOrder1)),o(3),F(g(33,37,e.Quantity1)),o(3),F(g(36,39,e.BasketSize1)),o(3),F(g(39,41,e.BasketValue1)),o(3),F(g(42,43,e.Sales1)),o(3),F(g(45,45,e.AverageDailySales1))}}function nT(i,s){if(i&1&&(n(0,"table",14)(1,"thead",22)(2,"tr",23)(3,"th",24)(4,"h2")(5,"a",25),p(6),a()()()(),n(7,"tr")(8,"th",26),p(9," Sales Person"),a(),n(10,"th",27)(11,"span"),p(12),d(13,"date"),a(),p(14," - "),n(15,"span"),p(16),d(17,"date"),a()(),n(18,"th",28)(19,"span"),p(20),d(21,"date"),a(),p(22," - "),n(23,"span"),p(24),d(25,"date"),a()()(),n(26,"tr",29)(27,"th",30),p(28," Ordr"),a(),n(29,"th",31),p(30,"Qty"),a(),n(31,"th",31),b(32,"i",32),a(),n(33,"th",33),p(34,"Basket Value"),a(),n(35,"th",33),p(36,"Sales"),a(),n(37,"th",33),p(38,"Avg Daily"),a(),n(39,"th",34),p(40,"Ordr"),a(),n(41,"th",31),p(42,"Qty"),a(),n(43,"th",31),b(44,"i",32),a(),n(45,"th",33),p(46,"Basket Value"),a(),n(47,"th",33),p(48,"Sales"),a(),n(49,"th",33),p(50,"Avg Daily"),a()()(),n(51,"tbody"),G(52,iT,46,61,"tr",null,Y),a(),n(54,"tfoot")(55,"tr",35)(56,"td"),p(57,"Total"),a(),n(58,"td",36),p(59),d(60,"sum"),d(61,"number"),a(),n(62,"td",36),p(63),d(64,"sum"),d(65,"quantityFraction"),a(),n(66,"td",36),p(67),d(68,"sum"),d(69,"quantityFraction"),a(),n(70,"td",36),p(71),d(72,"sum"),d(73,"quantityFraction"),a(),n(74,"td",36),p(75),d(76,"sum"),d(77,"amountFraction"),a(),n(78,"td",36),p(79),d(80,"sum"),d(81,"amountFraction"),a(),n(82,"td",36),p(83),d(84,"sum"),d(85,"number"),a(),n(86,"td",36),p(87),d(88,"sum"),d(89,"quantityFraction"),a(),n(90,"td",36),p(91),d(92,"sum"),d(93,"quantityFraction"),a(),n(94,"td",36),p(95),d(96,"sum"),d(97,"quantityFraction"),a(),n(98,"td",36),p(99),d(100,"sum"),d(101,"amountFraction"),a(),n(102,"td",36),p(103),d(104,"sum"),d(105,"amountFraction"),a()()()()),i&2){let e=s.$implicit,r=m(2);o(5),c("queryParams",X(90,vl,e.EntityID)),o(),F(e.EntityName),o(6),F(v(13,18,r.pageData.Filter.From,"dd MMMM yyyy")),o(4),F(v(17,21,r.pageData.Filter.To,"dd MMMM yyyy")),o(4),F(v(21,24,r.pageData.Filter.CompareFrom,"dd MMMM yyyy")),o(4),F(v(25,27,r.pageData.Filter.CompareTo,"dd MMMM yyyy")),o(28),H(e.SalesCommison),o(7),F(g(61,33,v(60,30,e.SalesCommison,"CountOrder"))),o(4),F(g(65,38,v(64,35,e.SalesCommison,"Quantity"))),o(4),F(g(69,43,v(68,40,e.SalesCommison,"BasketSize"))),o(4),F(g(73,48,v(72,45,e.SalesCommison,"BasketValue"))),o(4),F(g(77,53,v(76,50,e.SalesCommison,"Sales"))),o(4),F(g(81,58,v(80,55,e.SalesCommison,"AverageDailySales"))),o(4),F(g(85,63,v(84,60,e.SalesCommison,"CountOrder1"))),o(4),F(g(89,68,v(88,65,e.SalesCommison,"Quantity1"))),o(4),F(g(93,73,v(92,70,e.SalesCommison,"BasketSize1"))),o(4),F(g(97,78,v(96,75,e.SalesCommison,"BasketValue1"))),o(4),F(g(101,83,v(100,80,e.SalesCommison,"Sales1"))),o(4),F(g(105,88,v(104,85,e.SalesCommison,"AverageDailySales1")))}}function aT(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",3)(3,"a",4),P("click",function(){u(e);let t=m();return _(t.print())}),b(4,"i",5),p(5," Print"),a(),S(6,eT,3,0,"a",6),n(7,"div",7)(8,"button",8),p(9," More "),a(),n(10,"ul",9)(11,"li")(12,"a",10),p(13,"Summary"),a()(),n(14,"li")(15,"a",10),p(16,"By Employee"),a()(),n(17,"li")(18,"a",10),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",11),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),E(26,tT,13,9,"ng-template",null,0,O),a(),n(28,"content")(29,"div",12)(30,"div",13),G(31,nT,106,92,"table",14,Y),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(6),y(e.roleService!=null&&e.roleService.global.Export?6:-1),o(6),c("routerLink",M(16,Uw)),o(3),c("routerLink",M(17,zw)),o(3),c("routerLink",M(18,Kw)),o(3),c("routerLink",M(19,Xw))("queryParams",fe(20,Jw,v(22,10,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),v(23,13,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(10),H(e.data==null?null:e.data.Data)}}var ao=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesPersonCommissionGroupByOutlet","ReportLoader/GetSalesPersonCommissionGroupByOutlet",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.loaderPayload.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Commission Report",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionGroupByOutlet",Value:"Default",FileName:"Outlet Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}onChangeFilterDate1(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to,this.onFilterFromDate(),this.onFilterToDate()}onChangeFilterDate2(e){this.pageData.Filter.CompareFrom=e.from,this.pageData.Filter.CompareTo=e.to}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(Ne))};static \u0275cmp=B({type:i,selectors:[["POS-sales-person-by-outlet"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],[1,"btn","btn-outline-secondary","ms-3"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","mb-10"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to"],[1,"mt-0"],[1,"thead-light"],[2,"border","none !important"],["colspan","14",1,"text-center","bg-white","border-none"],["routerLink","/menu/Outlets/Master/Outlets/Info",3,"queryParams"],["rowspan","2","colspan","1",1,"border-end","text-center",2,"width","280px"],["colspan","6",1,"text-center"],["colspan","6",1,"text-center","border-start"],[1,"border-top-2"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end",2,"width","50px"],[1,"text-end",2,"width","50px"],["matTooltip","Basket Size","matTooltipPosition","above",1,"fa-solid","fa-cart-shopping"],[1,"text-end",2,"width","100px"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end","border-start",2,"width","50px"],[1,"table-footer","fw-bold"],[1,"text-end"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],["routerLink","/menu/Reports/Sales_Report/Standard/Detail",3,"queryParams"]],template:function(r,t){r&1&&S(0,aT,33,23,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,L,R,ie,Gt,U,ze,se,re,oe,Z,ne],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}}"]})};var oo=class i{onPanelShow(){setTimeout(()=>{let s=document.querySelector(".p-multiselect-filter-container input.p-multiselect-filter");s&&(s.focus(),s.select?.())},0)}static \u0275fac=function(e){return new(e||i)};static \u0275dir=pn({type:i,selectors:[["","autoFocusMultiselect",""]],hostBindings:function(e,r){e&1&&P("onPanelShow",function(){return r.onPanelShow()})}})};var rT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],lT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],pT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],mT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],sT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],cT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],wl=i=>({ID:i});function dT(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Date Value"),a(),n(2,"radio-options",35),h("modelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ReleasedType,t)||(l.pageData.Filter.ReleasedType=t),_(t)}),a()}if(i&2){let e=m(2);o(2),f("model",e.pageData.Filter.ReleasedType),c("options",e.pageData.Options==null?null:e.pageData.Options.ReleasedType)}}function uT(i,s){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Product Tag"),a(),n(9,"p-multiselect",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListTagID,t)||(l.pageData.Filter.ListTagID=t),_(t)}),a(),S(10,dT,3,2),n(11,"h6"),p(12,"Release Date"),a(),n(13,"div",22)(14,"datepicker",23),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ReleasedFrom,t)||(l.pageData.Filter.ReleasedFrom=t),_(t)}),a(),n(15,"datepicker",24),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ReleasedTo,t)||(l.pageData.Filter.ReleasedTo=t),_(t)}),a()(),n(16,"h6",25)(17,"div",26),p(18,"Number Of Interval"),a(),n(19,"div",26),p(20,"Interval Of"),a()(),n(21,"div",27)(22,"input",28),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.IntervalCount,t)||(l.pageData.Filter.IntervalCount=t),_(t)}),a(),n(23,"div",29)(24,"input",30),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.IntervalDays,t)||(l.pageData.Filter.IntervalDays=t),_(t)}),a(),n(25,"span",31),p(26,"Days"),a()()(),n(27,"h6"),p(28,"Page Size"),a(),n(29,"input",32),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(30,"h6"),p(31,"Purchased"),a(),n(32,"radio-options",33),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PurchaseType,t)||(l.pageData.Filter.PurchaseType=t),_(t)}),a(),n(33,"h6"),p(34,"Scope"),a(),n(35,"radio-options",33),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(36,"h6"),p(37,"Options"),a(),n(38,"radio-options",34),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.HideZero,t)||(l.pageData.Filter.HideZero=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("isInitializedCategoryLabel",!0)("showClear",!0),o(3),f("ngModel",e.pageData.Filter.ListTagID),c("options",e.pageData.Options.Tags)("showClear",!0)("maxSelectedLabels",5),o(),y((e.pageData.Filter.ListTagID==null?null:e.pageData.Filter.ListTagID.length)<=1?10:-1),o(4),f("date",e.pageData.Filter.ReleasedFrom),o(),f("date",e.pageData.Filter.ReleasedTo),o(7),f("ngModel",e.pageData.Filter.IntervalCount),o(2),f("ngModel",e.pageData.Filter.IntervalDays),o(5),c("max",1e3),f("ngModel",e.pageData.Filter.RowCount),o(3),f("model",e.pageData.Filter.PurchaseType),c("options",e.pageData.Options==null?null:e.pageData.Options.PurchaseType),o(3),f("model",e.pageData.Filter.GroupByProduct),c("options",e.scopeFilter),o(3),f("model",e.pageData.Filter.HideZero),c("options",e.hideZeroOptions)}}function _T(i,s){if(i&1){let e=I();n(0,"button",36),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",37),p(2," Export "),a()}}function gT(i,s){if(i&1&&(n(0,"th",38),p(1),a(),n(2,"th",39),p(3," % "),a()),i&2){let e=s.$index,r=m();c("mat-sort-header","Interval"+e)("matTooltip"," Quantity Sold "+(e*r.intervalDays()+1)+" - "+(e+1)*r.intervalDays()+" Days since Release Date"),o(),D(" ",e*r.intervalDays()+1+"-"+(e+1)*r.intervalDays()," "),o(),c("mat-sort-header","Percentage"+e)("matTooltip"," Percentage Sold "+(e*r.intervalDays()+1)+" - "+(e+1)*r.intervalDays()+" Days since Release Date")}}function CT(i,s){if(i&1&&(n(0,"th",40),d(1,"date"),d(2,"date"),p(3," TOT "),a(),n(4,"th",41),d(5,"date"),d(6,"date"),p(7," % "),a()),i&2){let e=m();c("matTooltip","Total items sold"+(e.pageData.Filter.ReleasedFrom&&e.pageData.Filter.ReleasedTo?` in this period
|
|
9
9
|
`+v(1,2,e.pageData.Filter.ReleasedFrom,"dd MMM yyyy")+" - "+v(2,5,e.pageData.Filter.ReleasedTo,"dd MMM yyyy"):"")),o(4),c("matTooltip","Total Percentage items sold"+(e.pageData.Filter.ReleasedFrom&&e.pageData.Filter.ReleasedTo?` in this period
|
|
10
|
-
`+v(5,8,e.pageData.Filter.ReleasedFrom,"dd MMM yyyy")+" - "+v(6,11,e.pageData.Filter.ReleasedTo,"dd MMM yyyy"):""))}}function
|
|
11
|
-
To : `+v(3,6,e.To,"dd MMM yyyy")),o(3),D(" ",g(5,9,e.Value)," "),o(4),D(" ",v(9,11,e.Percentage,"1.0-0"),"%")}}function wT(i,s){if(i&1&&(n(0,"td",51)(1,"span"),p(2),d(3,"number"),a()(),n(4,"td",54)(5,"small"),p(6),d(7,"number"),a()()),i&2){let e=m(2).$implicit;o(2),F(g(3,2,e==null?null:e.IntervalTotal)),o(4),D("",v(7,4,e==null?null:e.IntervalPercentage,"1.0-0"),"%")}}function TT(i,s){if(i&1&&S(0,wT,8,7),i&2){let e=m().$implicit;y((e==null||e.Intervals==null?null:e.Intervals.length)>0?0:-1)}}function PT(i,s){if(i&1){let e=I();n(0,"tr")(1,"td")(2,"div",42)(3,"div",43),S(4,hT,0,0)(5,ST,1,0,"img",44),n(6,"img",45),P("click",function(t){u(e);let l=m();return _(l.onZoomImage(t,t))}),a()(),n(7,"div",46),S(8,yT,2,4,"a",47)(9,DT,2,4,"a",48),n(10,"small",49),p(11),a()()()(),n(12,"td")(13,"div",46)(14,"div"),p(15),d(16,"date"),a(),n(17,"small",50),d(18,"date"),d(19,"date"),p(20),d(21,"number"),a()()(),n(22,"td",51),p(23),d(24,"number"),a(),G(25,vT,10,14,null,null,Yi),n(27,"td",51)(28,"span"),p(29),d(30,"number"),a()(),n(31,"td",52)(32,"small"),p(33),d(34,"number"),a()(),S(35,TT,1,1),n(36,"td",51),p(37),d(38,"number"),a()()}if(i&2){let e=s.$implicit,r=m();o(4),y(e.ThumbnailUrl?4:5),o(2),c("src",Ct(e.ThumbnailUrl),rn),o(2),y(!(r.pageData==null||r.pageData.Filter==null)&&r.pageData.Filter.GroupByProduct?8:9),o(3),F(e.Code),o(4),D(" ",v(16,13,e.Released,"dd MMM yyyy")," "),o(2),c("matTooltip",v(18,16,e.Released,"dd MMM yyyy")+" - "+v(19,19,r.today,"dd MMM yyyy")),o(3),D("",g(21,22,e.ReleasedDays)," days"),o(3),F(g(24,24,e.Purchased)),o(2),H(e==null?null:e.Intervals),o(4),F(g(30,26,e==null||e.SoldUntilNow==null?null:e.SoldUntilNow.Value)),o(4),D(" ",v(34,28,e==null?null:e.SoldUntilNowPercentage,"1.0-0"),"%"),o(2),y((e==null||e.Intervals==null?null:e.Intervals.length)>0?35:-1),o(2),F(g(38,31,e.Inventory))}}function FT(i,s){if(i&1){let e=I();n(0,"POS-complex-pagination",55),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()}if(i&2){let e=m();c("total",e.data==null||e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var ro=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/ProductTags","ReportLoader/ProductTags",null,t,!0);this.biggerPictureService=l;this.role=h;this.dialog=T}intervalDays=dt(30);today=new Date;defaultReleasedType=dt(0);hideZeroOptions=[{Key:!1,Value:"All"},{Key:!0,Value:"Hide Zero"}];scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];postInit(e){let r=JSON.parse(JSON.stringify(e));this.data.Data=r.Data.map((t,l)=>(t.Intervals=t?.Intervals.map((h,T)=>(t[`Interval${T}`]=h.Value,h.Percentage=this.calculatePercentage(h.Value,t.Purchased),t[`Percentage${T}`]=h.Percentage,h)),t.SoldUntilNowPercentage=this.calculatePercentage(t.SoldUntilNow?.Value,t.Purchased),t.IntervalTotal=t?.Intervals?.reduce((h,T)=>h+T.Value,t?.SoldUntilNow?.Value),t.IntervalPercentage=this.calculatePercentage(t.IntervalTotal,t.Purchased),t.ReleasedDays=this.calculateReleasedDate(t.Released),t.SoldNow=t.SoldUntilNow?.Value,t)),this.originalData=JSON.parse(JSON.stringify(this.data.Data)),this.intervalDays.set(this.pageData.Filter.IntervalDays)}calculateReleasedDate(e){let r=0;if(e){let t=new Date,l=new Date(e);r=V.differentInDays(l,t)}return r}calculatePercentage(e,r){let t=0;return r!==0&&(t=e/r*100),t}preInitList(){this.pageData.Filter.ListIDs=this.loaderPayload.ListIDs,this.pageData.Filter.ReleasedFrom=null,this.pageData.Filter.ReleasedTo=null,this.defaultReleasedType.set(this.pageData.Filter.ReleasedType)}onZoomImage(e,r){this.biggerPictureService.openBiggerPicture(e,r)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";return this.compare(t[e.active],l[e.active],h)})}openExportModal(){this.dialog.open(K,{data:{title:"Product Tags",exportTypes:[{ID:"ReportExport/ProductTags",Value:"Default",FileName:"Product Tags"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ProductTagsCount",pagination:!0}})}onProductTagChange(){(this.pageData.Filter.ListTagID?.length||0)>1&&(this.pageData.Filter.ReleasedType=this.defaultReleasedType())}preGetList(){(this.pageData.Filter.ListTagID?.length||0)>1&&(this.pageData.Filter.ReleasedType=this.defaultReleasedType()),super.preGetList()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(Ne),w(An),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-products-tags"]],standalone:!1,features:[W],decls:53,vars:23,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","hideSearchBox"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","ReleasedDays",2,"width","90px"],["matTooltip","Total number of Quantity Ordered since Created","matTooltipPosition","above",1,"text-end",2,"width","90px"],["mat-sort-header","SoldNow","arrowPosition","before","matTooltipPosition","above",1,"text-end",2,"width","58px",3,"matTooltip"],["mat-sort-header","Percentage","arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end",2,"width","10px",3,"matTooltip"],["mat-sort-header","Inventory","arrowPosition","before","matTooltip","Total On Hand Inventory Now",1,"text-end",2,"width","60px"],["api","Report/ProductTagsCount",3,"total","pageData"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["required","true","message","Category is Required",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","isInitializedCategoryLabel","showClear"],["optionLabel","Name","optionValue","ID","name","ListTagID","placeholder","Choose Product Tag","display","chip","fluid","","autoFocusMultiselect","",3,"ngModelChange","ngModel","options","showClear","maxSelectedLabels"],[1,"d-flex",2,"column-gap","4%"],["name","RelesedFrom",2,"width","48%",3,"dateChange","date"],["name","RelesedTo",2,"width","48%",3,"dateChange","date"],[1,"d-flex","align-items-start",2,"column-gap","19px"],[1,"w-100"],[1,"d-flex","align-items-center",2,"column-gap","4%"],["type","number","name","QuantityFrom",1,"form-control","input-filter",2,"width","93.5%",3,"ngModelChange","ngModel"],[1,"input-group"],["type","number","name","QuantityTo",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"input-group-text","rounded-end-1","input-filter","bg-body-tertiary"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Scope",3,"modelChange","model","options"],[3,"modelChange","model","options"],["name","ReleasedType",3,"modelChange","model","options"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["arrowPosition","before","matTooltipPosition","above",1,"text-end",2,"width","70px",3,"mat-sort-header","matTooltip"],["arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end",2,"width","10px",3,"mat-sort-header","matTooltip"],["mat-sort-header","IntervalTotal","arrowPosition","before","matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",1,"text-end",2,"width","60px",3,"matTooltip"],["mat-sort-header","IntervalPercentage","arrowPosition","before","matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",1,"text-end",2,"width","10px",3,"matTooltip"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px"],["matTooltipPosition","above","matTooltip","Click to zoom",2,"width","40px",3,"click","src"],[1,"lh-base"],["routerLink","/menu/Products/Catalog/Products/Info","target","_blank",3,"queryParams"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[1,"d-block"],["matTooltipPosition","above",1,"text-success",3,"matTooltip"],[1,"text-end"],[1,"text-end","border-end","text-success"],["matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",3,"matTooltip"],[1,"text-end","text-success"],["api","Report/ProductTagsCount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"filters"),E(2,gT,39,24,"ng-template",null,0,O),a(),n(4,"actions"),S(5,CT,3,0,"button",2),n(6,"div",3)(7,"button",4),p(8," More "),a(),n(9,"ul",5)(10,"li")(11,"a",6),p(12," Product Sold "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()(),n(16,"li")(17,"a",6),p(18," Compare by Month "),a()(),n(19,"li")(20,"a",6),p(21," Compare with Transfer Order "),a()(),n(22,"li")(23,"a",6),p(24," Top Suppliers "),a()(),n(25,"li")(26,"a",6),p(27," Quantity Sold Chart "),a()()()()(),n(28,"content")(29,"div",7)(30,"div",8)(31,"table",9),P("matSortChange",function(T){return u(l),_(t.sortData(T))}),n(32,"thead",10)(33,"tr")(34,"th",11),p(35,"Name"),a(),n(36,"th",12),p(37," Released "),a(),n(38,"th",13),p(39," Purchased "),a(),G(40,fT,4,5,null,null,Yi),n(42,"th",14),p(43),a(),n(44,"th",15),p(45," % "),a(),S(46,xT,8,14),n(47,"th",16),p(48," On Hand "),a()()(),n(49,"tbody"),G(50,PT,39,33,"tr",null,Y),a()()(),S(52,FT,1,2,"POS-complex-pagination",17),a()()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("hideSearchBox",!0),o(5),y(!(t.role==null||t.role.global==null)&&t.role.global.Export?5:-1),o(6),c("routerLink",M(17,pT)),o(3),c("routerLink",M(18,mT)),o(3),c("routerLink",M(19,sT)),o(3),c("routerLink",M(20,cT)),o(3),c("routerLink",M(21,dT)),o(3),c("routerLink",M(22,uT)),o(14),H(t.data==null||t.data.Data[0]==null?null:t.data.Data[0].Intervals),o(2),c("matTooltip"," Quantity Sold "+((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()+1)+" - Today since Release Date"),o(),D(" > ",(t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()," "),o(),c("matTooltip"," Percentage Sold "+((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()+1)+" - Today since Release Date"),o(2),y((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)>0?46:-1),o(4),H(t.data==null?null:t.data.Data),o(2),y((t.data==null||t.data.Data==null?null:t.data.Data.length)>0?52:-1))},dependencies:[A,Q,J,Qe,$o,L,R,ie,pe,ge,Ue,Te,Et,Ce,U,yr,oo,re,oe],encapsulation:2})};var IT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],bT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],ET=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],MT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],VT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],BT=()=>["/menu/Contacts/Contact/Customers/Info"],OT=i=>({ID:i}),LT=()=>["/menu/Reports/Sales_Report/Standard/Summary"],RT=i=>({CustomerID:i});function kT(i,s){if(i&1){let e=I();n(0,"a",12),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function WT(i,s){if(i&1){let e=I();n(0,"div",14)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",16),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",17)(9,"datepicker",18),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function NT(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",19),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),d(11,"date"),a(),n(12,"td"),p(13),a(),n(14,"td")(15,"a",19),p(16),a()(),n(17,"td"),p(18),d(19,"number"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(19,BT))("queryParams",X(20,OT,e.CustomerID)),o(),F(e.Name),o(2),F(e.Mobile),o(2),F(v(8,11,e.FirstPurchase,"dd/MM/yyyy")),o(3),F(v(11,14,e.LastPurchase,"dd/MM/yyyy")),o(3),F(e.Days),o(2),c("routerLink",M(22,LT))("queryParams",X(23,RT,e.CustomerID)),o(),F(e.Orders),o(2),F(g(19,17,e.Amount))}}function AT(i,s){if(i&1&&(n(0,"tbody",11),G(1,NT,20,25,"tr",null,Y),a()),i&2){let e=m();o(),H(e.data.Data)}}var lo=class i extends De{constructor(e,r,t,l,h){super(e,r,"SalesReport/CustomerLastPurchase");this.httpService=r;this.matDialog=t;this.datePipe=l;this.roleService=h}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}openExportModal(){this.matDialog.open(K,{data:{title:"Customer Last Purchase",exportTypes:[{ID:"ReportExport/CustomerLastPurchase",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(z),w(oe),w(j))};static \u0275cmp=B({type:i,selectors:[["POS-last-purchase"]],standalone:!1,features:[W],decls:45,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["matTooltipPosition","above","matTooltip","(Todays - last purchase date)"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,kT,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Customer Group "),a()()()()(),n(22,"filters"),E(23,WT,10,6,"ng-template",null,0,O),a(),n(25,"content")(26,"div",7)(27,"table",8)(28,"thead",9)(29,"tr")(30,"th"),p(31,"Name"),a(),n(32,"th"),p(33,"Mobile"),a(),n(34,"th"),p(35,"First Purchase"),a(),n(36,"th"),p(37,"Last Purchase"),a(),n(38,"th",10),p(39,"Days Ago"),a(),n(40,"th"),p(41,"Orders"),a(),n(42,"th"),p(43,"Amount"),a()()(),S(44,AT,3,0,"tbody",11),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,IT)),o(3),c("routerLink",M(12,bT)),o(3),c("routerLink",M(13,ET)),o(3),c("routerLink",M(14,MT)),o(3),c("routerLink",M(15,VT)),o(24),y(t.data?44:-1))},dependencies:[A,Q,J,L,R,ie,U,re,oe],encapsulation:2})};var Ht=Jt(bi());var GT=["outletSelectorRef"],HT=(i,s)=>s.Key;function QT(i,s){if(i&1){let e=I();n(0,"mat-chip",9),P("removed",function(){let t=u(e).$implicit,l=m();return _(l.onRemoveHandler(t))}),n(1,"span",10),p(2),a(),n(3,"button",11),b(4,"i",12),a()()}if(i&2){let e=s.$implicit;o(2),F(e.Value)}}var po=class i{constructor(s){this._dialogRef=s;this.modalConfig.title="Filter",this.modalConfig.customWidth="450px",this.modalConfig.headerType=zi.Success,this.pageData.set(this.data.pageData)}modalConfig=new Vn;data=Pe(Ti);pageData=dt(null);injector=Pe(on);variant$;#e=Pe(k);listVariantSelected=dt([]);toastr=Pe(qe);route=Pe(Ne);outletSelector;itemHashMap=new Map;router=Pe(_n);productOrVarariantAPIURL=dt("");minDateFrom=dt((0,Ht.default)().subtract(90,"days"));maxDateFrom=dt((0,Ht.default)().subtract(2,"days"));minDateTo=dt((0,Ht.default)().subtract(90,"days"));maxDateTo=dt((0,Ht.default)());scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];ngOnInit(){this.initializePageData(),this.handleQueryParams(),this.fetchVariantItems()}ngAfterViewChecked(){}get tooltipMessage(){return this.pageData()?this.pageData().Filter.GroupByVariant?"Max input 5 Variant":"Max input 5 Product":""}initializePageData(){Cn(this.pageData,{injector:this.injector}).pipe(ri(s=>!!s),nn(),Nt(s=>{let e=s.Filter.GroupByVariant?"/API/AC/GetVariantSuggestionByCodeNName":"/api/ac/GetProductSuggestionByCodeNName";this.productOrVarariantAPIURL.set(e)})).subscribe()}handleQueryParams(){this.route.queryParamMap.pipe(Nt(s=>{s.keys.length>0?this.pageData.update(e=>nt(et({},e),{Filter:nt(et({},e.Filter),{From:s.get("From"),To:s.get("To"),ListIDs:s.get("ListIDs")?s.get("ListIDs").split(","):[],ListVariantID:s.get("ListVariantID")?s.get("ListVariantID").split(","):[],GroupByVariant:JSON.parse(s.get("GroupByVariant"))||!1})})):(this.maxDateFrom.set((0,Ht.default)().subtract(2,"days")),this.minDateFrom.set((0,Ht.default)().subtract(90,"days")),this.pageData.update(e=>nt(et({},e),{Filter:nt(et({},e.Filter),{From:(0,Ht.default)().subtract(7,"days").format("YYYY-MM-DDTHH:mm:ss.SSS")})}))),this.listVariantSelected.set([])})).subscribe()}mergeAndReplaceWithSet(s,e,r){let t=[...s,...e];return Array.from(new Set(t.map(h=>h[r]))).map(h=>t.find(T=>T[r]===h))}fetchVariantItems(){this.route.queryParamMap.pipe(ri(s=>s&&s.keys.length>0),Vo(s=>{let r=[...s.get("ListVariantID").split(","),s.get("ID")].filter(h=>h),t=JSON.parse(s.get("GroupByVariant"))?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID",l={[JSON.parse(s.get("GroupByVariant"))?"ListVariantID":"ListProductID"]:[...new Set(r)]};return this.#e.post(t,l).pipe(Qi(()=>ci(null)))}),ri(s=>!!s),Nt(s=>{this.listVariantSelected.set(this.mergeAndReplaceWithSet(this.listVariantSelected(),s,"Key"))})).subscribe()}onVariantSelected(s){let e=this.pageData().Filter.GroupByVariant?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID",r={[this.pageData().Filter.GroupByVariant?"ListVariantID":"ListProductID"]:[JSON.parse(s).Key]};this.#e.post(e,r).pipe(Qi(()=>ci(null)),Nt(t=>{this.listVariantSelected.set(this.mergeAndReplaceWithSet(this.listVariantSelected(),t,"Key"))})).subscribe()}onScopeChange(s){this.pageData.update(e=>nt(et({},e),{Filter:nt(et({},e.Filter),{GroupByVariant:s})})),this.listVariantSelected.set([])}onRemoveHandler(s){this.listVariantSelected.set(this.listVariantSelected().filter(e=>e.Key!==s.Key))}onOk(){if(Array.isArray(this.listVariantSelected())&&this.listVariantSelected().length<=0){this.toastr.warning("Please select at least one variant",zi.Warning);return}this.pageData.update(e=>nt(et({},e),{Filter:nt(et({},e.Filter),{ListVariantID:[...this.listVariantSelected().map(r=>r.Key)]})})),this._dialogRef.close({role:"OK",data:et({},this.pageData())}),this.router.navigate(["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],{queryParams:{From:(0,Ht.default)(this.pageData().Filter.From).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,Ht.default)(this.pageData().Filter.To).format("YYYY-MM-DDTHH:mm:ss.SSS"),GroupByVariant:JSON.stringify(this.pageData().Filter.GroupByVariant),ListIDs:this.pageData().Filter.ListIDs.join(","),ListVariantID:this.pageData().Filter.ListVariantID.join(",")},queryParamsHandling:"merge",replaceUrl:!0})}close(){this._dialogRef.close({role:"close",data:null})}static \u0275fac=function(e){return new(e||i)(w(wi))};static \u0275cmp=B({type:i,selectors:[["pos-dialog-prod-sales-qty-chart"]],viewQuery:function(e,r){if(e&1&&sn(GT,5),e&2){let t;_i(t=gi())&&(r.outletSelector=t.first)}},decls:22,vars:17,consts:[[3,"onOk","onCancel","onClose","config"],[1,"d-flex","flex-column","gap-4"],[1,"d-flex","flex-column","gap-2"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["inputID","Key","placeholder","Search an Variant or Product",1,"w-100",3,"optionSelected","matTooltip","readonly","requestUrl","clearOnSelect"],["aria-label","Fish selection"],["name","From",3,"dateChange","maxDateValidation","minDateValidation","date"],["name","To",3,"dateChange","maxDateValidation","minDateValidation","date"],["name","Scope",3,"modelChange","model","options"],[3,"removed"],[1,"d-inline-block","text-truncate",2,"max-width","150px"],["matChipRemove",""],[1,"fa-solid","fa-circle-xmark"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.close()})("onClose",function(){return r.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",3),x("ngModelChange",function(l){return f(r.pageData().Filter.ListIDs,l)||(r.pageData().Filter.ListIDs=l),l}),a()(),n(7,"div",2)(8,"h6"),p(9,"Product to Analyze"),a(),n(10,"autocompleteV2",4),P("optionSelected",function(l){return r.onVariantSelected(l)}),a(),n(11,"mat-chip-set",5),G(12,QT,5,1,"mat-chip",null,HT),a()(),n(14,"div",2)(15,"h6"),p(16,"From - To"),a(),n(17,"datepicker",6),x("dateChange",function(l){return f(r.pageData().Filter.From,l)||(r.pageData().Filter.From=l),l}),a(),n(18,"datepicker",7),x("dateChange",function(l){return f(r.pageData().Filter.To,l)||(r.pageData().Filter.To=l),l}),a()(),n(19,"h6"),p(20,"Scope"),a(),n(21,"radio-options",8),P("modelChange",function(l){return r.onScopeChange(l)}),a()()()()),e&2&&(c("config",r.modalConfig),o(6),c("multiple",!0)("accessType",2)("outlets",r.pageData().Options.Entities),C("ngModel",r.pageData().Filter.ListIDs),o(4),c("matTooltip",r.tooltipMessage)("readonly",r.listVariantSelected().length>=5)("requestUrl",r.productOrVarariantAPIURL())("clearOnSelect",!0),o(2),H(r.listVariantSelected()),o(5),c("maxDateValidation",r.maxDateFrom())("minDateValidation",r.minDateFrom()),C("date",r.pageData().Filter.From),o(),c("maxDateValidation",r.maxDateTo())("minDateValidation",r.minDateTo()),C("date",r.pageData().Filter.To),o(3),c("model",r.pageData().Filter.GroupByVariant)("options",r.scopeFilter))},dependencies:[At,L,R,Ii,Bn,Pi,U,Ei,J,Rr,Or,Br,Lr,Wn,Te,kn,Ae,hn,ie],styles:["[_nghost-%COMP%]{display:block}"]})};var ni=Jt(bi()),Tl=Jt(Po());var YT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],jT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],qT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],UT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],zT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],KT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"];function XT(i,s){}Gn(Tl.default);var mo=class i{constructor(s,e,r,t,l,h,T,Ze,Ni){this.route=s;this.httpService=e;this.pageSetupService=r;this.matDialog=t;this.toastr=l;this.title=h;this.cdr=T;this.injector=Ze;this.router=Ni}loader$;chartData$;dialogOpened=!1;colorsChart=["#FF0060","#131010","#00DFA2","#fcbf49","#0079FF"];seriesData=dt(null);Highcharts=dt(Bi);variantOrProductItems=dt([]);menu$;ngOnInit(){this.initializeLoader(),this.pageSetupService.setMenu$(),this.handleVariantOrProductItems(),this.handleChartQuantitySold(),this.loadInitialData()}ngAfterViewInit(){this.updateChartOptions()}initializeLoader(){if(this.route.snapshot.queryParamMap.keys.length>0){let e=this.route.snapshot.queryParamMap.get("From"),r=this.route.snapshot.queryParamMap.get("To"),t=(0,ni.default)(e).isSame((0,ni.default)(r),"day");this.router.navigate([],{queryParams:{From:t?(0,ni.default)(r).subtract(6,"days").format("YYYY-MM-DDTHH:mm:ss.SSS"):(0,ni.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,ni.default)(this.route.snapshot.queryParamMap.get("To")).format("YYYY-MM-DDTHH:mm:ss.SSS")},queryParamsHandling:"merge",replaceUrl:!0})}this.loader$=this.httpService.post("/API/SalesReportLoader/GetChartQuantitySold",{}).pipe(jt(1))}parseQueryParams(s){let e=s.get("ID")?[s.get("ID")]:s.get("ListVariantID")?[...s.get("ListVariantID").split(",")]:[];return{ListVariantID:[...new Set(e)],GroupByVariant:JSON.parse(s.get("GroupByVariant")||"false"),From:(0,ni.default)(s.get("From")).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,ni.default)(s.get("To")).format("YYYY-MM-DDTHH:mm:ss.SSS"),ListIDs:s.get("ListIDs")?s.get("ListIDs").split(","):[]}}fetchVariantOrProductItems(s,e){let r=e?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID";return this.httpService.post(r,{[e?"ListVariantID":"ListProductID"]:s}).pipe(ri(t=>!!t),oi(t=>({Key:t.Key,Value:t.Value})),jt(1))}fetchChartQuantitySold(s){return this.httpService.post("/API/SalesReport/GetChartQuantitySold",s).pipe(oi(e=>nt(et({},e),{chart:{type:"spline"},series:e.Data.Series.map((r,t)=>nt(et({},r),{data:r.data,name:r.name,color:this.colorsChart[t]}))})),Nt(e=>{Object.prototype.hasOwnProperty.call(e,"ErrorMessage")&&this.toastr.error(e.ErrorMessage,"API Error - 400")}),Qi(e=>ci(null)),jt(1))}handleVariantOrProductItems(){let s=this.route.snapshot.queryParamMap,{ListVariantID:e,GroupByVariant:r}=this.parseQueryParams(s);this.fetchVariantOrProductItems(e,r).pipe(Nt(t=>{this.variantOrProductItems.set([...this.variantOrProductItems(),t])})).subscribe()}handleChartQuantitySold(){this.chartData$=this.loader$.pipe(Bo(100),_o(s=>{let e=this.route.snapshot.queryParamMap;if(e&&e.keys.length>0){let r=this.parseQueryParams(e);return this.fetchChartQuantitySold(r)}else return this.dialogOpened||(this.openDialogFilter(),this.dialogOpened=!0),this.fetchChartQuantitySold(s.Filter)}),jt(1)),uo([this.chartData$,this.pageSetupService.menu$]).pipe(oi(([s,e])=>({chartData:s,menu:nt(et({},e),{H:s.FullPageTitle,T:e.T.replace("undefined",s.FullPageTitle)})})),Nt(({chartData:s,menu:e})=>{this.menu$=ci(e),this.seriesData.set(s.Data),this.title.setTitle(e.T),this.cdr.markForCheck()})).subscribe()}loadInitialData(){this.chartData$.subscribe()}getCookie(s){let e=document.cookie.match(new RegExp("(?:^|; )"+s.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}updateChartOptions(){Cn(this.seriesData,{injector:this.injector}).pipe(ri(s=>!!s),nn(),Nt(s=>Bi.chart("chart-container",{time:{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},chart:{type:"spline",style:{fontFamily:"Roboto Slab, sans-serif"}},title:{text:""},tooltip:{enabled:!0,xDateFormat:"%e %b",shared:!0},credits:{enabled:!1},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom",backgroundColor:Bi.defaultOptions.legend.backgroundColor||"#FFFFFF"},yAxis:{title:{text:""}},xAxis:{type:"datetime",dateTimeLabelFormats:{day:"%e %b",week:"%e %m",month:"%e %m",year:"%e %m"},labels:{format:"{value:%e %b}"}},plotOptions:{series:{label:{enabled:!0},pointStart:new Date(s.From).getTime(),pointInterval:24*3600*1e3},line:{dataLabels:{enabled:!0,filter:{property:"y",operator:">",value:0}}}},series:s.Series.map((e,r)=>nt(et({},e),{color:this.colorsChart[r]}))}))).subscribe()}openDialogFilter(){uo([this.loader$]).pipe(oi(([s])=>({loader:s})),_o(({loader:s})=>{let e=this.getCookie("ReportFilter")?JSON.parse(this.getCookie("ReportFilter")):null,r=nt(et({},s),{Filter:nt(et({},s.Filter),{From:e?e.from:s.Filter.From,To:e?e.to:s.Filter.To})});return this.matDialog.open(po,{data:{pageData:r}}).afterClosed()}),Nt(()=>{this.handleChartQuantitySold()})).subscribe()}static \u0275fac=function(e){return new(e||i)(w(Ne),w(k),w(N),w(z),w(qe),w(Ko),w(Qo),w(on),w(_n))};static \u0275cmp=B({type:i,selectors:[["pos-product-sales-qty-chart"]],decls:35,vars:17,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","custom-header",5,["custom-header"]],[1,"d-flex","align-items-center","gap-4",2,"margin","0.6rem 0"],[1,"d-flex","pe-auto",2,"cursor","pointer",3,"click"],[1,"fa","fa-filter"],[1,"fa-solid","fa-caret-down"],["ngProjectAs","actions",5,["actions"]],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["filters",""],["id","chart-container",2,"margin","1.5rem 0.3rem"]],template:function(e,r){if(e&1){let t=I();n(0,"mainpanel-cmp",1),d(1,"async"),pt(2,2),n(3,"nav",3)(4,"div",4),P("click",function(){return u(t),_(r.openDialogFilter())}),b(5,"i",5)(6,"i",6),a()(),mt(),pt(7,7),n(8,"div",8)(9,"button",9),p(10," More "),a(),n(11,"ul",10)(12,"li")(13,"a",11),p(14," Product Sold "),a()(),n(15,"li")(16,"a",11),p(17," Compare by Outlet "),a()(),n(18,"li")(19,"a",11),p(20," Compare by Month "),a()(),n(21,"li")(22,"a",11),p(23," Compare with Transfer Order "),a()(),n(24,"li")(25,"a",11),p(26," Product Tags Analysis "),a()(),n(27,"li")(28,"a",11),p(29," Top Suppliers "),a()()()(),mt(),pt(30,12),E(31,XT,0,0,"ng-template",null,0,O),mt(),n(33,"content"),b(34,"div",13),a()()}e&2&&(c("pageData",g(1,9,r.menu$))("hideSearchBox",!0)("hideSearchDropdown",!0),o(13),c("routerLink",M(11,YT)),o(3),c("routerLink",M(12,jT)),o(3),c("routerLink",M(13,qT)),o(3),c("routerLink",M(14,UT)),o(3),c("routerLink",M(15,zT)),o(3),c("routerLink",M(16,KT)))},dependencies:[Si,Ui,Q,Ii,A,Ei,At,Uo],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var JT=[{path:"Sales_Report/Standard/Detail",component:Hn},{path:"Sales_Report/Standard/Summary",component:Yn},{path:"Sales_Report/Standard/Top_Brand",component:jn},{path:"Sales_Report/Standard/Top_Brand/Top_Brand_Chart",component:$a},{path:"Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis",component:Ua},{path:"Sales_Report/Standard/Top_Customers",component:Un},{path:"Sales_Report/Standard/Top_Customers/By_Last_Purchase",component:lo},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Age",component:zn},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender",component:Kn},{path:"Sales_Report/Standard/Products_Sold/Top_Suppliers",component:Xn},{path:"Sales_Report/Standard/Top_Customers/City",component:La},{path:"Sales_Report/Standard/Top_Customers/Customer_Group",component:Ra},{path:"Sales_Report/Standard/Products_Sold",component:Jn},{path:"Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",component:mo},{path:"Sales_Report/Standard/Products_Sold/Products_Tags",component:ro},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet",component:Zn},{path:"Sales_Report/Standard/Products_Sold/Product_Sales",component:$n},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics",component:ea},{path:"Sales_Report/Standard/Category_Sold",component:io},{path:"Sales_Report/Standard/Category_Sold/Category_Sales_Tree",component:ta},{path:"Sales_Report/Standard/Category_Sold/Category_By_Outlet",component:ia},{path:"Sales_Report/Standard/Category_Sold/Category",component:na},{path:"Sales_Report/Standard/Peak",component:aa},{path:"Sales_Report/Standard/Peak/Peak",component:ra},{path:"Sales_Report/Standard/Daily",component:la},{path:"Sales_Report/Standard/Daily/Daily_Table",component:ca},{path:"Sales_Report/Standard/Monthly",component:ma},{path:"Sales_Report/Standard/Monthly/Monthly_Table",component:da},{path:"Sales_Report/Standard/Yearly",component:to},{path:"Sales_Report/Standard/Yearly/Comparison",component:sa},{path:"Sales_Report/Standard/Daily/Daily_Quantity",component:ua},{path:"Sales_Report/Standard/Daily/Daily_Quantity/Monthly",component:_a},{path:"Sales_Report/Standard/Outlet_Performance",component:Ca},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Graphic",component:ga},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance",component:fa},{path:"Sales_Report/Standard/Sales_Order_Tag",component:za},{path:"Sales_Report/Standard/Person",component:ha},{path:"Sales_Report/Standard/Person/Commission_Outlet",component:ao},{path:"Sales_Report/Standard/Person/Commission_Report",component:Sa},{path:"Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",component:ya},{path:"Sales_Report/Standard/Person/Sales_Group",component:ka},{path:"Sales_Report/Standard/Discounted_Sales",component:no},{path:"Purchases_Report/Detail",component:Da},{path:"Purchases_Report/Summary",component:va},{path:"Purchases_Report/Supplier",component:wa},{path:"Purchases_Report/Product",component:Ta},{path:"Purchases_Report/History",component:Fa},{path:"Purchases_Report/Daily",component:Ia},{path:"Purchases_Report/Daily/Monthly",component:ba},{path:"Purchases_Report/Volume",component:Ea},{path:"Purchases_Report/Sales",component:Ma},{path:"Purchases_Report/Tax",component:Za},{path:"Purchases_Report/Outlet",component:Va},{path:"Purchases_Report/Outlet/Outlet_Group_Performance",component:Ba},{path:"Purchases_Report/Outlet/Outlet_Monthly_Perfomance",component:Oa},{path:"Sales_Report/Standard/Compare",component:eo},{path:"Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance",component:xa},{path:"Sales_Report/Advanced/Tax_Report",component:Wa},{path:"Sales_Report/Advanced/Visitor",component:oa},{path:"Sales_Report/Advanced/Tax_Report/By_Outlet",component:Na},{path:"Sales_Report/Advanced/Product_Life_Cycle",component:Aa},{path:"Sales_Report/Advanced/Product_Profit",component:Ga},{path:"Sales_Report/Advanced/Exchanged_Sales",component:Ha},{path:"Sales_Report/Advanced/Variant_Model_Rank",component:Qa},{path:"Sales_Report/Advanced/Logistics_Service",component:Hr},{path:"Return/Sales_Return",component:Ya},{path:"Return/Purchase_Return",component:ja},{path:"Sales_Report/Standard/Products_Sold/Invoice_Items",component:qa},{path:"Sales_Report/Standard/Price_Analysis",component:Ja},{path:"",redirectTo:"Sales_Report/Standard/Products_Sold",pathMatch:"full"}],so=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=ui({type:i});static \u0275inj=di({imports:[Ui.forChild(JT),Ui]})};var Pl=`
|
|
10
|
+
`+v(5,8,e.pageData.Filter.ReleasedFrom,"dd MMM yyyy")+" - "+v(6,11,e.pageData.Filter.ReleasedTo,"dd MMM yyyy"):""))}}function fT(i,s){}function xT(i,s){i&1&&b(0,"img",44)}function hT(i,s){if(i&1&&(n(0,"a",47),p(1),a()),i&2){let e=m().$implicit;c("queryParams",X(2,wl,e.ID)),o(),F(e.Name)}}function ST(i,s){if(i&1&&(n(0,"a",48),p(1),a()),i&2){let e=m().$implicit;c("queryParams",X(2,wl,e.ID)),o(),F(e.Name)}}function yT(i,s){if(i&1&&(n(0,"td",51)(1,"span",53),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()(),n(6,"td",52)(7,"small"),p(8),d(9,"number"),a()()),i&2){let e=s.$implicit;o(),c("matTooltip","From : "+v(2,3,e.From,"dd MMM yyyy")+`
|
|
11
|
+
To : `+v(3,6,e.To,"dd MMM yyyy")),o(3),D(" ",g(5,9,e.Value)," "),o(4),D(" ",v(9,11,e.Percentage,"1.0-0"),"%")}}function DT(i,s){if(i&1&&(n(0,"td",51)(1,"span"),p(2),d(3,"number"),a()(),n(4,"td",54)(5,"small"),p(6),d(7,"number"),a()()),i&2){let e=m(2).$implicit;o(2),F(g(3,2,e==null?null:e.IntervalTotal)),o(4),D("",v(7,4,e==null?null:e.IntervalPercentage,"1.0-0"),"%")}}function vT(i,s){if(i&1&&S(0,DT,8,7),i&2){let e=m().$implicit;y((e==null||e.Intervals==null?null:e.Intervals.length)>0?0:-1)}}function wT(i,s){if(i&1){let e=I();n(0,"tr")(1,"td")(2,"div",42)(3,"div",43),S(4,fT,0,0)(5,xT,1,0,"img",44),n(6,"img",45),P("click",function(t){u(e);let l=m();return _(l.onZoomImage(t,t))}),a()(),n(7,"div",46),S(8,hT,2,4,"a",47)(9,ST,2,4,"a",48),n(10,"small",49),p(11),a()()()(),n(12,"td")(13,"div",46)(14,"div"),p(15),d(16,"date"),a(),n(17,"small",50),d(18,"date"),d(19,"date"),p(20),d(21,"number"),a()()(),n(22,"td",51),p(23),d(24,"number"),a(),G(25,yT,10,14,null,null,Yi),n(27,"td",51)(28,"span"),p(29),d(30,"number"),a()(),n(31,"td",52)(32,"small"),p(33),d(34,"number"),a()(),S(35,vT,1,1),n(36,"td",51),p(37),d(38,"number"),a()()}if(i&2){let e=s.$implicit,r=m();o(4),y(e.ThumbnailUrl?4:5),o(2),c("src",Ct(e.ThumbnailUrl),rn),o(2),y(!(r.pageData==null||r.pageData.Filter==null)&&r.pageData.Filter.GroupByProduct?8:9),o(3),F(e.Code),o(4),D(" ",v(16,13,e.Released,"dd MMM yyyy")," "),o(2),c("matTooltip",v(18,16,e.Released,"dd MMM yyyy")+" - "+v(19,19,r.today,"dd MMM yyyy")),o(3),D("",g(21,22,e.ReleasedDays)," days"),o(3),F(g(24,24,e.Purchased)),o(2),H(e==null?null:e.Intervals),o(4),F(g(30,26,e==null||e.SoldUntilNow==null?null:e.SoldUntilNow.Value)),o(4),D(" ",v(34,28,e==null?null:e.SoldUntilNowPercentage,"1.0-0"),"%"),o(2),y((e==null||e.Intervals==null?null:e.Intervals.length)>0?35:-1),o(2),F(g(38,31,e.Inventory))}}function TT(i,s){if(i&1){let e=I();n(0,"POS-complex-pagination",55),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()}if(i&2){let e=m();c("total",e.data==null||e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var ro=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/ProductTags","ReportLoader/ProductTags",null,t,!0);this.biggerPictureService=l;this.role=C;this.dialog=T}intervalDays=dt(30);today=new Date;defaultReleasedType=dt(0);hideZeroOptions=[{Key:!1,Value:"All"},{Key:!0,Value:"Hide Zero"}];scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];postInit(e){let r=JSON.parse(JSON.stringify(e));this.data.Data=r.Data.map((t,l)=>(t.Intervals=t?.Intervals.map((C,T)=>(t[`Interval${T}`]=C.Value,C.Percentage=this.calculatePercentage(C.Value,t.Purchased),t[`Percentage${T}`]=C.Percentage,C)),t.SoldUntilNowPercentage=this.calculatePercentage(t.SoldUntilNow?.Value,t.Purchased),t.IntervalTotal=t?.Intervals?.reduce((C,T)=>C+T.Value,t?.SoldUntilNow?.Value),t.IntervalPercentage=this.calculatePercentage(t.IntervalTotal,t.Purchased),t.ReleasedDays=this.calculateReleasedDate(t.Released),t.SoldNow=t.SoldUntilNow?.Value,t)),this.originalData=JSON.parse(JSON.stringify(this.data.Data)),this.intervalDays.set(this.pageData.Filter.IntervalDays)}calculateReleasedDate(e){let r=0;if(e){let t=new Date,l=new Date(e);r=V.differentInDays(l,t)}return r}calculatePercentage(e,r){let t=0;return r!==0&&(t=e/r*100),t}preInitList(){this.pageData.Filter.ListIDs=this.loaderPayload.ListIDs,this.pageData.Filter.ReleasedFrom=null,this.pageData.Filter.ReleasedTo=null,this.defaultReleasedType.set(this.pageData.Filter.ReleasedType)}onZoomImage(e,r){this.biggerPictureService.openBiggerPicture(e,r)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";return this.compare(t[e.active],l[e.active],C)})}openExportModal(){this.dialog.open(K,{data:{title:"Product Tags",exportTypes:[{ID:"ReportExport/ProductTags",Value:"Default",FileName:"Product Tags"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ProductTagsCount",pagination:!0}})}onProductTagChange(){(this.pageData.Filter.ListTagID?.length||0)>1&&(this.pageData.Filter.ReleasedType=this.defaultReleasedType())}preGetList(){(this.pageData.Filter.ListTagID?.length||0)>1&&(this.pageData.Filter.ReleasedType=this.defaultReleasedType()),super.preGetList()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(Ne),w(An),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-products-tags"]],standalone:!1,features:[W],decls:53,vars:23,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","hideSearchBox"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","ReleasedDays",2,"width","90px"],["matTooltip","Total number of Quantity Ordered since Created","matTooltipPosition","above",1,"text-end",2,"width","90px"],["mat-sort-header","SoldNow","arrowPosition","before","matTooltipPosition","above",1,"text-end",2,"width","58px",3,"matTooltip"],["mat-sort-header","Percentage","arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end",2,"width","10px",3,"matTooltip"],["mat-sort-header","Inventory","arrowPosition","before","matTooltip","Total On Hand Inventory Now",1,"text-end",2,"width","60px"],["api","Report/ProductTagsCount",3,"total","pageData"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["required","true","message","Category is Required",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","isInitializedCategoryLabel","showClear"],["optionLabel","Name","optionValue","ID","name","ListTagID","placeholder","Choose Product Tag","display","chip","fluid","","autoFocusMultiselect","",3,"ngModelChange","ngModel","options","showClear","maxSelectedLabels"],[1,"d-flex",2,"column-gap","4%"],["name","RelesedFrom",2,"width","48%",3,"dateChange","date"],["name","RelesedTo",2,"width","48%",3,"dateChange","date"],[1,"d-flex","align-items-start",2,"column-gap","19px"],[1,"w-100"],[1,"d-flex","align-items-center",2,"column-gap","4%"],["type","number","name","QuantityFrom",1,"form-control","input-filter",2,"width","93.5%",3,"ngModelChange","ngModel"],[1,"input-group"],["type","number","name","QuantityTo",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"input-group-text","rounded-end-1","input-filter","bg-body-tertiary"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Scope",3,"modelChange","model","options"],[3,"modelChange","model","options"],["name","ReleasedType",3,"modelChange","model","options"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["arrowPosition","before","matTooltipPosition","above",1,"text-end",2,"width","70px",3,"mat-sort-header","matTooltip"],["arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end",2,"width","10px",3,"mat-sort-header","matTooltip"],["mat-sort-header","IntervalTotal","arrowPosition","before","matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",1,"text-end",2,"width","60px",3,"matTooltip"],["mat-sort-header","IntervalPercentage","arrowPosition","before","matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",1,"text-end",2,"width","10px",3,"matTooltip"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px"],["matTooltipPosition","above","matTooltip","Click to zoom",2,"width","40px",3,"click","src"],[1,"lh-base"],["routerLink","/menu/Products/Catalog/Products/Info","target","_blank",3,"queryParams"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[1,"d-block"],["matTooltipPosition","above",1,"text-success",3,"matTooltip"],[1,"text-end"],[1,"text-end","border-end","text-success"],["matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",3,"matTooltip"],[1,"text-end","text-success"],["api","Report/ProductTagsCount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"filters"),E(2,uT,39,24,"ng-template",null,0,O),a(),n(4,"actions"),S(5,_T,3,0,"button",2),n(6,"div",3)(7,"button",4),p(8," More "),a(),n(9,"ul",5)(10,"li")(11,"a",6),p(12," Product Sold "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()(),n(16,"li")(17,"a",6),p(18," Compare by Month "),a()(),n(19,"li")(20,"a",6),p(21," Compare with Transfer Order "),a()(),n(22,"li")(23,"a",6),p(24," Top Suppliers "),a()(),n(25,"li")(26,"a",6),p(27," Quantity Sold Chart "),a()()()()(),n(28,"content")(29,"div",7)(30,"div",8)(31,"table",9),P("matSortChange",function(T){return u(l),_(t.sortData(T))}),n(32,"thead",10)(33,"tr")(34,"th",11),p(35,"Name"),a(),n(36,"th",12),p(37," Released "),a(),n(38,"th",13),p(39," Purchased "),a(),G(40,gT,4,5,null,null,Yi),n(42,"th",14),p(43),a(),n(44,"th",15),p(45," % "),a(),S(46,CT,8,14),n(47,"th",16),p(48," On Hand "),a()()(),n(49,"tbody"),G(50,wT,39,33,"tr",null,Y),a()()(),S(52,TT,1,2,"POS-complex-pagination",17),a()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("hideSearchBox",!0),o(5),y(!(t.role==null||t.role.global==null)&&t.role.global.Export?5:-1),o(6),c("routerLink",M(17,rT)),o(3),c("routerLink",M(18,lT)),o(3),c("routerLink",M(19,pT)),o(3),c("routerLink",M(20,mT)),o(3),c("routerLink",M(21,sT)),o(3),c("routerLink",M(22,cT)),o(14),H(t.data==null||t.data.Data[0]==null?null:t.data.Data[0].Intervals),o(2),c("matTooltip"," Quantity Sold "+((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()+1)+" - Today since Release Date"),o(),D(" > ",(t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()," "),o(),c("matTooltip"," Percentage Sold "+((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()+1)+" - Today since Release Date"),o(2),y((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)>0?46:-1),o(4),H(t.data==null?null:t.data.Data),o(2),y((t.data==null||t.data.Data==null?null:t.data.Data.length)>0?52:-1))},dependencies:[A,Q,J,Qe,$o,L,R,ie,pe,ge,Ue,Te,Et,Ce,U,yr,oo,re,oe],encapsulation:2})};var PT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],FT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],IT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],bT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],ET=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],MT=()=>["/menu/Contacts/Contact/Customers/Info"],VT=i=>({ID:i}),BT=()=>["/menu/Reports/Sales_Report/Standard/Summary"],OT=i=>({CustomerID:i});function LT(i,s){if(i&1){let e=I();n(0,"a",12),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function RT(i,s){if(i&1){let e=I();n(0,"div",14)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",17)(9,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function kT(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",19),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),d(11,"date"),a(),n(12,"td"),p(13),a(),n(14,"td")(15,"a",19),p(16),a()(),n(17,"td"),p(18),d(19,"number"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(19,MT))("queryParams",X(20,VT,e.CustomerID)),o(),F(e.Name),o(2),F(e.Mobile),o(2),F(v(8,11,e.FirstPurchase,"dd/MM/yyyy")),o(3),F(v(11,14,e.LastPurchase,"dd/MM/yyyy")),o(3),F(e.Days),o(2),c("routerLink",M(22,BT))("queryParams",X(23,OT,e.CustomerID)),o(),F(e.Orders),o(2),F(g(19,17,e.Amount))}}function WT(i,s){if(i&1&&(n(0,"tbody",11),G(1,kT,20,25,"tr",null,Y),a()),i&2){let e=m();o(),H(e.data.Data)}}var lo=class i extends De{constructor(e,r,t,l,C){super(e,r,"SalesReport/CustomerLastPurchase");this.httpService=r;this.matDialog=t;this.datePipe=l;this.roleService=C}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}openExportModal(){this.matDialog.open(K,{data:{title:"Customer Last Purchase",exportTypes:[{ID:"ReportExport/CustomerLastPurchase",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(z),w(oe),w(j))};static \u0275cmp=B({type:i,selectors:[["POS-last-purchase"]],standalone:!1,features:[W],decls:45,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["matTooltipPosition","above","matTooltip","(Todays - last purchase date)"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,LT,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Customer Group "),a()()()()(),n(22,"filters"),E(23,RT,10,6,"ng-template",null,0,O),a(),n(25,"content")(26,"div",7)(27,"table",8)(28,"thead",9)(29,"tr")(30,"th"),p(31,"Name"),a(),n(32,"th"),p(33,"Mobile"),a(),n(34,"th"),p(35,"First Purchase"),a(),n(36,"th"),p(37,"Last Purchase"),a(),n(38,"th",10),p(39,"Days Ago"),a(),n(40,"th"),p(41,"Orders"),a(),n(42,"th"),p(43,"Amount"),a()()(),S(44,WT,3,0,"tbody",11),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,PT)),o(3),c("routerLink",M(12,FT)),o(3),c("routerLink",M(13,IT)),o(3),c("routerLink",M(14,bT)),o(3),c("routerLink",M(15,ET)),o(24),y(t.data?44:-1))},dependencies:[A,Q,J,L,R,ie,U,re,oe],encapsulation:2})};var Ht=Jt(bi());var NT=["outletSelectorRef"],AT=(i,s)=>s.Key;function GT(i,s){if(i&1){let e=I();n(0,"mat-chip",9),P("removed",function(){let t=u(e).$implicit,l=m();return _(l.onRemoveHandler(t))}),n(1,"span",10),p(2),a(),n(3,"button",11),b(4,"i",12),a()()}if(i&2){let e=s.$implicit;o(2),F(e.Value)}}var po=class i{constructor(s){this._dialogRef=s;this.modalConfig.title="Filter",this.modalConfig.customWidth="450px",this.modalConfig.headerType=zi.Success,this.pageData.set(this.data.pageData)}modalConfig=new Vn;data=Pe(Ti);pageData=dt(null);injector=Pe(on);variant$;#e=Pe(k);listVariantSelected=dt([]);toastr=Pe(qe);route=Pe(Ne);outletSelector;itemHashMap=new Map;router=Pe(_n);productOrVarariantAPIURL=dt("");minDateFrom=dt((0,Ht.default)().subtract(90,"days"));maxDateFrom=dt((0,Ht.default)().subtract(2,"days"));minDateTo=dt((0,Ht.default)().subtract(90,"days"));maxDateTo=dt((0,Ht.default)());scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];ngOnInit(){this.initializePageData(),this.handleQueryParams(),this.fetchVariantItems()}ngAfterViewChecked(){}get tooltipMessage(){return this.pageData()?this.pageData().Filter.GroupByVariant?"Max input 5 Variant":"Max input 5 Product":""}initializePageData(){Cn(this.pageData,{injector:this.injector}).pipe(ri(s=>!!s),nn(),Nt(s=>{let e=s.Filter.GroupByVariant?"/API/AC/GetVariantSuggestionByCodeNName":"/api/ac/GetProductSuggestionByCodeNName";this.productOrVarariantAPIURL.set(e)})).subscribe()}handleQueryParams(){this.route.queryParamMap.pipe(Nt(s=>{s.keys.length>0?this.pageData.update(e=>nt(et({},e),{Filter:nt(et({},e.Filter),{From:s.get("From"),To:s.get("To"),ListIDs:s.get("ListIDs")?s.get("ListIDs").split(","):[],ListVariantID:s.get("ListVariantID")?s.get("ListVariantID").split(","):[],GroupByVariant:JSON.parse(s.get("GroupByVariant"))||!1})})):(this.maxDateFrom.set((0,Ht.default)().subtract(2,"days")),this.minDateFrom.set((0,Ht.default)().subtract(90,"days")),this.pageData.update(e=>nt(et({},e),{Filter:nt(et({},e.Filter),{From:(0,Ht.default)().subtract(7,"days").format("YYYY-MM-DDTHH:mm:ss.SSS")})}))),this.listVariantSelected.set([])})).subscribe()}mergeAndReplaceWithSet(s,e,r){let t=[...s,...e];return Array.from(new Set(t.map(C=>C[r]))).map(C=>t.find(T=>T[r]===C))}fetchVariantItems(){this.route.queryParamMap.pipe(ri(s=>s&&s.keys.length>0),Vo(s=>{let r=[...s.get("ListVariantID").split(","),s.get("ID")].filter(C=>C),t=JSON.parse(s.get("GroupByVariant"))?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID",l={[JSON.parse(s.get("GroupByVariant"))?"ListVariantID":"ListProductID"]:[...new Set(r)]};return this.#e.post(t,l).pipe(Qi(()=>ci(null)))}),ri(s=>!!s),Nt(s=>{this.listVariantSelected.set(this.mergeAndReplaceWithSet(this.listVariantSelected(),s,"Key"))})).subscribe()}onVariantSelected(s){let e=this.pageData().Filter.GroupByVariant?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID",r={[this.pageData().Filter.GroupByVariant?"ListVariantID":"ListProductID"]:[JSON.parse(s).Key]};this.#e.post(e,r).pipe(Qi(()=>ci(null)),Nt(t=>{this.listVariantSelected.set(this.mergeAndReplaceWithSet(this.listVariantSelected(),t,"Key"))})).subscribe()}onScopeChange(s){this.pageData.update(e=>nt(et({},e),{Filter:nt(et({},e.Filter),{GroupByVariant:s})})),this.listVariantSelected.set([])}onRemoveHandler(s){this.listVariantSelected.set(this.listVariantSelected().filter(e=>e.Key!==s.Key))}onOk(){if(Array.isArray(this.listVariantSelected())&&this.listVariantSelected().length<=0){this.toastr.warning("Please select at least one variant",zi.Warning);return}this.pageData.update(e=>nt(et({},e),{Filter:nt(et({},e.Filter),{ListVariantID:[...this.listVariantSelected().map(r=>r.Key)]})})),this._dialogRef.close({role:"OK",data:et({},this.pageData())}),this.router.navigate(["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],{queryParams:{From:(0,Ht.default)(this.pageData().Filter.From).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,Ht.default)(this.pageData().Filter.To).format("YYYY-MM-DDTHH:mm:ss.SSS"),GroupByVariant:JSON.stringify(this.pageData().Filter.GroupByVariant),ListIDs:this.pageData().Filter.ListIDs.join(","),ListVariantID:this.pageData().Filter.ListVariantID.join(",")},queryParamsHandling:"merge",replaceUrl:!0})}close(){this._dialogRef.close({role:"close",data:null})}static \u0275fac=function(e){return new(e||i)(w(wi))};static \u0275cmp=B({type:i,selectors:[["pos-dialog-prod-sales-qty-chart"]],viewQuery:function(e,r){if(e&1&&sn(NT,5),e&2){let t;_i(t=gi())&&(r.outletSelector=t.first)}},decls:22,vars:17,consts:[[3,"onOk","onCancel","onClose","config"],[1,"d-flex","flex-column","gap-4"],[1,"d-flex","flex-column","gap-2"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["inputID","Key","placeholder","Search an Variant or Product",1,"w-100",3,"optionSelected","matTooltip","readonly","requestUrl","clearOnSelect"],["aria-label","Fish selection"],["name","From",3,"dateChange","maxDateValidation","minDateValidation","date"],["name","To",3,"dateChange","maxDateValidation","minDateValidation","date"],["name","Scope",3,"modelChange","model","options"],[3,"removed"],[1,"d-inline-block","text-truncate",2,"max-width","150px"],["matChipRemove",""],[1,"fa-solid","fa-circle-xmark"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.close()})("onClose",function(){return r.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",3),h("ngModelChange",function(l){return x(r.pageData().Filter.ListIDs,l)||(r.pageData().Filter.ListIDs=l),l}),a()(),n(7,"div",2)(8,"h6"),p(9,"Product to Analyze"),a(),n(10,"autocompleteV2",4),P("optionSelected",function(l){return r.onVariantSelected(l)}),a(),n(11,"mat-chip-set",5),G(12,GT,5,1,"mat-chip",null,AT),a()(),n(14,"div",2)(15,"h6"),p(16,"From - To"),a(),n(17,"datepicker",6),h("dateChange",function(l){return x(r.pageData().Filter.From,l)||(r.pageData().Filter.From=l),l}),a(),n(18,"datepicker",7),h("dateChange",function(l){return x(r.pageData().Filter.To,l)||(r.pageData().Filter.To=l),l}),a()(),n(19,"h6"),p(20,"Scope"),a(),n(21,"radio-options",8),P("modelChange",function(l){return r.onScopeChange(l)}),a()()()()),e&2&&(c("config",r.modalConfig),o(6),c("multiple",!0)("accessType",2)("outlets",r.pageData().Options.Entities),f("ngModel",r.pageData().Filter.ListIDs),o(4),c("matTooltip",r.tooltipMessage)("readonly",r.listVariantSelected().length>=5)("requestUrl",r.productOrVarariantAPIURL())("clearOnSelect",!0),o(2),H(r.listVariantSelected()),o(5),c("maxDateValidation",r.maxDateFrom())("minDateValidation",r.minDateFrom()),f("date",r.pageData().Filter.From),o(),c("maxDateValidation",r.maxDateTo())("minDateValidation",r.minDateTo()),f("date",r.pageData().Filter.To),o(3),c("model",r.pageData().Filter.GroupByVariant)("options",r.scopeFilter))},dependencies:[At,L,R,Ii,Bn,Pi,U,Ei,J,Rr,Or,Br,Lr,Wn,Te,kn,Ae,hn,ie],styles:["[_nghost-%COMP%]{display:block}"]})};var ni=Jt(bi()),Tl=Jt(Po());var HT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],QT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],YT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],jT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],qT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],UT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"];function zT(i,s){}Gn(Tl.default);var mo=class i{constructor(s,e,r,t,l,C,T,Ze,Ni){this.route=s;this.httpService=e;this.pageSetupService=r;this.matDialog=t;this.toastr=l;this.title=C;this.cdr=T;this.injector=Ze;this.router=Ni}loader$;chartData$;dialogOpened=!1;colorsChart=["#FF0060","#131010","#00DFA2","#fcbf49","#0079FF"];seriesData=dt(null);Highcharts=dt(Bi);variantOrProductItems=dt([]);menu$;ngOnInit(){this.initializeLoader(),this.pageSetupService.setMenu$(),this.handleVariantOrProductItems(),this.handleChartQuantitySold(),this.loadInitialData()}ngAfterViewInit(){this.updateChartOptions()}initializeLoader(){if(this.route.snapshot.queryParamMap.keys.length>0){let e=this.route.snapshot.queryParamMap.get("From"),r=this.route.snapshot.queryParamMap.get("To"),t=(0,ni.default)(e).isSame((0,ni.default)(r),"day");this.router.navigate([],{queryParams:{From:t?(0,ni.default)(r).subtract(6,"days").format("YYYY-MM-DDTHH:mm:ss.SSS"):(0,ni.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,ni.default)(this.route.snapshot.queryParamMap.get("To")).format("YYYY-MM-DDTHH:mm:ss.SSS")},queryParamsHandling:"merge",replaceUrl:!0})}this.loader$=this.httpService.post("/API/SalesReportLoader/GetChartQuantitySold",{}).pipe(jt(1))}parseQueryParams(s){let e=s.get("ID")?[s.get("ID")]:s.get("ListVariantID")?[...s.get("ListVariantID").split(",")]:[];return{ListVariantID:[...new Set(e)],GroupByVariant:JSON.parse(s.get("GroupByVariant")||"false"),From:(0,ni.default)(s.get("From")).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,ni.default)(s.get("To")).format("YYYY-MM-DDTHH:mm:ss.SSS"),ListIDs:s.get("ListIDs")?s.get("ListIDs").split(","):[]}}fetchVariantOrProductItems(s,e){let r=e?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID";return this.httpService.post(r,{[e?"ListVariantID":"ListProductID"]:s}).pipe(ri(t=>!!t),oi(t=>({Key:t.Key,Value:t.Value})),jt(1))}fetchChartQuantitySold(s){return this.httpService.post("/API/SalesReport/GetChartQuantitySold",s).pipe(oi(e=>nt(et({},e),{chart:{type:"spline"},series:e.Data.Series.map((r,t)=>nt(et({},r),{data:r.data,name:r.name,color:this.colorsChart[t]}))})),Nt(e=>{Object.prototype.hasOwnProperty.call(e,"ErrorMessage")&&this.toastr.error(e.ErrorMessage,"API Error - 400")}),Qi(e=>ci(null)),jt(1))}handleVariantOrProductItems(){let s=this.route.snapshot.queryParamMap,{ListVariantID:e,GroupByVariant:r}=this.parseQueryParams(s);this.fetchVariantOrProductItems(e,r).pipe(Nt(t=>{this.variantOrProductItems.set([...this.variantOrProductItems(),t])})).subscribe()}handleChartQuantitySold(){this.chartData$=this.loader$.pipe(Bo(100),_o(s=>{let e=this.route.snapshot.queryParamMap;if(e&&e.keys.length>0){let r=this.parseQueryParams(e);return this.fetchChartQuantitySold(r)}else return this.dialogOpened||(this.openDialogFilter(),this.dialogOpened=!0),this.fetchChartQuantitySold(s.Filter)}),jt(1)),uo([this.chartData$,this.pageSetupService.menu$]).pipe(oi(([s,e])=>({chartData:s,menu:nt(et({},e),{H:s.FullPageTitle,T:e.T.replace("undefined",s.FullPageTitle)})})),Nt(({chartData:s,menu:e})=>{this.menu$=ci(e),this.seriesData.set(s.Data),this.title.setTitle(e.T),this.cdr.markForCheck()})).subscribe()}loadInitialData(){this.chartData$.subscribe()}getCookie(s){let e=document.cookie.match(new RegExp("(?:^|; )"+s.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}updateChartOptions(){Cn(this.seriesData,{injector:this.injector}).pipe(ri(s=>!!s),nn(),Nt(s=>Bi.chart("chart-container",{time:{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},chart:{type:"spline",style:{fontFamily:"Roboto Slab, sans-serif"}},title:{text:""},tooltip:{enabled:!0,xDateFormat:"%e %b",shared:!0},credits:{enabled:!1},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom",backgroundColor:Bi.defaultOptions.legend.backgroundColor||"#FFFFFF"},yAxis:{title:{text:""}},xAxis:{type:"datetime",dateTimeLabelFormats:{day:"%e %b",week:"%e %m",month:"%e %m",year:"%e %m"},labels:{format:"{value:%e %b}"}},plotOptions:{series:{label:{enabled:!0},pointStart:new Date(s.From).getTime(),pointInterval:24*3600*1e3},line:{dataLabels:{enabled:!0,filter:{property:"y",operator:">",value:0}}}},series:s.Series.map((e,r)=>nt(et({},e),{color:this.colorsChart[r]}))}))).subscribe()}openDialogFilter(){uo([this.loader$]).pipe(oi(([s])=>({loader:s})),_o(({loader:s})=>{let e=this.getCookie("ReportFilter")?JSON.parse(this.getCookie("ReportFilter")):null,r=nt(et({},s),{Filter:nt(et({},s.Filter),{From:e?e.from:s.Filter.From,To:e?e.to:s.Filter.To})});return this.matDialog.open(po,{data:{pageData:r}}).afterClosed()}),Nt(()=>{this.handleChartQuantitySold()})).subscribe()}static \u0275fac=function(e){return new(e||i)(w(Ne),w(k),w(N),w(z),w(qe),w(Ko),w(Qo),w(on),w(_n))};static \u0275cmp=B({type:i,selectors:[["pos-product-sales-qty-chart"]],decls:35,vars:17,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","custom-header",5,["custom-header"]],[1,"d-flex","align-items-center","gap-4",2,"margin","0.6rem 0"],[1,"d-flex","pe-auto",2,"cursor","pointer",3,"click"],[1,"fa","fa-filter"],[1,"fa-solid","fa-caret-down"],["ngProjectAs","actions",5,["actions"]],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["filters",""],["id","chart-container",2,"margin","1.5rem 0.3rem"]],template:function(e,r){if(e&1){let t=I();n(0,"mainpanel-cmp",1),d(1,"async"),pt(2,2),n(3,"nav",3)(4,"div",4),P("click",function(){return u(t),_(r.openDialogFilter())}),b(5,"i",5)(6,"i",6),a()(),mt(),pt(7,7),n(8,"div",8)(9,"button",9),p(10," More "),a(),n(11,"ul",10)(12,"li")(13,"a",11),p(14," Product Sold "),a()(),n(15,"li")(16,"a",11),p(17," Compare by Outlet "),a()(),n(18,"li")(19,"a",11),p(20," Compare by Month "),a()(),n(21,"li")(22,"a",11),p(23," Compare with Transfer Order "),a()(),n(24,"li")(25,"a",11),p(26," Product Tags Analysis "),a()(),n(27,"li")(28,"a",11),p(29," Top Suppliers "),a()()()(),mt(),pt(30,12),E(31,zT,0,0,"ng-template",null,0,O),mt(),n(33,"content"),b(34,"div",13),a()()}e&2&&(c("pageData",g(1,9,r.menu$))("hideSearchBox",!0)("hideSearchDropdown",!0),o(13),c("routerLink",M(11,HT)),o(3),c("routerLink",M(12,QT)),o(3),c("routerLink",M(13,YT)),o(3),c("routerLink",M(14,jT)),o(3),c("routerLink",M(15,qT)),o(3),c("routerLink",M(16,UT)))},dependencies:[Si,Ui,Q,Ii,A,Ei,At,Uo],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var KT=[{path:"Sales_Report/Standard/Detail",component:Hn},{path:"Sales_Report/Standard/Summary",component:Yn},{path:"Sales_Report/Standard/Top_Brand",component:jn},{path:"Sales_Report/Standard/Top_Brand/Top_Brand_Chart",component:$a},{path:"Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis",component:Ua},{path:"Sales_Report/Standard/Top_Customers",component:Un},{path:"Sales_Report/Standard/Top_Customers/By_Last_Purchase",component:lo},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Age",component:zn},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender",component:Kn},{path:"Sales_Report/Standard/Products_Sold/Top_Suppliers",component:Xn},{path:"Sales_Report/Standard/Top_Customers/City",component:La},{path:"Sales_Report/Standard/Top_Customers/Customer_Group",component:Ra},{path:"Sales_Report/Standard/Products_Sold",component:Jn},{path:"Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",component:mo},{path:"Sales_Report/Standard/Products_Sold/Products_Tags",component:ro},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet",component:Zn},{path:"Sales_Report/Standard/Products_Sold/Product_Sales",component:$n},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics",component:ea},{path:"Sales_Report/Standard/Category_Sold",component:io},{path:"Sales_Report/Standard/Category_Sold/Category_Sales_Tree",component:ta},{path:"Sales_Report/Standard/Category_Sold/Category_By_Outlet",component:ia},{path:"Sales_Report/Standard/Category_Sold/Category",component:na},{path:"Sales_Report/Standard/Peak",component:aa},{path:"Sales_Report/Standard/Peak/Peak",component:ra},{path:"Sales_Report/Standard/Daily",component:la},{path:"Sales_Report/Standard/Daily/Daily_Table",component:ca},{path:"Sales_Report/Standard/Monthly",component:ma},{path:"Sales_Report/Standard/Monthly/Monthly_Table",component:da},{path:"Sales_Report/Standard/Yearly",component:to},{path:"Sales_Report/Standard/Yearly/Comparison",component:sa},{path:"Sales_Report/Standard/Daily/Daily_Quantity",component:ua},{path:"Sales_Report/Standard/Daily/Daily_Quantity/Monthly",component:_a},{path:"Sales_Report/Standard/Outlet_Performance",component:Ca},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Graphic",component:ga},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance",component:fa},{path:"Sales_Report/Standard/Sales_Order_Tag",component:za},{path:"Sales_Report/Standard/Person",component:ha},{path:"Sales_Report/Standard/Person/Commission_Outlet",component:ao},{path:"Sales_Report/Standard/Person/Commission_Report",component:Sa},{path:"Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",component:ya},{path:"Sales_Report/Standard/Person/Sales_Group",component:ka},{path:"Sales_Report/Standard/Discounted_Sales",component:no},{path:"Purchases_Report/Detail",component:Da},{path:"Purchases_Report/Summary",component:va},{path:"Purchases_Report/Supplier",component:wa},{path:"Purchases_Report/Product",component:Ta},{path:"Purchases_Report/History",component:Fa},{path:"Purchases_Report/Daily",component:Ia},{path:"Purchases_Report/Daily/Monthly",component:ba},{path:"Purchases_Report/Volume",component:Ea},{path:"Purchases_Report/Sales",component:Ma},{path:"Purchases_Report/Tax",component:Za},{path:"Purchases_Report/Outlet",component:Va},{path:"Purchases_Report/Outlet/Outlet_Group_Performance",component:Ba},{path:"Purchases_Report/Outlet/Outlet_Monthly_Perfomance",component:Oa},{path:"Sales_Report/Standard/Compare",component:eo},{path:"Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance",component:xa},{path:"Sales_Report/Advanced/Tax_Report",component:Wa},{path:"Sales_Report/Advanced/Visitor",component:oa},{path:"Sales_Report/Advanced/Tax_Report/By_Outlet",component:Na},{path:"Sales_Report/Advanced/Product_Life_Cycle",component:Aa},{path:"Sales_Report/Advanced/Product_Profit",component:Ga},{path:"Sales_Report/Advanced/Exchanged_Sales",component:Ha},{path:"Sales_Report/Advanced/Variant_Model_Rank",component:Qa},{path:"Sales_Report/Advanced/Logistics_Service",component:Hr},{path:"Return/Sales_Return",component:Ya},{path:"Return/Purchase_Return",component:ja},{path:"Sales_Report/Standard/Products_Sold/Invoice_Items",component:qa},{path:"Sales_Report/Standard/Price_Analysis",component:Ja},{path:"",redirectTo:"Sales_Report/Standard/Products_Sold",pathMatch:"full"}],so=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=ui({type:i});static \u0275inj=di({imports:[Ui.forChild(KT),Ui]})};var Pl=`
|
|
12
12
|
.p-toggleswitch {
|
|
13
13
|
display: inline-block;
|
|
14
14
|
width: dt('toggleswitch.width');
|
|
@@ -122,10 +122,10 @@ import{a as ii,b as Nr}from"./chunk-C3STDN73.js";import{a as Wr}from"./chunk-KB4
|
|
|
122
122
|
.p-toggleswitch.p-disabled .p-toggleswitch-handle {
|
|
123
123
|
background: dt('toggleswitch.handle.disabled.background');
|
|
124
124
|
}
|
|
125
|
-
`;var
|
|
125
|
+
`;var XT=["handle"],JT=["input"],ZT=i=>({checked:i});function $T(i,s){i&1&&Wo(0)}function eP(i,s){if(i&1&&E(0,$T,1,0,"ng-container",3),i&2){let e=m();c("ngTemplateOutlet",e.handleTemplate||e._handleTemplate)("ngTemplateOutletContext",X(2,ZT,e.checked()))}}var tP=`
|
|
126
126
|
${Pl}
|
|
127
127
|
|
|
128
128
|
p-toggleswitch.ng-invalid.ng-dirty > .p-toggleswitch-slider {
|
|
129
129
|
border-color: dt('toggleswitch.invalid.border.color');
|
|
130
130
|
}
|
|
131
|
-
`,
|
|
131
|
+
`,iP={root:{position:"relative"}},nP={root:({instance:i})=>["p-toggleswitch p-component",{"p-toggleswitch p-component":!0,"p-toggleswitch-checked":i.checked(),"p-disabled":i.$disabled(),"p-invalid":i.invalid()}],input:"p-toggleswitch-input",slider:"p-toggleswitch-slider",handle:"p-toggleswitch-handle"},Fl=(()=>{class i extends tr{name="toggleswitch";style=tP;classes=nP;inlineStyles=iP;static \u0275fac=(()=>{let e;return function(t){return(e||(e=go(i)))(t||i)}})();static \u0275prov=an({token:i,factory:i.\u0275fac})}return i})();var Il=new Zt("TOGGLESWITCH_INSTANCE"),aP={provide:Xo,useExisting:Oo(()=>bl),multi:!0},bl=(()=>{class i extends ar{$pcToggleSwitch=Pe(Il,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=Pe(Ki,{self:!0});onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}styleClass;tabindex;inputId;readonly;trueValue=!0;falseValue=!1;ariaLabel;size=hi();ariaLabelledBy;autofocus;onChange=new ln;input;handleTemplate;_handleTemplate;focused=!1;_componentStyle=Pe(Fl);templates;onHostClick(e){this.onClick(e)}onAfterContentInit(){this.templates.forEach(e=>{switch(e.getType()){case"handle":this._handleTemplate=e.template;break;default:this._handleTemplate=e.template;break}})}onClick(e){!this.$disabled()&&!this.readonly&&(this.writeModelValue(this.checked()?this.falseValue:this.trueValue),this.onModelChange(this.modelValue()),this.onChange.emit({originalEvent:e,checked:this.modelValue()}),this.input.nativeElement.focus())}onFocus(){this.focused=!0}onBlur(){this.focused=!1,this.onModelTouched()}checked(){return this.modelValue()===this.trueValue}writeControlValue(e,r){r(e),this.cd.markForCheck()}static \u0275fac=(()=>{let e;return function(t){return(e||(e=go(i)))(t||i)}})();static \u0275cmp=B({type:i,selectors:[["p-toggleswitch"],["p-toggleSwitch"],["p-toggle-switch"]],contentQueries:function(r,t,l){if(r&1&&(Co(l,XT,4),Co(l,fn,4)),r&2){let C;_i(C=gi())&&(t.handleTemplate=C.first),_i(C=gi())&&(t.templates=C)}},viewQuery:function(r,t){if(r&1&&sn(JT,5),r&2){let l;_i(l=gi())&&(t.input=l.first)}},hostVars:5,hostBindings:function(r,t){r&1&&P("click",function(C){return t.onHostClick(C)}),r&2&&(li("data-pc-name","toggleswitch"),No(t.sx("root")),qi(t.cn(t.cx("root"),t.styleClass)))},inputs:{styleClass:"styleClass",tabindex:[2,"tabindex","tabindex",Yo],inputId:"inputId",readonly:[2,"readonly","readonly",fo],trueValue:"trueValue",falseValue:"falseValue",ariaLabel:"ariaLabel",size:[1,"size"],ariaLabelledBy:"ariaLabelledBy",autofocus:[2,"autofocus","autofocus",fo]},outputs:{onChange:"onChange"},features:[Ci([aP,Fl,{provide:Il,useExisting:i},{provide:ir,useExisting:i}]),mn([Ki]),W],decls:5,vars:20,consts:[["input",""],["type","checkbox","role","switch",3,"focus","blur","checked","pAutoFocus","pBind"],[3,"pBind"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(r,t){if(r&1){let l=I();n(0,"input",1,0),P("focus",function(){return u(l),_(t.onFocus())})("blur",function(){return u(l),_(t.onBlur())}),a(),n(2,"div",2)(3,"div",2),S(4,eP,1,4,"ng-container"),a()()}r&2&&(qi(t.cx("input")),c("checked",t.checked())("pAutoFocus",t.autofocus)("pBind",t.ptm("input")),li("id",t.inputId)("required",t.required()?"":void 0)("disabled",t.$disabled()?"":void 0)("aria-checked",t.checked())("aria-labelledby",t.ariaLabelledBy)("aria-label",t.ariaLabel)("name",t.name())("tabindex",t.tabindex),o(2),qi(t.cx("slider")),c("pBind",t.ptm("slider")),o(),qi(t.cx("handle")),c("pBind",t.ptm("handle")),o(),y(t.handleTemplate||t._handleTemplate?4:-1))},dependencies:[Si,qo,nr,xn,or,Ki],encapsulation:2,changeDetection:0})}return i})(),El=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=ui({type:i});static \u0275inj=di({imports:[bl,xn,xn]})}return i})();var Ml=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=ui({type:i});static \u0275inj=di({providers:[oe],imports:[Ii,xr,Si,so,$,Ei,At,gn,yi,In,sr,Di,mr,cr,hn,dr,ur,$,lr,pr,_r,Bn,Wn,Nr,Ar,kn,vr,Gr,K,Mi,pi,Vr,pi,Ce,U,Sr,ze,ti,El,hr,Xa,Vi,Wi,Dr,Pr]})};export{Ml as ReportsModule};
|