dealpos 12.44.2 → 12.44.4
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/POS/{chunk-F4HN3Z2L.js → chunk-2B62AQXH.js} +1 -1
- package/POS/{chunk-KUMRBAHR.js → chunk-2BWYY4MQ.js} +1 -1
- package/POS/{chunk-5ZEEDNAK.js → chunk-2CSFHPOU.js} +1 -1
- package/POS/{chunk-DKCK5RIU.js → chunk-2I6XYQES.js} +1 -1
- package/POS/chunk-2KX7EPCB.js +1 -0
- package/POS/{chunk-UJFOW5TG.js → chunk-2MIMVIKE.js} +1 -1
- package/POS/{chunk-DD67HQ7F.js → chunk-2QSZYWHY.js} +1 -1
- package/POS/{chunk-RV5E6O6T.js → chunk-2SDASQS6.js} +1 -1
- package/POS/{chunk-D7PWW4KB.js → chunk-3733XHJB.js} +1 -1
- package/POS/{chunk-WT3AJK6U.js → chunk-3CVN7FD2.js} +1 -1
- package/POS/{chunk-UX7A3PWK.js → chunk-3I6X7UOD.js} +1 -1
- package/POS/{chunk-VULT74OX.js → chunk-3QWDDOWC.js} +1 -1
- package/POS/chunk-3WRVTX63.js +1 -0
- package/POS/{chunk-FIWIH5KW.js → chunk-3YUW3R7G.js} +1 -1
- package/POS/{chunk-FAXWM6PK.js → chunk-47ZSD7FA.js} +1 -1
- package/POS/{chunk-2QHWTMUM.js → chunk-4NYAISL7.js} +1 -1
- package/POS/{chunk-HEIOCVQ6.js → chunk-4TJDMTAL.js} +1 -1
- package/POS/{chunk-OXVRREM5.js → chunk-5BZ3MV4S.js} +1 -1
- package/POS/{chunk-44XDLDWJ.js → chunk-5O673ECY.js} +1 -1
- package/POS/{chunk-SUS4A7WY.js → chunk-5QPEMH3U.js} +1 -1
- package/POS/{chunk-UR7COGWR.js → chunk-5T6JU6XP.js} +1 -1
- package/POS/{chunk-CL7HVW54.js → chunk-5WQZZME6.js} +1 -1
- package/POS/{chunk-ZY5WJGY4.js → chunk-67F5SJVS.js} +1 -1
- package/POS/{chunk-CKZWWRAL.js → chunk-6BK7YHCM.js} +1 -1
- package/POS/{chunk-WB6N5MVQ.js → chunk-6CMTBTF4.js} +1 -1
- package/POS/{chunk-LBDXAO2B.js → chunk-6DKKU2XR.js} +1 -1
- package/POS/{chunk-AOBDJGB5.js → chunk-6K7MIFLK.js} +1 -1
- package/POS/{chunk-KENNSFTS.js → chunk-6L3SYQNX.js} +1 -1
- package/POS/{chunk-G5HZY2KN.js → chunk-6S3HBHKC.js} +1 -1
- package/POS/{chunk-PEGWWH3L.js → chunk-72B7MWMG.js} +1 -1
- package/POS/{chunk-LF55ROD5.js → chunk-7GWZ36VL.js} +1 -1
- package/POS/{chunk-UMXNKIUN.js → chunk-7YD5IGMB.js} +1 -1
- package/POS/{chunk-ZRE6HAVR.js → chunk-A7XKZWGG.js} +1 -1
- package/POS/{chunk-PMNCSCFI.js → chunk-ACMUCAFL.js} +1 -1
- package/POS/{chunk-GNEWHXJ2.js → chunk-ADJIB445.js} +1 -1
- package/POS/{chunk-F7PR4HXN.js → chunk-AILI7OYP.js} +1 -1
- package/POS/chunk-AQS7ZG75.js +1 -0
- package/POS/{chunk-FJ377DVL.js → chunk-ASSILUFP.js} +1 -1
- package/POS/{chunk-HPBLH7VY.js → chunk-B24IP5ZY.js} +1 -1
- package/POS/{chunk-HD7GYN5I.js → chunk-BBOFKPT3.js} +1 -1
- package/POS/{chunk-FVJT3LJT.js → chunk-BBRWTT5B.js} +1 -1
- package/POS/{chunk-Q23IPH45.js → chunk-BOHFP6LT.js} +1 -1
- package/POS/{chunk-A2NDWPSD.js → chunk-BPUD4VLT.js} +1 -1
- package/POS/{chunk-VS35NMDG.js → chunk-BXQKLCYH.js} +2 -2
- package/POS/{chunk-KWYZFU47.js → chunk-BZ7W4SQS.js} +1 -1
- package/POS/{chunk-MYBI3KOI.js → chunk-C2CB3GKS.js} +1 -1
- package/POS/{chunk-PF336JCV.js → chunk-CATUDIDC.js} +1 -1
- package/POS/{chunk-J2OAFFRS.js → chunk-CD25DWKU.js} +1 -1
- package/POS/{chunk-AABHTRTT.js → chunk-CEI5CFML.js} +1 -1
- package/POS/{chunk-R374GSLO.js → chunk-CGY7S5VD.js} +1 -1
- package/POS/{chunk-HFBUCKWD.js → chunk-DAGT3EWL.js} +1 -1
- package/POS/{chunk-PQUJN4TQ.js → chunk-DCTE4EMY.js} +1 -1
- package/POS/{chunk-FH4LAUBW.js → chunk-DDVGNIC2.js} +1 -1
- package/POS/{chunk-UQZEPMAX.js → chunk-DIHHH52W.js} +1 -1
- package/POS/{chunk-3377XH6K.js → chunk-DJSB72WG.js} +1 -1
- package/POS/{chunk-7T6HIUVL.js → chunk-DUCXZWTS.js} +1 -1
- package/POS/{chunk-BZELV2UM.js → chunk-DWS2YTB6.js} +1 -1
- package/POS/{chunk-R5YKL7DY.js → chunk-ESLDPGRV.js} +1 -1
- package/POS/{chunk-UKUUAMR4.js → chunk-F4CJOMBR.js} +1 -1
- package/POS/{chunk-S6HCCFCH.js → chunk-F5UGW2OZ.js} +1 -1
- package/POS/{chunk-7PN36SJO.js → chunk-F65H46DR.js} +1 -1
- package/POS/{chunk-IJ5U3JU4.js → chunk-F6E7434J.js} +1 -1
- package/POS/{chunk-FRJAM5SZ.js → chunk-FAUAPPQ7.js} +1 -1
- package/POS/{chunk-Z3YSGPQJ.js → chunk-FDJCJBZ4.js} +1 -1
- package/POS/{chunk-2TMYAIFR.js → chunk-FNNVQKO3.js} +1 -1
- package/POS/{chunk-KQ2FI4N3.js → chunk-FTR7AA6W.js} +1 -1
- package/POS/{chunk-WB3XNSQ4.js → chunk-G46RO6DU.js} +1 -1
- package/POS/{chunk-L5YPVUHN.js → chunk-G7MJDRKQ.js} +1 -1
- package/POS/{chunk-64VKACQD.js → chunk-GGHVOCFP.js} +1 -1
- package/POS/{chunk-WS5XBPGM.js → chunk-GIDOHD4M.js} +1 -1
- package/POS/{chunk-CDUJTJLA.js → chunk-GUHGJGF6.js} +1 -1
- package/POS/{chunk-524SE7PJ.js → chunk-H22CEEHA.js} +1 -1
- package/POS/{chunk-PPDFV3FN.js → chunk-HADVK46R.js} +1 -1
- package/POS/{chunk-PMXTFBQR.js → chunk-HLBSFB5P.js} +1 -1
- package/POS/{chunk-W6MCL3BJ.js → chunk-HSH3U3NZ.js} +1 -1
- package/POS/{chunk-HSM37ZU5.js → chunk-HYED47DK.js} +1 -1
- package/POS/{chunk-ILSLOJ6R.js → chunk-HYZIC5OW.js} +1 -1
- package/POS/{chunk-RAF3HZP2.js → chunk-I3NUPTGA.js} +1 -1
- package/POS/{chunk-FVG7JFO5.js → chunk-IDN3C67X.js} +1 -1
- package/POS/{chunk-XGC7OLSC.js → chunk-INN3O3SR.js} +1 -1
- package/POS/{chunk-5RB66ESJ.js → chunk-IVJLOMD3.js} +1 -1
- package/POS/{chunk-BGNV7XOW.js → chunk-J57E5TL3.js} +1 -1
- package/POS/{chunk-7QJQYLFV.js → chunk-JC5VQPOU.js} +1 -1
- package/POS/{chunk-OFE2I4YO.js → chunk-JFX5X6A2.js} +1 -1
- package/POS/{chunk-6LHUX4Z3.js → chunk-JLAO4L6Z.js} +1 -1
- package/POS/{chunk-KYYZS6VT.js → chunk-JLMC2QL5.js} +1 -1
- package/POS/{chunk-3I2YNNIP.js → chunk-JTSLJN7Z.js} +1 -1
- package/POS/{chunk-5D6VGPMG.js → chunk-JXCGJLM3.js} +1 -1
- package/POS/{chunk-AWO6YCWE.js → chunk-K2MSZS6P.js} +1 -1
- package/POS/{chunk-GODVSV6G.js → chunk-K62IXAWM.js} +1 -1
- package/POS/{chunk-R53XLIS5.js → chunk-KTBBK3PZ.js} +1 -1
- package/POS/{chunk-PNF63EQQ.js → chunk-LFBBAGTD.js} +1 -1
- package/POS/{chunk-FDYSJWM7.js → chunk-LGNEVA67.js} +1 -1
- package/POS/{chunk-V3367KV6.js → chunk-LPKDE3ES.js} +1 -1
- package/POS/{chunk-DLD7IXQ3.js → chunk-LPODCMFN.js} +1 -1
- package/POS/{chunk-JRV3N3PJ.js → chunk-LRITIWKE.js} +1 -1
- package/POS/{chunk-FKC53V4F.js → chunk-LXSYPTVI.js} +1 -1
- package/POS/{chunk-QJZTBVE2.js → chunk-M3HQGEUI.js} +1 -1
- package/POS/{chunk-L76DHTUO.js → chunk-ME7RASOA.js} +1 -1
- package/POS/{chunk-HAB3VLCQ.js → chunk-MFU4MK5H.js} +1 -1
- package/POS/{chunk-KKD3TAME.js → chunk-MMMUAIC4.js} +1 -1
- package/POS/{chunk-X7C7HZS5.js → chunk-MOCWB3ZI.js} +1 -1
- package/POS/{chunk-2YS27SKR.js → chunk-MZ4FA3YV.js} +1 -1
- package/POS/{chunk-Q45MX3PQ.js → chunk-N4PMIQGW.js} +2 -2
- package/POS/{chunk-BLLGFTYX.js → chunk-NAHLCIMF.js} +1 -1
- package/POS/{chunk-5RNZ2CWR.js → chunk-NEPW5RA2.js} +1 -1
- package/POS/{chunk-DQ2WI3MZ.js → chunk-NJZMANF5.js} +1 -1
- package/POS/{chunk-XU3Q3X7P.js → chunk-NMZZA7KM.js} +1 -1
- package/POS/{chunk-4G2YJGZA.js → chunk-NRGFP2PU.js} +1 -1
- package/POS/{chunk-NH2WWUKA.js → chunk-NSRZZXL3.js} +1 -1
- package/POS/{chunk-ZOUTOWA5.js → chunk-NTGC2PEF.js} +1 -1
- package/POS/{chunk-JMI5WGFR.js → chunk-NV4F3EAU.js} +1 -1
- package/POS/{chunk-OHUH3OB2.js → chunk-NYTGQEJS.js} +1 -1
- package/POS/{chunk-CNWEP3UL.js → chunk-O3QEQTRY.js} +1 -1
- package/POS/{chunk-R7WWUG6O.js → chunk-O55WIKRR.js} +1 -1
- package/POS/{chunk-FAD3GUYQ.js → chunk-OCBGPPC5.js} +1 -1
- package/POS/{chunk-JW6ZEAHM.js → chunk-OF2HST5N.js} +1 -1
- package/POS/{chunk-5EWQA55L.js → chunk-OHQNX7T2.js} +1 -1
- package/POS/{chunk-E6QZTOZV.js → chunk-OKR43MTB.js} +1 -1
- package/POS/{chunk-HHKZPB5G.js → chunk-OQLI3GL4.js} +1 -1
- package/POS/{chunk-JQVKNL3P.js → chunk-PD5E2UG6.js} +1 -1
- package/POS/{chunk-2UBL4HZB.js → chunk-PJSDMPUU.js} +1 -1
- package/POS/{chunk-73E7PVE3.js → chunk-PU4TRUQY.js} +1 -1
- package/POS/chunk-PXAPE4JC.js +1 -0
- package/POS/{chunk-DZCRCN63.js → chunk-QNQO4QD7.js} +1 -1
- package/POS/{chunk-5DSDVFKS.js → chunk-RBHBHEHA.js} +1 -1
- package/POS/{chunk-5QKCQQPK.js → chunk-REDP5RDI.js} +1 -1
- package/POS/{chunk-FWEVJM3J.js → chunk-RFXXMOJ3.js} +1 -1
- package/POS/{chunk-GHQ7ZPO2.js → chunk-S5O2FRNX.js} +1 -1
- package/POS/{chunk-ASYDVWMZ.js → chunk-S7OSFHNK.js} +1 -1
- package/POS/{chunk-XFTAHHM7.js → chunk-SBNKKPLX.js} +1 -1
- package/POS/{chunk-AFPTRWDM.js → chunk-SZXNOUBK.js} +1 -1
- package/POS/{chunk-JIC4HMMK.js → chunk-TIIZI7P2.js} +1 -1
- package/POS/{chunk-NVYYIEOU.js → chunk-TJCBWUIF.js} +3 -3
- package/POS/{chunk-KFYJDT5N.js → chunk-UIK43BGI.js} +1 -1
- package/POS/{chunk-OIF3V5VM.js → chunk-UIOYKSGI.js} +1 -1
- package/POS/{chunk-B6N5KOGE.js → chunk-UOWDTGBK.js} +1 -1
- package/POS/{chunk-LFS5Y43Y.js → chunk-UQJVM3QL.js} +1 -1
- package/POS/{chunk-FNTPE5XI.js → chunk-URBK2BIP.js} +1 -1
- package/POS/{chunk-5HT3IRBH.js → chunk-VMXWIYZB.js} +1 -1
- package/POS/{chunk-UHZ43IH5.js → chunk-VX3IMTVA.js} +1 -1
- package/POS/{chunk-HY26GKM5.js → chunk-W2WCBQXG.js} +1 -1
- package/POS/{chunk-5PNIJAQJ.js → chunk-WJQ72Y2U.js} +1 -1
- package/POS/{chunk-I2YGPNYY.js → chunk-WMAYHHVK.js} +1 -1
- package/POS/{chunk-5AIW4C7Z.js → chunk-WVAWPQSM.js} +1 -1
- package/POS/{chunk-UT6N5CAL.js → chunk-WVE6Y5CB.js} +1 -1
- package/POS/{chunk-OFCLSGZN.js → chunk-WXPYLO7I.js} +1 -1
- package/POS/{chunk-WAB3JNIZ.js → chunk-WZ3ZHHDP.js} +1 -1
- package/POS/{chunk-VNUPRAZ7.js → chunk-XKKALE7W.js} +1 -1
- package/POS/{chunk-3XZR6Z37.js → chunk-YGNJW3QK.js} +1 -1
- package/POS/{chunk-5LVG2FD5.js → chunk-YUXCUZLB.js} +1 -1
- package/POS/chunk-YZ7DSNJN.js +1 -0
- package/POS/{chunk-SKGNEYHA.js → chunk-Z4LON2SE.js} +1 -1
- package/POS/{chunk-EHJPHIVP.js → chunk-ZDUT44QS.js} +2 -2
- package/POS/{chunk-O55XPEK3.js → chunk-ZJK2D57G.js} +1 -1
- package/POS/{chunk-WFGIA2YF.js → chunk-ZK6DATHK.js} +1 -1
- package/POS/{chunk-LR2EY44G.js → chunk-ZS772QNW.js} +1 -1
- package/POS/index.html +2 -2
- package/POS/{main-QLHGUFSE.js → main-T42I5XDN.js} +2 -2
- package/package.json +1 -1
- package/POS/chunk-33CZC6AV.js +0 -1
- package/POS/chunk-6O7AU44A.js +0 -1
- package/POS/chunk-BNKZEXZL.js +0 -1
- package/POS/chunk-LGTD4ATE.js +0 -1
- package/POS/chunk-PD6NYGJ4.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ao,b as Nn,c as so}from"./chunk-LFS5Y43Y.js";import{a as lo}from"./chunk-HSM37ZU5.js";import{a as Jr,b as Yr,c as Zr,d as Xr,e as to,f as io,g as ro}from"./chunk-JQVKNL3P.js";import{a as eo,b as no}from"./chunk-W6MCL3BJ.js";import{b as oo}from"./chunk-JW6ZEAHM.js";import{G as kr}from"./chunk-NH2WWUKA.js";import"./chunk-RRQI7YBE.js";import"./chunk-H3I3GRUR.js";import"./chunk-GNEWHXJ2.js";import"./chunk-K7ACLCRR.js";import"./chunk-TK5H65DN.js";import"./chunk-B5FODXLM.js";import"./chunk-CKZWWRAL.js";import{a as Mr,b as Or,c as Tr,d as kn,e as Er}from"./chunk-WB6N5MVQ.js";import"./chunk-6L6CIH5M.js";import"./chunk-5DSDVFKS.js";import"./chunk-7QJQYLFV.js";import"./chunk-2TMYAIFR.js";import{a as qe}from"./chunk-KKD3TAME.js";import{a as lr}from"./chunk-OXVRREM5.js";import{a as Ge}from"./chunk-BNKZEXZL.js";import{a as Ur,b as Lr,c as Rr,d as Qr,e as Br,f as Wr}from"./chunk-PMXTFBQR.js";import{b as Fr}from"./chunk-CNWEP3UL.js";import"./chunk-5D6VGPMG.js";import"./chunk-RAF3HZP2.js";import{c as jn}from"./chunk-Z3YSGPQJ.js";import"./chunk-DZCRCN63.js";import"./chunk-R53XLIS5.js";import{b as wr}from"./chunk-RV5E6O6T.js";import"./chunk-5ZEEDNAK.js";import"./chunk-VVOAOYFG.js";import{a as Ar,b as Vr}from"./chunk-A2NDWPSD.js";import"./chunk-BYXBJQAS.js";import{a as qr,b as Gr,e as zr,f as $r,g as Kr}from"./chunk-HHKZPB5G.js";import{d as Pr}from"./chunk-OFCLSGZN.js";import"./chunk-IJ5U3JU4.js";import{a as Hr}from"./chunk-JMI5WGFR.js";import"./chunk-WAB3JNIZ.js";import"./chunk-FIWIH5KW.js";import{a as Yo,b as Nr}from"./chunk-KUMRBAHR.js";import{b as Ti}from"./chunk-E6QZTOZV.js";import{e as jr}from"./chunk-AFPTRWDM.js";import{a as He,b as We}from"./chunk-JRV3N3PJ.js";import{a as Ce}from"./chunk-5QKCQQPK.js";import{a as Qe}from"./chunk-BLLGFTYX.js";import{a as hr}from"./chunk-V3367KV6.js";import"./chunk-SCLRE6QV.js";import"./chunk-JNZOT7YV.js";import{a as Ut}from"./chunk-HD7GYN5I.js";import"./chunk-FVG7JFO5.js";import"./chunk-SUS4A7WY.js";import{o as xr,r as he,s as Sr}from"./chunk-R7WWUG6O.js";import"./chunk-HEIOCVQ6.js";import{a as pt}from"./chunk-KFNCZ3ZB.js";import{a as Cr}from"./chunk-FJ377DVL.js";import{g as Tn}from"./chunk-SKGNEYHA.js";import"./chunk-UT6N5CAL.js";import{a as Be,b as Dr}from"./chunk-KENNSFTS.js";import{a as fr,b as Wt}from"./chunk-F7PR4HXN.js";import{d as On,e as br}from"./chunk-LF55ROD5.js";import{a as mr,b as pr,c as cr}from"./chunk-KQ2FI4N3.js";import{a as Ft}from"./chunk-ZY5WJGY4.js";import"./chunk-L5YPVUHN.js";import"./chunk-LBDXAO2B.js";import"./chunk-R374GSLO.js";import{a as Ot}from"./chunk-OIF3V5VM.js";import{a as Ue}from"./chunk-O55XPEK3.js";import{a as ur,b as xn,d as Sn,e as _r}from"./chunk-HFBUCKWD.js";import{a as En}from"./chunk-OFE2I4YO.js";import{b as mt,c as Re}from"./chunk-KYYZS6VT.js";import"./chunk-WS5XBPGM.js";import{a as ue,b as rt}from"./chunk-5AIW4C7Z.js";import{h as dr,l as Le,m as Mn}from"./chunk-5EWQA55L.js";import"./chunk-WFGIA2YF.js";import{b as Ir}from"./chunk-64VKACQD.js";import{a as X,b as Dn,c as at,d as gt,e as _e,f as ft,h as ht,i as Ct,j as jt}from"./chunk-FWEVJM3J.js";import{Aa as Ht,Ba as sr,K as or,la as ar}from"./chunk-FRJAM5SZ.js";import{N as wn,U as fe,Y as vr,g as ge,n as yr}from"./chunk-FVJT3LJT.js";import"./chunk-DQ2WI3MZ.js";import"./chunk-UJBDZYC5.js";import{a as gr,e as Mt,f as Pn}from"./chunk-4G2YJGZA.js";import"./chunk-AWO6YCWE.js";import{A as Fe,B as ce,C as de,b as rr,c as lt,h as F,i as je,l as Ne,n as Y,r as bn,s as Ae,t as Ve}from"./chunk-5RNZ2CWR.js";import{a as ir}from"./chunk-JIC4HMMK.js";import"./chunk-FKC53V4F.js";import{b as U}from"./chunk-3XZR6Z37.js";import{a as w}from"./chunk-5WAGVKZG.js";import{$ as et,$a as ct,$b as S,Aa as Pt,Bb as I,C as H,Ca as nt,Da as Zi,Dc as vn,Eb as g,G as Cn,Gb as c,Gd as pe,H as ae,Id as wt,Jd as ut,Kb as er,Lc as Ee,Ld as cn,N as be,Na as R,Nc as J,Oa as Te,Ob as ln,Oc as V,Od as _t,Pb as mn,Qa as Vt,Qb as pn,Rd as k,S as Ji,Sa as l,Ta as C,Tc as le,U as yn,Ub as It,Vb as m,Vc as me,Wb as v,Xb as O,Xc as it,Y as G,Ya as Xi,Yb as se,_c as ke,ac as x,ba as L,bc as D,bd as nr,c as st,ca as Yi,cb as dt,d as fn,dc as K,eb as _,ec as Z,fa as N,fc as A,ga as Me,gc as xe,ia as Rt,ib as p,j as hn,ja as h,jb as tr,ld as In,mb as vt,n as $i,na as P,nc as b,o as Ki,oa as Oe,oc as M,pc as Q,qb as re,r as Dt,s as Ie,sb as Oi,tb as an,tc as ot,ua as d,ub as sn,va as u,vb as a,wb as o,xb as f,yb as z,zb as $}from"./chunk-UR7COGWR.js";import{a as j,b as q,g as Mi,j as gn}from"./chunk-LHUGHE24.js";var Xo=()=>["/menu/Adjustment/Adjustment/Archive/Form"],un=r=>({ID:r}),mo=()=>["/print/Adjustment"],Un=(r,e)=>({"text-success":r,"text-danger":e});function ta(r,e){if(r&1){let t=I();a(0,"div",19)(1,"button",20),g("click",function(){d(t);let n=c(2);return u(n.reject())}),f(2,"i",21),m(3,"Reject "),o(),a(4,"button",20),g("click",function(){d(t);let n=c(2);return u(n.accept())}),f(5,"i",22),m(6,"Accept "),o()()}}function ea(r,e){if(r&1&&(a(0,"a",23),f(1,"i",24),m(2,"Edit "),o()),r&2){let t=c(2);p("routerLink",Z(2,Xo))("queryParams",A(3,un,t.data.ID))}}function na(r,e){if(r&1){let t=I();a(0,"button",20),g("click",function(){d(t);let n=c(2);return u(n.delete())}),f(1,"i",25),m(2,"Delete "),o()}}function ia(r,e){if(r&1&&(a(0,"tr")(1,"th"),m(2,"Journal Link"),o(),a(3,"td"),m(4,":"),o(),a(5,"td")(6,"a",26),m(7,"View Journal"),o()()()),r&2){let t=c(2);l(6),er("href","https://accounting.dealpos.app/pages/journal-entry;TransID=",t.data.ID,"",Te)}}function ra(r,e){if(r&1){let t=I();a(0,"a",44),g("click",function(){d(t);let n=c(3);return u(n.exportCSV(n.csvConverter,"Adjustment/AdjustmentInfoExport","Adjustment#"+n.data.Adjustment.Number+".csv"))}),m(1,"Export"),o()}}function oa(r,e){r&1&&(a(0,"th",45),m(1,"Cost"),o())}function aa(r,e){r&1&&(a(0,"th",45),m(1,"Price"),o())}function sa(r,e){if(r&1&&(z(0),f(1,"p",51),$()),r&2){let t=c().$implicit;l(),p("innerHTML",t.Note,R)}}function la(r,e){if(r&1&&(a(0,"td",52),m(1),o()),r&2){let t=c().$implicit;vt(xe(3,Un,t.Quantity>0,t.Quantity<0)),l(),v(t.Quantity)}}function ma(r,e){if(r&1&&(a(0,"td",52),m(1),o()),r&2){let t=c().$implicit;vt(xe(3,Un,t.Quantity>0,t.Quantity<0)),l(),v(t.Quantity)}}function pa(r,e){if(r&1&&(a(0,"td",52),m(1),o()),r&2){let t=c().$implicit;vt(xe(3,Un,t.Counted>0,t.Counted<0)),l(),v(t.Counted)}}function ca(r,e){if(r&1&&(f(0,"td",53),b(1,"number")),r&2){let t=c().$implicit;p("innerHTML",M(1,1,t.UnitCost),R)}}function da(r,e){if(r&1&&(f(0,"td",53),b(1,"number")),r&2){let t=c().$implicit;p("innerHTML",M(1,1,t.UnitPrice),R)}}function ua(r,e){if(r&1&&(a(0,"tr"),f(1,"td",46),a(2,"td")(3,"a",47),m(4),o(),a(5,"div"),m(6),o(),f(7,"app-serial-note",48),_(8,sa,2,1,"ng-container",14),o(),_(9,la,2,6,"td",49)(10,ma,2,6,"td",49)(11,pa,2,6,"td",49)(12,ca,2,3,"td",50)(13,da,2,3,"td",50),o()),r&2){let t=e.$implicit,i=e.index,n=c(3);l(),p("innerHTML",i+1+".",R),l(2),p("queryParams",A(11,un,t.VariantID)),l(),v(t.Name),l(2),v(t.Code),l(),p("serials",t.Serial),l(),p("ngIf",t.Note!=null),l(),p("ngIf",n.data.Adjustment.StateID==4),l(),p("ngIf",n.data.Adjustment.StateID<4&&n.data.Adjustment.TypeID==1),l(),p("ngIf",n.data.Adjustment.StateID<4&&n.data.Adjustment.TypeID==2),l(),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.sell.PriceVisible)}}function _a(r,e){if(r&1&&(a(0,"td",54)(1,"b"),m(2),b(3,"sum"),b(4,"number"),o()()),r&2){let t=c(3);l(2),v(M(4,4,Q(3,1,t.data.DifferencesArray,"TotalCost")))}}function ga(r,e){if(r&1&&(a(0,"td",55)(1,"b"),m(2),b(3,"sum"),b(4,"number"),o()()),r&2){let t=c(3);l(2),v(M(4,4,Q(3,1,t.data.DifferencesArray,"TotalPrice")))}}function fa(r,e){if(r&1&&(a(0,"div",9)(1,"div",27)(2,"div")(3,"h2"),m(4),o()(),a(5,"div",28)(6,"a",29),f(7,"i",30),m(8,"Print "),o(),_(9,ra,2,0,"a",31),o()(),a(10,"div",12)(11,"div",32)(12,"table",33)(13,"thead",34)(14,"tr")(15,"th",35),m(16,"No"),o(),a(17,"th",36),m(18,"Name"),o(),a(19,"th",37),m(20,"Qty"),o(),_(21,oa,2,0,"th",38)(22,aa,2,0,"th",38),o()(),a(23,"tbody"),_(24,ua,14,13,"tr",39),o(),a(25,"tfoot")(26,"tr")(27,"td",40)(28,"b"),m(29,"Total :"),o()(),a(30,"td",41)(31,"b"),m(32),b(33,"sum"),b(34,"number"),o()(),_(35,_a,5,6,"td",42)(36,ga,5,6,"td",43),o()()()()()()),r&2){let t=c(2);l(4),O("Adjusted Inventory (",t.data.DifferencesArray.length," SKU)"),l(2),p("routerLink",Z(15,mo))("queryParams",A(16,un,t.paramId)),l(3),p("ngIf",t.roleService.global.Export&&t.data.Adjustment.StateID==4),l(12),p("ngIf",t.roleService.product.Cost),l(),p("ngIf",t.roleService.sell.PriceVisible),l(2),p("ngForOf",t.data.DifferencesArray),l(8),v(M(34,13,Q(33,10,t.data.DifferencesArray,"Quantity"))),l(3),p("ngIf",t.roleService.product.Cost),l(),p("ngIf",t.roleService.sell.PriceVisible)}}function ha(r,e){if(r&1&&(a(0,"h2"),m(1),o()),r&2){let t=c(3);l(),O("Counted Inventory (",t.data.CountedArray.length," SKU)")}}function Ca(r,e){if(r&1){let t=I();a(0,"a",44),g("click",function(){d(t);let n=c(3);return u(n.exportCSV(n.csvConverter,"Adjustment/AdjustmentCountedExport","Adjustment_Counted#"+n.data.Adjustment.Number+".csv"))}),f(1,"i",57),m(2,"Export"),o()}}function ya(r,e){if(r&1&&(a(0,"tr"),f(1,"td",46),a(2,"td")(3,"a",47),m(4),o(),a(5,"div"),m(6),o()(),a(7,"td",52),m(8),o(),a(9,"td",52),m(10),o(),a(11,"td",52),m(12),o()()),r&2){let t=e.$implicit,i=e.index;l(),p("innerHTML",i+1+".",R),l(2),p("queryParams",A(9,un,t.VariantID)),l(),v(t.Name),l(2),v(t.Code),l(2),v(t.Counted),l(2),v(t.Actual),l(),vt(xe(11,Un,t.Difference>0,t.Difference<0)),l(),v(t.Difference)}}function va(r,e){if(r&1&&(a(0,"div",9)(1,"div",27)(2,"div"),_(3,ha,2,1,"h2",14),o(),a(4,"div",28)(5,"a",29),f(6,"i",30),m(7,"Print "),o(),_(8,Ca,3,0,"a",31),o()(),a(9,"div",12)(10,"div",32)(11,"table",33)(12,"thead",34)(13,"tr")(14,"th",35),m(15,"No"),o(),a(16,"th",36),m(17,"Name"),o(),a(18,"th",56),m(19,"Counted"),o(),a(20,"th",56),m(21,"Actual"),o(),a(22,"th",56),m(23,"Difference"),o()()(),a(24,"tbody"),_(25,ya,13,14,"tr",39),o()()()()()),r&2){let t=c(2);l(3),p("ngIf",t.data.CountedArray.length>0&&t.data.Adjustment.TypeID==2),l(2),p("routerLink",Z(5,mo))("queryParams",A(6,un,t.paramId)),l(3),p("ngIf",t.roleService.global.Export&&t.data.Adjustment.StateID==4),l(17),p("ngForOf",t.data.CountedArray)}}function Ia(r,e){if(r&1&&(a(0,"span")(1,"b"),m(2,"Modified:"),o(),m(3),b(4,"date"),o()),r&2){let t=c(2);l(3),se(" ",Q(4,2,t.data.CreatedInfo.Modified.Date,"dd MMM yyyy HH:mm")," / ",t.data.CreatedInfo.Modified.User," ")}}function ba(r,e){if(r&1&&(a(0,"mainpanel-cmp",1)(1,"actions"),_(2,ta,7,0,"div",2),a(3,"div",3),_(4,ea,3,5,"a",4)(5,na,3,0,"button",5),o()(),a(6,"content")(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10)(12,"div"),f(13,"h2",11),o()(),a(14,"div",12)(15,"table",13)(16,"tr")(17,"th"),m(18,"Date"),o(),a(19,"td"),m(20,":"),o(),f(21,"td",11),o(),a(22,"tr")(23,"th"),m(24,"PIC"),o(),a(25,"td"),m(26,":"),o(),f(27,"td",11),o(),a(28,"tr")(29,"th"),m(30,"Type"),o(),a(31,"td"),m(32,":"),o(),f(33,"td",11),o(),a(34,"tr")(35,"th"),m(36,"State"),o(),a(37,"td"),m(38,":"),o(),f(39,"td",11),o(),a(40,"tr")(41,"th"),m(42,"Note"),o(),a(43,"td"),m(44,":"),o(),f(45,"td",11),o(),_(46,ia,8,2,"tr",14),o()()()(),a(47,"div",15),_(48,fa,37,18,"div",16)(49,va,26,8,"div",16),o()(),a(50,"div",17),f(51,"i",18),a(52,"span")(53,"b"),m(54,"Created:"),o(),m(55),b(56,"date"),o(),_(57,Ia,5,5,"span",14),o()()()()),r&2){let t=c();p("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),p("ngIf",!t.toggleAccRej),l(2),p("ngIf",t.roleService.adjustment.Edit&&t.data.Adjustment.TypeID!=2&&t.data.Adjustment.StateID!=3),l(),p("ngIf",t.roleService.adjustment.Delete),l(8),p("innerHTML",t.data.Adjustment.OutletName,R),l(8),p("innerHTML",t.data.Adjustment.Date,R),l(6),p("innerHTML",t.data.Adjustment.PIC,R),l(6),p("innerHTML",t.data.Adjustment.TypeLabel,R),l(6),p("innerHTML",t.data.Adjustment.StateLabel,R),l(6),p("innerHTML",t.data.Adjustment.Note,R),l(),p("ngIf",t.data.AppsAccoutingActive&&t.roleService.accounting.View),l(2),p("ngIf",t.data.DifferencesArray.length>0),l(),p("ngIf",(t.data.CountedArray==null?null:t.data.CountedArray.length)>0&&t.data.Adjustment.TypeID==2),l(6),se(" ",Q(56,18,t.data.CreatedInfo.Created.Date,"dd MMM yyyy HH:mm")," / ",t.data.CreatedInfo.Created.User," "),l(2),p("ngIf",t.data.CreatedInfo.Modified.User)}}var An=class r extends Ft{constructor(t,i,n,s,y,T,tt){super(t,i,"Adjustment/AuditInventoryAdjustmentInfo",null,null,s);this.toastr=n;this.csvConverter=y;this.router=T;this.roleService=tt;this.initQueryParam()}paramId;toggleAccRej=!1;isEditable=!1;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.toggleAccRej=!1:this.toggleAccRej=!0,(this.data.Adjustment.StateID==1||this.data.Adjustment.StateID==2)&&(this.isEditable=!0)}exportCSV(t,i,n){this.httpService.get(`/api/${i}`,[{key:"ID",value:this.paramId}]).subscribe(s=>{t.convertToCSV(s,n)})}reject(){if(!confirm("Are you sure you want to reject this?"))return;let t={ID:this.data.Adjustment.ID,Number:this.data.Adjustment.Number,Date:this.data.Adjustment.Date,PIC:this.data.Adjustment.PIC,Note:this.data.Adjustment.Note,EntityID:this.data.Adjustment.EntityID,TypeID:this.data.Adjustment.TypeID,StateID:3};this.data.Order=t,this.httpService.post("/API/Adjustment/RejectCountedItem",this.data).subscribe({next:i=>{this.toastr.success("Success reject adjustment",X.Success),this.toggleAccRej=!0,this.isEditable=!1,this.getListData()}})}accept(){if(!confirm("Are you sure you want to accept this?"))return;let t={ID:this.data.Adjustment.ID,Number:this.data.Adjustment.Number,Date:this.data.Adjustment.Date,PIC:this.data.Adjustment.PIC,Note:this.data.Adjustment.Note,EntityID:this.data.Adjustment.EntityID,TypeID:this.data.Adjustment.TypeID,StateID:4};this.data.Order=t,this.data.Items=[],this.data.DifferencesArray.forEach(i=>{this.data.Order.TypeID===2&&(i.Quantity=i.Counted),this.data.Items.push(i)}),this.httpService.post("/API/Adjustment/AcceptCountedItem",this.data).subscribe({next:i=>{this.toastr.success("Success accept adjustment",X.Success),this.toggleAccRej=!0,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.",X.Success),this.router.navigate(["/menu/Adjustment/Adjustment/Archive"])})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(_t),C(pe),C(Ut),C(wt),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-adjustment-info"]],features:[dt],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["class","btn-group me-5",4,"ngIf"],[1,"btn-group","ms-5"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-3"],[1,"card"],[1,"card-header"],[3,"innerHTML"],[1,"card-body"],[1,"table-sm","table-borderless"],[4,"ngIf"],[1,"col-sm-9"],["class","card",4,"ngIf"],[1,"alert","alert-warning"],["aria-hidden","true",1,"fa-regular","fa-file","me-3"],[1,"btn-group","me-5"],[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-trash","me-3"],[3,"href"],[1,"card-header","d-flex","justify-content-between"],[1,"btn-group"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams"],[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"],[1,"text-center",2,"width","1px"],[2,"width","300px"],[1,"text-end",2,"width","80px"],["class","text-end","style","width: 120px",4,"ngIf"],[4,"ngFor","ngForOf"],["colspan","2",1,"text-end","empty-column"],[1,"text-end","empty-column"],["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"],["role","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"text-end",2,"width","120px"],[1,"text-center",3,"innerHTML"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[3,"serials"],["class","text-end",3,"class",4,"ngIf"],["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"],["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,"text-end",2,"width","100px"],[1,"fa-solid","fa-upload","me-3"]],template:function(i,n){i&1&&_(0,ba,58,21,"mainpanel-cmp",0),i&2&&p("ngIf",n.data)},dependencies:[J,V,ut,mt,Ht,Ce,it,me,ge]})};var Sa=()=>["/menu/Adjustment/Adjustment/Archive/Form/V2"],Da=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Pa=r=>({ID:r}),wa=(r,e)=>({"text-success":r,"text-danger":e}),Ma=r=>({"text-success":r}),Oa=r=>({"text-danger":r});function Ta(r,e){if(r&1){let t=I();a(0,"a",18),g("click",function(){d(t);let n=c(2);return u(n.httpPostListID("Adjustment/DeleteInventoryAdjustmentList"))}),f(1,"i",19),m(2,"Delete "),o()}}function Ea(r,e){if(r&1){let t=I();a(0,"button",20),g("click",function(){d(t);let n=c(2);return u(n.openExportModal())}),f(1,"i",21),m(2," Export "),o()}}function ka(r,e){r&1&&(a(0,"a",22),m(1,"New"),o()),r&2&&p("routerLink",Z(1,Sa))}function ja(r,e){if(r&1){let t=I();a(0,"div")(1,"div",23)(2,"h6"),m(3,"Outlet"),o(),a(4,"ng-select",24),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,n)||(s.pageData.Filter.EntityID=n),u(n)}),o(),a(5,"h6"),m(6,"From"),o(),a(7,"datepicker",25),D("dateChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.From,n)||(s.pageData.Filter.From=n),u(n)}),o(),a(8,"h6"),m(9,"To"),o(),a(10,"datepicker",26),D("dateChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.To,n)||(s.pageData.Filter.To=n),u(n)}),o(),a(11,"h6"),m(12,"Quantity From - To"),o(),a(13,"div",27)(14,"input",28),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.QuantityFrom,n)||(s.pageData.Filter.QuantityFrom=n),u(n)}),o(),m(15," - "),a(16,"input",28),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.QuantityTo,n)||(s.pageData.Filter.QuantityTo=n),u(n)}),o()(),a(17,"h6"),m(18,"State"),o(),a(19,"ng-select",29),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.State,n)||(s.pageData.Filter.State=n),u(n)}),o(),a(20,"h6"),m(21,"Rows"),o(),a(22,"input",30),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.RowCount,n)||(s.pageData.Filter.RowCount=n),u(n)}),o(),a(23,"h6"),m(24,"Exclude Zero"),o(),a(25,"radio-options",31),D("modelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.ExcludeZero,n)||(s.pageData.Filter.ExcludeZero=n),u(n)}),o()()()}if(r&2){let t=c(2);l(4),p("items",t.pageData.Options.Entities),S("ngModel",t.pageData.Filter.EntityID),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.From),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.To),l(4),S("ngModel",t.pageData.Filter.QuantityFrom),l(2),S("ngModel",t.pageData.Filter.QuantityTo),l(3),p("items",t.pageData.Options.States),S("ngModel",t.pageData.Filter.State),l(3),S("ngModel",t.pageData.Filter.RowCount),p("max",1e4),l(3),S("model",t.pageData.Filter.ExcludeZero)}}function Na(r,e){if(r&1){let t=I();a(0,"th",32)(1,"input",33),g("change",function(n){d(t);let s=c(2);return u(s.onSelectAllData(n.target.checked))}),o()()}}function Aa(r,e){r&1&&(a(0,"th",15),m(1,"Cost"),o())}function Va(r,e){if(r&1){let t=I();a(0,"td")(1,"input",40),D("ngModelChange",function(n){d(t);let s=c().$implicit;return x(s.selected,n)||(s.selected=n),u(n)}),o()()}if(r&2){let t=c().$implicit;l(),S("ngModel",t.selected)}}function Fa(r,e){if(r&1&&(a(0,"td",39),m(1),b(2,"quantityFraction"),o()),r&2){let t=c().$implicit;l(),O(" ",M(2,1,t.Quantity)," ")}}function Ua(r,e){if(r&1&&(a(0,"td",39),m(1),b(2,"quantityFraction"),o()),r&2){let t=c().$implicit;vt(A(5,Ma,t.Quantity>0)),l(),O(" +",M(2,3,t.Quantity)," ")}}function La(r,e){if(r&1&&(a(0,"td",39),m(1),b(2,"quantityFraction"),o()),r&2){let t=c().$implicit;vt(A(5,Oa,t.Quantity<0)),l(),O(" ",M(2,3,t.Quantity)," ")}}function Ra(r,e){if(r&1&&(a(0,"td",39),m(1),b(2,"amountFraction"),o()),r&2){let t=c().$implicit;l(),v(M(2,1,t.Cost))}}function Qa(r,e){if(r&1&&(a(0,"tr",34),_(1,Va,2,1,"td",35),a(2,"td"),m(3),o(),a(4,"td")(5,"a",36),m(6),o()(),a(7,"td"),m(8),b(9,"date"),o(),_(10,Fa,3,3,"td",37)(11,Ua,3,7,"td",38)(12,La,3,7,"td",38),a(13,"td"),m(14),o(),_(15,Ra,3,3,"td",39),a(16,"td"),m(17),o(),a(18,"td"),m(19),o()()),r&2){let t=e.$implicit,i=c(2);l(),p("ngIf",i.roleService.adjustment.Delete),l(2),v(t.EntityName),l(2),p("routerLink",Z(18,Da))("queryParams",A(19,Pa,t.ID)),l(),v(t.Number),l(2),v(Q(9,15,t.Date,"dd MMM yyyy")),l(2),p("ngIf",t.Quantity==0),l(),p("ngIf",t.Quantity>0),l(),p("ngIf",t.Quantity<0),l(2),v(t.TypeLabel),l(),re(!(i.roleService==null||i.roleService.product==null)&&i.roleService.product.Cost?15:-1),l(),vt(xe(21,wa,t.StateID==4,t.StateID==3)),l(),O(" ",t.StateLabel," "),l(2),v(t.Note)}}function Ba(r,e){if(r&1){let t=I();a(0,"mainpanel-cmp",2),D("textChange",function(n){d(t);let s=c();return x(s.pageData.Filter.Number,n)||(s.pageData.Filter.Number=n),u(n)}),g("onSubmit",function(){d(t);let n=c();return u(n.searchFromPageOne())}),D("filterChange",function(n){d(t);let s=c();return x(s.pageData.Filter,n)||(s.pageData.Filter=n),u(n)}),a(1,"actions"),_(2,Ta,3,0,"a",3)(3,Ea,3,0,"button",4)(4,ka,2,2,"a",5),o(),a(5,"filters"),_(6,ja,26,13,"ng-template",null,0,ot),o(),a(8,"content")(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr"),_(14,Na,2,0,"th",10),a(15,"th",11),m(16,"Outlet"),o(),a(17,"th",11),m(18,"Number"),o(),a(19,"th",12),m(20,"Date"),o(),a(21,"th",13),m(22," Qty "),o(),a(23,"th",14),m(24,"Type"),o(),_(25,Aa,2,0,"th",15),a(26,"th",12),m(27,"State"),o(),a(28,"th"),m(29,"Note"),o()()(),a(30,"tbody"),_(31,Qa,20,24,"tr",16),o()()(),a(32,"POS-complex-pagination",17),g("jumpToPage",function(){d(t);let n=c();return u(n.getListData())})("previousPage",function(){d(t);let n=c();return u(n.getListData())})("nextPage",function(){d(t);let n=c();return u(n.getListData())}),o()()()()}if(r&2){let t=c();p("pageData",t.menuData),S("text",t.pageData.Filter.Number),p("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.getSelectedData().length>0),l(),p("ngIf",t.roleService.global.Export),l(),p("ngIf",t.roleService.adjustment.Create),l(10),p("ngIf",t.roleService.adjustment.Delete),l(11),re(!(t.roleService==null||t.roleService.product==null)&&t.roleService.product.Cost?25:-1),l(6),p("ngForOf",t.data.Data),l(),p("total",t.data.Data.length)("pageData",t.pageData)}}var Ln=class r extends Ft{constructor(t,i,n,s,y,T){super(t,i,"Adjustment/GetInventoryAdjustmentList","AdjustmentLoader/GetInventoryAdjustmentList",n);this.toastr=n;this.csvConverter=s;this.roleService=y;this.matDialog=T}hideMore=!1;openExportModal(){this.matDialog.open(Wt,{data:{title:"Inventory Adjustment",exportTypes:[{ID:"AdjustmentExport/GetInventoryAdjustmentList",Value:"Default",FileName:"Inventory Adjustment"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/GetInventoryAdjustmentListCount",pagination:!0}})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(_t),C(Ut),C(U),C(ft))};static \u0275cmp=P({type:r,selectors:[["POS-inventory-adjustment"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-5",3,"click",4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","button btn btn-success",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 14px",4,"ngIf"],[2,"width","120px"],[2,"width","100px"],["matTooltipPosition","above","matTooltip","Adjusted Quantity",1,"text-end",2,"width","50px"],[2,"width","130px"],[1,"text-end",2,"width","95px"],["class","border-bottom",4,"ngFor","ngForOf"],["api","Adjustment/GetInventoryAdjustmentListCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fa-solid","fa-trash","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"button","btn","btn-success",3,"routerLink"],[1,"dialog-filter"],["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"],[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"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel","max"],[3,"modelChange","model"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom"],[4,"ngIf"],[3,"routerLink","queryParams"],["class","text-end",4,"ngIf"],["class","text-end",3,"class",4,"ngIf"],[1,"text-end"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(i,n){i&1&&_(0,Ba,33,12,"mainpanel-cmp",1),i&2&&p("ngIf",n.data)},dependencies:[J,V,ut,mt,lt,rr,F,Y,he,Mt,Be,On,Ot,Ht,me,hr,Cr]})};var ki=(i=>(i[i.INPUT=0]="INPUT",i[i.INVENTORY=1]="INVENTORY",i[i.SERIAL=2]="SERIAL",i))(ki||{});var Rn=(t=>(t[t.ADJUST_DIFFERENCES=1]="ADJUST_DIFFERENCES",t[t.UPDATE_INVENTORY=2]="UPDATE_INVENTORY",t))(Rn||{});var we=class{CountedItems;Items;Order;OrderItems;constructor(){this.Items=[],this.Order=new ji}};var ji=class{AdjustedQuantity;Bin;Created;CreatorID;Date;EntityID;EntityName;ID;Modified;ModifierID;Note;Number;PIC;Quantity;ReviewDate;ReviewerID;StateID;StateLabel;TotalPrice;TypeID;TypeLabel;UnitCost;UnitPrice;constructor(){this.ID=w.GuidEmpty,this.EntityID="",this.StateID=1,this.TypeID=1}};var ze=class r{_Data=new fn(new we);Data$=this._Data.asObservable();get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var ye=class r{constructor(e,t,i,n){this.adjustmentDataService=e;this.backEndService=t;this.factoryService=i;this.toastr=n}_notifyNewItem=new st;notifyNewItem$=this._notifyNewItem.asObservable();getItemByCode(e,t){let i;return this.backEndService.getVarianByCode(e,t).pipe(Dt(n=>{let s=this.patchVariantToItem(n);return i=s.Variant,s.Cost=i.UnitCost,s.UnitCost=i.UnitCost,s}))}getItemById(e,t){let i;return this.backEndService.getVariantById(e,t).pipe(Dt(n=>{let s=this.patchVariantToItem(n);return i=s.Variant,s.Cost=i.UnitCost,s.UnitCost=i.UnitCost,s}))}patchVariantToItem(e){let t=new fe;return e=this.factoryService.generateVariantObj(e),t.patchByVariantAdjustment(e),t}updateCartItem(e){let t=this.adjustmentDataService.Data;t.Items=e,this.adjustmentDataService.pushNewValue(t)}addNewItem(e,t){let i=this.checkBehaviourRowItem(e,t);this.updateCartItem(i)}addCartItemByCode(e,t){this.backEndService.getVarianByCode(e,t).subscribe(i=>{this.createNewCartItem(i,"scan")})}createNewCartItem(e,t="add"){let i=new fe;i.patchByVariantAdjustment(e),t=="scan"&&(i.Cost=e.UnitCost),i.UnitPrice=e.UnitPrice,this.addNewItem(i)}removeItem(e){let t=this.adjustmentDataService.Data;t.Items.splice(e.index,1),this.updateCartItem(t.Items)}updateItem(e){let t=this.adjustmentDataService.Data.Items;t[e.index]=e.item,this.updateCartItem(t)}checkBehaviourRowItem(e,t=!1){let i=[];if(t)i=this.adjustmentDataService.Data.Items,this._notifyNewItem.next("NEW"),i.push(e);else{i=this.adjustmentDataService.Data.Items!=null?this.adjustmentDataService.Data.Items:Array();let n=i.findIndex(y=>y.VariantID===e.VariantID),s=e.Quantity;n===-1?(w.IsNotEmpty(s)?e.Quantity=s:e.Quantity=1,this._notifyNewItem.next("NEW"),i.push(e)):w.IsNotEmpty(s)?i[n].Quantity+=s:i[n].Quantity++}return i}static \u0275fac=function(t){return new(t||r)(Rt(ze),Rt(Qe),Rt(ao),Rt(_t))};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var Ai=r=>({selected:r}),Ha=()=>["/menu/Products/Catalog/Variants/Info"],Wa=r=>({ID:r});function qa(r,e){if(r&1){let t=I();a(0,"a",7),g("click",function(){d(t);let n=c();return u(n.onTabChange(n.modalItemState.INVENTORY))}),m(1," Product "),o()}if(r&2){let t=c();p("ngClass",A(1,Ai,t.modalItemState.INVENTORY==t.currentStateTab))}}function Ga(r,e){if(r&1&&(a(0,"div",23)(1,"div",24)(2,"div"),m(3),o(),a(4,"small",25),m(5),o()()()),r&2){let t=e.data;l(3),v(t==null?null:t.Value),l(2),v(t==null?null:t.Code)}}function za(r,e){if(r&1){let t=I();a(0,"div",21)(1,"div",18)(2,"autocompleteV2",22,1),g("onSelect",function(n){d(t);let s=c(2);return u(s.addItem(n))})("keyup.enter",function(n){return d(t),u(n.stopPropagation())})("onInputEnter",function(n){d(t);let s=c(2);return u(s.scanCode(n))}),o(),_(4,Ga,6,2,"ng-template",null,2,ot),o()()}if(r&2){let t=It(5);l(2),p("renderThumbnail",!0)("useCustomTemplate",!0)("itemTemplate",t)}}function $a(r,e){if(r&1){let t=I();a(0,"div",15)(1,"h5"),m(2,"Cost"),o(),a(3,"input",16),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.item.Cost,n)||(s.item.Cost=n),u(n)}),o()()}if(r&2){let t=c(2);l(3),S("ngModel",t.item.Cost)}}function Ka(r,e){if(r&1){let t=I();z(0),_(1,za,6,3,"div",11),a(2,"div")(3,"div",12)(4,"div",13)(5,"h5"),m(6,"Qty"),o(),a(7,"input",14,0),D("ngModelChange",function(n){d(t);let s=c();return x(s.item.Quantity,n)||(s.item.Quantity=n),u(n)}),o()(),a(9,"div",15)(10,"h5"),m(11,"Price"),o(),a(12,"input",16),D("ngModelChange",function(n){d(t);let s=c();return x(s.item.Price,n)||(s.item.Price=n),u(n)}),o()(),_(13,$a,4,1,"div",17),o(),a(14,"div",12)(15,"div",18)(16,"h5",19),m(17,"Note"),o(),a(18,"POS-tinymce-editor",20),D("valueChange",function(n){d(t);let s=c();return x(s.item.Note,n)||(s.item.Note=n),u(n)}),o()()()(),$()}if(r&2){let t=c();l(),p("ngIf",!t.isEdit),l(6),S("ngModel",t.item.Quantity),p("decimalPlaces",t.isItemSerial?0:4)("disabled",t.isAdjustmentEdit&&t.isItemSerial&&t.constants.IsNotEmpty(t.item.ID)),l(5),S("ngModel",t.item.Price),l(),p("ngIf",t.roleService.product.Cost),l(5),S("value",t.item.Note)}}function Ja(r,e){r&1&&(z(0),f(1,"i",37),a(2,"h6"),m(3,"No Image"),o(),$())}function Ya(r,e){if(r&1&&f(0,"img",38),r&2){let t=c(2);p("src",t.item.Variant.ThumbnailUrl,Te)}}function Za(r,e){if(r&1&&(z(0),a(1,"div",21)(2,"div",26)(3,"a",27),_(4,Ja,4,0,"ng-container",28)(5,Ya,1,1,"ng-template",null,3,ot),o()(),a(7,"div",29)(8,"div",30),f(9,"i",31),a(10,"div",32),m(11,"Inventory"),o()(),a(12,"table",33)(13,"tbody")(14,"tr")(15,"td",34),m(16," On Hand "),o(),a(17,"td",35),m(18),b(19,"number"),o()(),a(20,"tr")(21,"td",36),m(22," Allocated "),o(),a(23,"td",35),m(24),b(25,"number"),o()(),a(26,"tr")(27,"td",36),m(28,"Available"),o(),a(29,"td",35),m(30),b(31,"number"),o()(),a(32,"tr")(33,"td",36),m(34,"ROP"),o(),a(35,"td",35),m(36),b(37,"number"),o()(),a(38,"tr")(39,"td",36),m(40,"Max"),o(),a(41,"td",35)(42,"span"),m(43),b(44,"number"),o()()()()()()(),$()),r&2){let t=It(6),i=c();l(3),p("routerLink",Z(19,Ha))("queryParams",A(20,Wa,i.item==null||i.item.Variant==null?null:i.item.Variant.ID)),l(),p("ngIf",(i.item==null||i.item.Variant==null?null:i.item.Variant.ThumbnailUrl)==null)("ngIfElse",t),l(14),O(" ",M(19,9,i.onHand)," "),l(6),O(" ",M(25,11,i.allocated)," "),l(6),O(" ",M(31,13,i.onHand-i.allocated)," "),l(6),O(" ",M(37,15,i.rop)," "),l(7),v(M(44,17,i.max))}}function Xa(r,e){if(r&1){let t=I();z(0),a(1,"POS-tab-serial",39),D("variantChange",function(n){d(t);let s=c();return x(s.item,n)||(s.item=n),u(n)})("serialsChange",function(n){d(t);let s=c();return x(s.serials,n)||(s.serials=n),u(n)}),o(),$()}if(r&2){let t=c();l(),p("isEditBuyForm",!1)("outletID",t.entityID),S("variant",t.item)("serials",t.serials)}}var Qn=class r{constructor(e,t,i,n,s,y){this.httpService=e;this.toastr=t;this.data=i;this.dialogRef=n;this.cartItemService=s;this.roleService=y;this.config=new ht,this.entityID=i.entityID,this.queryInventoryOnOpen=!1,this.currentStateTab=0,this.adjusmentType=i.adjustmentType,this.isAdjustmentEdit=this.data.isAdjustmentEdit,w.IsNotEmpty(i.itemInfo)?(this.isEdit=!0,this.item=vr(fe,this.data.itemInfo.item),this.roleService.inventory.View&&this.requestUnitInStock(),this.config.title=this.item.Variant.Name,this.item.Variant.Ordered!=null&&(this.extraTitle=` Inventory: ${this.item.Variant.UnitsInStock}, Allocated: ${this.item.Variant.Ordered}`,this.toggleInventory=!0)):(this.item=new fe,this.config.title="Add Item"),this.config.customWidth="650px",this.config.bodyScrollable=!0}currentStateTab;modalItemState=ki;onHand;allocated;rop;max;extraTitle;config;item;isEdit=!1;toggleInventory=!1;entityID;separatorKeysCodes=[13,188];constants=w;isFocusSerialInput=!1;isItemSerial=!1;serialOptions;queryInventoryOnOpen;adjusmentType;adjustmentTypeEnum=Rn;isAdjustmentEdit=!1;serials=[];ngOnInit(){this.isItemSerial=this.checkIsSerial()}onOk(e){if(!this.isFocusSerialInput){if(this.generateSerial(),this.item.isSerialType())if(this.item.checkMatchSerialWithQuantity()){if(this.item?.Serial?.length==0){this.toastr.warning("Serial is required","Warning!");return}}else{this.toastr.warning("Serial must be equal with the quantity","Warning!");return}this.isEdit?(this.item.UnitCost=this.item.Cost,this.cartItemService.updateItem({item:this.item,index:this.data.itemInfo.index})):(this.item.UnitCost=this.item.Cost,this.cartItemService.addNewItem(this.item,!0)),this.dialogRef.close()}}generateSerial(){this.isItemSerial&&(!this.item?.Serial||this.item?.Serial?.length==0)&&(this.item.Quantity=this.serials.length,this.item.Serial=this.serials.map(e=>({Quantity:1,Number:e,ExpiryDate:null})))}addItem(e){this.cartItemService.getItemById(e,this.data.entityID).subscribe(t=>{this.item=t,this.isItemSerial=this.checkIsSerial(),this.config.title=this.item.Variant.Name})}onTabChange(e){this.currentStateTab=e,e==1&&!this.queryInventoryOnOpen&&this.requestUnitInStock()}requestUnitInStock(){if(w.IsEmpty(this.entityID)){this.toastr.error("Please select outlet before proceeding..",X.Error);return}this.httpService.get(pt.GetVariantStockByID,[{key:"ID",value:this.item.Variant.ID},{key:"EntityID",value:this.entityID}]).subscribe(e=>{this.queryInventoryOnOpen=!0,this.onHand=e.OnHand,this.allocated=e.Allocated,this.rop=e.ROP,this.max=e.Max})}scanCode(e){this.cartItemService.getItemByCode(e,this.entityID).subscribe(t=>{this.item=t,this.isItemSerial=this.checkIsSerial(),this.config.title=this.item.Variant.Name,this.toggleInventory=!1})}onFocusAddSerial(){this.isFocusSerialInput=!0}onBlurAddSerial(){this.isFocusSerialInput=!1}checkIsSerial(){return this.item.Variant!=null?this.item.Variant.TypeID==4:!1}static \u0275fac=function(t){return new(t||r)(C(k),C(_t),C(_e),C(gt),C(ye),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-modal-item"]],decls:14,vars:11,consts:[["qty",""],["variant",""],["itemTemplate",""],["SHOW_IMAGE",""],[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"row","border-bottom"],[1,"btn","btn-link",3,"click","ngClass"],["class","btn btn-link",3,"ngClass","click",4,"ngIf"],[1,"container-fluid","mt-5"],[4,"ngIf"],["class","row",4,"ngIf"],[1,"row","mt-5"],[1,"col-auto"],["type","text","autoNum","",1,"mt-5","form-control",2,"width","100px",3,"ngModelChange","ngModel","decimalPlaces","disabled"],[1,"col-auto","ps-0"],["type","text","autoNum","",1,"mt-5","form-control",2,"width","100px",3,"ngModelChange","ngModel"],["class","col-auto ps-0",4,"ngIf"],[1,"col-12"],[1,"mb-5"],["height","220px",3,"valueChange","value"],[1,"row"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"onSelect","keyup.enter","onInputEnter","renderThumbnail","useCustomTemplate","itemTemplate"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink","queryParams"],[4,"ngIf","ngIfElse"],[1,"col-sm-6"],[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","border"],[1,"table-light","text-start","border-0",2,"width","100px"],[1,"text-end"],[1,"table-light","text-start","border-0"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"border","rounded",3,"src"],[3,"variantChange","serialsChange","isEditBuyForm","outletID","variant","serials"]],template:function(t,i){t&1&&(a(0,"modal-material",4),g("onOk",function(s){return i.onOk(s)})("onCancel",function(){return i.dialogRef.close()})("onClose",function(){return i.dialogRef.close()}),a(1,"content")(2,"div",5)(3,"div",6)(4,"div")(5,"a",7),g("click",function(){return i.onTabChange(i.modalItemState.INPUT)}),m(6," Cart "),o(),_(7,qa,2,3,"a",8),a(8,"a",7),g("click",function(){return i.onTabChange(i.modalItemState.SERIAL)}),m(9," Serial "),o()()()(),a(10,"div",9),_(11,Ka,19,7,"ng-container",10)(12,Za,45,22,"ng-container",10)(13,Xa,2,4,"ng-container",10),o()()()),t&2&&(p("config",i.config),l(5),p("ngClass",A(7,Ai,i.modalItemState.INPUT==i.currentStateTab)),l(2),p("ngIf",i.roleService.inventory.View&&(i.item==null||i.item.Variant==null?null:i.item.Variant.Name)),l(),p("ngClass",A(9,Ai,i.modalItemState.SERIAL==i.currentStateTab)),l(3),p("ngIf",i.modalItemState.INPUT==i.currentStateTab),l(),p("ngIf",i.modalItemState.INVENTORY==i.currentStateTab),l(),p("ngIf",i.modalItemState.SERIAL==i.currentStateTab))},dependencies:[Ee,V,ut,lt,F,Y,Le,Ct,Ot,He,qe,it],styles:[".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}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}"]})};var Bn=class r{constructor(e,t){this.data=e;this.dialogRef=t;this.config=new ht,this.config.title="Note",this.adjustmentData=this.data}adjustmentData;config;onOk(e){e!="Enter"&&this.dialogRef.close()}static \u0275fac=function(t){return new(t||r)(C(_e),C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-note"]],decls:9,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row"],[1,"col-12"],["type","text","placeholder","PIC",1,"text","w-100",3,"ngModelChange","ngModel"],[1,"row","mt-5"],["placeholder","Notes",2,"width","250px","height","120px",3,"ngModelChange","ngModel"]],template:function(t,i){t&1&&(a(0,"modal-material",0),g("onOk",function(s){return i.onOk(s)})("onCancel",function(){return i.dialogRef.close()})("onClose",function(){return i.dialogRef.close()}),a(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"input",4),D("ngModelChange",function(s){return x(i.adjustmentData.Order.PIC,s)||(i.adjustmentData.Order.PIC=s),s}),o()()(),a(6,"div",5)(7,"div",3)(8,"textarea",6),D("ngModelChange",function(s){return x(i.adjustmentData.Order.Note,s)||(i.adjustmentData.Order.Note=s),s}),o()()()()()()),t&2&&(p("config",i.config),l(5),S("ngModel",i.adjustmentData.Order.PIC),l(3),S("ngModel",i.adjustmentData.Order.Note))},dependencies:[lt,F,Y,Ct]})};var Hn=class r{constructor(e,t,i){this.backEndService=e;this.data=t;this.dialogRef=i;this.config=new ht,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0,this.adjustmentData=this.data}adjustmentData;config;submit(e){this.adjustmentData.Items.forEach(t=>delete t.UnitPriceOriginal),this.adjustmentData.Order.StateID=e,this.backEndService.submitTransaction(this.adjustmentData,pt.SubmitAdjustment).subscribe(t=>{this.dialogRef.close(t)})}static \u0275fac=function(t){return new(t||r)(C(Qe),C(_e),C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-submit"]],decls:9,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid",2,"width","500px","display","flex","justify-content","space-around"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-file-pen"],[1,"btn","btn-outline-secondary","ms-5",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-user-magnifying-glass"]],template:function(t,i){t&1&&(a(0,"modal-material",0),g("onCancel",function(){return i.dialogRef.close()})("onClose",function(){return i.dialogRef.close()}),a(1,"content")(2,"div",1)(3,"div",2),g("click",function(){return i.submit(1)}),f(4,"i",3),m(5," Save as Draft "),o(),a(6,"div",4),g("click",function(){return i.submit(2)}),f(7,"i",5),m(8," Submit for Review "),o()()()()),t&2&&p("config",i.config)},dependencies:[Ct]})};function ts(r,e){if(r&1){let t=I();a(0,"div",1)(1,"div",2),g("click",function(){d(t);let n=c();return u(n.openOutletModal())}),f(2,"i",3)(3,"input",4),b(4,"limitTo"),o(),a(5,"div",5)(6,"datepicker",6),D("dateChange",function(n){d(t);let s=c();return x(s.adjustmentData.Order.Date,n)||(s.adjustmentData.Order.Date=n),u(n)}),o()(),a(7,"div",7),f(8,"i",8),a(9,"input",9),D("ngModelChange",function(n){d(t);let s=c();return x(s.adjustmentData.Order.Number,n)||(s.adjustmentData.Order.Number=n),u(n)}),o()(),a(10,"div",10)(11,"ng-select",11),D("ngModelChange",function(n){d(t);let s=c();return x(s.adjustmentData.Order.TypeID,n)||(s.adjustmentData.Order.TypeID=n),u(n)}),o()()()}if(r&2){let t=c();l(3),p("value",Q(4,10,t.outletName,20))("placeholder",t.outletName),l(3),S("date",t.adjustmentData.Order.Date),p("matTooltip",t.role!=null&&t.role.Date?"":"Date role is required")("disabled",!(t.role!=null&&t.role.Date)),l(3),S("ngModel",t.adjustmentData.Order.Number),p("disabled",!(t.role!=null&&t.role.Number)),l(2),p("disabled",t.isEdit),S("ngModel",t.adjustmentData.Order.TypeID),p("items",t.adjustmentTypes)}}var Wn=class r{adjustmentData;adjustmentTypes;outletName;isEdit;role;onOpenOutletModal=new nt;openOutletModal(){this.onOpenOutletModal.emit()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-toolbar"]],inputs:{adjustmentData:"adjustmentData",adjustmentTypes:"adjustmentTypes",outletName:"outletName",isEdit:"isEdit",role:"role"},outputs:{onOpenOutletModal:"onOpenOutletModal"},decls:1,vars:1,consts:[["class","row header g-0 py-4 border-bottom",4,"ngIf"],[1,"row","header","g-0","py-4","border-bottom"],[1,"col-auto",3,"click"],["matTooltipPosition","above","matTooltip","Outlet",1,"fa-solid","fa-house"],["readonly","",1,"outlet","cursor",3,"value","placeholder"],[1,"col-auto","me-5","date"],["appearance","fill","matTooltipPosition","above","name","orderDate",3,"dateChange","date","matTooltip","disabled"],[1,"col-auto","me-5"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Order number",1,"fa-regular","fa-file-lines"],["type","text","placeholder","Adjustment Number",1,"number",2,"width","180px",3,"ngModelChange","ngModel","disabled"],[1,"col-auto","me-5","d-flex"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",2,"width","381px",3,"ngModelChange","disabled","ngModel","items"]],template:function(t,i){t&1&&_(0,ts,12,13,"div",0),t&2&&p("ngIf",i.adjustmentData)},dependencies:[V,lt,F,Y,he,Mt,Ht,yr],styles:[".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}.date[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{top:3px!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-form-field-flex{background-color:#e9ecef!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-form-field-flex input{opacity:1!important;color:#00000061!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field{padding-right:0!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field .mat-mdc-text-field-wrapper{padding-bottom:0;background-color:#fff;padding-left:0}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-flex{width:147px;height:35px;border:1px solid rgb(207,207,207);margin-left:40px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix{border:none!important;top:5px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix input{font-size:14px;color:#000}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-form-field-infix{padding-top:4px;padding-bottom:4px;padding-left:8px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix{position:relative;left:-140px;top:1px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix .mat-mdc-button-persistent-ripple{color:#000}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix button.mat-mdc-icon-button.mat-mdc-button-base{padding:0}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mdc-line-ripple{display:none}.date[_ngcontent-%COMP%] datepicker.date-warnings[_ngcontent-%COMP%] .mat-mdc-form-field-flex{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.small[_ngcontent-%COMP%]{margin-right:5px!important}.small[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:143px}.col-auto[_ngcontent-%COMP%]{font-size:.875rem;height:fit-content}.col-auto[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1.25rem;color:#3b3b3b;margin-right:5px;line-height:unset!important;position:relative;top:2px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .col-auto[_ngcontent-%COMP%] span.outlet[_ngcontent-%COMP%]{padding:4px 8px 3px 5px;border:1px solid #dddddd;font-size:.875rem}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:36px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:disabled{background-color:#e9ecef!important;opacity:1!important;color:#00000061!important}.col-auto[_ngcontent-%COMP%] .outlet[_ngcontent-%COMP%]{width:165px;color:#337ab7;background:#fff}.col-auto[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:150px}.col-auto.supplier[_ngcontent-%COMP%] autocompleteV2[_ngcontent-%COMP%] input{font-size:14px}"]})};var qn=class r{onSubmit=new nt;onOpenVoidModal=new nt;onOpenNoteModal=new nt;submit(){this.onSubmit.emit()}openVoidModal(){this.onOpenVoidModal.emit()}openNoteModal(){this.onOpenNoteModal.emit()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-cart-action"]],outputs:{onSubmit:"onSubmit",onOpenVoidModal:"onOpenVoidModal",onOpenNoteModal:"onOpenNoteModal"},decls:10,vars:0,consts:[[1,"mt-5","d-flex","action-button","justify-content-between",2,"padding-left","120px"],[1,"btn","btn-gray","fw-bold","border","text-dark",2,"height","60px","width","120px",3,"click"],[1,"fa-solid","fa-note-sticky"],[1,"btn","btn-gray","fw-bold","border","text-dark","mx-5",2,"height","60px","width","120px",3,"click"],[1,"fa-solid","fa-rectangle-xmark"],[1,"btn","btn-success","d-flex","justify-content-around","align-items-center",2,"height","60px","width","200px",3,"click"],[1,"fw-bold"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"button",1),g("click",function(){return i.openNoteModal()}),f(2,"i",2),m(3," NOTE "),o(),a(4,"button",3),g("click",function(){return i.openVoidModal()}),f(5,"i",4),m(6," VOID "),o(),a(7,"button",5),g("click",function(){return i.submit()}),a(8,"span",6),m(9,"PROCESS"),o()()())},styles:[".btn-gray[_ngcontent-%COMP%]{background:linear-gradient(to bottom,#fff,#eee)}.action-button[_ngcontent-%COMP%]{width:550px}"]})};var fo=r=>({ID:r}),is=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function rs(r,e){if(r&1&&(a(0,"div",21)(1,"div",20),m(2),o(),a(3,"div",20),m(4),b(5,"number"),o()()),r&2){let t=e.$implicit;l(2),v(t.Variant.Name),l(2),v(M(5,2,t.Quantity))}}var Gn=class r{total;cartItems;completeInfo;onUndo=new nt;onNewForm=new nt;undo(){this.onUndo.emit()}newForm(){this.onNewForm.emit()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-complete"]],inputs:{total:"total",cartItems:"cartItems",completeInfo:"completeInfo"},outputs:{onUndo:"onUndo",onNewForm:"onNewForm"},decls:31,vars:16,consts:[[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","bg-light-gray","py-3"],["type","button","routerLink","/print/Adjustment","target","_blank",1,"btn","btn-light-gray",3,"queryParams"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px","border-bottom","1px solid rgba(0, 0, 0, 0.125)"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body"],["class","row justify-content-between mb-5",4,"ngFor","ngForOf"],[1,"row","justify-content-between","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col","text-start"],[1,"row","justify-content-between","mb-5"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h1",4),f(5,"i",5),m(6,"Inventory Adjustment Complete"),o()(),a(7,"div",6)(8,"div",7)(9,"div",8)(10,"a",9),g("click",function(){return i.newForm()}),m(11,"New Adjustment (F8)"),o()()()(),a(12,"div",10)(13,"a",11),f(14,"i",12),m(15,"Print "),o()()()(),a(16,"div",13)(17,"div",2)(18,"div",14)(19,"h2",15)(20,"a",16),m(21),o()()(),a(22,"div",17),_(23,rs,6,4,"div",18),a(24,"div",19)(25,"div",20),m(26,"Total Quantity:"),o(),a(27,"div",20),m(28),b(29,"sum"),b(30,"number"),o()()()()()()),t&2&&(l(13),p("queryParams",A(11,fo,i.completeInfo.OrderID)),l(7),p("routerLink",Z(13,is))("queryParams",A(14,fo,i.completeInfo.OrderID)),l(),O("#",i.completeInfo.InvoiceNumber,""),l(2),p("ngForOf",i.cartItems),l(5),v(M(30,9,Q(29,6,i.cartItems,"Quantity"))))},dependencies:[J,ut,it,ge]})};var ss=["cartContainer"];function ls(r,e){r&1&&f(0,"th",19)}function ms(r,e){r&1&&f(0,"th",20)}function ps(r,e){r&1&&(a(0,"th",21),m(1,"Cost"),o())}function cs(r,e){r&1&&(a(0,"th",22),m(1,"Total"),o())}function ds(r,e){if(r&1&&(a(0,"td")(1,"small"),m(2),o()()),r&2){let t=c().index;l(2),O("",t+1,".")}}function us(r,e){if(r&1&&(a(0,"i",27),m(1),o()),r&2){let t=c().$implicit;l(),O("",t.Variant.CategoryName," ")}}function _s(r,e){if(r&1&&(z(0),f(1,"span",32),$()),r&2){let t=c().$implicit;l(),p("innerHTML",t.Note,R)}}function gs(r,e){if(r&1&&(a(0,"td",30),m(1),o()),r&2){let t=c().$implicit;l(),v(t.Variant.UOM!="null"?t.Variant.UOMName:"")}}function fs(r,e){if(r&1&&(a(0,"td",30),m(1),b(2,"number"),o()),r&2){let t=c().$implicit;l(),v(M(2,1,t.Cost))}}function hs(r,e){if(r&1&&(a(0,"td",30),m(1),b(2,"number"),o()),r&2){let t=c().$implicit;l(),v(M(2,1,t.Cost*t.Quantity))}}function Cs(r,e){if(r&1){let t=I();a(0,"tr",23),g("click",function(){let n=d(t),s=n.$implicit,y=n.index,T=c();return u(T.onSelect({item:s,index:y}))})("contextmenu",function(n){let s=d(t),y=s.$implicit,T=s.index,tt=c();return u(tt.onContextMenu(n,y,T))}),a(1,"td",24)(2,"i",25),g("click",function(){let n=d(t),s=n.$implicit,y=n.index,T=c();return u(T.onRemove({item:s,index:y}))}),o()(),_(3,ds,3,1,"td",26),a(4,"td")(5,"span",27),m(6),o(),_(7,us,2,1,"i",28),f(8,"app-serial-note",29),_(9,_s,2,1,"ng-container",26),o(),a(10,"td"),m(11),o(),a(12,"td",30),m(13),b(14,"number"),a(15,"span"),m(16),o()(),_(17,gs,2,1,"td",31)(18,fs,3,3,"td",31)(19,hs,3,3,"td",31),o()}if(r&2){let t=e.$implicit,i=c();p("cdkDragDisabled",!i.enabledDragDrop),l(3),p("ngIf",i.appConfig.ModuleSell.Grid.RowNumberVisible),l(3),v(t.Variant.Name),l(),p("ngIf",i.appConfig.ModuleSell.Grid.CategoryVisible),l(),p("serials",t.Serial),l(),p("ngIf",t.Note),l(2),v(t.Variant.Code),l(2),O(" ",M(14,12,t.Quantity),""),l(3),v(t.UnitQuantity>1?"@"+t.UnitQuantity:""),l(),p("ngIf",i.appConfig.ModuleSell.Grid.UOMVisible),l(),p("ngIf",i.roleService.product.Cost),l(),p("ngIf",i.roleService.product.Cost)}}function ys(r,e){if(r&1){let t=I();a(0,"button",33),g("click",function(){let n=d(t).item,s=c();return u(s.onReverse(n,!0))}),m(1,"Return"),o(),a(2,"button",33),g("click",function(){let n=d(t).item,s=c();return u(s.onReverse(n,!1))}),m(3,"Purchase"),o()}}var zn=class r{constructor(e,t,i){this.loadService=e;this.cartItemService=t;this.roleService=i;this.cartItems=[],this.destroy$=new st,this.onSelectItem=new nt,this.onReturnItem=new nt,this.onPurchaseItem=new nt,this.onRemoveItem=new nt,this.onDragItem=new nt,this.cartItemsChange=new nt,this.cartItemService.notifyNewItem$.pipe(H(n=>w.IsNotEmpty(n))).subscribe({next:n=>{setTimeout(()=>{let s=this.cartContainer.nativeElement.scrollHeight;this.cartContainer.nativeElement.scrollTop=s},1)}})}cartItems;cartItemsChange;onSelectItem;onReturnItem;onPurchaseItem;onRemoveItem;onDragItem;entities;cartContainer;contextMenu;contextMenuPosition={x:"0px",y:"0px"};onContextMenu(e,t,i){e.preventDefault(),this.contextMenuPosition.x=e.clientX+"px",this.contextMenuPosition.y=e.clientY+"px",t.Index=i,this.contextMenu.menuData={item:t},this.contextMenu.openMenu()}onDrop(e){ur(this.cartItems,e.previousIndex,e.currentIndex),this.cartItemService.updateCartItem(this.cartItems),this.onDragItem.emit(this.cartItems),this.cartItemsChange.emit(this.cartItems)}destroy$;appConfig;enabledDragDrop=!0;ngOnInit(){this.initAppConfig(),this.initDragDropEnabled()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}initDragDropEnabled(){w.isMobileDevice&&(this.enabledDragDrop=!1)}initAppConfig(){this.appConfig=this.loadService.Data.AppConfigJSON,this.entities=this.loadService.Data.Entities}onRemove(e){this.onRemoveItem.emit(e)}onSelect(e){this.onSelectItem.emit(e)}onReverse(e,t){t?(e.Quantity>0&&(e.Quantity=e.Quantity*-1),this.onReturnItem.emit(e)):(e.Quantity<0&&(e.Quantity=e.Quantity*-1),this.onPurchaseItem.emit(e))}static \u0275fac=function(t){return new(t||r)(C(Nn),C(ye),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-cart-display"]],viewQuery:function(t,i){if(t&1&&(ln(ss,5),ln(kn,7)),t&2){let n;mn(n=pn())&&(i.cartContainer=n.first),mn(n=pn())&&(i.contextMenu=n.first)}},inputs:{cartItems:"cartItems"},outputs:{cartItemsChange:"cartItemsChange",onSelectItem:"onSelectItem",onReturnItem:"onReturnItem",onPurchaseItem:"onPurchaseItem",onRemoveItem:"onRemoveItem",onDragItem:"onDragItem"},decls:24,vars:10,consts:[["cartContainer",""],["contextMenu","matMenu"],[1,"cashier"],[1,"row","g-0","cart-table","border-bottom"],["cdkScrollable","",1,"col"],[1,"table"],[1,"border-start-0"],[2,"width","18px"],["style","width: 36px",4,"ngIf"],[1,"text-start",2,"width","250px"],[2,"cursor","pointer","width","60px"],[1,"text-end",2,"width","50px"],["class","text-end","style","width: 0.75rem",4,"ngIf"],["class","text-end","style","width: 90px;",4,"ngIf"],["class","text-end","style","width: 85px;",4,"ngIf"],["cdkDropList","",1,"itemList",3,"cdkDropListDropped"],["class","item","cdkDrag","",3,"cdkDragDisabled","click","contextmenu",4,"ngFor","ngForOf"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["matMenuContent",""],[2,"width","36px"],[1,"text-end",2,"width","0.75rem"],[1,"text-end",2,"width","90px"],[1,"text-end",2,"width","85px"],["cdkDrag","",1,"item",3,"click","contextmenu","cdkDragDisabled"],[1,"cursor"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Click to Remove",1,"fa","fa-xmark","text-danger",3,"click"],[4,"ngIf"],[1,"d-block"],["class","d-block",4,"ngIf"],[3,"serials"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"innerHTML"],["mat-menu-item","",3,"click"]],template:function(t,i){if(t&1){let n=I();a(0,"div",2)(1,"div",3)(2,"div",4,0)(4,"table",5)(5,"thead")(6,"tr",6),f(7,"th",7),_(8,ls,1,0,"th",8),a(9,"th",9),m(10,"Item"),o(),a(11,"th",10),m(12,"Code"),o(),a(13,"th",11),m(14,"Qty"),o(),_(15,ms,1,0,"th",12)(16,ps,2,0,"th",13)(17,cs,2,0,"th",14),o()(),a(18,"tbody",15),g("cdkDropListDropped",function(y){return d(n),u(i.onDrop(y))}),_(19,Cs,20,14,"tr",16),o()()()(),f(20,"div",17),a(21,"mat-menu",null,1),_(23,ys,4,0,"ng-template",18),o()()}if(t&2){let n=It(22);l(8),p("ngIf",i.appConfig.ModuleSell.Grid.RowNumberVisible),l(7),p("ngIf",i.appConfig.ModuleSell.Grid.UOMVisible),l(),p("ngIf",i.roleService.product.Cost),l(),p("ngIf",i.roleService.product.Cost),l(2),p("ngForOf",i.cartItems),l(),tr("left",i.contextMenuPosition.x)("top",i.contextMenuPosition.y),p("matMenuTriggerFor",n)}},dependencies:[J,V,or,Tr,Mr,Or,kn,Sn,xn,Ht,Ce,it],styles:[".cashier[_ngcontent-%COMP%]{width:550px;max-width:37rem;min-width:33rem}div.row.cart-table[_ngcontent-%COMP%]{border-left:solid 1px #CFCFCF}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%]{overflow:auto;height:250px}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background:#fbfbf7}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:.75rem;padding:9px 5px!important}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:.75rem;padding:6px 5px;border-bottom:1px solid #CFCFCF}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child{padding-right:0}.cdk-drag-preview[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}.item[_ngcontent-%COMP%]:last-child{border:none}.itemList.cdk-drop-list-dragging[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}"]})};var Is=()=>["/menu/Adjustment/Adjustment/Archive"];function bs(r,e){r&1&&(a(0,"a",4),m(1,"Cancel"),o()),r&2&&p("routerLink",Z(1,Is))}function xs(r,e){if(r&1){let t=I();a(0,"div",11)(1,"POS-cart-header",12),g("onCreateItem",function(){d(t);let n=c(2);return u(n.selectItem())})("onOpenUploadModal",function(){d(t);let n=c(2);return u(n.openUploadModal())})("onAddItem",function(n){d(t);let s=c(2);return u(s.addItem(n))})("onScanCode",function(n){d(t);let s=c(2);return u(s.onScanBarcode(n))}),o(),a(2,"POS-cart-display",13),g("onRemoveItem",function(n){d(t);let s=c(2);return u(s.removeItem(n))})("onSelectItem",function(n){d(t);let s=c(2);return u(s.selectItem(n))})("onDragItem",function(n){d(t);let s=c(2);return u(s.saveItemAfterDrag(n))})("onReturnItem",function(n){d(t);let s=c(2);return u(s.onReturnOrPurchaseItem(n))})("onPurchaseItem",function(n){d(t);let s=c(2);return u(s.onReturnOrPurchaseItem(n))}),o(),a(3,"POS-cart-action",14),g("onSubmit",function(){d(t);let n=c(2);return u(n.submit())})("onOpenVoidModal",function(){d(t);let n=c(2);return u(n.openVoidModal())})("onOpenNoteModal",function(){d(t);let n=c(2);return u(n.openNoteModal())}),o()()}if(r&2){let t=c(2);l(),p("cartItems",t.cartItems)("isUpload",!0),l(),p("cartItems",t.cartItems)}}function Ss(r,e){if(r&1){let t=I();a(0,"div",5)(1,"POS-toolbar",6),g("onOpenOutletModal",function(){d(t);let n=c();return u(n.openOutletModal())}),o(),a(2,"div",7)(3,"div",8),f(4,"pos-quick-key",9),o(),_(5,xs,4,3,"div",10),o()()}if(r&2){let t=c();l(),p("adjustmentData",t.adjustmentData)("adjustmentTypes",t.adjustmentTypes)("outletName",t.outletName)("isEdit",t.isEdit)("role",t.role.global),l(3),p("quickKeyId",t.quickKeyId)("outletID",t.outletID),l(),p("ngIf",t.adjustmentStorage)}}function Ds(r,e){if(r&1){let t=I();a(0,"div",15)(1,"POS-complete",16),g("onUndo",function(){d(t);let n=c();return u(n.undo())})("onNewForm",function(){d(t);let n=c();return u(n.newForm())}),o()()}if(r&2){let t=c();l(),p("total",t.total)("cartItems",t.cartItems)("completeInfo",t.completeInfo)}}var $n=class r extends ue{constructor(t,i,n,s,y,T,tt,bt,xt,yt,At,Bt){super(t);this.adjustmentDataService=n;this.firstLoadService=s;this.matDialog=y;this.backEndService=T;this.quickKeyService=tt;this.cartItemService=bt;this.toastr=xt;this.router=yt;this.route=At;this.role=Bt;this.destroy$=new st,this.adjustmentDataService.Data$.pipe(et(this.destroy$)).subscribe(St=>{this.adjustmentData=St,this.fillCartItems()}),this.quickKeyService.onSelectQuickeyItem$.pipe(et(this.destroy$),H(St=>w.IsNotEmpty(St.id)),ae(St=>this.cartItemService.getItemById(St.id,St.entityID))).subscribe(St=>this.cartItemService.addNewItem(St))}quickKeyId;adjustmentData;adjustmentStorage;adjustmentTypes;outletID=w.GuidEmpty;outletName="Choose an Outlet";entities;cartItems;completeInfo;isComplete;total=0;destroy$;isEdit;handleF8(){this.isComplete&&this.newForm()}ngOnInit(){this.initLoadForm()}ngOnDestroy(){this.adjustmentDataService.pushNewValue(new we),this.quickKeyService.Data=new Jr,this.destroy$.next(!0),this.destroy$.complete()}initLoadForm(){this.menuData$.subscribe(()=>{let t=this.adjustmentData.Order.ID;w.IsEmpty(t)&&w.IsNotEmpty(this.route.snapshot.queryParams.ID)&&(t=this.route.snapshot.queryParams.ID,this.isEdit=!0);let i=this.adjustmentData.Order.EntityID;this.firstLoadService.getStorage(pt.LoadFormAdjustment,t,i).subscribe(n=>{this.fillData(n),w.IsEmpty(t)&&this.entities.length>1?this.openOutletModal():this.entities.length==1&&Ie([this.backEndService.generateNumber(this.outletID,pt.AdjustmentGenerateNumber),this.backEndService.getQuickKey(this.outletID,pt.GetQuickKeyByEntityID)]).subscribe(([s,y])=>{this.adjustmentData.Order.Number=s.Number,this.initQuickKey(y)})})})}fillData(t){if(this.adjustmentStorage=t,this.isEdit&&(this.menuData.H=`Edit Adjustment #${t.Data.Order.Number}`),this.firstLoadService.pageState=2,this.entities=this.adjustmentStorage.Entities,this.entities.length==1&&(this.outletID=this.entities[0].ID,this.outletName=this.entities[0].Name,this.adjustmentData.Order.EntityID=this.outletID),this.adjustmentTypes=this.adjustmentStorage.AdjustmentTypes,this.adjustmentData.Order.TypeID=this.adjustmentStorage.AppConfigJSON.ModuleAdjustment.Advance.AdjustmentInputType,w.IsEmpty(this.adjustmentData.Order.Date)&&(this.adjustmentData.Order.Date=this.adjustmentStorage.ServerTime.toString()),w.IsNotEmpty(t.Data)){this.adjustmentDataService.pushNewValue(t.Data),this.outletID=t.Data.Order.EntityID;let i=this.entities.find(n=>n.ID==this.outletID);this.outletName=i.Name,this.quickKeyId=i.QuickKeyTemplateID,this.backEndService.getQuickKey(this.outletID,pt.GetQuickKeyByEntityID).subscribe(n=>this.initQuickKey(n))}}fillCartItems(){this.cartItems=[];let t;this.adjustmentData.Items.forEach(i=>{t=new fe,t.ID=i.ID,t.Taxable=i.Taxable,i.Variant.Serial=i.Serial,t.Quantity=i.Quantity,t.Note=i.Note,t.Cost=i.Cost,t.patchByVariantAdjustment(i.Variant),this.cartItems.push(t)})}openOutletModal(){this.isEdit||this.matDialog.open(eo,{data:{Entities:this.entities}}).afterClosed().pipe(H(t=>w.IsNotEmpty(t)),L(t=>{this.outletName=t.outlet.Name,this.outletID=t.outlet.ID,this.quickKeyId=t.outlet.QuickKeyTemplateID,this.adjustmentData.Order.EntityID=this.outletID}),ae(()=>Ie([this.backEndService.generateNumber(this.outletID,pt.AdjustmentGenerateNumber),this.backEndService.getQuickKey(this.outletID,pt.GetQuickKeyByEntityID)]))).subscribe(([t,i])=>{this.adjustmentData.Order.Number=t.Number,this.initQuickKey(i)})}initQuickKey(t){this.quickKeyService.Data=t,this.quickKeyService.EntityID=this.outletID}saveItemAfterDrag(t){this.cartItemService.updateCartItem(t)}removeItem(t){this.cartItemService.removeItem(t)}selectItem(t){this.matDialog.open(Qn,{data:{itemInfo:t,entityID:this.outletID,adjustmentType:this.adjustmentData.Order.TypeID,isAdjustmentEdit:this.isEdit}})}addItem(t){this.cartItemService.getItemById(t,this.outletID).subscribe(i=>this.cartItemService.addNewItem(i))}onScanBarcode(t){this.cartItemService.addCartItemByCode(t,this.outletID)}openUploadModal(){this.matDialog.open(jn,{data:{sampleUrl:"https://res.cloudinary.com/pos/raw/upload/v1699867623/POS/CSV/ImportAdjustment_DealPOS_New.csv",API:"/API/Adjustment/UploadCsvV2",outletID:this.outletID}}).afterClosed().pipe(H(t=>w.IsNotEmpty(t)&&t.length>0)).subscribe(t=>t.forEach(i=>this.cartItemService.addNewItem(i,!0)))}openNoteModal(){this.matDialog.open(Bn,{data:this.adjustmentData})}openVoidModal(){this.matDialog.open(io).afterClosed().pipe(H(t=>t)).subscribe(()=>{let t=this.adjustmentData.Order.Number;this.adjustmentDataService.pushNewValue(new we),this.adjustmentData.Order.EntityID=this.outletID,this.adjustmentData.Order.Number=t,this.initLoadForm()})}submit(){if(w.IsEmpty(this.adjustmentData.Order.EntityID)){this.toastr.error("Please select outlet before proceeding..",X.Error),this.openOutletModal();return}if(this.cartItems.length==0){this.toastr.error("You must have at least one item.",X.Error);return}if(w.IsEmpty(this.adjustmentData.Order.Number)){this.toastr.error("Number cannot be empty.",X.Error);return}if(this.validateItemSerial()==!1){this.toastr.warning(Ir.serialRequired,X.Warning);return}this.adjustmentStorage.AppConfigJSON.ModuleAdjustment.Basic.Workflow===1?(this.adjustmentData.Order.StateID=4,this.adjustmentData.Items.forEach(t=>delete t.UnitPriceOriginal),this.backEndService.submitTransaction(this.adjustmentData,pt.SubmitAdjustment).subscribe(t=>{this.completeInfo=t,this.isComplete=!0,this.adjustmentData.Order.ID=t.OrderID,this.calculateTotal()})):this.isEdit?(this.adjustmentData.Items.forEach(t=>delete t.UnitPriceOriginal),this.backEndService.submitTransaction(this.adjustmentData,pt.SubmitAdjustment).subscribe(t=>{this.completeInfo=t,this.isComplete=!0,this.adjustmentData.Order.ID=t.OrderID,this.calculateTotal()})):this.matDialog.open(Hn,{data:this.adjustmentData}).afterClosed().pipe(H(t=>w.IsNotEmpty(t))).subscribe(t=>{this.completeInfo=t,this.isComplete=!0,this.adjustmentData.Order.ID=t.OrderID,this.calculateTotal()})}validateItemSerial(){let t=0;return this.getItemSerial().forEach(n=>{(n.Serial?.length==0||w.IsEmpty(n.Serial))&&(t+=1)}),t==0}getItemSerial(){return this.cartItems.filter(i=>i.Variant.TypeID==4)}calculateTotal(){this.cartItems.forEach(t=>this.total+=t.Cost)}undo(){this.isComplete=!1,this.initLoadForm()}newForm(){this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Form"]).then(()=>window.location.reload())}onReturnOrPurchaseItem(t){this.cartItemService.updateItem({item:t,index:t.Index})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(ze),C(Nn),C(ft),C(Qe),C(Yr),C(ye),C(_t),C(wt),C(pe),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-new-inventory-adjustment"]],hostBindings:function(i,n){i&1&&g("keydown.F8",function(){return n.handleF8()},!1,Vt)},features:[dt],decls:6,vars:6,consts:[[3,"hideSearchDropdown","hideSearchBox","pageData"],["class","btn btn-outline-secondary",3,"routerLink",4,"ngIf"],["class","container-fluid",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid"],[3,"onOpenOutletModal","adjustmentData","adjustmentTypes","outletName","isEdit","role"],[1,"row","row","body","g-0","mt-4","justify-content-start"],[1,"col-auto","quickKey"],[3,"quickKeyId","outletID"],["class","col-auto cart ms-5",4,"ngIf"],[1,"col-auto","cart","ms-5"],[3,"onCreateItem","onOpenUploadModal","onAddItem","onScanCode","cartItems","isUpload"],[3,"onRemoveItem","onSelectItem","onDragItem","onReturnItem","onPurchaseItem","cartItems"],[3,"onSubmit","onOpenVoidModal","onOpenNoteModal"],[1,"container-fluid","mt-5"],[3,"onUndo","onNewForm","total","cartItems","completeInfo"]],template:function(i,n){i&1&&(a(0,"mainpanel-cmp",0)(1,"actions"),_(2,bs,2,2,"a",1),o(),a(3,"content"),_(4,Ss,6,8,"div",2)(5,Ds,2,3,"div",3),o()()),i&2&&(p("hideSearchDropdown",!0)("hideSearchBox",!0)("pageData",n.menuData),l(2),p("ngIf",!n.isComplete),l(2),p("ngIf",!n.isComplete),l(),p("ngIf",n.isComplete))},dependencies:[V,ut,mt,so,Xr,Wn,qn,Gn,zn]})};var Kn=class r{constructor(e){this.dialogRef=e;this.config=new ht,this.config.title="Export Adjustment Report",this.config.customWidth="382px"}pageNumber=1;pageSize=100;config;onOk(){this.dialogRef.close({pageNumber:this.pageNumber,pageSize:this.pageSize})}static \u0275fac=function(t){return new(t||r)(C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-export-report"]],decls:11,vars:3,consts:[[3,"onCancel","onClose","onOk","config"],[1,"container-fluid"],[1,"form-floating-outline"],["type","text","name","pageNumber","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["for","pageNumber"],["type","text","name","pageSize","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["for","pageSize"]],template:function(t,i){t&1&&(a(0,"modal-material",0),g("onCancel",function(){return i.dialogRef.close()})("onClose",function(){return i.dialogRef.close()})("onOk",function(){return i.onOk()}),a(1,"content")(2,"div",1)(3,"div",2)(4,"input",3),D("ngModelChange",function(s){return x(i.pageNumber,s)||(i.pageNumber=s),s}),o(),a(5,"label",4),m(6,"Page Number"),o()(),a(7,"div",2)(8,"input",5),D("ngModelChange",function(s){return x(i.pageSize,s)||(i.pageSize=s),s}),o(),a(9,"label",6),m(10,"Page Size"),o()()()()()),t&2&&(p("config",i.config),l(4),S("ngModel",i.pageNumber),l(4),S("ngModel",i.pageSize))},dependencies:[lt,F,Y,Ct,Ot]})};var ve=class r{constructor(e){this.http=e}currentUntilPage;toggleFetchTotalData;totalData;pageNumber;isNextBtnDisabled;isOnLastPage;calcCurrentUntilPage(e,t,i){this.currentUntilPage=e*(t-1)+i}setPageNumber(e){this.pageNumber=e}setPaginationButtonState(e,t,i){i==0?this.isNextBtnDisabled=!0:this.isNextBtnDisabled=!(i<e*t)}setTotalData(e,t,i){this.toggleFetchTotalData=!0,this.http.post(e,t).pipe(L(i)).subscribe(n=>this.totalData=n)}setPaginationState(e,t,i){this.calcCurrentUntilPage(e,t,i),this.setPageNumber(t),this.setPaginationButtonState(e,t,i)}static \u0275fac=function(t){return new(t||r)(Rt(k))};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var Jn=class r{constructor(e,t,i){this.state=i;this.fetchData$=n=>s=>t.post(n,s).pipe(Dt(y=>y.Data),L(y=>this.state.setPaginationState(s.RowCount,s.PageNumber,y.length))),this.fetchLoader$=n=>()=>t.post(n)}filter$=new fn(void 0);fetchData$;fetchLoader$;getLoader$(e,t){return e.pipe(ae(this.fetchLoader$(t)),L(i=>this.filter$.next(i.Filter)))}getInfiniteListData$(e){return this.filter$.pipe(H(t=>t!==void 0),ae(this.fetchData$(e)),Yi(this.filter$),L(([t,i])=>this.state.setPaginationState(i.RowCount,i.PageNumber,t.length)),Ji((t,i)=>{let[n,s]=t,[y]=i;return s.PageNumber==1?[y,s]:[n.concat(y),s]}),Dt(([t])=>t))}filterFromFirstPage(e){e.PageNumber=1,this.filter$.next(e)}nextPage(e){e.PageNumber+=1,this.filter$.next(e)}fetchTotalData(e,t){this.state.setTotalData(e,t)}fetchAllData(e,t){this.state.setTotalData(e,t,i=>{let n=j({},t);n.PageNumber=1,n.RowCount=i,this.filter$.next(n)})}static \u0275fac=function(t){return new(t||r)(Rt(rt),Rt(k),Rt(ve))};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};function ws(r,e){if(r&1){let t=I();a(0,"span",8),g("click",function(){d(t);let n=c();return u(n.onFetchTotalData())}),a(1,"i",9),m(2,"?"),o()()}}function Ms(r,e){if(r&1&&(a(0,"span"),m(1),b(2,"number"),o()),r&2){let t=c();l(),v(M(2,1,t.state.totalData))}}function Os(r,e){if(r&1){let t=I();a(0,"a",10),g("click",function(){d(t);let n=c();return u(n.onNextPage())}),f(1,"i",11),m(2," Next"),o()}}function Ts(r,e){if(r&1){let t=I();a(0,"a",12),g("click",function(){d(t);let n=c();return u(n.onConcatAllData())}),f(1,"i",13),m(2," Show All"),o()}}var Yn=class r{constructor(e){this.state=e}fetchTotalData=new nt;fetchAllData=new nt;nextPage=new nt;ngOnInit(){}onFetchTotalData(){this.fetchTotalData.emit()}onNextPage(){this.nextPage.emit()}onConcatAllData(){this.fetchAllData.emit()}static \u0275fac=function(t){return new(t||r)(C(ve))};static \u0275cmp=P({type:r,selectors:[["POS-infinite-list"]],outputs:{fetchTotalData:"fetchTotalData",fetchAllData:"fetchAllData",nextPage:"nextPage"},decls:11,vars:8,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load next page",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),m(3),b(4,"number"),_(5,ws,3,0,"span",3)(6,Ms,3,3,"span",4),m(7),o()(),a(8,"div",5),_(9,Os,3,0,"a",6)(10,Ts,3,0,"a",7),o()()),t&2&&(l(3),O(" Showing 1 - ",M(4,6,i.state.currentUntilPage)," of "),l(2),p("ngIf",!i.state.toggleFetchTotalData),l(),p("ngIf",i.state.toggleFetchTotalData),l(),O(" records ~ ",i.state.pageNumber," Page "),l(2),p("ngIf",i.state.isNextBtnDisabled&&!i.state.isOnLastPage),l(),p("ngIf",i.state.isNextBtnDisabled&&!i.state.isOnLastPage))},dependencies:[V,it]})},Zn=class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=Oe({type:r});static \u0275inj=Me({imports:[ke]})};var ks=()=>["/menu/Adjustment/Adjustment/Archive/Info"],js=r=>({ID:r});function Ns(r,e){if(r&1){let t=I();a(0,"button",13),g("click",function(){d(t);let n=c().ngIf,s=c();return u(s.openExportModal(n.Filter))}),f(1,"i",14),m(2," Export"),o()}}function As(r,e){if(r&1){let t=I();a(0,"div",15)(1,"h6"),m(2,"Outlets"),o(),a(3,"outlet-selector",16),D("ngModelChange",function(n){d(t);let s=c().ngIf;return x(s.Filter.EntityID,n)||(s.Filter.EntityID=n),u(n)}),o(),a(4,"h6"),m(5,"From"),o(),a(6,"datepicker",17),D("dateChange",function(n){d(t);let s=c().ngIf;return x(s.Filter.From,n)||(s.Filter.From=n),u(n)}),o(),a(7,"h6"),m(8,"To"),o(),a(9,"datepicker",18),D("dateChange",function(n){d(t);let s=c().ngIf;return x(s.Filter.To,n)||(s.Filter.To=n),u(n)}),o()()}if(r&2){let t=c().ngIf;l(3),p("accessType",2),S("ngModel",t.Filter.EntityID),p("multiple",!1),l(3),p("isFloatingLabel",!1),S("date",t.Filter.From),l(3),p("isFloatingLabel",!1),S("date",t.Filter.To)}}function Vs(r,e){r&1&&(a(0,"th",19),m(1,"@ Cost"),o())}function Fs(r,e){r&1&&(a(0,"th",19),m(1,"@ Price"),o())}function Us(r,e){if(r&1&&(a(0,"th",33),m(1),b(2,"number"),o()),r&2){let t=c().$implicit;l(),O(" ",M(2,1,t.UnitCost),"")}}function Ls(r,e){if(r&1&&(a(0,"th",33),m(1),b(2,"number"),o()),r&2){let t=c().$implicit;l(),O(" ",M(2,1,t.UnitPrice),"")}}function Rs(r,e){if(r&1&&(a(0,"tr")(1,"th",29),m(2),o(),a(3,"th",30),m(4),o(),a(5,"th",31),m(6),b(7,"number"),o(),_(8,Us,3,3,"th",32)(9,Ls,3,3,"th",32),o()),r&2){let t=e.$implicit,i=c(3);l(2),O(" ",t.VariantName,""),l(2),O(" ",t.VariantCode,""),l(2),v(M(7,5,t.Quantity)),l(2),p("ngIf",i.roleService.product.Cost),l(),p("ngIf",i.roleService.sell.UnitPriceEditor)}}function Qs(r,e){if(r&1&&(a(0,"div")(1,"div",20)(2,"div",21)(3,"a",22),f(4,"span",23),b(5,"date"),f(6,"small",24),b(7,"date"),a(8,"small",25),m(9),o()()()(),a(10,"div")(11,"strong",26),m(12),o(),f(13,"div",27),o(),a(14,"table",28)(15,"tbody"),_(16,Rs,10,7,"tr",11),o()()()),r&2){let t=e.$implicit;l(3),p("routerLink",Z(14,ks))("queryParams",A(15,js,t.ID)),l(),p("innerHTML",t.EntityName+" #"+t.Number+" - "+Q(5,8,t.Created,"dd MMM yyyy"),R),l(2),p("innerHTML","("+Q(7,11,t.Created,"HH:mm")+")",R),l(3),O(" ",t.PIC,""),l(3),O("[Q:",t.Quantity,"]"),l(),p("innerHTML",t.Note,R),l(3),p("ngForOf",t.Items)}}function Bs(r,e){if(r&1){let t=I();a(0,"mainpanel-cmp",2),D("textChange",function(n){let s=d(t).ngIf;return x(s.Filter.Number,n)||(s.Filter.Number=n),u(n)}),g("onSubmit",function(){let n=d(t).ngIf,s=c();return u(s.search(n.Filter))}),D("filterChange",function(n){let s=d(t).ngIf;return x(s.Filter,n)||(s.Filter=n),u(n)}),a(1,"actions"),_(2,Ns,3,0,"button",3),o(),a(3,"filters"),_(4,As,10,7,"ng-template",null,0,ot),o(),a(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),m(12,"Name"),o(),a(13,"th",8),m(14,"Code"),o(),a(15,"th",9),m(16,"Qty"),o(),_(17,Vs,2,0,"th",10)(18,Fs,2,0,"th",10),o()()(),_(19,Qs,17,17,"div",11),b(20,"async"),a(21,"POS-infinite-list",12),g("nextPage",function(){let n=d(t).ngIf,s=c();return u(s.nextPage(n.Filter))})("fetchTotalData",function(){let n=d(t).ngIf,s=c();return u(s.fetchTotalData(n.Filter))})("fetchAllData",function(){let n=d(t).ngIf,s=c();return u(s.fetchAllData(n.Filter))}),o()()()()}if(r&2){let t=e.ngIf,i=c();p("pageData",i.menuData),S("text",t.Filter.Number),p("isFilterOnDropdown",!1),S("filter",t.Filter),l(2),p("ngIf",i.roleService.global.Export),l(15),p("ngIf",i.roleService.product.Cost),l(),p("ngIf",i.roleService.sell.UnitPriceEditor),l(),p("ngForOf",M(20,8,i.data$))}}var Xn=class r extends ue{constructor(t,i,n,s,y,T,tt){super(t);this.http=i;this.infPagination=n;this.matDialog=y;this.csvConverter=T;this.roleService=tt;this.loader$=n.getLoader$(this.menuData$,this.loaderEndpoint),this.data$=n.getInfiniteListData$(this.dataEndpoint)}dataEndpoint="/api/Adjustment/AuditAdjustmentReport";loaderEndpoint="/api/AdjustmentLoader/AuditAdjustmentReport";countEndpoint="/api/Adjustment/AuditAdjustmentReportCount";data$;loader$;loader;search(t){this.infPagination.filterFromFirstPage(t)}nextPage(t){this.infPagination.nextPage(t)}fetchTotalData(t){this.infPagination.fetchTotalData(this.countEndpoint,t)}fetchAllData(t){this.infPagination.fetchAllData(this.countEndpoint,t)}onOpenExportDialog(t){this.matDialog.open(Kn).afterClosed().pipe(H(i=>w.IsNotEmpty(i))).subscribe(i=>{t.RowCount=i.pageSize,t.PageNumber=i.pageNumber,this.exportCSV("AdjustmentExport/AuditAdjustmentReport","AdjustmentReport.csv",t)})}exportCSV(t,i,n){this.http.post(`/api/${t}`,n).subscribe(s=>{this.csvConverter.convertToCSV(s,i)})}openExportModal(t){this.matDialog.open(Wt,{data:{title:"Adjustment Report",exportTypes:[{ID:"AdjustmentExport/AuditAdjustmentReport",Value:"Default",FileName:"Adjustment Report"}],filterExport:t,getAllDataLengthAPI:"Adjustment/AuditAdjustmentReportCount",pagination:!0}})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(Jn),C(ve),C(ft),C(Ut),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-adjustment-reports"]],features:[dt],decls:2,vars:3,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[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"],[3,"nextPage","fetchTotalData","fetchAllData"],[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"],[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(i,n){i&1&&(_(0,Bs,22,10,"mainpanel-cmp",1),b(1,"async")),i&2&&p("ngIf",M(1,1,n.loader$))},dependencies:[J,V,ut,mt,F,Y,he,Yn,En,le,it,me]})};var Hs=r=>({show:r});function Ws(r,e){if(r&1){let t=I();a(0,"button",25),g("click",function(){d(t);let n=c(2);return u(n.ok())}),m(1,"Upload"),o()}}function qs(r,e){if(r&1){let t=I();a(0,"button",25),g("click",function(){d(t);let n=c(2);return u(n.confirmAdjustment())}),m(1,"Confirm Adjustment"),o()}}function Gs(r,e){if(r&1&&(a(0,"div",26),m(1),b(2,"limitText"),o()),r&2){let t=e.item;p("title",(t==null||t.Name==null?null:t.Name.length)>23?t.Name:""),l(),O(" ",Q(2,2,t.Name,25)," ")}}function zs(r,e){if(r&1){let t=I();a(0,"div",27)(1,"button",28),f(2,"i",29),m(3," Download Current Inventory "),o(),a(4,"ul",30)(5,"li")(6,"a",31),g("click",function(){d(t);let n=c(2);return u(n.downloadData(0))}),f(7,"i",32),m(8," Download CSV "),o()(),a(9,"li")(10,"a",33),g("click",function(){d(t);let n=c(2);return u(n.downloadData(1))}),f(11,"i",34),m(12," Download XLSX "),o()()()()}}function $s(r,e){if(r&1&&(a(0,"tr",40),f(1,"td",41)(2,"td",41)(3,"td",42),b(4,"number"),f(5,"td",42),b(6,"number"),f(7,"td",42),b(8,"number"),o()),r&2){let t=e.$implicit;vt(t.QuantityDifferences<0?"danger":"success"),l(),p("innerHTML",t.Name,R),l(),p("innerHTML",t.Code,R),l(),p("innerHTML",M(4,9,t.Expected),R),l(2),p("innerHTML",M(6,11,t.Counted),R),l(2),vt(t.QuantityDifferences<0?"text-danger":"text-success"),p("innerHTML",M(8,13,t.QuantityDifferences),R)}}function Ks(r,e){if(r&1&&(a(0,"table",35)(1,"thead",36)(2,"tr")(3,"th"),m(4,"Name"),o(),a(5,"th",37),m(6,"Code"),o(),a(7,"th",38),m(8,"Expected Stock"),o(),a(9,"th",38),m(10,"Counted Stock "),o(),a(11,"th",38),m(12,"Differences "),o()()(),a(13,"tbody"),_(14,$s,9,15,"tr",39),o()()),r&2){let t=c(2);l(14),p("ngForOf",t.opNames)}}function Js(r,e){if(r&1){let t=I();a(0,"mainpanel-cmp",1)(1,"actions"),_(2,Ws,2,0,"button",2)(3,qs,2,0,"button",2),o(),a(4,"content")(5,"div",3)(6,"div",4)(7,"div",5)(8,"h5",6),m(9,"Outlet"),o(),a(10,"small",7),m(11,"Stock take location"),o()(),a(12,"div",8)(13,"div",9)(14,"div",10)(15,"div")(16,"ng-select",11),D("ngModelChange",function(n){d(t);let s=c();return x(s.formData.EntityID,n)||(s.formData.EntityID=n),u(n)}),g("change",function(n){d(t);let s=c();return u(s.getEntityName(n))}),_(17,Gs,3,5,"ng-template",12),o()(),_(18,zs,13,0,"div",13),o()()()(),a(19,"div",4)(20,"div",5)(21,"h5",6),m(22,"Counted Inventory"),o(),a(23,"small",7),m(24,".csv format"),o()(),a(25,"div",8)(26,"div",9)(27,"div",14)(28,"input",15),g("change",function(n){d(t);let s=c();return u(s.onSelectFile(n.target))}),o()()()()(),a(29,"div",16)(30,"div",5)(31,"h5",6),m(32,"Advanced"),o(),a(33,"small",7),m(34,"More Options"),o()(),a(35,"div",8)(36,"div",9)(37,"div",17)(38,"label",6),m(39,"Product Without Inventory"),o(),a(40,"small",18),m(41,"Download product Without Inventories"),o(),a(42,"div",19)(43,"radio-options",20),D("modelChange",function(n){d(t);let s=c();return x(s.formData.ProductWithoutInventory,n)||(s.formData.ProductWithoutInventory=n),u(n)}),o()()()()(),_(44,Ks,15,1,"table",21),o(),a(45,"a",22),m(46,"More Options"),o(),a(47,"div",23)(48,"div",24),m(49,"Tips"),o(),a(50,"ol")(51,"li"),m(52,"Choose your outlet then download the csv spreadsheet"),o(),a(53,"li"),m(54,"Fill the Quantity column beside the Expected column"),o(),a(55,"li"),m(56,"Upload your file using the Green Button on the top right corner"),o(),a(57,"li"),m(58,"Analyze the upload file on your screen and Confirm the Adjustment."),o(),a(59,"li"),m(60,'Inventory Adjustment only works for Product with type "Standard" / product with stock.'),o(),a(61,"li"),m(62,'"Composite" Product is not shown in the CSV you Download.'),o()()()()()()}if(r&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),p("ngIf",t.roleService.adjustment.Create&&!t.uploaded),l(),p("ngIf",t.uploaded),l(13),p("items",t.pageData.Entities),S("ngModel",t.formData.EntityID),l(2),p("ngIf",t.roleService.adjustment.Create||t.roleService.adjustment.Edit),l(11),vt(A(13,Hs,t.opNames.length>0)),l(14),p("options",t.productOptions),S("model",t.formData.ProductWithoutInventory),l(),p("ngIf",t.opNames.length>0)}}var ti=class r extends Ft{constructor(t,i,n,s,y,T,tt){super(t,i,null,"Outlet/GetByUserAccessWrite");this.toastr=n;this.csvConverter=s;this.router=y;this.roleService=T;this.exp=tt;this.formData={},this.opNames=[]}formData;outletName;flag;uploaded=!1;opNames;productOptions=[{Key:"0",Value:"No"},{Key:"1",Value:"Yes"},{Key:"-1",Value:"Exclude Zero"}];csvResult;file;preInitList(){this.formData.EntityID=this.pageData.Entities[0].ID,this.outletName=this.pageData.Entities[0].Name,this.formData.ProductWithoutInventory="1"}onSelectFile(t){this.file=t.files[0]}ok(){let t=new FormData;t.append("Data",this.file),t.append("EntityID",this.formData.EntityID),t.append("ProductWithoutInventory",this.formData.ProductWithoutInventory),this.httpService.postFormData("/API/Adjustment/GetPreviewImportCSV",t).subscribe({next:i=>{this.opNames=i,this.uploaded=!0}})}downloadData(t){t==0?this.exp.exportCSV("InventoryExport/GetStockTakeSpreadsheet",this.formData):this.exp.exportXlsx("InventoryExport/GetStockTakeSpreadsheet",this.formData)}getEntityName(t){this.outletName=t.Name}getFormatedDate(){let t=new Date,i=(t.getDate()<10?"0":"")+t.getDate(),n=(t.getMonth()+1<10?"0":"")+(t.getMonth()+1),s=t.getFullYear().toString().substr(-2);return i+n+s}confirmAdjustment(){let t=[];if(this.opNames.forEach(s=>{let y={VariantID:s.ID,Quantity:s.QuantityDifferences,Cost:s.UnitCost,Price:s.UnitPrice};t.push(y)}),t.length<1)return alert("You must atleast have one item to adjust!"),!1;let i=new Date;this.formData.InventoryDate!=null&&(i=new Date(this.formData.InventoryDate));let n={Order:{EntityID:this.formData.EntityID,Date:i},Items:t,TypeID:1};this.httpService.post("/API/Adjustment/SubmitUseDefault",n).subscribe({next:s=>{this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Info"],{queryParams:{ID:s.OrderID}}).then(()=>window.location.reload())},error:s=>{}})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(_t),C(Ut),C(wt),C(U),C(fr))};static \u0275cmp=P({type:r,selectors:[["POS-csv-stock-take"]],features:[dt],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[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","ngModel"],["ng-option-tmp",""],["class","dropdown ms-3",4,"ngIf"],["id","import-section",1,"col-md-6","mb-10"],["accept",".csv","id","csv","type","file","name","myfile",1,"form-control",3,"change"],[1,"row","extra-options","border-bottom","mt-10","ms-2","collapse"],[1,"col-md-5"],[1,"ms-3","h6","fst-italic"],[1,"form-floating-outline","radio","border","rounded",2,"padding-top","14px"],["name","productInventory",3,"modelChange","options","model"],["class","table table-bordered mt-3",4,"ngIf"],["data-bs-toggle","collapse","data-bs-target",".extra-options","aria-expanded","true",1,"more","ms-2"],[1,"border","mt-5","ms-2"],[1,"fst-italic","text-primary","fw-bold","h5","ms-12","mt-3"],[1,"btn","btn-success",3,"click"],[3,"title"],[1,"dropdown","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle","mb-2",2,"height","37px !important","font-size","12px !important"],[1,"fa","fa-download","me-3"],[1,"dropdown-menu","dropdown-menu-start"],["role","button",1,"dropdown-item",3,"click"],[1,"fa-solid","fa-file-csv","me-3","mb-1"],["role","button",1,"dropdown-item","mt-2",3,"click"],[1,"fa-solid","fa-file-excel","me-3","mb-1"],[1,"table","table-bordered","mt-3"],[1,"thead-light","sticky-top-thead"],[2,"width","150px"],[1,"text-end",2,"width","120px"],["class","red",3,"class",4,"ngFor","ngForOf"],[1,"red"],[3,"innerHTML"],[1,"text-end",3,"innerHTML"]],template:function(i,n){i&1&&_(0,Js,63,15,"mainpanel-cmp",0),i&2&&p("ngIf",n.pageData)},dependencies:[J,V,mt,F,Y,Mt,gr,On,it,lr],styles:[".col-md-5[_ngcontent-%COMP%]{font-size:.875rem;height:fit-content}.col-md-5.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix input{font-size:14px;padding-bottom:3px}"]})};var ei=class extends ue{constructor(t,i){super(t);this.httpService=i;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(ae(()=>this.httpService.post(this.loaderApi,this.requestPayload))).subscribe(t=>this.loaderData=t)}getProduct(t){this.products=[],this.httpService.post(this.productsApi,t).subscribe(i=>{i.forEach(n=>{n.Counted="",this.products.push(n),this.originalProducts.push(n)})})}submitAdjustment(t){this.httpService.post(this.submitApi,t).subscribe({next:i=>{this.adjustmentID=i.OrderID,this.completeInfo=i,this.error=null,this.onSubmitSuccess()},error:i=>{this.error=i}})}onSubmitSuccess(){}};var Ys=["stepper"],Zs=r=>({custom:r}),ho=r=>({"nb-button-override":r}),Co=()=>["/menu/Products/Catalog/Variants/Info"],Fi=r=>({ID:r}),Xs=r=>({"bg-gradient-warning":r}),tl=r=>({Filter:r}),el=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function nl(r,e){if(r&1){let t=I();a(0,"button",44),g("click",function(){d(t);let n=c(2);return u(n.validateFilter())}),m(1,"Next"),o()}if(r&2){let t=c(2);p("disabled",!t.roleService.adjustment.Create)}}function il(r,e){if(r&1){let t=I();a(0,"div",45)(1,"button",46),g("click",function(){d(t),c();let n=It(7);return u(n.previous())}),m(2," Back "),o(),a(3,"button",47),g("click",function(){d(t),c();let n=It(7);return u(n.next())}),m(4," Next "),o()()}if(r&2){let t=c(2);p("ngClass",A(1,ho,t.currentSubStatus!=t.subStatusEnum.PAID))}}function rl(r,e){if(r&1){let t=I();a(0,"div",45)(1,"button",48),g("click",function(){d(t),c();let n=It(7);return u(n.previous())}),m(2," Back "),o(),a(3,"button",49),g("click",function(){d(t),c();let n=It(7);return u(n.next())}),m(4," Confirm Adjustment "),o()()}if(r&2){let t=c(2);p("ngClass",A(1,ho,t.currentSubStatus!=t.subStatusEnum.PAID))}}function ol(r,e){r&1&&(f(0,"i",50),m(1,"Filter"))}function al(r,e){r&1&&(a(0,"small",51),m(1,"Outlet option is required."),o())}function sl(r,e){r&1&&(f(0,"i",52),m(1,"Input"))}function ll(r,e){r&1&&(a(0,"th",32),m(1,"Expected"),o())}function ml(r,e){r&1&&(a(0,"th",32),m(1,"Changes"),o())}function pl(r,e){if(r&1&&(a(0,"td"),m(1),o()),r&2){let t=c().$implicit;l(),v(t.Quantity)}}function cl(r,e){if(r&1&&(a(0,"td"),m(1),f(2,"i",58),m(3),o()),r&2){let t=c().$implicit;l(),O("",t.Quantity," "),l(2),se(" ",t.Counted," (",(t.Counted-t.Quantity>0?"+":"")+(t.Counted-t.Quantity),")")}}function dl(r,e){if(r&1){let t=I();a(0,"i",59),g("click",function(){d(t);let n=c().$implicit,s=c(2);return u(s.clear(n))}),o()}}function ul(r,e){if(r&1){let t=I();a(0,"tr")(1,"td"),m(2),o(),a(3,"td",53),m(4),o(),a(5,"td",53),m(6),o(),a(7,"td")(8,"a",54),m(9),o()(),a(10,"td"),m(11),o(),_(12,pl,2,1,"td",35),a(13,"td")(14,"input",55),D("ngModelChange",function(n){let s=d(t).$implicit;return x(s.Counted,n)||(s.Counted=n),u(n)}),o()(),_(15,cl,4,3,"td",35),a(16,"td",56),_(17,dl,1,0,"i",57),o()()}if(r&2){let t=e.$implicit,i=e.index,n=c(2);l(2),v(i+1+"."),l(2),v(t.CategoryName),l(2),v(t.ProductName),l(2),p("routerLink",Z(14,Co))("queryParams",A(15,Fi,t.ID)),l(),v(t.Model),l(2),v(t.Code),l(),p("ngIf",n.roleService.inventory.View),l(2),vt(A(17,Xs,t.Counted!==""&&t.Counted!=t.Quantity&&!n.roleService.inventory.View)),p("modifyValueOnWheel",!1),S("ngModel",t.Counted),l(),p("ngIf",t.Counted!==""&&n.roleService.inventory.View),l(2),p("ngIf",t.Counted!=="")}}function _l(r,e){if(r&1){let t=I();z(0),a(1,"POS-complex-pagination",60),g("jumpToPage",function(){d(t);let n=c(2);return u(n.getProduct(n.filter))})("previousPage",function(){d(t);let n=c(2);return u(n.getProduct(n.filter))})("nextPage",function(){d(t);let n=c(2);return u(n.getProduct(n.filter))}),o(),$()}if(r&2){let t=c(2);l(),p("total",t.products.length)("pageData",A(2,tl,t.filter))}}function gl(r,e){r&1&&(f(0,"i",61),m(1,"Review"))}function fl(r,e){r&1&&(a(0,"th",32),m(1,"Expected"),o())}function hl(r,e){r&1&&(a(0,"th",32),m(1,"Differences"),o())}function Cl(r,e){if(r&1&&(a(0,"td"),m(1),o()),r&2){let t=c(2).$implicit;l(),v(t.Quantity)}}function yl(r,e){if(r&1&&(a(0,"span"),m(1),o()),r&2){let t=c(3).$implicit;l(),O("+",t.Counted-t.Quantity,"")}}function vl(r,e){if(r&1&&(a(0,"span"),m(1),o()),r&2){let t=c(3).$implicit;l(),v(t.Counted-t.Quantity)}}function Il(r,e){if(r&1&&(a(0,"td"),_(1,yl,2,1,"span",35)(2,vl,2,1,"span",35),o()),r&2){let t=c(2).$implicit;l(),p("ngIf",t.Counted>t.Quantity),l(),p("ngIf",t.Counted<t.Quantity)}}function bl(r,e){if(r&1&&(a(0,"tr")(1,"td"),m(2),o(),a(3,"td",53),m(4),o(),a(5,"td")(6,"a",54),m(7),o()(),a(8,"td"),m(9),o(),_(10,Cl,2,1,"td",35),a(11,"td"),m(12),o(),_(13,Il,3,2,"td",35),o()),r&2){let t=c(),i=t.$implicit,n=t.index,s=c(2);vt(i.Counted<i.Quantity?"soft-yellow":"soft-green"),l(2),v(n+1+"."),l(2),v(i.ProductName),l(2),p("routerLink",Z(11,Co))("queryParams",A(12,Fi,i.ID)),l(),v(i.Model),l(2),v(i.Code),l(),p("ngIf",s.roleService.inventory.View),l(2),O(" ",i.Counted," "),l(),p("ngIf",s.roleService.inventory.View)}}function xl(r,e){if(r&1&&(z(0),_(1,bl,14,14,"tr",62),$()),r&2){let t=e.$implicit;l(),p("ngIf",t.Counted!==""&&t.Counted!=t.Quantity)}}function Sl(r,e){r&1&&(f(0,"i",63),m(1,"Finish"))}function Dl(r,e){if(r&1&&(a(0,"div",64),f(1,"i",65),m(2),o()),r&2){let t=c(2);l(2),v(t.error.error.Message)}}function Pl(r,e){r&1&&(a(0,"div",82),m(1," Difference"),o())}function wl(r,e){if(r&1&&(a(0,"div",87),m(1),o()),r&2){let t=c().$implicit;vt(t.Quantity-t.OriginalQuantity<0?"text-danger":"text-success"),l(),v((t.Quantity-t.OriginalQuantity>0?"+":" ")+(t.Quantity-t.OriginalQuantity))}}function Ml(r,e){if(r&1&&(a(0,"div",89)(1,"div",86),m(2),o(),a(3,"div",87),m(4),o(),_(5,wl,2,3,"div",88),o()),r&2){let t=e.$implicit,i=c(3);l(2),se("",t.Name," (",t.Model,")"),l(2),v(t.Quantity),l(),p("ngIf",i.roleService.inventory.View)}}function Ol(r,e){if(r&1&&(a(0,"div",87),b(1,"sum"),b(2,"sum"),m(3),b(4,"sum"),b(5,"sum"),b(6,"sum"),b(7,"sum"),o()),r&2){let t=c(3);vt(Q(1,3,t.Items,"Quantity")-Q(2,6,t.Items,"OriginalQuantity")<0?"text-danger":"text-success"),l(3),O(" ",(Q(4,9,t.Items,"Quantity")-Q(5,12,t.Items,"OriginalQuantity")>0?"+":" ")+(Q(6,15,t.Items,"Quantity")-Q(7,18,t.Items,"OriginalQuantity"))," ")}}function Tl(r,e){if(r&1){let t=I();a(0,"div",66)(1,"div",67)(2,"div",68)(3,"div",69)(4,"h1",70),f(5,"i",63),m(6,"Inventory Adjustment Completed"),o()(),a(7,"div",71)(8,"div",72)(9,"div",73)(10,"a",74),g("click",function(){d(t);let n=c(2);return u(n.newStockCount())}),m(11,"New Adjustment (F8)"),o()()()()()(),a(12,"div",75)(13,"div",68)(14,"div",76)(15,"h2",77)(16,"a",78),m(17),o()()(),a(18,"div",79)(19,"div",80)(20,"div",81),m(21,"Product Name (Variant)"),o(),a(22,"div",82),m(23,"Counted"),o(),_(24,Pl,2,0,"div",83),o(),_(25,Ml,6,4,"div",84),a(26,"div",85)(27,"div",86),m(28,"Total"),o(),a(29,"div",87),m(30),b(31,"sum"),o(),_(32,Ol,8,21,"div",88),o()()()()()}if(r&2){let t=c(2);l(16),p("routerLink",Z(10,el))("queryParams",A(11,Fi,t.adjustmentID)),l(),O("Adjustment #",t.completeInfo.InvoiceNumber,""),l(7),p("ngIf",t.roleService.inventory.View),l(),p("ngForOf",t.Items),l(5),v(Q(31,7,t.Items,"Quantity")),l(2),p("ngIf",t.roleService.inventory.View)}}function El(r,e){if(r&1){let t=I();a(0,"mainpanel-cmp",3),D("textChange",function(n){d(t);let s=c();return x(s.filter.ProductName,n)||(s.filter.ProductName=n),u(n)}),g("onSubmit",function(){d(t);let n=c();return u(n.filterProduct())}),a(1,"actions"),_(2,nl,2,1,"button",4)(3,il,5,3,"div",5)(4,rl,5,3,"div",5),o(),a(5,"content")(6,"mat-stepper",6,0),g("selectionChange",function(n){d(t);let s=c();return u(s.onNextStep(n))}),a(8,"mat-step",7),_(9,ol,2,0,"ng-template",8),a(10,"div",9)(11,"div",10)(12,"div",11)(13,"div",10)(14,"h3",12),m(15,"Outlet"),o()(),a(16,"div",13)(17,"ng-select",14,1),g("change",function(){d(t);let n=c();return u(n.toggleIsFilterFilled())}),D("ngModelChange",function(n){d(t);let s=c();return x(s.filter.EntityID,n)||(s.filter.EntityID=n),u(n)}),o(),_(19,al,2,0,"small",15),o()()(),a(20,"div",16)(21,"div",11)(22,"div",10)(23,"h3",12),m(24,"Category "),a(25,"small",17)(26,"em"),m(27,"Optional"),o()()()(),a(28,"div",13)(29,"ng-select",18),D("ngModelChange",function(n){d(t);let s=c();return x(s.filter.CategoryID,n)||(s.filter.CategoryID=n),u(n)}),o()()()(),a(30,"div",16)(31,"div",11)(32,"div",10)(33,"h3",12),m(34,"Contain Text "),a(35,"small",17)(36,"em"),m(37,"Optional"),o()()()(),a(38,"div",19)(39,"input",20),D("ngModelChange",function(n){d(t);let s=c();return x(s.filter.ProductName,n)||(s.filter.ProductName=n),u(n)}),o()()()(),a(40,"div",16)(41,"div",11)(42,"div",10)(43,"h3",12),m(44,"Note "),a(45,"small",17)(46,"em"),m(47,"Optional"),o()()()(),a(48,"div",13)(49,"textarea",21),D("ngModelChange",function(n){d(t);let s=c();return x(s.note,n)||(s.note=n),u(n)}),o()()()()()(),a(50,"mat-step",22),_(51,sl,2,0,"ng-template",8),a(52,"div",23)(53,"table",24),g("matSortChange",function(n){d(t);let s=c();return u(s.sortData(n))}),a(54,"thead",25)(55,"tr")(56,"th",26),m(57,"No"),o(),a(58,"th",27),m(59,"Category"),o(),a(60,"th",28),m(61,"Product"),o(),a(62,"th",29),m(63,"Variant"),o(),a(64,"th",30),m(65,"Code"),o(),_(66,ll,2,0,"th",31),a(67,"th",32),m(68,"Counted"),o(),_(69,ml,2,0,"th",33),f(70,"th",26),o()(),a(71,"tbody"),_(72,ul,18,19,"tr",34),o()(),_(73,_l,2,4,"ng-container",35),o()(),a(74,"mat-step",36),_(75,gl,2,0,"ng-template",8),a(76,"div",23)(77,"div",37)(78,"table",38),g("matSortChange",function(n){d(t);let s=c();return u(s.sortData(n))}),a(79,"thead",25)(80,"tr"),f(81,"th",26),a(82,"th",39),m(83,"Name"),o(),a(84,"th",40),m(85,"Variant"),o(),a(86,"th",32),m(87,"Code"),o(),_(88,fl,2,0,"th",31),a(89,"th",32),m(90,"Counted"),o(),_(91,hl,2,0,"th",31),o()(),a(92,"tbody"),_(93,xl,2,1,"ng-container",34),o()()()()(),a(94,"mat-step",41),_(95,Sl,2,0,"ng-template",8)(96,Dl,3,1,"div",42),o()(),_(97,Tl,33,13,"div",43),o()()}if(r&2){let t=It(18),i=c();p("pageData",i.menuData),S("text",i.filter.ProductName),p("hideSearchBox",i.currentStep!="input")("hideSearchDropdown",!0),l(2),p("ngIf",i.currentStep=="filter"),l(),p("ngIf",i.currentStep=="input"),l(),p("ngIf",i.currentStep=="review"),l(2),p("linear",!0),l(2),p("completed",i.isFilterFilled),l(9),vt(A(28,Zs,t.touched&&i.filter.EntityID==null)),p("items",i.loaderData.Entities),S("ngModel",i.filter.EntityID),p("clearable",!1),l(2),p("ngIf",t.touched&&i.filter.EntityID==null),l(10),p("items",i.loaderData.Categories),S("ngModel",i.filter.CategoryID),l(10),S("ngModel",i.filter.ProductName),l(10),S("ngModel",i.note),l(17),p("ngIf",i.roleService.inventory.View),l(3),p("ngIf",i.roleService.inventory.View),l(3),p("ngForOf",i.products),l(),p("ngIf",i.products.length>0),l(15),p("ngIf",i.roleService.inventory.View),l(3),p("ngIf",i.roleService.inventory.View),l(2),p("ngForOf",i.products),l(3),p("ngIf",i.error),l(),p("ngIf",i.isCompleted)}}var ni=class r extends ei{constructor(t,i,n,s,y){super(t,i);this.toastr=n;this.ngZone=s;this.roleService=y;this.isFilterFilled=!1,this.filter={CategoryID:null,EntityID:null,ProductName:"",SupplierID:w.GuidEmpty,RowCount:500,PageNumber:1},this.oldFilter={CategoryID:"dummy",EntityID:"dummy",ProductName:"dummy",SupplierID:"dummy",RowCount:500,PageNumber:1},this.Items=[],this.initSubscriptionStatus()}stepper;isFilterFilled;currentStep="filter";Items;note;isCompleted=!1;filter;oldFilter;currentSubStatus;subStatusEnum=ir;initSubscriptionStatus(){this.currentSubStatus=parseInt(localStorage.getItem("SubscriptionStatus"))}handleF8(){this.currentStep=="finish"&&this.newStockCount()}handleNextButton(){this.stepper&&this.ngZone.run(()=>{this.roleService.adjustment.Create&&(this.isFilterFilled?this.stepper.next():this.validateFilter())})}handlePreviousButton(){this.stepper&&this.ngZone.run(()=>{this.stepper.previous()})}toggleIsFilterFilled(){this.isFilterFilled=!0}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 i=0;this.products.forEach(n=>{n.Counted!==""&&n.Counted!=n.Quantity&&(n.Status=n.Counted>n.Quantity?"Over":"Under",i++)}),i&&!this.roleService.inventory.View&&this.toastr.warning("There are some items inventory that does not match! Click next to automatically adjust inventory.",X.Warning)}else if(t.selectedStep.label=="finish"){this.products=this.originalProducts,this.currentStep="finish",this.Items=[],this.products.forEach(s=>{if(s.Counted!==""&&s.Counted!=s.Quantity){let y={Name:s.ProductName,Cost:s.UnitCost,Price:s.UnitPrice,Quantity:s.Counted,OriginalQuantity:s.Quantity,VariantID:s.ID,Model:s.Model};this.Items.push(y)}});let i={Date:new Date,EntityID:this.filter.EntityID,Note:this.note,ID:this.adjustmentID||w.GuidEmpty},n={Items:this.Items,Order:i,TypeID:2};this.Items.length>0?this.submitAdjustment(n):this.toastr.error("Adjust at least 1 product",X.Error)}}validateFilter(){if(!this.isFilterFilled){this.toastr.error("Outlet is required",X.Error);return}this.stepper.next()}clear(t){t.Counted=""}newStockCount(){window.location.reload()}onSubmitSuccess(){this.isCompleted=!0}sortData(t){let i=this.products.slice();if(!t.active||t.direction===""){this.products=this.originalProducts;return}this.products=i.sort((n,s)=>{let y=t.direction==="asc",T=typeof n[t.active];switch(w.IsEmpty(n.Code)&&(n.Code=""),w.IsEmpty(s.Code)&&(s.Code=""),T){case"string":return w.compare(n[t.active].toLocaleLowerCase(),s[t.active].toLocaleLowerCase(),y);case"number":return w.compare(n[t.active],s[t.active],y);default:return 0}})}filterProduct(){this.filter.PageNumber=1,this.getProduct(this.filter)}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(_t),C(Zi),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-spreadsheet-stock-take"]],viewQuery:function(i,n){if(i&1&&ln(Ys,5),i&2){let s;mn(s=pn())&&(n.stepper=s.first)}},hostBindings:function(i,n){i&1&&g("keydown.F8",function(){return n.handleF8()},!1,Vt)("keydown.ArrowRight",function(){return n.handleNextButton()},!1,Vt)("keydown.ArrowLeft",function(){return n.handlePreviousButton()},!1,Vt)},features:[dt],decls:1,vars:1,consts:[["stepper",""],["outletFilter","ngModel"],[3,"pageData","text","hideSearchBox","hideSearchDropdown","textChange","onSubmit",4,"ngIf"],[3,"textChange","onSubmit","pageData","text","hideSearchBox","hideSearchDropdown"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page","class","btn btn-outline-secondary ms-auto me-0 d-block",3,"disabled","click",4,"ngIf"],["class","mt-5 nb-button",3,"ngClass",4,"ngIf"],[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"],["placeholder","Choose a category","dropdownPosition","bottom","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[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"],["rows","6","type","text","name","note",1,"form-control",3,"ngModelChange","ngModel"],["label","input"],[1,"container-fluid","px-0"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light"],[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"],["style","width: 75px;",4,"ngIf"],[2,"width","75px"],["style","width: 75px",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf"],["label","review"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom","w-100",2,"table-layout","fixed",3,"matSortChange"],["mat-sort-header","ProductName",2,"width","175px"],[2,"width","150px"],["label","finish"],["class","alert",4,"ngIf"],["class","container-fluid row mt-5",4,"ngIf"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-outline-secondary","ms-auto","me-0","d-block",3,"click","disabled"],[1,"mt-5","nb-button",3,"ngClass"],["mat-button","","mat-raised-button","","matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-2",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-outline-secondary",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-5",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success",3,"click"],[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"],[1,"text-center"],["class","fa-solid fa-delete-left fa-2x clear align-middle","matTooltipPosition","above","matTooltip","reset counter",3,"click",4,"ngIf"],[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,"class",4,"ngIf"],[1,"fa-solid","fa-check","me-3"],[1,"alert"],[1,"fa-solid","fa-circle-exclamation","me-3"],[1,"container-fluid","row","mt-5"],[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"],["class","col-3","style","font-size: 14px;",4,"ngIf"],["class","row justify-content-between my-5",4,"ngFor","ngForOf"],[1,"row","justify-content-between","fw-bold"],[1,"col-6"],[1,"col-3"],["class","col-3",3,"class",4,"ngIf"],[1,"row","justify-content-between","my-5"]],template:function(i,n){i&1&&_(0,El,98,30,"mainpanel-cmp",2),i&2&&p("ngIf",n.loaderData)},dependencies:[Ee,J,V,ut,mt,lt,F,Y,Mt,Be,zr,Gr,$r,Ot,Ht,mr,pr,ge],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}.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}']})};var kl=()=>["/menu/Products/Catalog/Products/Info"],jl=r=>({ID:r});function Nl(r,e){if(r&1){let t=I();a(0,"button",13),g("click",function(){d(t);let n=c(2);return u(n.confirmAdjust())}),m(1,"Confirm Adjustment"),o()}}function Al(r,e){if(r&1){let t=I();a(0,"div")(1,"div",14)(2,"h6"),m(3,"Outlets"),o(),a(4,"ng-select",15),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,n)||(s.pageData.Filter.EntityID=n),u(n)}),o()()()}if(r&2){let t=c(2);l(4),p("items",t.pageData.Entities),S("ngModel",t.pageData.Filter.EntityID)}}function Vl(r,e){if(r&1){let t=I();a(0,"tr",16)(1,"td"),f(2,"a",17),o(),f(3,"td",18)(4,"td",18)(5,"td",18)(6,"td",19)(7,"td",19),a(8,"td",20)(9,"input",21),D("ngModelChange",function(n){let s=d(t).$implicit;return x(s.NewQuantity,n)||(s.NewQuantity=n),u(n)}),o()(),a(10,"td",20),m(11),b(12,"number"),o(),a(13,"td")(14,"a",22),g("click",function(){let n=d(t).$implicit,s=c(2);return u(s.confirmAdjust(n))}),m(15,"Adjust"),o()()()}if(r&2){let t=e.$implicit;l(2),p("routerLink",Z(12,kl))("queryParams",A(13,jl,t.ProductID))("innerHTML",t.ProductName,R),l(),p("innerHTML",t.ParentCode,R),l(),p("innerHTML",t.Model,R),l(),p("innerHTML",t.ParentModel,R),l(),p("innerHTML",t.Ratio,R),l(),p("innerHTML",t.Inventory,R),l(2),S("ngModel",t.NewQuantity),l(2),O(" ",M(12,10,t.Inventory-t.NewQuantity*t.Ratio)," ")}}function Fl(r,e){if(r&1){let t=I();a(0,"mainpanel-cmp",2),g("onSubmit",function(){d(t);let n=c();return u(n.searchFromPageOne())}),D("filterChange",function(n){d(t);let s=c();return x(s.pageData.Filter,n)||(s.pageData.Filter=n),u(n)}),a(1,"actions"),_(2,Nl,2,0,"button",3),o(),a(3,"filters"),_(4,Al,5,2,"ng-template",null,0,ot),o(),a(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th"),m(13,"Product Name"),o(),a(14,"th",8),m(15,"Code"),o(),a(16,"th",8),m(17,"From"),o(),a(18,"th",8),m(19,"To"),o(),a(20,"th",9),m(21,"Ratio"),o(),a(22,"th",9),m(23,"Inventory"),o(),a(24,"th",10),m(25,"Convert Qty "),o(),a(26,"th",10),m(27,"Remaining"),o(),f(28,"th",11),o()(),a(29,"tbody"),_(30,Vl,16,15,"tr",12),o()()()()()()}if(r&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.roleService.adjustment.Create),l(28),p("ngForOf",t.Items)}}var ii=class r extends Ft{constructor(t,i,n,s,y){super(t,i,"Adjustment/GetAdjustToParentList","Outlet/GetByUserAccessWrite");this.toastr=n;this.router=s;this.roleService=y}Items;preGetList(){w.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=this.pageData.Entities[0].ID)}postInit(t){this.Items=t,this.Items.forEach(i=>i.NewQuantity=Math.floor(i.Inventory/i.Ratio))}confirmAdjust(t){let i=[],n=[];if(t?n.push(t):n=this.Items,n.forEach(y=>{let T={VariantID:y.ParentID,Quantity:y.NewQuantity,Cost:y.UnitCost*y.Ratio,Price:y.UnitPrice*y.Ratio};i.push(T),T={VariantID:y.ID,Quantity:y.NewQuantity*y.Ratio*-1,Cost:y.UnitCost,Price:y.UnitPrice},i.push(T)}),i.length<1)return alert("You must atleast have one item to adjust!"),!1;if(w.IsEmpty(this.pageData.Filter.EntityID))return alert("Outlet is require"),!1;let s={Order:{EntityID:this.pageData.Filter.EntityID},Items:i};this.httpService.post("/API/Adjustment/SubmitUseDefault",s).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,X.Success)},error:y=>{this.toastr.error(y,X.Error)}})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(_t),C(wt),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-convert-inventory"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-success",3,"click",4,"ngIf"],[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"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-success",3,"click"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","appendTo","body",3,"ngModelChange","items","ngModel"],[1,"border-bottom"],[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(i,n){i&1&&_(0,Fl,31,6,"mainpanel-cmp",1),i&2&&p("ngIf",n.data)},dependencies:[J,V,ut,mt,lt,F,Y,Mt,Ot,it]})};function Ul(r,e){if(r&1){let t=I();a(0,"button",16),g("click",function(){d(t);let n=c();return u(n.openExportModal())}),f(1,"i",17),m(2," Export"),o()}}function Ll(r,e){if(r&1){let t=I();a(0,"td",14)(1,"input",21),D("ngModelChange",function(n){d(t);let s=c().$implicit;return x(s.Quantity,n)||(s.Quantity=n),u(n)}),o()()}if(r&2){let t=c().$implicit;l(),S("ngModel",t.Quantity)}}function Rl(r,e){if(r&1&&(a(0,"td",14),m(1),o()),r&2){let t=c().$implicit;l(),O(" ",t.Quantity,"")}}function Ql(r,e){if(r&1){let t=I();a(0,"tr",18)(1,"td")(2,"i",19),g("click",function(){let n=d(t).index,s=c();return u(s.products.splice(n,1))}),o()(),a(3,"td"),m(4),o(),a(5,"td",14),m(6),o(),_(7,Ll,2,1,"td",20)(8,Rl,2,1,"td",20),o()}if(r&2){let t=e.$implicit,i=c();l(4),v(t.Name),l(2),v(t.Code),l(),p("ngIf",i.roleService.adjustment.InventoryProductCount),l(),p("ngIf",!i.roleService.adjustment.InventoryProductCount)}}var ri=class r extends ue{constructor(t,i,n,s,y){super(t);this.httpService=i;this.csvConverter=n;this.roleService=s;this.matDialog=y;this.products=[],this.menuData$.subscribe()}productCode;products;onBarcodeEnter(t){let i=this.products.findIndex(n=>n.Code===t);i!=-1?this.products[i].Quantity++:this.httpService.post("/API/catalog/product/ProductCountByCode",{code:t}).subscribe(n=>{n.Quantity=1,this.products.push(n)}),this.productCode=null}openExportModal(){var t={Products:this.products,Export:!0};this.matDialog.open(Wt,{data:{title:"Count Product Inventory",exportTypes:[{ID:"ProductExport/ProductCountInventory",Value:"Default",FileName:"Count Product Inventory"}],filterExport:t,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(Ut),C(U),C(ft))};static \u0275cmp=P({type:r,selectors:[["POS-count-product-inventory"]],features:[dt],decls:27,vars:6,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"cashier"],[1,"cart","big-cart","scan-cart"],[1,"barcode","barcode_counter","text-end"],[1,"me-5"],["aria-hidden","true",1,"fa-solid","fa-barcode","fa-2x","icon"],["type","text","placeholder","Scan Barcode Here","autofocus","",2,"width","200px",3,"keyup.enter","ngModelChange","ngModel"],[1,"content"],[1,"table"],["id","tableGrid",1,"cart","table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],["width","15px"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[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"],["class","text-end",4,"ngIf"],["type","text","autoNum","",1,"text-end",3,"ngModelChange","ngModel"]],template:function(i,n){i&1&&(a(0,"mainpanel-cmp",0)(1,"actions"),_(2,Ul,3,0,"button",1),o(),a(3,"content")(4,"div",2)(5,"section",3)(6,"main")(7,"section",4)(8,"div",5)(9,"span",6),m(10,"Barcode"),o(),f(11,"i",7),a(12,"input",8),g("keyup.enter",function(){return n.onBarcodeEnter(n.productCode)}),D("ngModelChange",function(y){return x(n.productCode,y)||(n.productCode=y),y}),o()(),a(13,"div",9)(14,"div",10)(15,"table",11)(16,"thead",12)(17,"tr"),f(18,"th",13),a(19,"th"),m(20,"Name"),o(),a(21,"th",14),m(22,"Code"),o(),a(23,"th",14),m(24,"Qty"),o()()(),a(25,"tbody"),_(26,Ql,9,4,"tr",15),o()()()()()()()()()()),i&2&&(p("pageData",n.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),p("ngIf",n.roleService.global.Export),l(10),S("ngModel",n.productCode),l(14),p("ngForOf",n.products))},dependencies:[J,V,mt,lt,F,Y,Ot],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 Bl(r,e){if(r&1){let t=I();a(0,"button",15),g("click",function(){d(t);let n=c(2);return u(n.openExportModal())}),f(1,"i",16),m(2," Export"),o()}}function Hl(r,e){if(r&1){let t=I();a(0,"div")(1,"div",17)(2,"h6"),m(3,"Outlets"),o(),a(4,"ng-select",18),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,n)||(s.pageData.Filter.EntityID=n),u(n)}),o(),a(5,"h6"),m(6,"Category"),o(),a(7,"POS-product-category-select",19),D("selectedCategoryIDChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.CategoryID,n)||(s.pageData.Filter.CategoryID=n),u(n)}),o(),a(8,"h6"),m(9,"Sort By"),o(),a(10,"ng-select",20),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.SortByid,n)||(s.pageData.Filter.SortByid=n),u(n)}),o()()()}if(r&2){let t=c(2);l(4),p("items",t.pageData.Options.Entities),S("ngModel",t.pageData.Filter.EntityID),l(3),S("selectedCategoryID",t.pageData.Filter.CategoryID),p("showClear",!0),l(3),p("items",t.pageData.Options.SortBy),S("ngModel",t.pageData.Filter.SortByid)}}function Wl(r,e){if(r&1&&(a(0,"span"),m(1),o()),r&2){let t=e.$implicit;l(),v(t+" ")}}function ql(r,e){if(r&1&&(a(0,"tr")(1,"td"),m(2),o(),a(3,"td"),m(4),o(),a(5,"td",14),m(6),b(7,"number"),o(),a(8,"td",14),m(9),b(10,"number"),o(),a(11,"td",21),_(12,Wl,2,1,"span",11),o()()),r&2){let t=e.$implicit;l(2),v(t.ProductCode),l(2),v(t.ProductName),l(2),v(M(7,5,t.UnitPrice)),l(3),v(M(10,7,t.Qty)),l(3),p("ngForOf",t.Models)}}function Gl(r,e){if(r&1){let t=I();a(0,"mainpanel-cmp",2),g("onSubmit",function(){d(t);let n=c();return u(n.searchFromPageOne())}),D("filterChange",function(n){d(t);let s=c();return x(s.pageData.Filter,n)||(s.pageData.Filter=n),u(n)}),a(1,"actions"),_(2,Bl,3,0,"button",3),o(),a(3,"filters"),_(4,Hl,11,6,"ng-template",null,0,ot),o(),a(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),m(12,"Code"),o(),a(13,"th",8),m(14,"Name"),o(),a(15,"th",9),m(16,"UnitPrice"),o(),a(17,"th",10),m(18,"Qty"),o(),a(19,"th"),m(20,"Available Models"),o()()(),a(21,"tbody"),_(22,ql,13,9,"tr",11),o(),a(23,"tfoot")(24,"tr",12),f(25,"td",13),a(26,"td",14),m(27),b(28,"sum"),b(29,"number"),o(),f(30,"td"),o()()()()()()}if(r&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.roleService.global.Export),l(20),p("ngForOf",t.data.Data),l(5),v(M(29,10,Q(28,7,t.data.Data,"Qty")))}}var oi=class r extends Ft{constructor(t,i,n,s,y){super(t,i,"catalog/product/GetOutletProductSheet","catalog/ProductLoader/GetOutletProductSheet");this.csvConverter=n;this.roleService=s;this.matDialog=y}openExportModal(){this.matDialog.open(Wt,{data:{title:"Product Sheet",exportTypes:[{ID:"ProductExport/GetOutletProductSheet",Value:"Default",FileName:"Product Sheet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(Ut),C(U),C(ft))};static \u0275cmp=P({type:r,selectors:[["POS-product-sheet"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[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"],[4,"ngFor","ngForOf"],[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(i,n){i&1&&_(0,Gl,31,12,"mainpanel-cmp",1),i&2&&p("ngIf",n.data)},dependencies:[J,V,mt,F,Y,Mt,Tn,it,ge]})};var yo=Mi(xr());var W=class r{INITIAL_STATE={loadForm:{},outlet:{ID:"",Name:""},isOpenDialog:!0,isComplete:!1,adjustmentState:0,quickeyItems:{},cartItems:[],order:{Date:(0,yo.default)().utcOffset("+07:00").format(),EntityID:"",ID:w.GuidEmpty,StateID:4,TypeID:1,Number:"",PIC:"",Note:""},orderComplete:{},NewOrderID:""};#t=lo(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=>q(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,i)=>t+i.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,i)=>t+i.Variant.UnitPrice*i.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||r)};static \u0275prov=N({token:r,factory:r.\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,i,n,s,y,T,tt,bt,xt,yt,At,Bt,St,Jt,Yt,Zt,Xt,te,ee,ne,ie){this.ID=e,this.VariantID=t,this.Quantity=i,this.Cost=n,this.Price=s,this.Expense=y,this.Discount=T,this.DiscountAmount=tt,this.Note=bt,this.Taxable=xt,this.LoyaltyPoint=yt,this.EntityID=At,this.UnitQuantity=Bt,this.VariantUnitQuantity=St,this.InventoryTypeID=Jt,this.Variant=Yt,this.SalesID=Zt,this.UnitCost=Xt,this.UnitPrice=te,this.SplitQuantity=ee,this.isMaxInventory=ne,this.PromotionGift=ie}},ai=class r{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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})},Li=class{constructor(e,t,i,n,s,y,T,tt,bt,xt,yt,At,Bt,St,Jt,Yt,Zt,Xt,te,ee,ne,ie,Je,Ye,Ze,Xe,tn,en,nn,rn,on){this.ID=e,this.Name=t,this.Code=i,this.UnitCost=n,this.UnitPrice=s,this.UnitExpense=y,this.UnitQuantity=T,this.PriceDiscount=tt,this.UnitPriceOriginal=bt,this.Description=xt,this.UOM=yt,this.UOMName=At,this.ImageUrl=Bt,this.TypeID=St,this.SellPriceType=Jt,this.UnitsInStock=Yt,this.Ordered=Zt,this.OrderPrice=Xt,this.OrderPriceDiscount=te,this.Taxable=ee,this.LoyaltyPoint=ne,this.CategoryName=ie,this.CategoryID=Je,this.CategoryTypeID=Ye,this.PriceNote=Ze,this.PaymentTypeID=Xe,this.ThumbnailUrl=tn,this.Storage=en,this.Component=nn,this.PriceBook=rn,this.VariantUnitQuantity=on}ID;Name;Code;UnitCost;UnitPrice;UnitExpense;UnitQuantity;PriceDiscount;UnitPriceOriginal;Description;UOM;UOMName;ImageUrl;TypeID;SellPriceType;UnitsInStock;Ordered;OrderPrice;OrderPriceDiscount;Taxable;LoyaltyPoint;CategoryName;CategoryID;CategoryTypeID;PriceNote;PaymentTypeID;ThumbnailUrl;Storage;Component;PriceBook;VariantUnitQuantity},si=class r{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.UnitsInStock??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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var li=class r{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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})},mi=class r{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,UnitsInStock:e.UnitsInStock,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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})},vo=class r{adapt(e){return{Number:e.Number,Quantity:e.Quantity,ExpiryDate:e.ExpiryDate}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var Et=class r{destroy$=new st;#t=h(W);#e=h(k);#n=h(ai);#i=h(si);#r=h(Pt);#o=h(li);#a=h(mi);constructor(){}processOrder(){return at(this.#t.AdjustmentState,{injector:this.#r}).pipe(et(this.destroy$),G(e=>{let t=[...this.#t.CartItems()].map(i=>q(j({},this.#o.adapt(i)),{EntityID:w.GuidEmpty,Note:i.Note??"",SalesID:i.SalesID??"",isMaxInventory:!1,PromotionGift:!1,SplitQuantity:0,UnitCost:i.Cost,Cost:i.Cost,Variant:q(j({},this.#a.adapt(i.Variant)),{Taxable:!!i.Variant.Taxable})}));if(e===0){let i={Items:[...t],Order:{Date:this.#t.Order().Date,EntityID:this.#t.Outlet().ID,ID:w.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},NewOrderID:this.#t.NewOrderID()};return this.#e.post(pt.SubmitAdjustment,i).pipe(et(this.destroy$))}if(e===1){let i=q(j({},this.#t.LoadForm().Data),{Order:q(j({},this.#t.LoadForm().Data.Order),{Note:this.#t.Order().Note,PIC:this.#t.Order().PIC,Number:this.#t.Order().Number||this.#t.LoadForm().Data.Order.Number,Date:this.#t.Order().Date||this.#t.LoadForm().Data.Order.Date}),Items:[...t]});return this.#e.post(pt.SubmitAdjustment,i).pipe(et(this.destroy$))}return hn}),Cn(e=>Ki(()=>new Error(e))))}onUpdateOrderState(e,t){if(Object.keys(this.#t.Order()).includes(e)){let n=q(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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var $e=class r{destroy$=new st;#t=h(k);#e=h(W);#n=h(Pt);orderService=h(Et);getLoadForm$=this.#t.post("/API/Adjustment/LoadForm",{EntityID:w.GuidEmpty,ID:w.GuidEmpty}).pipe(Dn(),L(e=>{this.#e.onChangeLoadform(e)}));constructor(){}httpRequestLoadForm$(e){return at(this.#e.IsComplete,{injector:this.#n}).pipe(et(this.destroy$),H(t=>!t),G(t=>this.#t.post("/API/Adjustment/LoadForm",j({EntityID:"00000000-0000-0000-0000-000000000000",ID:"00000000-0000-0000-0000-000000000000"},e))),L(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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var pi=class r{destroy$=new st;#t=h(W);#e=h(k);#n=h(Et);#i=h(Pt);constructor(){this.initialize()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initialize(){Ie([at(this.#t.Outlet,{injector:this.#i}),at(this.#t.AdjustmentState,{injector:this.#i}),at(this.#t.IsComplete,{injector:this.#i})]).pipe(Dn(),H(([e,t,i])=>w.IsNotEmpty(e.ID)&&!i),G(([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(et(this.destroy$),L(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(et(this.destroy$),L(t=>{this.#t.onChangeQuickeyItems(t)}))}getQuickey(e){return this.#e.get(pt.GetQuickKeyByEntityID,[{key:"ID",value:e}])}static \u0275fac=function(t){return new(t||r)};static \u0275prov=N({token:r,factory:r.\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}_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;constructor(e,t,i,n,s,y,T,tt,bt,xt,yt,At,Bt,St,Jt,Yt,Zt,Xt,te,ee,ne,ie,Je,Ye,Ze,Xe,tn,en,nn,rn,on){this._Variant=e,this._QtyRequested=t,this._TotalPrice=i,this._SalesName=n,this._PriceNote=s,this._SalesID=y,this._InventoryTypeID=T,this._ID=tt,this._Code=bt,this._VariantID=xt,this._Quantity=yt,this._UnitQuantity=At,this._Expense=Bt,this._Cost=St,this._Price=Jt,this._Discount=Yt,this._Note=Zt,this._Taxable=Xt,this._LoyaltyPoint=te,this._UnitPriceOriginal=ee,this._DiscountAmount=ne,this._Name=ie,this._PriceTypeID=Je,this._Storage=Ye,this._Serial=Ze,this._ThumbnailUrl=Xe,this._UnitPrice=tn,this._TypeID=en,this._VariantUnitQuantity=nn,this._UOM=rn,this._UOMName=on}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}}},Qi=class{get UnitsInStock(){return this._UnitsInStock}set UnitsInStock(e){this._UnitsInStock=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}_UnitsInStock;_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,i,n,s,y,T,tt,bt,xt,yt,At,Bt,St,Jt,Yt,Zt,Xt,te,ee,ne,ie,Je,Ye,Ze,Xe,tn,en,nn,rn,on,wo,Mo,Oo,To,Eo,ko,jo,No,Ao,Vo,Fo,Uo,Lo,Ro,Qo,Bo,Ho,Wo,qo,Go,zo,$o,Ko,Jo){this._UnitsInStock=e,this._CategoryName=t,this._CategoryTypeID=i,this._PriceTypeID=n,this._PriceNote=s,this._UnitPriceOriginal=y,this._Ordered=T,this._BrandName=tt,this._ImageUrl=bt,this._ThumbnailUrl=xt,this._Component=yt,this._PriceBook=At,this._UOMName=Bt,this._Storage=St,this._CategoryID=Jt,this._DiscountAmount=Yt,this._VariantUnitQuantity=Zt,this._ProductCreated=Xt,this._ProductID=te,this._ProductIndex=ee,this._Code=ne,this._TypeID=ie,this._UnitQuantity=Je,this._SalesCommission=Ye,this._Description=Ze,this._Image=Xe,this._Discontinued=tn,this._Taxable=en,this._LoyaltyPoint=nn,this._PackSize=rn,this._CreatorId=on,this._Created=wo,this._UnitExpense=Mo,this._SellPriceType=Oo,this._VariantType=To,this._CostCurrencyID=Eo,this._UnitCost=ko,this._OrderPrice=jo,this._OrderPriceDiscount=No,this._OrderPriceDiscountDetail=Ao,this._PriceCurrencyID=Vo,this._UnitPrice=Fo,this._PriceDiscount=Uo,this._PaymentTypeID=Lo,this._PaymentTypeString=Ro,this._SellPriceTypeString=Qo,this._Weight=Bo,this._CostCurrencySymbol=Ho,this._PriceCurrencySymbol=Wo,this._UOM=qo,this._MeasurementID=Go,this._UOMQ=zo,this._Name=$o,this._Model=Ko,this._ID=Jo}toJSON(){return{UnitsInStock:this.UnitsInStock,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}}},Kt=class r{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).toJSON()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})},Ke=class r{adapt(e){return new Qi(e.UnitsInStock??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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var ci=class r{modalConfig;storeService=h(W);#t=h(Fe);#e=h(gt);form;constructor(){this.modalConfig=new ht,this.modalConfig.customWidth="400px",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]})}onOK(){let e=this.form.value;this.#e.close(e)}onCancel(){this.#e.close()}ngOnInit(){this.generateForm()}handleKeyDown(e){console.log("event",e),e.code==="F2"&&this.onOK()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-modal-cart-note"]],hostBindings:function(t,i){t&1&&g("keydown",function(s){return i.handleKeyDown(s)},!1,Vt)},standalone:!0,features:[K],decls:11,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100",3,"formGroup"],[1,"w-100"],[1,"mb-3"],["type","text","formControlName","PIC",1,"form-control","w-100","height-input"],[1,"w-100","mt-4"],["formControlName","Note","rows","4",1,"form-control","w-100","ps-2"]],template:function(t,i){t&1&&(a(0,"modal-material",0),g("onOk",function(){return i.onOK()})("onCancel",function(){return i.onCancel()})("onClose",function(){return i.onCancel()}),a(1,"content")(2,"div",1)(3,"div",2)(4,"strong",3),m(5,"PIC"),o(),f(6,"input",4),o(),a(7,"div",5)(8,"strong",3),m(9,"Note"),o(),f(10,"textarea",6),o()()()()),t&2&&(p("config",i.modalConfig),l(2),p("formGroup",i.form))},dependencies:[jt,Ct,ce,lt,F,je,de,Ae,Ve]})};var di=class r{modalConfig;#t=h(gt);constructor(){this.modalConfig=new ht,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||r)};static \u0275cmp=P({type:r,selectors:[["POS-modal-cart-void"]],standalone:!0,features:[K],decls:5,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"fw-normal"]],template:function(t,i){t&1&&(a(0,"modal-material",0),g("onOk",function(){return i.onOK()})("onCancel",function(){return i.onCancel()})("onClose",function(){return i.onCancel()}),a(1,"content")(2,"div",1)(3,"h4",2),m(4,"This will erase all current data. Are you sure?"),o()()()()),t&2&&p("config",i.modalConfig)},dependencies:[jt,Ct]})};var kt=class r{variantSearchCTRL=new Ne({});#t=h(W);#e=h(k);#n=h(Pt);#i=h(Kt);#r=h(ft);#o=h(Ke);destroy$=new st;#a=this.variantSearchCTRL.valueChanges.pipe(et(this.destroy$),H(e=>w.IsNotEmpty(e)),G(e=>e.type==="ID"?this.httpGetVariantByID(e.str):this.httpRequestVariantByCode(e.str)));constructor(){}httpGetVariantByID(e){let t={entityID:this.#t.Outlet().ID,id:e};return this.#e.post("/API/catalog/variant/GetVariantByID",t).pipe(Dt(i=>this.generateCartItem(i)))}httpRequestVariantByCode(e){return at(this.#t.Outlet,{injector:this.#n}).pipe(et(this.destroy$),H(t=>w.IsNotEmpty(t.ID)),be(),G(t=>this.#e.get(pt.GetVariantByCode,[{key:"Code",value:e},{key:"EntityID",value:t.ID},{key:"Promotion",value:!0}]).pipe(Dt(i=>this.generateCartItem(i)))))}httpRequestGetInventoryByVariantID(e){return at(this.#t.Outlet,{injector:this.#n}).pipe(et(this.destroy$),H(t=>w.IsNotEmpty(t.ID)),be(),G(t=>this.#e.get(pt.GetVariantStockByID,[{key:"EntityID",value:t.ID},{key:"ID",value:e}])))}addItemByVariantID(e){this.httpGetVariantByID(e).pipe(et(this.destroy$),L(t=>this.onAddCartItem(t))).subscribe()}onAddCartItem(e,t=!1){let i=this.#t.CartItems(),n=i.findIndex(y=>y.VariantID===e.VariantID),s=[];n!==-1?t?s=[...i,e]:(i[n].Quantity+=1,s=[...i]):s=[...i,e],this.#t.onChangeCartItems(s)}generateCartItem(e){return this.#i.adapt(q(j({},e),{ID:w.GuidEmpty,Cost:e.UnitCost,Expense:e.UnitCost,SplitQuantity:0,UnitCost:e.UnitCost,InventoryTypeID:4,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:w.GuidEmpty,VariantUnitQuantity:e.VariantUnitQuantity,Storage:e.Storage,UOM:e.UOM,UOMName:e.UOMName,VariantID:e.ID,Variant:this.#o.adapt(e)}))}onRemoveCartItem(e){let t=this.#t.CartItems().filter((i,n)=>e!==n);this.#t.onChangeCartItems(t)}onOpenCartNoteModal(){return this.#r.open(ci)}onOpenCartVoidModal(){return this.#r.open(di)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var zl=(r,e)=>e.key,$l=r=>({selected:r}),Kl=()=>["/menu/Products/Catalog/Variants/Info"];function Jl(r,e){if(r&1){let t=I();a(0,"a",8),g("click",function(){d(t);let n=c().$implicit,s=c();return u(s.onTabChange(n.key))}),m(1),o()}if(r&2){let t=c().$implicit,i=c();p("ngClass",A(2,$l,i.activeTab().key===t.key)),l(),O(" ",t.label," ")}}function Yl(r,e){if(r&1&&_(0,Jl,2,4,"a",7),r&2){let t=e.$implicit;re(t.isVisible?0:-1)}}function Zl(r,e){r&1&&(a(0,"div",12)(1,"h5"),m(2,"Cost"),o(),f(3,"input",18),o())}function Xl(r,e){if(r&1){let t=I();a(0,"div",5)(1,"div",9)(2,"div",10)(3,"h5"),m(4,"Qty"),o(),f(5,"input",11,0),o(),a(7,"div",12)(8,"h5"),m(9,"Price"),o(),f(10,"input",13),o(),_(11,Zl,4,0,"div",14),o(),z(12),a(13,"div",9)(14,"div",15)(15,"h5",16),m(16,"Note"),o(),a(17,"POS-tinymce-editor",17),g("valueChange",function(n){d(t);let s=c();return u(s.onNoteChange(n))}),o()()(),$(),o()}if(r&2){let t,i=c();p("formGroup",i.form),l(11),p("ngIf",i.roleService.product.Cost),l(6),p("value",(t=i.form.get("Note"))==null?null:t.value)}}function tm(r,e){if(r&1&&f(0,"img",30),r&2){let t=c(3);p("ngSrc",t.cartItem.ThumbnailUrl)}}function em(r,e){r&1&&_(0,tm,1,1,"ng-template")}function nm(r,e){r&1&&(z(0),f(1,"i",31),a(2,"h6"),m(3,"No Image"),o(),$())}function im(r,e){if(r&1&&(z(0),a(1,"div",19)(2,"div",20)(3,"a",21),_(4,em,1,0)(5,nm,4,0,"ng-container"),o()(),a(6,"div",22)(7,"div",23),f(8,"i",24),a(9,"div",25),m(10,"Inventory"),o()(),a(11,"table",26)(12,"tbody")(13,"tr")(14,"td",27),m(15," On Hand "),o(),a(16,"td",28),m(17),o()(),a(18,"tr")(19,"td",29),m(20," Allocated "),o(),a(21,"td",28),m(22),o()(),a(23,"tr")(24,"td",29),m(25,"Available"),o(),a(26,"td",28),m(27),o()(),a(28,"tr")(29,"td",29),m(30,"ROP"),o(),a(31,"td",28),m(32),o()(),a(33,"tr")(34,"td",29),m(35,"Max"),o(),a(36,"td",28)(37,"span"),m(38),o()()()()()()(),$()),r&2){let t=c();l(3),p("routerLink",Z(7,Kl)),l(),re(t.cartItem.ThumbnailUrl?4:5),l(13),O(" ",t.inventory().ON_HAND," "),l(5),O(" ",t.inventory().ALLOCATED," "),l(5),O(" ",t.inventory().AVAILABLE," "),l(5),O(" ",t.inventory().ROP," "),l(6),v(t.inventory().MAX)}}function rm(r,e){if(r&1){let t=I();a(0,"POS-tab-serial",32),D("variantChange",function(n){d(t);let s=c();return x(s.storeService.CartItems()[s.data.index],n)||(s.storeService.CartItems()[s.data.index]=n),u(n)})("serialsChange",function(n){d(t);let s=c();return x(s.serials,n)||(s.serials=n),u(n)}),g("onSerialDataChange",function(n){d(t);let s=c();return u(s.onSerialDataHandler(n))}),o()}if(r&2){let t=c();p("isEditBuyForm",!1)("outletID",t.storeService.Outlet().ID),S("variant",t.storeService.CartItems()[t.data.index])("serials",t.serials)}}var ui=class r{constructor(e){this.data=e;this.cartItem=Object.assign({},this.storeService.CartItems()[this.data.index]),this.modalConfig.title=this.cartItem.Variant.Name,this.modalConfig.customWidth="650px",this.modalConfig.bodyScrollable=!0}storeService=h(W);roleService=h(U);modalConfig=new ht;cartItem;form;tabs=ct([]);activeTab=vn(()=>this.tabs().filter(e=>e.isActive)[0]);isItemSerial=ct(!1);inventory=ct({ON_HAND:0,ALLOCATED:0,AVAILABLE:0,ROP:0,MAX:0});serials=[];#t=h(Fe);#e=h(gt);#n=h(Kt);#i=h(kt);#r=h(Pt);#o=h(_t);itemQuantity=ct(1);itemPrice=ct("");itemCost=ct("");itemNote=ct("");onTabChange(e){let t=this.tabs().map(i=>i.key===e?q(j({},i),{isActive:!0}):q(j({},i),{isActive:!1}));this.tabs.set(t)}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??""})}onSerialDataHandler(e){let t=e.reduce((n,s)=>n+s.Quantity,0),i=this.storeService.CartItems().reduce((n,s)=>(s.ID===this.cartItem.ID?n.push(j({},this.#n.adapt(q(j({},s),{Serial:[...e],Quantity:+t})))):n.push(s),n),[]);this.storeService.onChangeCartItems(i)}ngOnInit(){at(this.storeService.CartItems,{injector:this.#r}).pipe(L(e=>{this.cartItem=e[this.data.index]})).subscribe(),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:!0}]),this.requestUnitInStock().subscribe({next:e=>this.inventory.set(q(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)}))}),this.form.valueChanges.pipe(L(e=>{let t=this.storeService.CartItems().reduce((i,n,s)=>(this.data.index===s?i.push(j({},this.#n.adapt(q(j({},n),{Quantity:+e.Quantity,Price:+e.Price,Cost:+e.Cost,Note:e.Note})))):i.push(n),i),[]);this.storeService.onChangeCartItems(t)}),Ge("edit")).subscribe()}onNoteChange(e){this.form.get("Note").setValue(e)}onOK(){if(this.checkIsSerial()){if(Array.isArray(this.cartItem.Serial)&&this.cartItem.Serial.length){let e=this.cartItem.Serial.reduce((t,i)=>t+i.Quantity,0);if(this.cartItem.Quantity!==e){this.#o.warning("Serial must be equal with the quantity",X.Warning);return}}if(this.cartItem.Quantity<0){let e=this.storeService.CartItems().reduce((t,i,n)=>(this.data.index===n?t.push(j({},this.#n.adapt(q(j({},i),{Quantity:+this.cartItem.Quantity,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value})))):t.push(i),t),[]);this.storeService.onChangeCartItems(e)}if(this.cartItem.Quantity>0){let e=this.serials.map(i=>({Quantity:1,Number:i,ExpiryDate:null}));this.cartItem.Serial=[...e],this.cartItem.Quantity=e.reduce((i,n)=>i+n.Quantity,0);let t=this.storeService.CartItems().reduce((i,n,s)=>(this.data.index===s?i.push(j({},this.#n.adapt(q(j({},n),{Quantity:+this.cartItem.Quantity,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):i.push(n),i),[]);this.storeService.onChangeCartItems(t)}}else{let e=this.storeService.CartItems().reduce((t,i,n)=>(this.data.index===n?t.push(j({},this.#n.adapt(q(j({},i),{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(i),t),[]);this.storeService.onChangeCartItems(e)}this.#e.close()}checkIsSerial(){return this.cartItem.Variant!==void 0?this.cartItem.Variant.TypeID===4:!1}requestUnitInStock(){if(w.IsEmpty(this.storeService.Outlet().ID)){this.#o.error("Please select outlet before proceding...",X.Error);return}return at(this.activeTab,{injector:this.#r}).pipe(H(e=>e.key===1),be(),G(e=>this.#i.httpRequestGetInventoryByVariantID(this.cartItem.VariantID)))}onCancel(){this.#e.close()}onSerialChanges(e){this.form.patchValue({Quantity:e.Quantity});let t=e,i=this.storeService.CartItems(),n=[],s=i.findIndex(y=>y.VariantID===t.VariantID);s!==-1&&(i[s]=t,n=[...i],this.storeService.onChangeCartItems(n))}static \u0275fac=function(t){return new(t||r)(C(_e))};static \u0275cmp=P({type:r,selectors:[["adjustment-modal-edit-product"]],standalone:!0,features:[K],decls:11,vars:2,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,"isEditBuyForm","outletID","variant","serials"],[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"],["class","col-auto ps-0",4,"ngIf"],[1,"col-12"],[1,"mb-5"],["height","220px",3,"valueChange","value"],["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-sm-6"],[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","text-start",2,"width","100px"],[1,"text-end"],[1,"table-light","text-start"],["width","400","height","400",1,"border","rounded",3,"ngSrc"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[3,"variantChange","serialsChange","onSerialDataChange","isEditBuyForm","outletID","variant","serials"]],template:function(t,i){if(t&1&&(a(0,"modal-material",1),g("onOk",function(){return i.onOK()})("onCancel",function(){return i.onCancel()})("onClose",function(){return i.onCancel()}),a(1,"content")(2,"div",2)(3,"div",3)(4,"div"),an(5,Yl,1,1,null,null,zl),o()()(),a(7,"div",4),_(8,Xl,18,3,"div",5)(9,im,39,8,"ng-container")(10,rm,1,4,"POS-tab-serial",6),o()()()),t&2){let n;p("config",i.modalConfig),l(5),sn(i.tabs()),l(3),re((n=i.activeTab().key)===0?8:n===1?9:n===2?10:-1)}},dependencies:[jt,Ct,ke,Ee,V,de,lt,F,je,Ae,Ve,We,He,cn,ut,nr,qe,Ue,Ot],styles:[".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}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 om(r,e){if(r&1){let t=I();a(0,"div",27)(1,"button",28),g("click",function(){d(t);let n=c().index,s=c(2);return u(s.onReturnVariant(n))}),m(2," Return "),o(),a(3,"button",28),g("click",function(){d(t);let n=c().index,s=c(2);return u(s.onPurchaseVariant(n))}),m(4," Purchase "),o()()}}function am(r,e){if(r&1&&(a(0,"td",29),m(1),o()),r&2){let t=c().index;l(),O(" ",t+1,". ")}}function sm(r,e){if(r&1){let t=I();z(0),a(1,"div",30)(2,"img",31),g("error",function(n){d(t);let s=c(3);return u(s.onErrorImage(n))}),o()(),$()}if(r&2){let t=c().$implicit;l(2),p("src",t.Variant.ThumbnailUrl,Te)("alt",t.Variant.Name)}}function lm(r,e){r&1&&(a(0,"div",32),f(1,"i",33),o())}function mm(r,e){if(r&1&&(a(0,"span"),m(1),b(2,"number"),o()),r&2){let t=c().$implicit;l(),v(M(2,1,t.Quantity))}}function pm(r,e){r&1&&(a(0,"span",34),m(1," x "),o())}function cm(r,e){if(r&1&&(a(0,"span"),m(1),b(2,"number"),o()),r&2){let t=c().$implicit;l(),v(M(2,1,t.UnitQuantity))}}function dm(r,e){if(r&1&&(z(0),a(1,"small",35),m(2),o(),$()),r&2){let t=c().$implicit;l(2),v(t.Variant.UOM?t.Variant.UOMName:"")}}function um(r,e){if(r&1&&(z(0),a(1,"div",36),m(2),b(3,"number"),o(),$()),r&2){let t=c().$implicit;l(2),O(" ",Q(3,1,t.Price,"1.0-4")," ")}}function _m(r,e){if(r&1){let t=I();z(0),a(1,"tr",7),g("click",function(){let n=d(t).index,s=c(2);return u(s.onOpenModalEditProduct(n))}),_(2,om,5,0,"ng-template",null,1,ot)(4,am,2,1,"td",8),a(5,"td",9)(6,"div",10),_(7,sm,3,2,"ng-container",3)(8,lm,2,0,"ng-template",null,2,ot),a(10,"div",11)(11,"div"),m(12),o(),a(13,"span",12),m(14),o(),a(15,"div"),f(16,"app-serial-note",13),o(),f(17,"small",14),o()()(),a(18,"td",15)(19,"div",16)(20,"div",17)(21,"span"),_(22,mm,3,3,"span",18)(23,pm,2,0,"span",19)(24,cm,3,3,"span",18),o(),_(25,dm,3,1,"ng-container",18),o()()(),a(26,"td"),_(27,um,4,4,"ng-container",18),o(),a(28,"td")(29,"div",20),m(30),b(31,"number"),o()(),a(32,"td",21)(33,"div",16)(34,"div",22),m(35),b(36,"number"),o()()(),a(37,"td",23)(38,"div",24)(39,"span",25),g("click",function(){let n=d(t).index,s=c(2);return u(s.removeCartItem(n))}),f(40,"i",26),o()()()(),$()}if(r&2){let t,i,n=e.$implicit,s=It(3),y=It(9),T=c(2);l(),p("cdkContextMenuTriggerFor",s),l(3),p("ngIf",(t=T.AppConfigJSON())==null?null:t.ModuleSell.Grid.RowNumberVisible),l(3),p("ngIf",n.Variant.ThumbnailUrl)("ngIfElse",y),l(5),v(n.Variant.Name),l(2),v(n.Variant.Code),l(2),p("serials",n.Serial),l(),p("innerHtml",n.Note,R),l(5),p("ngIf",n.Quantity!=1||n.UnitQuantity>1),l(),p("ngIf",n.UnitQuantity>1||n.UnitQuantity<-1),l(),p("ngIf",n.UnitQuantity>1||n.UnitQuantity<-1),l(),p("ngIf",n.Variant.UOM&&((i=T.AppConfigJSON())==null||i.ModuleSell==null?null:i.ModuleSell.Grid.UOMVisible)),l(2),p("ngIf",n.UnitPrice!==n.Total),l(3),O(" ",n.Discount?M(31,15,n.Discount*-1)+"%":""," "),l(5),O(" ",T.roleService.product!=null&&T.roleService.product.Price?M(36,17,+n.Quantity*+n.UnitPrice):" - "," ")}}function gm(r,e){if(r&1){let t=I();z(0),a(1,"table",4)(2,"tbody",5),g("cdkDropListDropped",function(n){d(t);let s=c();return u(s.onDrop(n))}),_(3,_m,41,19,"ng-container",6),o()(),$()}if(r&2){let t=c();l(3),p("ngForOf",t.CartItems())}}function fm(r,e){r&1&&(a(0,"div",37)(1,"div",38)(2,"div",39)(3,"div",40)(4,"div",41),f(5,"i",42),o(),a(6,"div",43)(7,"span"),m(8,"Empty Cart"),o(),f(9,"br"),a(10,"span"),m(11,"Add products to the cart"),o(),f(12,"br"),a(13,"span"),m(14,"or scan barcode"),o()()()()()())}var _i=class r{roleService=h(U);storeService=h(W);cartService=h(kt);matDialog=h(ft);renderer=h(Xi);#t=h(Kt);CartItems=this.storeService.CartItems;AppConfigJSON=this.storeService.AppConfigJSON;onDrop(e){}onOpenModalEditProduct(e){let t=this.matDialog.open(ui,{data:{index:e}})}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((i,n,s)=>(e===s?i.push(j({},this.#t.adapt(q(j({},n),{Quantity:-Math.abs(n.Quantity),TotalPrice:-Math.abs(n.Quantity)*n.Price})))):i.push(n),i),[]);this.storeService.onChangeCartItems(t)}onPurchaseVariant(e){let t=this.storeService.CartItems().reduce((i,n,s)=>(e===s?i.push(j({},this.#t.adapt(q(j({},n),{Quantity:Math.abs(n.Quantity),TotalPrice:Math.abs(n.Quantity)*n.Price})))):i.push(n),i),[]);this.storeService.onChangeCartItems(t)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart-display"]],standalone:!0,features:[K],decls:3,vars:2,consts:[["EMPTY_CART",""],["context_menu",""],["NO_IMAGE",""],[4,"ngIf","ngIfElse"],[1,"table","table-borderless"],["cdkDropList","",3,"cdkDropListDropped"],[4,"ngFor","ngForOf"],["cdkDrag","",1,"border-bottom",2,"padding-left","12px",3,"click","cdkContextMenuTriggerFor"],["style","width: 10px; padding-left: 12px",4,"ngIf"],[1,"pe-0",2,"width","50%","padding-left","12px"],[1,"d-flex","align-items-center"],[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"],[4,"ngIf"],["class","fs-6",4,"ngIf"],[1,"fw-normal","fs-5","text-danger"],["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"],[2,"width","10px","padding-left","12px"],[1,""],[1,"object-fit-contain",2,"height","55px","width","55px",3,"error","src","alt"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6"],["title","UOM",1,"ps-1","fs-5"],[1,"fs-5","text-end"],[1,"row","g-0","h-100"],[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,i){if(t&1&&_(0,gm,4,1,"ng-container",3)(1,fm,15,0,"ng-template",null,0,ot),t&2){let n=It(2);p("ngIf",i.CartItems().length>0)("ngIfElse",n)}},dependencies:[V,Sn,J,xn,Ce,it,Br,Rr,Lr,Qr],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 gi=class r{storeService=h(W);cartService=h(kt);orderService=h(Et);loadFormService=h($e);roleService=h(U);#t=h(wt);onProcess=new nt;onOpenModalNote=new nt;onOpenModalVoid=new nt;constructor(){}onProcessHandler(){this.onProcess.emit()}onOpenModalNoteHandler(){this.onOpenModalNote.emit(),this.cartService.onOpenCartNoteModal().afterClosed().subscribe({next:t=>{Object.keys(t).forEach(i=>{this.orderService.onUpdateOrderState(i,t[i])})}})}onOpenModalVoidHandler(){this.onOpenModalVoid.emit(),this.cartService.onOpenCartVoidModal().afterClosed().pipe(H(t=>t.type==="OK"),G(()=>this.loadFormService.getLoadForm$),L(()=>{this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeCartItems([]),this.storeService.onChangeIsOpenDialog(!1),this.#t.navigate(["/menu/Adjustment/Adjustment/Archive/Form/V2"])})).subscribe()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart-action"]],outputs:{onProcess:"onProcess",onOpenModalNote:"onOpenModalNote",onOpenModalVoid:"onOpenModalVoid"},standalone:!0,features:[K],decls:13,vars:2,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","fa-rectangle-xmark"],[1,"col-7"],["type","button",1,"btn","btn-success","w-100","fs-3","px-0","py-6",2,"border-left","0.1px solid #fff",3,"click"],[1,"fs-6"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"button",2),g("click",function(){return i.onOpenModalNoteHandler()}),f(3,"i",3),o(),a(4,"button",4),g("click",function(){return i.onOpenModalVoidHandler()}),f(5,"i",5),a(6,"span"),m(7,"Void"),o()()(),a(8,"div",6)(9,"button",7),g("click",function(){return i.onProcessHandler()}),m(10," Process "),a(11,"small",8),m(12),o()()()()),t&2&&(l(12),se("(",i.storeService.CartItems().length," items, ",i.storeService.QtyCartItems()," Qty)"))},styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};var fi=class r{cartService=h(kt);query=new Ne({});#t=h(k);#e=h(W);constructor(){}ngOnInit(){this.query.valueChanges.pipe(H(e=>w.IsNotEmpty(e)),G(e=>e.type==="ID"?this.cartService.httpGetVariantByID(e.str):this.cartService.httpRequestVariantByCode(e.str))).subscribe({next:e=>{this.cartService.onAddCartItem(e)}})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart-header"]],standalone:!0,features:[K],decls:4,vars:1,consts:[[1,"row"],[1,"col"],[1,""],[3,"formControl"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),f(3,"POS-variant-autocomplete",3),o()()()),t&2&&(l(3),p("formControl",i.query))},dependencies:[kr,Fr,ce,F,de,bn]})};var Bi=class{constructor(e,t,i,n,s,y,T,tt,bt,xt,yt){this._StateID=e,this._StateLabel=t,this._Success=i,this._Message=n,this._InvoiceID=s,this._OrderID=y,this._InvoiceNumber=T,this._PrintMode=tt,this._DeliveryID=bt,this._PaymentStateID=xt,this._PaymentStateLabel=yt}_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}}},hi=class r{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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var Ci=class r{constructor(e){this.dialogRef=e;this.config=new ht,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0}config;onClose(){this.dialogRef.close({role:"close"})}onCancel(){this.dialogRef.close({role:"cancel"})}submit(e){this.dialogRef.close({role:"ok",data:e})}static \u0275fac=function(t){return new(t||r)(C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-with-approval"]],standalone:!0,features:[K],decls:9,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid",2,"width","500px","display","flex","justify-content","space-around"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-file-pen"],[1,"btn","btn-outline-secondary","ms-5",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-user-magnifying-glass"]],template:function(t,i){t&1&&(a(0,"modal-material",0),g("onCancel",function(){return i.dialogRef.close()})("onClose",function(){return i.dialogRef.close()}),a(1,"content")(2,"div",1)(3,"div",2),g("click",function(){return i.submit(0)}),f(4,"i",3),m(5," Save as Draft "),o(),a(6,"div",4),g("click",function(){return i.submit(1)}),f(7,"i",5),m(8," Submit for Review "),o()()()()),t&2&&p("config",i.config)},dependencies:[jt,Ct]})};var yi=class r{destroy$=new st;#t=h(Et);#e=h(W);#n=h(hi);toastr=h(_t);matDialog=h(ft);constructor(){}ngOnInit(){}onProcessOrder(){if(w.IsEmpty(this.#e.Outlet().ID)){this.toastr.error("Please select outlet before proceeding..",X.Error);return}if(this.#e.CartItems().length==0){this.toastr.error("You must have at least one item.",X.Error);return}if(w.IsEmpty(this.#e.Order().Number)){this.toastr.error("Number cannot be empty.",X.Error);return}switch(this.#e.AppConfigJSON().ModuleAdjustment.Basic.Workflow){case 1:this.#t.processOrder().pipe(et(this.destroy$)).subscribe({next:e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))},error:e=>{console.log("error",e)}});break;case 2:this.#e.AdjustmentState()==0&&this.matDialog.open(Ci).afterClosed().pipe(H(e=>e!=null&&e.role==="ok"),L(e=>{let t=e.data+1;this.#t.onUpdateOrderState("StateID",Number(t))}),G(e=>this.#t.processOrder()),L(e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))})).subscribe(),this.#e.AdjustmentState()==1&&this.#t.processOrder().pipe(et(this.destroy$)).subscribe({next:e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))},error:e=>{console.log("error",e)}});break}}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart"]],standalone:!0,features:[K],decls:9,vars:0,consts:[[1,"h-100","d-flex","flex-column"],[1,"pt-4"],[1,"row"],[1,"col"],[1,"",2,"overflow-y","auto","flex","1 1 0%"],[1,""],[3,"onProcess"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),f(4,"adjustment-cart-header"),o()()(),a(5,"div",4),f(6,"adjustment-cart-display"),o(),a(7,"div",5)(8,"adjustment-cart-action",6),g("onProcess",function(){return i.onProcessOrder()}),o()()())},dependencies:[_i,gi,fi]})};var vi=class r{destroy$=new st;#t=h(W);#e=h(k);#n=h(Pt);#i=h(Et);constructor(){}httpGenerateNumber$(){let e=at(this.#t.Outlet,{injector:this.#n}),t=at(this.#t.IsComplete,{injector:this.#n});return Ie([e,t]).pipe(et(this.destroy$),H(([i,n])=>w.IsNotEmpty(i.ID)),be(),G(([i,n])=>this.#e.post("/API/Adjustment/GenerateNumber",{ID:i.ID}).pipe(Dt(s=>s.Number))),L(i=>{this.#i.onUpdateOrderState("Number",i)}),yn(1))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};function hm(r,e){if(r&1&&(a(0,"div",25)(1,"div",26),m(2),o(),a(3,"div",26),m(4),o()()),r&2){let t=e.$implicit;l(2),v(t.Variant.Name),l(2),v(t.Quantity)}}var Ii=class r{#t=h(rt);#e=h(In);menu$;storeService=h(W);#n=h(wt);#i=h(vi);#r=h(Et);cartItems;constructor(){this.#t.setMenu$(),this.menu$=this.#t.menu$.pipe(Dt(e=>q(j({},e),{H:"Inventory Adjustment",T:e.T.replace("undefined","Inventory Adjustment")})),L(e=>this.#e.setTitle(e.T)))}handleF8(){this.onNewAdjustment()}onPrintReceipt(){return gn(this,null,function*(){window.open(`/print/Adjustment?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onGotoAdjustmentDetail(){return gn(this,null,function*(){window.open(`/menu/Adjustment/Adjustment/Archive/Info?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onNewAdjustment(){return gn(this,null,function*(){this.storeService.onChangeCartItems([]),yield this.#n.navigate(["menu/Adjustment/Adjustment/Archive/Form/V2"],{queryParams:{}}),this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeIsComplete(),this.storeService.onChangeCartItems([])})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-order-complete"]],hostBindings:function(t,i){t&1&&g("keydown.F8",function(){return i.handleF8()},!1,Vt)},inputs:{cartItems:"cartItems"},standalone:!0,features:[K],decls:36,vars:10,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"order-complete"],[1,"container-fluid","pt-8"],[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,"click"],[1,"card-body"],["class","row justify-content-between mb-3",4,"ngFor","ngForOf"],[1,"row","justify-content-end","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col-4","text-end"],[1,"row","justify-content-between","mb-3"],[1,"col","text-end"]],template:function(t,i){t&1&&(a(0,"mainpanel-cmp",0),b(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),m(11,"Inventory Adjustment Complete "),o()(),a(12,"div",9)(13,"div",10)(14,"div",11)(15,"a",12),g("click",function(){return i.onNewAdjustment()}),m(16," New Adjustment (F8)"),o()()()(),a(17,"div",13)(18,"div",14)(19,"a",15),g("click",function(){return i.onPrintReceipt()}),f(20,"i",16),m(21,"Print Receipt"),o()()()()(),a(22,"div",17)(23,"div",5)(24,"div",18)(25,"h3",19)(26,"a",20),g("click",function(){return i.onGotoAdjustmentDetail()}),m(27),o()()(),a(28,"div",21),_(29,hm,5,2,"div",22),a(30,"div",23)(31,"div",24),m(32,"Total:"),o(),a(33,"div",24),m(34),b(35,"number"),o()()()()()()()()()()),t&2&&(p("pageData",M(1,6,i.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),l(27),O("Adjustment #",i.storeService.OrderComplete().InvoiceNumber,""),l(2),p("ngForOf",i.cartItems),l(5),O(" ",M(35,8,i.storeService.QtyCartItems())," "))},dependencies:[le,it,Re,mt,J,wn],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} #full-container{padding-top:60px!important}"]})};function Cm(r,e){if(r&1&&(a(0,"div",16)(1,"div",17)(2,"div"),m(3),o(),a(4,"small",18),m(5),o()()()),r&2){let t=e.data;l(3),v(t==null?null:t.Value),l(2),v(t==null?null:t.Code)}}var _n=class r{modalConfig=new ht;cartService=h(kt);cartItem=ct(null);query=new Ne(null);form;#t=h(gt);unsubscribe$=new st;#e=h(Fe);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)}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:[""]})}onSelected(e){}ngOnInit(){this.initForm(),this.query.valueChanges.pipe(et(this.unsubscribe$),G(e=>this.cartService.httpGetVariantByID(e).pipe()),Ge("get cart item")).subscribe({next:e=>{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()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-modal-cart-add"]],standalone:!0,features:[K],decls:29,vars:7,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,"optionSelected","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"],["height","220px",3,"valueChange","value"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"]],template:function(t,i){if(t&1){let n=I();a(0,"modal-material",2),g("onCancel",function(){return d(n),u(i.onCancel())})("onClose",function(){return d(n),u(i.onCancel())})("onOk",function(){return d(n),u(i.onOK())}),a(1,"content")(2,"div",3)(3,"div",4)(4,"div",5)(5,"autocompleteV2",6),g("optionSelected",function(y){return d(n),u(i.onSelected(y))})("keyup.enter",function(y){return d(n),u(y.stopPropagation())}),o(),_(6,Cm,6,2,"ng-template",null,0,ot),o()(),a(8,"div",7)(9,"div",8)(10,"div",9)(11,"h5"),m(12,"Qty"),o(),f(13,"input",10,1),o(),a(15,"div",11)(16,"h5"),m(17,"Price"),o(),f(18,"input",12),o(),a(19,"div",11)(20,"h5"),m(21,"Cost"),o(),f(22,"input",13),o()(),z(23),a(24,"div",8)(25,"div",5)(26,"h5",14),m(27,"Note"),o(),a(28,"POS-tinymce-editor",15),g("valueChange",function(y){return d(n),u(i.onChangeNote(y))}),o()()(),$(),o()()()()}if(t&2){let n,s=It(7);p("config",i.modalConfig),l(5),p("formControl",i.query)("renderThumbnail",!0)("useCustomTemplate",!0)("itemTemplate",s),l(3),p("formGroup",i.form),l(20),p("value",(n=i.form.get("Note"))==null?null:n.value)}},dependencies:[Ue,Ot,Mn,Le,jt,Ct,Pr,lt,F,je,de,bn,Ae,Ve,We,He]})};var Io=Mi(Yo());function ym(r,e){if(r&1){let t=I();a(0,"POS-uppy",2),g("onParser",function(n){d(t);let s=c();return u(s.onParser(n))})("fileUploaded",function(n){d(t);let s=c();return u(s.onUploadCsv(n))})("fileRemoved",function(){d(t);let n=c();return u(n.onRemovedFile())}),o()}if(r&2){let t=c();p("sampleUrl",t.sampleURL)}}var bi=class r{modalConfig;sampleURL;fileInput=ct(null);unsubscribe$=new st;#t=h(gt);#e=h(k);#n=h(W);#i=h(kt);#r=h(Pt);cartItem=ct([]);skipEmptyLines=!0;rowCount=ct(0);rowEmpty=ct(0);totalRows=vn(()=>this.rowCount()-this.rowEmpty());file=ct(null);constructor(){this.modalConfig=new ht,this.modalConfig.title="Import Items",this.modalConfig.customWidth="500px",this.sampleURL="https://res.cloudinary.com/pos/raw/upload/v1699867623/POS/CSV/ImportAdjustment_DealPOS_New.csv"}onOK(){at(this.cartItem,{injector:this.#r}).pipe(G(e=>{let t={EntityID:this.#n.Outlet().ID,CartItems:e};return this.#e.post("/API/Adjustment/UploadCsvV2",t).pipe(Ge("response")).pipe(Cn(i=>[]))}),L(e=>{Array.isArray(e)&&e.length>0&&e.forEach(t=>this.#i.onAddCartItem(t,!0))})).subscribe(),this.#t.close()}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),Io.default.parse(t,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:i=>{let n=i.split(/\r?\n/).slice(1);return n[n.length-1]===""&&n.pop(),this.rowCount.set(n.length),n.forEach(s=>{s.split(",").every(T=>T==="")&&this.rowEmpty.update(T=>T+=1)}),i},error(i,n){console.log("ERROR",i,n)},complete:(i,n)=>{console.log("COMPLETE",i),this.cartItem.set(i.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||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-modal-cart-upload"]],standalone:!0,features:[K],decls:3,vars:1,consts:[["modalContent",""],[3,"onOk","onCancel","onClose","config"],[3,"onParser","fileUploaded","fileRemoved","sampleUrl"]],template:function(t,i){if(t&1){let n=I();a(0,"modal-material",1),g("onOk",function(){return d(n),u(i.onOK())})("onCancel",function(){return d(n),u(i.onClose())})("onClose",function(){return d(n),u(i.onClose())}),_(1,ym,1,1,"ng-template",null,0,ot),o()}t&2&&p("config",i.modalConfig)},dependencies:[jt,Ct,Nr]})};function vm(r,e){if(r&1){let t=I();a(0,"li",11),g("click",function(){let n=d(t).$implicit,s=c(3);return u(s.onClickMenu(n))}),f(1,"POS-dropdown-item-more-action",12),o()}if(r&2){let t=e.$implicit;l(),p("icon",t.icon)("label",t.title)}}function Im(r,e){if(r&1&&an(0,vm,2,2,"li",10,Oi),r&2){let t=c().$implicit;sn(t.children)}}function bm(r,e){if(r&1&&(a(0,"div",7)(1,"div",8),m(2),o(),f(3,"div",9),_(4,Im,2,0),o()),r&2){let t=e.$implicit;l(2),v(t.title),l(2),re(t.children.length>0?4:-1)}}var xi=class r{menu=ct([]);#t=h(ft);router=h(wt);handleF8(){this.#t.openDialogs&&this.#t.openDialogs.length>0||this.#t.open(_n)}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"}]},{title:"Advanced",icon:"",children:[{title:"Adjustment V1",icon:"fa-scanner-gun fas",value:"adjustment v1"}]}];this.menu.set(e)}onClickMenu(e){switch(e.value){case"add":this.#t.open(_n);break;case"upload":this.#t.open(bi);break;case"adjustment v1":this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Form"]);break}}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-more-actions"]],hostBindings:function(t,i){t&1&&g("keydown.F4",function(s){return i.handleF8(s)},!1,Vt)},standalone:!0,features:[K],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","300px"],[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,i){t&1&&(a(0,"span",0)(1,"span",1),f(2,"i",2),o(),a(3,"span",3),m(4,"More Actions"),o()(),a(5,"div",4)(6,"div",5)(7,"div",6),an(8,bm,5,2,"div",7,Oi),o()()()),t&2&&(l(8),sn(i.menu()))},dependencies:[Wr]})};var Hi=class{constructor(e,t,i,n){this._Order=e,this._Items=t,this._OrderItems=i,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}},Si=class r{adapt(e){return new Hi(e.Order,e.Items,e.OrderItems,e.CountedItems)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})},Wi=class{constructor(e,t,i,n,s,y,T,tt,bt,xt,yt,At,Bt,St,Jt,Yt,Zt,Xt,te,ee,ne,ie){this._EntityID=e,this._Number=t,this._Date=i,this._PIC=n,this._Note=s,this._EntityName=y,this._StateID=T,this._StateLabel=tt,this._ReviewDate=bt,this._ReviewerID=xt,this._TypeID=yt,this._TypeLabel=At,this._Quantity=Bt,this._UnitPrice=St,this._UnitCost=Jt,this._TotalPrice=Yt,this._AdjustedQuantity=Zt,this._CreatorID=Xt,this._Created=te,this._ModifierID=ee,this._Modified=ne,this._ID=ie}_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}},bo=class r{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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})},qi=class{constructor(e,t,i,n,s,y,T,tt,bt,xt,yt,At){this._LostNFoundID=e,this._UnitCost=t,this._InventoryTypeID=i,this._UnitPrice=n,this._Discount=s,this._VariantID=y,this._Note=T,this._Quantity=tt,this._UnitQuantity=bt,this._Index=xt,this._Serial=yt,this._ID=At}_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}},xo=class r{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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})},Gi=class{constructor(e,t,i,n,s,y,T,tt,bt,xt,yt,At){this._ParentID=e,this._Start=t,this._Finish=i,this._UnitPrice=n,this._UnitCost=s,this._VariantID=y,this._Note=T,this._Quantity=tt,this._UnitQuantity=bt,this._Index=xt,this._Serial=yt,this._ID=At}_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}},So=class r{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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var Do=Mi(xr());function xm(r,e){if(r&1&&(z(0),f(1,"adjustment-order-complete",2),$()),r&2){let t=c();l(),p("cartItems",t.storeService.CartItems())}}function Sm(r,e){if(r&1){let t=I();a(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"POS-select-outlet-form",8),b(6,"async"),g("ngModelChange",function(n){d(t);let s=c();return u(s.storeService.onChangeOutlet(n))}),o(),a(7,"POS-invoice-number-form",9),b(8,"async"),g("ngModelChange",function(n){d(t);let s=c();return u(s.onInvoiceNumberChange(n))}),o()(),a(9,"POS-invoice-date",10),g("ngModelChange",function(n){d(t);let s=c();return u(s.onChangeOrderDate(n))}),o()()(),a(10,"div",11)(11,"div",12)(12,"div",13),f(13,"adjustment-more-actions"),o(),a(14,"div",14),f(15,"i",15),a(16,"ng-select",16),g("ngModelChange",function(n){d(t);let s=c();return u(s.onChangeAdjustmentType(n))}),o()()()()(),a(17,"div",17)(18,"div",18)(19,"POS-quick-key",19),g("onSelectVariant",function(n){d(t);let s=c();return u(s.onSelectVariant(n))}),o()(),a(20,"div",20),f(21,"adjustment-cart"),o()()()}if(r&2){let t=c();l(5),p("disabled",t.storeService.AdjustmentState()===1)("isOpenAfterLoad",M(6,16,t.isOpenDiaglog$))("outlets",t.storeService.Outlets())("ngModel",t.storeService.Outlet()),l(2),p("ngModel",t.storeService.Order().Number)("transactionType",M(8,18,t.transactionType$))("disabled",!(t.roleService.global!=null&&t.roleService.global.Number)),l(2),p("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),p("clearable",!1)("ngModel",t.storeService.Order().TypeID)("disabled",!!t.storeService.Order().TypeID&&t.storeService.AdjustmentState()===1)("items",t.storeService.AdjustmentTypes()),l(3),p("quickKey",t.storeService.QuickeyItems())("outletID",t.storeService.Outlet().ID)}}var Di=class r{isOpenDialog=ct(!0);loadFormService=h($e);storeService=h(W);quickeyService=h(pi);cartService=h(kt);orderService=h(Et);isOpenDiaglog$;Outlets$;loadForm$;adjustmentEditDataAdapter=h(Si);roleService=h(U);#t=h(Kt);#e=h(Ke);#n=h(pe);transactionType$=this.#n.queryParamMap.pipe(Dt(e=>(e.has("ID"),"Adjustment")));title=h(In);injector=h(Pt);test=[];ngOnInit(){let e=JSON.parse(localStorage.getItem("AccountInfo"));this.title.setTitle(e.BrandName+" POS | New Inventory Adjustment"),this.test=this.storeService.Outlets()&&this.storeService.Outlets().filter((t,i)=>i===0),this.#n.queryParamMap.pipe(G(t=>{if(t.has("ID")){this.storeService.onChangeAdjustmentState(1);let i={EntityID:"00000000-0000-0000-0000-000000000000",ID:t.get("ID")};return this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeAdjustmentState(1),this.loadFormService.httpRequestLoadForm$(i).pipe(L(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 s=n.Data.Items.map(y=>this.#t.adapt(q(j({},y),{Variant:this.#e.adapt(y.Variant)})));if(this.storeService.onChangeCartItems(s),this.orderService.onUpdateOrderState("PIC",n.Data.Order.PIC),this.orderService.onUpdateOrderState("Note",n.Data.Order.Note),n.Entities.length>0){let y=n.Entities.findIndex(T=>T.ID===n.Data.Order.EntityID);y!==-1&&this.storeService.onChangeOutlet(n.Entities[y])}}}))}return this.storeService.onChangeAdjustmentState(0),this.loadFormService.httpRequestLoadForm$()})).subscribe({}),at(this.storeService.IsOpenDialog,{injector:this.injector}).pipe().subscribe(),at(this.storeService.AppConfigJSON,{injector:this.injector}).pipe(L(t=>this.orderService.onUpdateOrderState("StateID",t?.ModuleAdjustment.Advance.AdjustmentInputType))).subscribe(),this.isOpenDiaglog$=at(this.storeService.IsOpenDialog,{injector:this.injector})}onChangeAdjustmentType(e){let t=this.storeService.AdjustmentTypes().filter(i=>i.Key===e)[0];this.orderService.onUpdateOrderState("TypeID",t.Key)}onInvoiceNumberChange(e){this.orderService.onUpdateOrderState("Number",e)}onChangeOrderDate(e){this.orderService.onUpdateOrderState("Date",(0,Do.default)(e).startOf("day").format("YYYY-MM-DDTHH:mm:ss.SSS"))}onSelectVariant(e){this.cartService.addItemByVariantID(e)}ngOnDestroy(){this.storeService.onResetState()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-adjustment-v2"]],standalone:!0,features:[K],decls:3,vars:2,consts:[["ON_GOING",""],[4,"ngIf","ngIfElse"],[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,i){if(t&1&&_(0,xm,2,1,"ng-container",1)(1,Sm,22,20,"ng-template",null,0,ot),t&2){let n=It(2);p("ngIf",i.storeService.IsComplete())("ngIfElse",n)}},dependencies:[Re,V,le,wr,Vr,Ur,Ar,ce,F,Y,Pn,Mt,yi,Ii,xi],styles:[".left-toolbar-container[_ngcontent-%COMP%]{position:relative}.left-toolbar-container[_ngcontent-%COMP%] POS-invoice-number-form[_ngcontent-%COMP%]{position:absolute;top:34px;left:28px}.header[_ngcontent-%COMP%]{min-height:60px}.content[_ngcontent-%COMP%]{min-height:calc(100vh - 60px)}.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 Dm=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Pm=r=>({ID:r});function wm(r,e){if(r&1){let t=I();a(0,"button",11),g("click",function(){d(t);let n=c(2);return u(n.openExportModal())}),f(1,"i",12),m(2," Export "),o()}}function Mm(r,e){if(r&1){let t=I();a(0,"div")(1,"div",13)(2,"h6"),m(3,"Variant"),o(),a(4,"autocompleteV2",14),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.ID,n)||(s.pageData.Filter.ID=n),u(n)}),o(),a(5,"h6"),m(6,"Outlet"),o(),a(7,"ng-select",15),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,n)||(s.pageData.Filter.EntityID=n),u(n)}),o(),a(8,"h6"),m(9,"From"),o(),a(10,"datepicker",16),D("dateChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.From,n)||(s.pageData.Filter.From=n),u(n)}),o(),a(11,"h6"),m(12,"To"),o(),a(13,"datepicker",17),D("dateChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.To,n)||(s.pageData.Filter.To=n),u(n)}),o()()()}if(r&2){let t=c(2);l(4),S("ngModel",t.pageData.Filter.ID),p("inputTextValue",t.pageData.Filter.VariantName),l(3),p("items",t.pageData.Options.Entities),S("ngModel",t.pageData.Filter.EntityID),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.From),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.To)}}function Om(r,e){r&1&&(a(0,"th"),m(1,"Variant"),o())}function Tm(r,e){if(r&1&&(a(0,"td"),m(1),o()),r&2){let t=c().$implicit;l(),v(t.Name)}}function Em(r,e){if(r&1&&(a(0,"tr",18),_(1,Tm,2,1,"td",8),b(2,"async"),a(3,"td"),m(4),o(),a(5,"td")(6,"a",19),m(7),o()(),a(8,"td"),m(9),b(10,"number"),o(),a(11,"td"),m(12),b(13,"date"),o()()),r&2){let t=e.$implicit,i=c(2);l(),p("ngIf",!M(2,7,i.isRedirect$)),l(3),v(t.EntityName),l(2),p("routerLink",Z(14,Dm))("queryParams",A(15,Pm,t.ID)),l(),v(t.Number),l(2),v(M(10,9,t.Quantity)),l(3),v(Q(13,11,t.Date,"dd/MM/yy"))}}function km(r,e){if(r&1){let t=I();a(0,"mainpanel-cmp",2),D("textChange",function(n){d(t);let s=c();return x(s.pageData.Filter.Number,n)||(s.pageData.Filter.Number=n),u(n)}),g("onSubmit",function(){d(t);let n=c();return u(n.searchFromPageOne())}),D("filterChange",function(n){d(t);let s=c();return x(s.pageData.Filter,n)||(s.pageData.Filter=n),u(n)}),a(1,"actions"),_(2,wm,3,0,"button",3),o(),a(3,"filters"),_(4,Mm,14,8,"ng-template",null,0,ot),o(),a(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr"),_(12,Om,2,0,"th",8),b(13,"async"),a(14,"th"),m(15,"Outlet"),o(),a(16,"th"),m(17,"Number"),o(),a(18,"th"),m(19,"Quantity"),o(),a(20,"th"),m(21,"Date"),o()()(),a(22,"tbody"),_(23,Em,14,17,"tr",9),o()()(),a(24,"POS-complex-pagination",10),g("jumpToPage",function(){d(t);let n=c();return u(n.getListData())})("previousPage",function(){d(t);let n=c();return u(n.getListData())})("nextPage",function(){d(t);let n=c();return u(n.getListData())}),o()()()()}if(r&2){let t=c();p("pageData",t.menuData),S("text",t.pageData.Filter.Number),p("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.roleService.global.Export),l(10),p("ngIf",!M(13,9,t.isRedirect$)),l(11),p("ngForOf",t.data.Data),l(),p("total",t.data.Data==null?null:t.data.Data.length)("pageData",t.pageData)}}var Pi=class r extends Ft{constructor(t,i,n,s,y){super(t,i,"catalog/product/GetAdjustmentHistory","catalog/productLoader/GetAdjustmentHistoryLoader",null,n);this.matDialog=s;this.roleService=y;this.isRedirect$=$i(this.route.snapshot.queryParamMap).pipe(Dt(T=>T.has("ID")),yn(1))}isRedirect$;openExportModal(){this.matDialog.open(Wt,{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(i){return new(i||r)(C(rt),C(k),C(pe),C(ft),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-history-variant"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["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"],[1,"border-bottom"],["target","_blank",3,"routerLink","queryParams"]],template:function(i,n){i&1&&_(0,km,25,11,"mainpanel-cmp",1),i&2&&p("ngIf",n.data)},dependencies:[J,V,ut,mt,F,Y,he,Mt,Le,Be,le,it,me]})};var zi=(r,e)=>{let t=h(U),i=h(wt),n=t[r.data.module],s=t;if(n){let{context:y}=r.data,T=y.includes("Edit"),tt=y.includes("Create"),bt=T&&n.Edit,xt=tt&&n.Create,yt=r.queryParamMap.has("ID");if(yt&&T&&!bt)return i.navigate(["menu/Unauthorized/Main/Unauthorized"]),!1;if(!yt&&tt&&!xt)return i.navigate(["menu/Unauthorized/Main/Unauthorized"]),!1}return!0};var jm=[{path:"Adjustment/Archive",component:Ln},{path:"Adjustment/Archive/Info",component:An},{path:"Adjustment/Archive/Form",component:$n,canActivate:[zi],data:{module:"adjustment",context:["Create","Edit"]}},{path:"Adjustment/Archive/Form/V2",component:Di,canActivate:[zi],data:{module:"adjustment",context:["Create","Edit"]}},{path:"Tools/Count_Product_Inventory",component:ri},{path:"Tools/Convert_Inventory_to_Parent_UOM",component:ii},{path:"Tools/Product_Sheet",component:oi},{path:"Report/Adjustment",component:Xn},{path:"History/Variant",component:Pi},{path:"Adjustment/Stock_Take_by_Web_Spreadsheet",component:ni},{path:"Adjustment/Stock_Take_by_CSV",component:ti},{path:"",redirectTo:"Adjustment/Archive",pathMatch:"full"}],wi=class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=Oe({type:r});static \u0275inj=Me({imports:[cn.forChild(jm),cn]})};var Po=class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=Oe({type:r});static \u0275inj=Me({imports:[ke,wi,Re,ce,wn,Sr,Pn,Zr,to,Mn,jt,Er,_r,Dr,jt,Kr,qr,Ti,br,Ue,sr,dr,jr,ar,oo,Ti,cr,no,ro,jn,We,Hr,Zn,Ce,Tn,En,qe]})};export{Po as AdjustmentModule};
|
|
1
|
+
import{a as ao,b as Nn,c as so}from"./chunk-UQJVM3QL.js";import{a as lo}from"./chunk-HYED47DK.js";import{a as Jr,b as Yr,c as Zr,d as Xr,e as to,f as io,g as ro}from"./chunk-PD5E2UG6.js";import{a as eo,b as no}from"./chunk-HSH3U3NZ.js";import{b as oo}from"./chunk-OF2HST5N.js";import{G as kr}from"./chunk-NSRZZXL3.js";import"./chunk-RRQI7YBE.js";import"./chunk-H3I3GRUR.js";import"./chunk-ADJIB445.js";import"./chunk-K7ACLCRR.js";import"./chunk-TK5H65DN.js";import"./chunk-B5FODXLM.js";import"./chunk-6BK7YHCM.js";import{a as Mr,b as Or,c as Tr,d as kn,e as Er}from"./chunk-6CMTBTF4.js";import"./chunk-6L6CIH5M.js";import"./chunk-RBHBHEHA.js";import"./chunk-JC5VQPOU.js";import"./chunk-FNNVQKO3.js";import{a as qe}from"./chunk-MMMUAIC4.js";import{a as lr}from"./chunk-5BZ3MV4S.js";import{a as Ge}from"./chunk-AQS7ZG75.js";import{a as Ur,b as Lr,c as Rr,d as Qr,e as Br,f as Wr}from"./chunk-HLBSFB5P.js";import{b as Fr}from"./chunk-O3QEQTRY.js";import"./chunk-JXCGJLM3.js";import"./chunk-I3NUPTGA.js";import{c as jn}from"./chunk-FDJCJBZ4.js";import"./chunk-QNQO4QD7.js";import"./chunk-KTBBK3PZ.js";import{b as wr}from"./chunk-2SDASQS6.js";import"./chunk-2CSFHPOU.js";import"./chunk-VVOAOYFG.js";import{a as Ar,b as Vr}from"./chunk-BPUD4VLT.js";import"./chunk-BYXBJQAS.js";import{a as qr,b as Gr,e as zr,f as $r,g as Kr}from"./chunk-OQLI3GL4.js";import{d as Pr}from"./chunk-WXPYLO7I.js";import"./chunk-F6E7434J.js";import{a as Hr}from"./chunk-NV4F3EAU.js";import"./chunk-WZ3ZHHDP.js";import"./chunk-3YUW3R7G.js";import{a as Yo,b as Nr}from"./chunk-2BWYY4MQ.js";import{b as Ti}from"./chunk-OKR43MTB.js";import{e as jr}from"./chunk-SZXNOUBK.js";import{a as He,b as We}from"./chunk-LRITIWKE.js";import{a as Ce}from"./chunk-REDP5RDI.js";import{a as Qe}from"./chunk-NAHLCIMF.js";import{a as hr}from"./chunk-LPKDE3ES.js";import"./chunk-SCLRE6QV.js";import"./chunk-JNZOT7YV.js";import{a as Ut}from"./chunk-BBOFKPT3.js";import"./chunk-IDN3C67X.js";import"./chunk-5QPEMH3U.js";import{o as xr,r as he,s as Sr}from"./chunk-O55WIKRR.js";import"./chunk-4TJDMTAL.js";import{a as pt}from"./chunk-KFNCZ3ZB.js";import{a as Cr}from"./chunk-ASSILUFP.js";import{g as Tn}from"./chunk-Z4LON2SE.js";import"./chunk-WVE6Y5CB.js";import{a as Be,b as Dr}from"./chunk-6L3SYQNX.js";import{a as fr,b as Wt}from"./chunk-AILI7OYP.js";import{d as On,e as br}from"./chunk-7GWZ36VL.js";import{a as mr,b as pr,c as cr}from"./chunk-FTR7AA6W.js";import{a as Ft}from"./chunk-67F5SJVS.js";import"./chunk-G7MJDRKQ.js";import"./chunk-6DKKU2XR.js";import"./chunk-CGY7S5VD.js";import{a as Ot}from"./chunk-UIOYKSGI.js";import{a as Ue}from"./chunk-ZJK2D57G.js";import{a as ur,b as xn,d as Sn,e as _r}from"./chunk-DAGT3EWL.js";import{a as En}from"./chunk-JFX5X6A2.js";import{b as mt,c as Re}from"./chunk-JLMC2QL5.js";import"./chunk-GIDOHD4M.js";import{a as ue,b as rt}from"./chunk-WVAWPQSM.js";import{h as dr,l as Le,m as Mn}from"./chunk-OHQNX7T2.js";import"./chunk-ZK6DATHK.js";import{b as Ir}from"./chunk-GGHVOCFP.js";import{a as X,b as Dn,c as at,d as gt,e as _e,f as ft,h as ht,i as Ct,j as jt}from"./chunk-RFXXMOJ3.js";import{Aa as Ht,Ba as sr,K as or,la as ar}from"./chunk-FAUAPPQ7.js";import{N as wn,U as fe,Y as vr,g as ge,n as yr}from"./chunk-BBRWTT5B.js";import"./chunk-NJZMANF5.js";import"./chunk-UJBDZYC5.js";import{a as gr,e as Mt,f as Pn}from"./chunk-NRGFP2PU.js";import"./chunk-K2MSZS6P.js";import{A as Fe,B as ce,C as de,b as rr,c as lt,h as F,i as je,l as Ne,n as Y,r as bn,s as Ae,t as Ve}from"./chunk-NEPW5RA2.js";import{a as ir}from"./chunk-TIIZI7P2.js";import"./chunk-LXSYPTVI.js";import{b as U}from"./chunk-YGNJW3QK.js";import{a as w}from"./chunk-5WAGVKZG.js";import{$ as et,$a as ct,$b as S,Aa as Pt,Bb as I,C as H,Ca as nt,Da as Zi,Dc as vn,Eb as g,G as Cn,Gb as c,Gd as pe,H as ae,Id as wt,Jd as ut,Kb as er,Lc as Ee,Ld as cn,N as be,Na as R,Nc as J,Oa as Te,Ob as ln,Oc as V,Od as _t,Pb as mn,Qa as Vt,Qb as pn,Rd as k,S as Ji,Sa as l,Ta as C,Tc as le,U as yn,Ub as It,Vb as m,Vc as me,Wb as v,Xb as O,Xc as it,Y as G,Ya as Xi,Yb as se,_c as ke,ac as x,ba as L,bc as D,bd as nr,c as st,ca as Yi,cb as dt,d as fn,dc as K,eb as _,ec as Z,fa as N,fc as A,ga as Me,gc as xe,ia as Rt,ib as p,j as hn,ja as h,jb as tr,ld as In,mb as vt,n as $i,na as P,nc as b,o as Ki,oa as Oe,oc as M,pc as Q,qb as re,r as Dt,s as Ie,sb as Oi,tb as an,tc as ot,ua as d,ub as sn,va as u,vb as a,wb as o,xb as f,yb as z,zb as $}from"./chunk-5T6JU6XP.js";import{a as j,b as q,g as Mi,j as gn}from"./chunk-LHUGHE24.js";var Xo=()=>["/menu/Adjustment/Adjustment/Archive/Form"],un=r=>({ID:r}),mo=()=>["/print/Adjustment"],Un=(r,e)=>({"text-success":r,"text-danger":e});function ta(r,e){if(r&1){let t=I();a(0,"div",19)(1,"button",20),g("click",function(){d(t);let n=c(2);return u(n.reject())}),f(2,"i",21),m(3,"Reject "),o(),a(4,"button",20),g("click",function(){d(t);let n=c(2);return u(n.accept())}),f(5,"i",22),m(6,"Accept "),o()()}}function ea(r,e){if(r&1&&(a(0,"a",23),f(1,"i",24),m(2,"Edit "),o()),r&2){let t=c(2);p("routerLink",Z(2,Xo))("queryParams",A(3,un,t.data.ID))}}function na(r,e){if(r&1){let t=I();a(0,"button",20),g("click",function(){d(t);let n=c(2);return u(n.delete())}),f(1,"i",25),m(2,"Delete "),o()}}function ia(r,e){if(r&1&&(a(0,"tr")(1,"th"),m(2,"Journal Link"),o(),a(3,"td"),m(4,":"),o(),a(5,"td")(6,"a",26),m(7,"View Journal"),o()()()),r&2){let t=c(2);l(6),er("href","https://accounting.dealpos.app/pages/journal-entry;TransID=",t.data.ID,"",Te)}}function ra(r,e){if(r&1){let t=I();a(0,"a",44),g("click",function(){d(t);let n=c(3);return u(n.exportCSV(n.csvConverter,"Adjustment/AdjustmentInfoExport","Adjustment#"+n.data.Adjustment.Number+".csv"))}),m(1,"Export"),o()}}function oa(r,e){r&1&&(a(0,"th",45),m(1,"Cost"),o())}function aa(r,e){r&1&&(a(0,"th",45),m(1,"Price"),o())}function sa(r,e){if(r&1&&(z(0),f(1,"p",51),$()),r&2){let t=c().$implicit;l(),p("innerHTML",t.Note,R)}}function la(r,e){if(r&1&&(a(0,"td",52),m(1),o()),r&2){let t=c().$implicit;vt(xe(3,Un,t.Quantity>0,t.Quantity<0)),l(),v(t.Quantity)}}function ma(r,e){if(r&1&&(a(0,"td",52),m(1),o()),r&2){let t=c().$implicit;vt(xe(3,Un,t.Quantity>0,t.Quantity<0)),l(),v(t.Quantity)}}function pa(r,e){if(r&1&&(a(0,"td",52),m(1),o()),r&2){let t=c().$implicit;vt(xe(3,Un,t.Counted>0,t.Counted<0)),l(),v(t.Counted)}}function ca(r,e){if(r&1&&(f(0,"td",53),b(1,"number")),r&2){let t=c().$implicit;p("innerHTML",M(1,1,t.UnitCost),R)}}function da(r,e){if(r&1&&(f(0,"td",53),b(1,"number")),r&2){let t=c().$implicit;p("innerHTML",M(1,1,t.UnitPrice),R)}}function ua(r,e){if(r&1&&(a(0,"tr"),f(1,"td",46),a(2,"td")(3,"a",47),m(4),o(),a(5,"div"),m(6),o(),f(7,"app-serial-note",48),_(8,sa,2,1,"ng-container",14),o(),_(9,la,2,6,"td",49)(10,ma,2,6,"td",49)(11,pa,2,6,"td",49)(12,ca,2,3,"td",50)(13,da,2,3,"td",50),o()),r&2){let t=e.$implicit,i=e.index,n=c(3);l(),p("innerHTML",i+1+".",R),l(2),p("queryParams",A(11,un,t.VariantID)),l(),v(t.Name),l(2),v(t.Code),l(),p("serials",t.Serial),l(),p("ngIf",t.Note!=null),l(),p("ngIf",n.data.Adjustment.StateID==4),l(),p("ngIf",n.data.Adjustment.StateID<4&&n.data.Adjustment.TypeID==1),l(),p("ngIf",n.data.Adjustment.StateID<4&&n.data.Adjustment.TypeID==2),l(),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.sell.PriceVisible)}}function _a(r,e){if(r&1&&(a(0,"td",54)(1,"b"),m(2),b(3,"sum"),b(4,"number"),o()()),r&2){let t=c(3);l(2),v(M(4,4,Q(3,1,t.data.DifferencesArray,"TotalCost")))}}function ga(r,e){if(r&1&&(a(0,"td",55)(1,"b"),m(2),b(3,"sum"),b(4,"number"),o()()),r&2){let t=c(3);l(2),v(M(4,4,Q(3,1,t.data.DifferencesArray,"TotalPrice")))}}function fa(r,e){if(r&1&&(a(0,"div",9)(1,"div",27)(2,"div")(3,"h2"),m(4),o()(),a(5,"div",28)(6,"a",29),f(7,"i",30),m(8,"Print "),o(),_(9,ra,2,0,"a",31),o()(),a(10,"div",12)(11,"div",32)(12,"table",33)(13,"thead",34)(14,"tr")(15,"th",35),m(16,"No"),o(),a(17,"th",36),m(18,"Name"),o(),a(19,"th",37),m(20,"Qty"),o(),_(21,oa,2,0,"th",38)(22,aa,2,0,"th",38),o()(),a(23,"tbody"),_(24,ua,14,13,"tr",39),o(),a(25,"tfoot")(26,"tr")(27,"td",40)(28,"b"),m(29,"Total :"),o()(),a(30,"td",41)(31,"b"),m(32),b(33,"sum"),b(34,"number"),o()(),_(35,_a,5,6,"td",42)(36,ga,5,6,"td",43),o()()()()()()),r&2){let t=c(2);l(4),O("Adjusted Inventory (",t.data.DifferencesArray.length," SKU)"),l(2),p("routerLink",Z(15,mo))("queryParams",A(16,un,t.paramId)),l(3),p("ngIf",t.roleService.global.Export&&t.data.Adjustment.StateID==4),l(12),p("ngIf",t.roleService.product.Cost),l(),p("ngIf",t.roleService.sell.PriceVisible),l(2),p("ngForOf",t.data.DifferencesArray),l(8),v(M(34,13,Q(33,10,t.data.DifferencesArray,"Quantity"))),l(3),p("ngIf",t.roleService.product.Cost),l(),p("ngIf",t.roleService.sell.PriceVisible)}}function ha(r,e){if(r&1&&(a(0,"h2"),m(1),o()),r&2){let t=c(3);l(),O("Counted Inventory (",t.data.CountedArray.length," SKU)")}}function Ca(r,e){if(r&1){let t=I();a(0,"a",44),g("click",function(){d(t);let n=c(3);return u(n.exportCSV(n.csvConverter,"Adjustment/AdjustmentCountedExport","Adjustment_Counted#"+n.data.Adjustment.Number+".csv"))}),f(1,"i",57),m(2,"Export"),o()}}function ya(r,e){if(r&1&&(a(0,"tr"),f(1,"td",46),a(2,"td")(3,"a",47),m(4),o(),a(5,"div"),m(6),o()(),a(7,"td",52),m(8),o(),a(9,"td",52),m(10),o(),a(11,"td",52),m(12),o()()),r&2){let t=e.$implicit,i=e.index;l(),p("innerHTML",i+1+".",R),l(2),p("queryParams",A(9,un,t.VariantID)),l(),v(t.Name),l(2),v(t.Code),l(2),v(t.Counted),l(2),v(t.Actual),l(),vt(xe(11,Un,t.Difference>0,t.Difference<0)),l(),v(t.Difference)}}function va(r,e){if(r&1&&(a(0,"div",9)(1,"div",27)(2,"div"),_(3,ha,2,1,"h2",14),o(),a(4,"div",28)(5,"a",29),f(6,"i",30),m(7,"Print "),o(),_(8,Ca,3,0,"a",31),o()(),a(9,"div",12)(10,"div",32)(11,"table",33)(12,"thead",34)(13,"tr")(14,"th",35),m(15,"No"),o(),a(16,"th",36),m(17,"Name"),o(),a(18,"th",56),m(19,"Counted"),o(),a(20,"th",56),m(21,"Actual"),o(),a(22,"th",56),m(23,"Difference"),o()()(),a(24,"tbody"),_(25,ya,13,14,"tr",39),o()()()()()),r&2){let t=c(2);l(3),p("ngIf",t.data.CountedArray.length>0&&t.data.Adjustment.TypeID==2),l(2),p("routerLink",Z(5,mo))("queryParams",A(6,un,t.paramId)),l(3),p("ngIf",t.roleService.global.Export&&t.data.Adjustment.StateID==4),l(17),p("ngForOf",t.data.CountedArray)}}function Ia(r,e){if(r&1&&(a(0,"span")(1,"b"),m(2,"Modified:"),o(),m(3),b(4,"date"),o()),r&2){let t=c(2);l(3),se(" ",Q(4,2,t.data.CreatedInfo.Modified.Date,"dd MMM yyyy HH:mm")," / ",t.data.CreatedInfo.Modified.User," ")}}function ba(r,e){if(r&1&&(a(0,"mainpanel-cmp",1)(1,"actions"),_(2,ta,7,0,"div",2),a(3,"div",3),_(4,ea,3,5,"a",4)(5,na,3,0,"button",5),o()(),a(6,"content")(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10)(12,"div"),f(13,"h2",11),o()(),a(14,"div",12)(15,"table",13)(16,"tr")(17,"th"),m(18,"Date"),o(),a(19,"td"),m(20,":"),o(),f(21,"td",11),o(),a(22,"tr")(23,"th"),m(24,"PIC"),o(),a(25,"td"),m(26,":"),o(),f(27,"td",11),o(),a(28,"tr")(29,"th"),m(30,"Type"),o(),a(31,"td"),m(32,":"),o(),f(33,"td",11),o(),a(34,"tr")(35,"th"),m(36,"State"),o(),a(37,"td"),m(38,":"),o(),f(39,"td",11),o(),a(40,"tr")(41,"th"),m(42,"Note"),o(),a(43,"td"),m(44,":"),o(),f(45,"td",11),o(),_(46,ia,8,2,"tr",14),o()()()(),a(47,"div",15),_(48,fa,37,18,"div",16)(49,va,26,8,"div",16),o()(),a(50,"div",17),f(51,"i",18),a(52,"span")(53,"b"),m(54,"Created:"),o(),m(55),b(56,"date"),o(),_(57,Ia,5,5,"span",14),o()()()()),r&2){let t=c();p("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),p("ngIf",!t.toggleAccRej),l(2),p("ngIf",t.roleService.adjustment.Edit&&t.data.Adjustment.TypeID!=2&&t.data.Adjustment.StateID!=3),l(),p("ngIf",t.roleService.adjustment.Delete),l(8),p("innerHTML",t.data.Adjustment.OutletName,R),l(8),p("innerHTML",t.data.Adjustment.Date,R),l(6),p("innerHTML",t.data.Adjustment.PIC,R),l(6),p("innerHTML",t.data.Adjustment.TypeLabel,R),l(6),p("innerHTML",t.data.Adjustment.StateLabel,R),l(6),p("innerHTML",t.data.Adjustment.Note,R),l(),p("ngIf",t.data.AppsAccoutingActive&&t.roleService.accounting.View),l(2),p("ngIf",t.data.DifferencesArray.length>0),l(),p("ngIf",(t.data.CountedArray==null?null:t.data.CountedArray.length)>0&&t.data.Adjustment.TypeID==2),l(6),se(" ",Q(56,18,t.data.CreatedInfo.Created.Date,"dd MMM yyyy HH:mm")," / ",t.data.CreatedInfo.Created.User," "),l(2),p("ngIf",t.data.CreatedInfo.Modified.User)}}var An=class r extends Ft{constructor(t,i,n,s,y,T,tt){super(t,i,"Adjustment/AuditInventoryAdjustmentInfo",null,null,s);this.toastr=n;this.csvConverter=y;this.router=T;this.roleService=tt;this.initQueryParam()}paramId;toggleAccRej=!1;isEditable=!1;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.toggleAccRej=!1:this.toggleAccRej=!0,(this.data.Adjustment.StateID==1||this.data.Adjustment.StateID==2)&&(this.isEditable=!0)}exportCSV(t,i,n){this.httpService.get(`/api/${i}`,[{key:"ID",value:this.paramId}]).subscribe(s=>{t.convertToCSV(s,n)})}reject(){if(!confirm("Are you sure you want to reject this?"))return;let t={ID:this.data.Adjustment.ID,Number:this.data.Adjustment.Number,Date:this.data.Adjustment.Date,PIC:this.data.Adjustment.PIC,Note:this.data.Adjustment.Note,EntityID:this.data.Adjustment.EntityID,TypeID:this.data.Adjustment.TypeID,StateID:3};this.data.Order=t,this.httpService.post("/API/Adjustment/RejectCountedItem",this.data).subscribe({next:i=>{this.toastr.success("Success reject adjustment",X.Success),this.toggleAccRej=!0,this.isEditable=!1,this.getListData()}})}accept(){if(!confirm("Are you sure you want to accept this?"))return;let t={ID:this.data.Adjustment.ID,Number:this.data.Adjustment.Number,Date:this.data.Adjustment.Date,PIC:this.data.Adjustment.PIC,Note:this.data.Adjustment.Note,EntityID:this.data.Adjustment.EntityID,TypeID:this.data.Adjustment.TypeID,StateID:4};this.data.Order=t,this.data.Items=[],this.data.DifferencesArray.forEach(i=>{this.data.Order.TypeID===2&&(i.Quantity=i.Counted),this.data.Items.push(i)}),this.httpService.post("/API/Adjustment/AcceptCountedItem",this.data).subscribe({next:i=>{this.toastr.success("Success accept adjustment",X.Success),this.toggleAccRej=!0,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.",X.Success),this.router.navigate(["/menu/Adjustment/Adjustment/Archive"])})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(_t),C(pe),C(Ut),C(wt),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-adjustment-info"]],features:[dt],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["class","btn-group me-5",4,"ngIf"],[1,"btn-group","ms-5"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-3"],[1,"card"],[1,"card-header"],[3,"innerHTML"],[1,"card-body"],[1,"table-sm","table-borderless"],[4,"ngIf"],[1,"col-sm-9"],["class","card",4,"ngIf"],[1,"alert","alert-warning"],["aria-hidden","true",1,"fa-regular","fa-file","me-3"],[1,"btn-group","me-5"],[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-trash","me-3"],[3,"href"],[1,"card-header","d-flex","justify-content-between"],[1,"btn-group"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams"],[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"],[1,"text-center",2,"width","1px"],[2,"width","300px"],[1,"text-end",2,"width","80px"],["class","text-end","style","width: 120px",4,"ngIf"],[4,"ngFor","ngForOf"],["colspan","2",1,"text-end","empty-column"],[1,"text-end","empty-column"],["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"],["role","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"text-end",2,"width","120px"],[1,"text-center",3,"innerHTML"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[3,"serials"],["class","text-end",3,"class",4,"ngIf"],["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"],["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,"text-end",2,"width","100px"],[1,"fa-solid","fa-upload","me-3"]],template:function(i,n){i&1&&_(0,ba,58,21,"mainpanel-cmp",0),i&2&&p("ngIf",n.data)},dependencies:[J,V,ut,mt,Ht,Ce,it,me,ge]})};var Sa=()=>["/menu/Adjustment/Adjustment/Archive/Form/V2"],Da=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Pa=r=>({ID:r}),wa=(r,e)=>({"text-success":r,"text-danger":e}),Ma=r=>({"text-success":r}),Oa=r=>({"text-danger":r});function Ta(r,e){if(r&1){let t=I();a(0,"a",18),g("click",function(){d(t);let n=c(2);return u(n.httpPostListID("Adjustment/DeleteInventoryAdjustmentList"))}),f(1,"i",19),m(2,"Delete "),o()}}function Ea(r,e){if(r&1){let t=I();a(0,"button",20),g("click",function(){d(t);let n=c(2);return u(n.openExportModal())}),f(1,"i",21),m(2," Export "),o()}}function ka(r,e){r&1&&(a(0,"a",22),m(1,"New"),o()),r&2&&p("routerLink",Z(1,Sa))}function ja(r,e){if(r&1){let t=I();a(0,"div")(1,"div",23)(2,"h6"),m(3,"Outlet"),o(),a(4,"ng-select",24),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,n)||(s.pageData.Filter.EntityID=n),u(n)}),o(),a(5,"h6"),m(6,"From"),o(),a(7,"datepicker",25),D("dateChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.From,n)||(s.pageData.Filter.From=n),u(n)}),o(),a(8,"h6"),m(9,"To"),o(),a(10,"datepicker",26),D("dateChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.To,n)||(s.pageData.Filter.To=n),u(n)}),o(),a(11,"h6"),m(12,"Quantity From - To"),o(),a(13,"div",27)(14,"input",28),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.QuantityFrom,n)||(s.pageData.Filter.QuantityFrom=n),u(n)}),o(),m(15," - "),a(16,"input",28),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.QuantityTo,n)||(s.pageData.Filter.QuantityTo=n),u(n)}),o()(),a(17,"h6"),m(18,"State"),o(),a(19,"ng-select",29),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.State,n)||(s.pageData.Filter.State=n),u(n)}),o(),a(20,"h6"),m(21,"Rows"),o(),a(22,"input",30),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.RowCount,n)||(s.pageData.Filter.RowCount=n),u(n)}),o(),a(23,"h6"),m(24,"Exclude Zero"),o(),a(25,"radio-options",31),D("modelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.ExcludeZero,n)||(s.pageData.Filter.ExcludeZero=n),u(n)}),o()()()}if(r&2){let t=c(2);l(4),p("items",t.pageData.Options.Entities),S("ngModel",t.pageData.Filter.EntityID),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.From),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.To),l(4),S("ngModel",t.pageData.Filter.QuantityFrom),l(2),S("ngModel",t.pageData.Filter.QuantityTo),l(3),p("items",t.pageData.Options.States),S("ngModel",t.pageData.Filter.State),l(3),S("ngModel",t.pageData.Filter.RowCount),p("max",1e4),l(3),S("model",t.pageData.Filter.ExcludeZero)}}function Na(r,e){if(r&1){let t=I();a(0,"th",32)(1,"input",33),g("change",function(n){d(t);let s=c(2);return u(s.onSelectAllData(n.target.checked))}),o()()}}function Aa(r,e){r&1&&(a(0,"th",15),m(1,"Cost"),o())}function Va(r,e){if(r&1){let t=I();a(0,"td")(1,"input",40),D("ngModelChange",function(n){d(t);let s=c().$implicit;return x(s.selected,n)||(s.selected=n),u(n)}),o()()}if(r&2){let t=c().$implicit;l(),S("ngModel",t.selected)}}function Fa(r,e){if(r&1&&(a(0,"td",39),m(1),b(2,"quantityFraction"),o()),r&2){let t=c().$implicit;l(),O(" ",M(2,1,t.Quantity)," ")}}function Ua(r,e){if(r&1&&(a(0,"td",39),m(1),b(2,"quantityFraction"),o()),r&2){let t=c().$implicit;vt(A(5,Ma,t.Quantity>0)),l(),O(" +",M(2,3,t.Quantity)," ")}}function La(r,e){if(r&1&&(a(0,"td",39),m(1),b(2,"quantityFraction"),o()),r&2){let t=c().$implicit;vt(A(5,Oa,t.Quantity<0)),l(),O(" ",M(2,3,t.Quantity)," ")}}function Ra(r,e){if(r&1&&(a(0,"td",39),m(1),b(2,"amountFraction"),o()),r&2){let t=c().$implicit;l(),v(M(2,1,t.Cost))}}function Qa(r,e){if(r&1&&(a(0,"tr",34),_(1,Va,2,1,"td",35),a(2,"td"),m(3),o(),a(4,"td")(5,"a",36),m(6),o()(),a(7,"td"),m(8),b(9,"date"),o(),_(10,Fa,3,3,"td",37)(11,Ua,3,7,"td",38)(12,La,3,7,"td",38),a(13,"td"),m(14),o(),_(15,Ra,3,3,"td",39),a(16,"td"),m(17),o(),a(18,"td"),m(19),o()()),r&2){let t=e.$implicit,i=c(2);l(),p("ngIf",i.roleService.adjustment.Delete),l(2),v(t.EntityName),l(2),p("routerLink",Z(18,Da))("queryParams",A(19,Pa,t.ID)),l(),v(t.Number),l(2),v(Q(9,15,t.Date,"dd MMM yyyy")),l(2),p("ngIf",t.Quantity==0),l(),p("ngIf",t.Quantity>0),l(),p("ngIf",t.Quantity<0),l(2),v(t.TypeLabel),l(),re(!(i.roleService==null||i.roleService.product==null)&&i.roleService.product.Cost?15:-1),l(),vt(xe(21,wa,t.StateID==4,t.StateID==3)),l(),O(" ",t.StateLabel," "),l(2),v(t.Note)}}function Ba(r,e){if(r&1){let t=I();a(0,"mainpanel-cmp",2),D("textChange",function(n){d(t);let s=c();return x(s.pageData.Filter.Number,n)||(s.pageData.Filter.Number=n),u(n)}),g("onSubmit",function(){d(t);let n=c();return u(n.searchFromPageOne())}),D("filterChange",function(n){d(t);let s=c();return x(s.pageData.Filter,n)||(s.pageData.Filter=n),u(n)}),a(1,"actions"),_(2,Ta,3,0,"a",3)(3,Ea,3,0,"button",4)(4,ka,2,2,"a",5),o(),a(5,"filters"),_(6,ja,26,13,"ng-template",null,0,ot),o(),a(8,"content")(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr"),_(14,Na,2,0,"th",10),a(15,"th",11),m(16,"Outlet"),o(),a(17,"th",11),m(18,"Number"),o(),a(19,"th",12),m(20,"Date"),o(),a(21,"th",13),m(22," Qty "),o(),a(23,"th",14),m(24,"Type"),o(),_(25,Aa,2,0,"th",15),a(26,"th",12),m(27,"State"),o(),a(28,"th"),m(29,"Note"),o()()(),a(30,"tbody"),_(31,Qa,20,24,"tr",16),o()()(),a(32,"POS-complex-pagination",17),g("jumpToPage",function(){d(t);let n=c();return u(n.getListData())})("previousPage",function(){d(t);let n=c();return u(n.getListData())})("nextPage",function(){d(t);let n=c();return u(n.getListData())}),o()()()()}if(r&2){let t=c();p("pageData",t.menuData),S("text",t.pageData.Filter.Number),p("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.getSelectedData().length>0),l(),p("ngIf",t.roleService.global.Export),l(),p("ngIf",t.roleService.adjustment.Create),l(10),p("ngIf",t.roleService.adjustment.Delete),l(11),re(!(t.roleService==null||t.roleService.product==null)&&t.roleService.product.Cost?25:-1),l(6),p("ngForOf",t.data.Data),l(),p("total",t.data.Data.length)("pageData",t.pageData)}}var Ln=class r extends Ft{constructor(t,i,n,s,y,T){super(t,i,"Adjustment/GetInventoryAdjustmentList","AdjustmentLoader/GetInventoryAdjustmentList",n);this.toastr=n;this.csvConverter=s;this.roleService=y;this.matDialog=T}hideMore=!1;openExportModal(){this.matDialog.open(Wt,{data:{title:"Inventory Adjustment",exportTypes:[{ID:"AdjustmentExport/GetInventoryAdjustmentList",Value:"Default",FileName:"Inventory Adjustment"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/GetInventoryAdjustmentListCount",pagination:!0}})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(_t),C(Ut),C(U),C(ft))};static \u0275cmp=P({type:r,selectors:[["POS-inventory-adjustment"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-5",3,"click",4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","button btn btn-success",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 14px",4,"ngIf"],[2,"width","120px"],[2,"width","100px"],["matTooltipPosition","above","matTooltip","Adjusted Quantity",1,"text-end",2,"width","50px"],[2,"width","130px"],[1,"text-end",2,"width","95px"],["class","border-bottom",4,"ngFor","ngForOf"],["api","Adjustment/GetInventoryAdjustmentListCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fa-solid","fa-trash","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"button","btn","btn-success",3,"routerLink"],[1,"dialog-filter"],["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"],[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"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel","max"],[3,"modelChange","model"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom"],[4,"ngIf"],[3,"routerLink","queryParams"],["class","text-end",4,"ngIf"],["class","text-end",3,"class",4,"ngIf"],[1,"text-end"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(i,n){i&1&&_(0,Ba,33,12,"mainpanel-cmp",1),i&2&&p("ngIf",n.data)},dependencies:[J,V,ut,mt,lt,rr,F,Y,he,Mt,Be,On,Ot,Ht,me,hr,Cr]})};var ki=(i=>(i[i.INPUT=0]="INPUT",i[i.INVENTORY=1]="INVENTORY",i[i.SERIAL=2]="SERIAL",i))(ki||{});var Rn=(t=>(t[t.ADJUST_DIFFERENCES=1]="ADJUST_DIFFERENCES",t[t.UPDATE_INVENTORY=2]="UPDATE_INVENTORY",t))(Rn||{});var we=class{CountedItems;Items;Order;OrderItems;constructor(){this.Items=[],this.Order=new ji}};var ji=class{AdjustedQuantity;Bin;Created;CreatorID;Date;EntityID;EntityName;ID;Modified;ModifierID;Note;Number;PIC;Quantity;ReviewDate;ReviewerID;StateID;StateLabel;TotalPrice;TypeID;TypeLabel;UnitCost;UnitPrice;constructor(){this.ID=w.GuidEmpty,this.EntityID="",this.StateID=1,this.TypeID=1}};var ze=class r{_Data=new fn(new we);Data$=this._Data.asObservable();get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var ye=class r{constructor(e,t,i,n){this.adjustmentDataService=e;this.backEndService=t;this.factoryService=i;this.toastr=n}_notifyNewItem=new st;notifyNewItem$=this._notifyNewItem.asObservable();getItemByCode(e,t){let i;return this.backEndService.getVarianByCode(e,t).pipe(Dt(n=>{let s=this.patchVariantToItem(n);return i=s.Variant,s.Cost=i.UnitCost,s.UnitCost=i.UnitCost,s}))}getItemById(e,t){let i;return this.backEndService.getVariantById(e,t).pipe(Dt(n=>{let s=this.patchVariantToItem(n);return i=s.Variant,s.Cost=i.UnitCost,s.UnitCost=i.UnitCost,s}))}patchVariantToItem(e){let t=new fe;return e=this.factoryService.generateVariantObj(e),t.patchByVariantAdjustment(e),t}updateCartItem(e){let t=this.adjustmentDataService.Data;t.Items=e,this.adjustmentDataService.pushNewValue(t)}addNewItem(e,t){let i=this.checkBehaviourRowItem(e,t);this.updateCartItem(i)}addCartItemByCode(e,t){this.backEndService.getVarianByCode(e,t).subscribe(i=>{this.createNewCartItem(i,"scan")})}createNewCartItem(e,t="add"){let i=new fe;i.patchByVariantAdjustment(e),t=="scan"&&(i.Cost=e.UnitCost),i.UnitPrice=e.UnitPrice,this.addNewItem(i)}removeItem(e){let t=this.adjustmentDataService.Data;t.Items.splice(e.index,1),this.updateCartItem(t.Items)}updateItem(e){let t=this.adjustmentDataService.Data.Items;t[e.index]=e.item,this.updateCartItem(t)}checkBehaviourRowItem(e,t=!1){let i=[];if(t)i=this.adjustmentDataService.Data.Items,this._notifyNewItem.next("NEW"),i.push(e);else{i=this.adjustmentDataService.Data.Items!=null?this.adjustmentDataService.Data.Items:Array();let n=i.findIndex(y=>y.VariantID===e.VariantID),s=e.Quantity;n===-1?(w.IsNotEmpty(s)?e.Quantity=s:e.Quantity=1,this._notifyNewItem.next("NEW"),i.push(e)):w.IsNotEmpty(s)?i[n].Quantity+=s:i[n].Quantity++}return i}static \u0275fac=function(t){return new(t||r)(Rt(ze),Rt(Qe),Rt(ao),Rt(_t))};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var Ai=r=>({selected:r}),Ha=()=>["/menu/Products/Catalog/Variants/Info"],Wa=r=>({ID:r});function qa(r,e){if(r&1){let t=I();a(0,"a",7),g("click",function(){d(t);let n=c();return u(n.onTabChange(n.modalItemState.INVENTORY))}),m(1," Product "),o()}if(r&2){let t=c();p("ngClass",A(1,Ai,t.modalItemState.INVENTORY==t.currentStateTab))}}function Ga(r,e){if(r&1&&(a(0,"div",23)(1,"div",24)(2,"div"),m(3),o(),a(4,"small",25),m(5),o()()()),r&2){let t=e.data;l(3),v(t==null?null:t.Value),l(2),v(t==null?null:t.Code)}}function za(r,e){if(r&1){let t=I();a(0,"div",21)(1,"div",18)(2,"autocompleteV2",22,1),g("onSelect",function(n){d(t);let s=c(2);return u(s.addItem(n))})("keyup.enter",function(n){return d(t),u(n.stopPropagation())})("onInputEnter",function(n){d(t);let s=c(2);return u(s.scanCode(n))}),o(),_(4,Ga,6,2,"ng-template",null,2,ot),o()()}if(r&2){let t=It(5);l(2),p("renderThumbnail",!0)("useCustomTemplate",!0)("itemTemplate",t)}}function $a(r,e){if(r&1){let t=I();a(0,"div",15)(1,"h5"),m(2,"Cost"),o(),a(3,"input",16),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.item.Cost,n)||(s.item.Cost=n),u(n)}),o()()}if(r&2){let t=c(2);l(3),S("ngModel",t.item.Cost)}}function Ka(r,e){if(r&1){let t=I();z(0),_(1,za,6,3,"div",11),a(2,"div")(3,"div",12)(4,"div",13)(5,"h5"),m(6,"Qty"),o(),a(7,"input",14,0),D("ngModelChange",function(n){d(t);let s=c();return x(s.item.Quantity,n)||(s.item.Quantity=n),u(n)}),o()(),a(9,"div",15)(10,"h5"),m(11,"Price"),o(),a(12,"input",16),D("ngModelChange",function(n){d(t);let s=c();return x(s.item.Price,n)||(s.item.Price=n),u(n)}),o()(),_(13,$a,4,1,"div",17),o(),a(14,"div",12)(15,"div",18)(16,"h5",19),m(17,"Note"),o(),a(18,"POS-tinymce-editor",20),D("valueChange",function(n){d(t);let s=c();return x(s.item.Note,n)||(s.item.Note=n),u(n)}),o()()()(),$()}if(r&2){let t=c();l(),p("ngIf",!t.isEdit),l(6),S("ngModel",t.item.Quantity),p("decimalPlaces",t.isItemSerial?0:4)("disabled",t.isAdjustmentEdit&&t.isItemSerial&&t.constants.IsNotEmpty(t.item.ID)),l(5),S("ngModel",t.item.Price),l(),p("ngIf",t.roleService.product.Cost),l(5),S("value",t.item.Note)}}function Ja(r,e){r&1&&(z(0),f(1,"i",37),a(2,"h6"),m(3,"No Image"),o(),$())}function Ya(r,e){if(r&1&&f(0,"img",38),r&2){let t=c(2);p("src",t.item.Variant.ThumbnailUrl,Te)}}function Za(r,e){if(r&1&&(z(0),a(1,"div",21)(2,"div",26)(3,"a",27),_(4,Ja,4,0,"ng-container",28)(5,Ya,1,1,"ng-template",null,3,ot),o()(),a(7,"div",29)(8,"div",30),f(9,"i",31),a(10,"div",32),m(11,"Inventory"),o()(),a(12,"table",33)(13,"tbody")(14,"tr")(15,"td",34),m(16," On Hand "),o(),a(17,"td",35),m(18),b(19,"number"),o()(),a(20,"tr")(21,"td",36),m(22," Allocated "),o(),a(23,"td",35),m(24),b(25,"number"),o()(),a(26,"tr")(27,"td",36),m(28,"Available"),o(),a(29,"td",35),m(30),b(31,"number"),o()(),a(32,"tr")(33,"td",36),m(34,"ROP"),o(),a(35,"td",35),m(36),b(37,"number"),o()(),a(38,"tr")(39,"td",36),m(40,"Max"),o(),a(41,"td",35)(42,"span"),m(43),b(44,"number"),o()()()()()()(),$()),r&2){let t=It(6),i=c();l(3),p("routerLink",Z(19,Ha))("queryParams",A(20,Wa,i.item==null||i.item.Variant==null?null:i.item.Variant.ID)),l(),p("ngIf",(i.item==null||i.item.Variant==null?null:i.item.Variant.ThumbnailUrl)==null)("ngIfElse",t),l(14),O(" ",M(19,9,i.onHand)," "),l(6),O(" ",M(25,11,i.allocated)," "),l(6),O(" ",M(31,13,i.onHand-i.allocated)," "),l(6),O(" ",M(37,15,i.rop)," "),l(7),v(M(44,17,i.max))}}function Xa(r,e){if(r&1){let t=I();z(0),a(1,"POS-tab-serial",39),D("variantChange",function(n){d(t);let s=c();return x(s.item,n)||(s.item=n),u(n)})("serialsChange",function(n){d(t);let s=c();return x(s.serials,n)||(s.serials=n),u(n)}),o(),$()}if(r&2){let t=c();l(),p("isEditBuyForm",!1)("outletID",t.entityID),S("variant",t.item)("serials",t.serials)}}var Qn=class r{constructor(e,t,i,n,s,y){this.httpService=e;this.toastr=t;this.data=i;this.dialogRef=n;this.cartItemService=s;this.roleService=y;this.config=new ht,this.entityID=i.entityID,this.queryInventoryOnOpen=!1,this.currentStateTab=0,this.adjusmentType=i.adjustmentType,this.isAdjustmentEdit=this.data.isAdjustmentEdit,w.IsNotEmpty(i.itemInfo)?(this.isEdit=!0,this.item=vr(fe,this.data.itemInfo.item),this.roleService.inventory.View&&this.requestUnitInStock(),this.config.title=this.item.Variant.Name,this.item.Variant.Ordered!=null&&(this.extraTitle=` Inventory: ${this.item.Variant.UnitsInStock}, Allocated: ${this.item.Variant.Ordered}`,this.toggleInventory=!0)):(this.item=new fe,this.config.title="Add Item"),this.config.customWidth="650px",this.config.bodyScrollable=!0}currentStateTab;modalItemState=ki;onHand;allocated;rop;max;extraTitle;config;item;isEdit=!1;toggleInventory=!1;entityID;separatorKeysCodes=[13,188];constants=w;isFocusSerialInput=!1;isItemSerial=!1;serialOptions;queryInventoryOnOpen;adjusmentType;adjustmentTypeEnum=Rn;isAdjustmentEdit=!1;serials=[];ngOnInit(){this.isItemSerial=this.checkIsSerial()}onOk(e){if(!this.isFocusSerialInput){if(this.generateSerial(),this.item.isSerialType())if(this.item.checkMatchSerialWithQuantity()){if(this.item?.Serial?.length==0){this.toastr.warning("Serial is required","Warning!");return}}else{this.toastr.warning("Serial must be equal with the quantity","Warning!");return}this.isEdit?(this.item.UnitCost=this.item.Cost,this.cartItemService.updateItem({item:this.item,index:this.data.itemInfo.index})):(this.item.UnitCost=this.item.Cost,this.cartItemService.addNewItem(this.item,!0)),this.dialogRef.close()}}generateSerial(){this.isItemSerial&&(!this.item?.Serial||this.item?.Serial?.length==0)&&(this.item.Quantity=this.serials.length,this.item.Serial=this.serials.map(e=>({Quantity:1,Number:e,ExpiryDate:null})))}addItem(e){this.cartItemService.getItemById(e,this.data.entityID).subscribe(t=>{this.item=t,this.isItemSerial=this.checkIsSerial(),this.config.title=this.item.Variant.Name})}onTabChange(e){this.currentStateTab=e,e==1&&!this.queryInventoryOnOpen&&this.requestUnitInStock()}requestUnitInStock(){if(w.IsEmpty(this.entityID)){this.toastr.error("Please select outlet before proceeding..",X.Error);return}this.httpService.get(pt.GetVariantStockByID,[{key:"ID",value:this.item.Variant.ID},{key:"EntityID",value:this.entityID}]).subscribe(e=>{this.queryInventoryOnOpen=!0,this.onHand=e.OnHand,this.allocated=e.Allocated,this.rop=e.ROP,this.max=e.Max})}scanCode(e){this.cartItemService.getItemByCode(e,this.entityID).subscribe(t=>{this.item=t,this.isItemSerial=this.checkIsSerial(),this.config.title=this.item.Variant.Name,this.toggleInventory=!1})}onFocusAddSerial(){this.isFocusSerialInput=!0}onBlurAddSerial(){this.isFocusSerialInput=!1}checkIsSerial(){return this.item.Variant!=null?this.item.Variant.TypeID==4:!1}static \u0275fac=function(t){return new(t||r)(C(k),C(_t),C(_e),C(gt),C(ye),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-modal-item"]],decls:14,vars:11,consts:[["qty",""],["variant",""],["itemTemplate",""],["SHOW_IMAGE",""],[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"row","border-bottom"],[1,"btn","btn-link",3,"click","ngClass"],["class","btn btn-link",3,"ngClass","click",4,"ngIf"],[1,"container-fluid","mt-5"],[4,"ngIf"],["class","row",4,"ngIf"],[1,"row","mt-5"],[1,"col-auto"],["type","text","autoNum","",1,"mt-5","form-control",2,"width","100px",3,"ngModelChange","ngModel","decimalPlaces","disabled"],[1,"col-auto","ps-0"],["type","text","autoNum","",1,"mt-5","form-control",2,"width","100px",3,"ngModelChange","ngModel"],["class","col-auto ps-0",4,"ngIf"],[1,"col-12"],[1,"mb-5"],["height","220px",3,"valueChange","value"],[1,"row"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"onSelect","keyup.enter","onInputEnter","renderThumbnail","useCustomTemplate","itemTemplate"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink","queryParams"],[4,"ngIf","ngIfElse"],[1,"col-sm-6"],[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","border"],[1,"table-light","text-start","border-0",2,"width","100px"],[1,"text-end"],[1,"table-light","text-start","border-0"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"border","rounded",3,"src"],[3,"variantChange","serialsChange","isEditBuyForm","outletID","variant","serials"]],template:function(t,i){t&1&&(a(0,"modal-material",4),g("onOk",function(s){return i.onOk(s)})("onCancel",function(){return i.dialogRef.close()})("onClose",function(){return i.dialogRef.close()}),a(1,"content")(2,"div",5)(3,"div",6)(4,"div")(5,"a",7),g("click",function(){return i.onTabChange(i.modalItemState.INPUT)}),m(6," Cart "),o(),_(7,qa,2,3,"a",8),a(8,"a",7),g("click",function(){return i.onTabChange(i.modalItemState.SERIAL)}),m(9," Serial "),o()()()(),a(10,"div",9),_(11,Ka,19,7,"ng-container",10)(12,Za,45,22,"ng-container",10)(13,Xa,2,4,"ng-container",10),o()()()),t&2&&(p("config",i.config),l(5),p("ngClass",A(7,Ai,i.modalItemState.INPUT==i.currentStateTab)),l(2),p("ngIf",i.roleService.inventory.View&&(i.item==null||i.item.Variant==null?null:i.item.Variant.Name)),l(),p("ngClass",A(9,Ai,i.modalItemState.SERIAL==i.currentStateTab)),l(3),p("ngIf",i.modalItemState.INPUT==i.currentStateTab),l(),p("ngIf",i.modalItemState.INVENTORY==i.currentStateTab),l(),p("ngIf",i.modalItemState.SERIAL==i.currentStateTab))},dependencies:[Ee,V,ut,lt,F,Y,Le,Ct,Ot,He,qe,it],styles:[".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}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}"]})};var Bn=class r{constructor(e,t){this.data=e;this.dialogRef=t;this.config=new ht,this.config.title="Note",this.adjustmentData=this.data}adjustmentData;config;onOk(e){e!="Enter"&&this.dialogRef.close()}static \u0275fac=function(t){return new(t||r)(C(_e),C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-note"]],decls:9,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row"],[1,"col-12"],["type","text","placeholder","PIC",1,"text","w-100",3,"ngModelChange","ngModel"],[1,"row","mt-5"],["placeholder","Notes",2,"width","250px","height","120px",3,"ngModelChange","ngModel"]],template:function(t,i){t&1&&(a(0,"modal-material",0),g("onOk",function(s){return i.onOk(s)})("onCancel",function(){return i.dialogRef.close()})("onClose",function(){return i.dialogRef.close()}),a(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"input",4),D("ngModelChange",function(s){return x(i.adjustmentData.Order.PIC,s)||(i.adjustmentData.Order.PIC=s),s}),o()()(),a(6,"div",5)(7,"div",3)(8,"textarea",6),D("ngModelChange",function(s){return x(i.adjustmentData.Order.Note,s)||(i.adjustmentData.Order.Note=s),s}),o()()()()()()),t&2&&(p("config",i.config),l(5),S("ngModel",i.adjustmentData.Order.PIC),l(3),S("ngModel",i.adjustmentData.Order.Note))},dependencies:[lt,F,Y,Ct]})};var Hn=class r{constructor(e,t,i){this.backEndService=e;this.data=t;this.dialogRef=i;this.config=new ht,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0,this.adjustmentData=this.data}adjustmentData;config;submit(e){this.adjustmentData.Items.forEach(t=>delete t.UnitPriceOriginal),this.adjustmentData.Order.StateID=e,this.backEndService.submitTransaction(this.adjustmentData,pt.SubmitAdjustment).subscribe(t=>{this.dialogRef.close(t)})}static \u0275fac=function(t){return new(t||r)(C(Qe),C(_e),C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-submit"]],decls:9,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid",2,"width","500px","display","flex","justify-content","space-around"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-file-pen"],[1,"btn","btn-outline-secondary","ms-5",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-user-magnifying-glass"]],template:function(t,i){t&1&&(a(0,"modal-material",0),g("onCancel",function(){return i.dialogRef.close()})("onClose",function(){return i.dialogRef.close()}),a(1,"content")(2,"div",1)(3,"div",2),g("click",function(){return i.submit(1)}),f(4,"i",3),m(5," Save as Draft "),o(),a(6,"div",4),g("click",function(){return i.submit(2)}),f(7,"i",5),m(8," Submit for Review "),o()()()()),t&2&&p("config",i.config)},dependencies:[Ct]})};function ts(r,e){if(r&1){let t=I();a(0,"div",1)(1,"div",2),g("click",function(){d(t);let n=c();return u(n.openOutletModal())}),f(2,"i",3)(3,"input",4),b(4,"limitTo"),o(),a(5,"div",5)(6,"datepicker",6),D("dateChange",function(n){d(t);let s=c();return x(s.adjustmentData.Order.Date,n)||(s.adjustmentData.Order.Date=n),u(n)}),o()(),a(7,"div",7),f(8,"i",8),a(9,"input",9),D("ngModelChange",function(n){d(t);let s=c();return x(s.adjustmentData.Order.Number,n)||(s.adjustmentData.Order.Number=n),u(n)}),o()(),a(10,"div",10)(11,"ng-select",11),D("ngModelChange",function(n){d(t);let s=c();return x(s.adjustmentData.Order.TypeID,n)||(s.adjustmentData.Order.TypeID=n),u(n)}),o()()()}if(r&2){let t=c();l(3),p("value",Q(4,10,t.outletName,20))("placeholder",t.outletName),l(3),S("date",t.adjustmentData.Order.Date),p("matTooltip",t.role!=null&&t.role.Date?"":"Date role is required")("disabled",!(t.role!=null&&t.role.Date)),l(3),S("ngModel",t.adjustmentData.Order.Number),p("disabled",!(t.role!=null&&t.role.Number)),l(2),p("disabled",t.isEdit),S("ngModel",t.adjustmentData.Order.TypeID),p("items",t.adjustmentTypes)}}var Wn=class r{adjustmentData;adjustmentTypes;outletName;isEdit;role;onOpenOutletModal=new nt;openOutletModal(){this.onOpenOutletModal.emit()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-toolbar"]],inputs:{adjustmentData:"adjustmentData",adjustmentTypes:"adjustmentTypes",outletName:"outletName",isEdit:"isEdit",role:"role"},outputs:{onOpenOutletModal:"onOpenOutletModal"},decls:1,vars:1,consts:[["class","row header g-0 py-4 border-bottom",4,"ngIf"],[1,"row","header","g-0","py-4","border-bottom"],[1,"col-auto",3,"click"],["matTooltipPosition","above","matTooltip","Outlet",1,"fa-solid","fa-house"],["readonly","",1,"outlet","cursor",3,"value","placeholder"],[1,"col-auto","me-5","date"],["appearance","fill","matTooltipPosition","above","name","orderDate",3,"dateChange","date","matTooltip","disabled"],[1,"col-auto","me-5"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Order number",1,"fa-regular","fa-file-lines"],["type","text","placeholder","Adjustment Number",1,"number",2,"width","180px",3,"ngModelChange","ngModel","disabled"],[1,"col-auto","me-5","d-flex"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",2,"width","381px",3,"ngModelChange","disabled","ngModel","items"]],template:function(t,i){t&1&&_(0,ts,12,13,"div",0),t&2&&p("ngIf",i.adjustmentData)},dependencies:[V,lt,F,Y,he,Mt,Ht,yr],styles:[".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}.date[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{top:3px!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-form-field-flex{background-color:#e9ecef!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-form-field-flex input{opacity:1!important;color:#00000061!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field{padding-right:0!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field .mat-mdc-text-field-wrapper{padding-bottom:0;background-color:#fff;padding-left:0}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-flex{width:147px;height:35px;border:1px solid rgb(207,207,207);margin-left:40px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix{border:none!important;top:5px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix input{font-size:14px;color:#000}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-form-field-infix{padding-top:4px;padding-bottom:4px;padding-left:8px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix{position:relative;left:-140px;top:1px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix .mat-mdc-button-persistent-ripple{color:#000}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix button.mat-mdc-icon-button.mat-mdc-button-base{padding:0}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mdc-line-ripple{display:none}.date[_ngcontent-%COMP%] datepicker.date-warnings[_ngcontent-%COMP%] .mat-mdc-form-field-flex{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.small[_ngcontent-%COMP%]{margin-right:5px!important}.small[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:143px}.col-auto[_ngcontent-%COMP%]{font-size:.875rem;height:fit-content}.col-auto[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1.25rem;color:#3b3b3b;margin-right:5px;line-height:unset!important;position:relative;top:2px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .col-auto[_ngcontent-%COMP%] span.outlet[_ngcontent-%COMP%]{padding:4px 8px 3px 5px;border:1px solid #dddddd;font-size:.875rem}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:36px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:disabled{background-color:#e9ecef!important;opacity:1!important;color:#00000061!important}.col-auto[_ngcontent-%COMP%] .outlet[_ngcontent-%COMP%]{width:165px;color:#337ab7;background:#fff}.col-auto[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:150px}.col-auto.supplier[_ngcontent-%COMP%] autocompleteV2[_ngcontent-%COMP%] input{font-size:14px}"]})};var qn=class r{onSubmit=new nt;onOpenVoidModal=new nt;onOpenNoteModal=new nt;submit(){this.onSubmit.emit()}openVoidModal(){this.onOpenVoidModal.emit()}openNoteModal(){this.onOpenNoteModal.emit()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-cart-action"]],outputs:{onSubmit:"onSubmit",onOpenVoidModal:"onOpenVoidModal",onOpenNoteModal:"onOpenNoteModal"},decls:10,vars:0,consts:[[1,"mt-5","d-flex","action-button","justify-content-between",2,"padding-left","120px"],[1,"btn","btn-gray","fw-bold","border","text-dark",2,"height","60px","width","120px",3,"click"],[1,"fa-solid","fa-note-sticky"],[1,"btn","btn-gray","fw-bold","border","text-dark","mx-5",2,"height","60px","width","120px",3,"click"],[1,"fa-solid","fa-rectangle-xmark"],[1,"btn","btn-success","d-flex","justify-content-around","align-items-center",2,"height","60px","width","200px",3,"click"],[1,"fw-bold"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"button",1),g("click",function(){return i.openNoteModal()}),f(2,"i",2),m(3," NOTE "),o(),a(4,"button",3),g("click",function(){return i.openVoidModal()}),f(5,"i",4),m(6," VOID "),o(),a(7,"button",5),g("click",function(){return i.submit()}),a(8,"span",6),m(9,"PROCESS"),o()()())},styles:[".btn-gray[_ngcontent-%COMP%]{background:linear-gradient(to bottom,#fff,#eee)}.action-button[_ngcontent-%COMP%]{width:550px}"]})};var fo=r=>({ID:r}),is=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function rs(r,e){if(r&1&&(a(0,"div",21)(1,"div",20),m(2),o(),a(3,"div",20),m(4),b(5,"number"),o()()),r&2){let t=e.$implicit;l(2),v(t.Variant.Name),l(2),v(M(5,2,t.Quantity))}}var Gn=class r{total;cartItems;completeInfo;onUndo=new nt;onNewForm=new nt;undo(){this.onUndo.emit()}newForm(){this.onNewForm.emit()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-complete"]],inputs:{total:"total",cartItems:"cartItems",completeInfo:"completeInfo"},outputs:{onUndo:"onUndo",onNewForm:"onNewForm"},decls:31,vars:16,consts:[[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","bg-light-gray","py-3"],["type","button","routerLink","/print/Adjustment","target","_blank",1,"btn","btn-light-gray",3,"queryParams"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px","border-bottom","1px solid rgba(0, 0, 0, 0.125)"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body"],["class","row justify-content-between mb-5",4,"ngFor","ngForOf"],[1,"row","justify-content-between","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col","text-start"],[1,"row","justify-content-between","mb-5"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h1",4),f(5,"i",5),m(6,"Inventory Adjustment Complete"),o()(),a(7,"div",6)(8,"div",7)(9,"div",8)(10,"a",9),g("click",function(){return i.newForm()}),m(11,"New Adjustment (F8)"),o()()()(),a(12,"div",10)(13,"a",11),f(14,"i",12),m(15,"Print "),o()()()(),a(16,"div",13)(17,"div",2)(18,"div",14)(19,"h2",15)(20,"a",16),m(21),o()()(),a(22,"div",17),_(23,rs,6,4,"div",18),a(24,"div",19)(25,"div",20),m(26,"Total Quantity:"),o(),a(27,"div",20),m(28),b(29,"sum"),b(30,"number"),o()()()()()()),t&2&&(l(13),p("queryParams",A(11,fo,i.completeInfo.OrderID)),l(7),p("routerLink",Z(13,is))("queryParams",A(14,fo,i.completeInfo.OrderID)),l(),O("#",i.completeInfo.InvoiceNumber,""),l(2),p("ngForOf",i.cartItems),l(5),v(M(30,9,Q(29,6,i.cartItems,"Quantity"))))},dependencies:[J,ut,it,ge]})};var ss=["cartContainer"];function ls(r,e){r&1&&f(0,"th",19)}function ms(r,e){r&1&&f(0,"th",20)}function ps(r,e){r&1&&(a(0,"th",21),m(1,"Cost"),o())}function cs(r,e){r&1&&(a(0,"th",22),m(1,"Total"),o())}function ds(r,e){if(r&1&&(a(0,"td")(1,"small"),m(2),o()()),r&2){let t=c().index;l(2),O("",t+1,".")}}function us(r,e){if(r&1&&(a(0,"i",27),m(1),o()),r&2){let t=c().$implicit;l(),O("",t.Variant.CategoryName," ")}}function _s(r,e){if(r&1&&(z(0),f(1,"span",32),$()),r&2){let t=c().$implicit;l(),p("innerHTML",t.Note,R)}}function gs(r,e){if(r&1&&(a(0,"td",30),m(1),o()),r&2){let t=c().$implicit;l(),v(t.Variant.UOM!="null"?t.Variant.UOMName:"")}}function fs(r,e){if(r&1&&(a(0,"td",30),m(1),b(2,"number"),o()),r&2){let t=c().$implicit;l(),v(M(2,1,t.Cost))}}function hs(r,e){if(r&1&&(a(0,"td",30),m(1),b(2,"number"),o()),r&2){let t=c().$implicit;l(),v(M(2,1,t.Cost*t.Quantity))}}function Cs(r,e){if(r&1){let t=I();a(0,"tr",23),g("click",function(){let n=d(t),s=n.$implicit,y=n.index,T=c();return u(T.onSelect({item:s,index:y}))})("contextmenu",function(n){let s=d(t),y=s.$implicit,T=s.index,tt=c();return u(tt.onContextMenu(n,y,T))}),a(1,"td",24)(2,"i",25),g("click",function(){let n=d(t),s=n.$implicit,y=n.index,T=c();return u(T.onRemove({item:s,index:y}))}),o()(),_(3,ds,3,1,"td",26),a(4,"td")(5,"span",27),m(6),o(),_(7,us,2,1,"i",28),f(8,"app-serial-note",29),_(9,_s,2,1,"ng-container",26),o(),a(10,"td"),m(11),o(),a(12,"td",30),m(13),b(14,"number"),a(15,"span"),m(16),o()(),_(17,gs,2,1,"td",31)(18,fs,3,3,"td",31)(19,hs,3,3,"td",31),o()}if(r&2){let t=e.$implicit,i=c();p("cdkDragDisabled",!i.enabledDragDrop),l(3),p("ngIf",i.appConfig.ModuleSell.Grid.RowNumberVisible),l(3),v(t.Variant.Name),l(),p("ngIf",i.appConfig.ModuleSell.Grid.CategoryVisible),l(),p("serials",t.Serial),l(),p("ngIf",t.Note),l(2),v(t.Variant.Code),l(2),O(" ",M(14,12,t.Quantity),""),l(3),v(t.UnitQuantity>1?"@"+t.UnitQuantity:""),l(),p("ngIf",i.appConfig.ModuleSell.Grid.UOMVisible),l(),p("ngIf",i.roleService.product.Cost),l(),p("ngIf",i.roleService.product.Cost)}}function ys(r,e){if(r&1){let t=I();a(0,"button",33),g("click",function(){let n=d(t).item,s=c();return u(s.onReverse(n,!0))}),m(1,"Return"),o(),a(2,"button",33),g("click",function(){let n=d(t).item,s=c();return u(s.onReverse(n,!1))}),m(3,"Purchase"),o()}}var zn=class r{constructor(e,t,i){this.loadService=e;this.cartItemService=t;this.roleService=i;this.cartItems=[],this.destroy$=new st,this.onSelectItem=new nt,this.onReturnItem=new nt,this.onPurchaseItem=new nt,this.onRemoveItem=new nt,this.onDragItem=new nt,this.cartItemsChange=new nt,this.cartItemService.notifyNewItem$.pipe(H(n=>w.IsNotEmpty(n))).subscribe({next:n=>{setTimeout(()=>{let s=this.cartContainer.nativeElement.scrollHeight;this.cartContainer.nativeElement.scrollTop=s},1)}})}cartItems;cartItemsChange;onSelectItem;onReturnItem;onPurchaseItem;onRemoveItem;onDragItem;entities;cartContainer;contextMenu;contextMenuPosition={x:"0px",y:"0px"};onContextMenu(e,t,i){e.preventDefault(),this.contextMenuPosition.x=e.clientX+"px",this.contextMenuPosition.y=e.clientY+"px",t.Index=i,this.contextMenu.menuData={item:t},this.contextMenu.openMenu()}onDrop(e){ur(this.cartItems,e.previousIndex,e.currentIndex),this.cartItemService.updateCartItem(this.cartItems),this.onDragItem.emit(this.cartItems),this.cartItemsChange.emit(this.cartItems)}destroy$;appConfig;enabledDragDrop=!0;ngOnInit(){this.initAppConfig(),this.initDragDropEnabled()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}initDragDropEnabled(){w.isMobileDevice&&(this.enabledDragDrop=!1)}initAppConfig(){this.appConfig=this.loadService.Data.AppConfigJSON,this.entities=this.loadService.Data.Entities}onRemove(e){this.onRemoveItem.emit(e)}onSelect(e){this.onSelectItem.emit(e)}onReverse(e,t){t?(e.Quantity>0&&(e.Quantity=e.Quantity*-1),this.onReturnItem.emit(e)):(e.Quantity<0&&(e.Quantity=e.Quantity*-1),this.onPurchaseItem.emit(e))}static \u0275fac=function(t){return new(t||r)(C(Nn),C(ye),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-cart-display"]],viewQuery:function(t,i){if(t&1&&(ln(ss,5),ln(kn,7)),t&2){let n;mn(n=pn())&&(i.cartContainer=n.first),mn(n=pn())&&(i.contextMenu=n.first)}},inputs:{cartItems:"cartItems"},outputs:{cartItemsChange:"cartItemsChange",onSelectItem:"onSelectItem",onReturnItem:"onReturnItem",onPurchaseItem:"onPurchaseItem",onRemoveItem:"onRemoveItem",onDragItem:"onDragItem"},decls:24,vars:10,consts:[["cartContainer",""],["contextMenu","matMenu"],[1,"cashier"],[1,"row","g-0","cart-table","border-bottom"],["cdkScrollable","",1,"col"],[1,"table"],[1,"border-start-0"],[2,"width","18px"],["style","width: 36px",4,"ngIf"],[1,"text-start",2,"width","250px"],[2,"cursor","pointer","width","60px"],[1,"text-end",2,"width","50px"],["class","text-end","style","width: 0.75rem",4,"ngIf"],["class","text-end","style","width: 90px;",4,"ngIf"],["class","text-end","style","width: 85px;",4,"ngIf"],["cdkDropList","",1,"itemList",3,"cdkDropListDropped"],["class","item","cdkDrag","",3,"cdkDragDisabled","click","contextmenu",4,"ngFor","ngForOf"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["matMenuContent",""],[2,"width","36px"],[1,"text-end",2,"width","0.75rem"],[1,"text-end",2,"width","90px"],[1,"text-end",2,"width","85px"],["cdkDrag","",1,"item",3,"click","contextmenu","cdkDragDisabled"],[1,"cursor"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Click to Remove",1,"fa","fa-xmark","text-danger",3,"click"],[4,"ngIf"],[1,"d-block"],["class","d-block",4,"ngIf"],[3,"serials"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"innerHTML"],["mat-menu-item","",3,"click"]],template:function(t,i){if(t&1){let n=I();a(0,"div",2)(1,"div",3)(2,"div",4,0)(4,"table",5)(5,"thead")(6,"tr",6),f(7,"th",7),_(8,ls,1,0,"th",8),a(9,"th",9),m(10,"Item"),o(),a(11,"th",10),m(12,"Code"),o(),a(13,"th",11),m(14,"Qty"),o(),_(15,ms,1,0,"th",12)(16,ps,2,0,"th",13)(17,cs,2,0,"th",14),o()(),a(18,"tbody",15),g("cdkDropListDropped",function(y){return d(n),u(i.onDrop(y))}),_(19,Cs,20,14,"tr",16),o()()()(),f(20,"div",17),a(21,"mat-menu",null,1),_(23,ys,4,0,"ng-template",18),o()()}if(t&2){let n=It(22);l(8),p("ngIf",i.appConfig.ModuleSell.Grid.RowNumberVisible),l(7),p("ngIf",i.appConfig.ModuleSell.Grid.UOMVisible),l(),p("ngIf",i.roleService.product.Cost),l(),p("ngIf",i.roleService.product.Cost),l(2),p("ngForOf",i.cartItems),l(),tr("left",i.contextMenuPosition.x)("top",i.contextMenuPosition.y),p("matMenuTriggerFor",n)}},dependencies:[J,V,or,Tr,Mr,Or,kn,Sn,xn,Ht,Ce,it],styles:[".cashier[_ngcontent-%COMP%]{width:550px;max-width:37rem;min-width:33rem}div.row.cart-table[_ngcontent-%COMP%]{border-left:solid 1px #CFCFCF}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%]{overflow:auto;height:250px}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background:#fbfbf7}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:.75rem;padding:9px 5px!important}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:.75rem;padding:6px 5px;border-bottom:1px solid #CFCFCF}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child{padding-right:0}.cdk-drag-preview[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}.item[_ngcontent-%COMP%]:last-child{border:none}.itemList.cdk-drop-list-dragging[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}"]})};var Is=()=>["/menu/Adjustment/Adjustment/Archive"];function bs(r,e){r&1&&(a(0,"a",4),m(1,"Cancel"),o()),r&2&&p("routerLink",Z(1,Is))}function xs(r,e){if(r&1){let t=I();a(0,"div",11)(1,"POS-cart-header",12),g("onCreateItem",function(){d(t);let n=c(2);return u(n.selectItem())})("onOpenUploadModal",function(){d(t);let n=c(2);return u(n.openUploadModal())})("onAddItem",function(n){d(t);let s=c(2);return u(s.addItem(n))})("onScanCode",function(n){d(t);let s=c(2);return u(s.onScanBarcode(n))}),o(),a(2,"POS-cart-display",13),g("onRemoveItem",function(n){d(t);let s=c(2);return u(s.removeItem(n))})("onSelectItem",function(n){d(t);let s=c(2);return u(s.selectItem(n))})("onDragItem",function(n){d(t);let s=c(2);return u(s.saveItemAfterDrag(n))})("onReturnItem",function(n){d(t);let s=c(2);return u(s.onReturnOrPurchaseItem(n))})("onPurchaseItem",function(n){d(t);let s=c(2);return u(s.onReturnOrPurchaseItem(n))}),o(),a(3,"POS-cart-action",14),g("onSubmit",function(){d(t);let n=c(2);return u(n.submit())})("onOpenVoidModal",function(){d(t);let n=c(2);return u(n.openVoidModal())})("onOpenNoteModal",function(){d(t);let n=c(2);return u(n.openNoteModal())}),o()()}if(r&2){let t=c(2);l(),p("cartItems",t.cartItems)("isUpload",!0),l(),p("cartItems",t.cartItems)}}function Ss(r,e){if(r&1){let t=I();a(0,"div",5)(1,"POS-toolbar",6),g("onOpenOutletModal",function(){d(t);let n=c();return u(n.openOutletModal())}),o(),a(2,"div",7)(3,"div",8),f(4,"pos-quick-key",9),o(),_(5,xs,4,3,"div",10),o()()}if(r&2){let t=c();l(),p("adjustmentData",t.adjustmentData)("adjustmentTypes",t.adjustmentTypes)("outletName",t.outletName)("isEdit",t.isEdit)("role",t.role.global),l(3),p("quickKeyId",t.quickKeyId)("outletID",t.outletID),l(),p("ngIf",t.adjustmentStorage)}}function Ds(r,e){if(r&1){let t=I();a(0,"div",15)(1,"POS-complete",16),g("onUndo",function(){d(t);let n=c();return u(n.undo())})("onNewForm",function(){d(t);let n=c();return u(n.newForm())}),o()()}if(r&2){let t=c();l(),p("total",t.total)("cartItems",t.cartItems)("completeInfo",t.completeInfo)}}var $n=class r extends ue{constructor(t,i,n,s,y,T,tt,bt,xt,yt,At,Bt){super(t);this.adjustmentDataService=n;this.firstLoadService=s;this.matDialog=y;this.backEndService=T;this.quickKeyService=tt;this.cartItemService=bt;this.toastr=xt;this.router=yt;this.route=At;this.role=Bt;this.destroy$=new st,this.adjustmentDataService.Data$.pipe(et(this.destroy$)).subscribe(St=>{this.adjustmentData=St,this.fillCartItems()}),this.quickKeyService.onSelectQuickeyItem$.pipe(et(this.destroy$),H(St=>w.IsNotEmpty(St.id)),ae(St=>this.cartItemService.getItemById(St.id,St.entityID))).subscribe(St=>this.cartItemService.addNewItem(St))}quickKeyId;adjustmentData;adjustmentStorage;adjustmentTypes;outletID=w.GuidEmpty;outletName="Choose an Outlet";entities;cartItems;completeInfo;isComplete;total=0;destroy$;isEdit;handleF8(){this.isComplete&&this.newForm()}ngOnInit(){this.initLoadForm()}ngOnDestroy(){this.adjustmentDataService.pushNewValue(new we),this.quickKeyService.Data=new Jr,this.destroy$.next(!0),this.destroy$.complete()}initLoadForm(){this.menuData$.subscribe(()=>{let t=this.adjustmentData.Order.ID;w.IsEmpty(t)&&w.IsNotEmpty(this.route.snapshot.queryParams.ID)&&(t=this.route.snapshot.queryParams.ID,this.isEdit=!0);let i=this.adjustmentData.Order.EntityID;this.firstLoadService.getStorage(pt.LoadFormAdjustment,t,i).subscribe(n=>{this.fillData(n),w.IsEmpty(t)&&this.entities.length>1?this.openOutletModal():this.entities.length==1&&Ie([this.backEndService.generateNumber(this.outletID,pt.AdjustmentGenerateNumber),this.backEndService.getQuickKey(this.outletID,pt.GetQuickKeyByEntityID)]).subscribe(([s,y])=>{this.adjustmentData.Order.Number=s.Number,this.initQuickKey(y)})})})}fillData(t){if(this.adjustmentStorage=t,this.isEdit&&(this.menuData.H=`Edit Adjustment #${t.Data.Order.Number}`),this.firstLoadService.pageState=2,this.entities=this.adjustmentStorage.Entities,this.entities.length==1&&(this.outletID=this.entities[0].ID,this.outletName=this.entities[0].Name,this.adjustmentData.Order.EntityID=this.outletID),this.adjustmentTypes=this.adjustmentStorage.AdjustmentTypes,this.adjustmentData.Order.TypeID=this.adjustmentStorage.AppConfigJSON.ModuleAdjustment.Advance.AdjustmentInputType,w.IsEmpty(this.adjustmentData.Order.Date)&&(this.adjustmentData.Order.Date=this.adjustmentStorage.ServerTime.toString()),w.IsNotEmpty(t.Data)){this.adjustmentDataService.pushNewValue(t.Data),this.outletID=t.Data.Order.EntityID;let i=this.entities.find(n=>n.ID==this.outletID);this.outletName=i.Name,this.quickKeyId=i.QuickKeyTemplateID,this.backEndService.getQuickKey(this.outletID,pt.GetQuickKeyByEntityID).subscribe(n=>this.initQuickKey(n))}}fillCartItems(){this.cartItems=[];let t;this.adjustmentData.Items.forEach(i=>{t=new fe,t.ID=i.ID,t.Taxable=i.Taxable,i.Variant.Serial=i.Serial,t.Quantity=i.Quantity,t.Note=i.Note,t.Cost=i.Cost,t.patchByVariantAdjustment(i.Variant),this.cartItems.push(t)})}openOutletModal(){this.isEdit||this.matDialog.open(eo,{data:{Entities:this.entities}}).afterClosed().pipe(H(t=>w.IsNotEmpty(t)),L(t=>{this.outletName=t.outlet.Name,this.outletID=t.outlet.ID,this.quickKeyId=t.outlet.QuickKeyTemplateID,this.adjustmentData.Order.EntityID=this.outletID}),ae(()=>Ie([this.backEndService.generateNumber(this.outletID,pt.AdjustmentGenerateNumber),this.backEndService.getQuickKey(this.outletID,pt.GetQuickKeyByEntityID)]))).subscribe(([t,i])=>{this.adjustmentData.Order.Number=t.Number,this.initQuickKey(i)})}initQuickKey(t){this.quickKeyService.Data=t,this.quickKeyService.EntityID=this.outletID}saveItemAfterDrag(t){this.cartItemService.updateCartItem(t)}removeItem(t){this.cartItemService.removeItem(t)}selectItem(t){this.matDialog.open(Qn,{data:{itemInfo:t,entityID:this.outletID,adjustmentType:this.adjustmentData.Order.TypeID,isAdjustmentEdit:this.isEdit}})}addItem(t){this.cartItemService.getItemById(t,this.outletID).subscribe(i=>this.cartItemService.addNewItem(i))}onScanBarcode(t){this.cartItemService.addCartItemByCode(t,this.outletID)}openUploadModal(){this.matDialog.open(jn,{data:{sampleUrl:"https://res.cloudinary.com/pos/raw/upload/v1699867623/POS/CSV/ImportAdjustment_DealPOS_New.csv",API:"/API/Adjustment/UploadCsvV2",outletID:this.outletID}}).afterClosed().pipe(H(t=>w.IsNotEmpty(t)&&t.length>0)).subscribe(t=>t.forEach(i=>this.cartItemService.addNewItem(i,!0)))}openNoteModal(){this.matDialog.open(Bn,{data:this.adjustmentData})}openVoidModal(){this.matDialog.open(io).afterClosed().pipe(H(t=>t)).subscribe(()=>{let t=this.adjustmentData.Order.Number;this.adjustmentDataService.pushNewValue(new we),this.adjustmentData.Order.EntityID=this.outletID,this.adjustmentData.Order.Number=t,this.initLoadForm()})}submit(){if(w.IsEmpty(this.adjustmentData.Order.EntityID)){this.toastr.error("Please select outlet before proceeding..",X.Error),this.openOutletModal();return}if(this.cartItems.length==0){this.toastr.error("You must have at least one item.",X.Error);return}if(w.IsEmpty(this.adjustmentData.Order.Number)){this.toastr.error("Number cannot be empty.",X.Error);return}if(this.validateItemSerial()==!1){this.toastr.warning(Ir.serialRequired,X.Warning);return}this.adjustmentStorage.AppConfigJSON.ModuleAdjustment.Basic.Workflow===1?(this.adjustmentData.Order.StateID=4,this.adjustmentData.Items.forEach(t=>delete t.UnitPriceOriginal),this.backEndService.submitTransaction(this.adjustmentData,pt.SubmitAdjustment).subscribe(t=>{this.completeInfo=t,this.isComplete=!0,this.adjustmentData.Order.ID=t.OrderID,this.calculateTotal()})):this.isEdit?(this.adjustmentData.Items.forEach(t=>delete t.UnitPriceOriginal),this.backEndService.submitTransaction(this.adjustmentData,pt.SubmitAdjustment).subscribe(t=>{this.completeInfo=t,this.isComplete=!0,this.adjustmentData.Order.ID=t.OrderID,this.calculateTotal()})):this.matDialog.open(Hn,{data:this.adjustmentData}).afterClosed().pipe(H(t=>w.IsNotEmpty(t))).subscribe(t=>{this.completeInfo=t,this.isComplete=!0,this.adjustmentData.Order.ID=t.OrderID,this.calculateTotal()})}validateItemSerial(){let t=0;return this.getItemSerial().forEach(n=>{(n.Serial?.length==0||w.IsEmpty(n.Serial))&&(t+=1)}),t==0}getItemSerial(){return this.cartItems.filter(i=>i.Variant.TypeID==4)}calculateTotal(){this.cartItems.forEach(t=>this.total+=t.Cost)}undo(){this.isComplete=!1,this.initLoadForm()}newForm(){this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Form"]).then(()=>window.location.reload())}onReturnOrPurchaseItem(t){this.cartItemService.updateItem({item:t,index:t.Index})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(ze),C(Nn),C(ft),C(Qe),C(Yr),C(ye),C(_t),C(wt),C(pe),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-new-inventory-adjustment"]],hostBindings:function(i,n){i&1&&g("keydown.F8",function(){return n.handleF8()},!1,Vt)},features:[dt],decls:6,vars:6,consts:[[3,"hideSearchDropdown","hideSearchBox","pageData"],["class","btn btn-outline-secondary",3,"routerLink",4,"ngIf"],["class","container-fluid",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid"],[3,"onOpenOutletModal","adjustmentData","adjustmentTypes","outletName","isEdit","role"],[1,"row","row","body","g-0","mt-4","justify-content-start"],[1,"col-auto","quickKey"],[3,"quickKeyId","outletID"],["class","col-auto cart ms-5",4,"ngIf"],[1,"col-auto","cart","ms-5"],[3,"onCreateItem","onOpenUploadModal","onAddItem","onScanCode","cartItems","isUpload"],[3,"onRemoveItem","onSelectItem","onDragItem","onReturnItem","onPurchaseItem","cartItems"],[3,"onSubmit","onOpenVoidModal","onOpenNoteModal"],[1,"container-fluid","mt-5"],[3,"onUndo","onNewForm","total","cartItems","completeInfo"]],template:function(i,n){i&1&&(a(0,"mainpanel-cmp",0)(1,"actions"),_(2,bs,2,2,"a",1),o(),a(3,"content"),_(4,Ss,6,8,"div",2)(5,Ds,2,3,"div",3),o()()),i&2&&(p("hideSearchDropdown",!0)("hideSearchBox",!0)("pageData",n.menuData),l(2),p("ngIf",!n.isComplete),l(2),p("ngIf",!n.isComplete),l(),p("ngIf",n.isComplete))},dependencies:[V,ut,mt,so,Xr,Wn,qn,Gn,zn]})};var Kn=class r{constructor(e){this.dialogRef=e;this.config=new ht,this.config.title="Export Adjustment Report",this.config.customWidth="382px"}pageNumber=1;pageSize=100;config;onOk(){this.dialogRef.close({pageNumber:this.pageNumber,pageSize:this.pageSize})}static \u0275fac=function(t){return new(t||r)(C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-export-report"]],decls:11,vars:3,consts:[[3,"onCancel","onClose","onOk","config"],[1,"container-fluid"],[1,"form-floating-outline"],["type","text","name","pageNumber","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["for","pageNumber"],["type","text","name","pageSize","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["for","pageSize"]],template:function(t,i){t&1&&(a(0,"modal-material",0),g("onCancel",function(){return i.dialogRef.close()})("onClose",function(){return i.dialogRef.close()})("onOk",function(){return i.onOk()}),a(1,"content")(2,"div",1)(3,"div",2)(4,"input",3),D("ngModelChange",function(s){return x(i.pageNumber,s)||(i.pageNumber=s),s}),o(),a(5,"label",4),m(6,"Page Number"),o()(),a(7,"div",2)(8,"input",5),D("ngModelChange",function(s){return x(i.pageSize,s)||(i.pageSize=s),s}),o(),a(9,"label",6),m(10,"Page Size"),o()()()()()),t&2&&(p("config",i.config),l(4),S("ngModel",i.pageNumber),l(4),S("ngModel",i.pageSize))},dependencies:[lt,F,Y,Ct,Ot]})};var ve=class r{constructor(e){this.http=e}currentUntilPage;toggleFetchTotalData;totalData;pageNumber;isNextBtnDisabled;isOnLastPage;calcCurrentUntilPage(e,t,i){this.currentUntilPage=e*(t-1)+i}setPageNumber(e){this.pageNumber=e}setPaginationButtonState(e,t,i){i==0?this.isNextBtnDisabled=!0:this.isNextBtnDisabled=!(i<e*t)}setTotalData(e,t,i){this.toggleFetchTotalData=!0,this.http.post(e,t).pipe(L(i)).subscribe(n=>this.totalData=n)}setPaginationState(e,t,i){this.calcCurrentUntilPage(e,t,i),this.setPageNumber(t),this.setPaginationButtonState(e,t,i)}static \u0275fac=function(t){return new(t||r)(Rt(k))};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var Jn=class r{constructor(e,t,i){this.state=i;this.fetchData$=n=>s=>t.post(n,s).pipe(Dt(y=>y.Data),L(y=>this.state.setPaginationState(s.RowCount,s.PageNumber,y.length))),this.fetchLoader$=n=>()=>t.post(n)}filter$=new fn(void 0);fetchData$;fetchLoader$;getLoader$(e,t){return e.pipe(ae(this.fetchLoader$(t)),L(i=>this.filter$.next(i.Filter)))}getInfiniteListData$(e){return this.filter$.pipe(H(t=>t!==void 0),ae(this.fetchData$(e)),Yi(this.filter$),L(([t,i])=>this.state.setPaginationState(i.RowCount,i.PageNumber,t.length)),Ji((t,i)=>{let[n,s]=t,[y]=i;return s.PageNumber==1?[y,s]:[n.concat(y),s]}),Dt(([t])=>t))}filterFromFirstPage(e){e.PageNumber=1,this.filter$.next(e)}nextPage(e){e.PageNumber+=1,this.filter$.next(e)}fetchTotalData(e,t){this.state.setTotalData(e,t)}fetchAllData(e,t){this.state.setTotalData(e,t,i=>{let n=j({},t);n.PageNumber=1,n.RowCount=i,this.filter$.next(n)})}static \u0275fac=function(t){return new(t||r)(Rt(rt),Rt(k),Rt(ve))};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};function ws(r,e){if(r&1){let t=I();a(0,"span",8),g("click",function(){d(t);let n=c();return u(n.onFetchTotalData())}),a(1,"i",9),m(2,"?"),o()()}}function Ms(r,e){if(r&1&&(a(0,"span"),m(1),b(2,"number"),o()),r&2){let t=c();l(),v(M(2,1,t.state.totalData))}}function Os(r,e){if(r&1){let t=I();a(0,"a",10),g("click",function(){d(t);let n=c();return u(n.onNextPage())}),f(1,"i",11),m(2," Next"),o()}}function Ts(r,e){if(r&1){let t=I();a(0,"a",12),g("click",function(){d(t);let n=c();return u(n.onConcatAllData())}),f(1,"i",13),m(2," Show All"),o()}}var Yn=class r{constructor(e){this.state=e}fetchTotalData=new nt;fetchAllData=new nt;nextPage=new nt;ngOnInit(){}onFetchTotalData(){this.fetchTotalData.emit()}onNextPage(){this.nextPage.emit()}onConcatAllData(){this.fetchAllData.emit()}static \u0275fac=function(t){return new(t||r)(C(ve))};static \u0275cmp=P({type:r,selectors:[["POS-infinite-list"]],outputs:{fetchTotalData:"fetchTotalData",fetchAllData:"fetchAllData",nextPage:"nextPage"},decls:11,vars:8,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load next page",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),m(3),b(4,"number"),_(5,ws,3,0,"span",3)(6,Ms,3,3,"span",4),m(7),o()(),a(8,"div",5),_(9,Os,3,0,"a",6)(10,Ts,3,0,"a",7),o()()),t&2&&(l(3),O(" Showing 1 - ",M(4,6,i.state.currentUntilPage)," of "),l(2),p("ngIf",!i.state.toggleFetchTotalData),l(),p("ngIf",i.state.toggleFetchTotalData),l(),O(" records ~ ",i.state.pageNumber," Page "),l(2),p("ngIf",i.state.isNextBtnDisabled&&!i.state.isOnLastPage),l(),p("ngIf",i.state.isNextBtnDisabled&&!i.state.isOnLastPage))},dependencies:[V,it]})},Zn=class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=Oe({type:r});static \u0275inj=Me({imports:[ke]})};var ks=()=>["/menu/Adjustment/Adjustment/Archive/Info"],js=r=>({ID:r});function Ns(r,e){if(r&1){let t=I();a(0,"button",13),g("click",function(){d(t);let n=c().ngIf,s=c();return u(s.openExportModal(n.Filter))}),f(1,"i",14),m(2," Export"),o()}}function As(r,e){if(r&1){let t=I();a(0,"div",15)(1,"h6"),m(2,"Outlets"),o(),a(3,"outlet-selector",16),D("ngModelChange",function(n){d(t);let s=c().ngIf;return x(s.Filter.EntityID,n)||(s.Filter.EntityID=n),u(n)}),o(),a(4,"h6"),m(5,"From"),o(),a(6,"datepicker",17),D("dateChange",function(n){d(t);let s=c().ngIf;return x(s.Filter.From,n)||(s.Filter.From=n),u(n)}),o(),a(7,"h6"),m(8,"To"),o(),a(9,"datepicker",18),D("dateChange",function(n){d(t);let s=c().ngIf;return x(s.Filter.To,n)||(s.Filter.To=n),u(n)}),o()()}if(r&2){let t=c().ngIf;l(3),p("accessType",2),S("ngModel",t.Filter.EntityID),p("multiple",!1),l(3),p("isFloatingLabel",!1),S("date",t.Filter.From),l(3),p("isFloatingLabel",!1),S("date",t.Filter.To)}}function Vs(r,e){r&1&&(a(0,"th",19),m(1,"@ Cost"),o())}function Fs(r,e){r&1&&(a(0,"th",19),m(1,"@ Price"),o())}function Us(r,e){if(r&1&&(a(0,"th",33),m(1),b(2,"number"),o()),r&2){let t=c().$implicit;l(),O(" ",M(2,1,t.UnitCost),"")}}function Ls(r,e){if(r&1&&(a(0,"th",33),m(1),b(2,"number"),o()),r&2){let t=c().$implicit;l(),O(" ",M(2,1,t.UnitPrice),"")}}function Rs(r,e){if(r&1&&(a(0,"tr")(1,"th",29),m(2),o(),a(3,"th",30),m(4),o(),a(5,"th",31),m(6),b(7,"number"),o(),_(8,Us,3,3,"th",32)(9,Ls,3,3,"th",32),o()),r&2){let t=e.$implicit,i=c(3);l(2),O(" ",t.VariantName,""),l(2),O(" ",t.VariantCode,""),l(2),v(M(7,5,t.Quantity)),l(2),p("ngIf",i.roleService.product.Cost),l(),p("ngIf",i.roleService.sell.UnitPriceEditor)}}function Qs(r,e){if(r&1&&(a(0,"div")(1,"div",20)(2,"div",21)(3,"a",22),f(4,"span",23),b(5,"date"),f(6,"small",24),b(7,"date"),a(8,"small",25),m(9),o()()()(),a(10,"div")(11,"strong",26),m(12),o(),f(13,"div",27),o(),a(14,"table",28)(15,"tbody"),_(16,Rs,10,7,"tr",11),o()()()),r&2){let t=e.$implicit;l(3),p("routerLink",Z(14,ks))("queryParams",A(15,js,t.ID)),l(),p("innerHTML",t.EntityName+" #"+t.Number+" - "+Q(5,8,t.Created,"dd MMM yyyy"),R),l(2),p("innerHTML","("+Q(7,11,t.Created,"HH:mm")+")",R),l(3),O(" ",t.PIC,""),l(3),O("[Q:",t.Quantity,"]"),l(),p("innerHTML",t.Note,R),l(3),p("ngForOf",t.Items)}}function Bs(r,e){if(r&1){let t=I();a(0,"mainpanel-cmp",2),D("textChange",function(n){let s=d(t).ngIf;return x(s.Filter.Number,n)||(s.Filter.Number=n),u(n)}),g("onSubmit",function(){let n=d(t).ngIf,s=c();return u(s.search(n.Filter))}),D("filterChange",function(n){let s=d(t).ngIf;return x(s.Filter,n)||(s.Filter=n),u(n)}),a(1,"actions"),_(2,Ns,3,0,"button",3),o(),a(3,"filters"),_(4,As,10,7,"ng-template",null,0,ot),o(),a(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),m(12,"Name"),o(),a(13,"th",8),m(14,"Code"),o(),a(15,"th",9),m(16,"Qty"),o(),_(17,Vs,2,0,"th",10)(18,Fs,2,0,"th",10),o()()(),_(19,Qs,17,17,"div",11),b(20,"async"),a(21,"POS-infinite-list",12),g("nextPage",function(){let n=d(t).ngIf,s=c();return u(s.nextPage(n.Filter))})("fetchTotalData",function(){let n=d(t).ngIf,s=c();return u(s.fetchTotalData(n.Filter))})("fetchAllData",function(){let n=d(t).ngIf,s=c();return u(s.fetchAllData(n.Filter))}),o()()()()}if(r&2){let t=e.ngIf,i=c();p("pageData",i.menuData),S("text",t.Filter.Number),p("isFilterOnDropdown",!1),S("filter",t.Filter),l(2),p("ngIf",i.roleService.global.Export),l(15),p("ngIf",i.roleService.product.Cost),l(),p("ngIf",i.roleService.sell.UnitPriceEditor),l(),p("ngForOf",M(20,8,i.data$))}}var Xn=class r extends ue{constructor(t,i,n,s,y,T,tt){super(t);this.http=i;this.infPagination=n;this.matDialog=y;this.csvConverter=T;this.roleService=tt;this.loader$=n.getLoader$(this.menuData$,this.loaderEndpoint),this.data$=n.getInfiniteListData$(this.dataEndpoint)}dataEndpoint="/api/Adjustment/AuditAdjustmentReport";loaderEndpoint="/api/AdjustmentLoader/AuditAdjustmentReport";countEndpoint="/api/Adjustment/AuditAdjustmentReportCount";data$;loader$;loader;search(t){this.infPagination.filterFromFirstPage(t)}nextPage(t){this.infPagination.nextPage(t)}fetchTotalData(t){this.infPagination.fetchTotalData(this.countEndpoint,t)}fetchAllData(t){this.infPagination.fetchAllData(this.countEndpoint,t)}onOpenExportDialog(t){this.matDialog.open(Kn).afterClosed().pipe(H(i=>w.IsNotEmpty(i))).subscribe(i=>{t.RowCount=i.pageSize,t.PageNumber=i.pageNumber,this.exportCSV("AdjustmentExport/AuditAdjustmentReport","AdjustmentReport.csv",t)})}exportCSV(t,i,n){this.http.post(`/api/${t}`,n).subscribe(s=>{this.csvConverter.convertToCSV(s,i)})}openExportModal(t){this.matDialog.open(Wt,{data:{title:"Adjustment Report",exportTypes:[{ID:"AdjustmentExport/AuditAdjustmentReport",Value:"Default",FileName:"Adjustment Report"}],filterExport:t,getAllDataLengthAPI:"Adjustment/AuditAdjustmentReportCount",pagination:!0}})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(Jn),C(ve),C(ft),C(Ut),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-adjustment-reports"]],features:[dt],decls:2,vars:3,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[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"],[3,"nextPage","fetchTotalData","fetchAllData"],[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"],[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(i,n){i&1&&(_(0,Bs,22,10,"mainpanel-cmp",1),b(1,"async")),i&2&&p("ngIf",M(1,1,n.loader$))},dependencies:[J,V,ut,mt,F,Y,he,Yn,En,le,it,me]})};var Hs=r=>({show:r});function Ws(r,e){if(r&1){let t=I();a(0,"button",25),g("click",function(){d(t);let n=c(2);return u(n.ok())}),m(1,"Upload"),o()}}function qs(r,e){if(r&1){let t=I();a(0,"button",25),g("click",function(){d(t);let n=c(2);return u(n.confirmAdjustment())}),m(1,"Confirm Adjustment"),o()}}function Gs(r,e){if(r&1&&(a(0,"div",26),m(1),b(2,"limitText"),o()),r&2){let t=e.item;p("title",(t==null||t.Name==null?null:t.Name.length)>23?t.Name:""),l(),O(" ",Q(2,2,t.Name,25)," ")}}function zs(r,e){if(r&1){let t=I();a(0,"div",27)(1,"button",28),f(2,"i",29),m(3," Download Current Inventory "),o(),a(4,"ul",30)(5,"li")(6,"a",31),g("click",function(){d(t);let n=c(2);return u(n.downloadData(0))}),f(7,"i",32),m(8," Download CSV "),o()(),a(9,"li")(10,"a",33),g("click",function(){d(t);let n=c(2);return u(n.downloadData(1))}),f(11,"i",34),m(12," Download XLSX "),o()()()()}}function $s(r,e){if(r&1&&(a(0,"tr",40),f(1,"td",41)(2,"td",41)(3,"td",42),b(4,"number"),f(5,"td",42),b(6,"number"),f(7,"td",42),b(8,"number"),o()),r&2){let t=e.$implicit;vt(t.QuantityDifferences<0?"danger":"success"),l(),p("innerHTML",t.Name,R),l(),p("innerHTML",t.Code,R),l(),p("innerHTML",M(4,9,t.Expected),R),l(2),p("innerHTML",M(6,11,t.Counted),R),l(2),vt(t.QuantityDifferences<0?"text-danger":"text-success"),p("innerHTML",M(8,13,t.QuantityDifferences),R)}}function Ks(r,e){if(r&1&&(a(0,"table",35)(1,"thead",36)(2,"tr")(3,"th"),m(4,"Name"),o(),a(5,"th",37),m(6,"Code"),o(),a(7,"th",38),m(8,"Expected Stock"),o(),a(9,"th",38),m(10,"Counted Stock "),o(),a(11,"th",38),m(12,"Differences "),o()()(),a(13,"tbody"),_(14,$s,9,15,"tr",39),o()()),r&2){let t=c(2);l(14),p("ngForOf",t.opNames)}}function Js(r,e){if(r&1){let t=I();a(0,"mainpanel-cmp",1)(1,"actions"),_(2,Ws,2,0,"button",2)(3,qs,2,0,"button",2),o(),a(4,"content")(5,"div",3)(6,"div",4)(7,"div",5)(8,"h5",6),m(9,"Outlet"),o(),a(10,"small",7),m(11,"Stock take location"),o()(),a(12,"div",8)(13,"div",9)(14,"div",10)(15,"div")(16,"ng-select",11),D("ngModelChange",function(n){d(t);let s=c();return x(s.formData.EntityID,n)||(s.formData.EntityID=n),u(n)}),g("change",function(n){d(t);let s=c();return u(s.getEntityName(n))}),_(17,Gs,3,5,"ng-template",12),o()(),_(18,zs,13,0,"div",13),o()()()(),a(19,"div",4)(20,"div",5)(21,"h5",6),m(22,"Counted Inventory"),o(),a(23,"small",7),m(24,".csv format"),o()(),a(25,"div",8)(26,"div",9)(27,"div",14)(28,"input",15),g("change",function(n){d(t);let s=c();return u(s.onSelectFile(n.target))}),o()()()()(),a(29,"div",16)(30,"div",5)(31,"h5",6),m(32,"Advanced"),o(),a(33,"small",7),m(34,"More Options"),o()(),a(35,"div",8)(36,"div",9)(37,"div",17)(38,"label",6),m(39,"Product Without Inventory"),o(),a(40,"small",18),m(41,"Download product Without Inventories"),o(),a(42,"div",19)(43,"radio-options",20),D("modelChange",function(n){d(t);let s=c();return x(s.formData.ProductWithoutInventory,n)||(s.formData.ProductWithoutInventory=n),u(n)}),o()()()()(),_(44,Ks,15,1,"table",21),o(),a(45,"a",22),m(46,"More Options"),o(),a(47,"div",23)(48,"div",24),m(49,"Tips"),o(),a(50,"ol")(51,"li"),m(52,"Choose your outlet then download the csv spreadsheet"),o(),a(53,"li"),m(54,"Fill the Quantity column beside the Expected column"),o(),a(55,"li"),m(56,"Upload your file using the Green Button on the top right corner"),o(),a(57,"li"),m(58,"Analyze the upload file on your screen and Confirm the Adjustment."),o(),a(59,"li"),m(60,'Inventory Adjustment only works for Product with type "Standard" / product with stock.'),o(),a(61,"li"),m(62,'"Composite" Product is not shown in the CSV you Download.'),o()()()()()()}if(r&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),p("ngIf",t.roleService.adjustment.Create&&!t.uploaded),l(),p("ngIf",t.uploaded),l(13),p("items",t.pageData.Entities),S("ngModel",t.formData.EntityID),l(2),p("ngIf",t.roleService.adjustment.Create||t.roleService.adjustment.Edit),l(11),vt(A(13,Hs,t.opNames.length>0)),l(14),p("options",t.productOptions),S("model",t.formData.ProductWithoutInventory),l(),p("ngIf",t.opNames.length>0)}}var ti=class r extends Ft{constructor(t,i,n,s,y,T,tt){super(t,i,null,"Outlet/GetByUserAccessWrite");this.toastr=n;this.csvConverter=s;this.router=y;this.roleService=T;this.exp=tt;this.formData={},this.opNames=[]}formData;outletName;flag;uploaded=!1;opNames;productOptions=[{Key:"0",Value:"No"},{Key:"1",Value:"Yes"},{Key:"-1",Value:"Exclude Zero"}];csvResult;file;preInitList(){this.formData.EntityID=this.pageData.Entities[0].ID,this.outletName=this.pageData.Entities[0].Name,this.formData.ProductWithoutInventory="1"}onSelectFile(t){this.file=t.files[0]}ok(){let t=new FormData;t.append("Data",this.file),t.append("EntityID",this.formData.EntityID),t.append("ProductWithoutInventory",this.formData.ProductWithoutInventory),this.httpService.postFormData("/API/Adjustment/GetPreviewImportCSV",t).subscribe({next:i=>{this.opNames=i,this.uploaded=!0}})}downloadData(t){t==0?this.exp.exportCSV("InventoryExport/GetStockTakeSpreadsheet",this.formData):this.exp.exportXlsx("InventoryExport/GetStockTakeSpreadsheet",this.formData)}getEntityName(t){this.outletName=t.Name}getFormatedDate(){let t=new Date,i=(t.getDate()<10?"0":"")+t.getDate(),n=(t.getMonth()+1<10?"0":"")+(t.getMonth()+1),s=t.getFullYear().toString().substr(-2);return i+n+s}confirmAdjustment(){let t=[];if(this.opNames.forEach(s=>{let y={VariantID:s.ID,Quantity:s.QuantityDifferences,Cost:s.UnitCost,Price:s.UnitPrice};t.push(y)}),t.length<1)return alert("You must atleast have one item to adjust!"),!1;let i=new Date;this.formData.InventoryDate!=null&&(i=new Date(this.formData.InventoryDate));let n={Order:{EntityID:this.formData.EntityID,Date:i},Items:t,TypeID:1};this.httpService.post("/API/Adjustment/SubmitUseDefault",n).subscribe({next:s=>{this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Info"],{queryParams:{ID:s.OrderID}}).then(()=>window.location.reload())},error:s=>{}})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(_t),C(Ut),C(wt),C(U),C(fr))};static \u0275cmp=P({type:r,selectors:[["POS-csv-stock-take"]],features:[dt],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[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","ngModel"],["ng-option-tmp",""],["class","dropdown ms-3",4,"ngIf"],["id","import-section",1,"col-md-6","mb-10"],["accept",".csv","id","csv","type","file","name","myfile",1,"form-control",3,"change"],[1,"row","extra-options","border-bottom","mt-10","ms-2","collapse"],[1,"col-md-5"],[1,"ms-3","h6","fst-italic"],[1,"form-floating-outline","radio","border","rounded",2,"padding-top","14px"],["name","productInventory",3,"modelChange","options","model"],["class","table table-bordered mt-3",4,"ngIf"],["data-bs-toggle","collapse","data-bs-target",".extra-options","aria-expanded","true",1,"more","ms-2"],[1,"border","mt-5","ms-2"],[1,"fst-italic","text-primary","fw-bold","h5","ms-12","mt-3"],[1,"btn","btn-success",3,"click"],[3,"title"],[1,"dropdown","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle","mb-2",2,"height","37px !important","font-size","12px !important"],[1,"fa","fa-download","me-3"],[1,"dropdown-menu","dropdown-menu-start"],["role","button",1,"dropdown-item",3,"click"],[1,"fa-solid","fa-file-csv","me-3","mb-1"],["role","button",1,"dropdown-item","mt-2",3,"click"],[1,"fa-solid","fa-file-excel","me-3","mb-1"],[1,"table","table-bordered","mt-3"],[1,"thead-light","sticky-top-thead"],[2,"width","150px"],[1,"text-end",2,"width","120px"],["class","red",3,"class",4,"ngFor","ngForOf"],[1,"red"],[3,"innerHTML"],[1,"text-end",3,"innerHTML"]],template:function(i,n){i&1&&_(0,Js,63,15,"mainpanel-cmp",0),i&2&&p("ngIf",n.pageData)},dependencies:[J,V,mt,F,Y,Mt,gr,On,it,lr],styles:[".col-md-5[_ngcontent-%COMP%]{font-size:.875rem;height:fit-content}.col-md-5.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix input{font-size:14px;padding-bottom:3px}"]})};var ei=class extends ue{constructor(t,i){super(t);this.httpService=i;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(ae(()=>this.httpService.post(this.loaderApi,this.requestPayload))).subscribe(t=>this.loaderData=t)}getProduct(t){this.products=[],this.httpService.post(this.productsApi,t).subscribe(i=>{i.forEach(n=>{n.Counted="",this.products.push(n),this.originalProducts.push(n)})})}submitAdjustment(t){this.httpService.post(this.submitApi,t).subscribe({next:i=>{this.adjustmentID=i.OrderID,this.completeInfo=i,this.error=null,this.onSubmitSuccess()},error:i=>{this.error=i}})}onSubmitSuccess(){}};var Ys=["stepper"],Zs=r=>({custom:r}),ho=r=>({"nb-button-override":r}),Co=()=>["/menu/Products/Catalog/Variants/Info"],Fi=r=>({ID:r}),Xs=r=>({"bg-gradient-warning":r}),tl=r=>({Filter:r}),el=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function nl(r,e){if(r&1){let t=I();a(0,"button",44),g("click",function(){d(t);let n=c(2);return u(n.validateFilter())}),m(1,"Next"),o()}if(r&2){let t=c(2);p("disabled",!t.roleService.adjustment.Create)}}function il(r,e){if(r&1){let t=I();a(0,"div",45)(1,"button",46),g("click",function(){d(t),c();let n=It(7);return u(n.previous())}),m(2," Back "),o(),a(3,"button",47),g("click",function(){d(t),c();let n=It(7);return u(n.next())}),m(4," Next "),o()()}if(r&2){let t=c(2);p("ngClass",A(1,ho,t.currentSubStatus!=t.subStatusEnum.PAID))}}function rl(r,e){if(r&1){let t=I();a(0,"div",45)(1,"button",48),g("click",function(){d(t),c();let n=It(7);return u(n.previous())}),m(2," Back "),o(),a(3,"button",49),g("click",function(){d(t),c();let n=It(7);return u(n.next())}),m(4," Confirm Adjustment "),o()()}if(r&2){let t=c(2);p("ngClass",A(1,ho,t.currentSubStatus!=t.subStatusEnum.PAID))}}function ol(r,e){r&1&&(f(0,"i",50),m(1,"Filter"))}function al(r,e){r&1&&(a(0,"small",51),m(1,"Outlet option is required."),o())}function sl(r,e){r&1&&(f(0,"i",52),m(1,"Input"))}function ll(r,e){r&1&&(a(0,"th",32),m(1,"Expected"),o())}function ml(r,e){r&1&&(a(0,"th",32),m(1,"Changes"),o())}function pl(r,e){if(r&1&&(a(0,"td"),m(1),o()),r&2){let t=c().$implicit;l(),v(t.Quantity)}}function cl(r,e){if(r&1&&(a(0,"td"),m(1),f(2,"i",58),m(3),o()),r&2){let t=c().$implicit;l(),O("",t.Quantity," "),l(2),se(" ",t.Counted," (",(t.Counted-t.Quantity>0?"+":"")+(t.Counted-t.Quantity),")")}}function dl(r,e){if(r&1){let t=I();a(0,"i",59),g("click",function(){d(t);let n=c().$implicit,s=c(2);return u(s.clear(n))}),o()}}function ul(r,e){if(r&1){let t=I();a(0,"tr")(1,"td"),m(2),o(),a(3,"td",53),m(4),o(),a(5,"td",53),m(6),o(),a(7,"td")(8,"a",54),m(9),o()(),a(10,"td"),m(11),o(),_(12,pl,2,1,"td",35),a(13,"td")(14,"input",55),D("ngModelChange",function(n){let s=d(t).$implicit;return x(s.Counted,n)||(s.Counted=n),u(n)}),o()(),_(15,cl,4,3,"td",35),a(16,"td",56),_(17,dl,1,0,"i",57),o()()}if(r&2){let t=e.$implicit,i=e.index,n=c(2);l(2),v(i+1+"."),l(2),v(t.CategoryName),l(2),v(t.ProductName),l(2),p("routerLink",Z(14,Co))("queryParams",A(15,Fi,t.ID)),l(),v(t.Model),l(2),v(t.Code),l(),p("ngIf",n.roleService.inventory.View),l(2),vt(A(17,Xs,t.Counted!==""&&t.Counted!=t.Quantity&&!n.roleService.inventory.View)),p("modifyValueOnWheel",!1),S("ngModel",t.Counted),l(),p("ngIf",t.Counted!==""&&n.roleService.inventory.View),l(2),p("ngIf",t.Counted!=="")}}function _l(r,e){if(r&1){let t=I();z(0),a(1,"POS-complex-pagination",60),g("jumpToPage",function(){d(t);let n=c(2);return u(n.getProduct(n.filter))})("previousPage",function(){d(t);let n=c(2);return u(n.getProduct(n.filter))})("nextPage",function(){d(t);let n=c(2);return u(n.getProduct(n.filter))}),o(),$()}if(r&2){let t=c(2);l(),p("total",t.products.length)("pageData",A(2,tl,t.filter))}}function gl(r,e){r&1&&(f(0,"i",61),m(1,"Review"))}function fl(r,e){r&1&&(a(0,"th",32),m(1,"Expected"),o())}function hl(r,e){r&1&&(a(0,"th",32),m(1,"Differences"),o())}function Cl(r,e){if(r&1&&(a(0,"td"),m(1),o()),r&2){let t=c(2).$implicit;l(),v(t.Quantity)}}function yl(r,e){if(r&1&&(a(0,"span"),m(1),o()),r&2){let t=c(3).$implicit;l(),O("+",t.Counted-t.Quantity,"")}}function vl(r,e){if(r&1&&(a(0,"span"),m(1),o()),r&2){let t=c(3).$implicit;l(),v(t.Counted-t.Quantity)}}function Il(r,e){if(r&1&&(a(0,"td"),_(1,yl,2,1,"span",35)(2,vl,2,1,"span",35),o()),r&2){let t=c(2).$implicit;l(),p("ngIf",t.Counted>t.Quantity),l(),p("ngIf",t.Counted<t.Quantity)}}function bl(r,e){if(r&1&&(a(0,"tr")(1,"td"),m(2),o(),a(3,"td",53),m(4),o(),a(5,"td")(6,"a",54),m(7),o()(),a(8,"td"),m(9),o(),_(10,Cl,2,1,"td",35),a(11,"td"),m(12),o(),_(13,Il,3,2,"td",35),o()),r&2){let t=c(),i=t.$implicit,n=t.index,s=c(2);vt(i.Counted<i.Quantity?"soft-yellow":"soft-green"),l(2),v(n+1+"."),l(2),v(i.ProductName),l(2),p("routerLink",Z(11,Co))("queryParams",A(12,Fi,i.ID)),l(),v(i.Model),l(2),v(i.Code),l(),p("ngIf",s.roleService.inventory.View),l(2),O(" ",i.Counted," "),l(),p("ngIf",s.roleService.inventory.View)}}function xl(r,e){if(r&1&&(z(0),_(1,bl,14,14,"tr",62),$()),r&2){let t=e.$implicit;l(),p("ngIf",t.Counted!==""&&t.Counted!=t.Quantity)}}function Sl(r,e){r&1&&(f(0,"i",63),m(1,"Finish"))}function Dl(r,e){if(r&1&&(a(0,"div",64),f(1,"i",65),m(2),o()),r&2){let t=c(2);l(2),v(t.error.error.Message)}}function Pl(r,e){r&1&&(a(0,"div",82),m(1," Difference"),o())}function wl(r,e){if(r&1&&(a(0,"div",87),m(1),o()),r&2){let t=c().$implicit;vt(t.Quantity-t.OriginalQuantity<0?"text-danger":"text-success"),l(),v((t.Quantity-t.OriginalQuantity>0?"+":" ")+(t.Quantity-t.OriginalQuantity))}}function Ml(r,e){if(r&1&&(a(0,"div",89)(1,"div",86),m(2),o(),a(3,"div",87),m(4),o(),_(5,wl,2,3,"div",88),o()),r&2){let t=e.$implicit,i=c(3);l(2),se("",t.Name," (",t.Model,")"),l(2),v(t.Quantity),l(),p("ngIf",i.roleService.inventory.View)}}function Ol(r,e){if(r&1&&(a(0,"div",87),b(1,"sum"),b(2,"sum"),m(3),b(4,"sum"),b(5,"sum"),b(6,"sum"),b(7,"sum"),o()),r&2){let t=c(3);vt(Q(1,3,t.Items,"Quantity")-Q(2,6,t.Items,"OriginalQuantity")<0?"text-danger":"text-success"),l(3),O(" ",(Q(4,9,t.Items,"Quantity")-Q(5,12,t.Items,"OriginalQuantity")>0?"+":" ")+(Q(6,15,t.Items,"Quantity")-Q(7,18,t.Items,"OriginalQuantity"))," ")}}function Tl(r,e){if(r&1){let t=I();a(0,"div",66)(1,"div",67)(2,"div",68)(3,"div",69)(4,"h1",70),f(5,"i",63),m(6,"Inventory Adjustment Completed"),o()(),a(7,"div",71)(8,"div",72)(9,"div",73)(10,"a",74),g("click",function(){d(t);let n=c(2);return u(n.newStockCount())}),m(11,"New Adjustment (F8)"),o()()()()()(),a(12,"div",75)(13,"div",68)(14,"div",76)(15,"h2",77)(16,"a",78),m(17),o()()(),a(18,"div",79)(19,"div",80)(20,"div",81),m(21,"Product Name (Variant)"),o(),a(22,"div",82),m(23,"Counted"),o(),_(24,Pl,2,0,"div",83),o(),_(25,Ml,6,4,"div",84),a(26,"div",85)(27,"div",86),m(28,"Total"),o(),a(29,"div",87),m(30),b(31,"sum"),o(),_(32,Ol,8,21,"div",88),o()()()()()}if(r&2){let t=c(2);l(16),p("routerLink",Z(10,el))("queryParams",A(11,Fi,t.adjustmentID)),l(),O("Adjustment #",t.completeInfo.InvoiceNumber,""),l(7),p("ngIf",t.roleService.inventory.View),l(),p("ngForOf",t.Items),l(5),v(Q(31,7,t.Items,"Quantity")),l(2),p("ngIf",t.roleService.inventory.View)}}function El(r,e){if(r&1){let t=I();a(0,"mainpanel-cmp",3),D("textChange",function(n){d(t);let s=c();return x(s.filter.ProductName,n)||(s.filter.ProductName=n),u(n)}),g("onSubmit",function(){d(t);let n=c();return u(n.filterProduct())}),a(1,"actions"),_(2,nl,2,1,"button",4)(3,il,5,3,"div",5)(4,rl,5,3,"div",5),o(),a(5,"content")(6,"mat-stepper",6,0),g("selectionChange",function(n){d(t);let s=c();return u(s.onNextStep(n))}),a(8,"mat-step",7),_(9,ol,2,0,"ng-template",8),a(10,"div",9)(11,"div",10)(12,"div",11)(13,"div",10)(14,"h3",12),m(15,"Outlet"),o()(),a(16,"div",13)(17,"ng-select",14,1),g("change",function(){d(t);let n=c();return u(n.toggleIsFilterFilled())}),D("ngModelChange",function(n){d(t);let s=c();return x(s.filter.EntityID,n)||(s.filter.EntityID=n),u(n)}),o(),_(19,al,2,0,"small",15),o()()(),a(20,"div",16)(21,"div",11)(22,"div",10)(23,"h3",12),m(24,"Category "),a(25,"small",17)(26,"em"),m(27,"Optional"),o()()()(),a(28,"div",13)(29,"ng-select",18),D("ngModelChange",function(n){d(t);let s=c();return x(s.filter.CategoryID,n)||(s.filter.CategoryID=n),u(n)}),o()()()(),a(30,"div",16)(31,"div",11)(32,"div",10)(33,"h3",12),m(34,"Contain Text "),a(35,"small",17)(36,"em"),m(37,"Optional"),o()()()(),a(38,"div",19)(39,"input",20),D("ngModelChange",function(n){d(t);let s=c();return x(s.filter.ProductName,n)||(s.filter.ProductName=n),u(n)}),o()()()(),a(40,"div",16)(41,"div",11)(42,"div",10)(43,"h3",12),m(44,"Note "),a(45,"small",17)(46,"em"),m(47,"Optional"),o()()()(),a(48,"div",13)(49,"textarea",21),D("ngModelChange",function(n){d(t);let s=c();return x(s.note,n)||(s.note=n),u(n)}),o()()()()()(),a(50,"mat-step",22),_(51,sl,2,0,"ng-template",8),a(52,"div",23)(53,"table",24),g("matSortChange",function(n){d(t);let s=c();return u(s.sortData(n))}),a(54,"thead",25)(55,"tr")(56,"th",26),m(57,"No"),o(),a(58,"th",27),m(59,"Category"),o(),a(60,"th",28),m(61,"Product"),o(),a(62,"th",29),m(63,"Variant"),o(),a(64,"th",30),m(65,"Code"),o(),_(66,ll,2,0,"th",31),a(67,"th",32),m(68,"Counted"),o(),_(69,ml,2,0,"th",33),f(70,"th",26),o()(),a(71,"tbody"),_(72,ul,18,19,"tr",34),o()(),_(73,_l,2,4,"ng-container",35),o()(),a(74,"mat-step",36),_(75,gl,2,0,"ng-template",8),a(76,"div",23)(77,"div",37)(78,"table",38),g("matSortChange",function(n){d(t);let s=c();return u(s.sortData(n))}),a(79,"thead",25)(80,"tr"),f(81,"th",26),a(82,"th",39),m(83,"Name"),o(),a(84,"th",40),m(85,"Variant"),o(),a(86,"th",32),m(87,"Code"),o(),_(88,fl,2,0,"th",31),a(89,"th",32),m(90,"Counted"),o(),_(91,hl,2,0,"th",31),o()(),a(92,"tbody"),_(93,xl,2,1,"ng-container",34),o()()()()(),a(94,"mat-step",41),_(95,Sl,2,0,"ng-template",8)(96,Dl,3,1,"div",42),o()(),_(97,Tl,33,13,"div",43),o()()}if(r&2){let t=It(18),i=c();p("pageData",i.menuData),S("text",i.filter.ProductName),p("hideSearchBox",i.currentStep!="input")("hideSearchDropdown",!0),l(2),p("ngIf",i.currentStep=="filter"),l(),p("ngIf",i.currentStep=="input"),l(),p("ngIf",i.currentStep=="review"),l(2),p("linear",!0),l(2),p("completed",i.isFilterFilled),l(9),vt(A(28,Zs,t.touched&&i.filter.EntityID==null)),p("items",i.loaderData.Entities),S("ngModel",i.filter.EntityID),p("clearable",!1),l(2),p("ngIf",t.touched&&i.filter.EntityID==null),l(10),p("items",i.loaderData.Categories),S("ngModel",i.filter.CategoryID),l(10),S("ngModel",i.filter.ProductName),l(10),S("ngModel",i.note),l(17),p("ngIf",i.roleService.inventory.View),l(3),p("ngIf",i.roleService.inventory.View),l(3),p("ngForOf",i.products),l(),p("ngIf",i.products.length>0),l(15),p("ngIf",i.roleService.inventory.View),l(3),p("ngIf",i.roleService.inventory.View),l(2),p("ngForOf",i.products),l(3),p("ngIf",i.error),l(),p("ngIf",i.isCompleted)}}var ni=class r extends ei{constructor(t,i,n,s,y){super(t,i);this.toastr=n;this.ngZone=s;this.roleService=y;this.isFilterFilled=!1,this.filter={CategoryID:null,EntityID:null,ProductName:"",SupplierID:w.GuidEmpty,RowCount:500,PageNumber:1},this.oldFilter={CategoryID:"dummy",EntityID:"dummy",ProductName:"dummy",SupplierID:"dummy",RowCount:500,PageNumber:1},this.Items=[],this.initSubscriptionStatus()}stepper;isFilterFilled;currentStep="filter";Items;note;isCompleted=!1;filter;oldFilter;currentSubStatus;subStatusEnum=ir;initSubscriptionStatus(){this.currentSubStatus=parseInt(localStorage.getItem("SubscriptionStatus"))}handleF8(){this.currentStep=="finish"&&this.newStockCount()}handleNextButton(){this.stepper&&this.ngZone.run(()=>{this.roleService.adjustment.Create&&(this.isFilterFilled?this.stepper.next():this.validateFilter())})}handlePreviousButton(){this.stepper&&this.ngZone.run(()=>{this.stepper.previous()})}toggleIsFilterFilled(){this.isFilterFilled=!0}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 i=0;this.products.forEach(n=>{n.Counted!==""&&n.Counted!=n.Quantity&&(n.Status=n.Counted>n.Quantity?"Over":"Under",i++)}),i&&!this.roleService.inventory.View&&this.toastr.warning("There are some items inventory that does not match! Click next to automatically adjust inventory.",X.Warning)}else if(t.selectedStep.label=="finish"){this.products=this.originalProducts,this.currentStep="finish",this.Items=[],this.products.forEach(s=>{if(s.Counted!==""&&s.Counted!=s.Quantity){let y={Name:s.ProductName,Cost:s.UnitCost,Price:s.UnitPrice,Quantity:s.Counted,OriginalQuantity:s.Quantity,VariantID:s.ID,Model:s.Model};this.Items.push(y)}});let i={Date:new Date,EntityID:this.filter.EntityID,Note:this.note,ID:this.adjustmentID||w.GuidEmpty},n={Items:this.Items,Order:i,TypeID:2};this.Items.length>0?this.submitAdjustment(n):this.toastr.error("Adjust at least 1 product",X.Error)}}validateFilter(){if(!this.isFilterFilled){this.toastr.error("Outlet is required",X.Error);return}this.stepper.next()}clear(t){t.Counted=""}newStockCount(){window.location.reload()}onSubmitSuccess(){this.isCompleted=!0}sortData(t){let i=this.products.slice();if(!t.active||t.direction===""){this.products=this.originalProducts;return}this.products=i.sort((n,s)=>{let y=t.direction==="asc",T=typeof n[t.active];switch(w.IsEmpty(n.Code)&&(n.Code=""),w.IsEmpty(s.Code)&&(s.Code=""),T){case"string":return w.compare(n[t.active].toLocaleLowerCase(),s[t.active].toLocaleLowerCase(),y);case"number":return w.compare(n[t.active],s[t.active],y);default:return 0}})}filterProduct(){this.filter.PageNumber=1,this.getProduct(this.filter)}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(_t),C(Zi),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-spreadsheet-stock-take"]],viewQuery:function(i,n){if(i&1&&ln(Ys,5),i&2){let s;mn(s=pn())&&(n.stepper=s.first)}},hostBindings:function(i,n){i&1&&g("keydown.F8",function(){return n.handleF8()},!1,Vt)("keydown.ArrowRight",function(){return n.handleNextButton()},!1,Vt)("keydown.ArrowLeft",function(){return n.handlePreviousButton()},!1,Vt)},features:[dt],decls:1,vars:1,consts:[["stepper",""],["outletFilter","ngModel"],[3,"pageData","text","hideSearchBox","hideSearchDropdown","textChange","onSubmit",4,"ngIf"],[3,"textChange","onSubmit","pageData","text","hideSearchBox","hideSearchDropdown"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page","class","btn btn-outline-secondary ms-auto me-0 d-block",3,"disabled","click",4,"ngIf"],["class","mt-5 nb-button",3,"ngClass",4,"ngIf"],[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"],["placeholder","Choose a category","dropdownPosition","bottom","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[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"],["rows","6","type","text","name","note",1,"form-control",3,"ngModelChange","ngModel"],["label","input"],[1,"container-fluid","px-0"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light"],[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"],["style","width: 75px;",4,"ngIf"],[2,"width","75px"],["style","width: 75px",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf"],["label","review"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom","w-100",2,"table-layout","fixed",3,"matSortChange"],["mat-sort-header","ProductName",2,"width","175px"],[2,"width","150px"],["label","finish"],["class","alert",4,"ngIf"],["class","container-fluid row mt-5",4,"ngIf"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-outline-secondary","ms-auto","me-0","d-block",3,"click","disabled"],[1,"mt-5","nb-button",3,"ngClass"],["mat-button","","mat-raised-button","","matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-2",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-outline-secondary",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-5",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success",3,"click"],[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"],[1,"text-center"],["class","fa-solid fa-delete-left fa-2x clear align-middle","matTooltipPosition","above","matTooltip","reset counter",3,"click",4,"ngIf"],[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,"class",4,"ngIf"],[1,"fa-solid","fa-check","me-3"],[1,"alert"],[1,"fa-solid","fa-circle-exclamation","me-3"],[1,"container-fluid","row","mt-5"],[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"],["class","col-3","style","font-size: 14px;",4,"ngIf"],["class","row justify-content-between my-5",4,"ngFor","ngForOf"],[1,"row","justify-content-between","fw-bold"],[1,"col-6"],[1,"col-3"],["class","col-3",3,"class",4,"ngIf"],[1,"row","justify-content-between","my-5"]],template:function(i,n){i&1&&_(0,El,98,30,"mainpanel-cmp",2),i&2&&p("ngIf",n.loaderData)},dependencies:[Ee,J,V,ut,mt,lt,F,Y,Mt,Be,zr,Gr,$r,Ot,Ht,mr,pr,ge],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}.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}']})};var kl=()=>["/menu/Products/Catalog/Products/Info"],jl=r=>({ID:r});function Nl(r,e){if(r&1){let t=I();a(0,"button",13),g("click",function(){d(t);let n=c(2);return u(n.confirmAdjust())}),m(1,"Confirm Adjustment"),o()}}function Al(r,e){if(r&1){let t=I();a(0,"div")(1,"div",14)(2,"h6"),m(3,"Outlets"),o(),a(4,"ng-select",15),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,n)||(s.pageData.Filter.EntityID=n),u(n)}),o()()()}if(r&2){let t=c(2);l(4),p("items",t.pageData.Entities),S("ngModel",t.pageData.Filter.EntityID)}}function Vl(r,e){if(r&1){let t=I();a(0,"tr",16)(1,"td"),f(2,"a",17),o(),f(3,"td",18)(4,"td",18)(5,"td",18)(6,"td",19)(7,"td",19),a(8,"td",20)(9,"input",21),D("ngModelChange",function(n){let s=d(t).$implicit;return x(s.NewQuantity,n)||(s.NewQuantity=n),u(n)}),o()(),a(10,"td",20),m(11),b(12,"number"),o(),a(13,"td")(14,"a",22),g("click",function(){let n=d(t).$implicit,s=c(2);return u(s.confirmAdjust(n))}),m(15,"Adjust"),o()()()}if(r&2){let t=e.$implicit;l(2),p("routerLink",Z(12,kl))("queryParams",A(13,jl,t.ProductID))("innerHTML",t.ProductName,R),l(),p("innerHTML",t.ParentCode,R),l(),p("innerHTML",t.Model,R),l(),p("innerHTML",t.ParentModel,R),l(),p("innerHTML",t.Ratio,R),l(),p("innerHTML",t.Inventory,R),l(2),S("ngModel",t.NewQuantity),l(2),O(" ",M(12,10,t.Inventory-t.NewQuantity*t.Ratio)," ")}}function Fl(r,e){if(r&1){let t=I();a(0,"mainpanel-cmp",2),g("onSubmit",function(){d(t);let n=c();return u(n.searchFromPageOne())}),D("filterChange",function(n){d(t);let s=c();return x(s.pageData.Filter,n)||(s.pageData.Filter=n),u(n)}),a(1,"actions"),_(2,Nl,2,0,"button",3),o(),a(3,"filters"),_(4,Al,5,2,"ng-template",null,0,ot),o(),a(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th"),m(13,"Product Name"),o(),a(14,"th",8),m(15,"Code"),o(),a(16,"th",8),m(17,"From"),o(),a(18,"th",8),m(19,"To"),o(),a(20,"th",9),m(21,"Ratio"),o(),a(22,"th",9),m(23,"Inventory"),o(),a(24,"th",10),m(25,"Convert Qty "),o(),a(26,"th",10),m(27,"Remaining"),o(),f(28,"th",11),o()(),a(29,"tbody"),_(30,Vl,16,15,"tr",12),o()()()()()()}if(r&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.roleService.adjustment.Create),l(28),p("ngForOf",t.Items)}}var ii=class r extends Ft{constructor(t,i,n,s,y){super(t,i,"Adjustment/GetAdjustToParentList","Outlet/GetByUserAccessWrite");this.toastr=n;this.router=s;this.roleService=y}Items;preGetList(){w.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=this.pageData.Entities[0].ID)}postInit(t){this.Items=t,this.Items.forEach(i=>i.NewQuantity=Math.floor(i.Inventory/i.Ratio))}confirmAdjust(t){let i=[],n=[];if(t?n.push(t):n=this.Items,n.forEach(y=>{let T={VariantID:y.ParentID,Quantity:y.NewQuantity,Cost:y.UnitCost*y.Ratio,Price:y.UnitPrice*y.Ratio};i.push(T),T={VariantID:y.ID,Quantity:y.NewQuantity*y.Ratio*-1,Cost:y.UnitCost,Price:y.UnitPrice},i.push(T)}),i.length<1)return alert("You must atleast have one item to adjust!"),!1;if(w.IsEmpty(this.pageData.Filter.EntityID))return alert("Outlet is require"),!1;let s={Order:{EntityID:this.pageData.Filter.EntityID},Items:i};this.httpService.post("/API/Adjustment/SubmitUseDefault",s).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,X.Success)},error:y=>{this.toastr.error(y,X.Error)}})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(_t),C(wt),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-convert-inventory"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-success",3,"click",4,"ngIf"],[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"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-success",3,"click"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","appendTo","body",3,"ngModelChange","items","ngModel"],[1,"border-bottom"],[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(i,n){i&1&&_(0,Fl,31,6,"mainpanel-cmp",1),i&2&&p("ngIf",n.data)},dependencies:[J,V,ut,mt,lt,F,Y,Mt,Ot,it]})};function Ul(r,e){if(r&1){let t=I();a(0,"button",16),g("click",function(){d(t);let n=c();return u(n.openExportModal())}),f(1,"i",17),m(2," Export"),o()}}function Ll(r,e){if(r&1){let t=I();a(0,"td",14)(1,"input",21),D("ngModelChange",function(n){d(t);let s=c().$implicit;return x(s.Quantity,n)||(s.Quantity=n),u(n)}),o()()}if(r&2){let t=c().$implicit;l(),S("ngModel",t.Quantity)}}function Rl(r,e){if(r&1&&(a(0,"td",14),m(1),o()),r&2){let t=c().$implicit;l(),O(" ",t.Quantity,"")}}function Ql(r,e){if(r&1){let t=I();a(0,"tr",18)(1,"td")(2,"i",19),g("click",function(){let n=d(t).index,s=c();return u(s.products.splice(n,1))}),o()(),a(3,"td"),m(4),o(),a(5,"td",14),m(6),o(),_(7,Ll,2,1,"td",20)(8,Rl,2,1,"td",20),o()}if(r&2){let t=e.$implicit,i=c();l(4),v(t.Name),l(2),v(t.Code),l(),p("ngIf",i.roleService.adjustment.InventoryProductCount),l(),p("ngIf",!i.roleService.adjustment.InventoryProductCount)}}var ri=class r extends ue{constructor(t,i,n,s,y){super(t);this.httpService=i;this.csvConverter=n;this.roleService=s;this.matDialog=y;this.products=[],this.menuData$.subscribe()}productCode;products;onBarcodeEnter(t){let i=this.products.findIndex(n=>n.Code===t);i!=-1?this.products[i].Quantity++:this.httpService.post("/API/catalog/product/ProductCountByCode",{code:t}).subscribe(n=>{n.Quantity=1,this.products.push(n)}),this.productCode=null}openExportModal(){var t={Products:this.products,Export:!0};this.matDialog.open(Wt,{data:{title:"Count Product Inventory",exportTypes:[{ID:"ProductExport/ProductCountInventory",Value:"Default",FileName:"Count Product Inventory"}],filterExport:t,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(Ut),C(U),C(ft))};static \u0275cmp=P({type:r,selectors:[["POS-count-product-inventory"]],features:[dt],decls:27,vars:6,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"cashier"],[1,"cart","big-cart","scan-cart"],[1,"barcode","barcode_counter","text-end"],[1,"me-5"],["aria-hidden","true",1,"fa-solid","fa-barcode","fa-2x","icon"],["type","text","placeholder","Scan Barcode Here","autofocus","",2,"width","200px",3,"keyup.enter","ngModelChange","ngModel"],[1,"content"],[1,"table"],["id","tableGrid",1,"cart","table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],["width","15px"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[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"],["class","text-end",4,"ngIf"],["type","text","autoNum","",1,"text-end",3,"ngModelChange","ngModel"]],template:function(i,n){i&1&&(a(0,"mainpanel-cmp",0)(1,"actions"),_(2,Ul,3,0,"button",1),o(),a(3,"content")(4,"div",2)(5,"section",3)(6,"main")(7,"section",4)(8,"div",5)(9,"span",6),m(10,"Barcode"),o(),f(11,"i",7),a(12,"input",8),g("keyup.enter",function(){return n.onBarcodeEnter(n.productCode)}),D("ngModelChange",function(y){return x(n.productCode,y)||(n.productCode=y),y}),o()(),a(13,"div",9)(14,"div",10)(15,"table",11)(16,"thead",12)(17,"tr"),f(18,"th",13),a(19,"th"),m(20,"Name"),o(),a(21,"th",14),m(22,"Code"),o(),a(23,"th",14),m(24,"Qty"),o()()(),a(25,"tbody"),_(26,Ql,9,4,"tr",15),o()()()()()()()()()()),i&2&&(p("pageData",n.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),p("ngIf",n.roleService.global.Export),l(10),S("ngModel",n.productCode),l(14),p("ngForOf",n.products))},dependencies:[J,V,mt,lt,F,Y,Ot],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 Bl(r,e){if(r&1){let t=I();a(0,"button",15),g("click",function(){d(t);let n=c(2);return u(n.openExportModal())}),f(1,"i",16),m(2," Export"),o()}}function Hl(r,e){if(r&1){let t=I();a(0,"div")(1,"div",17)(2,"h6"),m(3,"Outlets"),o(),a(4,"ng-select",18),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,n)||(s.pageData.Filter.EntityID=n),u(n)}),o(),a(5,"h6"),m(6,"Category"),o(),a(7,"POS-product-category-select",19),D("selectedCategoryIDChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.CategoryID,n)||(s.pageData.Filter.CategoryID=n),u(n)}),o(),a(8,"h6"),m(9,"Sort By"),o(),a(10,"ng-select",20),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.SortByid,n)||(s.pageData.Filter.SortByid=n),u(n)}),o()()()}if(r&2){let t=c(2);l(4),p("items",t.pageData.Options.Entities),S("ngModel",t.pageData.Filter.EntityID),l(3),S("selectedCategoryID",t.pageData.Filter.CategoryID),p("showClear",!0),l(3),p("items",t.pageData.Options.SortBy),S("ngModel",t.pageData.Filter.SortByid)}}function Wl(r,e){if(r&1&&(a(0,"span"),m(1),o()),r&2){let t=e.$implicit;l(),v(t+" ")}}function ql(r,e){if(r&1&&(a(0,"tr")(1,"td"),m(2),o(),a(3,"td"),m(4),o(),a(5,"td",14),m(6),b(7,"number"),o(),a(8,"td",14),m(9),b(10,"number"),o(),a(11,"td",21),_(12,Wl,2,1,"span",11),o()()),r&2){let t=e.$implicit;l(2),v(t.ProductCode),l(2),v(t.ProductName),l(2),v(M(7,5,t.UnitPrice)),l(3),v(M(10,7,t.Qty)),l(3),p("ngForOf",t.Models)}}function Gl(r,e){if(r&1){let t=I();a(0,"mainpanel-cmp",2),g("onSubmit",function(){d(t);let n=c();return u(n.searchFromPageOne())}),D("filterChange",function(n){d(t);let s=c();return x(s.pageData.Filter,n)||(s.pageData.Filter=n),u(n)}),a(1,"actions"),_(2,Bl,3,0,"button",3),o(),a(3,"filters"),_(4,Hl,11,6,"ng-template",null,0,ot),o(),a(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),m(12,"Code"),o(),a(13,"th",8),m(14,"Name"),o(),a(15,"th",9),m(16,"UnitPrice"),o(),a(17,"th",10),m(18,"Qty"),o(),a(19,"th"),m(20,"Available Models"),o()()(),a(21,"tbody"),_(22,ql,13,9,"tr",11),o(),a(23,"tfoot")(24,"tr",12),f(25,"td",13),a(26,"td",14),m(27),b(28,"sum"),b(29,"number"),o(),f(30,"td"),o()()()()()()}if(r&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.roleService.global.Export),l(20),p("ngForOf",t.data.Data),l(5),v(M(29,10,Q(28,7,t.data.Data,"Qty")))}}var oi=class r extends Ft{constructor(t,i,n,s,y){super(t,i,"catalog/product/GetOutletProductSheet","catalog/ProductLoader/GetOutletProductSheet");this.csvConverter=n;this.roleService=s;this.matDialog=y}openExportModal(){this.matDialog.open(Wt,{data:{title:"Product Sheet",exportTypes:[{ID:"ProductExport/GetOutletProductSheet",Value:"Default",FileName:"Product Sheet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(i){return new(i||r)(C(rt),C(k),C(Ut),C(U),C(ft))};static \u0275cmp=P({type:r,selectors:[["POS-product-sheet"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[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"],[4,"ngFor","ngForOf"],[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(i,n){i&1&&_(0,Gl,31,12,"mainpanel-cmp",1),i&2&&p("ngIf",n.data)},dependencies:[J,V,mt,F,Y,Mt,Tn,it,ge]})};var yo=Mi(xr());var W=class r{INITIAL_STATE={loadForm:{},outlet:{ID:"",Name:""},isOpenDialog:!0,isComplete:!1,adjustmentState:0,quickeyItems:{},cartItems:[],order:{Date:(0,yo.default)().utcOffset("+07:00").format(),EntityID:"",ID:w.GuidEmpty,StateID:4,TypeID:1,Number:"",PIC:"",Note:""},orderComplete:{},NewOrderID:""};#t=lo(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=>q(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,i)=>t+i.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,i)=>t+i.Variant.UnitPrice*i.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||r)};static \u0275prov=N({token:r,factory:r.\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,i,n,s,y,T,tt,bt,xt,yt,At,Bt,St,Jt,Yt,Zt,Xt,te,ee,ne,ie){this.ID=e,this.VariantID=t,this.Quantity=i,this.Cost=n,this.Price=s,this.Expense=y,this.Discount=T,this.DiscountAmount=tt,this.Note=bt,this.Taxable=xt,this.LoyaltyPoint=yt,this.EntityID=At,this.UnitQuantity=Bt,this.VariantUnitQuantity=St,this.InventoryTypeID=Jt,this.Variant=Yt,this.SalesID=Zt,this.UnitCost=Xt,this.UnitPrice=te,this.SplitQuantity=ee,this.isMaxInventory=ne,this.PromotionGift=ie}},ai=class r{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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})},Li=class{constructor(e,t,i,n,s,y,T,tt,bt,xt,yt,At,Bt,St,Jt,Yt,Zt,Xt,te,ee,ne,ie,Je,Ye,Ze,Xe,tn,en,nn,rn,on){this.ID=e,this.Name=t,this.Code=i,this.UnitCost=n,this.UnitPrice=s,this.UnitExpense=y,this.UnitQuantity=T,this.PriceDiscount=tt,this.UnitPriceOriginal=bt,this.Description=xt,this.UOM=yt,this.UOMName=At,this.ImageUrl=Bt,this.TypeID=St,this.SellPriceType=Jt,this.UnitsInStock=Yt,this.Ordered=Zt,this.OrderPrice=Xt,this.OrderPriceDiscount=te,this.Taxable=ee,this.LoyaltyPoint=ne,this.CategoryName=ie,this.CategoryID=Je,this.CategoryTypeID=Ye,this.PriceNote=Ze,this.PaymentTypeID=Xe,this.ThumbnailUrl=tn,this.Storage=en,this.Component=nn,this.PriceBook=rn,this.VariantUnitQuantity=on}ID;Name;Code;UnitCost;UnitPrice;UnitExpense;UnitQuantity;PriceDiscount;UnitPriceOriginal;Description;UOM;UOMName;ImageUrl;TypeID;SellPriceType;UnitsInStock;Ordered;OrderPrice;OrderPriceDiscount;Taxable;LoyaltyPoint;CategoryName;CategoryID;CategoryTypeID;PriceNote;PaymentTypeID;ThumbnailUrl;Storage;Component;PriceBook;VariantUnitQuantity},si=class r{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.UnitsInStock??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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var li=class r{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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})},mi=class r{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,UnitsInStock:e.UnitsInStock,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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})},vo=class r{adapt(e){return{Number:e.Number,Quantity:e.Quantity,ExpiryDate:e.ExpiryDate}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var Et=class r{destroy$=new st;#t=h(W);#e=h(k);#n=h(ai);#i=h(si);#r=h(Pt);#o=h(li);#a=h(mi);constructor(){}processOrder(){return at(this.#t.AdjustmentState,{injector:this.#r}).pipe(et(this.destroy$),G(e=>{let t=[...this.#t.CartItems()].map(i=>q(j({},this.#o.adapt(i)),{EntityID:w.GuidEmpty,Note:i.Note??"",SalesID:i.SalesID??"",isMaxInventory:!1,PromotionGift:!1,SplitQuantity:0,UnitCost:i.Cost,Cost:i.Cost,Variant:q(j({},this.#a.adapt(i.Variant)),{Taxable:!!i.Variant.Taxable})}));if(e===0){let i={Items:[...t],Order:{Date:this.#t.Order().Date,EntityID:this.#t.Outlet().ID,ID:w.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},NewOrderID:this.#t.NewOrderID()};return this.#e.post(pt.SubmitAdjustment,i).pipe(et(this.destroy$))}if(e===1){let i=q(j({},this.#t.LoadForm().Data),{Order:q(j({},this.#t.LoadForm().Data.Order),{Note:this.#t.Order().Note,PIC:this.#t.Order().PIC,Number:this.#t.Order().Number||this.#t.LoadForm().Data.Order.Number,Date:this.#t.Order().Date||this.#t.LoadForm().Data.Order.Date}),Items:[...t]});return this.#e.post(pt.SubmitAdjustment,i).pipe(et(this.destroy$))}return hn}),Cn(e=>Ki(()=>new Error(e))))}onUpdateOrderState(e,t){if(Object.keys(this.#t.Order()).includes(e)){let n=q(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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var $e=class r{destroy$=new st;#t=h(k);#e=h(W);#n=h(Pt);orderService=h(Et);getLoadForm$=this.#t.post("/API/Adjustment/LoadForm",{EntityID:w.GuidEmpty,ID:w.GuidEmpty}).pipe(Dn(),L(e=>{this.#e.onChangeLoadform(e)}));constructor(){}httpRequestLoadForm$(e){return at(this.#e.IsComplete,{injector:this.#n}).pipe(et(this.destroy$),H(t=>!t),G(t=>this.#t.post("/API/Adjustment/LoadForm",j({EntityID:"00000000-0000-0000-0000-000000000000",ID:"00000000-0000-0000-0000-000000000000"},e))),L(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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var pi=class r{destroy$=new st;#t=h(W);#e=h(k);#n=h(Et);#i=h(Pt);constructor(){this.initialize()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initialize(){Ie([at(this.#t.Outlet,{injector:this.#i}),at(this.#t.AdjustmentState,{injector:this.#i}),at(this.#t.IsComplete,{injector:this.#i})]).pipe(Dn(),H(([e,t,i])=>w.IsNotEmpty(e.ID)&&!i),G(([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(et(this.destroy$),L(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(et(this.destroy$),L(t=>{this.#t.onChangeQuickeyItems(t)}))}getQuickey(e){return this.#e.get(pt.GetQuickKeyByEntityID,[{key:"ID",value:e}])}static \u0275fac=function(t){return new(t||r)};static \u0275prov=N({token:r,factory:r.\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}_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;constructor(e,t,i,n,s,y,T,tt,bt,xt,yt,At,Bt,St,Jt,Yt,Zt,Xt,te,ee,ne,ie,Je,Ye,Ze,Xe,tn,en,nn,rn,on){this._Variant=e,this._QtyRequested=t,this._TotalPrice=i,this._SalesName=n,this._PriceNote=s,this._SalesID=y,this._InventoryTypeID=T,this._ID=tt,this._Code=bt,this._VariantID=xt,this._Quantity=yt,this._UnitQuantity=At,this._Expense=Bt,this._Cost=St,this._Price=Jt,this._Discount=Yt,this._Note=Zt,this._Taxable=Xt,this._LoyaltyPoint=te,this._UnitPriceOriginal=ee,this._DiscountAmount=ne,this._Name=ie,this._PriceTypeID=Je,this._Storage=Ye,this._Serial=Ze,this._ThumbnailUrl=Xe,this._UnitPrice=tn,this._TypeID=en,this._VariantUnitQuantity=nn,this._UOM=rn,this._UOMName=on}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}}},Qi=class{get UnitsInStock(){return this._UnitsInStock}set UnitsInStock(e){this._UnitsInStock=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}_UnitsInStock;_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,i,n,s,y,T,tt,bt,xt,yt,At,Bt,St,Jt,Yt,Zt,Xt,te,ee,ne,ie,Je,Ye,Ze,Xe,tn,en,nn,rn,on,wo,Mo,Oo,To,Eo,ko,jo,No,Ao,Vo,Fo,Uo,Lo,Ro,Qo,Bo,Ho,Wo,qo,Go,zo,$o,Ko,Jo){this._UnitsInStock=e,this._CategoryName=t,this._CategoryTypeID=i,this._PriceTypeID=n,this._PriceNote=s,this._UnitPriceOriginal=y,this._Ordered=T,this._BrandName=tt,this._ImageUrl=bt,this._ThumbnailUrl=xt,this._Component=yt,this._PriceBook=At,this._UOMName=Bt,this._Storage=St,this._CategoryID=Jt,this._DiscountAmount=Yt,this._VariantUnitQuantity=Zt,this._ProductCreated=Xt,this._ProductID=te,this._ProductIndex=ee,this._Code=ne,this._TypeID=ie,this._UnitQuantity=Je,this._SalesCommission=Ye,this._Description=Ze,this._Image=Xe,this._Discontinued=tn,this._Taxable=en,this._LoyaltyPoint=nn,this._PackSize=rn,this._CreatorId=on,this._Created=wo,this._UnitExpense=Mo,this._SellPriceType=Oo,this._VariantType=To,this._CostCurrencyID=Eo,this._UnitCost=ko,this._OrderPrice=jo,this._OrderPriceDiscount=No,this._OrderPriceDiscountDetail=Ao,this._PriceCurrencyID=Vo,this._UnitPrice=Fo,this._PriceDiscount=Uo,this._PaymentTypeID=Lo,this._PaymentTypeString=Ro,this._SellPriceTypeString=Qo,this._Weight=Bo,this._CostCurrencySymbol=Ho,this._PriceCurrencySymbol=Wo,this._UOM=qo,this._MeasurementID=Go,this._UOMQ=zo,this._Name=$o,this._Model=Ko,this._ID=Jo}toJSON(){return{UnitsInStock:this.UnitsInStock,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}}},Kt=class r{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).toJSON()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})},Ke=class r{adapt(e){return new Qi(e.UnitsInStock??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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var ci=class r{modalConfig;storeService=h(W);#t=h(Fe);#e=h(gt);form;constructor(){this.modalConfig=new ht,this.modalConfig.customWidth="400px",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]})}onOK(){let e=this.form.value;this.#e.close(e)}onCancel(){this.#e.close()}ngOnInit(){this.generateForm()}handleKeyDown(e){console.log("event",e),e.code==="F2"&&this.onOK()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-modal-cart-note"]],hostBindings:function(t,i){t&1&&g("keydown",function(s){return i.handleKeyDown(s)},!1,Vt)},standalone:!0,features:[K],decls:11,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100",3,"formGroup"],[1,"w-100"],[1,"mb-3"],["type","text","formControlName","PIC",1,"form-control","w-100","height-input"],[1,"w-100","mt-4"],["formControlName","Note","rows","4",1,"form-control","w-100","ps-2"]],template:function(t,i){t&1&&(a(0,"modal-material",0),g("onOk",function(){return i.onOK()})("onCancel",function(){return i.onCancel()})("onClose",function(){return i.onCancel()}),a(1,"content")(2,"div",1)(3,"div",2)(4,"strong",3),m(5,"PIC"),o(),f(6,"input",4),o(),a(7,"div",5)(8,"strong",3),m(9,"Note"),o(),f(10,"textarea",6),o()()()()),t&2&&(p("config",i.modalConfig),l(2),p("formGroup",i.form))},dependencies:[jt,Ct,ce,lt,F,je,de,Ae,Ve]})};var di=class r{modalConfig;#t=h(gt);constructor(){this.modalConfig=new ht,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||r)};static \u0275cmp=P({type:r,selectors:[["POS-modal-cart-void"]],standalone:!0,features:[K],decls:5,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"fw-normal"]],template:function(t,i){t&1&&(a(0,"modal-material",0),g("onOk",function(){return i.onOK()})("onCancel",function(){return i.onCancel()})("onClose",function(){return i.onCancel()}),a(1,"content")(2,"div",1)(3,"h4",2),m(4,"This will erase all current data. Are you sure?"),o()()()()),t&2&&p("config",i.modalConfig)},dependencies:[jt,Ct]})};var kt=class r{variantSearchCTRL=new Ne({});#t=h(W);#e=h(k);#n=h(Pt);#i=h(Kt);#r=h(ft);#o=h(Ke);destroy$=new st;#a=this.variantSearchCTRL.valueChanges.pipe(et(this.destroy$),H(e=>w.IsNotEmpty(e)),G(e=>e.type==="ID"?this.httpGetVariantByID(e.str):this.httpRequestVariantByCode(e.str)));constructor(){}httpGetVariantByID(e){let t={entityID:this.#t.Outlet().ID,id:e};return this.#e.post("/API/catalog/variant/GetVariantByID",t).pipe(Dt(i=>this.generateCartItem(i)))}httpRequestVariantByCode(e){return at(this.#t.Outlet,{injector:this.#n}).pipe(et(this.destroy$),H(t=>w.IsNotEmpty(t.ID)),be(),G(t=>this.#e.get(pt.GetVariantByCode,[{key:"Code",value:e},{key:"EntityID",value:t.ID},{key:"Promotion",value:!0}]).pipe(Dt(i=>this.generateCartItem(i)))))}httpRequestGetInventoryByVariantID(e){return at(this.#t.Outlet,{injector:this.#n}).pipe(et(this.destroy$),H(t=>w.IsNotEmpty(t.ID)),be(),G(t=>this.#e.get(pt.GetVariantStockByID,[{key:"EntityID",value:t.ID},{key:"ID",value:e}])))}addItemByVariantID(e){this.httpGetVariantByID(e).pipe(et(this.destroy$),L(t=>this.onAddCartItem(t))).subscribe()}onAddCartItem(e,t=!1){let i=this.#t.CartItems(),n=i.findIndex(y=>y.VariantID===e.VariantID),s=[];n!==-1?t?s=[...i,e]:(i[n].Quantity+=1,s=[...i]):s=[...i,e],this.#t.onChangeCartItems(s)}generateCartItem(e){return this.#i.adapt(q(j({},e),{ID:w.GuidEmpty,Cost:e.UnitCost,Expense:e.UnitCost,SplitQuantity:0,UnitCost:e.UnitCost,InventoryTypeID:4,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:w.GuidEmpty,VariantUnitQuantity:e.VariantUnitQuantity,Storage:e.Storage,UOM:e.UOM,UOMName:e.UOMName,VariantID:e.ID,Variant:this.#o.adapt(e)}))}onRemoveCartItem(e){let t=this.#t.CartItems().filter((i,n)=>e!==n);this.#t.onChangeCartItems(t)}onOpenCartNoteModal(){return this.#r.open(ci)}onOpenCartVoidModal(){return this.#r.open(di)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var zl=(r,e)=>e.key,$l=r=>({selected:r}),Kl=()=>["/menu/Products/Catalog/Variants/Info"];function Jl(r,e){if(r&1){let t=I();a(0,"a",8),g("click",function(){d(t);let n=c().$implicit,s=c();return u(s.onTabChange(n.key))}),m(1),o()}if(r&2){let t=c().$implicit,i=c();p("ngClass",A(2,$l,i.activeTab().key===t.key)),l(),O(" ",t.label," ")}}function Yl(r,e){if(r&1&&_(0,Jl,2,4,"a",7),r&2){let t=e.$implicit;re(t.isVisible?0:-1)}}function Zl(r,e){r&1&&(a(0,"div",12)(1,"h5"),m(2,"Cost"),o(),f(3,"input",18),o())}function Xl(r,e){if(r&1){let t=I();a(0,"div",5)(1,"div",9)(2,"div",10)(3,"h5"),m(4,"Qty"),o(),f(5,"input",11,0),o(),a(7,"div",12)(8,"h5"),m(9,"Price"),o(),f(10,"input",13),o(),_(11,Zl,4,0,"div",14),o(),z(12),a(13,"div",9)(14,"div",15)(15,"h5",16),m(16,"Note"),o(),a(17,"POS-tinymce-editor",17),g("valueChange",function(n){d(t);let s=c();return u(s.onNoteChange(n))}),o()()(),$(),o()}if(r&2){let t,i=c();p("formGroup",i.form),l(11),p("ngIf",i.roleService.product.Cost),l(6),p("value",(t=i.form.get("Note"))==null?null:t.value)}}function tm(r,e){if(r&1&&f(0,"img",30),r&2){let t=c(3);p("ngSrc",t.cartItem.ThumbnailUrl)}}function em(r,e){r&1&&_(0,tm,1,1,"ng-template")}function nm(r,e){r&1&&(z(0),f(1,"i",31),a(2,"h6"),m(3,"No Image"),o(),$())}function im(r,e){if(r&1&&(z(0),a(1,"div",19)(2,"div",20)(3,"a",21),_(4,em,1,0)(5,nm,4,0,"ng-container"),o()(),a(6,"div",22)(7,"div",23),f(8,"i",24),a(9,"div",25),m(10,"Inventory"),o()(),a(11,"table",26)(12,"tbody")(13,"tr")(14,"td",27),m(15," On Hand "),o(),a(16,"td",28),m(17),o()(),a(18,"tr")(19,"td",29),m(20," Allocated "),o(),a(21,"td",28),m(22),o()(),a(23,"tr")(24,"td",29),m(25,"Available"),o(),a(26,"td",28),m(27),o()(),a(28,"tr")(29,"td",29),m(30,"ROP"),o(),a(31,"td",28),m(32),o()(),a(33,"tr")(34,"td",29),m(35,"Max"),o(),a(36,"td",28)(37,"span"),m(38),o()()()()()()(),$()),r&2){let t=c();l(3),p("routerLink",Z(7,Kl)),l(),re(t.cartItem.ThumbnailUrl?4:5),l(13),O(" ",t.inventory().ON_HAND," "),l(5),O(" ",t.inventory().ALLOCATED," "),l(5),O(" ",t.inventory().AVAILABLE," "),l(5),O(" ",t.inventory().ROP," "),l(6),v(t.inventory().MAX)}}function rm(r,e){if(r&1){let t=I();a(0,"POS-tab-serial",32),D("variantChange",function(n){d(t);let s=c();return x(s.storeService.CartItems()[s.data.index],n)||(s.storeService.CartItems()[s.data.index]=n),u(n)})("serialsChange",function(n){d(t);let s=c();return x(s.serials,n)||(s.serials=n),u(n)}),g("onSerialDataChange",function(n){d(t);let s=c();return u(s.onSerialDataHandler(n))}),o()}if(r&2){let t=c();p("isEditBuyForm",!1)("outletID",t.storeService.Outlet().ID),S("variant",t.storeService.CartItems()[t.data.index])("serials",t.serials)}}var ui=class r{constructor(e){this.data=e;this.cartItem=Object.assign({},this.storeService.CartItems()[this.data.index]),this.modalConfig.title=this.cartItem.Variant.Name,this.modalConfig.customWidth="650px",this.modalConfig.bodyScrollable=!0}storeService=h(W);roleService=h(U);modalConfig=new ht;cartItem;form;tabs=ct([]);activeTab=vn(()=>this.tabs().filter(e=>e.isActive)[0]);isItemSerial=ct(!1);inventory=ct({ON_HAND:0,ALLOCATED:0,AVAILABLE:0,ROP:0,MAX:0});serials=[];#t=h(Fe);#e=h(gt);#n=h(Kt);#i=h(kt);#r=h(Pt);#o=h(_t);itemQuantity=ct(1);itemPrice=ct("");itemCost=ct("");itemNote=ct("");onTabChange(e){let t=this.tabs().map(i=>i.key===e?q(j({},i),{isActive:!0}):q(j({},i),{isActive:!1}));this.tabs.set(t)}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??""})}onSerialDataHandler(e){let t=e.reduce((n,s)=>n+s.Quantity,0),i=this.storeService.CartItems().reduce((n,s)=>(s.ID===this.cartItem.ID?n.push(j({},this.#n.adapt(q(j({},s),{Serial:[...e],Quantity:+t})))):n.push(s),n),[]);this.storeService.onChangeCartItems(i)}ngOnInit(){at(this.storeService.CartItems,{injector:this.#r}).pipe(L(e=>{this.cartItem=e[this.data.index]})).subscribe(),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:!0}]),this.requestUnitInStock().subscribe({next:e=>this.inventory.set(q(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)}))}),this.form.valueChanges.pipe(L(e=>{let t=this.storeService.CartItems().reduce((i,n,s)=>(this.data.index===s?i.push(j({},this.#n.adapt(q(j({},n),{Quantity:+e.Quantity,Price:+e.Price,Cost:+e.Cost,Note:e.Note})))):i.push(n),i),[]);this.storeService.onChangeCartItems(t)}),Ge("edit")).subscribe()}onNoteChange(e){this.form.get("Note").setValue(e)}onOK(){if(this.checkIsSerial()){if(Array.isArray(this.cartItem.Serial)&&this.cartItem.Serial.length){let e=this.cartItem.Serial.reduce((t,i)=>t+i.Quantity,0);if(this.cartItem.Quantity!==e){this.#o.warning("Serial must be equal with the quantity",X.Warning);return}}if(this.cartItem.Quantity<0){let e=this.storeService.CartItems().reduce((t,i,n)=>(this.data.index===n?t.push(j({},this.#n.adapt(q(j({},i),{Quantity:+this.cartItem.Quantity,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value})))):t.push(i),t),[]);this.storeService.onChangeCartItems(e)}if(this.cartItem.Quantity>0){let e=this.serials.map(i=>({Quantity:1,Number:i,ExpiryDate:null}));this.cartItem.Serial=[...e],this.cartItem.Quantity=e.reduce((i,n)=>i+n.Quantity,0);let t=this.storeService.CartItems().reduce((i,n,s)=>(this.data.index===s?i.push(j({},this.#n.adapt(q(j({},n),{Quantity:+this.cartItem.Quantity,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):i.push(n),i),[]);this.storeService.onChangeCartItems(t)}}else{let e=this.storeService.CartItems().reduce((t,i,n)=>(this.data.index===n?t.push(j({},this.#n.adapt(q(j({},i),{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(i),t),[]);this.storeService.onChangeCartItems(e)}this.#e.close()}checkIsSerial(){return this.cartItem.Variant!==void 0?this.cartItem.Variant.TypeID===4:!1}requestUnitInStock(){if(w.IsEmpty(this.storeService.Outlet().ID)){this.#o.error("Please select outlet before proceding...",X.Error);return}return at(this.activeTab,{injector:this.#r}).pipe(H(e=>e.key===1),be(),G(e=>this.#i.httpRequestGetInventoryByVariantID(this.cartItem.VariantID)))}onCancel(){this.#e.close()}onSerialChanges(e){this.form.patchValue({Quantity:e.Quantity});let t=e,i=this.storeService.CartItems(),n=[],s=i.findIndex(y=>y.VariantID===t.VariantID);s!==-1&&(i[s]=t,n=[...i],this.storeService.onChangeCartItems(n))}static \u0275fac=function(t){return new(t||r)(C(_e))};static \u0275cmp=P({type:r,selectors:[["adjustment-modal-edit-product"]],standalone:!0,features:[K],decls:11,vars:2,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,"isEditBuyForm","outletID","variant","serials"],[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"],["class","col-auto ps-0",4,"ngIf"],[1,"col-12"],[1,"mb-5"],["height","220px",3,"valueChange","value"],["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-sm-6"],[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","text-start",2,"width","100px"],[1,"text-end"],[1,"table-light","text-start"],["width","400","height","400",1,"border","rounded",3,"ngSrc"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[3,"variantChange","serialsChange","onSerialDataChange","isEditBuyForm","outletID","variant","serials"]],template:function(t,i){if(t&1&&(a(0,"modal-material",1),g("onOk",function(){return i.onOK()})("onCancel",function(){return i.onCancel()})("onClose",function(){return i.onCancel()}),a(1,"content")(2,"div",2)(3,"div",3)(4,"div"),an(5,Yl,1,1,null,null,zl),o()()(),a(7,"div",4),_(8,Xl,18,3,"div",5)(9,im,39,8,"ng-container")(10,rm,1,4,"POS-tab-serial",6),o()()()),t&2){let n;p("config",i.modalConfig),l(5),sn(i.tabs()),l(3),re((n=i.activeTab().key)===0?8:n===1?9:n===2?10:-1)}},dependencies:[jt,Ct,ke,Ee,V,de,lt,F,je,Ae,Ve,We,He,cn,ut,nr,qe,Ue,Ot],styles:[".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}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 om(r,e){if(r&1){let t=I();a(0,"div",27)(1,"button",28),g("click",function(){d(t);let n=c().index,s=c(2);return u(s.onReturnVariant(n))}),m(2," Return "),o(),a(3,"button",28),g("click",function(){d(t);let n=c().index,s=c(2);return u(s.onPurchaseVariant(n))}),m(4," Purchase "),o()()}}function am(r,e){if(r&1&&(a(0,"td",29),m(1),o()),r&2){let t=c().index;l(),O(" ",t+1,". ")}}function sm(r,e){if(r&1){let t=I();z(0),a(1,"div",30)(2,"img",31),g("error",function(n){d(t);let s=c(3);return u(s.onErrorImage(n))}),o()(),$()}if(r&2){let t=c().$implicit;l(2),p("src",t.Variant.ThumbnailUrl,Te)("alt",t.Variant.Name)}}function lm(r,e){r&1&&(a(0,"div",32),f(1,"i",33),o())}function mm(r,e){if(r&1&&(a(0,"span"),m(1),b(2,"number"),o()),r&2){let t=c().$implicit;l(),v(M(2,1,t.Quantity))}}function pm(r,e){r&1&&(a(0,"span",34),m(1," x "),o())}function cm(r,e){if(r&1&&(a(0,"span"),m(1),b(2,"number"),o()),r&2){let t=c().$implicit;l(),v(M(2,1,t.UnitQuantity))}}function dm(r,e){if(r&1&&(z(0),a(1,"small",35),m(2),o(),$()),r&2){let t=c().$implicit;l(2),v(t.Variant.UOM?t.Variant.UOMName:"")}}function um(r,e){if(r&1&&(z(0),a(1,"div",36),m(2),b(3,"number"),o(),$()),r&2){let t=c().$implicit;l(2),O(" ",Q(3,1,t.Price,"1.0-4")," ")}}function _m(r,e){if(r&1){let t=I();z(0),a(1,"tr",7),g("click",function(){let n=d(t).index,s=c(2);return u(s.onOpenModalEditProduct(n))}),_(2,om,5,0,"ng-template",null,1,ot)(4,am,2,1,"td",8),a(5,"td",9)(6,"div",10),_(7,sm,3,2,"ng-container",3)(8,lm,2,0,"ng-template",null,2,ot),a(10,"div",11)(11,"div"),m(12),o(),a(13,"span",12),m(14),o(),a(15,"div"),f(16,"app-serial-note",13),o(),f(17,"small",14),o()()(),a(18,"td",15)(19,"div",16)(20,"div",17)(21,"span"),_(22,mm,3,3,"span",18)(23,pm,2,0,"span",19)(24,cm,3,3,"span",18),o(),_(25,dm,3,1,"ng-container",18),o()()(),a(26,"td"),_(27,um,4,4,"ng-container",18),o(),a(28,"td")(29,"div",20),m(30),b(31,"number"),o()(),a(32,"td",21)(33,"div",16)(34,"div",22),m(35),b(36,"number"),o()()(),a(37,"td",23)(38,"div",24)(39,"span",25),g("click",function(){let n=d(t).index,s=c(2);return u(s.removeCartItem(n))}),f(40,"i",26),o()()()(),$()}if(r&2){let t,i,n=e.$implicit,s=It(3),y=It(9),T=c(2);l(),p("cdkContextMenuTriggerFor",s),l(3),p("ngIf",(t=T.AppConfigJSON())==null?null:t.ModuleSell.Grid.RowNumberVisible),l(3),p("ngIf",n.Variant.ThumbnailUrl)("ngIfElse",y),l(5),v(n.Variant.Name),l(2),v(n.Variant.Code),l(2),p("serials",n.Serial),l(),p("innerHtml",n.Note,R),l(5),p("ngIf",n.Quantity!=1||n.UnitQuantity>1),l(),p("ngIf",n.UnitQuantity>1||n.UnitQuantity<-1),l(),p("ngIf",n.UnitQuantity>1||n.UnitQuantity<-1),l(),p("ngIf",n.Variant.UOM&&((i=T.AppConfigJSON())==null||i.ModuleSell==null?null:i.ModuleSell.Grid.UOMVisible)),l(2),p("ngIf",n.UnitPrice!==n.Total),l(3),O(" ",n.Discount?M(31,15,n.Discount*-1)+"%":""," "),l(5),O(" ",T.roleService.product!=null&&T.roleService.product.Price?M(36,17,+n.Quantity*+n.UnitPrice):" - "," ")}}function gm(r,e){if(r&1){let t=I();z(0),a(1,"table",4)(2,"tbody",5),g("cdkDropListDropped",function(n){d(t);let s=c();return u(s.onDrop(n))}),_(3,_m,41,19,"ng-container",6),o()(),$()}if(r&2){let t=c();l(3),p("ngForOf",t.CartItems())}}function fm(r,e){r&1&&(a(0,"div",37)(1,"div",38)(2,"div",39)(3,"div",40)(4,"div",41),f(5,"i",42),o(),a(6,"div",43)(7,"span"),m(8,"Empty Cart"),o(),f(9,"br"),a(10,"span"),m(11,"Add products to the cart"),o(),f(12,"br"),a(13,"span"),m(14,"or scan barcode"),o()()()()()())}var _i=class r{roleService=h(U);storeService=h(W);cartService=h(kt);matDialog=h(ft);renderer=h(Xi);#t=h(Kt);CartItems=this.storeService.CartItems;AppConfigJSON=this.storeService.AppConfigJSON;onDrop(e){}onOpenModalEditProduct(e){let t=this.matDialog.open(ui,{data:{index:e}})}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((i,n,s)=>(e===s?i.push(j({},this.#t.adapt(q(j({},n),{Quantity:-Math.abs(n.Quantity),TotalPrice:-Math.abs(n.Quantity)*n.Price})))):i.push(n),i),[]);this.storeService.onChangeCartItems(t)}onPurchaseVariant(e){let t=this.storeService.CartItems().reduce((i,n,s)=>(e===s?i.push(j({},this.#t.adapt(q(j({},n),{Quantity:Math.abs(n.Quantity),TotalPrice:Math.abs(n.Quantity)*n.Price})))):i.push(n),i),[]);this.storeService.onChangeCartItems(t)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart-display"]],standalone:!0,features:[K],decls:3,vars:2,consts:[["EMPTY_CART",""],["context_menu",""],["NO_IMAGE",""],[4,"ngIf","ngIfElse"],[1,"table","table-borderless"],["cdkDropList","",3,"cdkDropListDropped"],[4,"ngFor","ngForOf"],["cdkDrag","",1,"border-bottom",2,"padding-left","12px",3,"click","cdkContextMenuTriggerFor"],["style","width: 10px; padding-left: 12px",4,"ngIf"],[1,"pe-0",2,"width","50%","padding-left","12px"],[1,"d-flex","align-items-center"],[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"],[4,"ngIf"],["class","fs-6",4,"ngIf"],[1,"fw-normal","fs-5","text-danger"],["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"],[2,"width","10px","padding-left","12px"],[1,""],[1,"object-fit-contain",2,"height","55px","width","55px",3,"error","src","alt"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6"],["title","UOM",1,"ps-1","fs-5"],[1,"fs-5","text-end"],[1,"row","g-0","h-100"],[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,i){if(t&1&&_(0,gm,4,1,"ng-container",3)(1,fm,15,0,"ng-template",null,0,ot),t&2){let n=It(2);p("ngIf",i.CartItems().length>0)("ngIfElse",n)}},dependencies:[V,Sn,J,xn,Ce,it,Br,Rr,Lr,Qr],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 gi=class r{storeService=h(W);cartService=h(kt);orderService=h(Et);loadFormService=h($e);roleService=h(U);#t=h(wt);onProcess=new nt;onOpenModalNote=new nt;onOpenModalVoid=new nt;constructor(){}onProcessHandler(){this.onProcess.emit()}onOpenModalNoteHandler(){this.onOpenModalNote.emit(),this.cartService.onOpenCartNoteModal().afterClosed().subscribe({next:t=>{Object.keys(t).forEach(i=>{this.orderService.onUpdateOrderState(i,t[i])})}})}onOpenModalVoidHandler(){this.onOpenModalVoid.emit(),this.cartService.onOpenCartVoidModal().afterClosed().pipe(H(t=>t.type==="OK"),G(()=>this.loadFormService.getLoadForm$),L(()=>{this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeCartItems([]),this.storeService.onChangeIsOpenDialog(!1),this.#t.navigate(["/menu/Adjustment/Adjustment/Archive/Form/V2"])})).subscribe()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart-action"]],outputs:{onProcess:"onProcess",onOpenModalNote:"onOpenModalNote",onOpenModalVoid:"onOpenModalVoid"},standalone:!0,features:[K],decls:13,vars:2,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","fa-rectangle-xmark"],[1,"col-7"],["type","button",1,"btn","btn-success","w-100","fs-3","px-0","py-6",2,"border-left","0.1px solid #fff",3,"click"],[1,"fs-6"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"button",2),g("click",function(){return i.onOpenModalNoteHandler()}),f(3,"i",3),o(),a(4,"button",4),g("click",function(){return i.onOpenModalVoidHandler()}),f(5,"i",5),a(6,"span"),m(7,"Void"),o()()(),a(8,"div",6)(9,"button",7),g("click",function(){return i.onProcessHandler()}),m(10," Process "),a(11,"small",8),m(12),o()()()()),t&2&&(l(12),se("(",i.storeService.CartItems().length," items, ",i.storeService.QtyCartItems()," Qty)"))},styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};var fi=class r{cartService=h(kt);query=new Ne({});#t=h(k);#e=h(W);constructor(){}ngOnInit(){this.query.valueChanges.pipe(H(e=>w.IsNotEmpty(e)),G(e=>e.type==="ID"?this.cartService.httpGetVariantByID(e.str):this.cartService.httpRequestVariantByCode(e.str))).subscribe({next:e=>{this.cartService.onAddCartItem(e)}})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart-header"]],standalone:!0,features:[K],decls:4,vars:1,consts:[[1,"row"],[1,"col"],[1,""],[3,"formControl"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),f(3,"POS-variant-autocomplete",3),o()()()),t&2&&(l(3),p("formControl",i.query))},dependencies:[kr,Fr,ce,F,de,bn]})};var Bi=class{constructor(e,t,i,n,s,y,T,tt,bt,xt,yt){this._StateID=e,this._StateLabel=t,this._Success=i,this._Message=n,this._InvoiceID=s,this._OrderID=y,this._InvoiceNumber=T,this._PrintMode=tt,this._DeliveryID=bt,this._PaymentStateID=xt,this._PaymentStateLabel=yt}_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}}},hi=class r{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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var Ci=class r{constructor(e){this.dialogRef=e;this.config=new ht,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0}config;onClose(){this.dialogRef.close({role:"close"})}onCancel(){this.dialogRef.close({role:"cancel"})}submit(e){this.dialogRef.close({role:"ok",data:e})}static \u0275fac=function(t){return new(t||r)(C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-with-approval"]],standalone:!0,features:[K],decls:9,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid",2,"width","500px","display","flex","justify-content","space-around"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-file-pen"],[1,"btn","btn-outline-secondary","ms-5",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-user-magnifying-glass"]],template:function(t,i){t&1&&(a(0,"modal-material",0),g("onCancel",function(){return i.dialogRef.close()})("onClose",function(){return i.dialogRef.close()}),a(1,"content")(2,"div",1)(3,"div",2),g("click",function(){return i.submit(0)}),f(4,"i",3),m(5," Save as Draft "),o(),a(6,"div",4),g("click",function(){return i.submit(1)}),f(7,"i",5),m(8," Submit for Review "),o()()()()),t&2&&p("config",i.config)},dependencies:[jt,Ct]})};var yi=class r{destroy$=new st;#t=h(Et);#e=h(W);#n=h(hi);toastr=h(_t);matDialog=h(ft);constructor(){}ngOnInit(){}onProcessOrder(){if(w.IsEmpty(this.#e.Outlet().ID)){this.toastr.error("Please select outlet before proceeding..",X.Error);return}if(this.#e.CartItems().length==0){this.toastr.error("You must have at least one item.",X.Error);return}if(w.IsEmpty(this.#e.Order().Number)){this.toastr.error("Number cannot be empty.",X.Error);return}switch(this.#e.AppConfigJSON().ModuleAdjustment.Basic.Workflow){case 1:this.#t.processOrder().pipe(et(this.destroy$)).subscribe({next:e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))},error:e=>{console.log("error",e)}});break;case 2:this.#e.AdjustmentState()==0&&this.matDialog.open(Ci).afterClosed().pipe(H(e=>e!=null&&e.role==="ok"),L(e=>{let t=e.data+1;this.#t.onUpdateOrderState("StateID",Number(t))}),G(e=>this.#t.processOrder()),L(e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))})).subscribe(),this.#e.AdjustmentState()==1&&this.#t.processOrder().pipe(et(this.destroy$)).subscribe({next:e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))},error:e=>{console.log("error",e)}});break}}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart"]],standalone:!0,features:[K],decls:9,vars:0,consts:[[1,"h-100","d-flex","flex-column"],[1,"pt-4"],[1,"row"],[1,"col"],[1,"",2,"overflow-y","auto","flex","1 1 0%"],[1,""],[3,"onProcess"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),f(4,"adjustment-cart-header"),o()()(),a(5,"div",4),f(6,"adjustment-cart-display"),o(),a(7,"div",5)(8,"adjustment-cart-action",6),g("onProcess",function(){return i.onProcessOrder()}),o()()())},dependencies:[_i,gi,fi]})};var vi=class r{destroy$=new st;#t=h(W);#e=h(k);#n=h(Pt);#i=h(Et);constructor(){}httpGenerateNumber$(){let e=at(this.#t.Outlet,{injector:this.#n}),t=at(this.#t.IsComplete,{injector:this.#n});return Ie([e,t]).pipe(et(this.destroy$),H(([i,n])=>w.IsNotEmpty(i.ID)),be(),G(([i,n])=>this.#e.post("/API/Adjustment/GenerateNumber",{ID:i.ID}).pipe(Dt(s=>s.Number))),L(i=>{this.#i.onUpdateOrderState("Number",i)}),yn(1))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};function hm(r,e){if(r&1&&(a(0,"div",25)(1,"div",26),m(2),o(),a(3,"div",26),m(4),o()()),r&2){let t=e.$implicit;l(2),v(t.Variant.Name),l(2),v(t.Quantity)}}var Ii=class r{#t=h(rt);#e=h(In);menu$;storeService=h(W);#n=h(wt);#i=h(vi);#r=h(Et);cartItems;constructor(){this.#t.setMenu$(),this.menu$=this.#t.menu$.pipe(Dt(e=>q(j({},e),{H:"Inventory Adjustment",T:e.T.replace("undefined","Inventory Adjustment")})),L(e=>this.#e.setTitle(e.T)))}handleF8(){this.onNewAdjustment()}onPrintReceipt(){return gn(this,null,function*(){window.open(`/print/Adjustment?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onGotoAdjustmentDetail(){return gn(this,null,function*(){window.open(`/menu/Adjustment/Adjustment/Archive/Info?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onNewAdjustment(){return gn(this,null,function*(){this.storeService.onChangeCartItems([]),yield this.#n.navigate(["menu/Adjustment/Adjustment/Archive/Form/V2"],{queryParams:{}}),this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeIsComplete(),this.storeService.onChangeCartItems([])})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-order-complete"]],hostBindings:function(t,i){t&1&&g("keydown.F8",function(){return i.handleF8()},!1,Vt)},inputs:{cartItems:"cartItems"},standalone:!0,features:[K],decls:36,vars:10,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"order-complete"],[1,"container-fluid","pt-8"],[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,"click"],[1,"card-body"],["class","row justify-content-between mb-3",4,"ngFor","ngForOf"],[1,"row","justify-content-end","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col-4","text-end"],[1,"row","justify-content-between","mb-3"],[1,"col","text-end"]],template:function(t,i){t&1&&(a(0,"mainpanel-cmp",0),b(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),m(11,"Inventory Adjustment Complete "),o()(),a(12,"div",9)(13,"div",10)(14,"div",11)(15,"a",12),g("click",function(){return i.onNewAdjustment()}),m(16," New Adjustment (F8)"),o()()()(),a(17,"div",13)(18,"div",14)(19,"a",15),g("click",function(){return i.onPrintReceipt()}),f(20,"i",16),m(21,"Print Receipt"),o()()()()(),a(22,"div",17)(23,"div",5)(24,"div",18)(25,"h3",19)(26,"a",20),g("click",function(){return i.onGotoAdjustmentDetail()}),m(27),o()()(),a(28,"div",21),_(29,hm,5,2,"div",22),a(30,"div",23)(31,"div",24),m(32,"Total:"),o(),a(33,"div",24),m(34),b(35,"number"),o()()()()()()()()()()),t&2&&(p("pageData",M(1,6,i.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),l(27),O("Adjustment #",i.storeService.OrderComplete().InvoiceNumber,""),l(2),p("ngForOf",i.cartItems),l(5),O(" ",M(35,8,i.storeService.QtyCartItems())," "))},dependencies:[le,it,Re,mt,J,wn],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} #full-container{padding-top:60px!important}"]})};function Cm(r,e){if(r&1&&(a(0,"div",16)(1,"div",17)(2,"div"),m(3),o(),a(4,"small",18),m(5),o()()()),r&2){let t=e.data;l(3),v(t==null?null:t.Value),l(2),v(t==null?null:t.Code)}}var _n=class r{modalConfig=new ht;cartService=h(kt);cartItem=ct(null);query=new Ne(null);form;#t=h(gt);unsubscribe$=new st;#e=h(Fe);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)}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:[""]})}onSelected(e){}ngOnInit(){this.initForm(),this.query.valueChanges.pipe(et(this.unsubscribe$),G(e=>this.cartService.httpGetVariantByID(e).pipe()),Ge("get cart item")).subscribe({next:e=>{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()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-modal-cart-add"]],standalone:!0,features:[K],decls:29,vars:7,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,"optionSelected","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"],["height","220px",3,"valueChange","value"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"]],template:function(t,i){if(t&1){let n=I();a(0,"modal-material",2),g("onCancel",function(){return d(n),u(i.onCancel())})("onClose",function(){return d(n),u(i.onCancel())})("onOk",function(){return d(n),u(i.onOK())}),a(1,"content")(2,"div",3)(3,"div",4)(4,"div",5)(5,"autocompleteV2",6),g("optionSelected",function(y){return d(n),u(i.onSelected(y))})("keyup.enter",function(y){return d(n),u(y.stopPropagation())}),o(),_(6,Cm,6,2,"ng-template",null,0,ot),o()(),a(8,"div",7)(9,"div",8)(10,"div",9)(11,"h5"),m(12,"Qty"),o(),f(13,"input",10,1),o(),a(15,"div",11)(16,"h5"),m(17,"Price"),o(),f(18,"input",12),o(),a(19,"div",11)(20,"h5"),m(21,"Cost"),o(),f(22,"input",13),o()(),z(23),a(24,"div",8)(25,"div",5)(26,"h5",14),m(27,"Note"),o(),a(28,"POS-tinymce-editor",15),g("valueChange",function(y){return d(n),u(i.onChangeNote(y))}),o()()(),$(),o()()()()}if(t&2){let n,s=It(7);p("config",i.modalConfig),l(5),p("formControl",i.query)("renderThumbnail",!0)("useCustomTemplate",!0)("itemTemplate",s),l(3),p("formGroup",i.form),l(20),p("value",(n=i.form.get("Note"))==null?null:n.value)}},dependencies:[Ue,Ot,Mn,Le,jt,Ct,Pr,lt,F,je,de,bn,Ae,Ve,We,He]})};var Io=Mi(Yo());function ym(r,e){if(r&1){let t=I();a(0,"POS-uppy",2),g("onParser",function(n){d(t);let s=c();return u(s.onParser(n))})("fileUploaded",function(n){d(t);let s=c();return u(s.onUploadCsv(n))})("fileRemoved",function(){d(t);let n=c();return u(n.onRemovedFile())}),o()}if(r&2){let t=c();p("sampleUrl",t.sampleURL)}}var bi=class r{modalConfig;sampleURL;fileInput=ct(null);unsubscribe$=new st;#t=h(gt);#e=h(k);#n=h(W);#i=h(kt);#r=h(Pt);cartItem=ct([]);skipEmptyLines=!0;rowCount=ct(0);rowEmpty=ct(0);totalRows=vn(()=>this.rowCount()-this.rowEmpty());file=ct(null);constructor(){this.modalConfig=new ht,this.modalConfig.title="Import Items",this.modalConfig.customWidth="500px",this.sampleURL="https://res.cloudinary.com/pos/raw/upload/v1699867623/POS/CSV/ImportAdjustment_DealPOS_New.csv"}onOK(){at(this.cartItem,{injector:this.#r}).pipe(G(e=>{let t={EntityID:this.#n.Outlet().ID,CartItems:e};return this.#e.post("/API/Adjustment/UploadCsvV2",t).pipe(Ge("response")).pipe(Cn(i=>[]))}),L(e=>{Array.isArray(e)&&e.length>0&&e.forEach(t=>this.#i.onAddCartItem(t,!0))})).subscribe(),this.#t.close()}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),Io.default.parse(t,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:i=>{let n=i.split(/\r?\n/).slice(1);return n[n.length-1]===""&&n.pop(),this.rowCount.set(n.length),n.forEach(s=>{s.split(",").every(T=>T==="")&&this.rowEmpty.update(T=>T+=1)}),i},error(i,n){console.log("ERROR",i,n)},complete:(i,n)=>{console.log("COMPLETE",i),this.cartItem.set(i.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||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-modal-cart-upload"]],standalone:!0,features:[K],decls:3,vars:1,consts:[["modalContent",""],[3,"onOk","onCancel","onClose","config"],[3,"onParser","fileUploaded","fileRemoved","sampleUrl"]],template:function(t,i){if(t&1){let n=I();a(0,"modal-material",1),g("onOk",function(){return d(n),u(i.onOK())})("onCancel",function(){return d(n),u(i.onClose())})("onClose",function(){return d(n),u(i.onClose())}),_(1,ym,1,1,"ng-template",null,0,ot),o()}t&2&&p("config",i.modalConfig)},dependencies:[jt,Ct,Nr]})};function vm(r,e){if(r&1){let t=I();a(0,"li",11),g("click",function(){let n=d(t).$implicit,s=c(3);return u(s.onClickMenu(n))}),f(1,"POS-dropdown-item-more-action",12),o()}if(r&2){let t=e.$implicit;l(),p("icon",t.icon)("label",t.title)}}function Im(r,e){if(r&1&&an(0,vm,2,2,"li",10,Oi),r&2){let t=c().$implicit;sn(t.children)}}function bm(r,e){if(r&1&&(a(0,"div",7)(1,"div",8),m(2),o(),f(3,"div",9),_(4,Im,2,0),o()),r&2){let t=e.$implicit;l(2),v(t.title),l(2),re(t.children.length>0?4:-1)}}var xi=class r{menu=ct([]);#t=h(ft);router=h(wt);handleF8(){this.#t.openDialogs&&this.#t.openDialogs.length>0||this.#t.open(_n)}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"}]},{title:"Advanced",icon:"",children:[{title:"Adjustment V1",icon:"fa-scanner-gun fas",value:"adjustment v1"}]}];this.menu.set(e)}onClickMenu(e){switch(e.value){case"add":this.#t.open(_n);break;case"upload":this.#t.open(bi);break;case"adjustment v1":this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Form"]);break}}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-more-actions"]],hostBindings:function(t,i){t&1&&g("keydown.F4",function(s){return i.handleF8(s)},!1,Vt)},standalone:!0,features:[K],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","300px"],[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,i){t&1&&(a(0,"span",0)(1,"span",1),f(2,"i",2),o(),a(3,"span",3),m(4,"More Actions"),o()(),a(5,"div",4)(6,"div",5)(7,"div",6),an(8,bm,5,2,"div",7,Oi),o()()()),t&2&&(l(8),sn(i.menu()))},dependencies:[Wr]})};var Hi=class{constructor(e,t,i,n){this._Order=e,this._Items=t,this._OrderItems=i,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}},Si=class r{adapt(e){return new Hi(e.Order,e.Items,e.OrderItems,e.CountedItems)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})},Wi=class{constructor(e,t,i,n,s,y,T,tt,bt,xt,yt,At,Bt,St,Jt,Yt,Zt,Xt,te,ee,ne,ie){this._EntityID=e,this._Number=t,this._Date=i,this._PIC=n,this._Note=s,this._EntityName=y,this._StateID=T,this._StateLabel=tt,this._ReviewDate=bt,this._ReviewerID=xt,this._TypeID=yt,this._TypeLabel=At,this._Quantity=Bt,this._UnitPrice=St,this._UnitCost=Jt,this._TotalPrice=Yt,this._AdjustedQuantity=Zt,this._CreatorID=Xt,this._Created=te,this._ModifierID=ee,this._Modified=ne,this._ID=ie}_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}},bo=class r{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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})},qi=class{constructor(e,t,i,n,s,y,T,tt,bt,xt,yt,At){this._LostNFoundID=e,this._UnitCost=t,this._InventoryTypeID=i,this._UnitPrice=n,this._Discount=s,this._VariantID=y,this._Note=T,this._Quantity=tt,this._UnitQuantity=bt,this._Index=xt,this._Serial=yt,this._ID=At}_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}},xo=class r{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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})},Gi=class{constructor(e,t,i,n,s,y,T,tt,bt,xt,yt,At){this._ParentID=e,this._Start=t,this._Finish=i,this._UnitPrice=n,this._UnitCost=s,this._VariantID=y,this._Note=T,this._Quantity=tt,this._UnitQuantity=bt,this._Index=xt,this._Serial=yt,this._ID=At}_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}},So=class r{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||r)};static \u0275prov=N({token:r,factory:r.\u0275fac,providedIn:"root"})};var Do=Mi(xr());function xm(r,e){if(r&1&&(z(0),f(1,"adjustment-order-complete",2),$()),r&2){let t=c();l(),p("cartItems",t.storeService.CartItems())}}function Sm(r,e){if(r&1){let t=I();a(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"POS-select-outlet-form",8),b(6,"async"),g("ngModelChange",function(n){d(t);let s=c();return u(s.storeService.onChangeOutlet(n))}),o(),a(7,"POS-invoice-number-form",9),b(8,"async"),g("ngModelChange",function(n){d(t);let s=c();return u(s.onInvoiceNumberChange(n))}),o()(),a(9,"POS-invoice-date",10),g("ngModelChange",function(n){d(t);let s=c();return u(s.onChangeOrderDate(n))}),o()()(),a(10,"div",11)(11,"div",12)(12,"div",13),f(13,"adjustment-more-actions"),o(),a(14,"div",14),f(15,"i",15),a(16,"ng-select",16),g("ngModelChange",function(n){d(t);let s=c();return u(s.onChangeAdjustmentType(n))}),o()()()()(),a(17,"div",17)(18,"div",18)(19,"POS-quick-key",19),g("onSelectVariant",function(n){d(t);let s=c();return u(s.onSelectVariant(n))}),o()(),a(20,"div",20),f(21,"adjustment-cart"),o()()()}if(r&2){let t=c();l(5),p("disabled",t.storeService.AdjustmentState()===1)("isOpenAfterLoad",M(6,16,t.isOpenDiaglog$))("outlets",t.storeService.Outlets())("ngModel",t.storeService.Outlet()),l(2),p("ngModel",t.storeService.Order().Number)("transactionType",M(8,18,t.transactionType$))("disabled",!(t.roleService.global!=null&&t.roleService.global.Number)),l(2),p("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),p("clearable",!1)("ngModel",t.storeService.Order().TypeID)("disabled",!!t.storeService.Order().TypeID&&t.storeService.AdjustmentState()===1)("items",t.storeService.AdjustmentTypes()),l(3),p("quickKey",t.storeService.QuickeyItems())("outletID",t.storeService.Outlet().ID)}}var Di=class r{isOpenDialog=ct(!0);loadFormService=h($e);storeService=h(W);quickeyService=h(pi);cartService=h(kt);orderService=h(Et);isOpenDiaglog$;Outlets$;loadForm$;adjustmentEditDataAdapter=h(Si);roleService=h(U);#t=h(Kt);#e=h(Ke);#n=h(pe);transactionType$=this.#n.queryParamMap.pipe(Dt(e=>(e.has("ID"),"Adjustment")));title=h(In);injector=h(Pt);test=[];ngOnInit(){let e=JSON.parse(localStorage.getItem("AccountInfo"));this.title.setTitle(e.BrandName+" POS | New Inventory Adjustment"),this.test=this.storeService.Outlets()&&this.storeService.Outlets().filter((t,i)=>i===0),this.#n.queryParamMap.pipe(G(t=>{if(t.has("ID")){this.storeService.onChangeAdjustmentState(1);let i={EntityID:"00000000-0000-0000-0000-000000000000",ID:t.get("ID")};return this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeAdjustmentState(1),this.loadFormService.httpRequestLoadForm$(i).pipe(L(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 s=n.Data.Items.map(y=>this.#t.adapt(q(j({},y),{Variant:this.#e.adapt(y.Variant)})));if(this.storeService.onChangeCartItems(s),this.orderService.onUpdateOrderState("PIC",n.Data.Order.PIC),this.orderService.onUpdateOrderState("Note",n.Data.Order.Note),n.Entities.length>0){let y=n.Entities.findIndex(T=>T.ID===n.Data.Order.EntityID);y!==-1&&this.storeService.onChangeOutlet(n.Entities[y])}}}))}return this.storeService.onChangeAdjustmentState(0),this.loadFormService.httpRequestLoadForm$()})).subscribe({}),at(this.storeService.IsOpenDialog,{injector:this.injector}).pipe().subscribe(),at(this.storeService.AppConfigJSON,{injector:this.injector}).pipe(L(t=>this.orderService.onUpdateOrderState("StateID",t?.ModuleAdjustment.Advance.AdjustmentInputType))).subscribe(),this.isOpenDiaglog$=at(this.storeService.IsOpenDialog,{injector:this.injector})}onChangeAdjustmentType(e){let t=this.storeService.AdjustmentTypes().filter(i=>i.Key===e)[0];this.orderService.onUpdateOrderState("TypeID",t.Key)}onInvoiceNumberChange(e){this.orderService.onUpdateOrderState("Number",e)}onChangeOrderDate(e){this.orderService.onUpdateOrderState("Date",(0,Do.default)(e).startOf("day").format("YYYY-MM-DDTHH:mm:ss.SSS"))}onSelectVariant(e){this.cartService.addItemByVariantID(e)}ngOnDestroy(){this.storeService.onResetState()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-adjustment-v2"]],standalone:!0,features:[K],decls:3,vars:2,consts:[["ON_GOING",""],[4,"ngIf","ngIfElse"],[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,i){if(t&1&&_(0,xm,2,1,"ng-container",1)(1,Sm,22,20,"ng-template",null,0,ot),t&2){let n=It(2);p("ngIf",i.storeService.IsComplete())("ngIfElse",n)}},dependencies:[Re,V,le,wr,Vr,Ur,Ar,ce,F,Y,Pn,Mt,yi,Ii,xi],styles:[".left-toolbar-container[_ngcontent-%COMP%]{position:relative}.left-toolbar-container[_ngcontent-%COMP%] POS-invoice-number-form[_ngcontent-%COMP%]{position:absolute;top:34px;left:28px}.header[_ngcontent-%COMP%]{min-height:60px}.content[_ngcontent-%COMP%]{min-height:calc(100vh - 60px)}.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 Dm=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Pm=r=>({ID:r});function wm(r,e){if(r&1){let t=I();a(0,"button",11),g("click",function(){d(t);let n=c(2);return u(n.openExportModal())}),f(1,"i",12),m(2," Export "),o()}}function Mm(r,e){if(r&1){let t=I();a(0,"div")(1,"div",13)(2,"h6"),m(3,"Variant"),o(),a(4,"autocompleteV2",14),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.ID,n)||(s.pageData.Filter.ID=n),u(n)}),o(),a(5,"h6"),m(6,"Outlet"),o(),a(7,"ng-select",15),D("ngModelChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,n)||(s.pageData.Filter.EntityID=n),u(n)}),o(),a(8,"h6"),m(9,"From"),o(),a(10,"datepicker",16),D("dateChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.From,n)||(s.pageData.Filter.From=n),u(n)}),o(),a(11,"h6"),m(12,"To"),o(),a(13,"datepicker",17),D("dateChange",function(n){d(t);let s=c(2);return x(s.pageData.Filter.To,n)||(s.pageData.Filter.To=n),u(n)}),o()()()}if(r&2){let t=c(2);l(4),S("ngModel",t.pageData.Filter.ID),p("inputTextValue",t.pageData.Filter.VariantName),l(3),p("items",t.pageData.Options.Entities),S("ngModel",t.pageData.Filter.EntityID),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.From),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.To)}}function Om(r,e){r&1&&(a(0,"th"),m(1,"Variant"),o())}function Tm(r,e){if(r&1&&(a(0,"td"),m(1),o()),r&2){let t=c().$implicit;l(),v(t.Name)}}function Em(r,e){if(r&1&&(a(0,"tr",18),_(1,Tm,2,1,"td",8),b(2,"async"),a(3,"td"),m(4),o(),a(5,"td")(6,"a",19),m(7),o()(),a(8,"td"),m(9),b(10,"number"),o(),a(11,"td"),m(12),b(13,"date"),o()()),r&2){let t=e.$implicit,i=c(2);l(),p("ngIf",!M(2,7,i.isRedirect$)),l(3),v(t.EntityName),l(2),p("routerLink",Z(14,Dm))("queryParams",A(15,Pm,t.ID)),l(),v(t.Number),l(2),v(M(10,9,t.Quantity)),l(3),v(Q(13,11,t.Date,"dd/MM/yy"))}}function km(r,e){if(r&1){let t=I();a(0,"mainpanel-cmp",2),D("textChange",function(n){d(t);let s=c();return x(s.pageData.Filter.Number,n)||(s.pageData.Filter.Number=n),u(n)}),g("onSubmit",function(){d(t);let n=c();return u(n.searchFromPageOne())}),D("filterChange",function(n){d(t);let s=c();return x(s.pageData.Filter,n)||(s.pageData.Filter=n),u(n)}),a(1,"actions"),_(2,wm,3,0,"button",3),o(),a(3,"filters"),_(4,Mm,14,8,"ng-template",null,0,ot),o(),a(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr"),_(12,Om,2,0,"th",8),b(13,"async"),a(14,"th"),m(15,"Outlet"),o(),a(16,"th"),m(17,"Number"),o(),a(18,"th"),m(19,"Quantity"),o(),a(20,"th"),m(21,"Date"),o()()(),a(22,"tbody"),_(23,Em,14,17,"tr",9),o()()(),a(24,"POS-complex-pagination",10),g("jumpToPage",function(){d(t);let n=c();return u(n.getListData())})("previousPage",function(){d(t);let n=c();return u(n.getListData())})("nextPage",function(){d(t);let n=c();return u(n.getListData())}),o()()()()}if(r&2){let t=c();p("pageData",t.menuData),S("text",t.pageData.Filter.Number),p("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.roleService.global.Export),l(10),p("ngIf",!M(13,9,t.isRedirect$)),l(11),p("ngForOf",t.data.Data),l(),p("total",t.data.Data==null?null:t.data.Data.length)("pageData",t.pageData)}}var Pi=class r extends Ft{constructor(t,i,n,s,y){super(t,i,"catalog/product/GetAdjustmentHistory","catalog/productLoader/GetAdjustmentHistoryLoader",null,n);this.matDialog=s;this.roleService=y;this.isRedirect$=$i(this.route.snapshot.queryParamMap).pipe(Dt(T=>T.has("ID")),yn(1))}isRedirect$;openExportModal(){this.matDialog.open(Wt,{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(i){return new(i||r)(C(rt),C(k),C(pe),C(ft),C(U))};static \u0275cmp=P({type:r,selectors:[["POS-history-variant"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["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"],[1,"border-bottom"],["target","_blank",3,"routerLink","queryParams"]],template:function(i,n){i&1&&_(0,km,25,11,"mainpanel-cmp",1),i&2&&p("ngIf",n.data)},dependencies:[J,V,ut,mt,F,Y,he,Mt,Le,Be,le,it,me]})};var zi=(r,e)=>{let t=h(U),i=h(wt),n=t[r.data.module],s=t;if(n){let{context:y}=r.data,T=y.includes("Edit"),tt=y.includes("Create"),bt=T&&n.Edit,xt=tt&&n.Create,yt=r.queryParamMap.has("ID");if(yt&&T&&!bt)return i.navigate(["menu/Unauthorized/Main/Unauthorized"]),!1;if(!yt&&tt&&!xt)return i.navigate(["menu/Unauthorized/Main/Unauthorized"]),!1}return!0};var jm=[{path:"Adjustment/Archive",component:Ln},{path:"Adjustment/Archive/Info",component:An},{path:"Adjustment/Archive/Form",component:$n,canActivate:[zi],data:{module:"adjustment",context:["Create","Edit"]}},{path:"Adjustment/Archive/Form/V2",component:Di,canActivate:[zi],data:{module:"adjustment",context:["Create","Edit"]}},{path:"Tools/Count_Product_Inventory",component:ri},{path:"Tools/Convert_Inventory_to_Parent_UOM",component:ii},{path:"Tools/Product_Sheet",component:oi},{path:"Report/Adjustment",component:Xn},{path:"History/Variant",component:Pi},{path:"Adjustment/Stock_Take_by_Web_Spreadsheet",component:ni},{path:"Adjustment/Stock_Take_by_CSV",component:ti},{path:"",redirectTo:"Adjustment/Archive",pathMatch:"full"}],wi=class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=Oe({type:r});static \u0275inj=Me({imports:[cn.forChild(jm),cn]})};var Po=class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=Oe({type:r});static \u0275inj=Me({imports:[ke,wi,Re,ce,wn,Sr,Pn,Zr,to,Mn,jt,Er,_r,Dr,jt,Kr,qr,Ti,br,Ue,sr,dr,jr,ar,oo,Ti,cr,no,ro,jn,We,Hr,Zn,Ce,Tn,En,qe]})};export{Po as AdjustmentModule};
|