dealpos 25.45.2 → 25.46.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-2BGWWBHC.js +3 -0
- package/browser/{chunk-KL5VH4OU.js → chunk-2G2N3QIY.js} +1 -1
- package/browser/{chunk-IAFZ6YAO.js → chunk-2P6YEJWK.js} +1 -1
- package/browser/{chunk-IR75FMI5.js → chunk-2PFGIE43.js} +1 -1
- package/browser/{chunk-O4SFEWMN.js → chunk-2RA23GAL.js} +1 -1
- package/browser/{chunk-TPHEWWHE.js → chunk-2S4MUH4L.js} +3 -3
- package/browser/chunk-2T2LYQDD.js +22 -0
- package/browser/chunk-2T52WAWX.js +380 -0
- package/browser/{chunk-PIYVELLT.js → chunk-2UJUXPQL.js} +1 -1
- package/browser/{chunk-KLZBTT2P.js → chunk-3F4KI5PR.js} +1 -1
- package/browser/chunk-3G2IUR3X.js +82 -0
- package/browser/{chunk-MXGNASOC.js → chunk-3ZFDZRWQ.js} +1 -1
- package/browser/{chunk-SYMXIBEB.js → chunk-42IETN73.js} +1 -1
- package/browser/{chunk-7EVERJPZ.js → chunk-44MS566M.js} +1 -1
- package/browser/{chunk-JGWQC4DI.js → chunk-45DQRELI.js} +1 -1
- package/browser/{chunk-FR4CH42S.js → chunk-45LBXHFM.js} +1 -1
- package/browser/{chunk-PLVOH67J.js → chunk-47TATTXM.js} +1 -1
- package/browser/{chunk-A4SCCZAY.js → chunk-4BMVHD44.js} +1 -1
- package/browser/{chunk-DJNB7COU.js → chunk-4BPD7IPB.js} +1 -1
- package/browser/{chunk-QCCKEP2R.js → chunk-4CLAEU7U.js} +1 -1
- package/browser/chunk-4GH7NXPQ.js +315 -0
- package/browser/{chunk-NJB3X4XL.js → chunk-4WDKKRLY.js} +1 -1
- package/browser/{chunk-FV3VHB7N.js → chunk-52X5HGTB.js} +1 -1
- package/browser/{chunk-U3WVC6SN.js → chunk-54PTN6TM.js} +1 -1
- package/browser/{chunk-EAXUIPR5.js → chunk-5A3WAD32.js} +1 -1
- package/browser/chunk-5A4BI6R4.js +1 -0
- package/browser/{chunk-TS6CZC3J.js → chunk-5ACAEXN7.js} +1 -1
- package/browser/{chunk-J3OQGBIN.js → chunk-5JDNG4HM.js} +1 -1
- package/browser/{chunk-XIXREDEB.js → chunk-5KVP2F7F.js} +1 -1
- package/browser/chunk-5O5D7WMM.js +1 -0
- package/browser/{chunk-BQAKWHPC.js → chunk-5SJZZU5V.js} +1 -1
- package/browser/{chunk-PQ65IMRY.js → chunk-5V62CV7A.js} +1 -1
- package/browser/{chunk-B6EKSPI2.js → chunk-5WD2XGU7.js} +1 -1
- package/browser/chunk-5X6HJLPO.js +1 -0
- package/browser/{chunk-5I74KDE7.js → chunk-5YVJIGMT.js} +1 -1
- package/browser/chunk-5ZFCEP2C.css +1 -0
- package/browser/{chunk-L3JI6OZ3.js → chunk-67JWJEWL.js} +1 -1
- package/browser/{chunk-UYXD7WPN.js → chunk-6AY5BHS7.js} +1 -1
- package/browser/{chunk-JGYO4OTZ.js → chunk-6CM3LOP5.js} +1 -1
- package/browser/{chunk-DELGLVJJ.js → chunk-6JM2R43J.js} +1 -1
- package/browser/chunk-6KAJXZU4.js +152 -0
- package/browser/{chunk-NERV3W42.js → chunk-6KD2XLEU.js} +1 -1
- package/browser/{chunk-FAGD2TBB.js → chunk-6PPAAIAS.js} +1 -1
- package/browser/{chunk-ELTC3POX.js → chunk-6SLXFBWF.js} +1 -1
- package/browser/chunk-6VWCIQNT.js +1 -0
- package/browser/{chunk-P2FSLJ4X.js → chunk-7EN4VWQC.js} +1 -1
- package/browser/{chunk-5DXDXIDO.js → chunk-7WAZVWJ7.js} +1 -1
- package/browser/chunk-7YBH2SXZ.js +151 -0
- package/browser/{chunk-S4ZRXSPZ.js → chunk-AD5QTGBG.js} +1 -1
- package/browser/chunk-ADRSDODY.js +1 -0
- package/browser/{chunk-7FUWLNHK.js → chunk-AL37NTTS.js} +1 -1
- package/browser/{chunk-B5ORO5G4.js → chunk-AM63STD6.js} +1 -1
- package/browser/{chunk-WKB7BKHN.js → chunk-ANWIC3AL.js} +1 -1
- package/browser/{chunk-LDDG4GE7.js → chunk-ARGOJ7DE.js} +1 -1
- package/browser/{chunk-QHWRBSOD.js → chunk-B2ZKTHHK.js} +1 -1
- package/browser/{chunk-KNQEOPID.js → chunk-B6RBXYBH.js} +1 -1
- package/browser/{chunk-RCC5SUNH.js → chunk-B7BEECTQ.js} +1 -1
- package/browser/{chunk-NM3RF6OH.js → chunk-BCNA556P.js} +1 -1
- package/browser/{chunk-I4WJ5CEN.js → chunk-BG4XRSKY.js} +1 -1
- package/browser/chunk-BOKRBOOE.js +334 -0
- package/browser/{chunk-PCAFUCUK.js → chunk-BQ7W6HVM.js} +1 -1
- package/browser/{chunk-EIH377TR.js → chunk-BQZPNTN2.js} +1 -1
- package/browser/chunk-BWBWSNUR.js +1095 -0
- package/browser/chunk-BWL4WXAD.js +1 -0
- package/browser/{chunk-N7C7P5QN.js → chunk-BZ2MTKI3.js} +1 -1
- package/browser/{chunk-LJMHI6I5.js → chunk-CDXAKDVU.js} +1 -1
- package/browser/{chunk-HYXSN2J6.js → chunk-CH2CJQUF.js} +1 -1
- package/browser/{chunk-HPPKFGND.js → chunk-CKUZYWD3.js} +1 -1
- package/browser/{chunk-EPINEYFX.js → chunk-CRXFERRX.js} +1 -1
- package/browser/{chunk-YXNBLVK4.js → chunk-CSSCB5H5.js} +1 -1
- package/browser/chunk-D4VXNK25.js +5 -0
- package/browser/chunk-D5IRUIA5.js +40 -0
- package/browser/{chunk-YMVBGQ2W.js → chunk-D7PYJVQX.js} +1 -1
- package/browser/{chunk-3MU2GNGM.js → chunk-DBEYMOMT.js} +1 -1
- package/browser/{chunk-O4IQZBVW.js → chunk-DFHK3QA3.js} +1 -1
- package/browser/{chunk-IJXCL7KL.js → chunk-DNBHVVDZ.js} +1 -1
- package/browser/{chunk-MFDMUMA4.js → chunk-DSGMEORC.js} +1 -1
- package/browser/chunk-DWWQ27MN.js +16 -0
- package/browser/chunk-DZSOQO6Z.js +1 -0
- package/browser/chunk-E7CKHP2W.js +1 -0
- package/browser/{chunk-OJ5SEYSF.js → chunk-EEJEVJEF.js} +1 -1
- package/browser/{chunk-HK2NKWCI.js → chunk-EHLQZKY6.js} +1 -1
- package/browser/{chunk-JXXEYFN7.js → chunk-EPSJXHC6.js} +1 -1
- package/browser/{chunk-6BGTH62C.js → chunk-EV4Q6ALX.js} +1 -1
- package/browser/{chunk-X6XUOWVT.js → chunk-FAUBVY2Z.js} +2 -2
- package/browser/{chunk-JXHHT6R2.js → chunk-FE7XNXYT.js} +1 -1
- package/browser/{chunk-B3LNBFJF.js → chunk-FHVQSZV4.js} +1 -1
- package/browser/{chunk-DB3W42KN.js → chunk-FJDNER3H.js} +1 -1
- package/browser/{chunk-33B62QHS.js → chunk-FO57E5BU.js} +1 -1
- package/browser/{chunk-EGADVOKH.js → chunk-FV4VN5TM.js} +1 -1
- package/browser/{chunk-5PWOYB4R.js → chunk-FVSWTMXM.js} +11 -11
- package/browser/chunk-G36EBMA4.js +1 -0
- package/browser/{chunk-DU7W2G2L.js → chunk-GA5UNKLN.js} +1 -1
- package/browser/{chunk-ETTSYVEZ.js → chunk-GB6NLAAI.js} +1 -1
- package/browser/{chunk-LODGW3WU.js → chunk-GF6UUBXR.js} +1 -1
- package/browser/{chunk-VO3NT5EH.js → chunk-GFBFG6KV.js} +1 -1
- package/browser/{chunk-TMQ7NWGZ.js → chunk-GFNPL4DE.js} +1 -1
- package/browser/{chunk-YQE3PJGM.js → chunk-GG2JYIHB.js} +2 -2
- package/browser/{chunk-LAQMHKSP.js → chunk-GNTFQRQT.js} +1 -1
- package/browser/{chunk-3CZ6HKSM.js → chunk-GQGYP4YJ.js} +1 -1
- package/browser/{chunk-XZFHDKIK.js → chunk-H6DX2XWJ.js} +1 -1
- package/browser/{chunk-OKEI5RKW.js → chunk-HE2B5Q63.js} +1 -1
- package/browser/{chunk-4CFMB4IK.js → chunk-HENPJSI6.js} +1 -1
- package/browser/chunk-HG5EY2AA.js +1 -0
- package/browser/chunk-HKYIKSF6.js +257 -0
- package/browser/{chunk-3MUHZKUR.js → chunk-HPPVU3Z2.js} +1 -1
- package/browser/{chunk-QGYIPOLS.js → chunk-HS26VQGJ.js} +1 -1
- package/browser/{chunk-U3EOEZ3B.js → chunk-HTUZHZ2W.js} +1 -1
- package/browser/{chunk-TPKU52VV.js → chunk-I46YKGKC.js} +1 -1
- package/browser/{chunk-GJIFUWGQ.js → chunk-ID2BNJTV.js} +1 -1
- package/browser/{chunk-NCT5IK4R.js → chunk-II43RP2H.js} +1 -1
- package/browser/{chunk-XWWKCPZS.js → chunk-IKX6MZV7.js} +1 -1
- package/browser/{chunk-GWL7ZN37.js → chunk-ITL6HDN2.js} +1 -1
- package/browser/{chunk-OLT6DXR7.js → chunk-IXBA7EIJ.js} +1 -1
- package/browser/{chunk-RFVQHGYD.js → chunk-IYQKU2EL.js} +4 -4
- package/browser/{chunk-GDPQI6PI.js → chunk-JBMBXZHF.js} +1 -1
- package/browser/{chunk-XKAKP3E6.js → chunk-JCTDORER.js} +1 -1
- package/browser/chunk-JM73PAXO.js +1 -0
- package/browser/{chunk-6DRTZA6S.js → chunk-JQFQEYSX.js} +1 -1
- package/browser/{chunk-3RGQWWNI.js → chunk-JSKJOCYV.js} +1 -1
- package/browser/{chunk-JRM47ALM.js → chunk-KCYEWNYP.js} +1 -1
- package/browser/{chunk-FR6L6XAP.js → chunk-KOF4TIVO.js} +1 -1
- package/browser/{chunk-RPJIPLQS.js → chunk-KPNDJV2U.js} +1 -1
- package/browser/{chunk-VQBUIUJC.js → chunk-KRTNI2QB.js} +1 -1
- package/browser/{chunk-W34NDG3T.js → chunk-KVJIA6ZU.js} +1 -1
- package/browser/chunk-KY4GSSBW.js +1 -0
- package/browser/{chunk-MREFZR3I.js → chunk-L245BNIA.js} +1 -1
- package/browser/{chunk-GINPKODK.js → chunk-LFJYPPPQ.js} +1 -1
- package/browser/{chunk-VBX5VOJG.js → chunk-LFUE4ZL6.js} +1 -1
- package/browser/{chunk-BG6GTLXF.js → chunk-LHXDS2UV.js} +1 -1
- package/browser/{chunk-ZEXXJZ7U.js → chunk-LJ6YD225.js} +1 -1
- package/browser/{chunk-M76YU6SQ.js → chunk-LKDUSJDE.js} +1 -1
- package/browser/{chunk-SA67OWFV.js → chunk-LLD4JAZJ.js} +1 -1
- package/browser/{chunk-IUE6IUOH.js → chunk-LOHDNRJM.js} +1 -1
- package/browser/{chunk-XZXNHGZ2.js → chunk-LWTHIG4U.js} +1 -1
- package/browser/chunk-LY6VOK2B.js +149 -0
- package/browser/{chunk-HHSXXJFJ.js → chunk-MBWD4S2P.js} +1 -1
- package/browser/chunk-MMT7GFHE.js +21 -0
- package/browser/{chunk-67UQKMLX.js → chunk-MPPCTVQF.js} +1 -1
- package/browser/chunk-N5J3AS3T.js +131 -0
- package/browser/{chunk-XTMUP2BA.js → chunk-NFZ2TD3A.js} +1 -1
- package/browser/{chunk-KB64CIW5.js → chunk-NJ67KPDC.js} +2 -2
- package/browser/{chunk-UEMKVZMR.js → chunk-NKSKEAZY.js} +1 -1
- package/browser/{chunk-BJKHMXAA.js → chunk-NQ3TLVWW.js} +1 -1
- package/browser/chunk-O2H3P76C.js +1 -0
- package/browser/{chunk-YL6HCV6T.js → chunk-O44PCSTB.js} +1 -1
- package/browser/{chunk-7USHMTB5.js → chunk-OFXB2JPC.js} +1 -1
- package/browser/{chunk-MTU6753J.js → chunk-OHYERAR6.js} +1 -1
- package/browser/{chunk-PUXE7FLT.js → chunk-OQW54TBN.js} +1 -1
- package/browser/{chunk-WACBOZDR.js → chunk-OWKXU5ZC.js} +1 -1
- package/browser/{chunk-T3HVVJIV.js → chunk-P4NX6EKZ.js} +1 -1
- package/browser/chunk-P5NZWQQQ.js +90 -0
- package/browser/chunk-PF2YFOXS.js +1 -0
- package/browser/{chunk-AASKAWJ4.js → chunk-PIZCEKMP.js} +1 -1
- package/browser/{chunk-7IRMDCKA.js → chunk-PMYMVWKR.js} +1 -1
- package/browser/chunk-PNLYN7MQ.js +311 -0
- package/browser/{chunk-SICZ4VWZ.js → chunk-PS6E5OMN.js} +1 -1
- package/browser/{chunk-2BSYBLS4.js → chunk-QDM4BBTH.js} +1 -1
- package/browser/{chunk-FFOK3ZNC.js → chunk-QIYEPDZF.js} +1 -1
- package/browser/{chunk-G4XFK7EF.js → chunk-QJIVDQKL.js} +1 -1
- package/browser/{chunk-IQ7VK4UE.js → chunk-QLGCMRTS.js} +2 -2
- package/browser/{chunk-WAAJYULE.js → chunk-QNPEMG6D.js} +1 -1
- package/browser/chunk-QNQXO4YS.js +54 -0
- package/browser/{chunk-BXGUZIC4.js → chunk-QVN7DETM.js} +1 -1
- package/browser/chunk-QXANNR7D.js +1 -0
- package/browser/{chunk-KWDQGODG.js → chunk-QYQO4PJF.js} +1 -1
- package/browser/{chunk-V6MKE6LP.js → chunk-RA4OB2YA.js} +1 -1
- package/browser/chunk-REYWUYK5.js +1 -0
- package/browser/chunk-RLNFPJPE.js +1 -0
- package/browser/{chunk-HVRLWPZX.js → chunk-RN6J3XFI.js} +1 -1
- package/browser/{chunk-LFHXGZHT.js → chunk-RRHPX65K.js} +1 -1
- package/browser/{chunk-EHXTW46H.js → chunk-RV3HEIY6.js} +1 -1
- package/browser/{chunk-G7HGWSUU.js → chunk-RWMRVY4Q.js} +1 -1
- package/browser/{chunk-A6F6V3WW.js → chunk-S5MGRIMQ.js} +1 -1
- package/browser/{chunk-I24HJLN4.js → chunk-SN3QC2AI.js} +1 -1
- package/browser/{chunk-VCQBS5CA.js → chunk-SNGOVACV.js} +1 -1
- package/browser/{chunk-TCR2YYM5.js → chunk-SZHE2X7K.js} +1 -1
- package/browser/{chunk-RNEU5YBN.js → chunk-T4EAHLQ4.js} +1 -1
- package/browser/{chunk-OGN6JWED.js → chunk-T6TESUGU.js} +1 -1
- package/browser/{chunk-PTQCXOVM.js → chunk-TFNPU76N.js} +1 -1
- package/browser/{chunk-KMYTSO3Q.js → chunk-TJXA75FB.js} +1 -1
- package/browser/{chunk-FADT3LJL.js → chunk-TKOHX2XL.js} +3 -3
- package/browser/{chunk-EGUIWOC3.js → chunk-TO24XJZI.js} +1 -1
- package/browser/{chunk-IT7I47UZ.js → chunk-TRI5DSKF.js} +1 -1
- package/browser/chunk-TTR5FF2O.js +1 -0
- package/browser/chunk-TTUXWXNN.js +480 -0
- package/browser/chunk-TU6PG43Y.js +118 -0
- package/browser/{chunk-RO5PWDCR.js → chunk-U2AHHKPZ.js} +1 -1
- package/browser/{chunk-PQFMYP23.js → chunk-U2WIPEWI.js} +1 -1
- package/browser/chunk-UFZBFEHP.js +149 -0
- package/browser/{chunk-DZA27E5L.js → chunk-UV57OGWO.js} +1 -1
- package/browser/chunk-UWBVPKV4.js +1 -0
- package/browser/{chunk-OKVQYK4Y.js → chunk-V2IOC2AJ.js} +1 -1
- package/browser/chunk-VBBYHB7E.js +191 -0
- package/browser/{chunk-5ZU5FBGM.js → chunk-VCSTNDEY.js} +1 -1
- package/browser/{chunk-FAN4YDVT.js → chunk-VIIDAPDU.js} +1 -1
- package/browser/{chunk-4KBU47GN.js → chunk-VNNCIA5L.js} +1 -1
- package/browser/{chunk-L5HF7UAT.js → chunk-VNV7VWNA.js} +1 -1
- package/browser/{chunk-E2XUBZDW.js → chunk-VPNGMBCE.js} +1 -1
- package/browser/chunk-VSS454NR.js +2 -0
- package/browser/{chunk-OYO4SRAO.js → chunk-VWL5FKU2.js} +1 -1
- package/browser/{chunk-4KMN7PSV.js → chunk-W4S7Q6CB.js} +1 -1
- package/browser/{chunk-ISY4SDFY.js → chunk-WILA4FS3.js} +1 -1
- package/browser/{chunk-YM2ZQTDF.js → chunk-WJL7IGC6.js} +1 -1
- package/browser/{chunk-HMKM466S.js → chunk-WMTI6O7I.js} +1 -1
- package/browser/{chunk-IZQ5FNXP.js → chunk-WPPCNK6N.js} +1 -1
- package/browser/{chunk-OTT6RJHI.js → chunk-WXF6PTWZ.js} +1 -1
- package/browser/{chunk-F7EO5OHI.js → chunk-X5OTMPQN.js} +1 -1
- package/browser/{chunk-E4GYCB3G.js → chunk-XABTH5K3.js} +1 -1
- package/browser/chunk-XCII6WYI.js +92 -0
- package/browser/chunk-XEAD3GDE.js +507 -0
- package/browser/{chunk-PIW2M2DH.js → chunk-XFQZ7QQD.js} +1 -1
- package/browser/{chunk-RRYYS272.js → chunk-XGM7LWRY.js} +1 -1
- package/browser/{chunk-HC2YTBED.js → chunk-XMPP4Y4Z.js} +1 -1
- package/browser/{chunk-M4BTEXS6.js → chunk-XSPT7GLC.js} +1 -1
- package/browser/chunk-XU5W6MOV.js +15 -0
- package/browser/{chunk-B235RUOX.js → chunk-XUAUPVAM.js} +1 -1
- package/browser/chunk-XUEGGJ25.js +209 -0
- package/browser/{chunk-XXNLATCJ.js → chunk-XVOXL7EV.js} +1 -1
- package/browser/{chunk-IE2H4VRD.js → chunk-XZGY4EZF.js} +1 -1
- package/browser/chunk-Y2T5WNHG.js +1 -0
- package/browser/chunk-Y5JYDZ3E.js +1 -0
- package/browser/chunk-YGHK5XUL.js +1 -0
- package/browser/{chunk-OMKIT3Z4.js → chunk-YGOSFZQM.js} +1 -1
- package/browser/{chunk-3LPZYQS6.js → chunk-YJJAQOYJ.js} +3 -2
- package/browser/{chunk-PQS3RLPI.js → chunk-YJJEYBW2.js} +1 -1
- package/browser/{chunk-BLQKJ5OK.js → chunk-YV457DYY.js} +1 -1
- package/browser/chunk-YZSVWK3T.js +1 -0
- package/browser/{chunk-U5HTULBC.js → chunk-Z2VRH2HR.js} +1 -1
- package/browser/chunk-ZIWCCS4F.js +1 -0
- package/browser/{chunk-6Q7J43H4.js → chunk-ZJDFNACB.js} +1 -1
- package/browser/{chunk-IAFZ75L3.js → chunk-ZJFXRNBM.js} +3 -3
- package/browser/{chunk-RKCNENWQ.js → chunk-ZVQF3NH4.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/main-5IXVIJ7Z.css +1 -0
- package/browser/{main-7FKCOQYA.js → main-K2ATSNT2.js} +2 -2
- package/browser/{styles-J6LGFNKV.css → styles-URIEURGQ.css} +1 -1
- package/package.json +1 -1
- package/browser/chunk-2JU7KFOZ.js +0 -2
- package/browser/chunk-2QD46TNT.js +0 -191
- package/browser/chunk-4ZFVM7K7.js +0 -1
- package/browser/chunk-6A3BN6JC.js +0 -507
- package/browser/chunk-6VM27TUY.js +0 -1
- package/browser/chunk-BJG2UU2M.js +0 -1
- package/browser/chunk-BRHHRJLT.js +0 -39
- package/browser/chunk-CKGJCUHW.js +0 -1
- package/browser/chunk-DG4IHOM2.js +0 -1
- package/browser/chunk-EOJJS4LU.js +0 -334
- package/browser/chunk-FSGCO2Z5.js +0 -1
- package/browser/chunk-GUF6JXSS.js +0 -257
- package/browser/chunk-HBH23XBO.js +0 -1
- package/browser/chunk-HDJJJAZJ.js +0 -1
- package/browser/chunk-IBZF5QXJ.js +0 -1
- package/browser/chunk-IPJU7D3K.js +0 -3
- package/browser/chunk-KDOS4X4T.js +0 -82
- package/browser/chunk-KFUPP33B.js +0 -92
- package/browser/chunk-KPZU3ZPZ.js +0 -1
- package/browser/chunk-KTV4REGV.js +0 -152
- package/browser/chunk-L453AX2W.js +0 -376
- package/browser/chunk-MHZV4BL7.js +0 -1095
- package/browser/chunk-MNZLKEWQ.js +0 -118
- package/browser/chunk-N43HXORE.js +0 -22
- package/browser/chunk-NBMH5YL2.css +0 -1
- package/browser/chunk-PCFR4J66.js +0 -131
- package/browser/chunk-PNN75KZR.js +0 -16
- package/browser/chunk-PROSYUA2.js +0 -1
- package/browser/chunk-PUFGTKWO.js +0 -1
- package/browser/chunk-PXKNGMLL.js +0 -1
- package/browser/chunk-QMFA3PF5.js +0 -1
- package/browser/chunk-RMIJZMA5.js +0 -480
- package/browser/chunk-SGSOCLV7.js +0 -21
- package/browser/chunk-TR5NO2CB.js +0 -1
- package/browser/chunk-TWVDGGTY.js +0 -209
- package/browser/chunk-TX6ZFPHY.js +0 -90
- package/browser/chunk-USEPOJ5L.js +0 -1
- package/browser/chunk-V7HBROQ5.js +0 -54
- package/browser/chunk-VS3RTXZC.js +0 -5
- package/browser/chunk-W5N6DMDQ.js +0 -149
- package/browser/chunk-WAXYETAG.js +0 -151
- package/browser/chunk-WRZUQ2QI.js +0 -1
- package/browser/chunk-WXJTNRD3.js +0 -149
- package/browser/chunk-XF5XKXE6.js +0 -311
- package/browser/chunk-XHA6WGTO.js +0 -1
- package/browser/chunk-XRLRUCRR.js +0 -315
- package/browser/chunk-YQ5GJPDB.js +0 -1
- package/browser/chunk-YZP4FX7D.js +0 -15
- package/browser/chunk-ZRHYTE5S.js +0 -1
- package/browser/main-WPNH2WGQ.css +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as sr}from"./chunk-3ZFDZRWQ.js";import{a as or,b as ar}from"./chunk-X5OTMPQN.js";import{a as rr}from"./chunk-Y2T5WNHG.js";import{b as lr}from"./chunk-5KVP2F7F.js";import{a as Rn}from"./chunk-OQW54TBN.js";import{a as zo,b as $o,c as Ko,d as Jo,e as Zo,f as Xo}from"./chunk-2UJUXPQL.js";import{a as tr}from"./chunk-Z2VRH2HR.js";import{a as nr}from"./chunk-6JM2R43J.js";import{a as er}from"./chunk-GNTFQRQT.js";import{a as ir}from"./chunk-FE7XNXYT.js";import{a as qo}from"./chunk-XVOXL7EV.js";import{a as Yo}from"./chunk-SNGOVACV.js";import{a as Go}from"./chunk-U2WIPEWI.js";import{a as Qn}from"./chunk-GFBFG6KV.js";import"./chunk-I46YKGKC.js";import{a as kn}from"./chunk-LFJYPPPQ.js";import{a as $e}from"./chunk-ZIWCCS4F.js";import{a as Wo}from"./chunk-54PTN6TM.js";import"./chunk-GB6NLAAI.js";import"./chunk-NQX7EX5A.js";import{a as Qo,b as Nn,c as Bo,e as Fn,f as Un,g as Ho}from"./chunk-5V62CV7A.js";import"./chunk-KOF4TIVO.js";import{a as Ln}from"./chunk-P3KIIKY4.js";import{E as Ro}from"./chunk-DWWQ27MN.js";import"./chunk-JFLT7NX3.js";import"./chunk-W3VF2RCW.js";import"./chunk-HENPJSI6.js";import{e as Uo}from"./chunk-JQFQEYSX.js";import"./chunk-QIYEPDZF.js";import"./chunk-AM63STD6.js";import"./chunk-4CLAEU7U.js";import"./chunk-RV3HEIY6.js";import"./chunk-Y5JYDZ3E.js";import"./chunk-DFHK3QA3.js";import"./chunk-JBMBXZHF.js";import"./chunk-ID2BNJTV.js";import"./chunk-QXANNR7D.js";import{a as co}from"./chunk-WXF6PTWZ.js";import{b as Fo}from"./chunk-NFZ2TD3A.js";import"./chunk-TFNPU76N.js";import{b as Ai}from"./chunk-KPNDJV2U.js";import{a as Jr,b as Ze}from"./chunk-MMT7GFHE.js";import{a as Ke,b as De}from"./chunk-REYWUYK5.js";import{a as Je}from"./chunk-B6RBXYBH.js";import{a as Lo}from"./chunk-OHYERAR6.js";import"./chunk-RLNFPJPE.js";import"./chunk-YXCPHYC5.js";import"./chunk-7WAZVWJ7.js";import"./chunk-YGHK5XUL.js";import"./chunk-ADRSDODY.js";import"./chunk-PF33HK6M.js";import"./chunk-GQGYP4YJ.js";import"./chunk-5UDUWK67.js";import"./chunk-BYXBJQAS.js";import"./chunk-5A4BI6R4.js";import"./chunk-J6U6UYNI.js";import"./chunk-ITL6HDN2.js";import"./chunk-Z3E24JZW.js";import"./chunk-KY4GSSBW.js";import"./chunk-NQKVYQ6V.js";import"./chunk-NSNUUKNK.js";import"./chunk-EPSJXHC6.js";import{a as Vn}from"./chunk-II43RP2H.js";import{g as No}from"./chunk-L245BNIA.js";import"./chunk-BYXBJQAS.js";import{c as Co,d as fo,e as ho}from"./chunk-XABTH5K3.js";import{a as dr}from"./chunk-H6DX2XWJ.js";import{c as Vo}from"./chunk-4GH7NXPQ.js";import"./chunk-D7PYJVQX.js";import"./chunk-T6TESUGU.js";import{a as Do}from"./chunk-LHXDS2UV.js";import{a as Io}from"./chunk-HTUZHZ2W.js";import{a as jo,d as ze,e as ko}from"./chunk-BG4XRSKY.js";import"./chunk-PMYMVWKR.js";import"./chunk-3RK6DDJD.js";import{a as go}from"./chunk-O2H3P76C.js";import{q as _o}from"./chunk-O44PCSTB.js";import"./chunk-TTR5FF2O.js";import{d as uo}from"./chunk-WILA4FS3.js";import"./chunk-T4EAHLQ4.js";import{d as jn,e as Eo}from"./chunk-U2AHHKPZ.js";import"./chunk-FO57E5BU.js";import{a as Qe,b as Be,c as po}from"./chunk-VNV7VWNA.js";import{a as Kt,b as Ao}from"./chunk-WPPCNK6N.js";import{f as $t}from"./chunk-2T52WAWX.js";import{c as Ge}from"./chunk-HKYIKSF6.js";import{a as En,b as Rt}from"./chunk-RN6J3XFI.js";import{a as St}from"./chunk-HPPVU3Z2.js";import"./chunk-VIIDAPDU.js";import"./chunk-IYQKU2EL.js";import{c as Oo}from"./chunk-QNQXO4YS.js";import{a as kt}from"./chunk-ANWIC3AL.js";import{b as wo,c as Mo,e as at,f as An}from"./chunk-3G2IUR3X.js";import"./chunk-PNLYN7MQ.js";import"./chunk-CDXAKDVU.js";import"./chunk-RWMRVY4Q.js";import{c as yo}from"./chunk-MPPCTVQF.js";import"./chunk-B7BEECTQ.js";import"./chunk-VWL5FKU2.js";import{c as vo,e as xo,g as So}from"./chunk-DBEYMOMT.js";import{a as He,c as Lt}from"./chunk-PIZCEKMP.js";import"./chunk-VBBYHB7E.js";import"./chunk-E7CKHP2W.js";import"./chunk-TJXA75FB.js";import"./chunk-D5IRUIA5.js";import{c as To,d as Po}from"./chunk-6KAJXZU4.js";import{a as Mn,b as rt}from"./chunk-FV4VN5TM.js";import"./chunk-YJJAQOYJ.js";import"./chunk-NQ3TLVWW.js";import{F as zt,G as qe,u as gt,v as Ct,w as ut}from"./chunk-TO24XJZI.js";import{b as Ie,c as Re}from"./chunk-KRTNI2QB.js";import{N as On,O as wt,g as We}from"./chunk-CH2CJQUF.js";import{a as bo,d as pt}from"./chunk-VSS454NR.js";import"./chunk-FJDNER3H.js";import"./chunk-EQLHPWVB.js";import{a as Le,b as Pt,e as _t,f as Gt,g as nt}from"./chunk-HS26VQGJ.js";import"./chunk-OWKXU5ZC.js";import"./chunk-P5NZWQQQ.js";import"./chunk-XU5W6MOV.js";import{a as et}from"./chunk-2FWFPV5I.js";import"./chunk-7YBH2SXZ.js";import{E as Ue,F as qt,G as be,b as ao,c as xt,h as B,i as Ve,l as Se,o as X,r as lo,s as so,t as Ne,w as Fe}from"./chunk-EEJEVJEF.js";import{a as ro}from"./chunk-HG5EY2AA.js";import{a as mo}from"./chunk-5YVJIGMT.js";import{a as A,c as Oi,d as H}from"./chunk-5ACAEXN7.js";import"./chunk-44MS566M.js";import{$b as un,$d as _n,Ab as F,Ad as Pn,Bb as U,Bc as v,Ca as z,Cb as c,Cc as w,Db as a,Dc as k,E as dt,Eb as r,Ed as wn,Fb as f,Gb as ge,Hb as pn,Hc as K,I as _e,Ib as Mi,Ja as Xi,Jb as At,K as Ki,Kb as jt,Kc as ye,Lb as Ei,Lc as eo,M as Ji,Mb as x,Ob as _,Pb as In,Q as Me,Qa as $,Qb as m,Sa as Oe,Ub as Ce,Va as Ht,Vb as fe,Vc as no,Wb as he,Wd as xe,Xa as l,Y as xn,Ya as Sn,Yd as Ut,Za as bn,Zd as ct,_b as J,aa as it,ac as Nt,bc as to,be as vt,cb as Yi,cc as Tt,cd as Ft,d as ft,da as Dt,db as b,dc as s,ec as S,ed as Tn,ee as L,fa as Q,fc as I,fd as ve,gc as de,hb as O,hc as Dn,ib as Ae,ic as M,jc as T,jd as io,k as hn,kc as P,kd as ke,la as W,lb as mt,ma as Ee,md as Wt,nb as E,o as yn,oa as Zi,od as q,p as vn,pa as h,pc as me,rd as yt,t as Ot,ta as p,tc as Z,u as $i,ua as u,uc as V,ud as oo,vb as g,vc as je,xa as ht,xb as C,yb as se,zb as tt}from"./chunk-D4VXNK25.js";import"./chunk-WFMAM73Y.js";import{a as j,b as R,h as wi,k as fn}from"./chunk-SNAKHGZS.js";var ji=(t=>(t[t.AdjustDifferences=1]="AdjustDifferences",t[t.CountQuantity=2]="CountQuantity",t))(ji||{});var ki=(n=>(n[n.Draft=1]="Draft",n[n.Pending=2]="Pending",n[n.Rejected=3]="Rejected",n[n.Accepted=4]="Accepted",n))(ki||{});var Zr=["productSearchInput"],Xr=()=>["/menu/Products/Catalog/Variants/Info"],Yr=i=>({ID:i});function ta(i,e){i&1&&(a(0,"div"),s(1,"Name"),r())}function ea(i,e){if(i&1){let t=x();a(0,"input",15,0),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.productNameFilter,n)||(d.productNameFilter=n),u(n)}),_("ngModelChange",function(){p(t);let n=m(2);return u(n.onProductNameFilterChange())})("click",function(n){return p(t),u(n.stopPropagation())}),r()}if(i&2){let t=m(2);M("ngModel",t.productNameFilter)}}function na(i,e){if(i&1){let t=x();a(0,"div",12),E(1,ea,2,1,"input",13),a(2,"i",14),_("click",function(n){p(t);let d=m();return n.stopPropagation(),u(d.toggleProductFilter())}),r()()}if(i&2){let t=m();un("width",t.filterProductToggle?"100%":"auto"),l(),c("ngIf",t.filterProductToggle),l(),Nt("fa-filter",!t.filterProductToggle)("fa-filter-slash",t.filterProductToggle),c("matTooltip",t.searchTooltip)}}function ia(i,e){if(i&1&&(a(0,"tr")(1,"td")(2,"a",16),s(3),r()(),a(4,"td"),s(5),r(),a(6,"td",17),s(7),r()()),i&2){let t=e.$implicit;l(2),c("routerLink",Z(5,Xr))("queryParams",V(6,Yr,t.ID)),l(),I(" ",t.Name," "),l(2),S(t.Code),l(2),S(t.OnHand)}}function oa(i,e){if(i&1&&F(0,ia,8,8,"tr",null,se),i&2){let t=m();U(t.data.Data)}}function ra(i,e){i&1&&(a(0,"tr",11)(1,"td",18),f(2,"empty-state-table"),r()())}var Bn=class i{constructor(e){this.data=e;this.modalConfig.title=`${e.ListTotal} Uncounted Products`,this.modalConfig.customWidth="600px",this.modalConfig.okText="<div> <i class='fa fa-print' aria-hidden='true'></i> Export </div>",this.modalConfig.hideCancel=!1,this.modalConfig.headerType=et.Warning,this.originalData=e.Data,this.initSearchKeywordListener()}exportService=h(En);productSearchInput;modalConfig=new gt;dialogRef=h(_t);filterProductToggle=!1;productNameFilter="";searchSubject=new ft;originalData=[];initSearchKeywordListener(){this.searchSubject.pipe(Ji(500),Me(),Le(),Q(e=>{let t=e?.trim()?.toLowerCase()||"";this.data.Data=t?this.originalData.filter(o=>o.Name.toLowerCase().includes(t)):this.originalData})).subscribe()}onOk(){this.exportService.exportCSV("AdjustmentExport/GetExportMissingVariantAdjustment",{AdjustmentID:this.data.Adjustment.ID,OutletID:this.data.Adjustment.OutletID,ExportPageNumber:1,ExportRowCount:1e4,Export:!0,Format:0})}onCancel(){this.dialogRef.close()}onProductNameFilterChange(){this.searchSubject.next(this.productNameFilter)}toggleProductFilter(){this.filterProductToggle=!this.filterProductToggle,this.filterProductToggle?setTimeout(()=>this.productSearchInput?.nativeElement?.focus(),0):(this.productNameFilter="",this.onProductNameFilterChange())}get searchTooltip(){return this.filterProductToggle?"Click to hide search bar":"Click to search product"}static \u0275fac=function(t){return new(t||i)(b(Gt))};static \u0275cmp=O({type:i,selectors:[["POS-dialog-unscanned-products"]],viewQuery:function(t,o){if(t&1&&Ce(Zr,5,Xi),t&2){let n;fe(n=he())&&(o.productSearchInput=n.first)}},decls:19,vars:4,consts:[["productSearchInput",""],[3,"onOk","onCancel","onClose","config"],[1,"container"],[1,"mt-4"],[1,"table","table-bordered"],[1,"thead-light"],[1,"d-flex","justify-content-between","align-items-center"],[4,"ngIf"],[1,"d-flex","justify-content-between","align-items-center",2,"cursor","pointer",3,"width"],[2,"width","120px"],[1,"text-end",2,"width","80px"],[1,"table-border-bottom-0"],[1,"d-flex","justify-content-between","align-items-center",2,"cursor","pointer"],["type","text","class","txtFilter form-control","placeholder","Search Product by Name","aria-label","Search","style","width: 100%; max-width: 250px","autofocus","",3,"ngModel","ngModelChange","click",4,"ngIf"],["matTooltipPosition","below",1,"fa-solid","ms-2",3,"click","matTooltip"],["type","text","placeholder","Search Product by Name","aria-label","Search","autofocus","",1,"txtFilter","form-control",2,"width","100%","max-width","250px",3,"ngModelChange","click","ngModel"],["target","_blank",3,"routerLink","queryParams"],[1,"text-end"],["colspan","3"]],template:function(t,o){t&1&&(a(0,"modal-material",1),_("onOk",function(){return o.onOk()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),a(1,"content")(2,"div",2)(3,"div")(4,"div",3)(5,"table",4)(6,"thead",5)(7,"tr")(8,"th")(9,"div",6),E(10,ta,2,0,"div",7),g(11,na,3,8,"div",8),r()(),a(12,"th",9),s(13,"Code"),r(),a(14,"th",10),s(15,"On-Hand"),r()()(),a(16,"tbody"),g(17,oa,2,0)(18,ra,3,0,"tr",11),r()()()()()()()),t&2&&(c("config",o.modalConfig),l(10),c("ngIf",!o.filterProductToggle),l(),C(o.data.Data.length>5?11:-1),l(6),C(o.data.Data.length>0?17:18))},dependencies:[ut,Ct,ct,Lo,yt,ve,qt,xt,B,X,Re,Ie],styles:[".txtFilter[_ngcontent-%COMP%]{transition:all .3s ease;border:1px solid #ccc;border-radius:4px;padding:.5rem .75rem;font-size:.7rem;background-color:#fff;color:#333}.txtFilter[_ngcontent-%COMP%]::placeholder{color:#999}.txtFilter[_ngcontent-%COMP%]:hover{border-color:#89b03e;background-color:#f7fdf0}.txtFilter[_ngcontent-%COMP%]:focus{border-color:#89b03e;outline:none;box-shadow:0 0 0 .25rem #89b03e40;background-color:#fff}.txtFilter[_ngcontent-%COMP%]:not(:focus):not(:hover){background-color:#fff}"]})};var cr=()=>["/menu/Adjustment/Adjustment/Archive/Form"],Ye=i=>({ID:i}),pr=()=>["/print/Adjustment"],ur=i=>({"border-end-0":i}),la=()=>({arrayName:"DifferencesArray"}),qn=(i,e)=>({"text-success":i,"text-danger":e}),sa=(i,e)=>({"text-danger":i,"text-success":e}),da=()=>({arrayName:"CountedArray"});function ma(i,e){if(i&1){let t=x();a(0,"div",9)(1,"button",27),_("click",function(){p(t);let n=m(2);return u(n.reject())}),f(2,"i",28),s(3,"Reject"),r(),a(4,"button",27),_("click",function(){p(t);let n=m(2);return u(n.accept())}),f(5,"i",29),s(6,"Accept "),r()()}}function ca(i,e){if(i&1&&(a(0,"a",30),f(1,"i",31),s(2,"Resume "),r()),i&2){let t=m(3);c("routerLink",Z(2,cr))("queryParams",V(3,Ye,t.data.ID))}}function pa(i,e){if(i&1){let t=x();a(0,"button",27),_("click",function(){p(t);let n=m(3);return u(n.onSubmit())}),f(1,"i",32),s(2,"Submit "),r()}}function ua(i,e){if(i&1&&(g(0,ca,3,5,"a",30),g(1,pa,3,0,"button",10)),i&2){let t=m(2);C(t.data.Adjustment.StateID==t.adjustmentState.Draft?0:-1),l(),C(t.data.Adjustment.StateID==t.adjustmentState.Draft?1:-1)}}function _a(i,e){if(i&1&&(a(0,"a",30),f(1,"i",31),s(2,"Edit "),r()),i&2){let t=m(3);c("routerLink",Z(2,cr))("queryParams",V(3,Ye,t.data.ID))}}function ga(i,e){if(i&1&&g(0,_a,3,5,"a",30),i&2){let t=m(2);C(t.data.Adjustment.TypeID==t.adjustmentType.AdjustDifferences&&(t.data.Adjustment.StateID==t.adjustmentState.Pending||t.data.Adjustment.StateID==t.adjustmentState.Accepted)?0:-1)}}function Ca(i,e){if(i&1){let t=x();a(0,"button",27),_("click",function(){p(t);let n=m(2);return u(n.delete())}),f(1,"i",33),s(2,"Delete "),r()}}function fa(i,e){if(i&1&&(a(0,"tr")(1,"th"),s(2,"Journal Link"),r(),a(3,"td"),s(4,":"),r(),a(5,"td")(6,"a",34),s(7,"View Journal"),r()()()),i&2){let t=m(2);l(6),c("href",me("https://accounting.dealpos.app/pages/journal-entry;TransID=",t.data.ID),Oe)}}function ha(i,e){i&1&&(a(0,"div",40),f(1,"div",42),r())}function ya(i,e){if(i&1&&(a(0,"div",12)(1,"div",36)(2,"h4"),s(3),v(4,"date"),r(),a(5,"p",37),s(6),v(7,"date"),r()(),a(8,"div",38),f(9,"i",39),g(10,ha,2,0,"div",40),r(),a(11,"div",41)(12,"h4"),s(13),r(),a(14,"p",37),s(15),r()()()),i&2){let t=m(),o=t.$implicit,n=t.$index,d=m(2);l(3),S(k(4,7,o.Date,"dd MMM yyyy")),l(3),S(k(7,10,o.Date,"HH:mm a")),l(3),un("color",n==0?"blue":"black"),l(),C(n!=d.data.StatusProcess.length-1?10:-1),l(3),S(o.Status),l(2),S(o.Creator)}}function va(i,e){if(i&1&&E(0,ya,16,13,"div",35),i&2){let t=e.$implicit;c("ngIf",t.Date)}}function xa(i,e){if(i&1){let t=x();a(0,"div",45)(1,"i",58),_("click",function(){p(t);let n=m(3);return u(n.showUnscannedProducts())}),r()()}}function Sa(i,e){if(i&1){let t=x();a(0,"a",59),_("click",function(){p(t);let n=m(3);return u(n.exportCSV(n.csvConverter,n.adjustmentTypeStatus!==-1&&n.adjustmentTypeStatus===1?"Adjustment/AdjustmentInfoExport":"Adjustment/AdjustmentCountedExport","Adjustment#"+n.data.Adjustment.Number+".csv"))}),f(1,"i",60),s(2,"Export"),r()}}function ba(i,e){i&1&&(At(0),a(1,"th",61),s(2,"Qty"),r(),jt())}function Ia(i,e){i&1&&(At(0),a(1,"th",61),s(2,"Counted"),r(),a(3,"th",61),s(4,"Expected"),r(),jt())}function Da(i,e){i&1&&(a(0,"th",61),s(1,"Expected"),r(),a(2,"th",61),s(3,"Counted"),r())}function Ta(i,e){i&1&&Ei(0)}function Pa(i,e){if(i&1&&E(0,Ta,1,0,"ng-container",64),i&2){m(4);let t=J(2);c("ngTemplateOutlet",t)("ngTemplateOutletContext",Z(2,la))}}function wa(i,e){if(i&1&&(E(0,Ia,5,0,"ng-container",56)(1,Da,4,0,"ng-template",null,3,K),a(3,"th",61)(4,"div",62)(5,"span",63),s(6," Diff "),r(),g(7,Pa,1,3,"ng-container"),r()()),i&2){let t=J(2),o=m(3);c("ngIf",o.data.Adjustment.TypeID===2&&(o.data.Adjustment.StateID===1||o.data.Adjustment.StateID===2))("ngIfElse",t),l(7),C(o.data.Adjustment.TypeID!=o.adjustmentType.AdjustDifferences&&!(o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity)?7:-1)}}function Ma(i,e){i&1&&(a(0,"th",65),s(1," Cost "),r())}function Ea(i,e){i&1&&(a(0,"th",65),s(1," Price "),r())}function Oa(i,e){if(i&1&&(a(0,"div"),s(1),r()),i&2){let t=m().$implicit,o=m(4);l(),S(o.parseTID(t.TID))}}function Aa(i,e){if(i&1&&(At(0),f(1,"p",71),jt()),i&2){let t=m().$implicit;l(),c("innerHTML",t.Note,$)}}function ja(i,e){if(i&1&&(At(0),a(1,"td",72),s(2),v(3,"number"),r(),jt()),i&2){let t=m().$implicit;l(),Tt(je(5,qn,t.Quantity>0,t.Quantity<0)),l(),I(" ",w(3,3,t.Quantity)," ")}}function ka(i,e){if(i&1&&(At(0),a(1,"td",72),s(2),v(3,"number"),r(),a(4,"td",72),s(5),v(6,"number"),r(),jt()),i&2){let t=m(2).$implicit;l(2),I(" ",w(3,2,t.Counted)," "),l(3),I(" ",w(6,4,t.Expected)," ")}}function Va(i,e){if(i&1&&(a(0,"td",72),s(1),v(2,"number"),r(),a(3,"td",72),s(4),v(5,"number"),r()),i&2){let t=m(2).$implicit;l(),I(" ",w(2,2,t.Expected)," "),l(3),I(" ",w(5,4,t.Counted)," ")}}function Na(i,e){if(i&1&&(E(0,ka,7,6,"ng-container",56)(1,Va,6,6,"ng-template",null,3,K),a(3,"td",72),s(4),v(5,"number"),r()),i&2){let t=J(2),o=m().$implicit,n=m(4);c("ngIf",n.data.Adjustment.TypeID===2&&(n.data.Adjustment.StateID===1||n.data.Adjustment.StateID===2))("ngIfElse",t),l(3),Tt(je(7,sa,o.Expected>o.Counted,o.Expected<o.Counted)),l(),I(" ",w(5,5,o.Difference)," ")}}function Fa(i,e){if(i&1&&(f(0,"td",73),v(1,"number")),i&2){let t=m().$implicit;c("innerHTML",w(1,1,t.UnitCost),$)}}function Ua(i,e){if(i&1&&(f(0,"td",73),v(1,"number")),i&2){let t=m().$implicit;c("innerHTML",w(1,1,t.UnitPrice),$)}}function La(i,e){if(i&1&&(a(0,"tr"),f(1,"td",67),a(2,"td")(3,"a",68),s(4),r(),a(5,"div"),s(6),r(),g(7,Oa,2,1,"div"),f(8,"app-serial-note",69),E(9,Aa,2,1,"ng-container",23),r(),E(10,ja,4,8,"ng-container",56)(11,Na,6,10,"ng-template",null,4,K)(13,Fa,2,3,"td",70)(14,Ua,2,3,"td",70),r()),i&2){let t=e.$implicit,o=e.index,n=J(12),d=m(4);l(),c("innerHTML",o+1+".",$),l(2),c("queryParams",V(11,Ye,t.VariantID)),l(),S(t.Name),l(2),S(t.Code),l(),C(t.TID&&t.TID.length>0?7:-1),l(),c("serials",t.Serial),l(),c("ngIf",t.Note!=null),l(),c("ngIf",d.data.Adjustment.TypeID==d.adjustmentType.AdjustDifferences||d.data.Adjustment.StateID==d.adjustmentState.Accepted&&d.data.Adjustment.TypeID==d.adjustmentType.CountQuantity)("ngIfElse",n),l(3),c("ngIf",d.roleService.product.Cost),l(),c("ngIf",d.roleService.sell.PriceVisible)}}function Ra(i,e){if(i&1&&E(0,La,15,13,"tr",66),i&2){let t=m(3);c("ngForOf",t.filteredDifferences)}}function Qa(i,e){i&1&&(a(0,"tr")(1,"td",74),f(2,"app-empty-state"),r()())}function Ba(i,e){if(i&1&&(a(0,"td",76)(1,"b"),s(2),v(3,"sum"),v(4,"number"),r()()),i&2){let t=m(4);l(2),S(w(4,4,k(3,1,t.filteredDifferences,"Counted")))}}function Ha(i,e){if(i&1&&(a(0,"td",76)(1,"b"),s(2),v(3,"sum"),v(4,"number"),r()()),i&2){let t=m(4);l(2),S(w(4,4,k(3,1,t.filteredDifferences,"Expected")))}}function Wa(i,e){if(i&1&&(a(0,"b"),v(1,"sum"),v(2,"sum"),s(3),v(4,"sum"),v(5,"number"),r()),i&2){let t=m(4);Tt(je(14,qn,k(1,3,t.filteredDifferences,"Quantity")>0,k(2,6,t.filteredDifferences,"Quantity")<0)),l(3),S(w(5,12,k(4,9,t.filteredDifferences,"Quantity")))}}function qa(i,e){if(i&1&&(a(0,"b",81),v(1,"sum"),v(2,"sum"),s(3),v(4,"sum"),v(5,"number"),r()),i&2){let t=m(4);c("ngClass",je(13,qn,k(1,2,t.filteredDifferences,"Difference")>0,k(2,5,t.filteredDifferences,"Difference")<0)),l(3),I(" ",w(5,11,k(4,8,t.filteredDifferences,"Difference"))," ")}}function Ga(i,e){if(i&1&&(a(0,"td",82)(1,"b"),s(2),v(3,"sum"),v(4,"number"),r()()),i&2){let t=m(4);l(2),S(w(4,4,k(3,1,t.filteredDifferences,"TotalCost")))}}function za(i,e){if(i&1&&(a(0,"td",83)(1,"b"),s(2),v(3,"sum"),v(4,"number"),r()()),i&2){let t=m(4);l(2),S(w(4,4,k(3,1,t.filteredDifferences,"TotalPrice")))}}function $a(i,e){if(i&1&&(a(0,"tfoot")(1,"tr")(2,"td",75)(3,"b"),s(4,"Total :"),r()(),g(5,Ba,5,6,"td",76),g(6,Ha,5,6,"td",76),a(7,"td",77),E(8,Wa,6,17,"b",78)(9,qa,6,16,"ng-template",null,5,K),r(),E(11,Ga,5,6,"td",79)(12,za,5,6,"td",80),r()()),i&2){let t=J(10),o=m(3);l(2),c("colSpan",o.data.Adjustment.TypeID==o.adjustmentType.AdjustDifferences||o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity||o.data.Adjustment.TypeID!=o.adjustmentType.AdjustDifferences&&!(o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity)?2:4),l(3),C(o.data.Adjustment.TypeID!=o.adjustmentType.AdjustDifferences&&!(o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity)?5:-1),l(),C(o.data.Adjustment.TypeID!=o.adjustmentType.AdjustDifferences&&!(o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity)?6:-1),l(2),c("ngIf",o.data.Adjustment.TypeID==o.adjustmentType.AdjustDifferences||o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity)("ngIfElse",t),l(3),c("ngIf",o.roleService.product.Cost),l(),c("ngIf",o.roleService.sell.PriceVisible)}}function Ka(i,e){if(i&1&&(a(0,"div",14)(1,"div",43)(2,"div",44)(3,"h2"),s(4),r(),g(5,xa,2,0,"div",45),r(),a(6,"div",46)(7,"a",47),f(8,"i",48),s(9,"Print "),r(),E(10,Sa,3,0,"a",49),r()(),a(11,"div",20)(12,"div",50)(13,"table",51)(14,"thead",52)(15,"tr")(16,"th",53),s(17,"No"),r(),a(18,"th",54),s(19," Name "),a(20,"small",55),s(21),v(22,"sum"),v(23,"number"),r()(),E(24,ba,3,0,"ng-container",56)(25,wa,8,3,"ng-template",null,2,K)(27,Ma,2,0,"th",57)(28,Ea,2,0,"th",57),r()(),a(29,"tbody"),g(30,Ra,1,1,"tr")(31,Qa,3,0,"tr"),r(),g(32,$a,13,7,"tfoot"),r()()()()),i&2){let t=J(26),o=m(2);l(4),I(" ",o.data.Adjustment.TypeID==o.adjustmentType.AdjustDifferences||o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity?"Adjusted":"Counted"," Inventory "),l(),C(o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity&&(o.data.Adjustment.StateID==o.adjustmentState.Draft||o.data.Adjustment.StateID==o.adjustmentState.Pending)?5:-1),l(2),c("routerLink",Z(20,pr))("queryParams",V(21,Ye,o.paramId))("ngClass",V(23,ur,o.roleService.global.Export)),l(3),c("ngIf",o.roleService.global.Export),l(11),Dn(" (",o.filteredDifferences&&o.filteredDifferences.length>0?o.filteredDifferences.length:0," SKU - ",w(23,18,k(22,15,o.filteredDifferences,"Quantity"))," ",o.data.Adjustment.TypeID==o.adjustmentType.AdjustDifferences||o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity?"Adjusted":"Counted",")"),l(3),c("ngIf",o.data.Adjustment.TypeID==o.adjustmentType.AdjustDifferences||o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity)("ngIfElse",t),l(3),c("ngIf",o.roleService.product.Cost),l(),c("ngIf",o.roleService.sell.PriceVisible),l(2),C(o.filteredDifferences&&o.filteredDifferences.length>0?30:31),l(2),C(o.filteredDifferences&&o.filteredDifferences.length>0&&o.filteredDifferences.length?32:-1)}}function Ja(i,e){i&1&&(a(0,"h2"),s(1," Counted Inventory "),r())}function Za(i,e){if(i&1){let t=x();a(0,"a",59),_("click",function(){p(t);let n=m(3);return u(n.exportCSV(n.csvConverter,"Adjustment/AdjustmentCountedExport","Adjustment_Counted#"+n.data.Adjustment.Number+".csv"))}),f(1,"i",60),s(2,"Export"),r()}}function Xa(i,e){i&1&&Ei(0)}function Ya(i,e){if(i&1&&(a(0,"div"),s(1),r()),i&2){let t=m().$implicit,o=m(4);l(),S(o.parseTID(t.TID))}}function tl(i,e){if(i&1&&(a(0,"tr"),f(1,"td",67),a(2,"td")(3,"a",68),s(4),r(),a(5,"div"),s(6),r(),g(7,Ya,2,1,"div"),r(),a(8,"td",72),s(9),v(10,"number"),r(),a(11,"td",72),s(12),v(13,"number"),r(),a(14,"td",88),s(15),v(16,"number"),r()()),i&2){let t=e.$implicit,o=e.index;l(),c("innerHTML",o+1+".",$),l(2),c("queryParams",V(16,Ye,t.VariantID)),l(),S(t.Name),l(2),S(t.Code),l(),C(t.TID&&t.TID.length>0?7:-1),l(2),S(w(10,10,t.Counted)),l(3),S(w(13,12,t.Expected)),l(2),Tt(je(18,qn,t.Difference>0,t.Difference<0)),l(),I(" ",w(16,14,t.Difference)," ")}}function el(i,e){if(i&1&&E(0,tl,17,21,"tr",66),i&2){let t=m(3);c("ngForOf",t.filteredCounted)}}function nl(i,e){i&1&&(a(0,"tr")(1,"td",89),f(2,"app-empty-state"),r()())}function il(i,e){if(i&1&&(a(0,"tfoot")(1,"tr")(2,"td",75)(3,"b"),s(4,"Total :"),r()(),a(5,"td",76)(6,"b"),s(7),v(8,"sum"),v(9,"number"),r()(),a(10,"td",76)(11,"b"),s(12),v(13,"sum"),v(14,"number"),r()(),a(15,"td",90)(16,"b"),s(17),v(18,"sum"),v(19,"number"),r()()()()),i&2){let t=m(3);l(2),c("colSpan",2),l(5),S(w(9,7,k(8,4,t.filteredCounted,"Counted"))),l(5),S(w(14,12,k(13,9,t.filteredCounted,"Expected"))),l(5),S(w(19,17,k(18,14,t.filteredCounted,"Difference")))}}function ol(i,e){if(i&1&&(a(0,"div",14)(1,"div",43)(2,"div",84),E(3,Ja,2,0,"h2",23),r(),a(4,"div",46)(5,"a",47),f(6,"i",48),s(7,"Print "),r(),E(8,Za,3,0,"a",49),r()(),a(9,"div",20)(10,"div",50)(11,"table",51)(12,"thead",52)(13,"tr")(14,"th",53),s(15,"No"),r(),a(16,"th",54),s(17," Name "),a(18,"small",55),s(19),v(20,"sum"),v(21,"number"),r()(),a(22,"th",85),s(23,"Counted"),r(),a(24,"th",85),s(25,"Expected"),r(),a(26,"th",85)(27,"div",86)(28,"span",87),s(29," Diff "),r(),E(30,Xa,1,0,"ng-container",64),r()()()(),a(31,"tbody"),g(32,el,1,1,"tr")(33,nl,3,0,"tr"),r(),g(34,il,20,19,"tfoot"),r()()()()),i&2){let t=m(2),o=J(2);l(3),c("ngIf",t.data.CountedArray.length>0&&t.data.Adjustment.TypeID==t.adjustmentType.CountQuantity),l(2),c("routerLink",Z(16,pr))("queryParams",V(17,Ye,t.paramId))("ngClass",V(19,ur,t.roleService.global.Export)),l(3),c("ngIf",t.roleService.global.Export),l(11),de(" (",t.filteredCounted&&t.filteredCounted.length>0?t.filteredCounted.length:0," SKU - ",w(21,14,k(20,11,t.filteredCounted,"Counted"))," Counted) "),l(11),c("ngTemplateOutlet",o)("ngTemplateOutletContext",Z(21,da)),l(2),C(t.filteredCounted&&t.filteredCounted.length>0?32:33),l(2),C(t.filteredCounted&&t.filteredCounted.length>0&&t.filteredCounted.length?34:-1)}}function rl(i,e){if(i&1&&(a(0,"mainpanel-cmp",8)(1,"actions"),g(2,ma,7,0,"div",9),a(3,"div",9),g(4,ua,2,2),g(5,ga,1,1),g(6,Ca,3,0,"button",10),r()(),a(7,"content")(8,"div",11)(9,"div",12)(10,"div",13)(11,"div",14)(12,"div",15)(13,"div",16),f(14,"h2",17,1),a(16,"div",18),f(17,"i",19),a(18,"span"),s(19),r()()()(),a(20,"div",20)(21,"table",21)(22,"tr")(23,"th"),s(24,"Date"),r(),a(25,"td"),s(26,":"),r(),f(27,"td",22),r(),a(28,"tr")(29,"th"),s(30,"PIC"),r(),a(31,"td"),s(32,":"),r(),f(33,"td",22),r(),a(34,"tr")(35,"th"),s(36,"Type"),r(),a(37,"td"),s(38,":"),r(),f(39,"td",22),r(),a(40,"tr")(41,"th"),s(42,"Note"),r(),a(43,"td"),s(44,":"),r(),f(45,"td",22),r(),E(46,fa,8,2,"tr",23),a(47,"tr")(48,"th"),s(49,"Tag"),r(),a(50,"td"),s(51,":"),r(),f(52,"td",22),r()()()(),a(53,"div")(54,"div",14)(55,"div",15)(56,"h2"),s(57,"Status"),r()(),a(58,"div",20),F(59,va,1,1,"div",12,se),r()()()(),a(61,"div",24),E(62,Ka,33,25,"div",25)(63,ol,35,22,"div",25),r()(),f(64,"pos-footer-alert",26),r()()()),i&2){let t=J(15),o=m();c("pageData",o.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),C(o.hasAccRejButton?2:-1),l(2),C(o.roleService.adjustment.Create?4:-1),l(),C(o.roleService.adjustment.Edit?5:-1),l(),C(o.roleService.adjustment.Delete?6:-1),l(8),c("matTooltip",t.classList.contains("text-truncate")?o.data.Adjustment.OutletName:"")("innerHTML",o.data.Adjustment.OutletName,$),l(2),c("ngClass",o.determineStatusClasses),l(),c("ngClass",o.getStatusIconClasses),l(2),S((o.data.Adjustment==null?null:o.data.Adjustment.StateLabel)||""),l(8),c("innerHTML",o.data.Adjustment.Date,$),l(6),c("innerHTML",o.data.Adjustment.PIC,$),l(6),c("innerHTML",o.data.Adjustment.TypeLabel,$),l(6),c("innerHTML",o.data.Adjustment.Note,$),l(),c("ngIf",o.data.AppsAccoutingActive&&o.roleService.accounting.View),l(6),c("innerHTML",o.data.Adjustment.TagName,$),l(7),U(o.data.StatusProcess),l(3),c("ngIf",o.data.DifferencesArray.length>0),l(),c("ngIf",(o.data.CountedArray==null?null:o.data.CountedArray.length)>0&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity),l(),c("created",o.data.CreatedInfo.Created)("modified",o.data.CreatedInfo.Modified)}}function al(i,e){if(i&1){let t=x();a(0,"div",91)(1,"i",92),_("click",function(n){let d=p(t).arrayName,y=J(3),D=m();return u(D.toggleFilter(n,y,d))}),r(),a(2,"p-popover",93,6)(4,"div",94)(5,"div",95)(6,"p-checkbox",96),P("ngModelChange",function(n){p(t);let d=m();return T(d.isAllSelected,n)||(d.isAllSelected=n),u(n)}),_("ngModelChange",function(n){let d=p(t).arrayName,y=m();return u(y.selectAll(n,d))}),r(),a(7,"label",97),s(8,"All"),r()(),a(9,"div",98)(10,"p-checkbox",99),P("ngModelChange",function(n){p(t);let d=m();return T(d.filterTreeCondition,n)||(d.filterTreeCondition=n),u(n)}),_("ngModelChange",function(){let n=p(t).arrayName,d=m();return u(d.onFilterChange(n))}),r(),a(11,"label",100),s(12),r()(),a(13,"div",98)(14,"p-checkbox",101),P("ngModelChange",function(n){p(t);let d=m();return T(d.filterTreeCondition,n)||(d.filterTreeCondition=n),u(n)}),_("ngModelChange",function(){let n=p(t).arrayName,d=m();return u(d.onFilterChange(n))}),r(),a(15,"label",102),s(16),r()()()()()}if(i&2){let t=e.arrayName,o=m();l(),un("margin-top",t==="CountedArray"?"5px":"0px"),Nt("ms-2",t==="CountedArray"),l(),c("dismissable",!0)("modal",!1),l(4),c("binary",!0),M("ngModel",o.isAllSelected),l(4),M("ngModel",o.filterTreeCondition),l(2),I("Matched (",o.data.MatchItemCount,")"),l(2),M("ngModel",o.filterTreeCondition),l(2),I("Unmatched (",o.data.UnmatchItemCount,")")}}var Hn=class i extends St{constructor(t,o,n,d,y,D,lt,ot){super(t,o,"Adjustment/AuditInventoryAdjustmentInfo",null,null,d);this.httpService=o;this.toastr=n;this.csvConverter=y;this.router=D;this.roleService=lt;this.dialog=ot;this.initQueryParam()}paramId;hasAccRejButton=!1;isEditable=!1;adjustmentType=ji;adjustmentState=ki;isAllSelected=!0;filterTreeCondition=["Matched","Unmatched"];filteredDifferences=[];filteredCounted=[];preGetList(){let t=this.route.snapshot.queryParams;this.pageData.Filter=t}initQueryParam(){let t=this.route.snapshot.queryParams;this.paramId=t.ID}postInit(t){this.menuData.H=t.PageTitle,t.Adjustment.StateID==2&&this.roleService.adjustment.Approval&&t.Config.WithApproval?this.hasAccRejButton=!0:this.hasAccRejButton=!1,(this.data.Adjustment.StateID==1||this.data.Adjustment.StateID==2)&&(this.isEditable=!0),this.filteredDifferences=this.data.DifferencesArray,this.filteredCounted=this.data.CountedArray}exportCSV(t,o,n){this.httpService.get(`/api/${o}`,[{key:"ID",value:this.paramId}]).subscribe(d=>{t.convertToCSV(d,n)})}reject(){if(!confirm("Are you sure you want to reject this?"))return;let t={ID:this.data.Adjustment.ID};this.httpService.post("/API/Adjustment/RejectCountedItem",t).subscribe({next:o=>{this.toastr.success("Success reject adjustment",et.Success),this.hasAccRejButton=!1,this.isEditable=!1,this.getListData()}})}accept(){if(!confirm("Are you sure you want to accept this?"))return;let t={ID:this.data.Adjustment.ID};this.httpService.post("/API/Adjustment/AcceptCountedItem",t).subscribe({next:o=>{this.toastr.success("Success accept adjustment",et.Success),this.hasAccRejButton=!1,this.isEditable=!1,this.getListData()}})}delete(){confirm("Are you sure you want to delete this?")&&this.httpService.delete("/api/Adjustment/DeleteInventoryAdjustmentInfo",{params:[{key:"ID",value:this.data.Adjustment.ID}]}).subscribe(()=>{this.toastr.success("Success delete record.",et.Success),this.router.navigate(["/menu/Adjustment/Adjustment/Archive"])})}get determineStatusClasses(){let t=this.data?.Adjustment?.StateLabel;return t?{"bg-draft":t.includes("Draft"),"bg-in-review":t.includes("Pending"),"bg-rejected":t.includes("Rejected"),"bg-accepted":t.includes("Accepted")}:{"bg-draft":!1,"bg-in-review":!1,"bg-rejected":!1,"bg-accepted":!1}}get getStatusIconClasses(){let t=this.data?.Adjustment?.StateLabel;return t?{"fa-check":t.includes("Accepted"),"fa-bookmark":t.includes("Draft"),"fa-hourglass-start":t.includes("Pending"),"fa-xmark":t.includes("Rejected")}:{"fa-check":!1,"fa-bookmark":!1,"fa-hourglass-start":!1,"fa-xmark":!1}}onSubmit(){this.dialog.open(er,{data:{title:"Submit Review",message:`
|
|
2
|
+
<h4>Are you sure you want to Change status to pending review?</h4>
|
|
3
|
+
`,headerType:et.Warning}}).afterClosed().pipe(dt(t=>t===!0),it(()=>this.httpService.post(wt.AdjusmentSubmitReview,{ID:this.data.Adjustment.ID}))).subscribe(t=>{this.toastr.success(t.Message,et.Success),this.getListData()})}showUnscannedProducts(){this.httpService.post("/api/Adjustment/GetListMissingVariantAdjustment",{AdjustmentID:this.data.Adjustment.ID,OutletID:this.data.Adjustment.EntityID,PageNumber:1,RowCount:100}).subscribe(t=>{let o={Data:t.Data,Adjustment:{ID:this.data.Adjustment.ID,OutletID:this.data.Adjustment.EntityID},ListTotal:t.ListTotal};this.dialog.open(Bn,{data:o})})}selectAll(t,o){this.isAllSelected=t,t?this.filterTreeCondition=["Matched","Unmatched"]:this.filterTreeCondition=[],this.onFilterChange(o),o==="DifferencesArray"&&this.data?.DifferencesArray?this.data.DifferencesArray.forEach(n=>n.selected=t):o==="CountedArray"&&this.data?.CountedArray&&this.data.CountedArray.forEach(n=>n.selected=t)}onFilterChange(t){let o=["Matched","Unmatched"];this.isAllSelected=o.every(n=>this.filterTreeCondition.includes(n)),t==="DifferencesArray"?this.filteredDifferences=this.applyFilter(this.data.DifferencesArray,t):this.filteredCounted=this.applyFilter(this.data.CountedArray,t)}toggleFilter(t,o,n){o.toggle(t)}applyFilter(t,o){let{filterTreeCondition:n}=this;return n.includes("Matched")&&n.includes("Unmatched")?o==="DifferencesArray"?this.data.DifferencesArray:this.data.CountedArray:n.includes("Matched")?t.filter(y=>y.Difference===0):n.includes("Unmatched")?t.filter(y=>y.Difference!==0):[]}parseTID(t){return`[${t?.join(", ")}]`||null}get adjustmentTypeStatus(){return this.data?this.data.Adjustment.TypeID==this.adjustmentType.AdjustDifferences||this.data.Adjustment.StateID==this.adjustmentState.Accepted&&this.data.Adjustment.TypeID==this.adjustmentType.CountQuantity?1:2:-1}static \u0275fac=function(o){return new(o||i)(b(rt),b(L),b(vt),b(xe),b(kt),b(Ut),b(H),b(nt))};static \u0275cmp=O({type:i,selectors:[["POS-adjustment-info"]],standalone:!1,features:[mt],decls:3,vars:1,consts:[["filterTemplate",""],["outletName",""],["NOTACC",""],["ELSE_BLOCK",""],["NOTACCDATA",""],["COUNTEDTOTAL",""],["op",""],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"btn-group","me-4"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-4"],[1,"card"],[1,"card-header"],[1,"d-flex","gap-4"],[1,"text-truncate",3,"matTooltip","innerHTML"],[1,"badge","rounded-pill","d-flex","align-items-center","gap-3","fs-6",3,"ngClass"],[1,"fa-solid",3,"ngClass"],[1,"card-body"],[1,"table-sm","table-borderless"],[3,"innerHTML"],[4,"ngIf"],[1,"col-sm-8"],["class","card",4,"ngIf"],[3,"created","modified"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-thumbs-down","me-3"],[1,"fa-solid","fa-thumbs-up","me-3"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-pen-to-square","me-3"],[1,"fa-solid","fa-floppy-disk","me-3"],[1,"fa-solid","fa-trash","me-3"],[3,"href"],["class","row",4,"ngIf"],[1,"col","text-end"],[1,"mt-3"],[1,"col-3","text-center","position-relative"],[1,"fa-solid","fa-angle-up","current-status-icon"],[1,"d-flex","justify-content-center","h-100"],[1,"col-5"],[1,"timeline"],[1,"card-header","d-flex","justify-content-between"],[1,"d-flex","gap-3","align-items-center"],[1,"d-flex","justify-content-center","align-items-center","unscanned-btn-wrapper"],[1,"btn-group"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams","ngClass"],[1,"fa-solid","fa-print","me-3"],["class","btn btn-outline-secondary btn-sm","role","button",3,"click",4,"ngIf"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-center",2,"width","1px"],[2,"width","300px"],[1,"fst-italic","fs-6"],[4,"ngIf","ngIfElse"],["class","text-end","style","width: 120px",4,"ngIf"],["matTooltip","Show outlet products with stock but haven't been counted/scanned yet","matTooltipPosition","above",1,"fa-solid","fa-magnifying-glass","cursor-pointer","unscanned-icon",3,"click"],["role","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"fa-solid","fa-upload","me-3"],[1,"text-end",2,"width","80px"],[1,"d-flex","align-items-center","justify-content-end","gap-2"],["matTooltip","Difference = Counted - Expected","matTooltipPosition","above",1,"text-end"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"text-end",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"text-center",3,"innerHTML"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[3,"serials"],["class","text-end",3,"innerHTML",4,"ngIf"],[1,"special-TinyMCE","fst-italic","text-warning","mb-0",2,"word-break","break-all",3,"innerHTML"],[1,"text-end"],[1,"text-end",3,"innerHTML"],["colspan","7"],[1,"text-end","empty-column",3,"colSpan"],["matTooltipPosition","above",1,"text-end","empty-column"],[1,"text-end","empty-column"],[3,"class",4,"ngIf","ngIfElse"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Cost",4,"ngIf"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Price",4,"ngIf"],[3,"ngClass"],["matTooltipPosition","above","matTooltip","Total from Quantity x Cost",1,"text-end","empty-column"],["matTooltipPosition","above","matTooltip","Total from Quantity x Price",1,"text-end","empty-column"],[1,"d-flex","align-items-center","gap-2"],[1,"text-end",2,"width","100px"],[1,"d-flex","align-items-center","justify-content-end","pe-4"],["matTooltip","Difference = Counted - Expected","matTooltipPosition","above",1,"me-2"],[1,"text-end",2,"padding-right","18px"],["colspan","5"],["matTooltipPosition","above",1,"text-end","empty-column",2,"padding-right","14px"],["matTooltip","Click to Filter Unmatched / Matched Items Only","matTooltipPosition","above",2,"cursor","pointer"],[1,"fa","fa-filter","pointer",3,"click"],[3,"dismissable","modal"],[1,"p-3",2,"width","150px"],[1,"border-bottom","pb-3","d-flex","align-items-center","column-gap-3"],["label","Select All","inputId","all",3,"ngModelChange","binary","ngModel"],["for","all",1,"ms-2"],[1,"mt-4","d-flex","align-items-center","column-gap-3"],["label","Matched","value","Matched","inputId","Matched",3,"ngModelChange","ngModel"],["for","Matched",1,"ms-2"],["label","Unmatched","value","Unmatched","inputId","Unmatched",3,"ngModelChange","ngModel"],["for","Unmatched",1,"ms-2"]],template:function(o,n){o&1&&E(0,rl,65,22,"mainpanel-cmp",7)(1,al,17,12,"ng-template",null,0,K),o&2&&c("ngIf",n.data)},dependencies:[Ft,Tn,ve,io,ct,at,B,X,Ie,To,wo,Je,Qn,Vn,q,Wt,We],styles:[".current-status-icon[_ngcontent-%COMP%]{background-color:#fff;border-radius:50%;box-shadow:0 2px #b8b8b8;width:35px;height:35px;font-size:35px}.timeline[_ngcontent-%COMP%]{border-left:3px solid #e1e1e1;height:100%;width:0px}.bg-draft[_ngcontent-%COMP%]{background-color:#ffa72a!important}.bg-in-review[_ngcontent-%COMP%]{background-color:#7e7e7e!important}.bg-rejected[_ngcontent-%COMP%]{background-color:#ff382e!important}.bg-accepted[_ngcontent-%COMP%]{background-color:#2fad1a!important}.unscanned-btn-wrapper[_ngcontent-%COMP%]{padding:3px;border-radius:120px;width:28px;height:28px;background-color:#ddd}.unscanned-icon[_ngcontent-%COMP%]{font-size:12px;margin-bottom:0}"]})};var sl=()=>["/menu/Adjustment/Adjustment/Archive/Form"],dl=()=>["/menu/Adjustment/Adjustment/Archive/Info"],ml=i=>({ID:i}),cl=i=>({"text-success":i}),pl=i=>({"text-danger":i});function ul(i,e){if(i&1){let t=x();a(0,"a",23),_("click",function(){p(t);let n=m(3);return u(n.httpPostListID("Adjustment/DeleteInventoryAdjustmentList"))}),f(1,"i",24),s(2,"Delete "),r()}}function _l(i,e){if(i&1){let t=x();a(0,"a",25),_("click",function(){p(t);let n=m(3);return u(n.onMergeAdjustment())}),f(1,"i",26),s(2," Merge "),r()}}function gl(i,e){if(i&1&&(a(0,"div",5),g(1,ul,3,0,"a",21),g(2,_l,3,0,"a",22),r()),i&2){let t=m(2);l(),C(t.getSelectedData().length>0&&(!(t.roleService==null||t.roleService.adjustment==null)&&t.roleService.adjustment.Delete)?1:-1),l(),C(t.getSelectedData().length>=2&&(!(t.roleService==null||t.roleService.adjustment==null)&&t.roleService.adjustment.Edit)?2:-1)}}function Cl(i,e){if(i&1){let t=x();a(0,"button",27),_("click",function(){p(t);let n=m(2);return u(n.openExportModal())}),f(1,"i",28),s(2," Export "),r()}}function fl(i,e){i&1&&(a(0,"a",7),s(1,"New"),r()),i&2&&c("routerLink",Z(1,sl))}function hl(i,e){if(i&1){let t=x();a(0,"div")(1,"div",29)(2,"h6"),s(3,"Outlet"),r(),a(4,"ng-select",30),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.EntityID,n)||(d.pageData.Filter.EntityID=n),u(n)}),r(),a(5,"h6"),s(6,"Date From - To"),r(),a(7,"div",31)(8,"div",32)(9,"datepicker",33),P("dateChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.From,n)||(d.pageData.Filter.From=n),u(n)}),r()(),a(10,"div",34)(11,"datepicker",35),P("dateChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.To,n)||(d.pageData.Filter.To=n),u(n)}),r()()(),a(12,"h6"),s(13,"Quantity From - To"),r(),a(14,"div",36)(15,"input",37),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.QuantityFrom,n)||(d.pageData.Filter.QuantityFrom=n),u(n)}),r(),s(16," - "),a(17,"input",37),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.QuantityTo,n)||(d.pageData.Filter.QuantityTo=n),u(n)}),r()(),a(18,"h6"),s(19,"State"),r(),a(20,"ng-select",38),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.State,n)||(d.pageData.Filter.State=n),u(n)}),r(),a(21,"h6"),s(22,"Adjustment Type"),r(),a(23,"ng-select",39),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.Type,n)||(d.pageData.Filter.Type=n),u(n)}),r(),a(24,"h6"),s(25,"Adjustment Tag"),r(),a(26,"ng-select",40),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.TagID,n)||(d.pageData.Filter.TagID=n),u(n)}),r(),a(27,"h6"),s(28,"Rows"),r(),a(29,"input",41),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.RowCount,n)||(d.pageData.Filter.RowCount=n),u(n)}),r(),a(30,"h6"),s(31,"Exclude Zero"),r(),a(32,"radio-options",42),P("modelChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.ExcludeZero,n)||(d.pageData.Filter.ExcludeZero=n),u(n)}),r()()()}if(i&2){let t=m(2);l(4),c("items",t.pageData.Options.Entities),M("ngModel",t.pageData.Filter.EntityID),l(5),c("isFloatingLabel",!1),M("date",t.pageData.Filter.From),l(2),c("isFloatingLabel",!1),M("date",t.pageData.Filter.To),l(4),M("ngModel",t.pageData.Filter.QuantityFrom),l(2),M("ngModel",t.pageData.Filter.QuantityTo),l(3),c("items",t.pageData.Options.States),M("ngModel",t.pageData.Filter.State),l(3),c("items",t.pageData.Options.Types),M("ngModel",t.pageData.Filter.Type),l(3),c("items",t.pageData.Options.AdjustmentTagsOptions),M("ngModel",t.pageData.Filter.TagID),l(3),M("ngModel",t.pageData.Filter.RowCount),c("max",1e4),l(3),M("model",t.pageData.Filter.ExcludeZero)}}function yl(i,e){if(i&1){let t=x();a(0,"th",12)(1,"input",43),_("change",function(n){p(t);let d=m(2);return u(d.onSelectAllData(n.target.checked))}),r()()}}function vl(i,e){i&1&&(a(0,"th",18),s(1,"Cost"),r())}function xl(i,e){if(i&1){let t=x();a(0,"td")(1,"input",48),P("ngModelChange",function(n){p(t);let d=m().$implicit;return T(d.selected,n)||(d.selected=n),u(n)}),r()()}if(i&2){let t=m().$implicit;l(),M("ngModel",t.selected)}}function Sl(i,e){if(i&1&&(a(0,"td",45),s(1),v(2,"quantityFraction"),r()),i&2){let t=m().$implicit;l(),I(" ",w(2,1,t.Quantity)," ")}}function bl(i,e){if(i&1&&(a(0,"td",45),s(1),v(2,"quantityFraction"),r()),i&2){let t=m().$implicit;Tt(V(5,cl,t.Quantity>0)),l(),I(" +",w(2,3,t.Quantity)," ")}}function Il(i,e){if(i&1&&(a(0,"td",45),s(1),v(2,"quantityFraction"),r()),i&2){let t=m().$implicit;Tt(V(5,pl,t.Quantity<0)),l(),I(" ",w(2,3,t.Quantity)," ")}}function Dl(i,e){if(i&1&&(a(0,"td",45),s(1),v(2,"amountFraction"),r()),i&2){let t=m().$implicit;l(),S(w(2,1,t.Cost))}}function Tl(i,e){if(i&1&&(a(0,"tr",19),g(1,xl,2,1,"td"),a(2,"td"),s(3),r(),a(4,"td")(5,"a",44),s(6),r()(),a(7,"td"),s(8),v(9,"date"),r(),a(10,"td",45),s(11),v(12,"number"),r(),g(13,Sl,3,3,"td",45),g(14,bl,3,7,"td",46),g(15,Il,3,7,"td",46),a(16,"td"),s(17),r(),g(18,Dl,3,3,"td",45),a(19,"td"),s(20),r(),a(21,"td"),f(22,"div",47),r()()),i&2){let t=e.$implicit,o=m(2);l(),C(!(o.roleService==null||o.roleService.adjustment==null)&&o.roleService.adjustment.Delete||!(o.roleService==null||o.roleService.adjustment==null)&&o.roleService.adjustment.Edit?1:-1),l(2),S(t.EntityName),l(2),c("routerLink",Z(21,dl))("queryParams",V(22,ml,t.ID)),l(),S(t.Number),l(2),S(k(9,16,t.Date,"dd MMM yyyy")),l(3),S(w(12,19,t.SKUCount)),l(2),C(t.Quantity==0?13:-1),l(),C(t.Quantity>0?14:-1),l(),C(t.Quantity<0?15:-1),l(2),S(t.TypeLabel),l(),C(!(o.roleService==null||o.roleService.product==null)&&o.roleService.product.Cost?18:-1),l(),to(o.stateColored(+t.StateID)),l(),I(" ",t.StateLabel," "),l(2),c("innerHTML",t.Note,$)}}function Pl(i,e){if(i&1){let t=x();a(0,"mainpanel-cmp",2),P("textChange",function(n){p(t);let d=m();return T(d.pageData.Filter.Number,n)||(d.pageData.Filter.Number=n),u(n)}),_("onSubmit",function(){p(t);let n=m();return u(n.searchFromPageOne())}),P("filterChange",function(n){p(t);let d=m();return T(d.pageData.Filter,n)||(d.pageData.Filter=n),u(n)}),a(1,"actions")(2,"a",3),f(3,"i",4),s(4,"Scanner App "),r(),g(5,gl,3,2,"div",5),g(6,Cl,3,0,"button",6),g(7,fl,2,2,"a",7),r(),a(8,"filters"),E(9,hl,33,17,"ng-template",null,0,K),r(),a(11,"content")(12,"div",8)(13,"div",9)(14,"table",10)(15,"thead",11)(16,"tr"),g(17,yl,2,0,"th",12),a(18,"th",13),s(19,"Outlet"),r(),a(20,"th",13),s(21,"Number"),r(),a(22,"th",14),s(23,"Date"),r(),a(24,"th",15),s(25,"SKU"),r(),a(26,"th",16),s(27," Qty "),r(),a(28,"th",17),s(29,"Type"),r(),g(30,vl,2,0,"th",18),a(31,"th",14),s(32,"State"),r(),a(33,"th"),s(34,"Note"),r()()(),a(35,"tbody"),F(36,Tl,23,24,"tr",19,tt),r()()(),a(38,"POS-complex-pagination",20),_("jumpToPage",function(){p(t);let n=m();return u(n.getListData())})("previousPage",function(){p(t);let n=m();return u(n.getListData())})("nextPage",function(){p(t);let n=m();return u(n.getListData())}),r()()()()}if(i&2){let t=m();c("pageData",t.menuData),M("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),M("filter",t.pageData.Filter),l(5),C(!(t.roleService==null||t.roleService.adjustment==null)&&t.roleService.adjustment.Delete||!(t.roleService==null||t.roleService.adjustment==null)&&t.roleService.adjustment.Edit?5:-1),l(),C(t.roleService.global.Export?6:-1),l(),C(t.roleService.adjustment.Create?7:-1),l(10),C(!(t.roleService==null||t.roleService.adjustment==null)&&t.roleService.adjustment.Delete||!(t.roleService==null||t.roleService.adjustment==null)&&t.roleService.adjustment.Edit?17:-1),l(13),C(!(t.roleService==null||t.roleService.product==null)&&t.roleService.product.Cost?30:-1),l(6),U(t.data.Data),l(2),c("total",t.data.Data.length)("pageData",t.pageData)}}var Gn=class i extends St{constructor(t,o,n,d,y,D){super(t,o,"Adjustment/GetInventoryAdjustmentList","AdjustmentLoader/GetInventoryAdjustmentList",n);this.toastr=n;this.csvConverter=d;this.roleService=y;this.matDialog=D}hideMore=!1;openExportModal(){this.matDialog.open(Rt,{data:{title:"Inventory Adjustment",exportTypes:[{ID:"AdjustmentExport/GetInventoryAdjustmentList",Value:"Default",FileName:"Inventory Adjustment"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/GetInventoryAdjustmentListCount",pagination:!0}})}onMergeAdjustment(){let t=this.getSelectedData();this.matDialog.open(tr,{data:{data:t,title:"Choose Merge Target",columns:[{type:"text",field:"Number"},{type:"date",field:"Date"},{type:"number",field:"Quantity"},{type:"text",field:"TypeLabel"},{type:"text",field:"StateLabel"}],headers:["Number","Date","Qty","Type","Status"]},width:"600px"}).afterClosed().pipe(dt(o=>o),it(o=>this.httpService.put(wt.MergeAdjustment,o))).subscribe(()=>{this.toastrService.success("Inventory Adjustment records have been merged successfully.",et.Success),this.getListData()})}stateColored(t){switch(t){case 1:return{color:"#FFA72A"};case 2:return{color:"#7E7E7E"};case 3:return{color:"#FF382E"};case 4:return{color:"#2FAD1A"}}}static \u0275fac=function(o){return new(o||i)(b(rt),b(L),b(vt),b(kt),b(H),b(nt))};static \u0275cmp=O({type:i,selectors:[["POS-inventory-adjustment"]],standalone:!1,features:[mt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["href","https://www.dealpos.co.id/tour/scanner","target","_blank",1,"btn","btn-outline-secondary","me-3"],[1,"fa-solid","fa-scanner","me-3"],[1,"btn-group","me-3"],[1,"btn","btn-outline-secondary","me-3"],[1,"button","btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","14px"],[2,"width","120px"],[2,"width","100px"],[1,"text-end",2,"width","55px"],["matTooltipPosition","above","matTooltip","Adjusted Quantity",1,"text-end",2,"width","50px"],[2,"width","130px"],[1,"text-end",2,"width","95px"],[1,"border-bottom"],["api","Adjustment/GetInventoryAdjustmentListCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary"],["role","button",1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash","me-3"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-merge","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 an outlet",3,"ngModelChange","items","ngModel"],[1,"row"],[1,"col-6","pe-2"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"col-6","ps-2"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"d-flex","align-items-center",2,"column-gap","8px"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an State",3,"ngModelChange","items","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose an Type",3,"ngModelChange","items","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose an Tags",3,"ngModelChange","items","ngModel"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel","max"],[3,"modelChange","model"],["type","checkbox",3,"change"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end",3,"class"],[3,"innerHTML"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(o,n){o&1&&g(0,Pl,39,11,"mainpanel-cmp",1),o&2&&C(n.data?0:-1)},dependencies:[ct,at,xt,ao,B,X,ze,pt,Kt,jn,Lt,Ie,q,Wt,Io,Do],encapsulation:2})};var $n=class i{config;dialogRef=h(_t);data=h(Gt);filterKeys=["From","To","PageNumber","RowCount","EntityID","TagID"];httpService=h(L);summaryData=z(null);constructor(){this.config=new gt,this.config.title="Total Adjustment Summary",this.config.hideFooter=!0,this.config.customWidth="382px"}ngOnInit(){console.log("DialogAdjustmentSummaryComponent",this.data.pageData),console.log("data",this.data);let e=Object.entries(this.data.pageData).filter(([o,n])=>this.filterKeys.includes(o)).map(([o,n])=>{if(o==="From"||o==="To"){let d=new Date(n);return{[o]:new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}).format(d).replace(/(\d{4})\/(\d{2})\/(\d{2})/,"$1-$2-$3")+"T00:00:00.000"}}return{[o]:n}}),t=e.reduce((o,n)=>j(j({},o),n),{});this.httpService.post("api/Adjustment/AuditAdjustmentSumReport",t).pipe(Ot(o=>o.Data),Q(o=>this.summaryData.set(o))).subscribe(),console.log("tdf",e)}onOK(){}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["pos-dialog-adjustment-summary"]],decls:29,vars:13,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid"],[1,"table","table-bordered"],[1,"py-2",2,"width","40%"],[1,"text-end","py-2"]],template:function(t,o){t&1&&(a(0,"modal-material",0),_("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),a(1,"content")(2,"div",1)(3,"table",2)(4,"tbody")(5,"tr")(6,"th",3),s(7,"Quantity"),r(),a(8,"td",4),s(9),v(10,"number"),r()(),a(11,"tr")(12,"th",3),s(13,"Weight"),r(),a(14,"td",4),s(15),v(16,"number"),r()(),a(17,"tr")(18,"th",3),s(19,"Total Cost"),r(),a(20,"td",4),s(21),v(22,"number"),r()(),a(23,"tr")(24,"th",3),s(25,"Total Price"),r(),a(26,"td",4),s(27),v(28,"number"),r()()()()()()()),t&2&&(c("config",o.config),l(9),I(" ",w(10,5,o.summaryData().Quantity)," "),l(6),I(" ",w(16,7,o.summaryData().Weight)," "),l(6),I(" ",w(22,9,o.summaryData().TotalCost)," "),l(6),I(" ",w(28,11,o.summaryData().TotalPrice)," "))},dependencies:[ut,Ct,yt,q],encapsulation:2,changeDetection:0})};var Ml=()=>["/menu/Adjustment/Adjustment/Archive/Info"],El=i=>({ID:i});function Ol(i,e){if(i&1){let t=x();a(0,"button",4),_("click",function(){p(t);let n=m();return u(n.openExportModal())}),f(1,"i",5),s(2," Export "),r()}}function Al(i,e){if(i&1){let t=x();a(0,"div",6)(1,"h6"),s(2,"Outlets"),r(),a(3,"outlet-selector",7),P("ngModelChange",function(n){p(t);let d=m();return T(d.pageData.Filter.EntityID,n)||(d.pageData.Filter.EntityID=n),u(n)}),r(),a(4,"h6"),s(5,"From"),r(),a(6,"datepicker",8),P("dateChange",function(n){p(t);let d=m();return T(d.pageData.Filter.From,n)||(d.pageData.Filter.From=n),u(n)}),r(),a(7,"h6"),s(8,"To"),r(),a(9,"datepicker",9),P("dateChange",function(n){p(t);let d=m();return T(d.pageData.Filter.To,n)||(d.pageData.Filter.To=n),u(n)}),r(),a(10,"h6"),s(11,"Adjustment Tag"),r(),a(12,"ng-select",10),P("ngModelChange",function(n){p(t);let d=m();return T(d.pageData.Filter.TagID,n)||(d.pageData.Filter.TagID=n),u(n)}),r()()}if(i&2){let t=m();l(3),c("accessType",2),M("ngModel",t.pageData.Filter.EntityID),c("multiple",!1),l(3),c("isFloatingLabel",!1),M("date",t.pageData.Filter.From),l(3),c("isFloatingLabel",!1),M("date",t.pageData.Filter.To),l(3),c("items",t.pageData.Options.AdjustmentTagsOptions),M("ngModel",t.pageData.Filter.TagID)}}function jl(i,e){i&1&&(a(0,"th",22),s(1," @ Cost "),r())}function kl(i,e){i&1&&(a(0,"th",22),s(1," @ Price "),r())}function Vl(i,e){if(i&1&&(a(0,"th",36),s(1),v(2,"number"),r()),i&2){let t=m().$implicit;l(),I(" ",w(2,1,t.UnitCost)," ")}}function Nl(i,e){if(i&1&&(a(0,"th",36),s(1),v(2,"number"),r()),i&2){let t=m().$implicit;l(),I(" ",w(2,1,t.UnitPrice)," ")}}function Fl(i,e){if(i&1&&(a(0,"tr")(1,"th",32),s(2),r(),a(3,"th",33),s(4),r(),a(5,"th",34),s(6),v(7,"number"),r(),E(8,Vl,3,3,"th",35)(9,Nl,3,3,"th",35),r()),i&2){let t=e.$implicit,o=m(3);l(2),I(" ",t.VariantName," "),l(2),I(" ",t.VariantCode," "),l(2),I(" ",w(7,5,t.Quantity)," "),l(2),c("ngIf",o.roleService.product.Cost),l(),c("ngIf",o.roleService.sell.UnitPriceEditor)}}function Ul(i,e){if(i&1&&(a(0,"div")(1,"div",23)(2,"div",24)(3,"a",25),f(4,"span",26),v(5,"date"),f(6,"small",27),v(7,"date"),a(8,"small",28),s(9),r()()()(),a(10,"div")(11,"strong",29),s(12),r(),f(13,"div",30),r(),a(14,"table",31)(15,"tbody"),E(16,Fl,10,7,"tr",18),r()()()),i&2){let t=e.$implicit;l(3),c("routerLink",Z(14,Ml))("queryParams",V(15,El,t.ID)),l(),c("innerHTML",t.EntityName+" #"+t.Number+" - "+k(5,8,t.Created,"dd MMM yyyy"),$),l(2),c("innerHTML","("+k(7,11,t.Created,"HH:mm")+")",$),l(3),I(" ",t.PIC),l(3),I("[Q:",t.Quantity,"]"),l(),c("innerHTML",t.Note,$),l(3),c("ngForOf",t.Items)}}function Ll(i,e){if(i&1){let t=x();a(0,"div",11)(1,"table",12)(2,"thead",13)(3,"tr")(4,"th",14),s(5,"Name"),r(),a(6,"th",15),s(7,"Code"),r(),a(8,"th",16),s(9,"Qty"),r(),E(10,jl,2,0,"th",17)(11,kl,2,0,"th",17),r()()(),E(12,Ul,17,17,"div",18),a(13,"div",19)(14,"button",20),_("click",function(){p(t);let n=m();return u(n.onDialogSummary())}),s(15," View Adjustment Summary "),r()(),a(16,"POS-complex-pagination",21),_("jumpToPage",function(){p(t);let n=m();return u(n.getListData())})("previousPage",function(){p(t);let n=m();return u(n.getListData())})("nextPage",function(){p(t);let n=m();return u(n.getListData())}),r()()}if(i&2){let t=m();l(10),c("ngIf",t.roleService.product.Cost),l(),c("ngIf",t.roleService.sell.UnitPriceEditor),l(),c("ngForOf",t.data.Data),l(4),c("total",t.data.Data.length)("pageData",t.pageData)}}var Kn=class i extends St{constructor(t,o,n,d,y){super(t,o,"Adjustment/AuditAdjustmentReport","AdjustmentLoader/AuditAdjustmentReport",void 0,void 0,!0);this.httpService=o;this.csvConverter=n;this.roleService=d;this.matDialog=y}dataEndpoint="/api/Adjustment/AuditAdjustmentReport";loaderEndpoint="/api/AdjustmentLoader/AuditAdjustmentReport";countEndpoint="/api/Adjustment/AuditAdjustmentReportCount";data$;loader$;loader;onOpenExportDialog(t){}openExportModal(){this.matDialog.open(Rt,{data:{title:"Adjustment Report",exportTypes:[{ID:"AdjustmentExport/AuditAdjustmentReport",Value:"Default",FileName:"Adjustment Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/AuditAdjustmentReportCount",pagination:!0}})}preInitList(){super.preInitList();let t=this.pageData.Options.AdjustmentTagsOptions.findIndex(o=>o.ID===this.pageData.Filter.TagID);this.pageData=R(j({},this.pageData),{Filter:R(j({},this.pageData.Filter),{TagID:t!==-1?this.pageData.Filter.TagID:null})})}onDialogSummary(){this.matDialog.open($n,{data:{pageData:this.pageData.Filter}})}static \u0275fac=function(o){return new(o||i)(b(rt),b(L),b(kt),b(H),b(nt))};static \u0275cmp=O({type:i,selectors:[["POS-adjustment-reports"]],standalone:!1,features:[mt],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["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 an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","Choose a tag","bindLabel","Name","bindValue","ID","appendTo","body",3,"ngModelChange","items","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","w-100"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[1,"text-end",2,"width","60px"],[1,"text-end",2,"width","50px"],["class","text-end","style","width: 80px",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-center","w-100","my-6"],["type","button",1,"btn","btn-outline-primary",3,"click"],["api","Adjustment/AuditAdjustmentReportCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"text-end",2,"width","80px"],[1,"d-lg-flex","mt-sm-0"],[1,"mt-5","ms-3"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHTML"],[1,"fst-italic","text-dark",3,"innerHTML"],[1,"fst-italic","text-dark"],[1,"text-danger","ms-3"],[3,"innerHTML"],[1,"table","table-bordered"],[1,"fw-normal",2,"width","645px","word-break","break-all"],[1,"fw-normal","text-end",2,"width","60px","word-break","break-all"],[1,"fw-normal","text-end",2,"width","50px"],["class","fw-normal text-end","style","width: 80px",4,"ngIf"],[1,"fw-normal","text-end",2,"width","80px"]],template:function(o,n){if(o&1){let d=x();a(0,"mainpanel-cmp",1),P("textChange",function(D){return p(d),T(n.pageData.Filter.Number,D)||(n.pageData.Filter.Number=D),u(D)}),_("onSubmit",function(){return p(d),u(n.searchFromPageOne())}),P("filterChange",function(D){return p(d),T(n.pageData.Filter,D)||(n.pageData.Filter=D),u(D)}),a(1,"actions"),E(2,Ol,3,0,"button",2),r(),a(3,"filters"),E(4,Al,13,9,"ng-template",null,0,K),r(),a(6,"content"),E(7,Ll,17,5,"div",3),r()()}o&2&&(c("pageData",n.menuData),M("text",n.pageData.Filter.Number),c("isFilterOnDropdown",!1),M("filter",n.pageData.Filter),l(2),c("ngIf",n.roleService.global.Export),l(5),c("ngIf",n.data&&n.data.Data))},dependencies:[Tn,ve,ct,at,B,X,ze,pt,Kt,Ge,q,Wt],encapsulation:2})};var Jn=class extends Mn{constructor(t,o){super(t);this.httpService=o;this.loaderApi="/API/AdjustmentLoader/StockTakeByCSV",this.productsApi="/API/Adjustment/GetSpreadsheetPagination",this.submitApi="/API/Adjustment/SubmitUseDefault",this.requestPayload=3,this.products=this.originalProducts=[],this.getDataFromLoader()}loaderData;products;originalProducts;adjustmentID;completeInfo;error;loaderApi;productsApi;submitApi;requestPayload;getDataFromLoader(){this.menuData$.pipe(Ki(()=>this.httpService.post(this.loaderApi,this.requestPayload))).subscribe(t=>this.loaderData=t)}getProduct(t){this.products=[],this.httpService.post(this.productsApi,t).subscribe(o=>{o.forEach(n=>{n.Counted="",this.products.push(n),this.originalProducts.push(n)})})}submitAdjustment(t){this.beforeSubmit(),this.httpService.post(this.submitApi,t).subscribe({next:o=>{this.adjustmentID=o.OrderID,this.completeInfo=o,this.error=null,this.onSubmitSuccess()},error:o=>{this.error=o,this.onSubmiterror()}})}onSubmitSuccess(){}beforeSubmit(){}onSubmiterror(){}};var Ql=["stepper"],Cr=i=>({"nb-button-override":i}),Bl=i=>({custom:i}),fr=()=>["/menu/Products/Catalog/Variants/Info"],Fi=i=>({ID:i}),Hl=i=>({"bg-gradient-warning":i}),Wl=i=>({Filter:i}),ql=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function Gl(i,e){if(i&1){let t=x();a(0,"button",9),_("click",function(){p(t);let n=m(2);return u(n.validateFilter())}),s(1," Next "),r()}if(i&2){let t=m(2);c("disabled",!t.roleService.adjustment.Create)}}function zl(i,e){if(i&1){let t=x();a(0,"div",6)(1,"button",10),_("click",function(){p(t);let n=m(2);return u(n.stepper.previous())}),s(2," Back "),r(),a(3,"button",11),_("click",function(){p(t);let n=m(2);return u(n.stepper.next())}),s(4," Next "),r()()}if(i&2){let t=m(2);c("ngClass",V(1,Cr,t.currentSubStatus!=t.subStatusEnum.PAID))}}function $l(i,e){if(i&1){let t=x();a(0,"div",6)(1,"button",12),_("click",function(){p(t);let n=m(2);return u(n.stepper.previous())}),s(2," Back "),r(),a(3,"button",11),_("click",function(){p(t);let n=m(2);return u(n.stepper.next())}),s(4," Confirm Adjustment "),r()()}if(i&2){let t=m(2);c("ngClass",V(1,Cr,t.currentSubStatus!=t.subStatusEnum.PAID))}}function Kl(i,e){i&1&&(f(0,"i",54),s(1,"Filter"))}function Jl(i,e){i&1&&(a(0,"small",55),s(1,"Outlet option is required."),r())}function Zl(i,e){i&1&&(f(0,"i",56),s(1,"Input"))}function Xl(i,e){i&1&&(a(0,"th",43),s(1,"Expected"),r())}function Yl(i,e){i&1&&(a(0,"th",43),s(1,"Changes"),r())}function ts(i,e){if(i&1&&(a(0,"td"),s(1),r()),i&2){let t=m().$implicit;l(),I(" ",t.Quantity," ")}}function es(i,e){if(i&1&&(a(0,"td"),s(1),f(2,"i",63),s(3),v(4,"number"),r()),i&2){let t=m().$implicit;Nt("bg-gradient-danger",t.Counted<t.Quantity)("bg-gradient-success",t.Counted>t.Quantity),l(),I(" ",t.Quantity," "),l(2),de(" ",t.Counted," (",(t.Counted-t.Quantity>0?"+":"")+w(4,7,t.Counted-t.Quantity),") ")}}function ns(i,e){if(i&1){let t=x();a(0,"i",64),_("click",function(){p(t);let n=m().$implicit,d=m(3);return u(d.clear(n))}),r()}}function is(i,e){if(i&1){let t=x();a(0,"tr")(1,"td"),s(2),r(),a(3,"td",57),s(4),r(),a(5,"td",57),s(6),r(),a(7,"td")(8,"a",58),s(9),r()(),a(10,"td"),s(11),r(),g(12,ts,2,1,"td"),a(13,"td")(14,"input",59,2),P("ngModelChange",function(n){let d=p(t).$implicit;return T(d.Counted,n)||(d.Counted=n),u(n)}),_("ngModelChange",function(){let n=p(t).$implicit,d=J(15),y=m(3);return u(y.onReset(n,d))}),r()(),g(16,es,5,9,"td",60),a(17,"td",61),g(18,ns,1,0,"i",62),r()()}if(i&2){let t=e.$implicit,o=e.$index,n=m(3);l(2),S(o+1+"."),l(2),I(" ",t.CategoryName," "),l(2),I(" ",t.ProductName," "),l(2),c("routerLink",Z(14,fr))("queryParams",V(15,Fi,t.ID)),l(),S(t.Model),l(2),S(t.Code),l(),C(n.roleService.inventory.View?12:-1),l(2),Tt(V(17,Hl,t.Counted!==""&&t.Counted!=t.Quantity&&!n.roleService.inventory.View)),c("modifyValueOnWheel",!1),M("ngModel",t.Counted),l(2),C(t.Counted!==""&&n.roleService.inventory.View?16:-1),l(2),C(t.Counted!==""?18:-1)}}function os(i,e){if(i&1){let t=x();a(0,"POS-complex-pagination",65),_("jumpToPage",function(){p(t);let n=m(3);return u(n.getProduct(n.filter))})("previousPage",function(){p(t);let n=m(3);return u(n.getProduct(n.filter))})("nextPage",function(){p(t);let n=m(3);return u(n.getProduct(n.filter))}),r()}if(i&2){let t=m(3);c("total",t.products.length)("pageData",V(2,Wl,t.filter))}}function rs(i,e){i&1&&(f(0,"i",66),s(1,"Review"))}function as(i,e){i&1&&(a(0,"th",43),s(1,"Expected"),r())}function ls(i,e){i&1&&(a(0,"th",43),s(1,"Differences"),r())}function ss(i,e){if(i&1&&(a(0,"td"),s(1),r()),i&2){let t=m(2).$implicit;l(),I(" ",t.Quantity," ")}}function ds(i,e){if(i&1&&(a(0,"span"),s(1),v(2,"number"),r()),i&2){let t=m(3).$implicit;l(),I("+",w(2,1,t.Counted-t.Quantity))}}function ms(i,e){if(i&1&&(a(0,"span"),s(1),v(2,"number"),r()),i&2){let t=m(3).$implicit;l(),S(w(2,1,t.Counted-t.Quantity))}}function cs(i,e){if(i&1&&(a(0,"td"),g(1,ds,3,3,"span"),g(2,ms,3,3,"span"),r()),i&2){let t=m(2).$implicit;l(),C(t.Counted>=t.Quantity?1:-1),l(),C(t.Counted<t.Quantity?2:-1)}}function ps(i,e){if(i&1&&(a(0,"tr")(1,"td"),s(2),r(),a(3,"td",57),s(4),r(),a(5,"td")(6,"a",58),s(7),r()(),a(8,"td"),s(9),r(),g(10,ss,2,1,"td"),a(11,"td"),s(12),r(),g(13,cs,3,2,"td"),r()),i&2){let t=m(),o=t.$implicit,n=t.$index,d=m(3);Nt("soft-yellow",o.Counted<o.Quantity)("soft-green",o.Counted>o.Quantity),l(2),S(n+1+"."),l(2),I(" ",o.ProductName," "),l(2),c("routerLink",Z(13,fr))("queryParams",V(14,Fi,o.ID)),l(),S(o.Model),l(2),S(o.Code),l(),C(d.roleService.inventory.View?10:-1),l(2),I(" ",o.Counted," "),l(),C(d.roleService.inventory.View?13:-1)}}function us(i,e){if(i&1&&g(0,ps,14,16,"tr",67),i&2){let t=e.$implicit;C(t.Counted!==""?0:-1)}}function _s(i,e){i&1&&(f(0,"i",68),s(1,"Finish"))}function gs(i,e){if(i&1&&(a(0,"div",53),f(1,"i",69),s(2),r()),i&2){let t=m(3);l(2),I("",t.error.error.Message," ")}}function Cs(i,e){if(i&1){let t=x();a(0,"mat-stepper",13,0),_("selectionChange",function(n){p(t);let d=m(2);return u(d.onNextStep(n))}),a(2,"mat-step",14),E(3,Kl,2,0,"ng-template",15),a(4,"div",16)(5,"div",17)(6,"div",18)(7,"div",17)(8,"h3",19),s(9,"Outlet"),r()(),a(10,"div",20)(11,"ng-select",21,1),_("change",function(){p(t);let n=m(2);return u(n.toggleIsFilterFilled())}),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.filter.EntityID,n)||(d.filter.EntityID=n),u(n)}),r(),E(13,Jl,2,0,"small",22),r()()(),a(14,"div",23)(15,"div",18)(16,"div",17)(17,"h3",19),s(18," Category "),a(19,"small",24)(20,"em"),s(21,"Optional"),r()()()(),a(22,"div",20)(23,"POS-product-category-select",25),P("selectedCategoryIDChange",function(n){p(t);let d=m(2);return T(d.filter.CategoryID,n)||(d.filter.CategoryID=n),u(n)}),r()()()(),a(24,"div",23)(25,"div",18)(26,"div",17)(27,"h3",19),s(28," Contain Text "),a(29,"small",24)(30,"em"),s(31,"Optional"),r()()()(),a(32,"div",26)(33,"input",27),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.filter.ProductName,n)||(d.filter.ProductName=n),u(n)}),r()()()(),a(34,"div",23)(35,"div",18)(36,"div",17)(37,"div",28)(38,"h3",29),s(39," Tag "),r(),a(40,"small",24)(41,"em"),s(42,"Optional"),r()()()(),a(43,"div",26)(44,"ng-select",30),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.filter.TagID,n)||(d.filter.TagID=n),u(n)}),r()()()(),a(45,"div",23)(46,"div",18)(47,"div",17)(48,"h3",19),s(49,"Storage Location"),r()(),a(50,"div",20)(51,"POS-storage-location-select",31),_("selectedCategoryIDChange",function(n){p(t);let d=m(2);return u(d.onSelectStorageLocation(n))}),r()()()(),a(52,"div",32)(53,"div",18)(54,"div",17)(55,"h3",19),s(56," Note "),a(57,"small",24)(58,"em"),s(59,"Optional"),r()()()(),a(60,"div",20)(61,"textarea",33),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.note,n)||(d.note=n),u(n)}),r()()()()()(),a(62,"mat-step",34),E(63,Zl,2,0,"ng-template",15),a(64,"div",35)(65,"table",36),_("matSortChange",function(n){p(t);let d=m(2);return u(d.sortData(n))}),a(66,"thead",37)(67,"tr")(68,"th",38),s(69,"No"),r(),a(70,"th",39),s(71," Category "),r(),a(72,"th",40),s(73," Product "),r(),a(74,"th",41),s(75," Variant "),r(),a(76,"th",42),s(77,"Code"),r(),g(78,Xl,2,0,"th",43),a(79,"th",43),s(80,"Counted"),r(),g(81,Yl,2,0,"th",43),f(82,"th",38),r()(),a(83,"tbody"),F(84,is,19,19,"tr",null,tt),r()(),g(86,os,1,4,"POS-complex-pagination",44),r()(),a(87,"mat-step",45),E(88,rs,2,0,"ng-template",15),a(89,"div",46)(90,"div",47)(91,"table",48),_("matSortChange",function(n){p(t);let d=m(2);return u(d.sortData(n))}),a(92,"thead",49)(93,"tr"),f(94,"th",38),a(95,"th",50),s(96," Name "),r(),a(97,"th",51),s(98,"Variant"),r(),a(99,"th",43),s(100,"Code"),r(),g(101,as,2,0,"th",43),a(102,"th",43),s(103,"Counted"),r(),g(104,ls,2,0,"th",43),r()(),a(105,"tbody"),F(106,us,1,1,null,null,tt),r()()()()(),a(108,"mat-step",52),E(109,_s,2,0,"ng-template",15),g(110,gs,3,1,"div",53),r()()}if(i&2){let t=J(12),o=m(2);c("linear",!0),l(2),c("completed",o.isFilterFilled),l(9),Tt(V(26,Bl,t.touched&&o.filter.EntityID==null)),c("items",o.loaderData.Entities),M("ngModel",o.filter.EntityID),c("clearable",!1),l(2),c("ngIf",t.touched&&o.filter.EntityID==null),l(10),M("selectedCategoryID",o.filter.CategoryID),c("showClear",!0)("placeholder","Choose Category")("isInitializedCategoryLabel",!0),l(10),M("ngModel",o.filter.ProductName),l(11),c("items",o.loaderData.AdjustmentTagsOptions),M("ngModel",o.filter.TagID),c("clearable",!1),l(7),c("showClear",!0)("placeholder","Choose Storage Location")("isInitializedCategoryLabel",!0),l(10),M("ngModel",o.note),l(17),C(o.roleService.inventory.View?78:-1),l(3),C(o.roleService.inventory.View?81:-1),l(3),U(o.products),l(2),C(o.products.length>0?86:-1),l(15),C(o.roleService.inventory.View?101:-1),l(3),C(o.roleService.inventory.View?104:-1),l(2),U(o.reviewedItems),l(4),C(o.error?110:-1)}}function fs(i,e){i&1&&(a(0,"div",85),s(1,"Difference"),r())}function hs(i,e){if(i&1&&(a(0,"div",89),s(1),r()),i&2){let t=m().$implicit;Tt(t.Quantity-t.OriginalQuantity<0?"text-danger":"text-success"),l(),I(" ",(t.Quantity-t.OriginalQuantity>0?"+":" ")+(t.Quantity-t.OriginalQuantity)," ")}}function ys(i,e){if(i&1&&(a(0,"div",86)(1,"div",88),s(2),r(),a(3,"div",89),s(4),r(),g(5,hs,2,3,"div",90),r()),i&2){let t=e.$implicit,o=m(3);l(2),de("",t.Name," (",t.Model,")"),l(2),S(t.Quantity),l(),C(o.roleService.inventory.View?5:-1)}}function vs(i,e){if(i&1&&(a(0,"div",89),v(1,"sum"),v(2,"sum"),s(3),v(4,"sum"),v(5,"sum"),v(6,"sum"),v(7,"sum"),r()),i&2){let t=m(3);Tt(k(1,3,t.displayedItems,"Quantity")-k(2,6,t.displayedItems,"OriginalQuantity")<0?"text-danger":"text-success"),l(3),I(" ",(k(4,9,t.displayedItems,"Quantity")-k(5,12,t.displayedItems,"OriginalQuantity")>0?"+":" ")+(k(6,15,t.displayedItems,"Quantity")-k(7,18,t.displayedItems,"OriginalQuantity"))," ")}}function xs(i,e){if(i&1){let t=x();a(0,"div",8)(1,"div",70)(2,"div",71)(3,"div",72)(4,"h1",73),f(5,"i",68),s(6,"Inventory Adjustment Completed "),r()(),a(7,"div",74)(8,"div",75)(9,"div",76)(10,"a",77),_("click",function(){p(t);let n=m(2);return u(n.newStockCount())}),s(11,"New Adjustment (F8)"),r()()()()()(),a(12,"div",78)(13,"div",71)(14,"div",79)(15,"h2",80)(16,"a",81),s(17),r()()(),a(18,"div",82)(19,"div",83)(20,"div",84),s(21," Product Name (Variant) "),r(),a(22,"div",85),s(23,"Counted"),r(),g(24,fs,2,0,"div",85),r(),F(25,ys,6,4,"div",86,tt),a(27,"div",87)(28,"div",88),s(29,"Total"),r(),a(30,"div",89),s(31),v(32,"sum"),r(),g(33,vs,8,21,"div",90),r()()()()()}if(i&2){let t=m(2);l(16),c("routerLink",Z(9,ql))("queryParams",V(10,Fi,t.adjustmentID)),l(),I("Adjustment #",t.completeInfo.InvoiceNumber),l(7),C(t.roleService.inventory.View?24:-1),l(),U(t.displayedItems),l(6),I(" ",k(32,6,t.displayedItems,"Quantity")," "),l(2),C(t.roleService.inventory.View?33:-1)}}function Ss(i,e){if(i&1){let t=x();a(0,"mainpanel-cmp",4),P("textChange",function(n){p(t);let d=m();return T(d.filter.ProductName,n)||(d.filter.ProductName=n),u(n)}),_("onSubmit",function(){p(t);let n=m();return u(n.filterProduct())}),a(1,"actions"),g(2,Gl,2,1,"button",5),g(3,zl,5,3,"div",6),g(4,$l,5,3,"div",6),r(),a(5,"content"),g(6,Cs,111,28,"mat-stepper",7),g(7,xs,34,12,"div",8),r()()}if(i&2){let t=m();c("pageData",t.menuData),M("text",t.filter.ProductName),c("hideSearchBox",t.currentStep!="input")("hideSearchDropdown",!0),l(2),C(t.currentStep=="filter"?2:-1),l(),C(t.currentStep=="input"?3:-1),l(),C(t.currentStep=="review"?4:-1),l(2),C(t.isCompleted?-1:6),l(),C(t.isCompleted?7:-1)}}var Zn=class i extends Jn{constructor(t,o,n,d,y){super(t,o);this.toastr=n;this.ngZone=d;this.roleService=y;this.isFilterFilled=!1,this.filter={CategoryID:null,EntityID:null,ProductName:"",SupplierID:A.GuidEmpty,RowCount:500,PageNumber:1,TagID:null,StorageID:A.GuidEmpty},this.oldFilter={CategoryID:"dummy",EntityID:"dummy",ProductName:"dummy",SupplierID:"dummy",RowCount:500,PageNumber:1,TagID:null,StorageID:A.GuidEmpty},this.Items=[],this.initSubscriptionStatus()}stepper;isFilterFilled;currentStep="filter";Items;reviewedItems=[];displayedItems=[];note;isCompleted=!1;filter;oldFilter;currentSubStatus;subStatusEnum=ro;ngOnDestroy(){}initSubscriptionStatus(){this.currentSubStatus=parseInt(localStorage.getItem("SubscriptionStatus"))}onSelectStorageLocation(t){this.filter=R(j({},this.filter),{StorageID:t})}handleF8(){this.currentStep=="finish"&&this.newStockCount()}handleNextButton(){this.stepper&&this.ngZone.run(()=>{this.roleService.adjustment.Create&&(this.isFilterFilled?this.stepper.next():this.validateFilter())})}onReset(t,o){o.value==""&&this.clear(t)}handlePreviousButton(){this.stepper&&this.ngZone.run(()=>{this.stepper.previous()})}toggleIsFilterFilled(){this.isFilterFilled=!0}updateFilterStorage(t){this.filter=R(j({},this.filter),{StorageID:t})}onNextStep(t){if(t.selectedStep.label=="filter")this.currentStep="filter";else if(t.selectedStep.label=="input")this.currentStep="input",(this.oldFilter.CategoryID!=this.filter.CategoryID||this.oldFilter.EntityID!=this.filter.EntityID||this.filter.ProductName!=this.oldFilter.ProductName)&&(this.getProduct(this.filter),this.oldFilter=Object.assign({},this.filter));else if(t.selectedStep.label=="review"){this.products=this.originalProducts,this.currentStep="review";let o=0;this.products.forEach(n=>{n.Counted!==""&&n.Counted!=n.Quantity&&(n.Status=n.Counted>n.Quantity?"Over":"Under",o++)}),this.reviewedItems=this.products.filter(n=>n.Counted!==""),o&&!this.roleService.inventory.View&&this.toastr.warning("There are some items inventory that does not match! Click next to automatically adjust inventory.",et.Warning)}else if(t.selectedStep.label=="finish"){this.products=this.originalProducts,this.currentStep="finish",this.Items=[],this.products.forEach(d=>{if(d.Counted!==""){let y={Name:d.ProductName,Cost:d.UnitCost,Price:d.UnitPrice,Quantity:d.Counted,OriginalQuantity:d.Quantity,VariantID:d.ID,Model:d.Model};this.Items.push(y)}});let o={Date:new Date,EntityID:this.filter.EntityID,Note:this.note,ID:this.adjustmentID||A.GuidEmpty,TagID:this.filter.TagID},n={Items:this.Items,Order:o,TypeID:2};this.displayedItems=this.Items.filter(d=>d.Quantity-d.OriginalQuantity!=0),this.submitAdjustment(n)}}validateFilter(){if(!this.isFilterFilled){this.toastr.error("Outlet is required",et.Error);return}this.stepper.next()}clear(t){t.Counted=""}newStockCount(){window.location.reload()}beforeSubmit(){this.isCompleted=!0}onSubmiterror(){this.isCompleted=!1}sortData(t){let o=this.products.slice();if(!t.active||t.direction===""){this.products=this.originalProducts;return}this.products=o.sort((n,d)=>{let y=t.direction==="asc",D=typeof n[t.active];switch(A.IsEmpty(n.Code)&&(n.Code=""),A.IsEmpty(d.Code)&&(d.Code=""),D){case"string":return A.compare(n[t.active].toLocaleLowerCase(),d[t.active].toLocaleLowerCase(),y);case"number":return A.compare(n[t.active],d[t.active],y);default:return 0}})}filterProduct(){this.filter.PageNumber=1,this.getProduct(this.filter)}static \u0275fac=function(o){return new(o||i)(b(rt),b(L),b(vt),b(bn),b(H))};static \u0275cmp=O({type:i,selectors:[["POS-spreadsheet-stock-take"]],viewQuery:function(o,n){if(o&1&&Ce(Ql,5),o&2){let d;fe(d=he())&&(n.stepper=d.first)}},hostBindings:function(o,n){o&1&&_("keydown.F8",function(){return n.handleF8()},Ht)("keydown.ArrowRight",function(){return n.handleNextButton()},Ht)("keydown.ArrowLeft",function(){return n.handlePreviousButton()},Ht)},standalone:!1,features:[mt],decls:1,vars:1,consts:[["stepper",""],["outletFilter","ngModel"],["input",""],[3,"pageData","text","hideSearchBox","hideSearchDropdown"],[3,"textChange","onSubmit","pageData","text","hideSearchBox","hideSearchDropdown"],["matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success","ms-auto","me-0","d-block",3,"disabled"],[1,"mt-5","nb-button",3,"ngClass"],[3,"linear"],[1,"container-fluid","row","mt-5"],["matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success","ms-auto","me-0","d-block",3,"click","disabled"],["matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-2",3,"click"],["matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success",3,"click"],["matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-5",3,"click"],[3,"selectionChange","linear"],["label","filter",3,"completed"],["matStepLabel",""],[1,"row","px-5","w-50","mx-auto"],[1,"col-12"],[1,"row"],[1,"fw-normal","text-dark","m-0"],[1,"col-12","mt-3"],["dropdownPosition","bottom","placeholder","Choose an outlet","bindLabel","Name","bindValue","ID",3,"change","ngModelChange","items","ngModel","clearable"],["style","color: red",4,"ngIf"],[1,"col-12",2,"margin-top","25px"],[1,"text-body-secondary","h6"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear","placeholder","isInitializedCategoryLabel"],[1,"col-12","mt-3","mb-0"],["type","text","name","text","placeholder","Type the product name you want to adjust",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","gap-4","align-items-baseline","w-100"],[1,"fw-normal","text-dark","m-0","d-inline-block"],["bindLabel","Name","bindValue","ID","placeholder","Choose an adjustment tag",3,"ngModelChange","items","ngModel","clearable"],["endPoint","api/catalog/product/GetProductStorageOptions",1,"tree-select-as-filter",3,"selectedCategoryIDChange","showClear","placeholder","isInitializedCategoryLabel"],[1,"col-12",2,"margin-top","25px","padding-bottom","25px"],["rows","6","type","text","name","note",1,"form-control",3,"ngModelChange","ngModel"],["label","input"],[1,"container-fluid",2,"height","calc(100vh - 180px)","overflow","auto","padding","0 24px","padding-bottom","20px"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","30px"],["mat-sort-header","CategoryName",2,"width","175px"],["mat-sort-header","ProductName",2,"width","200px"],["mat-sort-header","Model",2,"width","100px"],["mat-sort-header","Code",2,"width","75px"],[2,"width","75px"],["api","Adjustment/GetSpreadsheetCount",3,"total","pageData"],["label","review"],[1,"container-fluid",2,"padding","0 24px"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom","w-100",2,"table-layout","fixed",3,"matSortChange"],[1,"thead-light"],["mat-sort-header","ProductName",2,"width","175px"],[2,"width","150px"],["label","finish"],[1,"alert"],[1,"fa-solid","fa-filter","me-3"],[2,"color","red"],[1,"fa-solid","fa-calculator","me-3"],[2,"word-break","break-word"],["target","_blank",2,"color","#0976b4 !important",3,"routerLink","queryParams"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","modifyValueOnWheel","ngModel"],[3,"bg-gradient-danger","bg-gradient-success"],[1,"text-center"],["matTooltipPosition","above","matTooltip","reset counter",1,"fa-solid","fa-delete-left","fa-2x","clear","align-middle"],[1,"fa-solid","fa-right-long"],["matTooltipPosition","above","matTooltip","reset counter",1,"fa-solid","fa-delete-left","fa-2x","clear","align-middle",3,"click"],["api","Adjustment/GetSpreadsheetCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"fa-solid","fa-user-check","me-3"],[3,"soft-yellow","soft-green"],[1,"fa-solid","fa-check","me-3"],[1,"fa-solid","fa-circle-exclamation","me-3"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px","border-bottom","1px solid rgba(0, 0, 0, 0.125)","background-color","rgba(203, 203, 210, 0.15) !important"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body"],[1,"row","justify-content-between"],[1,"col-6",2,"font-size","14px"],[1,"col-3",2,"font-size","14px"],[1,"row","justify-content-between","my-5"],[1,"row","justify-content-between","fw-bold"],[1,"col-6"],[1,"col-3"],[1,"col-3",3,"class"]],template:function(o,n){o&1&&g(0,Ss,8,9,"mainpanel-cmp",3),o&2&&C(n.loaderData?0:-1)},dependencies:[kn,Ft,ve,ct,at,xt,B,X,pt,Kt,Fn,Nn,Un,Lt,Ie,Qe,Be,$t,q,We],styles:['@import"https://fonts.googleapis.com/icon?family=Material+Icons";ng-select.custom[_ngcontent-%COMP%] .ng-select-container{border:1px solid red!important}.soft-green[_ngcontent-%COMP%]{background-color:#acd1af}.sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{top:0!important}.soft-yellow[_ngcontent-%COMP%]{background-color:#eeee9b}.alert[_ngcontent-%COMP%]{color:#691917;background-color:#f4d6d5;border-color:#f0c5c4}input[_ngcontent-%COMP%]::-webkit-outer-spin-button, input[_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.nb-button[_ngcontent-%COMP%]{position:absolute;right:10px;top:-2px;z-index:9999}.nb-button-override[_ngcontent-%COMP%]{top:40px!important} .mat-horizontal-content-container{padding:0!important} .main-panel-content{padding-bottom:0!important}']})};var bs=()=>["/menu/Products/Catalog/Products/Info"],Is=i=>({ID:i});function Ds(i,e){if(i&1){let t=x();a(0,"button",13),_("click",function(){p(t);let n=m(2);return u(n.confirmAdjust())}),s(1,"Confirm Adjustment"),r()}}function Ts(i,e){if(i&1){let t=x();a(0,"div")(1,"div",14)(2,"h6"),s(3,"Outlets"),r(),a(4,"ng-select",15),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.EntityID,n)||(d.pageData.Filter.EntityID=n),u(n)}),r()()()}if(i&2){let t=m(2);l(4),c("items",t.pageData.Entities),M("ngModel",t.pageData.Filter.EntityID)}}function Ps(i,e){if(i&1){let t=x();a(0,"tr",12)(1,"td"),f(2,"a",16),r(),f(3,"td",17)(4,"td",17)(5,"td",17)(6,"td",18)(7,"td",18),a(8,"td",19)(9,"input",20),P("ngModelChange",function(n){let d=p(t).$implicit;return T(d.NewQuantity,n)||(d.NewQuantity=n),u(n)}),r()(),a(10,"td",19),s(11),v(12,"number"),r(),a(13,"td")(14,"a",21),_("click",function(){let n=p(t).$implicit,d=m(2);return u(d.confirmAdjust(n))}),s(15,"Adjust"),r()()()}if(i&2){let t=e.$implicit;l(2),c("routerLink",Z(12,bs))("queryParams",V(13,Is,t.ProductID))("innerHTML",t.ProductName,$),l(),c("innerHTML",t.ParentCode,$),l(),c("innerHTML",t.Model,$),l(),c("innerHTML",t.ParentModel,$),l(),c("innerHTML",t.Ratio,$),l(),c("innerHTML",t.Inventory,$),l(2),M("ngModel",t.NewQuantity),l(2),I(" ",w(12,10,t.Inventory-t.NewQuantity*t.Ratio)," ")}}function ws(i,e){if(i&1){let t=x();a(0,"mainpanel-cmp",2),_("onSubmit",function(){p(t);let n=m();return u(n.searchFromPageOne())}),P("filterChange",function(n){p(t);let d=m();return T(d.pageData.Filter,n)||(d.pageData.Filter=n),u(n)}),a(1,"actions"),g(2,Ds,2,0,"button",3),r(),a(3,"filters"),E(4,Ts,5,2,"ng-template",null,0,K),r(),a(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th"),s(13,"Product Name"),r(),a(14,"th",8),s(15,"Code"),r(),a(16,"th",8),s(17,"From"),r(),a(18,"th",8),s(19,"To"),r(),a(20,"th",9),s(21,"Ratio"),r(),a(22,"th",9),s(23,"Inventory"),r(),a(24,"th",10),s(25,"Convert Qty "),r(),a(26,"th",10),s(27,"Remaining"),r(),f(28,"th",11),r()(),a(29,"tbody"),F(30,Ps,16,15,"tr",12,tt),r()()()()()()}if(i&2){let t=m();c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),M("filter",t.pageData.Filter),l(2),C(t.roleService.adjustment.Create?2:-1),l(28),U(t.Items)}}var Xn=class i extends St{constructor(t,o,n,d,y){super(t,o,"Adjustment/GetAdjustToParentList","Outlet/GetByUserAccessWrite");this.toastr=n;this.router=d;this.roleService=y}Items;preGetList(){A.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=this.pageData.Entities[0].ID)}postInit(t){this.Items=t,this.Items.forEach(o=>o.NewQuantity=Math.floor(o.Inventory/o.Ratio))}confirmAdjust(t){let o=[],n=[];if(t?n.push(t):n=this.Items,n.forEach(y=>{let D={VariantID:y.ParentID,Quantity:y.NewQuantity,Cost:y.UnitCost*y.Ratio,Price:y.UnitPrice*y.Ratio};o.push(D),D={VariantID:y.ID,Quantity:y.NewQuantity*y.Ratio*-1,Cost:y.UnitCost,Price:y.UnitPrice},o.push(D)}),o.length<1)return alert("You must atleast have one item to adjust!"),!1;if(A.IsEmpty(this.pageData.Filter.EntityID))return alert("Outlet is require"),!1;let d={Order:{EntityID:this.pageData.Filter.EntityID},Items:o};this.httpService.post("/API/Adjustment/SubmitUseDefault",d).subscribe({next:y=>{y.Success?this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Info"],{queryParams:{ID:y.OrderID}}).then(()=>window.location.reload()):this.toastr.success(y.Message,et.Success)},error:y=>{this.toastr.error(y,et.Error)}})}static \u0275fac=function(o){return new(o||i)(b(rt),b(L),b(vt),b(Ut),b(H))};static \u0275cmp=O({type:i,selectors:[["POS-convert-inventory"]],standalone:!1,features:[mt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-success"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","125px"],[1,"text-end",2,"width","125px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],[1,"border-bottom"],[1,"btn","btn-success",3,"click"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","appendTo","body",3,"ngModelChange","items","ngModel"],[3,"routerLink","queryParams","innerHTML"],[3,"innerHTML"],[1,"text-end",3,"innerHTML"],[1,"text-end"],["type","text","autoNum","",1,"text-end",3,"ngModelChange","ngModel"],[3,"click"]],template:function(o,n){o&1&&g(0,ws,32,5,"mainpanel-cmp",1),o&2&&C(n.data?0:-1)},dependencies:[ct,at,xt,B,X,pt,Lt,q],encapsulation:2})};function Ms(i,e){if(i&1){let t=x();a(0,"button",12),_("click",function(){p(t);let n=m();return u(n.openExportModal())}),f(1,"i",13),s(2," Export "),r()}}function Es(i,e){if(i&1){let t=x();a(0,"td",10)(1,"input",16),P("ngModelChange",function(n){p(t);let d=m().$implicit;return T(d.Quantity,n)||(d.Quantity=n),u(n)}),r()()}if(i&2){let t=m().$implicit;l(),M("ngModel",t.Quantity)}}function Os(i,e){if(i&1&&(a(0,"td",10),s(1),r()),i&2){let t=m().$implicit;l(),I(" ",t==null?null:t.Quantity," ")}}function As(i,e){if(i&1){let t=x();a(0,"tr",14)(1,"td")(2,"i",15),_("click",function(){let n=p(t).$index,d=m(2);return u(d.products.splice(n,1))}),r()(),a(3,"td"),s(4),r(),a(5,"td",10),s(6),r(),g(7,Es,2,1,"td",10),g(8,Os,2,1,"td",10),r()}if(i&2){let t=e.$implicit,o=m(2);l(4),S(t==null?null:t.Name),l(2),S(t==null?null:t.Code),l(),C(o.roleService.adjustment.InventoryProductCount?7:-1),l(),C(o.roleService.adjustment.InventoryProductCount?-1:8)}}function js(i,e){if(i&1&&F(0,As,9,4,"tr",14,se),i&2){let t=m();U(t.products)}}function ks(i,e){i&1&&(a(0,"tr")(1,"td",17),f(2,"app-empty-state"),r()())}var Yn=class i extends Mn{constructor(t,o,n,d,y){super(t);this.httpService=o;this.csvConverter=n;this.roleService=d;this.matDialog=y;this.products=[],this.menuData$.subscribe()}products;onBarcodeEnter(t){let o=this.products.findIndex(n=>n.Code===t);o!=-1?this.products[o].Quantity++:this.httpService.post("/API/catalog/product/ProductCountByCode",{code:t}).subscribe(n=>{n.Quantity=1,this.products.push(n)})}openExportModal(){var t={Products:this.products,Export:!0};this.matDialog.open(Rt,{data:{title:"Count Product Inventory",exportTypes:[{ID:"ProductExport/ProductCountInventory",Value:"Default",FileName:"Count Product Inventory"}],filterExport:t,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(b(rt),b(L),b(kt),b(H),b(nt))};static \u0275cmp=O({type:i,selectors:[["POS-count-product-inventory"]],standalone:!1,features:[mt],decls:23,vars:7,consts:[[3,"barcodeQueryChange","pageData","hideSearchDropdown","hideSearchBox","showBarcodeScanner","autoFocusBarcodeScanInput"],[1,"btn","btn-outline-secondary","me-3"],[1,"container-fluid","mt-5"],[1,"cashier"],[1,"cart","big-cart","scan-cart"],[1,"content"],[1,"table"],["id","tableGrid",1,"cart","table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],["width","15px"],[1,"text-end"],[1,"text-end",2,"width","150px"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"border-bottom"],[1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],["type","text","autoNum","",1,"text-end","form-control",3,"ngModelChange","ngModel"],["colspan","4"]],template:function(o,n){o&1&&(a(0,"mainpanel-cmp",0),_("barcodeQueryChange",function(y){return n.onBarcodeEnter(y)}),a(1,"actions"),g(2,Ms,3,0,"button",1),r(),a(3,"content")(4,"div",2)(5,"section",3)(6,"main")(7,"section",4)(8,"div",5)(9,"div",6)(10,"table",7)(11,"thead",8)(12,"tr"),f(13,"th",9),a(14,"th"),s(15,"Name"),r(),a(16,"th",10),s(17,"Code"),r(),a(18,"th",11),s(19,"Qty"),r()()(),a(20,"tbody"),g(21,js,2,0)(22,ks,3,0,"tr"),r()()()()()()()()()()),o&2&&(c("pageData",n.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0)("showBarcodeScanner",!0)("autoFocusBarcodeScanInput",!0),l(2),C(n.roleService.global.Export?2:-1),l(19),C(n.products.length>0?21:22))},dependencies:[at,xt,B,X,Lt,Vn],styles:[".barcode_counter[_ngcontent-%COMP%]{position:fixed;right:10px;bottom:20px;background:#fff;border:1px solid #ddd;padding:8px 10px;border-radius:3px}.barcode_counter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border-radius:3px;border:1px solid #b7b7b7;background-repeat:no-repeat;background-position:5px -211px;padding:4px 5px 4px 35px}.barcode_counter[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{position:relative;left:35px;vertical-align:middle}.barcode_counter[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:5px;color:#868686;left:30px;position:relative;margin-left:-25px}"]})};function Vs(i,e){if(i&1){let t=x();a(0,"button",14),_("click",function(){p(t);let n=m(2);return u(n.openExportModal())}),f(1,"i",15),s(2," Export"),r()}}function Ns(i,e){if(i&1){let t=x();a(0,"div")(1,"div",16)(2,"h6"),s(3,"Outlets"),r(),a(4,"ng-select",17),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.EntityID,n)||(d.pageData.Filter.EntityID=n),u(n)}),r(),a(5,"h6"),s(6,"Category"),r(),a(7,"POS-product-category-select",18),P("selectedCategoryIDChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.CategoryID,n)||(d.pageData.Filter.CategoryID=n),u(n)}),r(),a(8,"h6"),s(9,"Sort By"),r(),a(10,"ng-select",19),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.SortByid,n)||(d.pageData.Filter.SortByid=n),u(n)}),r()()()}if(i&2){let t=m(2);l(4),c("items",t.pageData.Options.Entities),M("ngModel",t.pageData.Filter.EntityID),l(3),M("selectedCategoryID",t.pageData.Filter.CategoryID),c("showClear",!0),l(3),c("items",t.pageData.Options.SortBy),M("ngModel",t.pageData.Filter.SortByid)}}function Fs(i,e){if(i&1&&(a(0,"span"),s(1),r()),i&2){let t=e.$implicit;l(),S(t+" ")}}function Us(i,e){if(i&1&&(a(0,"tr")(1,"td"),s(2),r(),a(3,"td"),s(4),r(),a(5,"td",13),s(6),v(7,"number"),r(),a(8,"td",13),s(9),v(10,"number"),r(),a(11,"td",20),F(12,Fs,2,1,"span",null,tt),r()()),i&2){let t=e.$implicit;l(2),S(t.ProductCode),l(2),S(t.ProductName),l(2),S(w(7,4,t.UnitPrice)),l(3),S(w(10,6,t.Qty)),l(3),U(t.Models)}}function Ls(i,e){if(i&1){let t=x();a(0,"mainpanel-cmp",2),_("onSubmit",function(){p(t);let n=m();return u(n.searchFromPageOne())}),P("filterChange",function(n){p(t);let d=m();return T(d.pageData.Filter,n)||(d.pageData.Filter=n),u(n)}),a(1,"actions"),g(2,Vs,3,0,"button",3),r(),a(3,"filters"),E(4,Ns,11,6,"ng-template",null,0,K),r(),a(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),s(12,"Code"),r(),a(13,"th",8),s(14,"Name"),r(),a(15,"th",9),s(16,"UnitPrice"),r(),a(17,"th",10),s(18,"Qty"),r(),a(19,"th"),s(20,"Available Models"),r()()(),a(21,"tbody"),F(22,Us,14,8,"tr",null,tt),r(),a(24,"tfoot")(25,"tr",11),f(26,"td",12),a(27,"td",13),s(28),v(29,"sum"),v(30,"number"),r(),f(31,"td"),r()()()()()()}if(i&2){let t=m();c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),M("filter",t.pageData.Filter),l(2),C(t.roleService.global.Export?2:-1),l(20),U(t.data.Data),l(6),S(w(30,9,k(29,6,t.data.Data,"Qty")))}}var ti=class i extends St{constructor(t,o,n,d,y){super(t,o,"catalog/product/GetOutletProductSheet","catalog/ProductLoader/GetOutletProductSheet");this.csvConverter=n;this.roleService=d;this.matDialog=y}openExportModal(){this.matDialog.open(Rt,{data:{title:"Product Sheet",exportTypes:[{ID:"ProductExport/GetOutletProductSheet",Value:"Default",FileName:"Product Sheet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(b(rt),b(L),b(kt),b(H),b(nt))};static \u0275cmp=O({type:i,selectors:[["POS-product-sheet"]],standalone:!1,features:[mt],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,"container-fluid","mt-5"],["id","tableGrid",1,"table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","70px"],[2,"width","260px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","100px"],[1,"table-footer"],["colspan","3"],[1,"text-end"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","placeholder","Choose an outlet","bindLabel","Name","bindValue","ID",3,"ngModelChange","items","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[2,"word-spacing","20px"]],template:function(o,n){o&1&&g(0,Ls,32,11,"mainpanel-cmp",1),o&2&&C(n.data?0:-1)},dependencies:[at,B,X,pt,$t,q,We],encapsulation:2})};var hr=wi(jo());var G=class i{INITIAL_STATE={loadForm:{},outlet:{ID:A.GuidEmpty,Name:""},isOpenDialog:!0,isComplete:!1,adjustmentState:0,quickeyItems:{},cartItems:[],order:{Date:(0,hr.default)().utcOffset("+07:00").format(),EntityID:"",ID:A.GuidEmpty,StateID:4,TypeID:1,Number:"",PIC:"",Note:"",TagID:0},orderComplete:{},NewOrderID:""};#t=Yo(this.INITIAL_STATE);AppConfigJSON=this.#t.select(e=>e.loadForm().AppConfigJSON);LoadForm=this.#t.select(e=>e.loadForm());IsOpenDialog=this.#t.select(e=>e.isOpenDialog());Outlets=this.#t.select(e=>e.loadForm().Entities);Outlet=this.#t.select(e=>e.outlet());IsComplete=this.#t.select(e=>e.isComplete());QuickeyItems=this.#t.select(e=>e.quickeyItems());AdjustmentTypes=this.#t.select(e=>Array.isArray(e.loadForm().AdjustmentTypes)?e.loadForm().AdjustmentTypes.map(t=>R(j({},t),{Value:t.Value.replaceAll("Adjust Differences","Adjust").replaceAll("Update Inventory","Count")})):e.loadForm().AdjustmentTypes);CartItems=this.#t.select(e=>e.cartItems());QtyCartItems=this.#t.select(e=>e.cartItems().reduce((t,o)=>t+o.Quantity,0));Order=this.#t.select(e=>e.order());OrderComplete=this.#t.select(e=>e.orderComplete());AdjustmentState=this.#t.select(e=>e.adjustmentState());SubTotal=this.#t.select(e=>e.cartItems().reduce((t,o)=>t+o.Price*o.Quantity,0));NewOrderID=this.#t.select(e=>e.NewOrderID());constructor(){switch(this.AdjustmentState()){case 0:this.onChangeIsOpenDialog(!0);break;case 1:this.onChangeIsOpenDialog(!1);break;case 2:this.onChangeIsOpenDialog(!1);break}}onChangeLoadform(e){this.#t.update("loadForm",e)}onChangeIsOpenDialog(e){this.#t.update("isOpenDialog",e)}onChangeOutlet(e){this.#t.update("outlet",e)}onChangeAdjustmentState(e){this.#t.update("adjustmentState",e)}onChangeQuickeyItems(e){this.#t.update("quickeyItems",e)}onChangeCartItems(e){this.#t.update("cartItems",e)}onChangeIsComplete(){this.#t.update("isComplete",!this.IsComplete())}onChangeAdjustmentOrder(e){this.#t.update("order",e)}onChangeOrderComplete(e){this.#t.update("orderComplete",e)}onChangeNewOrderID(e){this.#t.update("NewOrderID",e)}onResetState(){this.#t.reset()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ui=class{ID;VariantID;Quantity;Cost;Price;Expense;Discount;DiscountAmount;Note;Taxable;LoyaltyPoint;EntityID;UnitQuantity;VariantUnitQuantity;InventoryTypeID;Variant;SalesID;UnitCost;UnitPrice;SplitQuantity;isMaxInventory;PromotionGift;constructor(e,t,o,n,d,y,D,lt,ot,st,It,Vt,Xt,Yt,te,ee,ne,ie,oe,re,ae,le){this.ID=e,this.VariantID=t,this.Quantity=o,this.Cost=n,this.Price=d,this.Expense=y,this.Discount=D,this.DiscountAmount=lt,this.Note=ot,this.Taxable=st,this.LoyaltyPoint=It,this.EntityID=Vt,this.UnitQuantity=Xt,this.VariantUnitQuantity=Yt,this.InventoryTypeID=te,this.Variant=ee,this.SalesID=ne,this.UnitCost=ie,this.UnitPrice=oe,this.SplitQuantity=re,this.isMaxInventory=ae,this.PromotionGift=le}},ei=class i{adapt(e){return new Ui(e.ID??null,e.VariantID??null,e.Quantity??null,e.Cost??null,e.Price??null,e.Expense??null,e.Discount??null,e.DiscountAmount??null,e.Note??null,e.Taxable??null,e.LoyaltyPoint??null,e.EntityID??null,e.UnitQuantity??null,e.VariantUnitQuantity??null,e.InventoryTypeID??null,e.Variant??null,e.SalesID??null,e.UnitCost??null,e.UnitPrice??null,e.SplitQuantity??null,e.isMaxInventory??null,e.PromotionGift??null)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},Li=class{constructor(e,t,o,n,d,y,D,lt,ot,st,It,Vt,Xt,Yt,te,ee,ne,ie,oe,re,ae,le,nn,on,rn,an,ln,sn,dn,mn,cn){this.ID=e,this.Name=t,this.Code=o,this.UnitCost=n,this.UnitPrice=d,this.UnitExpense=y,this.UnitQuantity=D,this.PriceDiscount=lt,this.UnitPriceOriginal=ot,this.Description=st,this.UOM=It,this.UOMName=Vt,this.ImageUrl=Xt,this.TypeID=Yt,this.SellPriceType=te,this.OnHand=ee,this.Ordered=ne,this.OrderPrice=ie,this.OrderPriceDiscount=oe,this.Taxable=re,this.LoyaltyPoint=ae,this.CategoryName=le,this.CategoryID=nn,this.CategoryTypeID=on,this.PriceNote=rn,this.PaymentTypeID=an,this.ThumbnailUrl=ln,this.Storage=sn,this.Component=dn,this.PriceBook=mn,this.VariantUnitQuantity=cn}ID;Name;Code;UnitCost;UnitPrice;UnitExpense;UnitQuantity;PriceDiscount;UnitPriceOriginal;Description;UOM;UOMName;ImageUrl;TypeID;SellPriceType;OnHand;Ordered;OrderPrice;OrderPriceDiscount;Taxable;LoyaltyPoint;CategoryName;CategoryID;CategoryTypeID;PriceNote;PaymentTypeID;ThumbnailUrl;Storage;Component;PriceBook;VariantUnitQuantity},ni=class i{adapt(e){return new Li(e.ID??null,e.Name??null,e.Code??null,e.UnitCost??null,e.UnitPrice??null,e.UnitExpense??null,e.UnitQuantity??null,e.PriceDiscount??null,e.UnitPriceOriginal??null,e.Description??null,e.UOM??null,e.UOMName??null,e.ImageUrl??null,e.TypeID??null,e.SellPriceType??null,e.OnHand??null,e.Ordered??null,e.OrderPrice??null,e.OrderPriceDiscount??null,e.Taxable??null,e.LoyaltyPoint??null,e.CategoryName??null,e.CategoryID??null,e.CategoryTypeID??null,e.PriceNote??null,e.PaymentTypeID??null,e.ThumbnailUrl??null,e.Storage??null,e.Component??null,e.PriceBook??null,e.VariantUnitQuantity??null)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var ii=class i{adapt(e){return{ID:e.ID,VariantID:e.VariantID,Quantity:e.Quantity,Cost:e.Cost,Price:e.Price,Expense:e.Expense,Discount:e.Discount,DiscountAmount:e.DiscountAmount,Note:e.Note,Taxable:e.Taxable,Serial:e.Serial,LoyaltyPoint:e.LoyaltyPoint,EntityID:e.EntityID,UnitQuantity:e.UnitQuantity,VariantUnitQuantity:e.VariantUnitQuantity,InventoryTypeID:e.InventoryTypeID,Variant:e.Variant,SalesID:e.SalesID,UnitCost:e.UnitCost,UnitPrice:e.UnitPrice,SplitQuantity:e.SplitQuantity,isMaxInventory:e.IsMaxInventory,PromotionGift:e.PromotionGift}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},oi=class i{adapt(e){return{ID:e.ID,Name:e.Name,Code:e.Code,UnitCost:e.UnitCost,UnitPrice:e.UnitPrice,UnitExpense:e.UnitExpense,UnitQuantity:e.UnitQuantity,PriceDiscount:e.PriceDiscount,UnitPriceOriginal:e.UnitPriceOriginal,Description:e.Description,UOM:e.UOM,UOMName:e.UOMName,ImageUrl:e.ImageUrl,TypeID:e.TypeID,SellPriceType:e.SellPriceType,OnHand:e.OnHand,Ordered:e.Ordered,OrderPrice:e.OrderPrice,OrderPriceDiscount:e.OrderPriceDiscount,Taxable:e.OrderPriceDiscount,LoyaltyPoint:e.LoyaltyPoint,CategoryName:e.CategoryName,CategoryID:e.CategoryID,CategoryTypeID:e.CategoryTypeID,PriceNote:e.PriceNote,PaymentTypeID:e.PaymentTypeID,ThumbnailUrl:e.ThumbnailUrl,Storage:e.Storage,Component:e.Component,PriceBook:e.PriceBook,VariantUnitQuantity:e.VariantUnitQuantity}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},yr=class i{adapt(e){return{Number:e.Number,Quantity:e.Quantity,ExpiryDate:e.ExpiryDate}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Qt=class i{destroy$=new ft;#t=h(G);#e=h(L);#n=h(ei);#i=h(ni);#o=h(ht);#r=h(ii);#a=h(oi);constructor(){}processOrder(){let e=[...this.#t.CartItems()].map(t=>R(j({},this.#r.adapt(t)),{EntityID:A.GuidEmpty,Note:t.Note??"",SalesID:t.SalesID??"",isMaxInventory:!1,PromotionGift:!1,SplitQuantity:0,UnitCost:t.Cost,Cost:t.Cost,Variant:R(j({},this.#a.adapt(t.Variant)),{Taxable:!!t.Variant.Taxable})}));if(this.#t.AdjustmentState()===0){let t={Items:[...e],Order:{Date:this.#t.Order().Date,EntityID:this.#t.Outlet().ID,ID:A.GuidEmpty,Number:this.#t.Order().Number,StateID:this.#t.Order().StateID,TypeID:this.#t.Order().TypeID,Note:this.#t.Order().Note,PIC:this.#t.Order().PIC,TagID:this.#t.Order().TagID},NewOrderID:this.#t.NewOrderID()};return this.#e.post(wt.SubmitAdjustment,t).pipe(Dt(this.destroy$))}if(this.#t.AdjustmentState()===1){let t=R(j({},this.#t.LoadForm().Data),{Order:R(j({},this.#t.LoadForm().Data.Order),{Note:this.#t.Order().Note,PIC:this.#t.Order().PIC,TagID:this.#t.Order().TagID,Number:this.#t.Order().Number||this.#t.LoadForm().Data.Order.Number,StateID:this.#t.Order().StateID,Date:this.#t.Order().Date||this.#t.LoadForm().Data.Order.Date}),Items:[...e]});return this.#e.post(wt.SubmitAdjustment,t).pipe(Dt(this.destroy$))}}onUpdateOrderState(e,t){if(Object.keys(this.#t.Order()).includes(e)){let n=R(j({},this.#t.Order()),{[e]:t});this.#t.onChangeAdjustmentOrder(n)}else console.error(`Error updating order state with key ${e}`)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var tn=class i{destroy$=new ft;#t=h(L);#e=h(G);#n=h(ht);orderService=h(Qt);getLoadForm$=this.#t.post("/API/Adjustment/LoadForm",{EntityID:A.GuidEmpty,ID:A.GuidEmpty}).pipe(Le(),Q(e=>{this.#e.onChangeLoadform(e)}));constructor(){}httpRequestLoadForm$(e){return Pt(this.#e.IsComplete,{injector:this.#n}).pipe(Dt(this.destroy$),dt(t=>!t),it(t=>this.#t.post("/API/Adjustment/LoadForm",j({EntityID:"00000000-0000-0000-0000-000000000000",ID:"00000000-0000-0000-0000-000000000000"},e))),Q(t=>{this.#e.onChangeLoadform(t),this.orderService.onUpdateOrderState("TypeID",t.AppConfigJSON.ModuleAdjustment.Advance.AdjustmentInputType)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var ri=class i{destroy$=new ft;#t=h(G);#e=h(L);#n=h(Qt);#i=h(ht);constructor(){this.initialize()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initialize(){$i([Pt(this.#t.Outlet,{injector:this.#i}),Pt(this.#t.AdjustmentState,{injector:this.#i}),Pt(this.#t.IsComplete,{injector:this.#i})]).pipe(Le(),dt(([e,t,o])=>A.IsNotEmpty(e.ID)&&!o),it(([e,t])=>this.handleStateChange(e,t))).subscribe()}handleStateChange(e,t){switch(t){case 0:return this.handleStateZero(e);case 1:return this.handleStateOne(e);default:return hn}}handleStateZero(e){return this.#e.get(`/api/AdjustmentLoader/LoadRegister?EntityID=${e.ID}&IsEdit=false`).pipe(Dt(this.destroy$),Q(t=>{this.#t.onChangeQuickeyItems(t.QuickKey),this.#n.onUpdateOrderState("Number",t.Number),this.#t.onChangeNewOrderID(t.NewOrderID)}))}handleStateOne(e){return this.getQuickey(e.ID).pipe(Dt(this.destroy$),Q(t=>{this.#t.onChangeQuickeyItems(t)}))}getQuickey(e){return this.#e.get(wt.GetQuickKeyByEntityID,[{key:"ID",value:e}])}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ri=class{get Variant(){return this._Variant}set Variant(e){this._Variant=e}get QtyRequested(){return this._QtyRequested}set QtyRequested(e){this._QtyRequested=e}get TotalPrice(){return this._TotalPrice}set TotalPrice(e){this._TotalPrice=e}get SalesName(){return this._SalesName}set SalesName(e){this._SalesName=e}get PriceNote(){return this._PriceNote}set PriceNote(e){this._PriceNote=e}get SalesID(){return this._SalesID}set SalesID(e){this._SalesID=e}get InventoryTypeID(){return this._InventoryTypeID}set InventoryTypeID(e){this._InventoryTypeID=e}get ID(){return this._ID}set ID(e){this._ID=e}get Code(){return this._Code}set Code(e){this._Code=e}get VariantID(){return this._VariantID}set VariantID(e){this._VariantID=e}get Quantity(){return this._Quantity}set Quantity(e){this._Quantity=e}get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(e){this._UnitQuantity=e}get Expense(){return this._Expense}set Expense(e){this._Expense=e}get Cost(){return this._Cost}set Cost(e){this._Cost=e}get Price(){return this._Price}set Price(e){this._Price=e}get Discount(){return this._Discount}set Discount(e){this._Discount=e}get Note(){return this._Note}set Note(e){this._Note=e}get Taxable(){return this._Taxable}set Taxable(e){this._Taxable=e}get LoyaltyPoint(){return this._LoyaltyPoint}set LoyaltyPoint(e){this._LoyaltyPoint=e}get UnitPriceOriginal(){return this._UnitPriceOriginal}set UnitPriceOriginal(e){this._UnitPriceOriginal=e}get DiscountAmount(){return this._DiscountAmount}set DiscountAmount(e){this._DiscountAmount=e}get Name(){return this._Name}set Name(e){this._Name=e}get PriceTypeID(){return this._PriceTypeID}set PriceTypeID(e){this._PriceTypeID=e}get Storage(){return this._Storage}set Storage(e){this._Storage=e}get Serial(){return this._Serial}set Serial(e){this._Serial=e}get ThumbnailUrl(){return this._ThumbnailUrl}set ThumbnailUrl(e){this._ThumbnailUrl=e}get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}get TypeID(){return this._TypeID}set TypeID(e){this._TypeID=e}get VariantUnitQuantity(){return this._VariantUnitQuantity}set VariantUnitQuantity(e){this._VariantUnitQuantity=e}get UOM(){return this._UOM}set UOM(e){this._UOM=e}get UOMName(){return this._UOMName}set UOMName(e){this._UOMName=e}get SalesCommission(){return this._SalesCommission}set SalesCommission(e){this._SalesCommission=e}_Variant;_QtyRequested;_TotalPrice;_SalesName;_PriceNote;_SalesID;_InventoryTypeID;_ID;_Code;_VariantID;_Quantity;_UnitQuantity;_Expense;_Cost;_Price;_Discount;_Note;_Taxable;_LoyaltyPoint;_UnitPriceOriginal;_DiscountAmount;_Name;_PriceTypeID;_Storage;_Serial;_ThumbnailUrl;_UnitPrice;_TypeID;_VariantUnitQuantity;_UOM;_UOMName;_SalesCommission;constructor(e,t,o,n,d,y,D,lt,ot,st,It,Vt,Xt,Yt,te,ee,ne,ie,oe,re,ae,le,nn,on,rn,an,ln,sn,dn,mn,cn,Pi){this._Variant=e,this._QtyRequested=t,this._TotalPrice=o,this._SalesName=n,this._PriceNote=d,this._SalesID=y,this._InventoryTypeID=D,this._ID=lt,this._Code=ot,this._VariantID=st,this._Quantity=It,this._UnitQuantity=Vt,this._Expense=Xt,this._Cost=Yt,this._Price=te,this._Discount=ee,this._Note=ne,this._Taxable=ie,this._LoyaltyPoint=oe,this._UnitPriceOriginal=re,this._DiscountAmount=ae,this._Name=le,this._PriceTypeID=nn,this._Storage=on,this._Serial=rn,this._ThumbnailUrl=an,this._UnitPrice=ln,this._TypeID=sn,this._VariantUnitQuantity=dn,this._UOM=mn,this._UOMName=cn,this._SalesCommission=Pi}toJSON(){return{Variant:this.Variant,QtyRequested:this.QtyRequested,TotalPrice:this.TotalPrice,SalesName:this.SalesName,PriceNote:this.PriceNote,SalesID:this.SalesID,InventoryTypeID:this.InventoryTypeID,ID:this.ID,Code:this.Code,VariantID:this.VariantID,Quantity:this.Quantity,UnitQuantity:this.UnitQuantity,Expense:this.Expense,Cost:this.Cost,Price:this.Price,Discount:this.Discount,Note:this.Note,Taxable:this.Taxable,LoyaltyPoint:this.LoyaltyPoint,UnitPriceOriginal:this.UnitPriceOriginal,DiscountAmount:this.DiscountAmount,Name:this.Name,PriceTypeID:this.PriceTypeID,Storage:this.Storage,Serial:this.Serial,ThumbnailUrl:this.ThumbnailUrl,UnitPrice:this.UnitPrice,TypeID:this.TypeID,VariantUnitQuantity:this.VariantUnitQuantity,UOM:this.UOM,UOMName:this.UOMName,SalesCommission:this.SalesCommission}}},Qi=class{get OnHand(){return this._OnHand}set OnHand(e){this._OnHand=e}get CategoryName(){return this._CategoryName}set CategoryName(e){this._CategoryName=e}get CategoryTypeID(){return this._CategoryTypeID}set CategoryTypeID(e){this._CategoryTypeID=e}get PriceTypeID(){return this._PriceTypeID}set PriceTypeID(e){this._PriceTypeID=e}get PriceNote(){return this._PriceNote}set PriceNote(e){this._PriceNote=e}get UnitPriceOriginal(){return this._UnitPriceOriginal}set UnitPriceOriginal(e){this._UnitPriceOriginal=e}get Ordered(){return this._Ordered}set Ordered(e){this._Ordered=e}get BrandName(){return this._BrandName}set BrandName(e){this._BrandName=e}get ImageUrl(){return this._ImageUrl}set ImageUrl(e){this._ImageUrl=e}get ThumbnailUrl(){return this._ThumbnailUrl}set ThumbnailUrl(e){this._ThumbnailUrl=e}get Component(){return this._Component}set Component(e){this._Component=e}get PriceBook(){return this._PriceBook}set PriceBook(e){this._PriceBook=e}get UOMName(){return this._UOMName}set UOMName(e){this._UOMName=e}get Storage(){return this._Storage}set Storage(e){this._Storage=e}get CategoryID(){return this._CategoryID}set CategoryID(e){this._CategoryID=e}get DiscountAmount(){return this._DiscountAmount}set DiscountAmount(e){this._DiscountAmount=e}get VariantUnitQuantity(){return this._VariantUnitQuantity}set VariantUnitQuantity(e){this._VariantUnitQuantity=e}get ProductCreated(){return this._ProductCreated}set ProductCreated(e){this._ProductCreated=e}get ProductID(){return this._ProductID}set ProductID(e){this._ProductID=e}get ProductIndex(){return this._ProductIndex}set ProductIndex(e){this._ProductIndex=e}get Code(){return this._Code}set Code(e){this._Code=e}get TypeID(){return this._TypeID}set TypeID(e){this._TypeID=e}get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(e){this._UnitQuantity=e}get SalesCommission(){return this._SalesCommission}set SalesCommission(e){this._SalesCommission=e}get Description(){return this._Description}set Description(e){this._Description=e}get Image(){return this._Image}set Image(e){this._Image=e}get Discontinued(){return this._Discontinued}set Discontinued(e){this._Discontinued=e}get Taxable(){return this._Taxable}set Taxable(e){this._Taxable=e}get LoyaltyPoint(){return this._LoyaltyPoint}set LoyaltyPoint(e){this._LoyaltyPoint=e}get PackSize(){return this._PackSize}set PackSize(e){this._PackSize=e}get CreatorId(){return this._CreatorId}set CreatorId(e){this._CreatorId=e}get Created(){return this._Created}set Created(e){this._Created=e}get UnitExpense(){return this._UnitExpense}set UnitExpense(e){this._UnitExpense=e}get SellPriceType(){return this._SellPriceType}set SellPriceType(e){this._SellPriceType=e}get VariantType(){return this._VariantType}set VariantType(e){this._VariantType=e}get CostCurrencyID(){return this._CostCurrencyID}set CostCurrencyID(e){this._CostCurrencyID=e}get UnitCost(){return this._UnitCost}set UnitCost(e){this._UnitCost=e}get OrderPrice(){return this._OrderPrice}set OrderPrice(e){this._OrderPrice=e}get OrderPriceDiscount(){return this._OrderPriceDiscount}set OrderPriceDiscount(e){this._OrderPriceDiscount=e}get OrderPriceDiscountDetail(){return this._OrderPriceDiscountDetail}set OrderPriceDiscountDetail(e){this._OrderPriceDiscountDetail=e}get PriceCurrencyID(){return this._PriceCurrencyID}set PriceCurrencyID(e){this._PriceCurrencyID=e}get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}get PriceDiscount(){return this._PriceDiscount}set PriceDiscount(e){this._PriceDiscount=e}get PaymentTypeID(){return this._PaymentTypeID}set PaymentTypeID(e){this._PaymentTypeID=e}get PaymentTypeString(){return this._PaymentTypeString}set PaymentTypeString(e){this._PaymentTypeString=e}get SellPriceTypeString(){return this._SellPriceTypeString}set SellPriceTypeString(e){this._SellPriceTypeString=e}get Weight(){return this._Weight}set Weight(e){this._Weight=e}get CostCurrencySymbol(){return this._CostCurrencySymbol}set CostCurrencySymbol(e){this._CostCurrencySymbol=e}get PriceCurrencySymbol(){return this._PriceCurrencySymbol}set PriceCurrencySymbol(e){this._PriceCurrencySymbol=e}get UOM(){return this._UOM}set UOM(e){this._UOM=e}get MeasurementID(){return this._MeasurementID}set MeasurementID(e){this._MeasurementID=e}get UOMQ(){return this._UOMQ}set UOMQ(e){this._UOMQ=e}get Name(){return this._Name}set Name(e){this._Name=e}get Model(){return this._Model}set Model(e){this._Model=e}get ID(){return this._ID}set ID(e){this._ID=e}_OnHand;_CategoryName;_CategoryTypeID;_PriceTypeID;_PriceNote;_UnitPriceOriginal;_Ordered;_BrandName;_ImageUrl;_ThumbnailUrl;_Component;_PriceBook;_UOMName;_Storage;_CategoryID;_DiscountAmount;_VariantUnitQuantity;_ProductCreated;_ProductID;_ProductIndex;_Code;_TypeID;_UnitQuantity;_SalesCommission;_Description;_Image;_Discontinued;_Taxable;_LoyaltyPoint;_PackSize;_CreatorId;_Created;_UnitExpense;_SellPriceType;_VariantType;_CostCurrencyID;_UnitCost;_OrderPrice;_OrderPriceDiscount;_OrderPriceDiscountDetail;_PriceCurrencyID;_UnitPrice;_PriceDiscount;_PaymentTypeID;_PaymentTypeString;_SellPriceTypeString;_Weight;_CostCurrencySymbol;_PriceCurrencySymbol;_UOM;_MeasurementID;_UOMQ;_Name;_Model;_ID;constructor(e,t,o,n,d,y,D,lt,ot,st,It,Vt,Xt,Yt,te,ee,ne,ie,oe,re,ae,le,nn,on,rn,an,ln,sn,dn,mn,cn,Pi,Pr,wr,Mr,Er,Or,Ar,jr,kr,Vr,Nr,Fr,Ur,Lr,Rr,Qr,Br,Hr,Wr,qr,Gr,zr,$r,Kr){this._OnHand=e,this._CategoryName=t,this._CategoryTypeID=o,this._PriceTypeID=n,this._PriceNote=d,this._UnitPriceOriginal=y,this._Ordered=D,this._BrandName=lt,this._ImageUrl=ot,this._ThumbnailUrl=st,this._Component=It,this._PriceBook=Vt,this._UOMName=Xt,this._Storage=Yt,this._CategoryID=te,this._DiscountAmount=ee,this._VariantUnitQuantity=ne,this._ProductCreated=ie,this._ProductID=oe,this._ProductIndex=re,this._Code=ae,this._TypeID=le,this._UnitQuantity=nn,this._SalesCommission=on,this._Description=rn,this._Image=an,this._Discontinued=ln,this._Taxable=sn,this._LoyaltyPoint=dn,this._PackSize=mn,this._CreatorId=cn,this._Created=Pi,this._UnitExpense=Pr,this._SellPriceType=wr,this._VariantType=Mr,this._CostCurrencyID=Er,this._UnitCost=Or,this._OrderPrice=Ar,this._OrderPriceDiscount=jr,this._OrderPriceDiscountDetail=kr,this._PriceCurrencyID=Vr,this._UnitPrice=Nr,this._PriceDiscount=Fr,this._PaymentTypeID=Ur,this._PaymentTypeString=Lr,this._SellPriceTypeString=Rr,this._Weight=Qr,this._CostCurrencySymbol=Br,this._PriceCurrencySymbol=Hr,this._UOM=Wr,this._MeasurementID=qr,this._UOMQ=Gr,this._Name=zr,this._Model=$r,this._ID=Kr}toJSON(){return{OnHand:this.OnHand,CategoryName:this.CategoryName,CategoryTypeID:this.CategoryTypeID,PriceTypeID:this.PriceTypeID,PriceNote:this.PriceNote,UnitPriceOriginal:this.UnitPriceOriginal,Ordered:this.Ordered,BrandName:this.BrandName,ImageUrl:this.ImageUrl,ThumbnailUrl:this.ThumbnailUrl,Component:this.Component,PriceBook:this.PriceBook,UOMName:this.UOMName,Storage:this.Storage,CategoryID:this.CategoryID,DiscountAmount:this.DiscountAmount,VariantUnitQuantity:this.VariantUnitQuantity,ProductCreated:this.ProductCreated,ProductID:this.ProductID,ProductIndex:this.ProductIndex,Code:this.Code,TypeID:this.TypeID,UnitQuantity:this.UnitQuantity,SalesCommission:this.SalesCommission,Description:this.Description,Image:this.Image,Discontinued:this.Discontinued,Taxable:this.Taxable,LoyaltyPoint:this.LoyaltyPoint,PackSize:this.PackSize,CreatorId:this.CreatorId,Created:this.Created,UnitExpense:this.UnitExpense,SellPriceType:this.SellPriceType,VariantType:this.VariantType,CostCurrencyID:this.CostCurrencyID,UnitCost:this.UnitCost,OrderPrice:this.OrderPrice,OrderPriceDiscount:this.OrderPriceDiscount,OrderPriceDiscountDetail:this.OrderPriceDiscountDetail,PriceCurrencyID:this.PriceCurrencyID,UnitPrice:this.UnitPrice,PriceDiscount:this.PriceDiscount,PaymentTypeID:this.PaymentTypeID,PaymentTypeString:this.PaymentTypeString,SellPriceTypeString:this.SellPriceTypeString,Weight:this.Weight,CostCurrencySymbol:this.CostCurrencySymbol,PriceCurrencySymbol:this.PriceCurrencySymbol,UOM:this.UOM,MeasurementID:this.MeasurementID,UOMQ:this.UOMQ,Name:this.Name,Model:this.Model,ID:this.ID}}},Zt=class i{adapt(e){return new Ri(e.Variant??null,e.QtyRequested??null,e.TotalPrice??null,e.SalesName??null,e.PriceNote??null,e.SalesID??null,e.InventoryTypeID??null,e.ID??null,e.Code??null,e.VariantID??null,e.Quantity??null,e.UnitQuantity??null,e.Expense??null,e.Cost??null,e.Price??null,e.Discount??null,e.Note??null,e.Taxable??null,e.LoyaltyPoint??null,e.UnitPriceOriginal??null,e.DiscountAmount??null,e.Name??null,e.PriceTypeID??null,e.Storage??null,e.Serial??null,e.ThumbnailUrl??null,e.UnitPrice??null,e.TypeID??null,e.VariantUnitQuantity??null,e.UOM??null,e.UOMName??null,e.SalesCommission??null).toJSON()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},en=class i{adapt(e){return new Qi(e.OnHand??null,e.CategoryName??null,e.CategoryTypeID??null,e.PriceTypeID??null,e.PriceNote??null,e.UnitPriceOriginal??null,e.Ordered??null,e.BrandName??null,e.ImageUrl??null,e.ThumbnailUrl??null,e.Component??null,e.PriceBook??null,e.UOMName??null,e.Storage??null,e.CategoryID??null,e.DiscountAmount??null,e.VariantUnitQuantity??null,e.ProductCreated??null,e.ProductID??null,e.ProductIndex??null,e.Code??null,e.TypeID??null,e.UnitQuantity??null,e.SalesCommission??null,e.Description??null,e.Image??null,e.Discontinued??null,e.Taxable??null,e.LoyaltyPoint??null,e.PackSize??null,e.CreatorId??null,e.Created??null,e.UnitExpense??null,e.SellPriceType??null,e.VariantType??null,e.CostCurrencyID??null,e.UnitCost??null,e.OrderPrice??null,e.OrderPriceDiscount??null,e.OrderPriceDiscountDetail??null,e.PriceCurrencyID??null,e.UnitPrice??null,e.PriceDiscount??null,e.PaymentTypeID??null,e.PaymentTypeString??null,e.SellPriceTypeString??null,e.Weight??null,e.CostCurrencySymbol??null,e.PriceCurrencySymbol??null,e.UOM??null,e.MeasurementID??null,e.UOMQ??null,e.Name??null,e.Model??null,e.ID??null).toJSON()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Rs=i=>({selected:i});function Qs(i,e){if(i&1){let t=x();a(0,"button",9),_("click",function(){let n=p(t).$implicit,d=m();return u(d.onTabChange(n.value))}),s(1),r()}if(i&2){let t=e.$implicit;Tt(t.class),c("ngClass",V(4,Rs,t.active)),l(),I(" ",t.label," ")}}function Bs(i,e){i&1&&(a(0,"div",10)(1,"strong",11),s(2,"PIC"),r(),f(3,"input",12),r(),a(4,"div",10)(5,"strong",13),s(6,"Note"),r(),f(7,"POS-tinymce-editor",14),r())}function Hs(i,e){if(i&1){let t=x();a(0,"div",15),f(1,"input",16,0),a(3,"button",17),_("click",function(){p(t);let n=J(2);return u(n.click())}),s(4),r()()}if(i&2){let t=e.$implicit,o=m(2);l(),c("id",me("tag-",t.ID))("value",t.ID),l(2),Nt("active",o.form.get("TagID").value===t.ID),l(),I(" ",t.Name," ")}}function Ws(i,e){if(i&1&&(a(0,"div",7),F(1,Hs,5,6,"div",15,se),r()),i&2){let t=m();l(),U(t.storeService.LoadForm().AdjustmentTags)}}var ai=class i{modalConfig;storeService=h(G);#t=h(Ue);#e=h(_t);form;tabs=z([]);activeTab=ye(()=>this.tabs().find(e=>e.active));constructor(){this.modalConfig=new gt,this.modalConfig.customWidth="600px",this.modalConfig.title="Adjustment Note",this.modalConfig.disableKeyup=!0}generateForm(){this.form=this.#t.group({PIC:[this.storeService.Order().PIC||""],Note:[this.storeService.Order().Note||""],TagID:new Se(this.storeService.Order().TagID||this.storeService.LoadForm().AdjustmentTags[0].ID)})}onOK(){let e=this.form.value;this.#e.close(e)}onCancel(){this.#e.close()}ngOnInit(){this.generateForm(),this.tabs.set([{label:"Note",value:"note",active:!0,class:"note-tab"},{label:"Tag",value:"tag",active:!1,class:"tag-tab"}])}handleKeyDown(e){console.log("event",e),e.code==="F2"&&this.onOK()}onTabChange(e){this.tabs.update(t=>t.map(o=>R(j({},o),{active:o.value===e})))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["POS-modal-cart-note"]],hostBindings:function(t,o){t&1&&_("keydown",function(d){return o.handleKeyDown(d)},Ht)},decls:12,vars:4,consts:[["tagInput",""],[3,"onOk","onCancel","onClose","config"],[2,"min-height","400px"],[1,"container-fluid"],[1,"row","border-bottom"],[1,"btn","btn-link",3,"class","ngClass"],[1,"w-100","h-100","d-flex","flex-column","gap-4","my-6",3,"formGroup"],[1,"d-flex","flex-wrap","gap-3","mt-3"],[1,"w-100","h-100","d-flex","flex-column","gap-4",3,"formGroup"],[1,"btn","btn-link",3,"click","ngClass"],[1,"w-100"],[1,"mt-3","mb-3"],["type","text","formControlName","PIC",1,"form-control","w-100","height-input"],[1,"mb-3"],["formControlName","Note"],[1,""],["type","radio","formControlName","TagID","name","TagID",1,"d-none",3,"value","id"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(t,o){if(t&1&&(a(0,"modal-material",1),_("onOk",function(){return o.onOK()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),a(1,"content")(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),F(6,Qs,2,6,"button",5,se),r()()(),a(8,"div",6),g(9,Bs,8,0)(10,Ws,3,0,"div",7),r(),f(11,"div",8),r()()()),t&2){let n;c("config",o.modalConfig),l(6),U(o.tabs()),l(2),c("formGroup",o.form),l(),C((n=o.activeTab().value)==="note"?9:n==="tag"?10:-1),l(2),c("formGroup",o.form)}},dependencies:[ut,Ct,qt,xt,lo,B,Ve,be,Ne,Fe,yt,Ft,De,Ke],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}a.btn.btn-link.note-tab[_ngcontent-%COMP%]{color:inherit}.active[_ngcontent-%COMP%]{background:#dcdcdc;border:1px solid #dcdcdc}"]})};var li=class i{modalConfig;#t=h(_t);constructor(){this.modalConfig=new gt,this.modalConfig.customWidth="400px",this.modalConfig.title="Void Transaction?"}onOK(){this.#t.close({type:"OK",data:null})}onCancel(){this.#t.close({type:"Cancel",data:null})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["POS-modal-cart-void"]],decls:5,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"fw-normal"]],template:function(t,o){t&1&&(a(0,"modal-material",0),_("onOk",function(){return o.onOK()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),a(1,"content")(2,"div",1)(3,"h4",2),s(4,"This will erase all current data. Are you sure?"),r()()()()),t&2&&c("config",o.modalConfig)},dependencies:[ut,Ct],encapsulation:2})};var bt=class i{variantSearchCTRL=new Se({});#t=h(G);#e=h(L);#n=h(ht);#i=h(Zt);#o=h(nt);#r=h(en);destroy$=new ft;toastr=h(vt);httpGetVariantByID(e,t=!0){let o={entityID:this.#t.Outlet().ID,id:e};return this.#e.post("/API/catalog/variant/GetVariantByID",o).pipe(Ot(n=>this.generateCartItem(n)),Q(n=>{t&&this.onAddCartItem(n)}))}httpRequestVariantByCode(e){let{Digit:t,QuantityDivider:o,Regex:n}=this.#t.LoadForm().AppConfigJSON.ModuleAdjustment.DigitalScale;if(e.length===t){let y=new RegExp(n).exec(e);if(Object.is(y,null))return this.#e.get(`${wt.GetVariantByCode}?Code=${e}&EntityID=${this.#t.Outlet().ID}`).pipe(Ot(D=>this.generateCartItem(D)),Q(D=>{this.onAddCartItem(D)}));{console.log(y,"decodedRegex");let D=y[1],lt=parseFloat(y[2]);return lt=lt/o||1,this.#e.get(`${wt.GetVariantByCode}?Code=${D}&EntityID=${this.#t.Outlet().ID}`).pipe(Ot(ot=>this.generateCartItem(ot)),Q(ot=>{this.onAddCartItem(ot,!1,lt)}),_e(ot=>(this.toastr.info("Matching Regex Rule to Barcode","Digital Scale"),this.#e.get(`${wt.GetVariantByCode}?Code=${e}&EntityID=${this.#t.Outlet().ID}`).pipe(Ot(st=>this.generateCartItem(st)),Q(st=>{this.onAddCartItem(st)})))))}}else return this.#e.get(`${wt.GetVariantByCode}?Code=${e}&EntityID=${this.#t.Outlet().ID}`).pipe(Ot(d=>this.generateCartItem(d)),Q(d=>{this.onAddCartItem(d)}))}httpRequestGetInventoryByVariantID(e){return Pt(this.#t.Outlet,{injector:this.#n}).pipe(Dt(this.destroy$),dt(t=>A.IsNotEmpty(t.ID)),Me(),it(t=>this.#e.get(wt.GetVariantStockByID,[{key:"EntityID",value:t.ID},{key:"ID",value:e}])))}addItemByVariantID(e){this.httpGetVariantByID(e).pipe(Dt(this.destroy$)).subscribe()}onAddCartItem(e,t=!1,o=1){let n=this.#t.CartItems(),d=n.findIndex(D=>D.VariantID===e.VariantID),y=[];d!==-1?t?y=[...n,e]:(n[d].Quantity+=o,y=[...n]):y=[...n,R(j({},e),{Quantity:o})],this.#t.onChangeCartItems(y)}generateCartItem(e){return this.#i.adapt(R(j({},e),{ID:A.GuidEmpty,Cost:e.UnitCost,Expense:e.UnitCost,SplitQuantity:0,UnitCost:e.UnitCost,InventoryTypeID:e.TypeID,Price:e.UnitPrice,Name:e.Name,ThumbnailUrl:e.ThumbnailUrl,UnitPrice:e.UnitPrice,UnitQuantity:e.UnitQuantity,Quantity:1,Code:e.Code,TypeID:e.TypeID,Discount:e.PriceDiscount,EntityID:A.GuidEmpty,VariantUnitQuantity:e.VariantUnitQuantity,Storage:e.Storage,UOM:e.UOM,UOMName:e.UOMName,VariantID:e.ID,Variant:this.#r.adapt(e)}))}onRemoveCartItem(e){let t=this.#t.CartItems().filter((o,n)=>e!==n);this.#t.onChangeCartItems(t)}onOpenCartNoteModal(){return this.#o.open(ai)}onOpenCartVoidModal(){return this.#o.open(li)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var qs=["unitCost"],Gs=i=>({selected:i}),zs=()=>["/menu/Products/Catalog/Variants/Info"],$s=(i,e)=>e.key;function Ks(i,e){if(i&1){let t=x();a(0,"a",7),_("click",function(){p(t);let n=m().$implicit,d=m();return u(d.onTabChange(n.key))}),s(1),r()}if(i&2){let t=m().$implicit,o=m();c("ngClass",V(2,Gs,o.activeTab().key===t.key)),l(),I(" ",t.label," ")}}function Js(i,e){if(i&1&&g(0,Ks,2,4,"a",6),i&2){let t=e.$implicit;C(t.isVisible?0:-1)}}function Zs(i,e){i&1&&(a(0,"div",11)(1,"h5"),s(2,"Cost"),r(),f(3,"input",16),r())}function Xs(i,e){if(i&1&&(a(0,"div")(1,"div",8)(2,"div",9)(3,"h5"),s(4,"Qty"),r(),f(5,"input",10,0),r(),a(7,"div",11)(8,"h5"),s(9,"Price"),r(),f(10,"input",12),r(),g(11,Zs,4,0,"div",11),r(),At(12),a(13,"div",8)(14,"div",13)(15,"h5",14),s(16,"Note"),r(),f(17,"POS-tinymce-editor",15),r()(),jt(),r()),i&2){let t=m();l(11),C(t.roleService.product.Cost?11:-1)}}function Ys(i,e){if(i&1&&f(0,"img",29),i&2){let t=m(3);c("ngSrc",t.cartItem.ThumbnailUrl)}}function td(i,e){i&1&&E(0,Ys,1,1,"ng-template")}function ed(i,e){i&1&&(At(0),f(1,"i",30),a(2,"h6"),s(3,"No Image"),r(),jt())}function nd(i,e){if(i&1&&(a(0,"div",13)(1,"table",31)(2,"thead")(3,"tr")(4,"th",32),s(5,"Storage Location"),r()()(),a(6,"tbody")(7,"tr")(8,"td"),s(9),r()()()()()),i&2){let t=m(2);l(9),I(" ",t.cartItem.Variant.Storage," ")}}function id(i,e){if(i&1&&(At(0),a(1,"div",17)(2,"div",18)(3,"a",19),g(4,td,1,0)(5,ed,4,0,"ng-container"),r()(),a(6,"div",20)(7,"div",21)(8,"div",13)(9,"div",22),f(10,"i",23),a(11,"div",24),s(12," Inventory "),r()(),a(13,"table",25)(14,"thead")(15,"tr")(16,"th",26),s(17," On Hand "),r(),a(18,"th",26),s(19," Allocated "),r(),a(20,"th",27),s(21," Available "),r()()(),a(22,"tbody")(23,"tr")(24,"td",28),s(25),r(),a(26,"td",28),s(27),r(),a(28,"td",28),s(29),r()()()()(),g(30,nd,10,1,"div",13),r()(),f(31,"div",17),r(),jt()),i&2){let t=m();l(3),c("routerLink",Z(6,zs)),l(),C(t.cartItem.ThumbnailUrl?4:5),l(21),I(" ",t.inventory().ON_HAND," "),l(2),I(" ",t.inventory().ALLOCATED," "),l(2),I(" ",t.inventory().ON_HAND-t.inventory().ALLOCATED," "),l(),C(!(t.AppConfigJSON==null||t.AppConfigJSON.ModuleSell==null||t.AppConfigJSON.ModuleSell.Grid==null)&&t.AppConfigJSON.ModuleSell.Grid.StorageVisible&&t.cartItem.Variant.Storage?30:-1)}}function od(i,e){if(i&1){let t=x();a(0,"POS-tab-serial",33),P("variantChange",function(n){p(t);let d=m();return T(d.cartItem,n)||(d.cartItem=n),u(n)}),_("variantChange",function(n){p(t);let d=m();return u(d.onSerialChange(n))}),P("serialsChange",function(n){p(t);let d=m();return T(d.serials,n)||(d.serials=n),u(n)})("isFocusOnSerialInputChange",function(n){p(t);let d=m();return T(d.isFocusOnSerialInput,n)||(d.isFocusOnSerialInput=n),u(n)}),r()}if(i&2){let t=m();c("disabledEditQty",t.isAdjustmentEdit())("disabledAddSerial",t.isAdjustmentEdit())("outletID",t.storeService.Outlet().ID),M("variant",t.cartItem)("serials",t.serials)("isFocusOnSerialInput",t.isFocusOnSerialInput)}}var si=class i{constructor(e){this.data=e;this.isAdjustmentEdit.set(this.data.isAdjustmentEdit);let t=this.storeService.CartItems()[this.data.index];this.cartItem=JSON.parse(JSON.stringify(t)),this.modalConfig.title=this.cartItem.Variant.Name,this.modalConfig.customWidth="650px",this.modalConfig.bodyScrollable=!0,this.AppConfigJSON=this.storeService.AppConfigJSON(),eo(()=>{this.tabs()&&this.tabs()[1].isActive&&this.tabs()[1].isActive&&setTimeout(()=>{this._costElement?.nativeElement?.click(),this._costElement.nativeElement.focus()},500)})}storeService=h(G);roleService=h(H);AppConfigJSON;modalConfig=new gt;cartItem;form;tabs=z([]);activeTab=ye(()=>this.tabs().filter(e=>e.isActive)[0]);isItemSerial=z(!1);inventory=z({ON_HAND:0,ALLOCATED:0,AVAILABLE:0,ROP:0,MAX:0});serials=[];isFocusOnSerialInput=z(!1);_costElement;cdr=h(no);#t=h(Ue);#e=h(_t);#n=h(Zt);#i=h(bt);#o=h(ht);#r=h(vt);isAdjustmentEdit=z(!1);onTabChange(e){let t=this.tabs().map(o=>o.key===e?R(j({},o),{isActive:!0}):R(j({},o),{isActive:!1}));this.tabs.set(t),this.cdr.detectChanges()}generateForm(){this.form=this.#t.group({Quantity:this.cartItem.Quantity??0,Price:this.cartItem.Price??0,Cost:this.cartItem.Cost??0,Note:this.cartItem.Note??""})}ngOnInit(){this.generateForm(),this.isItemSerial.set(this.checkIsSerial()),this.tabs.set([{key:0,value:"cart",label:"Cart",isActive:!0,isVisible:!0},{key:1,value:"product",label:"Product",isActive:!1,isVisible:this.roleService.inventory.View&&this.cartItem.Variant.Name.length>0},{key:2,value:"serial",label:"Serial",isActive:!1,isVisible:this.checkIsSerial()}]),this.requestUnitInStock().subscribe({next:e=>this.inventory.set(R(j({},this.inventory()),{ALLOCATED:Number(e.Allocated),MAX:Number(e.Max),ON_HAND:Number(e.OnHand),ROP:Number(e.ROP),AVAILABLE:Number(+e.OnHand-+e.Allocated)}))})}onSerialChange(e){let t=this.form.get("Quantity"),o=e.Quantity;t.setValue(o)}onNoteChange(e){this.form.get("Note").setValue(e)}onOK(){if(this.checkIsSerial()){if(this.generateSerials(),Array.isArray(this.cartItem.Serial)&&this.cartItem.Serial.length){let e=this.cartItem.Serial.reduce((o,n)=>o+n.Quantity,0);if(this.form.get("Quantity")?.value!==e){this.#r.warning("Serial must be equal with the quantity",et.Warning);return}}if(this.cartItem.Quantity<0){let e=this.storeService.CartItems().reduce((t,o,n)=>(this.data.index===n?t.push(j({},this.#n.adapt(R(j({},o),{Quantity:+this.form.get("Quantity")?.value,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):t.push(o),t),[]);this.storeService.onChangeCartItems(e)}if(this.cartItem.Quantity>0){let e=this.storeService.CartItems().reduce((t,o,n)=>(this.data.index===n?t.push(j({},this.#n.adapt(R(j({},o),{Quantity:+this.form.get("Quantity")?.value,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):t.push(o),t),[]);this.storeService.onChangeCartItems(e)}}else{let e=this.storeService.CartItems().reduce((t,o,n)=>(this.data.index===n?t.push(j({},this.#n.adapt(R(j({},o),{Quantity:+this.form.get("Quantity")?.value,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value})))):t.push(o),t),[]);this.storeService.onChangeCartItems(e)}this.#e.close()}checkIsSerial(){return this.cartItem.Variant!==void 0?this.cartItem.Variant.TypeID===4:!1}generateSerials(){if(!this.isFocusOnSerialInput()&&this.serials.length>0){let e=this.serials.map(t=>({Quantity:1,Number:t}));this.cartItem.Serial=[...this.cartItem.Serial,...e]}}requestUnitInStock(){if(A.IsEmpty(this.storeService.Outlet().ID)){this.#r.error("Please select outlet before proceding...",et.Error);return}return Pt(this.activeTab,{injector:this.#o}).pipe(dt(e=>e.key===1),Me(),it(e=>this.#i.httpRequestGetInventoryByVariantID(this.cartItem.VariantID)))}onCancel(){this.#e.close()}static \u0275fac=function(t){return new(t||i)(b(Gt))};static \u0275cmp=O({type:i,selectors:[["adjustment-modal-edit-product"]],viewQuery:function(t,o){if(t&1&&Ce(qs,5),t&2){let n;fe(n=he())&&(o._costElement=n.first)}},decls:11,vars:3,consts:[["qty",""],[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"row","border-bottom"],[1,"container-fluid","mt-5",3,"formGroup"],[3,"disabledEditQty","disabledAddSerial","outletID","variant","serials","isFocusOnSerialInput"],[1,"btn","btn-link",3,"ngClass"],[1,"btn","btn-link",3,"click","ngClass"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["formControlName","Price","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"col-12"],[1,"mb-5"],["formControlName","Note","height","220px"],["formControlName","Cost","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"row"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink"],[1,"col"],[1,"row","row-gap-4"],[1,"d-flex"],["aria-hidden","true",1,"fa-archive","fa-solid","fa-1x","pt-3","pe-2"],[2,"font-size","15px","font-family",'"Roboto Slab"'],[1,"table","table-bordered","text-center","inventory-table"],[1,"table-light","py-6","border-end",2,"text-transform","none"],[1,"table-light","py-6",2,"text-transform","none"],[1,"py-6"],["width","400","height","400",1,"border","rounded",3,"ngSrc"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"table","table-bordered","text-center"],[1,"table-light"],[3,"variantChange","serialsChange","isFocusOnSerialInputChange","disabledEditQty","disabledAddSerial","outletID","variant","serials","isFocusOnSerialInput"]],template:function(t,o){if(t&1&&(a(0,"modal-material",1),_("onOk",function(){return o.onOK()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),a(1,"content")(2,"div",2)(3,"div",3)(4,"div"),F(5,Js,1,1,null,null,$s),r()()(),a(7,"div",4),g(8,Xs,18,1,"div")(9,id,32,7,"ng-container")(10,od,1,6,"POS-tab-serial",5),r()()()),t&2){let n;c("config",o.modalConfig),l(5),U(o.tabs()),l(2),c("formGroup",o.form),l(),C((n=o.activeTab().key)===0?8:n===1?9:n===2?10:-1)}},dependencies:[ut,Ct,yt,Ft,be,xt,B,Ve,Ne,Fe,De,Ke,_n,ct,oo,Rn,He,Lt,Re],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}autocompleteV2[_ngcontent-%COMP%] mat-form-field input{padding:10px 15px!important}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}.inventory-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .inventory-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:6px!important}p-chips[_ngcontent-%COMP%] ul.p-inputtext{width:570px;max-width:570px;border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] ul.p-inputtext li.p-chips-input-token>input[type=text]{border:none}p-chips[_ngcontent-%COMP%] .p-chips .p-chips-multiple-container:not(.p-disabled):hover{border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container{display:inline-block}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container .p-chips-token{margin:2px;background:#96bf48}"]})};function rd(i,e){if(i&1){let t=x();a(0,"div",27)(1,"button",28),_("click",function(){p(t);let n=m().$index,d=m(2);return u(d.onReturnVariant(n))}),s(2," Return "),r(),a(3,"button",28),_("click",function(){p(t);let n=m().$index,d=m(2);return u(d.onPurchaseVariant(n))}),s(4," Purchase "),r()()}}function ad(i,e){if(i&1&&(a(0,"td",6),s(1),r()),i&2){let t=m().$index;l(),I("",t+1,".")}}function ld(i,e){if(i&1){let t=x();a(0,"div",9)(1,"img",29),_("error",function(n){p(t);let d=m(3);return u(d.onErrorImage(n))}),r()()}if(i&2){let t=m().$implicit;l(),c("src",t.Variant.ThumbnailUrl,Oe)("alt",t.Variant.Name)}}function sd(i,e){i&1&&(a(0,"div",10),f(1,"i",30),r())}function dd(i,e){if(i&1&&(a(0,"span"),s(1),v(2,"number"),r()),i&2){let t=m().$implicit;l(),S(w(2,1,t.Quantity))}}function md(i,e){i&1&&(a(0,"span",18),s(1," x "),r())}function cd(i,e){if(i&1&&(a(0,"span"),s(1),v(2,"number"),r()),i&2){let t=m().$implicit;l(),S(w(2,1,t.UnitQuantity))}}function pd(i,e){if(i&1&&(a(0,"small",19),s(1),r()),i&2){let t=m().$implicit;l(),S(t.Variant.UOM?t.Variant.UOMName:"")}}function ud(i,e){if(i&1&&(a(0,"div",20),s(1),v(2,"number"),r()),i&2){let t=m().$implicit;l(),I(" ",k(2,1,t.Price,"1.0-4")," ")}}function _d(i,e){if(i&1){let t=x();a(0,"tr",5),_("click",function(){let n=p(t).$index,d=m(2);return u(d.onOpenModalEditProduct(n))}),E(1,rd,5,0,"ng-template",null,0,K),g(3,ad,2,1,"td",6),a(4,"td",7)(5,"div",8),g(6,ld,2,2,"div",9)(7,sd,2,0,"div",10),a(8,"div",11)(9,"div"),s(10),r(),a(11,"span",12),s(12),r(),a(13,"div"),f(14,"app-serial-note",13),r(),f(15,"small",14),r()()(),a(16,"td",15)(17,"div",16)(18,"div",17)(19,"span"),g(20,dd,3,3,"span"),g(21,md,2,0,"span",18),g(22,cd,3,3,"span"),r(),g(23,pd,2,1,"small",19),r()()(),a(24,"td"),g(25,ud,3,4,"div",20),r(),a(26,"td",21)(27,"div",16)(28,"div",22),s(29),v(30,"number"),r()()(),a(31,"td",23)(32,"div",24)(33,"span",25),_("click",function(){let n=p(t).$index,d=m(2);return u(d.removeCartItem(n))}),f(34,"i",26),r()()()()}if(i&2){let t,o,n=e.$implicit,d=J(2),y=m(2);c("cdkContextMenuTriggerFor",d)("cdkDragDisabled",y.isMobileDevice()),l(3),C((t=y.AppConfigJSON())!=null&&t.ModuleSell.Grid.RowNumberVisible?3:-1),l(3),C(n.Variant.ThumbnailUrl?6:7),l(4),S(n.Variant.Name),l(2),S(n.Variant.Code),l(2),c("serials",n.Serial),l(),c("innerHtml",n.Note,$),l(5),C(n.Quantity!=1||n.UnitQuantity>1?20:-1),l(),C(n.UnitQuantity>1||n.UnitQuantity<-1?21:-1),l(),C(n.UnitQuantity>1||n.UnitQuantity<-1?22:-1),l(),C(n.Variant.UOM&&(!((o=y.AppConfigJSON())==null||o.ModuleSell==null)&&o.ModuleSell.Grid.UOMVisible)?23:-1),l(2),C(n.UnitPrice!==(n==null?null:n.Total)&&n.Quantity>1?25:-1),l(4),I(" ",y.roleService.product!=null&&y.roleService.product.Price?w(30,14,+(n.Quantity*+n.Price)):" - "," ")}}function gd(i,e){if(i&1){let t=x();a(0,"table",1)(1,"tbody",3),_("cdkDropListDropped",function(n){p(t);let d=m();return u(d.onDrop(n))}),F(2,_d,35,16,"tr",4,tt),r()()}if(i&2){let t=m();l(2),U(t.CartItems())}}function Cd(i,e){i&1&&(a(0,"div",2)(1,"div",31)(2,"div",32)(3,"div",33)(4,"div",34),f(5,"i",35),r(),a(6,"div",36)(7,"span"),s(8,"Empty Cart"),r(),f(9,"br"),a(10,"span"),s(11,"Add products to the cart"),r(),f(12,"br"),a(13,"span"),s(14,"or scan barcode"),r()()()()()())}var di=class i{roleService=h(H);storeService=h(G);cartService=h(bt);matDialog=h(nt);renderer=h(Yi);#t=h(Zt);route=h(xe);isAdjustmentEdit=ye(()=>{let e=this.route.snapshot?.queryParams;return A.IsNotEmpty(e.ID)});CartItems=this.storeService.CartItems;AppConfigJSON=this.storeService.AppConfigJSON;onDrop(e){}onOpenModalEditProduct(e){this.matDialog.open(si,{data:{index:e,isAdjustmentEdit:this.isAdjustmentEdit()}})}removeCartItem(e){this.cartService.onRemoveCartItem(e)}onErrorImage(e){console.log("img erro",e);let t=e.target;this.renderer.setStyle(t,"border","1px solid #dddddd"),this.renderer.setStyle(t,"border-radius","4px"),this.renderer.setAttribute(t,"alt","")}onReturnVariant(e){let t=this.storeService.CartItems().reduce((o,n,d)=>(e===d?o.push(j({},this.#t.adapt(R(j({},n),{Quantity:-Math.abs(n.Quantity),TotalPrice:-Math.abs(n.Quantity)*n.Price})))):o.push(n),o),[]);this.storeService.onChangeCartItems(t)}onPurchaseVariant(e){let t=this.storeService.CartItems().reduce((o,n,d)=>(e===d?o.push(j({},this.#t.adapt(R(j({},n),{Quantity:Math.abs(n.Quantity),TotalPrice:Math.abs(n.Quantity)*n.Price})))):o.push(n),o),[]);this.storeService.onChangeCartItems(t)}isMobileDevice(){let e=navigator.userAgent||"";return/android|avantgo|bada\/|blackberry|bb10|blazer|compal|elaine|fennec|hiptop|iemobile|iphone|ipod|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|acer|airn|al(av|ca)|amoi|anex|anyw|aptu|ar(ch|go)|as(te|us)|attw|au(di|m)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw(n|u)|c55\/|capi|ccwa|cdm|cell|chtm|cldc|cmd|co(mp|nd)|craw|da(it|ll)|dbte|dc|devi|dica|dmob|do(c|p)o|ds(12|d)|el(ai)|em(l2)|er(ic|k0)|esl8|ez(40|os|wa|ze)|fetc|fly|g1 u|g560|gene|gf5|gmo|go(\.w|od)|gr(ad|un)|haie|hcit|hd(m|p|t)|hei|hi(pt|ta)|hp i|hs(c)|ht(c|tp)|hu(aw|tc)|i(ma|go)|i230|iac|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(v)a|jbro|jemu|jigs|kddi|keji|kgt|klon|kpt |kwc|kyo|le(no|xi)|lg( g|\/k|50)|libw|lynx|m1|m3ga|m50|ma(te|ui|xo)|mc(01|21)|me(rc|ri)|mi(o8|oa)|mmef|mo(01|bi|zz)|mt(50|p1)|mwbp|mywa|n10|n20|n30|n50|n70|ne(c|m)|nok|nzph|o2im|opwv|oran|pdxg|pg(13|c)|phil|pire|pl(ay|uc)|pn|po(ck|se)|prox|psio|pt|qa|qc(07|12|21|60)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55|sa(ma|ny)|sc(01|p)|sdk|se(c|47|mc)|sgh|shar|sie|sk|sl45|sm(al|t5)|so(ft|ny)|sp(01|v)|sy|t2(18|50)|t6(00|18)|ta(gt)|tcl|tdg|tim|tmo|to(pl)|ts(70|m3)|tx|up(\.b)|utst|v400|v750|veri|vi(te)|vk(40)|vm40|voda|vx(52|53|60|70)|w3c|webc|whit|wi(g|nc)|wmlb|wonu|x700|yas|zeto|zte/i.test(e.substring(0,4))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["adjustment-cart-display"]],decls:2,vars:1,consts:[["context_menu",""],[1,"table","table-borderless"],[1,"row","g-0","h-100"],["cdkDropList","",3,"cdkDropListDropped"],["cdkDrag","",1,"border-bottom",2,"padding-left","12px",3,"cdkContextMenuTriggerFor","cdkDragDisabled"],["cdkDrag","",1,"border-bottom",2,"padding-left","12px",3,"click","cdkContextMenuTriggerFor","cdkDragDisabled"],[2,"width","10px","padding-left","12px"],[1,"pe-0",2,"width","50%","padding-left","12px"],[1,"d-flex","align-items-center"],[1,""],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"d-block","ms-6",2,"line-height","18px"],[1,"fw-normal","fs-6","text-muted"],[3,"serials"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",3,"innerHtml"],[1,"px-0","text-end",2,"width","15%"],[1,"d-flex","align-items-center","justify-content-end"],[1,"d-flex","text-end","fw-normal","align-items-center",2,"line-height","20px"],[1,"fs-6"],["title","UOM",1,"ps-1","fs-5"],[1,"fs-5","text-end"],["data-test","total",1,"pe-0"],[1,"fs-5"],[1,"mt-6","ps-0"],[1,"d-flex","justify-content-end","align-items-center"],["role","button","title","Delete Item",1,"fs-3","cursor-pointer",3,"click"],[1,"fa","fa-trash","text-danger","fs-4"],["cdkMenu","",1,"example-menu"],["cdkMenuItem","",1,"example-menu-item",3,"click"],[1,"object-fit-contain",2,"height","55px","width","55px",3,"error","src","alt"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"col-12"],[1,"d-flex","justify-content-center","align-items-center","h-100"],[1,"row"],[1,"col-12","d-flex","justify-content-center"],[1,"fa-regular","fa-cart-arrow-up","text-secondary",2,"font-size","110px"],[1,"col-12","justify-content-center","text-center","mt-5","empty-cart-description","text-secondary","headings-font-family"]],template:function(t,o){t&1&&g(0,gd,4,0,"table",1)(1,Cd,15,0,"div",2),t&2&&C(o.CartItems().length>0?0:1)},dependencies:[xo,vo,Je,Zo,Ko,$o,Jo,q],styles:[".item-image[_ngcontent-%COMP%]{height:50px;width:56px;display:block;border:solid 1px #dddddd;border-radius:5px}.example-menu[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;min-width:180px;max-width:280px;background-color:#fff;padding:6px 0}.example-menu-item[_ngcontent-%COMP%]{background-color:transparent;cursor:pointer;border:none;-webkit-user-select:none;user-select:none;min-width:64px;line-height:36px;padding:0 16px;display:flex;align-items:center;flex-direction:row;flex:1}.example-menu-item[_ngcontent-%COMP%]:hover{background-color:#f5f5f5}.example-menu-item[_ngcontent-%COMP%]:active{background-color:#dcdcdc} .cdk-menu.cdk-menu-group.example-menu{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}"]})};var mi=class i{storeService=h(G);cartService=h(bt);orderService=h(Qt);loadFormService=h(tn);roleService=h(H);#t=h(Ut);onProcess=new Sn;onOpenModalNote=new Sn;onOpenModalVoid=new Sn;constructor(){}onProcessHandler(){this.onProcess.emit()}onOpenModalNoteHandler(){this.onOpenModalNote.emit(),this.cartService.onOpenCartNoteModal().afterClosed().subscribe({next:t=>{Object.keys(t).forEach(o=>{this.orderService.onUpdateOrderState(o,t[o])})}})}onOpenModalVoidHandler(){this.onOpenModalVoid.emit(),this.cartService.onOpenCartVoidModal().afterClosed().pipe(dt(t=>t.type==="OK"),it(()=>this.loadFormService.getLoadForm$),Q(()=>{this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeCartItems([]),this.storeService.onChangeIsOpenDialog(!1),this.#t.navigate(["/menu/Adjustment/Adjustment/Archive/Form"])})).subscribe()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["adjustment-cart-action"]],outputs:{onProcess:"onProcess",onOpenModalNote:"onOpenModalNote",onOpenModalVoid:"onOpenModalVoid"},decls:17,vars:5,consts:[[1,"row","g-0","pb-6","px-5"],[1,"col-5","d-flex","justify-content-between","pe-5",2,"column-gap","12px"],["type","button",1,"btn","btn-gray","fs-3","py-6","headings-font-family",2,"flex-grow","1",3,"click"],[1,"fa-regular","fa-note-sticky","fa-xl"],["type","button",1,"btn","btn-gray","fs-3","px-0","py-6","headings-font-family","d-flex","gap-2","justify-content-center","align-items-center",2,"flex-grow","8",3,"click"],[1,"fa-solid"],[1,"col-7"],["type","button",1,"btn","btn-success","w-100","px-6","py-6","d-flex","justify-content-between","align-items-center","headings-font-family",2,"border-left","0.1px solid #fff","font-size","22px",3,"click"],[1,"fs-6"]],template:function(t,o){t&1&&(ge(0,"div",0)(1,"div",1)(2,"button",2),In("click",function(){return o.onOpenModalNoteHandler()}),Mi(3,"i",3),pn(),ge(4,"button",4),In("click",function(){return o.onOpenModalVoidHandler()}),Mi(5,"i",5),ge(6,"span"),s(7,"Clear"),pn()()(),ge(8,"div",6)(9,"button",7),In("click",function(){return o.onProcessHandler()}),ge(10,"div"),s(11," Submit "),ge(12,"small",8),s(13),pn()(),ge(14,"div"),s(15),v(16,"number"),pn()()()()),t&2&&(l(13),de("(",o.storeService.CartItems().length," items, ",o.storeService.QtyCartItems()," Qty)"),l(2),S(w(16,3,o.storeService.SubTotal())))},dependencies:[q],styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};function fd(i,e){if(i&1&&(a(0,"div",6)(1,"div",7)(2,"div"),s(3),r(),a(4,"small",8),s(5),r()(),a(6,"div",9)(7,"span"),s(8),v(9,"number"),r()()()),i&2){let t=e.data;l(3),S(t==null?null:t.Value),l(2),S(t==null?null:t.Code),l(3),S(w(9,3,t==null?null:t.UnitPrice))}}var ci=class i{cartService=h(bt);query=new Se({});#t=h(L);storeService=h(G);skipXHR=!1;spinnerService=h(dr);constructor(){}onBarcodeScan(e){console.log("Scanned barcode:",e),this.cartService.httpRequestVariantByCode(e).pipe().subscribe()}ngOnInit(){this.query.valueChanges.pipe($e("query"),dt(e=>e&&Object.keys(e).length>0),Q(e=>{this.spinnerService.show()}),it(e=>{this.spinnerService.show();let t;if(e.type==="ID")t=this.cartService.httpGetVariantByID(e.str);else if(e.type==="Code")t=this.cartService.httpRequestVariantByCode(e.str);else return hn;return t.pipe(_e(o=>o.status>=400&&o.status<=451?(console.error("Variant not found:",o.message),yn(null)):vn(()=>o)))}),Q(()=>{this.spinnerService.hide()})).subscribe({next:e=>{},error:e=>{this.spinnerService.hide(),console.error("An error occurred:",e)}})}onSelectVariant(e){this.cartService.addItemByVariantID(e)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["adjustment-cart-header"]],decls:7,vars:4,consts:[["itemTemplate",""],[1,"row"],[1,"col"],[1,""],[1,"px-4","py-4"],["inputID","product","requestUrl","/API/AC/GetVariantSuggestionByCodeNNameWithEntityID","prefixIcon","fa fa-barcode","placeholder","Search product by name / code","localStorage","products","notFoundMessageFor","product","data_cy","txt-product",1,"form-control","autocomplete-product",3,"onInputEnter","onSelect","clearOnSelect","useCustomTemplate","itemTemplate","outletId"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"],[1,"ps-4"]],template:function(t,o){if(t&1){let n=x();a(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"autocompleteV2",5),_("onInputEnter",function(y){return p(n),u(o.onBarcodeScan(y))})("onSelect",function(y){return p(n),u(o.onSelectVariant(y))}),r()(),E(5,fd,10,5,"ng-template",null,0,K),r()()()}if(t&2){let n=J(6);l(4),c("clearOnSelect",!0)("useCustomTemplate",!0)("itemTemplate",n)("outletId",o.storeService.Outlet().ID)}},dependencies:[yt,Ro,qt,be,qe,zt,q],styles:["[_nghost-%COMP%] autocompleteV2.autocomplete-product>mat-form-field>input{height:38px!important;border-radius:.375rem}[_nghost-%COMP%] autocompleteV2.autocomplete-product>mat-form-field>div.position-relative>span.prefix-icon{top:10px}"]})};var Bi=class{constructor(e,t,o,n,d,y,D,lt,ot,st,It){this._StateID=e,this._StateLabel=t,this._Success=o,this._Message=n,this._InvoiceID=d,this._OrderID=y,this._InvoiceNumber=D,this._PrintMode=lt,this._DeliveryID=ot,this._PaymentStateID=st,this._PaymentStateLabel=It}_StateID;get StateID(){return this._StateID}set StateID(e){this._StateID=e}_StateLabel;get StateLabel(){return this._StateLabel}set StateLabel(e){this._StateLabel=e}_Success;get Success(){return this._Success}set Success(e){this._Success=e}_Message;get Message(){return this._Message}set Message(e){this._Message=e}_InvoiceID;get InvoiceID(){return this._InvoiceID}set InvoiceID(e){this._InvoiceID=e}_OrderID;get OrderID(){return this._OrderID}set OrderID(e){this._OrderID=e}_InvoiceNumber;get InvoiceNumber(){return this._InvoiceNumber}set InvoiceNumber(e){this._InvoiceNumber=e}_PrintMode;get PrintMode(){return this._PrintMode}set PrintMode(e){this._PrintMode=e}_DeliveryID;get DeliveryID(){return this._DeliveryID}set DeliveryID(e){this._DeliveryID=e}_PaymentStateID;get PaymentStateID(){return this._PaymentStateID}set PaymentStateID(e){this._PaymentStateID=e}_PaymentStateLabel;get PaymentStateLabel(){return this._PaymentStateLabel}set PaymentStateLabel(e){this._PaymentStateLabel=e}toJSON(){return{StateID:this.StateID,StateLabel:this.StateLabel,Success:this.Success,Message:this.Message,InvoiceID:this.InvoiceID,OrderID:this.OrderID,InvoiceNumber:this.InvoiceNumber,PrintMode:this.PrintMode,DeliveryID:this.DeliveryID,PaymentStateID:this.PaymentStateID,PaymentStateLabel:this.PaymentStateLabel}}},ui=class i{adapt(e){return new Bi(e.StateID,e.StateLabel,e.Success,e.Message,e.InvoiceID,e.OrderID,e.InvoiceNumber,e.PrintMode,e.DeliveryID,e.PaymentStateID,e.PaymentStateLabel).toJSON()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var hd=(i,e)=>e.key;function yd(i,e){if(i&1){let t=x();a(0,"div",3),_("click",function(){let n=p(t).$implicit,d=m();return u(d.submit(n.key))}),f(1,"i",4),s(2),r()}if(i&2){let t=e.$implicit;l(),c("ngClass",t.icon),l(),I(" ",t.label," ")}}var _i=class i{constructor(e,t){this.dialogRef=e;this.data=t;this.config=new gt,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0}config;adjustmentState=z([]);onClose(){this.dialogRef.close({role:"close"})}onCancel(){this.dialogRef.close({role:"cancel"})}ngOnInit(){this.adjustmentState.set([{key:1,value:"draft",label:"Draft",icon:"fa-file-pen"},{key:2,value:"submitted",label:"Submit for Review",icon:"fa-user-magnifying-glass"}])}submit(e){this.dialogRef.close({role:"ok",data:e})}static \u0275fac=function(t){return new(t||i)(b(_t),b(Gt))};static \u0275cmp=O({type:i,selectors:[["POS-modal-with-approval"]],decls:5,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid","d-flex","gap-3","justify-content-between",2,"width","500px"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid",3,"ngClass"]],template:function(t,o){t&1&&(a(0,"modal-material",0),_("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),a(1,"content")(2,"div",1),F(3,yd,3,2,"div",2,hd),r()()()),t&2&&(c("config",o.config),l(3),U(o.adjustmentState()))},dependencies:[yt,Ft,ut,Ct],encapsulation:2})};var gi=class i{destroy$=new ft;#t=h(Qt);#e=h(G);#n=h(ui);injector=h(ht);toastr=h(vt);matDialog=h(nt);constructor(){}ngOnInit(){}onProcessOrder(){if(A.IsEmpty(this.#e.Outlet().ID)){this.toastr.error("Please select outlet before proceeding..",et.Error);return}if(this.#e.CartItems().length==0){this.toastr.error("You must have at least one item.",et.Error);return}if(A.IsEmpty(this.#e.Order().Number)){this.toastr.error("Number cannot be empty.",et.Error);return}if(this.#e.Order().TypeID==2){let e=[...this.#e.CartItems()].map(o=>o.VariantID),t=new Set(e);if(e.length!=t.size){this.toastr.error("Count adjustment type doesn't allow the same product/code in different rows. Please check again!","Submit Restricted!");return}}this.#e.AppConfigJSON().ModuleAdjustment.Basic.Workflow==1?this.#t.processOrder().pipe(Dt(this.destroy$)).subscribe({next:e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))},error:e=>{console.log("error",e)}}):(console.log(this.#e.Order().StateID),Pt(this.#e.LoadForm,{injector:this.injector}).pipe(it(e=>!e.Data||e.Data&&e.Data.Order.StateID&&e.Data.Order.StateID==1?this.matDialog.open(_i).afterClosed().pipe(dt(t=>t!=null&&t.role==="ok"),Q(t=>{let o=t.data;this.#t.onUpdateOrderState("StateID",Number(o))}),it(()=>this.#t.processOrder())):this.#t.processOrder()),Q(e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))})).subscribe())}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["adjustment-cart"]],decls:9,vars:0,consts:[[1,"h-100","d-flex","flex-column"],[1,"pt-4"],[1,"row"],[1,"col"],["PinScrollingBottom","",1,"",2,"overflow-y","auto","flex","1 1 0%","max-height","calc(100vh - 170px)"],[1,""],[3,"onProcess"]],template:function(t,o){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),f(4,"adjustment-cart-header"),r()()(),a(5,"div",4),f(6,"adjustment-cart-display"),r(),a(7,"div",5)(8,"adjustment-cart-action",6),_("onProcess",function(){return o.onProcessOrder()}),r()()())},dependencies:[di,mi,ci,ir],encapsulation:2})};function vd(i,e){if(i&1&&(a(0,"div",22)(1,"div",25),s(2),r(),a(3,"div",25),s(4),r()()),i&2){let t=e.$implicit;l(2),S(t.Variant.Name),l(2),S(t.Quantity)}}var Ci=class i{menu$;storeService=h(G);#t=h(Ut);#e=h(rt);#n=h(wn);cartItems;fullContainerEl=document.getElementById("full-container");constructor(){this.#e.setMenu$(),this.menu$=this.#e.menu$.pipe(Ot(e=>R(j({},e),{H:"Inventory Adjustment",T:e.T.replace("undefined","Inventory Adjustment")})),Q(e=>this.#n.setTitle(e.T)))}ngAfterViewInit(){this.fullContainerEl.classList.remove("full-container")}ngOnDestroy(){this.fullContainerEl.classList.add("full-container")}handleF8(){this.onNewAdjustment()}onPrintReceipt(){return fn(this,null,function*(){window.open(`/print/Adjustment?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onGotoAdjustmentDetail(){return fn(this,null,function*(){window.open(`/menu/Adjustment/Adjustment/Archive/Info?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onNewAdjustment(){return fn(this,null,function*(){this.storeService.onChangeCartItems([]),yield this.#t.navigate(["menu/Adjustment/Adjustment/Archive/Form"],{queryParams:{}}),this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeIsComplete(),this.storeService.onChangeCartItems([])})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["adjustment-order-complete"]],hostBindings:function(t,o){t&1&&_("keydown.F8",function(){return o.handleF8()},Ht)},inputs:{cartItems:"cartItems"},decls:37,vars:10,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"order-complete","mt-6"],[1,"container-fluid"],[1,"row"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"fa-solid","fa-check","me-3"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"card-footer"],[1,"d-flex","justify-content-between","py-5"],["target","_blank",1,"btn","bg-light-gray","btn-secondary",3,"click"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],["target","_blank",1,"",2,"cursor","pointer",3,"href"],[1,"card-body"],[1,"row","justify-content-between","mb-3"],[1,"row","justify-content-end","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col-4","text-end"],[1,"col","text-end"]],template:function(t,o){t&1&&(a(0,"mainpanel-cmp",0),v(1,"async"),a(2,"content")(3,"section",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"h1",7),f(10,"i",8),s(11,"Inventory Adjustment Complete "),r()(),a(12,"div",9)(13,"div",10)(14,"div",11)(15,"a",12),_("click",function(){return o.onNewAdjustment()}),s(16," New Adjustment (F8)"),r()()()(),a(17,"div",13)(18,"div",14)(19,"a",15),_("click",function(){return o.onPrintReceipt()}),f(20,"i",16),s(21,"Print Receipt"),r()()()()(),a(22,"div",17)(23,"div",5)(24,"div",18)(25,"h3",19)(26,"a",20),s(27),r()()(),a(28,"div",21),F(29,vd,5,2,"div",22,tt),a(31,"div",23)(32,"div",24),s(33,"Total:"),r(),a(34,"div",24),s(35),v(36,"number"),r()()()()()()()()()()),t&2&&(c("pageData",w(1,6,o.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),l(26),c("href","/menu/Adjustment/Adjustment/Archive/Info?ID="+o.storeService.OrderComplete().OrderID,Oe),l(),I("Adjustment #",o.storeService.OrderComplete().InvoiceNumber),l(2),U(o.cartItems),l(6),I(" ",w(36,8,o.storeService.QtyCartItems())," "))},dependencies:[An,at,On,ke,q],styles:[".print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block;text-align:left}.order-complete[_ngcontent-%COMP%]{display:none}}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.125);padding-bottom:.9375rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:2rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{max-width:500px;margin-top:30px;margin-bottom:30px}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle;line-height:15px!important}"]})};var xd=["qty"];function Sd(i,e){if(i&1&&(a(0,"div",16)(1,"div",17)(2,"div"),s(3),r(),a(4,"small",18),s(5),r()()()),i&2){let t=e.data;l(3),S(t==null?null:t.Value),l(2),S(t==null?null:t.Code)}}var Cn=class i{modalConfig=new gt;cartService=h(bt);cartItem=z(null);query=new Se(null);form;#t=h(_t);unsubscribe$=new ft;#e=h(Ue);quantityRef;focusTimeoutID;ngZone=h(bn);constructor(){this.modalConfig.customWidth="650px",this.modalConfig.title="Add Item"}onOK(){this.#t.close({type:"OK"});let e=this.cartItem();e.Quantity=this.form.get("Quantity").value,e.Price=this.form.get("Price").value,e.Cost=this.form.get("Cost").value,e.Note=this.form.get("Note").value,this.cartService.onAddCartItem(e,!0,e.Quantity)}onChangeNote(e){this.form.get("Note").setValue(e)}onClose(){this.#t.close({type:"close"})}onCancel(){this.#t.close({type:"cancel"})}initForm(){this.form=this.#e.group({Quantity:[""],Price:[""],Cost:[""],Note:[""]})}ngOnInit(){this.initForm(),this.query.valueChanges.pipe(Dt(this.unsubscribe$),it(e=>this.cartService.httpGetVariantByID(e,!1).pipe()),$e("get cart item")).subscribe({next:e=>{this.focusTimeoutID=setTimeout(()=>{this.quantityRef&&this.quantityRef.nativeElement&&(this.quantityRef.nativeElement.focus(),this.quantityRef.nativeElement.select())},0),this.cartItem.set(e),this.form.patchValue({Quantity:e.Quantity,Price:e.Price,Cost:e.Cost,Note:e.Note}),this.modalConfig.title=e.Variant.Name}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete(),this.focusTimeoutID&&clearTimeout(this.focusTimeoutID)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["adjustment-modal-cart-add"]],viewQuery:function(t,o){if(t&1&&Ce(xd,5),t&2){let n;fe(n=he())&&(o.quantityRef=n.first)}},decls:29,vars:6,consts:[["itemTemplate",""],["qty",""],[3,"onCancel","onClose","onOk","config"],[1,"container","w-100","h-100"],[1,"row"],[1,"col-12"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"keyup.enter","formControl","renderThumbnail","useCustomTemplate","itemTemplate"],[3,"formGroup"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["autoNum","","formControlName","Price","type","text",1,"mt-5","form-control",2,"width","100px"],["autoNum","","formControlName","Cost","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"mb-5"],["formControlName","Note","height","220px"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"]],template:function(t,o){if(t&1){let n=x();a(0,"modal-material",2),_("onCancel",function(){return p(n),u(o.onCancel())})("onClose",function(){return p(n),u(o.onCancel())})("onOk",function(){return p(n),u(o.onOK())}),a(1,"content")(2,"div",3)(3,"div",4)(4,"div",5)(5,"autocompleteV2",6),_("keyup.enter",function(y){return p(n),u(y.stopPropagation())}),r(),E(6,Sd,6,2,"ng-template",null,0,K),r()(),a(8,"div",7)(9,"div",8)(10,"div",9)(11,"h5"),s(12,"Qty"),r(),f(13,"input",10,1),r(),a(15,"div",11)(16,"h5"),s(17,"Price"),r(),f(18,"input",12),r(),a(19,"div",11)(20,"h5"),s(21,"Cost"),r(),f(22,"input",13),r()(),At(23),a(24,"div",8)(25,"div",5)(26,"h5",14),s(27,"Note"),r(),f(28,"POS-tinymce-editor",15),r()(),jt(),r()()()()}if(t&2){let n=J(7);c("config",o.modalConfig),l(5),c("formControl",o.query)("renderThumbnail",!0)("useCustomTemplate",!0)("itemTemplate",n),l(3),c("formGroup",o.form)}},dependencies:[He,Lt,qe,zt,ut,Ct,Vo,be,xt,B,Ve,so,Ne,Fe,De,Ke],encapsulation:2})};var xr=wi(Jr());function bd(i,e){if(i&1){let t=x();a(0,"POS-uppy",3),_("onParser",function(n){p(t);let d=m(2);return u(d.onParser(n))})("fileUploaded",function(n){p(t);let d=m(2);return u(d.onUploadCsv(n))})("fileRemoved",function(){p(t);let n=m(2);return u(n.onRemovedFile())}),r()}if(i&2){let t=m(2);c("sampleUrl",t.sampleURL)}}function Id(i,e){if(i&1){let t=x();a(0,"POS-uppy",3),_("onParser",function(n){p(t);let d=m(2);return u(d.onParser(n))})("fileUploaded",function(n){p(t);let d=m(2);return u(d.onUploadCsv(n))})("fileRemoved",function(){p(t);let n=m(2);return u(n.onRemovedFile())}),r()}if(i&2){let t=m(2);c("sampleUrl",t.sampleURL)}}function Dd(i,e){if(i&1&&(g(0,bd,1,1,"POS-uppy",2),g(1,Id,1,1,"POS-uppy",2)),i&2){let t=m();C(t.uploadState()===t.uploadStateEnum.Idle||t.uploadState()===t.uploadStateEnum.Uploading?0:-1),l(),C(t.uploadState()===t.uploadStateEnum.Success||t.uploadState()===t.uploadStateEnum.Error?1:-1)}}var fi=class i{modalConfig;sampleURL;fileInput=z(null);unsubscribe$=new ft;#t=h(_t);#e=h(L);#n=h(G);#i=h(bt);#o=h(ht);cartItem=z([]);skipEmptyLines=!0;rowCount=z(0);rowEmpty=z(0);totalRows=ye(()=>this.rowCount()-this.rowEmpty());file=z(null);uploadState=z(0);uploadStateEnum=Ln;constructor(){this.modalConfig=new gt,this.modalConfig.title="Import Items",this.modalConfig.customWidth="500px",this.sampleURL="https://cdn.dealpos.xyz/web-import-template/ImportItem_Adjustment_TemplateV2.csv"}onOK(){this.uploadState.set(1);let e={EntityID:this.#n.Outlet().ID,CartItems:this.cartItem()};return this.#e.post("/API/Adjustment/UploadCsvV2",e).pipe($e("response"),_e(t=>(t instanceof Pn&&this.uploadState.set(3),[])),Q(t=>{Array.isArray(t)&&t.length>0&&(this.uploadState.set(2),t.map(o=>(delete o?.Discount,delete o?.DiscountAmount,o)).forEach(o=>{this.#i.onAddCartItem(o,!0,o.Quantity)}),this.#t.close())}),xn(1)).subscribe()}onCancel(){this.#t.close()}onClose(){this.#t.close()}assignFile(e){this.fileInput.set(e)}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}ngOnInit(){}onRemovedFile(){this.file.set(null),this.rowCount.set(0),this.rowEmpty.set(0)}onUploadCsv(e){let t;e instanceof Blob&&(t=new File([e],"file.csv",{type:e.type})),e instanceof File&&(t=e),this.file.set(t),xr.default.parse(t,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:o=>{let n=o.split(/\r?\n/).slice(1);return n[n.length-1]===""&&n.pop(),this.rowCount.set(n.length),n.forEach(d=>{d.split(",").every(D=>D==="")&&this.rowEmpty.update(D=>D+=1)}),o},error(o,n){console.log("ERROR",o,n)},complete:(o,n)=>{console.log("COMPLETE",o),this.cartItem.set(o.data),console.log("row count",this.rowCount),console.log("row empy",this.rowEmpty)}})}onParser(e){console.log("row",e),this.cartItem.set(e)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["adjustment-modal-cart-upload"]],decls:3,vars:1,consts:[["modalContent",""],[3,"onOk","onCancel","onClose","config"],[3,"sampleUrl"],[3,"onParser","fileUploaded","fileRemoved","sampleUrl"]],template:function(t,o){if(t&1){let n=x();a(0,"modal-material",1),_("onOk",function(){return p(n),u(o.onOK())})("onCancel",function(){return p(n),u(o.onClose())})("onClose",function(){return p(n),u(o.onClose())}),E(1,Dd,2,2,"ng-template",null,0,K),r()}t&2&&c("config",o.modalConfig)},dependencies:[ut,Ct,Ze],encapsulation:2})};function Td(i,e){if(i&1){let t=x();a(0,"li",11),_("click",function(){let n=p(t).$implicit,d=m(3);return u(d.onClickMenu(n))}),f(1,"POS-dropdown-item-more-action",12),r()}if(i&2){let t=e.$implicit;l(),c("icon",t.icon)("label",t.title)}}function Pd(i,e){if(i&1&&F(0,Td,2,2,"li",10,tt),i&2){let t=m().$implicit;U(t.children)}}function wd(i,e){if(i&1&&(a(0,"div",7)(1,"div",8),s(2),r(),f(3,"div",9),g(4,Pd,2,0),r()),i&2){let t=e.$implicit;l(2),S(t.title),l(2),C(t.children.length>0?4:-1)}}var hi=class i{menu=z([]);#t=h(nt);router=h(Ut);handleF8(){this.#t.openDialogs&&this.#t.openDialogs.length>0||this.#t.open(Cn)}constructor(){}ngOnInit(){this.#e()}#e(){let e=[{title:"Item",icon:"",children:[{title:"Add",value:"add",icon:"fa-circle-plus fa-solid"},{title:"Upload",icon:"fa-solid fa-upload",value:"upload"}]}];this.menu.set(e)}onClickMenu(e){switch(e.value){case"add":this.#t.open(Cn);break;case"upload":this.#t.open(fi);break}}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["adjustment-more-actions"]],hostBindings:function(t,o){t&1&&_("keydown.F4",function(d){return o.handleF8(d)},Ht)},decls:10,vars:0,consts:[["id","moreMenu","data-bs-toggle","dropdown",1,"d-flex","align-items-center","cursor-pointer"],[1,"me-2"],[1,"fa-solid","fa-caret-down","fa-lg"],[1,"fs-6","headings-font-family","pb-1"],[1,"h-100","d-flex","align-items-center","justify-content-between"],["aria-labelledby","moreMenu",1,"dropdown-menu","more-actions",2,"min-width","150px"],[1,"d-flex"],[1,"dropdown-header","text-dark","col"],[1,"h5","mb-4"],[1,"dropdown-divider","m-0"],[1,"cursor-pointer"],[1,"cursor-pointer",3,"click"],[3,"icon","label"]],template:function(t,o){t&1&&(a(0,"span",0)(1,"span",1),f(2,"i",2),r(),a(3,"span",3),s(4,"More Actions"),r()(),a(5,"div",4)(6,"div",5)(7,"div",6),F(8,wd,5,2,"div",7,tt),r()()()),t&2&&(l(8),U(o.menu()))},dependencies:[Xo],encapsulation:2})};var Hi=class{constructor(e,t,o,n){this._Order=e,this._Items=t,this._OrderItems=o,this._CountedItems=n}_Order;get Order(){return this._Order}set Order(e){this._Order=e}_Items;get Items(){return this._Items}set Items(e){this._Items=e}_OrderItems;get OrderItems(){return this._OrderItems}set OrderItems(e){this._OrderItems=e}_CountedItems;get CountedItems(){return this._CountedItems}set CountedItems(e){this._CountedItems=e}},yi=class i{adapt(e){return new Hi(e.Order,e.Items,e.OrderItems,e.CountedItems)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},Wi=class{constructor(e,t,o,n,d,y,D,lt,ot,st,It,Vt,Xt,Yt,te,ee,ne,ie,oe,re,ae,le){this._EntityID=e,this._Number=t,this._Date=o,this._PIC=n,this._Note=d,this._EntityName=y,this._StateID=D,this._StateLabel=lt,this._ReviewDate=ot,this._ReviewerID=st,this._TypeID=It,this._TypeLabel=Vt,this._Quantity=Xt,this._UnitPrice=Yt,this._UnitCost=te,this._TotalPrice=ee,this._AdjustedQuantity=ne,this._CreatorID=ie,this._Created=oe,this._ModifierID=re,this._Modified=ae,this._ID=le}_EntityID;get EntityID(){return this._EntityID}set EntityID(e){this._EntityID=e}_Number;get Number(){return this._Number}set Number(e){this._Number=e}_Date;get Date(){return this._Date}set Date(e){this._Date=e}_PIC;get PIC(){return this._PIC}set PIC(e){this._PIC=e}_Note;get Note(){return this._Note}set Note(e){this._Note=e}_EntityName;get EntityName(){return this._EntityName}set EntityName(e){this._EntityName=e}_StateID;get StateID(){return this._StateID}set StateID(e){this._StateID=e}_StateLabel;get StateLabel(){return this._StateLabel}set StateLabel(e){this._StateLabel=e}_ReviewDate;get ReviewDate(){return this._ReviewDate}set ReviewDate(e){this._ReviewDate=e}_ReviewerID;get ReviewerID(){return this._ReviewerID}set ReviewerID(e){this._ReviewerID=e}_TypeID;get TypeID(){return this._TypeID}set TypeID(e){this._TypeID=e}_TypeLabel;get TypeLabel(){return this._TypeLabel}set TypeLabel(e){this._TypeLabel=e}_Quantity;get Quantity(){return this._Quantity}set Quantity(e){this._Quantity=e}_UnitPrice;get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}_UnitCost;get UnitCost(){return this._UnitCost}set UnitCost(e){this._UnitCost=e}_TotalPrice;get TotalPrice(){return this._TotalPrice}set TotalPrice(e){this._TotalPrice=e}_AdjustedQuantity;get AdjustedQuantity(){return this._AdjustedQuantity}set AdjustedQuantity(e){this._AdjustedQuantity=e}_CreatorID;get CreatorID(){return this._CreatorID}set CreatorID(e){this._CreatorID=e}_Created;get Created(){return this._Created}set Created(e){this._Created=e}_ModifierID;get ModifierID(){return this._ModifierID}set ModifierID(e){this._ModifierID=e}_Modified;get Modified(){return this._Modified}set Modified(e){this._Modified=e}_ID;get ID(){return this._ID}set ID(e){this._ID=e}},Sr=class i{adapt(e){return new Wi(e.EntityID,e.Number,e.Date,e.PIC,e.Note,e.EntityName,e.StateID,e.StateLabel,e.ReviewDate,e.ReviewerID,e.TypeID,e.TypeLabel,e.Quantity,e.UnitPrice,e.UnitCost,e.TotalPrice,e.AdjustedQuantity,e.CreatorID,e.Created,e.ModifierID,e.Modified,e.ID)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},qi=class{constructor(e,t,o,n,d,y,D,lt,ot,st,It,Vt){this._LostNFoundID=e,this._UnitCost=t,this._InventoryTypeID=o,this._UnitPrice=n,this._Discount=d,this._VariantID=y,this._Note=D,this._Quantity=lt,this._UnitQuantity=ot,this._Index=st,this._Serial=It,this._ID=Vt}_LostNFoundID;get LostNFoundID(){return this._LostNFoundID}set LostNFoundID(e){this._LostNFoundID=e}_UnitCost;get UnitCost(){return this._UnitCost}set UnitCost(e){this._UnitCost=e}_InventoryTypeID;get InventoryTypeID(){return this._InventoryTypeID}set InventoryTypeID(e){this._InventoryTypeID=e}_UnitPrice;get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}_Discount;get Discount(){return this._Discount}set Discount(e){this._Discount=e}_VariantID;get VariantID(){return this._VariantID}set VariantID(e){this._VariantID=e}_Note;get Note(){return this._Note}set Note(e){this._Note=e}_Quantity;get Quantity(){return this._Quantity}set Quantity(e){this._Quantity=e}_UnitQuantity;get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(e){this._UnitQuantity=e}_Index;get Index(){return this._Index}set Index(e){this._Index=e}_Serial;get Serial(){return this._Serial}set Serial(e){this._Serial=e}_ID;get ID(){return this._ID}set ID(e){this._ID=e}},br=class i{adapt(e){return new qi(e.LostNFoundID,e.UnitCost,e.InventoryTypeID,e.UnitPrice,e.Discount,e.VariantID,e.Note,e.Quantity,e.UnitQuantity,e.Index,e.Serial,e.ID)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},Gi=class{constructor(e,t,o,n,d,y,D,lt,ot,st,It,Vt){this._ParentID=e,this._Start=t,this._Finish=o,this._UnitPrice=n,this._UnitCost=d,this._VariantID=y,this._Note=D,this._Quantity=lt,this._UnitQuantity=ot,this._Index=st,this._Serial=It,this._ID=Vt}_ParentID;get ParentID(){return this._ParentID}set ParentID(e){this._ParentID=e}_Start;get Start(){return this._Start}set Start(e){this._Start=e}_Finish;get Finish(){return this._Finish}set Finish(e){this._Finish=e}_UnitPrice;get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}_UnitCost;get UnitCost(){return this._UnitCost}set UnitCost(e){this._UnitCost=e}_VariantID;get VariantID(){return this._VariantID}set VariantID(e){this._VariantID=e}_Note;get Note(){return this._Note}set Note(e){this._Note=e}_Quantity;get Quantity(){return this._Quantity}set Quantity(e){this._Quantity=e}_UnitQuantity;get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(e){this._UnitQuantity=e}_Index;get Index(){return this._Index}set Index(e){this._Index=e}_Serial;get Serial(){return this._Serial}set Serial(e){this._Serial=e}_ID;get ID(){return this._ID}set ID(e){this._ID=e}},Ir=class i{adapt(e){return new Gi(e.ParentID,e.Start,e.Finish,e.UnitPrice,e.UnitCost,e.VariantID,e.Note,e.Quantity,e.UnitQuantity,e.Index,e.Serial,e.ID)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Dr=wi(jo());function Md(i,e){if(i&1&&f(0,"adjustment-order-complete",0),i&2){let t=m();c("cartItems",t.storeService.CartItems())}}function Ed(i,e){if(i&1){let t=x();a(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"POS-select-outlet-form",6),v(6,"async"),_("ngModelChange",function(n){p(t);let d=m();return u(d.storeService.onChangeOutlet(n))}),r(),a(7,"POS-invoice-number-form",7),v(8,"async"),_("ngModelChange",function(n){p(t);let d=m();return u(d.onInvoiceNumberChange(n))}),r()(),a(9,"POS-invoice-date",8),_("ngModelChange",function(n){p(t);let d=m();return u(d.onChangeOrderDate(n))}),r()()(),a(10,"div",9)(11,"div",10)(12,"div",11),f(13,"adjustment-more-actions"),r(),a(14,"div",12),f(15,"i",13),a(16,"ng-select",14),_("ngModelChange",function(n){p(t);let d=m();return u(d.onChangeAdjustmentType(n))}),r()()()()(),a(17,"div",15)(18,"div",16)(19,"POS-quick-key",17),_("onSelectVariant",function(n){p(t);let d=m();return u(d.onSelectVariant(n))}),r()(),a(20,"div",18),f(21,"adjustment-cart"),r()()()}if(i&2){let t=m();l(5),c("disabled",t.storeService.AdjustmentState()===1)("isOpenAfterLoad",w(6,16,t.isOpenDiaglog$))("outlets",t.storeService.Outlets())("ngModel",t.storeService.Outlet()),l(2),c("ngModel",t.storeService.Order().Number)("transactionType",w(8,18,t.transactionType$))("disabled",!(t.roleService.global!=null&&t.roleService.global.Number)),l(2),c("ngModel",t.storeService.Order().Date)("disabled",!(t.roleService.global!=null&&t.roleService.global.Date))("tooltip",t.roleService.global!=null&&t.roleService.global.Date?"":"Date role is required"),l(7),c("clearable",!1)("ngModel",t.storeService.Order().TypeID)("disabled",!!t.storeService.Order().TypeID&&t.storeService.AdjustmentState()===1)("items",t.storeService.AdjustmentTypes()),l(3),c("quickKey",t.storeService.QuickeyItems())("outletID",t.storeService.Outlet().ID)}}var vi=class i{isOpenDialog=z(!0);loadFormService=h(tn);intercom=h(mo);storeService=h(G);quickeyService=h(ri);cartService=h(bt);orderService=h(Qt);isOpenDiaglog$;Outlets$;loadForm$;adjustmentEditDataAdapter=h(yi);roleService=h(H);#t=h(Zt);#e=h(en);#n=h(xe);transactionType$=this.#n.queryParamMap.pipe(Ot(e=>(e.has("ID"),"Adjustment")));title=h(wn);injector=h(ht);test=[];ngOnInit(){this.storeService.onResetState(),this.intercom.hideLauncher();let e=JSON.parse(localStorage.getItem("AccountInfo"));this.title.setTitle(e.BrandName+" POS | Inventory Adjustment"),this.test=this.storeService.Outlets()&&this.storeService.Outlets().filter((t,o)=>o===0),this.#n.queryParamMap.pipe(it(t=>{if(t.has("ID")){this.storeService.onChangeAdjustmentState(1);let o={EntityID:"00000000-0000-0000-0000-000000000000",ID:t.get("ID")};return this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeAdjustmentState(1),this.loadFormService.httpRequestLoadForm$(o).pipe(Q(n=>{if(n.Data&&Object.keys(n.Data).length>0&&Object.keys(this.storeService.LoadForm().Data).length>0){this.orderService.onUpdateOrderState("Number",n.Data.Order.Number),this.orderService.onUpdateOrderState("Date",new Date(n.Data.Order.Date)),this.orderService.onUpdateOrderState("StateID",n.Data.Order.StateID),this.orderService.onUpdateOrderState("TypeID",n.Data.Order.TypeID),this.orderService.onUpdateOrderState("EntityID",n.Data.Order.EntityID);let d=n.Data.Items.map(y=>this.#t.adapt(R(j({},y),{Variant:this.#e.adapt(y.Variant)})));if(this.storeService.onChangeCartItems(d),this.orderService.onUpdateOrderState("PIC",n.Data.Order.PIC),this.orderService.onUpdateOrderState("Note",n.Data.Order.Note),this.orderService.onUpdateOrderState("TagID",n.Data.Order.TagID),n.Entities.length>0){let y=n.Entities.findIndex(D=>D.ID===n.Data.Order.EntityID);y!==-1&&this.storeService.onChangeOutlet(n.Entities[y])}}}))}return this.storeService.onChangeAdjustmentState(0),this.loadFormService.httpRequestLoadForm$()})).subscribe({}),Pt(this.storeService.IsOpenDialog,{injector:this.injector}).pipe().subscribe(),this.isOpenDiaglog$=Pt(this.storeService.IsOpenDialog,{injector:this.injector})}onChangeAdjustmentType(e){let t=this.storeService.AdjustmentTypes().filter(o=>o.Key===e)[0];this.orderService.onUpdateOrderState("TypeID",t.Key)}onInvoiceNumberChange(e){this.orderService.onUpdateOrderState("Number",e)}onChangeOrderDate(e){this.orderService.onUpdateOrderState("Date",(0,Dr.default)(e).startOf("day").format("YYYY-MM-DDTHH:mm:ss.SSS"))}onSelectVariant(e){this.cartService.addItemByVariantID(e)}ngOnDestroy(){this.storeService.onResetState(),this.intercom.showLauncher()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["POS-adjustment-v2"]],decls:2,vars:1,consts:[[3,"cartItems"],[1,"container-fluid","overflow-x-hidden"],[1,"row","header","border-bottom"],[1,"col-5","border-end"],[1,"left-toolbar-container","h-100","d-flex","align-items-center","justify-content-between"],[1,"d-flex","flex-column"],[3,"ngModelChange","disabled","isOpenAfterLoad","outlets","ngModel"],[3,"ngModelChange","ngModel","transactionType","disabled"],[3,"ngModelChange","ngModel","disabled","tooltip"],[1,"col-7","d-flex","align-items-center"],[1,"row","flex-grow-1"],[1,"col-4","d-flex","align-items-center"],[1,"col","ps-0","d-flex","align-items-center","justify-content-end","gap-1"],[1,"fa-regular","fa-sliders"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",1,"",3,"ngModelChange","clearable","ngModel","disabled","items"],[1,"row","content"],[1,"col-5","border-end",2,"height","inherit"],[3,"onSelectVariant","quickKey","outletID"],[1,"col-7",2,"height","calc(100% - 0)","padding","0"]],template:function(t,o){t&1&&g(0,Md,1,1,"adjustment-order-complete",0)(1,Ed,22,20,"div",1),t&2&&C(o.storeService.IsComplete()?0:1)},dependencies:[Fo,Go,zo,qo,qt,B,X,pt,gi,Ci,hi,ke],styles:[".left-toolbar-container[_ngcontent-%COMP%]{position:relative}.left-toolbar-container[_ngcontent-%COMP%] POS-invoice-number-form[_ngcontent-%COMP%]{position:absolute;top:34px;left:32px}.header[_ngcontent-%COMP%]{min-height:60px}.content[_ngcontent-%COMP%]{height:calc(100vh - 60px);overflow:hidden}.supplier-more-menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.cart-display[_ngcontent-%COMP%]{flex-grow:1;height:0px;overflow-y:auto}input[_ngcontent-%COMP%]{width:100%;height:38px!important;border:0;border-bottom:1px solid #ced4da;padding-left:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i[_ngcontent-%COMP%]{font-size:16px;top:10.6px;left:13px}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]{transition:.4s}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(1){-webkit-transform:rotate(-45deg) translate(-8px,4px);transform:rotate(-45deg) translate(-8px,4px)}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(2){opacity:0}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(45deg) translate(-5px,0px);transform:rotate(45deg) translate(-5px)}.mobile-button[_ngcontent-%COMP%]{display:none}@media (max-width: 990px){.mobile-button[_ngcontent-%COMP%]{display:block}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.more-actions[_ngcontent-%COMP%] div.d-flex[_ngcontent-%COMP%]{width:30rem}[_nghost-%COMP%] .ng-select .ng-select-container{border:none}"]})};var Od=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Ad=i=>({ID:i});function jd(i,e){if(i&1){let t=x();a(0,"button",10),_("click",function(){p(t);let n=m(2);return u(n.openExportModal())}),f(1,"i",11),s(2," Export "),r()}}function kd(i,e){if(i&1){let t=x();a(0,"div")(1,"div",12)(2,"h6"),s(3,"Variant"),r(),a(4,"autocompleteV2",13),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.ID,n)||(d.pageData.Filter.ID=n),u(n)}),r(),a(5,"h6"),s(6,"Outlet"),r(),a(7,"ng-select",14),P("ngModelChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.EntityID,n)||(d.pageData.Filter.EntityID=n),u(n)}),r(),a(8,"h6"),s(9,"From"),r(),a(10,"datepicker",15),P("dateChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.From,n)||(d.pageData.Filter.From=n),u(n)}),r(),a(11,"h6"),s(12,"To"),r(),a(13,"datepicker",16),P("dateChange",function(n){p(t);let d=m(2);return T(d.pageData.Filter.To,n)||(d.pageData.Filter.To=n),u(n)}),r()()()}if(i&2){let t=m(2);l(4),M("ngModel",t.pageData.Filter.ID),c("inputTextValue",t.pageData.Filter.VariantName),l(3),c("items",t.pageData.Options.Entities),M("ngModel",t.pageData.Filter.EntityID),l(3),c("isFloatingLabel",!1),M("date",t.pageData.Filter.From),l(3),c("isFloatingLabel",!1),M("date",t.pageData.Filter.To)}}function Vd(i,e){i&1&&(a(0,"th"),s(1,"Variant"),r())}function Nd(i,e){if(i&1&&(a(0,"td"),s(1),r()),i&2){let t=m().$implicit;l(),S(t.Name)}}function Fd(i,e){if(i&1&&(a(0,"tr",8),g(1,Nd,2,1,"td"),v(2,"async"),a(3,"td"),s(4),r(),a(5,"td")(6,"a",17),s(7),r()(),a(8,"td"),s(9),v(10,"number"),r(),a(11,"td"),s(12),v(13,"date"),r()()),i&2){let t=e.$implicit,o=m(2);l(),C(w(2,7,o.isRedirect$)?-1:1),l(3),S(t.EntityName),l(2),c("routerLink",Z(14,Od))("queryParams",V(15,Ad,t.ID)),l(),S(t.Number),l(2),S(w(10,9,t.Quantity)),l(3),S(k(13,11,t.Date,"dd/MM/yy"))}}function Ud(i,e){if(i&1){let t=x();a(0,"mainpanel-cmp",2),P("textChange",function(n){p(t);let d=m();return T(d.pageData.Filter.Number,n)||(d.pageData.Filter.Number=n),u(n)}),_("onSubmit",function(){p(t);let n=m();return u(n.searchFromPageOne())}),P("filterChange",function(n){p(t);let d=m();return T(d.pageData.Filter,n)||(d.pageData.Filter=n),u(n)}),a(1,"actions"),g(2,jd,3,0,"button",3),r(),a(3,"filters"),E(4,kd,14,8,"ng-template",null,0,K),r(),a(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr"),g(12,Vd,2,0,"th"),v(13,"async"),a(14,"th"),s(15,"Outlet"),r(),a(16,"th"),s(17,"Number"),r(),a(18,"th"),s(19,"Quantity"),r(),a(20,"th"),s(21,"Date"),r()()(),a(22,"tbody"),F(23,Fd,14,17,"tr",8,tt),r()()(),a(25,"POS-complex-pagination",9),_("jumpToPage",function(){p(t);let n=m();return u(n.getListData())})("previousPage",function(){p(t);let n=m();return u(n.getListData())})("nextPage",function(){p(t);let n=m();return u(n.getListData())}),r()()()()}if(i&2){let t=m();c("pageData",t.menuData),M("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),M("filter",t.pageData.Filter),l(2),C(t.roleService.global.Export?2:-1),l(10),C(w(13,8,t.isRedirect$)?-1:12),l(11),U(t.data.Data),l(2),c("total",t.data.Data==null?null:t.data.Data.length)("pageData",t.pageData)}}var xi=class i extends St{constructor(t,o,n,d,y){super(t,o,"catalog/product/GetAdjustmentHistory","catalog/productLoader/GetAdjustmentHistoryLoader",null,n);this.matDialog=d;this.roleService=y;this.isRedirect$=yn(this.route.snapshot.queryParamMap).pipe(Ot(D=>D.has("ID")),xn(1))}isRedirect$;openExportModal(){this.matDialog.open(Rt,{data:{title:"Adjustment History",exportTypes:[{ID:"ProductExport/GetAdjustmentHistory",Value:"Default",FileName:"Adjustment History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"catalog/product/GetCountAdjustmentHistory",pagination:!0}})}static \u0275fac=function(o){return new(o||i)(b(rt),b(L),b(xe),b(nt),b(H))};static \u0275cmp=O({type:i,selectors:[["POS-history-variant"]],standalone:!1,features:[mt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border-bottom"],["api","catalog/product/GetCountAdjustmentHistory",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"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Variant","inputID","ID","notFoundMessageFor","variant",1,"form-control","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModelChange","items","ngModel"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],["target","_blank",3,"routerLink","queryParams"]],template:function(o,n){o&1&&g(0,Ud,26,10,"mainpanel-cmp",1),o&2&&C(n.data?0:-1)},dependencies:[ct,at,B,X,ze,pt,zt,Kt,ke,q,Wt],encapsulation:2})};function Ld(i,e){if(i&1){let t=x();a(0,"div",3)(1,"h6",1),s(2,"Category"),r(),a(3,"POS-product-category-select",10),P("selectedCategoryIDChange",function(n){p(t);let d=m();return T(d.categoryId,n)||(d.categoryId=n),u(n)}),_("selectedCategoryIDChange",function(){p(t);let n=m();return u(n.toggleTotalRows=!1)}),r()(),a(4,"div",3)(5,"h6",1),s(6,"Supplier"),r(),a(7,"autocompleteV2",11),P("ngModelChange",function(n){p(t);let d=m();return T(d.supplierID,n)||(d.supplierID=n),u(n)}),_("ngModelChange",function(){p(t);let n=m();return u(n.toggleTotalRows=!1)}),r()(),a(8,"div",3)(9,"h6"),s(10,"Brand"),r(),a(11,"ng-select",12),P("ngModelChange",function(n){p(t);let d=m();return T(d.loader.Filter.BrandID,n)||(d.loader.Filter.BrandID=n),u(n)}),_("ngModelChange",function(){p(t);let n=m();return u(n.toggleTotalRows=!1)}),r()()}if(i&2){let t=m();l(3),M("selectedCategoryID",t.categoryId),c("showClear",!0)("continuedCategoriesOnly",!0),l(4),M("ngModel",t.supplierID),l(4),c("items",t.loader.Options==null?null:t.loader.Options.BrandOptions),M("ngModel",t.loader.Filter.BrandID)}}function Rd(i,e){if(i&1){let t=x();a(0,"span",13),_("click",function(){p(t);let n=m();return u(n.getTotalRows())}),f(1,"i",14),r()}}function Qd(i,e){if(i&1&&(a(0,"span"),s(1),v(2,"number"),r()),i&2){let t=m();l(),I("",w(2,1,t.totalRows)," rows")}}var Si=class i{constructor(e,t,o){this.dialogRef=e;this.http=o;this.configModal=new gt,this.configModal.title="Download Template",this.configModal.customWidth="400px",this.configModal.hideScrollbar=!0,this.configModal.okText="Download",this.loader=t.loader,this.outletId=t.outletID}toggleTotalRows=!1;totalRows=0;exportFormat="CSV";configModal;onHandInventory=!0;stockCount="0";categoryId=null;supplierID=null;outletId="";loader;stockCountOptions=[{Key:"0",Value:"Full Count"},{Key:"1",Value:"Partial Count"}];exportFormatOptions=[{Key:"CSV",Value:"CSV"},{Key:"XLSX",Value:"XLSX"}];close(){this.dialogRef.close()}confirm(){this.dialogRef.close({IncludeZeroOnHand:this.onHandInventory,CategoryID:this.stockCount==="1"?this.categoryId:null,From:this.loader?.Filter.From,To:this.loader?.Filter.To,FormatType:this.exportFormat=="CSV"?0:this.exportFormat=="XLSX"?1:2,SupplierID:this.stockCount==="1"?this.supplierID:null,BrandID:this.stockCount==="1"?this.loader?.Filter.BrandID:null})}getTotalRows(){this.http.post("/api/InventoryExport/GetStockTakeSpreadsheetV2Count",{OutletID:this.outletId,IncludeZeroOnHand:this.onHandInventory,CategoryID:this.stockCount==="1"?this.categoryId:null,SupplierID:this.stockCount==="1"?this.supplierID:null,From:this.loader?.Filter.From,To:this.loader?.Filter.To,BrandID:this.stockCount==="1"?this.loader?.Filter.BrandID:null}).subscribe(e=>{this.totalRows=e.Count,this.toggleTotalRows=!0})}static \u0275fac=function(t){return new(t||i)(b(_t),b(Gt),b(L))};static \u0275cmp=O({type:i,selectors:[["POS-dialog-download-template"]],standalone:!1,decls:21,vars:9,consts:[[3,"onOk","onCancel","onClose","config"],[1,"mb-4"],["name","onHandInventory",3,"modelChange","model"],[1,"mt-5"],["name","stockCount",3,"modelChange","model","options"],["name","exportFormat",3,"modelChange","model","options"],[1,"col-12","mt-8"],[1,"p-3",2,"background-color","#add8e6","border-radius","4px"],[1,"fa-solid","fa-circle-exclamation","mx-3"],[2,"cursor","pointer"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear","continuedCategoriesOnly"],["requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose...","appendTo","body",3,"ngModelChange","items","ngModel"],[2,"cursor","pointer",3,"click"],[1,"fa-solid","fa-circle-question","mt-1",2,"font-size","14px"]],template:function(t,o){t&1&&(a(0,"modal-material",0),_("onOk",function(){return o.confirm()})("onCancel",function(){return o.close()})("onClose",function(){return o.close()}),a(1,"content")(2,"div")(3,"h6",1),s(4,"On Hand Inventory < 1"),r(),a(5,"radio-options",2),P("modelChange",function(d){return T(o.onHandInventory,d)||(o.onHandInventory=d),d}),_("modelChange",function(){return o.toggleTotalRows=!1}),r()(),a(6,"div",3)(7,"h6",1),s(8,"Stock Count"),r(),a(9,"radio-options",4),P("modelChange",function(d){return T(o.stockCount,d)||(o.stockCount=d),d}),_("modelChange",function(){return o.toggleTotalRows=!1}),r()(),g(10,Ld,12,6),a(11,"div",3)(12,"h6",1),s(13,"Format"),r(),a(14,"radio-options",5),P("modelChange",function(d){return T(o.exportFormat,d)||(o.exportFormat=d),d}),_("modelChange",function(){return o.toggleTotalRows=!1}),r()(),a(15,"div",6)(16,"div",7),f(17,"i",8),s(18," Exporting data from "),g(19,Rd,2,0,"span",9),g(20,Qd,3,3,"span"),r()()()()),t&2&&(c("config",o.configModal),l(5),M("model",o.onHandInventory),l(4),M("model",o.stockCount),c("options",o.stockCountOptions),l(),C(o.stockCount=="1"?10:-1),l(4),M("model",o.exportFormat),c("options",o.exportFormatOptions),l(5),C(o.toggleTotalRows?-1:19),l(),C(o.toggleTotalRows?20:-1))},dependencies:[B,X,pt,zt,Ct,jn,$t,q],encapsulation:2})};var Bd=i=>({"text-danger":i}),Hd=()=>["/menu/Products/Catalog/Variants/Info"],Wd=i=>({ID:i});function qd(i,e){if(i&1){let t=x();a(0,"button",38),_("click",function(){p(t);let n=m(),d=J(8);return u(n.onPreview(d))}),s(1," Next "),r()}}function Gd(i,e){if(i&1){let t=x();a(0,"button",39),_("click",function(){p(t);let n=m(),d=J(8);return d.selected.completed=!0,n.fileImport=null,d.previous(),u(n.uploadState.set(n.uploadStateEnum.Uploading))}),s(1," Back "),r(),a(2,"button",40),_("click",function(){p(t);let n=m(),d=J(8);return u(n.upload(d))}),s(3," Next "),r()}if(i&2){let t=m();l(2),c("disabled",!t.canProceedPreview)}}function zd(i,e){if(i&1){let t=x();a(0,"button",38),_("click",function(){p(t);let n=m(),d=J(8);return u(n.newUpload(d))}),s(1,"New"),r()}}function $d(i,e){if(i&1&&s(0),i&2){let t=e.index;S(t+1)}}function Kd(i,e){i&1&&(f(0,"i",41),s(1,"Upload"))}function Jd(i,e){if(i&1&&(a(0,"div",42),s(1),v(2,"limitText"),r()),i&2){let t=e.item;c("title",(t==null||t.Name==null?null:t.Name.length)>23?t.Name:""),l(),I(" ",k(2,2,t.Name,25)," ")}}function Zd(i,e){if(i&1){let t=x();a(0,"div",16)(1,"button",43),_("click",function(){p(t);let n=m();return u(n.openDownloadTemplateDialog())}),f(2,"i",44),s(3," Download Template "),r()()}}function Xd(i,e){if(i&1){let t=x();a(0,"POS-uppy",45),_("fileUploaded",function(n){p(t);let d=m();return u(d.onUploadCsv(n))}),r()}if(i&2){let t=m();c("dashboardPropsConfiguration",t.dashboardPropsConfiguration)("subtitle","Accepted file formats: .csv & max file size: 1 MB")}}function Yd(i,e){if(i&1){let t=x();a(0,"POS-uppy",45),_("fileUploaded",function(n){p(t);let d=m();return u(d.onUploadCsv(n))}),r()}if(i&2){let t=m();c("dashboardPropsConfiguration",t.dashboardPropsConfiguration)("subtitle","Accepted file formats: .csv & max file size: 1 MB")}}function tm(i,e){i&1&&(f(0,"i",46),s(1,"Preview"))}function em(i,e){i&1&&(a(0,"th",31),s(1," Difference "),r())}function nm(i,e){i&1&&(a(0,"th",32),s(1," Cost "),r())}function im(i,e){i&1&&(a(0,"th"),s(1," Message "),r())}function om(i,e){if(i&1&&(a(0,"a",49),s(1),r()),i&2){let t=m().$implicit;c("routerLink",Z(3,Hd))("queryParams",V(4,Wd,t.VariantID)),l(),S(t.VariantName)}}function rm(i,e){if(i&1&&(a(0,"span",50),s(1),r()),i&2){let t=m().$implicit;l(),S(t.VariantName)}}function am(i,e){if(i&1&&(a(0,"td"),s(1),r()),i&2){let t=m().$implicit;Nt("text-danger",t.Differences<0)("text-success",t.Differences>0),l(),I(" ",t.Differences," ")}}function lm(i,e){if(i&1&&(a(0,"td"),s(1),v(2,"number"),r()),i&2){let t=m().$implicit;Nt("text-danger",t.CostChange<0)("text-success",t.CostChange>0),l(),I(" ",w(2,5,t.CostChange)," ")}}function sm(i,e){if(i&1&&(a(0,"div"),s(1),r()),i&2){let t=e.$implicit;l(),de(" ",t.Issue," ",t.Solution," ")}}function dm(i,e){if(i&1&&(a(0,"td"),F(1,sm,2,2,"div",null,tt),r()),i&2){let t=m().$implicit;Nt("bg-gradient-danger",t.Issues==null?null:t.Issues.length),l(),U(t.Issues)}}function mm(i,e){if(i&1&&(a(0,"tr")(1,"td"),s(2),r(),a(3,"td",47),s(4),r(),a(5,"td",48),g(6,om,2,6,"a",49),g(7,rm,2,1,"span",50),r(),a(8,"td",48),s(9),r(),a(10,"td",48),s(11),r(),a(12,"td"),s(13),r(),g(14,am,2,5,"td",51),g(15,lm,3,7,"td",51),g(16,dm,3,2,"td",52),r()),i&2){let t=e.$implicit,o=e.$index,n=m();l(2),S(o+1+"."),l(),c("ngClass",V(11,Bd,!t.VariantCode)),l(),I(" ",t.ProductName," "),l(2),C(t.VariantID?6:-1),l(),C(t.VariantID?-1:7),l(2),I(" ",t.VariantCode," "),l(2),I(" ",t.Expected," "),l(2),I(" ",t.Counted," "),l(),C(n.importedDataState!="matched"?14:-1),l(),C(n.role.product.Cost&&n.importedDataState=="unmatched"?15:-1),l(),C(n.importedDataState=="error"||n.importedDataState=="all"?16:-1)}}function cm(i,e){i&1&&(f(0,"i",53),s(1,"Finish"))}var bi=class i extends St{constructor(t,o,n,d,y,D,lt,ot){super(t,o,null,"Outlet/GetByUserAccessWrite");this.toastr=n;this.csvConverter=d;this.router=y;this.importService=D;this.roleService=lt;this.matDialog=ot;this.formData={},this.opNames=[],o.get("/api/AdjustmentLoader/ImportAdjustmentV2Loader").subscribe(st=>{this.loader=st,console.log(this.loader)})}loader=null;importedDataState="unmatched";selectedTabIndex=0;sampleUrl="https://res.cloudinary.com/pos/raw/upload/v1724644913/POS/CSV/Products_DealPOS4.csv";state="upload";dashboardPropsConfiguration={width:600};fileImport;role=h(H);exp=h(En);cacheKey="";canProceedPreview=!1;importedData=[];summary=["Category","Product","Variant"];summaryData={};uploaded=!1;importHttpResponse=[];isPreviewState=!1;isSuccessState=!1;msgSuccessImport;isDisabledImportBtn=!1;originalData=[];formData;opNames;outletName;uploadState=z(0);uploadStateEnum=Ln;preInitList(){this.formData.EntityID=this.pageData.Entities[0].ID,this.outletName=this.pageData.Entities[0].Name,this.formData.ProductWithoutInventory="1"}getEntityName(t){this.outletName=t.Name}onPreview(t){this.uploadState.set(1),this.selectedTabIndex=0,this.importedDataState="unmatched";let o=this.importService.generateFormData(this.fileImport,null);this.importService.previewImport(`/api/Adjustment/ImportAdjustmentV2Preview?outletID=${this.formData.EntityID}`,o).pipe(_e(n=>(n instanceof Pn&&(this.uploadState.set(3),this.state="upload",console.error("Error during import preview:",n)),vn(()=>n)))).subscribe(n=>{t.selected.completed=!0,t.next(),this.cacheKey=n.CacheKey,this.canProceedPreview=n.CanProceed,this.importedData=n.DataRow,this.summaryData=n.Summary,this.importedData.filter(d=>d.Action=="Error").length>0?(this.importedDataState="error",this.selectedTabIndex=3):this.importedData.filter(d=>d.Action=="Update").length==0&&(this.importedDataState="matched",this.selectedTabIndex=1),this.initIsDisabledImport(),this.uploadState.set(2)})}initIsDisabledImport(){let t=JSON.stringify(this.importHttpResponse).toLowerCase().includes('"statusid":2');this.isDisabledImportBtn=t}alertConfirmInventory(){return!(this.formData.InventoryUpdate&&!confirm("Update Inventory is YES. This is will replace current inventory. Do you want to proceed?"))}onImportFileChange(t){this.fileImport=t,this.isPreviewState=!1}onNewImport(){this.isSuccessState=!1}onUploadCsv(t){this.fileImport=t}selectionChange(t){let o=t.selectedStep.label;this.state=o}postInit(t){this.originalData=t.Data}upload(t){this.httpService.post(`/api/Adjustment/ImportAdjustmentV2Confirm?outletID=${this.formData.EntityID}`,{CacheKey:this.cacheKey}).subscribe(o=>{t.selected.completed=!0,this.toastr.success(o.Message,et.Success),t.next(),this.uploaded=!0})}newUpload(t){t.reset(),this.uploaded=!1,this.state="upload",this.fileImport=null,this.cacheKey="",this.canProceedPreview=!1,this.importedData=[],this.summaryData={},this.uploadState.set(0)}downloadData(t){t==0?this.exp.exportCSV("InventoryExport/GetStockTakeSpreadsheet",this.formData):this.exp.exportXlsx("InventoryExport/GetStockTakeSpreadsheet",this.formData)}sortData(t){let o=this.importedData.slice();if(!t.active||t.direction===""){this.importedData=this.originalData;return}this.importedData=o.sort((n,d)=>{let y=t.direction==="asc",D=typeof n[t.active];switch(A.IsEmpty(n.Code)&&(n.Code=""),A.IsEmpty(d.Code)&&(d.Code=""),D){case"string":return A.compare(n[t.active].toLocaleLowerCase(),d[t.active].toLocaleLowerCase(),y);case"number":return A.compare(n[t.active],d[t.active],y);default:return 0}})}get filteredData(){return this.importedDataState==="all"?this.importedData:this.importedDataState==="matched"?this.importedData.filter(t=>t.Action=="Unchanged"):this.importedDataState==="unmatched"?this.importedData.filter(t=>t.Action=="Update"):this.importedDataState==="error"?this.importedData.filter(t=>t.Action=="Error"):this.importedData}openDownloadTemplateDialog(){this.matDialog.open(Si,{data:{loader:this.loader,outletID:this.formData.EntityID}}).afterClosed().pipe(dt(t=>A.IsNotEmpty(t))).subscribe(t=>{this.exp.exportCSV("InventoryExport/GetStockTakeSpreadsheetV2",{OutletID:this.formData.EntityID,IncludeZeroOnHand:t.IncludeZeroOnHand,CategoryID:t.CategoryID,From:t.From,To:t.To,FormatType:t.FormatType,SupplierID:t.SupplierID,BrandID:t.BrandID})})}onTabChange(t){t==0?this.importedDataState="unmatched":t==1?this.importedDataState="matched":t==2?this.importedDataState="all":t==3&&(this.importedDataState="error")}static \u0275fac=function(o){return new(o||i)(b(rt),b(L),b(vt),b(kt),b(Ut),b(nr),b(H),b(nt))};static \u0275cmp=O({type:i,selectors:[["POS-csv-stock-take-v2"]],standalone:!1,features:[mt],decls:71,vars:32,consts:[["stepper",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success"],["orientation","horizontal",3,"selectionChange","linear"],["matStepperIcon","edit"],["label","upload","state","upload",2,"margin-top","50px",3,"editable","completed"],["matStepLabel",""],[1,"row","border-bottom","mt-10","ms-2"],[1,"col-md-2"],[1,"fw-bold"],[1,"h6","fst-italic"],[1,"col-md-10"],[1,"row"],[1,"col-md-12","mb-10",2,"display","flex"],["bindLabel","Name","bindValue","ID",2,"width","200px",3,"ngModelChange","change","items","clearable","ngModel"],["ng-option-tmp",""],[1,"ms-3"],[1,"row","border-bottom","ms-2","mt-10","pb-10"],[1,"col-md-auto"],[3,"dashboardPropsConfiguration","subtitle"],["label","preview","state","preview",3,"editable","completed"],[2,"width","600px",3,"selectedIndexChange","selectedIndex"],[3,"label"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","30px"],["mat-sort-header","ProductName",2,"width","175px"],["mat-sort-header","VariantName",2,"width","175px"],["mat-sort-header","VariantCode",2,"width","100px"],["mat-sort-header","Expected",2,"width","200px"],["mat-sort-header","Counted",2,"width","100px"],["mat-sort-header","Differences",2,"width","75px"],["mat-sort-header","UnitCost",2,"width","100px"],["label","finish","state","finish"],[1,"d-flex","flex-column","align-items-center"],[1,"fa-solid","fa-circle-check","text-success",2,"font-size","110px"],[1,"mt-8"],[1,"fw-normal","mt-2"],[1,"btn","btn-success",3,"click"],[1,"btn","btn-outline-secondary",3,"click"],[1,"btn","btn-success","ms-3",3,"click","disabled"],[1,"fa-solid","fa-upload","me-3"],[3,"title"],["type","button","aria-expanded","false",1,"btn","btn-outline-secondary","mb-2",2,"height","37px !important","font-size","12px !important",3,"click"],[1,"fa","fa-download","me-3"],[3,"fileUploaded","dashboardPropsConfiguration","subtitle"],[1,"fa-regular","fa-file","me-3"],[3,"ngClass"],[2,"word-break","break-word"],[3,"routerLink","queryParams"],[1,"text-danger"],[3,"text-danger","text-success"],[3,"bg-gradient-danger"],[1,"fa-solid","fa-check","me-3"]],template:function(o,n){if(o&1){let d=x();a(0,"mainpanel-cmp",1)(1,"actions"),At(2),g(3,qd,2,0,"button",2),jt(),g(4,Gd,4,1),g(5,zd,2,0,"button",2),r(),a(6,"content")(7,"mat-stepper",3,0),_("selectionChange",function(D){return p(d),u(n.selectionChange(D))}),E(9,$d,1,1,"ng-template",4),a(10,"mat-step",5),E(11,Kd,2,0,"ng-template",6),a(12,"div",7)(13,"div",8)(14,"h5",9),s(15,"Outlet"),r(),a(16,"small",10),s(17,"Stock take location"),r()(),a(18,"div",11)(19,"div",12)(20,"div",13)(21,"div")(22,"ng-select",14),P("ngModelChange",function(D){return p(d),T(n.formData.EntityID,D)||(n.formData.EntityID=D),u(D)}),_("change",function(D){return p(d),u(n.getEntityName(D))}),E(23,Jd,3,5,"ng-template",15),r()(),g(24,Zd,4,0,"div",16),r()()()(),a(25,"div",17)(26,"div",8)(27,"h5",9),s(28,"Upload File"),r(),a(29,"small",10),s(30,".csv format"),r()(),a(31,"div",18),g(32,Xd,1,2,"POS-uppy",19),g(33,Yd,1,2,"POS-uppy",19),r()()(),a(34,"mat-step",20),E(35,tm,2,0,"ng-template",6),a(36,"div")(37,"mat-tab-group",21),_("selectedIndexChange",function(D){return p(d),u(n.onTabChange(D))}),f(38,"mat-tab",22)(39,"mat-tab",22)(40,"mat-tab",22)(41,"mat-tab",22),r(),a(42,"table",23),_("matSortChange",function(D){return p(d),u(n.sortData(D))}),a(43,"thead",24)(44,"tr")(45,"th",25),s(46,"No"),r(),a(47,"th",26),s(48," Product "),r(),a(49,"th",27),s(50," Variant "),r(),a(51,"th",28),s(52,"Code"),r(),a(53,"th",29),s(54," Expected "),r(),a(55,"th",30),s(56,"Counted"),r(),g(57,em,2,0,"th",31),g(58,nm,2,0,"th",32),g(59,im,2,0,"th"),r()(),a(60,"tbody"),F(61,mm,17,13,"tr",null,tt),r()()()(),a(63,"mat-step",33),E(64,cm,2,0,"ng-template",6),a(65,"div",34),f(66,"i",35),a(67,"h1",36),s(68,"Adjustment Complete!"),r(),a(69,"h6",37),s(70),r()()()()()()}o&2&&(c("pageData",n.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),l(3),C(n.state=="upload"&&n.fileImport?3:-1),l(),C(n.state=="preview"?4:-1),l(),C(n.state=="finish"?5:-1),l(2),c("linear",!0),l(3),c("editable",!n.uploaded)("completed",!1),l(12),c("items",n.pageData.Entities)("clearable",!1),M("ngModel",n.formData.EntityID),l(2),C(n.role.adjustment.Create||n.role.adjustment.Edit?24:-1),l(8),C(n.uploadState()===n.uploadStateEnum.Idle||n.uploadState()===n.uploadStateEnum.Uploading?32:-1),l(),C(n.uploadState()===n.uploadStateEnum.Success||n.uploadState()===n.uploadStateEnum.Error?33:-1),l(),c("editable",!n.uploaded)("completed",!1),l(3),c("selectedIndex",n.selectedTabIndex),l(),c("label",me("Unmatched (",n.summaryData.Updated,")")),l(),c("label",me("Matched (",n.summaryData.NoChanges,")")),l(),c("label",me("All (",n.summaryData.Total,")")),l(),c("label",me("Error (",n.summaryData.Error,")")),l(16),C(n.importedDataState!="matched"?57:-1),l(),C(n.role.product.Cost&&n.importedDataState=="unmatched"?58:-1),l(),C(n.importedDataState=="error"||n.importedDataState=="all"?59:-1),l(2),U(n.filteredData),l(9),Dn(" ",n.summaryData.Total," items with ",n.summaryData.Updated," unmatched & ",n.summaryData.NoChanges," matched quantities imported. "))},dependencies:[Ft,ct,at,B,X,pt,Fn,Nn,Un,Bo,Qe,Be,Ze,Co,fo,bo,q,co],styles:[".sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{top:48px!important}"]})};var pm=i=>({ID:i});function um(i,e){if(i&1){let t=x();a(0,"button",4),_("click",function(){p(t);let n=m();return u(n.openExportModal())}),f(1,"i",5),s(2," Export "),r()}}function _m(i,e){if(i&1){let t=x();a(0,"div",6)(1,"h6"),s(2,"Outlets"),r(),a(3,"outlet-selector",7),P("ngModelChange",function(n){p(t);let d=m();return T(d.pageData.Filter.OutletId,n)||(d.pageData.Filter.OutletId=n),u(n)}),r(),a(4,"h6"),s(5,"Supplier"),r(),a(6,"autocompleteV2",8),P("ngModelChange",function(n){p(t);let d=m();return T(d.pageData.Filter.SupplierId,n)||(d.pageData.Filter.SupplierId=n),u(n)}),r(),a(7,"h6"),s(8,"Category"),r(),a(9,"POS-product-category-select",9),P("selectedCategoryIDChange",function(n){p(t);let d=m();return T(d.pageData.Filter.CategoryId,n)||(d.pageData.Filter.CategoryId=n),u(n)}),r()()}if(i&2){let t=m();l(3),c("accessType",2),M("ngModel",t.pageData.Filter.OutletId),c("multiple",!1)("clearable",!1),l(3),M("ngModel",t.pageData.Filter.SupplierId),l(3),M("selectedCategoryID",t.pageData.Filter.CategoryId),c("showClear",!0)}}function gm(i,e){i&1&&(a(0,"th",16),s(1," On Hand "),r())}function Cm(i,e){if(i&1&&(a(0,"td",19),s(1),r()),i&2){let t=m().$implicit;l(),S(t.OnHand)}}function fm(i,e){if(i&1&&(a(0,"tr")(1,"td")(2,"a",18),s(3),r()(),a(4,"td"),s(5),r(),a(6,"td"),s(7),v(8,"date"),r(),a(9,"td",19),s(10),r(),g(11,Cm,2,1,"td",19),r()),i&2){let t=e.$implicit,o=m(2);l(2),c("queryParams",V(9,pm,t.ID)),l(),S(t.Name),l(2),S(t.Code),l(2),S(k(8,6,t.LastCountDate,"dd MMM yyyy")),l(3),S(t.DaysSinceLastCount),l(),C(o.role.inventory.View?11:-1)}}function hm(i,e){if(i&1){let t=x();a(0,"div",3)(1,"table",10),_("matSortChange",function(n){p(t);let d=m();return u(d.sortData(n))}),a(2,"thead",11)(3,"tr")(4,"th",12),s(5,"Name"),r(),a(6,"th",13),s(7,"Code"),r(),a(8,"th",14),s(9,"Last Count"),r(),a(10,"th",15),s(11," Days Since Last Count "),r(),g(12,gm,2,0,"th",16),r()(),a(13,"tbody"),F(14,fm,12,11,"tr",null,tt),r()(),a(16,"POS-complex-pagination",17),_("jumpToPage",function(){p(t);let n=m();return u(n.getListData())})("previousPage",function(){p(t);let n=m();return u(n.getListData())})("nextPage",function(){p(t);let n=m();return u(n.getListData())}),r()()}if(i&2){let t=m();l(12),C(t.role.inventory.View?12:-1),l(2),U(t.data.Data),l(2),c("total",t.data.Data.length)("pageData",t.pageData)}}var Ii=class i extends St{constructor(t,o,n,d,y){super(t,o,"Adjustment/AdjustmentLastCountDate","AdjustmentLoader/AdjustmentLastCountDate",void 0,void 0,!0);this.httpService=o;this.csvConverter=n;this.roleService=d;this.matDialog=y}role=h(H);originalData=[];postInit(t){this.originalData=t.Data,this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(Rt,{data:{title:"Adjustment Report",exportTypes:[{ID:"AdjustmentExport/ExportAdjustmentLastCountDate",Value:"Default",FileName:"Adjustment Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/AdjustmentLastCountDate",pagination:!0}})}sortData(t){let o=this.data.Data.slice();if(!t.active||t.direction===""){this.data.Data=this.originalData;return}this.data.Data=o.sort((n,d)=>{let y=t.direction==="asc",D=typeof n[t.active];switch(A.IsEmpty(n.Code)&&(n.Code=""),A.IsEmpty(d.Code)&&(d.Code=""),D){case"string":return A.compare(n[t.active].toLocaleLowerCase(),d[t.active].toLocaleLowerCase(),y);case"number":return A.compare(n[t.active],d[t.active],y);default:return 0}})}static \u0275fac=function(o){return new(o||i)(b(rt),b(L),b(kt),b(H),b(nt))};static \u0275cmp=O({type:i,selectors:[["POS-last-count"]],standalone:!1,features:[mt],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[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 an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple","clearable"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["id","tableGrid","matSort","",1,"table","w-100",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","Code"],["mat-sort-header","LastCountDate"],["mat-sort-header","DaysSinceLastCount",1,"align-right"],["mat-sort-header","OnHand",1,"align-right"],["api","Adjustment/CountAdjustmentLastCountDate",3,"jumpToPage","previousPage","nextPage","total","pageData"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[1,"text-end"]],template:function(o,n){if(o&1){let d=x();a(0,"mainpanel-cmp",1),P("textChange",function(D){return p(d),T(n.pageData.Filter.Text,D)||(n.pageData.Filter.Text=D),u(D)}),_("onSubmit",function(){return p(d),u(n.searchFromPageOne())}),P("filterChange",function(D){return p(d),T(n.pageData.Filter,D)||(n.pageData.Filter=D),u(D)}),a(1,"actions"),g(2,um,3,0,"button",2),r(),a(3,"filters"),E(4,_m,10,7,"ng-template",null,0,K),r(),a(6,"content"),g(7,hm,17,3,"div",3),r()()}o&2&&(c("pageData",n.menuData),M("text",n.pageData.Filter.Text),c("isFilterOnDropdown",!1),M("filter",n.pageData.Filter),l(2),C(n.roleService.global.Export?2:-1),l(5),C(n.data&&n.data.Data?7:-1))},dependencies:[ct,at,B,X,zt,Kt,Qe,Be,$t,Ge,Wt],encapsulation:2})};var ym=[{path:"Adjustment/Archive",component:Gn},{path:"Adjustment/Archive/Info",component:Hn},{path:"Adjustment/Archive/Form",component:vi,canActivate:[sr],data:{roles:[Oi.adjustment.Create,Oi.adjustment.Edit]}},{path:"Tools/Count_Product_Inventory",component:Yn},{path:"Tools/Convert_Inventory_to_Parent_UOM",component:Xn},{path:"Tools/Product_Sheet",component:ti},{path:"Report/Last_Count",component:Ii},{path:"Report/Adjustment",component:Kn},{path:"History/Variant",component:xi},{path:"Adjustment/Stock_Take_by_Web_Spreadsheet",component:Zn},{path:"Adjustment/Stock_Take_by_CSV",component:bi},{path:"",redirectTo:"Adjustment/Archive",pathMatch:"full"}],Di=class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=Ae({type:i});static \u0275inj=Ee({imports:[_n.forChild(ym),_n]})};var zi=class i{constructor(e){this.http=e}currentUntilPage;toggleFetchTotalData;totalData;pageNumber;isNextBtnDisabled;isOnLastPage;calcCurrentUntilPage(e,t,o){this.currentUntilPage=e*(t-1)+o}setPageNumber(e){this.pageNumber=e}setPaginationButtonState(e,t,o){o==0?this.isNextBtnDisabled=!0:this.isNextBtnDisabled=!(o<e*t)}setTotalData(e,t,o){this.toggleFetchTotalData=!0,this.http.post(e,t).pipe(Q(o)).subscribe(n=>this.totalData=n)}setPaginationState(e,t,o){this.calcCurrentUntilPage(e,t,o),this.setPageNumber(t),this.setPaginationButtonState(e,t,o)}static \u0275fac=function(t){return new(t||i)(Zi(L))};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ti=class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=Ae({type:i});static \u0275inj=Ee({imports:[yt]})};var Tr=class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=Ae({type:i});static \u0275inj=Ee({imports:[kn,yt,Di,An,qt,On,ko,pt,or,qe,ut,Uo,So,Ao,ut,Ho,Qo,Ai,Eo,He,Re,go,No,_o,lr,Ai,po,rr,ar,Wo,De,Oo,Po,Mo,Ti,Je,$t,Ge,Rn,Qn,Ze,ho,uo,yo]})};export{Tr as AdjustmentModule};
|