dealpos 25.43.2 → 25.43.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/browser/{chunk-ZMOEZBOV.js → chunk-272PZZGG.js} +1 -1
- package/browser/{chunk-ZT3ATOCA.js → chunk-2EP24RI6.js} +1 -1
- package/browser/{chunk-KUN2P3RN.js → chunk-2PLXQ6DN.js} +1 -1
- package/browser/{chunk-N4FKAPLW.js → chunk-2RGZUU27.js} +1 -1
- package/browser/{chunk-4QQF4IJE.js → chunk-3RWAC4XP.js} +1 -1
- package/browser/{chunk-HKUGK6HF.js → chunk-3VT5D6VK.js} +1 -1
- package/browser/{chunk-NSXCBKM4.js → chunk-3Z2WREJH.js} +1 -1
- package/browser/{chunk-LDF4ZCJN.js → chunk-4DMEBTIA.js} +1 -1
- package/browser/{chunk-HMU3DWZJ.js → chunk-4V3WJ77K.js} +1 -1
- package/browser/{chunk-5EEOIYLP.js → chunk-5FDHNE6C.js} +1 -1
- package/browser/{chunk-KIQXPGXN.js → chunk-5H2362GA.js} +1 -1
- package/browser/{chunk-JEZGFXOM.js → chunk-5QQG3XAT.js} +1 -1
- package/browser/{chunk-SEXUIUP5.js → chunk-5YFCA5PL.js} +1 -1
- package/browser/{chunk-V73DMOF7.js → chunk-66K27OF2.js} +1 -1
- package/browser/{chunk-PGSKQYIL.js → chunk-6W6BB6FZ.js} +1 -1
- package/browser/{chunk-T4OMGJF4.js → chunk-75SMG4SF.js} +1 -1
- package/browser/{chunk-LAFPISY6.js → chunk-7HSR3LT6.js} +1 -1
- package/browser/{chunk-ITUXL4IU.js → chunk-7UXE6WII.js} +1 -1
- package/browser/{chunk-ROR3RTY5.js → chunk-A5ZLOGOJ.js} +2 -2
- package/browser/{chunk-6KPCTTDA.js → chunk-AGUT25WD.js} +1 -1
- package/browser/{chunk-AXLH4KKX.js → chunk-AROOOSPE.js} +2 -2
- package/browser/{chunk-7527AL7Q.js → chunk-AVQXAEMG.js} +1 -1
- package/browser/{chunk-BJ4ZY3VJ.js → chunk-B2ZLN3DU.js} +1 -1
- package/browser/{chunk-5YJ2OEBF.js → chunk-BLOA2A3C.js} +1 -1
- package/browser/{chunk-QSWKUXSH.js → chunk-C7XXRU25.js} +1 -1
- package/browser/{chunk-IFFXFKVP.js → chunk-CMKDM3YB.js} +6 -6
- package/browser/{chunk-R4CTK5NZ.js → chunk-CVI22GXH.js} +1 -1
- package/browser/{chunk-INZKDGM2.js → chunk-DLQL5GPU.js} +3 -3
- package/browser/{chunk-YEAPJ2OC.js → chunk-E72S2LHD.js} +1 -1
- package/browser/{chunk-QVTFZ7LA.js → chunk-EFKIYD2S.js} +1 -1
- package/browser/{chunk-X5OST3RI.js → chunk-EIHE3QN4.js} +1 -1
- package/browser/{chunk-VPFQM3LL.js → chunk-EP6KOZ4E.js} +1 -1
- package/browser/{chunk-PBEIFRAA.js → chunk-F3T2SC5Q.js} +1 -1
- package/browser/{chunk-2QU24F5P.js → chunk-F5XHOC4H.js} +1 -1
- package/browser/{chunk-EKDNW5AX.js → chunk-FBXL7ZXR.js} +1 -1
- package/browser/{chunk-CFSBMQ5D.js → chunk-FHJG45VQ.js} +2 -2
- package/browser/{chunk-K5KGHSAP.js → chunk-FMDB67TU.js} +1 -1
- package/browser/{chunk-3XR3MVQE.js → chunk-G2MU6LQ2.js} +1 -1
- package/browser/{chunk-O2QDJGKT.js → chunk-G7SZYW63.js} +1 -1
- package/browser/{chunk-ZEQ2QQEK.js → chunk-GFJYKJED.js} +1 -1
- package/browser/{chunk-HJVO2MYG.js → chunk-GSISS3SC.js} +1 -1
- package/browser/{chunk-HFYSK74N.js → chunk-HIYIS7P2.js} +1 -1
- package/browser/{chunk-DKDOVSVH.js → chunk-HZ2U3RGD.js} +1 -1
- package/browser/{chunk-ZZVT4VHZ.js → chunk-INQBV4VC.js} +1 -1
- package/browser/{chunk-MSBIWISH.js → chunk-IQBTWGJY.js} +1 -1
- package/browser/{chunk-FSXDAB7C.js → chunk-ITGJPMDT.js} +1 -1
- package/browser/{chunk-XTL4S3XK.js → chunk-J3IQVJI4.js} +1 -1
- package/browser/{chunk-MBA7MORK.js → chunk-JEAH4FYM.js} +1 -1
- package/browser/{chunk-EJDRY7MH.js → chunk-JGK2MYOQ.js} +1 -1
- package/browser/{chunk-A7FNJM6G.js → chunk-KA4TOHBS.js} +1 -1
- package/browser/{chunk-OB764IZP.js → chunk-M4F2UJHF.js} +1 -1
- package/browser/{chunk-AWSD3VOK.js → chunk-MDD6TFTM.js} +1 -1
- package/browser/{chunk-CSLHA6EL.js → chunk-MZPJH3AH.js} +1 -1
- package/browser/{chunk-6HXB7UO4.js → chunk-NISY7IAG.js} +3 -3
- package/browser/{chunk-6FSVJ3O6.js → chunk-NRWPQAB7.js} +1 -1
- package/browser/{chunk-SYQCAXOC.js → chunk-NUJC3NPK.js} +1 -1
- package/browser/{chunk-FXKRIVYT.js → chunk-NWXWPE73.js} +1 -1
- package/browser/{chunk-2HUEFC2T.js → chunk-O2OM4KZ4.js} +1 -1
- package/browser/{chunk-FYACJ2YI.js → chunk-O7K75UXY.js} +1 -1
- package/browser/{chunk-CODMBGPI.js → chunk-ONEB5DHN.js} +2 -2
- package/browser/{chunk-BPWQFTXE.js → chunk-PWJVQMES.js} +1 -1
- package/browser/{chunk-6EOWD655.js → chunk-PX65TDN3.js} +1 -1
- package/browser/{chunk-5YUUUZD3.js → chunk-R4KZHFTX.js} +1 -1
- package/browser/{chunk-B6STMZWX.js → chunk-RNH5CWRS.js} +1 -1
- package/browser/{chunk-BCMMSVJJ.js → chunk-S3ZJOM5T.js} +1 -1
- package/browser/{chunk-346EL5B3.js → chunk-SEGFXGKG.js} +1 -1
- package/browser/{chunk-FSTDHLYH.js → chunk-SH2AVVL5.js} +1 -1
- package/browser/{chunk-ACD7MZMQ.js → chunk-SYYCPGJV.js} +2 -2
- package/browser/{chunk-S4IKR42Q.js → chunk-TNHTZU3G.js} +1 -1
- package/browser/{chunk-RP455IK5.js → chunk-TS5DD7F4.js} +1 -1
- package/browser/{chunk-WEGDL4GR.js → chunk-UCJKQICE.js} +1 -1
- package/browser/{chunk-4RRARGON.js → chunk-UYLL2WJ3.js} +2 -2
- package/browser/{chunk-NUV6F5WN.js → chunk-VT2H5BYD.js} +1 -1
- package/browser/{chunk-ON5DTHAP.js → chunk-WDQOMZAV.js} +1 -1
- package/browser/{chunk-DK44EJTX.js → chunk-WZS6HHV3.js} +1 -1
- package/browser/{chunk-BJMIDKW4.js → chunk-XBC5WNSH.js} +1 -1
- package/browser/{chunk-KTD4OMXY.js → chunk-XRZ7VBID.js} +1 -1
- package/browser/{chunk-L7IGIQVH.js → chunk-XZJ645Q5.js} +2 -2
- package/browser/{chunk-6VOFZE3V.js → chunk-YFL7VFWC.js} +1 -1
- package/browser/{chunk-I7HV744J.js → chunk-YGCPZSCL.js} +1 -1
- package/browser/chunk-YGHO5ZLV.js +1 -0
- package/browser/{chunk-I3YPVX5L.js → chunk-YI4JLNCJ.js} +1 -1
- package/browser/{chunk-2LMF4IMC.js → chunk-YQLHHLTC.js} +1 -1
- package/browser/{chunk-CURYSM3Y.js → chunk-ZYI3XMBD.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-QGKQ75P4.js → main-SAUYF5DW.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-TE3WGV2Q.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as Qr,b as Hr}from"./chunk-YZHVQD5P.js";import{a as Br}from"./chunk-HKJLMHAD.js";import{a as qr}from"./chunk-PBEIFRAA.js";import{b as Wr}from"./chunk-5YRS6BWA.js";import{a as On}from"./chunk-U6TUYK6J.js";import{a as Mr,b as Er,c as Or,d as Ar,e as kr,f as jr}from"./chunk-4G344XSZ.js";import{a as Fr}from"./chunk-ZZYILM3B.js";import{a as Lr}from"./chunk-WEQFFBAF.js";import{a as Ur}from"./chunk-CM4CUWDT.js";import{a as Vr}from"./chunk-23PJKOTU.js";import{a as Rr}from"./chunk-Z2LCSWV4.js";import{a as Tr}from"./chunk-ALNSA73T.js";import{a as Nr}from"./chunk-NMR7EZWC.js";import{a as wr}from"./chunk-3CUWPIMQ.js";import{a as An}from"./chunk-DEBIFZGN.js";import"./chunk-7ENDP7TZ.js";import{a as Pn}from"./chunk-KIQXPGXN.js";import{a as Ht}from"./chunk-L7RHCBKX.js";import{a as Pr}from"./chunk-JLXCN2NR.js";import"./chunk-2YDEXJE5.js";import"./chunk-NQX7EX5A.js";import{a as br,b as Tn,c as Ir,e as wn,f as Mn,g as Dr}from"./chunk-6CWGCLY5.js";import"./chunk-EWZ63XSS.js";import{a as En}from"./chunk-P3KIIKY4.js";import{L as xr}from"./chunk-6HXB7UO4.js";import"./chunk-JFLT7NX3.js";import"./chunk-YXCPHYC5.js";import"./chunk-QUHI6RHC.js";import{e as Sr}from"./chunk-FIHWJAIR.js";import"./chunk-W3VF2RCW.js";import"./chunk-OKIBXXRJ.js";import"./chunk-PD445FIT.js";import"./chunk-SRRURHLT.js";import"./chunk-SGFSKIUE.js";import"./chunk-5M3JINH2.js";import"./chunk-C2KD7R6L.js";import"./chunk-PF33HK6M.js";import{a as Zi}from"./chunk-YNDNTAII.js";import"./chunk-4SKJU2FQ.js";import{b as vr}from"./chunk-RFO7MTFT.js";import"./chunk-4PPRFE5H.js";import{b as Si}from"./chunk-O2QTP22K.js";import{a as Vo,b as Gt}from"./chunk-YRGGDRUH.js";import"./chunk-5UDUWK67.js";import{a as Wt,b as Ct}from"./chunk-OISKO6QJ.js";import"./chunk-M3HHWYKD.js";import"./chunk-J6U6UYNI.js";import"./chunk-AEHOR4RJ.js";import"./chunk-Z3E24JZW.js";import"./chunk-BYXBJQAS.js";import"./chunk-7IDMO3VZ.js";import"./chunk-NQKVYQ6V.js";import"./chunk-HT35KHLT.js";import"./chunk-DAIHPIA2.js";import{a as yr}from"./chunk-BXQFYW4R.js";import{g as hr}from"./chunk-4UYZJCFI.js";import"./chunk-BYXBJQAS.js";import{c as nr,d as ir,e as rr}from"./chunk-RHUDY63D.js";import"./chunk-Z65FTA7V.js";import"./chunk-HOM424UE.js";import"./chunk-IAZFUBFX.js";import"./chunk-6774R2EL.js";import{a as qt}from"./chunk-MPSML3FA.js";import{a as Gr}from"./chunk-C6DVD3VG.js";import{c as Cr}from"./chunk-BCMMSVJJ.js";import"./chunk-L7YSVT7G.js";import"./chunk-RX7JS4CO.js";import{a as gr,d as Bt,e as fr}from"./chunk-GIDGCFLX.js";import"./chunk-XBRBYCWJ.js";import"./chunk-3RK6DDJD.js";import{a as tr}from"./chunk-FP4HFB5J.js";import{q as er}from"./chunk-H3OZSV6V.js";import"./chunk-YEDKRNXU.js";import{d as Yi}from"./chunk-VZEPVRCY.js";import"./chunk-7QWJJPNG.js";import{d as Dn,e as ur}from"./chunk-6647Y35T.js";import"./chunk-VHAM2DWK.js";import{a as dr}from"./chunk-JPXXXD26.js";import{a as cr}from"./chunk-WO3LDDSF.js";import{a as Nt,b as Ft,c as Xi}from"./chunk-VQBXUZ6U.js";import{a as Ge,b as _r}from"./chunk-BBGWXLHJ.js";import{f as qe}from"./chunk-3XR3MVQE.js";import{c as Qt}from"./chunk-PGSKQYIL.js";import{a as pr,b as Le}from"./chunk-QHBWVJIQ.js";import{a as Ce}from"./chunk-MSBIWISH.js";import"./chunk-T4OMGJF4.js";import"./chunk-6JAL37Y4.js";import"./chunk-4QQTEPQT.js";import{a as ke}from"./chunk-XZR3IMWZ.js";import{e as ae,f as In}from"./chunk-QVTFZ7LA.js";import"./chunk-FSXDAB7C.js";import"./chunk-5JJSLRVS.js";import{c as or}from"./chunk-B6LPY2IZ.js";import"./chunk-CWITQVZH.js";import"./chunk-QHRP323Q.js";import"./chunk-WDQ4UKKY.js";import{d as ar,f as lr,h as sr}from"./chunk-MFCXEITE.js";import{a as Ut,c as Ue}from"./chunk-MUJ6277G.js";import"./chunk-LMJVRREP.js";import"./chunk-3LBZDIW2.js";import"./chunk-KTCV3KOE.js";import"./chunk-KZDE63UL.js";import"./chunk-EJDRY7MH.js";import{a as xn,b as oe}from"./chunk-DK44EJTX.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import{F as We,G as Rt,u as ye,v as ve,w as ue}from"./chunk-H7F34T25.js";import{b as jt,c as Sn}from"./chunk-JOXTERIM.js";import{N as bn,O as Te,g as Lt}from"./chunk-TSIYPTYI.js";import{a as mr,d as ce}from"./chunk-XYB3YDKL.js";import"./chunk-7VKFVS7K.js";import"./chunk-ZVDY66SR.js";import{a as vn,b as Pe,e as he,f as ft,g as X}from"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import"./chunk-VFTGIP5A.js";import"./chunk-LE3BKIDY.js";import{a as ee}from"./chunk-2FWFPV5I.js";import"./chunk-EEEAUYZ6.js";import{E as Vt,F as _t,G as gt,b as zi,c as Ae,h as q,i as Ot,l as ut,o as re,r as Ki,s as $i,t as At,w as kt}from"./chunk-RVXZOIFQ.js";import{a as Gi}from"./chunk-FSTDHLYH.js";import{a as Ji}from"./chunk-WEGDL4GR.js";import{a as E,c as vi,d as L}from"./chunk-ZZGSAFGO.js";import"./chunk-346EL5B3.js";import{$a as l,$b as wt,Ac as w,Ba as _e,Bc as j,Db as J,E as me,Eb as yt,Fa as fn,Fb as yi,Fc as Q,Ga as Cn,Gb as Ee,Hb as Oe,I as pt,Ib as o,Jb as a,K as Fi,Kb as f,Kc as Hi,Lb as F,Ma as z,Mb as U,Ob as y,Od as dt,Pc as ct,Q as _n,Qb as g,Qc as Wi,Qd as Fe,Rb as c,Rd as de,Td as ln,Va as K,Vb as at,Vd as fe,Wa as It,Wc as Ne,Y as gn,Yc as ie,Yd as A,Za as Be,Zb as Pt,Zc as B,_b as Tt,aa as Y,cb as Li,cd as Et,d as we,da as Ie,db as b,dc as $,ec as s,ed as He,fa as R,fc as S,gc as I,gd as W,hc as vt,ic as Bi,ja as H,jc as T,jd as ge,k as cn,ka as bt,kb as M,kc as D,lb as Dt,lc as P,ma as Ui,md as qi,na as C,o as dn,ob as pe,p as un,qb as _,qc as ne,rc as V,sc as Mt,sd as hn,t as Me,u as Ni,va as d,vb as p,wa as u,wb as Ri,wd as yn,xb as ot,yb as Qi,zb as De,zc as v}from"./chunk-UXRO4UFY.js";import{a as O,b as N,g as hi,j as pn}from"./chunk-7DCB7DB2.js";var xi=(e=>(e[e.AdjustDifferences=1]="AdjustDifferences",e[e.CountQuantity=2]="CountQuantity",e))(xi||{});var bi=(n=>(n[n.Draft=1]="Draft",n[n.Pending=2]="Pending",n[n.Rejected=3]="Rejected",n[n.Accepted=4]="Accepted",n))(bi||{});var $r=()=>["/menu/Adjustment/Adjustment/Archive/Form"],Kt=i=>({ID:i}),Jr=()=>["/print/Adjustment"],jn=(i,t)=>({"text-success":i,"text-danger":t}),jo=(i,t)=>({"text-danger":i,"text-success":t});function No(i,t){if(i&1){let e=y();o(0,"div",7)(1,"button",25),g("click",function(){d(e);let n=c(2);return u(n.reject())}),f(2,"i",26),s(3,"Reject"),a(),o(4,"button",25),g("click",function(){d(e);let n=c(2);return u(n.accept())}),f(5,"i",27),s(6,"Accept "),a()()}}function Fo(i,t){if(i&1&&(o(0,"a",28),f(1,"i",29),s(2,"Resume "),a()),i&2){let e=c(3);p("routerLink",ne(2,$r))("queryParams",V(3,Kt,e.data.ID))}}function Uo(i,t){if(i&1){let e=y();o(0,"button",25),g("click",function(){d(e);let n=c(3);return u(n.onSubmit())}),f(1,"i",30),s(2,"Submit "),a()}}function Lo(i,t){if(i&1&&_(0,Fo,3,5,"a",28)(1,Uo,3,0,"button",8),i&2){let e=c(2);J(e.data.Adjustment.StateID==e.adjustmentState.Draft?0:-1),l(),J(e.data.Adjustment.StateID==e.adjustmentState.Draft?1:-1)}}function Ro(i,t){if(i&1&&(o(0,"a",28),f(1,"i",29),s(2,"Edit "),a()),i&2){let e=c(3);p("routerLink",ne(2,$r))("queryParams",V(3,Kt,e.data.ID))}}function Qo(i,t){if(i&1&&_(0,Ro,3,5,"a",28),i&2){let e=c(2);J(e.data.Adjustment.TypeID==e.adjustmentType.AdjustDifferences&&(e.data.Adjustment.StateID==e.adjustmentState.Pending||e.data.Adjustment.StateID==e.adjustmentState.Accepted)?0:-1)}}function Bo(i,t){if(i&1){let e=y();o(0,"button",25),g("click",function(){d(e);let n=c(2);return u(n.delete())}),f(1,"i",31),s(2,"Delete "),a()}}function Ho(i,t){if(i&1&&(o(0,"tr")(1,"th"),s(2,"Journal Link"),a(),o(3,"td"),s(4,":"),a(),o(5,"td")(6,"a",32),s(7,"View Journal"),a()()()),i&2){let e=c(2);l(6),at("href","https://accounting.dealpos.app/pages/journal-entry;TransID=",e.data.ID,"",It)}}function Wo(i,t){i&1&&(o(0,"div",38),f(1,"div",40),a())}function qo(i,t){if(i&1&&(o(0,"div",10)(1,"div",34)(2,"h4"),s(3),v(4,"date"),a(),o(5,"p",35),s(6),v(7,"date"),a()(),o(8,"div",36),f(9,"i",37),_(10,Wo,2,0,"div",38),a(),o(11,"div",39)(12,"h4"),s(13),a(),o(14,"p",35),s(15),a()()()),i&2){let e=c(),r=e.$implicit,n=e.$index,m=c(2);l(3),S(j(4,7,r.Date,"dd MMM yyyy")),l(3),S(j(7,10,r.Date,"HH:mm a")),l(3),Ri("color",n==0?"blue":"black"),l(),J(n!=m.data.StatusProcess.length-1?10:-1),l(3),S(r.Status),l(2),S(r.Creator)}}function Go(i,t){if(i&1&&_(0,qo,16,13,"div",33),i&2){let e=t.$implicit;p("ngIf",e.Date)}}function zo(i,t){if(i&1){let e=y();o(0,"a",60),g("click",function(){d(e);let n=c(3);return u(n.exportCSV(n.csvConverter,n.adjustmentTypeStatus!==-1&&n.adjustmentTypeStatus===1?"Adjustment/AdjustmentInfoExport":"Adjustment/AdjustmentCountedExport","Adjustment#"+n.data.Adjustment.Number+".csv"))}),f(1,"i",61),s(2,"Export"),a()}}function Ko(i,t){i&1&&(F(0),o(1,"th",62),s(2,"Qty"),a(),U())}function $o(i,t){i&1&&(F(0),o(1,"th",62),s(2,"Counted"),a(),o(3,"th",62),s(4,"Expected"),a(),U())}function Jo(i,t){i&1&&(o(0,"th",62),s(1,"Expected"),a(),o(2,"th",62),s(3,"Counted"),a())}function Zo(i,t){if(i&1&&(_(0,$o,5,0,"ng-container",52)(1,Jo,4,0,"ng-template",null,3,Q),o(3,"th",62),s(4,"Difference"),a()),i&2){let e=$(2),r=c(3);p("ngIf",r.data.Adjustment.TypeID===2&&(r.data.Adjustment.StateID===1||r.data.Adjustment.StateID===2))("ngIfElse",e)}}function Xo(i,t){i&1&&(o(0,"th",63),s(1," Cost "),a())}function Yo(i,t){i&1&&(o(0,"th",63),s(1," Price "),a())}function ea(i,t){if(i&1&&(F(0),f(1,"p",68),U()),i&2){let e=c().$implicit;l(),p("innerHTML",e.Note,K)}}function ta(i,t){if(i&1&&(F(0),o(1,"td",69),s(2),a(),U()),i&2){let e=c().$implicit;l(),De(Mt(3,jn,e.Quantity>0,e.Quantity<0)),l(),I(" ",e.Quantity," ")}}function na(i,t){if(i&1&&(F(0),o(1,"td",69),s(2),a(),o(3,"td",69),s(4),a(),U()),i&2){let e=c(2).$implicit;l(2),I(" ",e.Counted," "),l(2),I(" ",e.Expected," ")}}function ia(i,t){if(i&1&&(o(0,"td",69),s(1),a(),o(2,"td",69),s(3),a()),i&2){let e=c(2).$implicit;l(),I(" ",e.Expected," "),l(2),I(" ",e.Counted," ")}}function ra(i,t){if(i&1&&(_(0,na,5,2,"ng-container",52)(1,ia,4,2,"ng-template",null,3,Q),o(3,"td",69),s(4),v(5,"number"),a()),i&2){let e=$(2),r=c().$implicit,n=c(3);p("ngIf",n.data.Adjustment.TypeID===2&&(n.data.Adjustment.StateID===1||n.data.Adjustment.StateID===2))("ngIfElse",e),l(3),De(Mt(7,jo,r.Expected>r.Counted,r.Expected<r.Counted)),l(),I(" ",w(5,5,r.Difference)," ")}}function oa(i,t){if(i&1&&(f(0,"td",70),v(1,"number")),i&2){let e=c().$implicit;p("innerHTML",w(1,1,e.UnitCost),K)}}function aa(i,t){if(i&1&&(f(0,"td",70),v(1,"number")),i&2){let e=c().$implicit;p("innerHTML",w(1,1,e.UnitPrice),K)}}function la(i,t){if(i&1&&(o(0,"tr"),f(1,"td",64),o(2,"td")(3,"a",65),s(4),a(),o(5,"div"),s(6),a(),f(7,"app-serial-note",66),_(8,ea,2,1,"ng-container",21),a(),_(9,ta,3,6,"ng-container",52)(10,ra,6,10,"ng-template",null,4,Q)(12,oa,2,3,"td",67)(13,aa,2,3,"td",67),a()),i&2){let e=t.$implicit,r=t.index,n=$(11),m=c(3);l(),p("innerHTML",r+1+".",K),l(2),p("queryParams",V(10,Kt,e.VariantID)),l(),S(e.Name),l(2),S(e.Code),l(),p("serials",e.Serial),l(),p("ngIf",e.Note!=null),l(),p("ngIf",m.data.Adjustment.TypeID==m.adjustmentType.AdjustDifferences||m.data.Adjustment.StateID==m.adjustmentState.Accepted&&m.data.Adjustment.TypeID==m.adjustmentType.CountQuantity)("ngIfElse",n),l(3),p("ngIf",m.roleService.product.Cost),l(),p("ngIf",m.roleService.sell.PriceVisible)}}function sa(i,t){if(i&1&&(o(0,"b"),v(1,"sum"),v(2,"sum"),s(3),v(4,"sum"),v(5,"number"),a()),i&2){let e=c(3);De(Mt(14,jn,j(1,3,e.data.DifferencesArray,"Quantity")>0,j(2,6,e.data.DifferencesArray,"Quantity")<0)),l(3),S(w(5,12,j(4,9,e.data.DifferencesArray,"Quantity")))}}function ma(i,t){if(i&1&&(o(0,"b",71),v(1,"sum"),v(2,"sum"),s(3),v(4,"sum"),v(5,"number"),a()),i&2){let e=c(3);p("ngClass",Mt(13,jn,j(1,2,e.data.DifferencesArray,"Difference")>0,j(2,5,e.data.DifferencesArray,"Difference")<0)),l(3),I(" ",w(5,11,j(4,8,e.data.DifferencesArray,"Difference"))," ")}}function pa(i,t){if(i&1&&(o(0,"td",72)(1,"b"),s(2),v(3,"sum"),v(4,"number"),a()()),i&2){let e=c(3);l(2),S(w(4,4,j(3,1,e.data.DifferencesArray,"TotalCost")))}}function ca(i,t){if(i&1&&(o(0,"td",73)(1,"b"),s(2),v(3,"sum"),v(4,"number"),a()()),i&2){let e=c(3);l(2),S(w(4,4,j(3,1,e.data.DifferencesArray,"TotalPrice")))}}function da(i,t){if(i&1&&(o(0,"div",12)(1,"div",41)(2,"div")(3,"h2"),s(4),o(5,"small",42),s(6),a()()(),o(7,"div",43)(8,"a",44),f(9,"i",45),s(10,"Print "),a(),_(11,zo,3,0,"a",46),a()(),o(12,"div",18)(13,"div",47)(14,"table",48)(15,"thead",49)(16,"tr")(17,"th",50),s(18,"No"),a(),o(19,"th",51),s(20,"Name"),a(),_(21,Ko,3,0,"ng-container",52)(22,Zo,5,2,"ng-template",null,1,Q)(24,Xo,2,0,"th",53)(25,Yo,2,0,"th",53),a()(),o(26,"tbody"),_(27,la,14,12,"tr",54),a(),o(28,"tfoot")(29,"tr")(30,"td",55)(31,"b"),s(32,"Total :"),a()(),o(33,"td",56),_(34,sa,6,17,"b",57)(35,ma,6,16,"ng-template",null,2,Q),a(),_(37,pa,5,6,"td",58)(38,ca,5,6,"td",59),a()()()()()()),i&2){let e=$(23),r=$(36),n=c(2);l(4),I(" ",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity?"Adjusted":"Counted"," Inventory"),l(2),I(" (",n.data.DifferencesArray.length," SKU)"),l(2),p("routerLink",ne(15,Jr))("queryParams",V(16,Kt,n.paramId)),l(3),p("ngIf",n.roleService.global.Export),l(10),p("ngIf",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity)("ngIfElse",e),l(3),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.sell.PriceVisible),l(2),p("ngForOf",n.data.DifferencesArray),l(3),p("colSpan",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity?2:4),l(4),p("ngIf",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity)("ngIfElse",r),l(3),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.sell.PriceVisible)}}function ua(i,t){if(i&1&&(o(0,"h2"),s(1," Counted Inventory "),o(2,"small",42),s(3),a()()),i&2){let e=c(3);l(3),I("(",e.data.CountedArray.length," SKU)")}}function _a(i,t){if(i&1){let e=y();o(0,"a",60),g("click",function(){d(e);let n=c(3);return u(n.exportCSV(n.csvConverter,"Adjustment/AdjustmentCountedExport","Adjustment_Counted#"+n.data.Adjustment.Number+".csv"))}),f(1,"i",61),s(2,"Export"),a()}}function ga(i,t){if(i&1&&(o(0,"tr"),f(1,"td",64),o(2,"td")(3,"a",65),s(4),a(),o(5,"div"),s(6),a()(),o(7,"td",69),s(8),a(),o(9,"td",69),s(10),a(),o(11,"td",69),s(12),a()()),i&2){let e=t.$implicit,r=t.index;l(),p("innerHTML",r+1+".",K),l(2),p("queryParams",V(9,Kt,e.VariantID)),l(),S(e.Name),l(2),S(e.Code),l(2),S(e.Counted),l(2),S(e.Expected),l(),De(Mt(11,jn,e.Difference>0,e.Difference<0)),l(),I(" ",e.Difference," ")}}function fa(i,t){if(i&1&&(o(0,"div",12)(1,"div",41)(2,"div"),_(3,ua,4,1,"h2",21),a(),o(4,"div",43)(5,"a",44),f(6,"i",45),s(7,"Print "),a(),_(8,_a,3,0,"a",46),a()(),o(9,"div",18)(10,"div",47)(11,"table",48)(12,"thead",49)(13,"tr")(14,"th",50),s(15,"No"),a(),o(16,"th",51),s(17,"Name"),a(),o(18,"th",74),s(19,"Counted"),a(),o(20,"th",74),s(21,"Expected"),a(),o(22,"th",74),s(23,"Difference"),a()()(),o(24,"tbody"),_(25,ga,13,14,"tr",54),a()()()()()),i&2){let e=c(2);l(3),p("ngIf",e.data.CountedArray.length>0&&e.data.Adjustment.TypeID==e.adjustmentState.Pending),l(2),p("routerLink",ne(5,Jr))("queryParams",V(6,Kt,e.paramId)),l(3),p("ngIf",e.roleService.global.Export),l(17),p("ngForOf",e.data.CountedArray)}}function Ca(i,t){if(i&1&&(o(0,"mainpanel-cmp",6)(1,"actions"),_(2,No,7,0,"div",7),o(3,"div",7),_(4,Lo,2,2)(5,Qo,1,1)(6,Bo,3,0,"button",8),a()(),o(7,"content")(8,"div",9)(9,"div",10)(10,"div",11)(11,"div",12)(12,"div",13)(13,"div",14),f(14,"h2",15,0),o(16,"div",16),f(17,"i",17),o(18,"span"),s(19),a()()()(),o(20,"div",18)(21,"table",19)(22,"tr")(23,"th"),s(24,"Date"),a(),o(25,"td"),s(26,":"),a(),f(27,"td",20),a(),o(28,"tr")(29,"th"),s(30,"PIC"),a(),o(31,"td"),s(32,":"),a(),f(33,"td",20),a(),o(34,"tr")(35,"th"),s(36,"Type"),a(),o(37,"td"),s(38,":"),a(),f(39,"td",20),a(),o(40,"tr")(41,"th"),s(42,"Note"),a(),o(43,"td"),s(44,":"),a(),f(45,"td",20),a(),_(46,Ho,8,2,"tr",21),o(47,"tr")(48,"th"),s(49,"Tag"),a(),o(50,"td"),s(51,":"),a(),f(52,"td",20),a()()()(),o(53,"div")(54,"div",12)(55,"div",13)(56,"h2"),s(57,"Status"),a()(),o(58,"div",18),Ee(59,Go,1,1,"div",10,yt),a()()()(),o(61,"div",22),_(62,da,39,18,"div",23)(63,fa,26,8,"div",23),a()(),f(64,"pos-footer-alert",24),a()()()),i&2){let e=$(15),r=c();p("pageData",r.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),J(r.hasAccRejButton?2:-1),l(2),J(r.roleService.adjustment.Create?4:-1),l(),J(r.roleService.adjustment.Edit?5:-1),l(),J(r.roleService.adjustment.Delete?6:-1),l(8),p("matTooltip",e.classList.contains("text-truncate")?r.data.Adjustment.OutletName:"")("innerHTML",r.data.Adjustment.OutletName,K),l(2),p("ngClass",r.determineStatusClasses),l(),p("ngClass",r.getStatusIconClasses),l(2),S((r.data.Adjustment==null?null:r.data.Adjustment.StateLabel)||""),l(8),p("innerHTML",r.data.Adjustment.Date,K),l(6),p("innerHTML",r.data.Adjustment.PIC,K),l(6),p("innerHTML",r.data.Adjustment.TypeLabel,K),l(6),p("innerHTML",r.data.Adjustment.Note,K),l(),p("ngIf",r.data.AppsAccoutingActive&&r.roleService.accounting.View),l(6),p("innerHTML",r.data.Adjustment.TagName,K),l(7),Oe(r.data.StatusProcess),l(3),p("ngIf",r.data.DifferencesArray.length>0),l(),p("ngIf",(r.data.CountedArray==null?null:r.data.CountedArray.length)>0&&r.data.Adjustment.TypeID==r.adjustmentState.Pending),l(),p("created",r.data.CreatedInfo.Created)("modified",r.data.CreatedInfo.Modified)}}var kn=class i extends Ce{constructor(e,r,n,m,h,x,le,te){super(e,r,"Adjustment/AuditInventoryAdjustmentInfo",null,null,m);this.httpService=r;this.toastr=n;this.csvConverter=h;this.router=x;this.roleService=le;this.dialog=te;this.initQueryParam()}paramId;hasAccRejButton=!1;isEditable=!1;adjustmentType=xi;adjustmentState=bi;preGetList(){let e=this.route.snapshot.queryParams;this.pageData.Filter=e}initQueryParam(){let e=this.route.snapshot.queryParams;this.paramId=e.ID}postInit(e){this.menuData.H=e.PageTitle,e.Adjustment.StateID==2&&this.roleService.adjustment.Approval&&e.Config.WithApproval?this.hasAccRejButton=!0:this.hasAccRejButton=!1,(this.data.Adjustment.StateID==1||this.data.Adjustment.StateID==2)&&(this.isEditable=!0)}exportCSV(e,r,n){this.httpService.get(`/api/${r}`,[{key:"ID",value:this.paramId}]).subscribe(m=>{e.convertToCSV(m,n)})}reject(){if(!confirm("Are you sure you want to reject this?"))return;let e={ID:this.data.Adjustment.ID};this.httpService.post("/API/Adjustment/RejectCountedItem",e).subscribe({next:r=>{this.toastr.success("Success reject adjustment",ee.Success),this.hasAccRejButton=!1,this.isEditable=!1,this.getListData()}})}accept(){if(!confirm("Are you sure you want to accept this?"))return;let e={ID:this.data.Adjustment.ID};this.httpService.post("/API/Adjustment/AcceptCountedItem",e).subscribe({next:r=>{this.toastr.success("Success accept adjustment",ee.Success),this.hasAccRejButton=!1,this.isEditable=!1,this.getListData()}})}delete(){confirm("Are you sure you want to delete this?")&&this.httpService.delete("/api/Adjustment/DeleteInventoryAdjustmentInfo",{params:[{key:"ID",value:this.data.Adjustment.ID}]}).subscribe(()=>{this.toastr.success("Success delete record.",ee.Success),this.router.navigate(["/menu/Adjustment/Adjustment/Archive"])})}get determineStatusClasses(){let e=this.data?.Adjustment?.StateLabel;return e?{"bg-draft":e.includes("Draft"),"bg-in-review":e.includes("Pending"),"bg-rejected":e.includes("Rejected"),"bg-accepted":e.includes("Accepted")}:{"bg-draft":!1,"bg-in-review":!1,"bg-rejected":!1,"bg-accepted":!1}}get getStatusIconClasses(){let e=this.data?.Adjustment?.StateLabel;return e?{"fa-check":e.includes("Accepted"),"fa-bookmark":e.includes("Draft"),"fa-hourglass-start":e.includes("Pending"),"fa-xmark":e.includes("Rejected")}:{"fa-check":!1,"fa-bookmark":!1,"fa-hourglass-start":!1,"fa-xmark":!1}}onSubmit(){this.dialog.open(Ur,{data:{title:"Submit Review",message:`
|
|
1
|
+
import{a as Qr,b as Hr}from"./chunk-YZHVQD5P.js";import{a as Br}from"./chunk-HKJLMHAD.js";import{a as qr}from"./chunk-F3T2SC5Q.js";import{b as Wr}from"./chunk-5YRS6BWA.js";import{a as On}from"./chunk-U6TUYK6J.js";import{a as Mr,b as Er,c as Or,d as Ar,e as kr,f as jr}from"./chunk-4G344XSZ.js";import{a as Fr}from"./chunk-ZZYILM3B.js";import{a as Lr}from"./chunk-WEQFFBAF.js";import{a as Ur}from"./chunk-CM4CUWDT.js";import{a as Vr}from"./chunk-23PJKOTU.js";import{a as Rr}from"./chunk-Z2LCSWV4.js";import{a as Tr}from"./chunk-ALNSA73T.js";import{a as Nr}from"./chunk-NMR7EZWC.js";import{a as wr}from"./chunk-3CUWPIMQ.js";import{a as An}from"./chunk-DEBIFZGN.js";import"./chunk-7ENDP7TZ.js";import{a as Pn}from"./chunk-5H2362GA.js";import{a as Ht}from"./chunk-L7RHCBKX.js";import{a as Pr}from"./chunk-JLXCN2NR.js";import"./chunk-2YDEXJE5.js";import"./chunk-NQX7EX5A.js";import{a as br,b as Tn,c as Ir,e as wn,f as Mn,g as Dr}from"./chunk-6CWGCLY5.js";import"./chunk-EWZ63XSS.js";import{a as En}from"./chunk-P3KIIKY4.js";import{L as xr}from"./chunk-NISY7IAG.js";import"./chunk-JFLT7NX3.js";import"./chunk-YXCPHYC5.js";import"./chunk-QUHI6RHC.js";import{e as Sr}from"./chunk-FIHWJAIR.js";import"./chunk-W3VF2RCW.js";import"./chunk-OKIBXXRJ.js";import"./chunk-PD445FIT.js";import"./chunk-SRRURHLT.js";import"./chunk-SGFSKIUE.js";import"./chunk-5M3JINH2.js";import"./chunk-C2KD7R6L.js";import"./chunk-PF33HK6M.js";import{a as Zi}from"./chunk-YNDNTAII.js";import"./chunk-4SKJU2FQ.js";import{b as vr}from"./chunk-RFO7MTFT.js";import"./chunk-4PPRFE5H.js";import{b as Si}from"./chunk-O2QTP22K.js";import{a as Vo,b as Gt}from"./chunk-YRGGDRUH.js";import"./chunk-5UDUWK67.js";import{a as Wt,b as Ct}from"./chunk-OISKO6QJ.js";import"./chunk-M3HHWYKD.js";import"./chunk-J6U6UYNI.js";import"./chunk-AEHOR4RJ.js";import"./chunk-Z3E24JZW.js";import"./chunk-BYXBJQAS.js";import"./chunk-7IDMO3VZ.js";import"./chunk-NQKVYQ6V.js";import"./chunk-HT35KHLT.js";import"./chunk-DAIHPIA2.js";import{a as yr}from"./chunk-BXQFYW4R.js";import{g as hr}from"./chunk-4UYZJCFI.js";import"./chunk-BYXBJQAS.js";import{c as nr,d as ir,e as rr}from"./chunk-RHUDY63D.js";import"./chunk-Z65FTA7V.js";import"./chunk-HOM424UE.js";import"./chunk-IAZFUBFX.js";import"./chunk-6774R2EL.js";import{a as qt}from"./chunk-MPSML3FA.js";import{a as Gr}from"./chunk-C6DVD3VG.js";import{c as Cr}from"./chunk-S3ZJOM5T.js";import"./chunk-L7YSVT7G.js";import"./chunk-RX7JS4CO.js";import{a as gr,d as Bt,e as fr}from"./chunk-GIDGCFLX.js";import"./chunk-XBRBYCWJ.js";import"./chunk-3RK6DDJD.js";import{a as tr}from"./chunk-FP4HFB5J.js";import{q as er}from"./chunk-H3OZSV6V.js";import"./chunk-YEDKRNXU.js";import{d as Yi}from"./chunk-VZEPVRCY.js";import"./chunk-7QWJJPNG.js";import{d as Dn,e as ur}from"./chunk-6647Y35T.js";import"./chunk-VHAM2DWK.js";import{a as dr}from"./chunk-JPXXXD26.js";import{a as cr}from"./chunk-WO3LDDSF.js";import{a as Nt,b as Ft,c as Xi}from"./chunk-VQBXUZ6U.js";import{a as Ge,b as _r}from"./chunk-BBGWXLHJ.js";import{f as qe}from"./chunk-G2MU6LQ2.js";import{c as Qt}from"./chunk-6W6BB6FZ.js";import{a as pr,b as Le}from"./chunk-QHBWVJIQ.js";import{a as Ce}from"./chunk-IQBTWGJY.js";import"./chunk-75SMG4SF.js";import"./chunk-6JAL37Y4.js";import"./chunk-4QQTEPQT.js";import{a as ke}from"./chunk-XZR3IMWZ.js";import{e as ae,f as In}from"./chunk-EFKIYD2S.js";import"./chunk-ITGJPMDT.js";import"./chunk-5JJSLRVS.js";import{c as or}from"./chunk-B6LPY2IZ.js";import"./chunk-CWITQVZH.js";import"./chunk-QHRP323Q.js";import"./chunk-WDQ4UKKY.js";import{d as ar,f as lr,h as sr}from"./chunk-MFCXEITE.js";import{a as Ut,c as Ue}from"./chunk-MUJ6277G.js";import"./chunk-LMJVRREP.js";import"./chunk-3LBZDIW2.js";import"./chunk-KTCV3KOE.js";import"./chunk-KZDE63UL.js";import"./chunk-JGK2MYOQ.js";import{a as xn,b as oe}from"./chunk-WZS6HHV3.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import{F as We,G as Rt,u as ye,v as ve,w as ue}from"./chunk-H7F34T25.js";import{b as jt,c as Sn}from"./chunk-JOXTERIM.js";import{N as bn,O as Te,g as Lt}from"./chunk-TSIYPTYI.js";import{a as mr,d as ce}from"./chunk-XYB3YDKL.js";import"./chunk-7VKFVS7K.js";import"./chunk-ZVDY66SR.js";import{a as vn,b as Pe,e as he,f as ft,g as X}from"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import"./chunk-VFTGIP5A.js";import"./chunk-LE3BKIDY.js";import{a as ee}from"./chunk-2FWFPV5I.js";import"./chunk-EEEAUYZ6.js";import{E as Vt,F as _t,G as gt,b as zi,c as Ae,h as q,i as Ot,l as ut,o as re,r as Ki,s as $i,t as At,w as kt}from"./chunk-RVXZOIFQ.js";import{a as Gi}from"./chunk-SH2AVVL5.js";import{a as Ji}from"./chunk-UCJKQICE.js";import{a as E,c as vi,d as L}from"./chunk-ZZGSAFGO.js";import"./chunk-SEGFXGKG.js";import{$a as l,$b as wt,Ac as w,Ba as _e,Bc as j,Db as J,E as me,Eb as yt,Fa as fn,Fb as yi,Fc as Q,Ga as Cn,Gb as Ee,Hb as Oe,I as pt,Ib as o,Jb as a,K as Fi,Kb as f,Kc as Hi,Lb as F,Ma as z,Mb as U,Ob as y,Od as dt,Pc as ct,Q as _n,Qb as g,Qc as Wi,Qd as Fe,Rb as c,Rd as de,Td as ln,Va as K,Vb as at,Vd as fe,Wa as It,Wc as Ne,Y as gn,Yc as ie,Yd as A,Za as Be,Zb as Pt,Zc as B,_b as Tt,aa as Y,cb as Li,cd as Et,d as we,da as Ie,db as b,dc as $,ec as s,ed as He,fa as R,fc as S,gc as I,gd as W,hc as vt,ic as Bi,ja as H,jc as T,jd as ge,k as cn,ka as bt,kb as M,kc as D,lb as Dt,lc as P,ma as Ui,md as qi,na as C,o as dn,ob as pe,p as un,qb as _,qc as ne,rc as V,sc as Mt,sd as hn,t as Me,u as Ni,va as d,vb as p,wa as u,wb as Ri,wd as yn,xb as ot,yb as Qi,zb as De,zc as v}from"./chunk-UXRO4UFY.js";import{a as O,b as N,g as hi,j as pn}from"./chunk-7DCB7DB2.js";var xi=(e=>(e[e.AdjustDifferences=1]="AdjustDifferences",e[e.CountQuantity=2]="CountQuantity",e))(xi||{});var bi=(n=>(n[n.Draft=1]="Draft",n[n.Pending=2]="Pending",n[n.Rejected=3]="Rejected",n[n.Accepted=4]="Accepted",n))(bi||{});var $r=()=>["/menu/Adjustment/Adjustment/Archive/Form"],Kt=i=>({ID:i}),Jr=()=>["/print/Adjustment"],jn=(i,t)=>({"text-success":i,"text-danger":t}),jo=(i,t)=>({"text-danger":i,"text-success":t});function No(i,t){if(i&1){let e=y();o(0,"div",7)(1,"button",25),g("click",function(){d(e);let n=c(2);return u(n.reject())}),f(2,"i",26),s(3,"Reject"),a(),o(4,"button",25),g("click",function(){d(e);let n=c(2);return u(n.accept())}),f(5,"i",27),s(6,"Accept "),a()()}}function Fo(i,t){if(i&1&&(o(0,"a",28),f(1,"i",29),s(2,"Resume "),a()),i&2){let e=c(3);p("routerLink",ne(2,$r))("queryParams",V(3,Kt,e.data.ID))}}function Uo(i,t){if(i&1){let e=y();o(0,"button",25),g("click",function(){d(e);let n=c(3);return u(n.onSubmit())}),f(1,"i",30),s(2,"Submit "),a()}}function Lo(i,t){if(i&1&&_(0,Fo,3,5,"a",28)(1,Uo,3,0,"button",8),i&2){let e=c(2);J(e.data.Adjustment.StateID==e.adjustmentState.Draft?0:-1),l(),J(e.data.Adjustment.StateID==e.adjustmentState.Draft?1:-1)}}function Ro(i,t){if(i&1&&(o(0,"a",28),f(1,"i",29),s(2,"Edit "),a()),i&2){let e=c(3);p("routerLink",ne(2,$r))("queryParams",V(3,Kt,e.data.ID))}}function Qo(i,t){if(i&1&&_(0,Ro,3,5,"a",28),i&2){let e=c(2);J(e.data.Adjustment.TypeID==e.adjustmentType.AdjustDifferences&&(e.data.Adjustment.StateID==e.adjustmentState.Pending||e.data.Adjustment.StateID==e.adjustmentState.Accepted)?0:-1)}}function Bo(i,t){if(i&1){let e=y();o(0,"button",25),g("click",function(){d(e);let n=c(2);return u(n.delete())}),f(1,"i",31),s(2,"Delete "),a()}}function Ho(i,t){if(i&1&&(o(0,"tr")(1,"th"),s(2,"Journal Link"),a(),o(3,"td"),s(4,":"),a(),o(5,"td")(6,"a",32),s(7,"View Journal"),a()()()),i&2){let e=c(2);l(6),at("href","https://accounting.dealpos.app/pages/journal-entry;TransID=",e.data.ID,"",It)}}function Wo(i,t){i&1&&(o(0,"div",38),f(1,"div",40),a())}function qo(i,t){if(i&1&&(o(0,"div",10)(1,"div",34)(2,"h4"),s(3),v(4,"date"),a(),o(5,"p",35),s(6),v(7,"date"),a()(),o(8,"div",36),f(9,"i",37),_(10,Wo,2,0,"div",38),a(),o(11,"div",39)(12,"h4"),s(13),a(),o(14,"p",35),s(15),a()()()),i&2){let e=c(),r=e.$implicit,n=e.$index,m=c(2);l(3),S(j(4,7,r.Date,"dd MMM yyyy")),l(3),S(j(7,10,r.Date,"HH:mm a")),l(3),Ri("color",n==0?"blue":"black"),l(),J(n!=m.data.StatusProcess.length-1?10:-1),l(3),S(r.Status),l(2),S(r.Creator)}}function Go(i,t){if(i&1&&_(0,qo,16,13,"div",33),i&2){let e=t.$implicit;p("ngIf",e.Date)}}function zo(i,t){if(i&1){let e=y();o(0,"a",60),g("click",function(){d(e);let n=c(3);return u(n.exportCSV(n.csvConverter,n.adjustmentTypeStatus!==-1&&n.adjustmentTypeStatus===1?"Adjustment/AdjustmentInfoExport":"Adjustment/AdjustmentCountedExport","Adjustment#"+n.data.Adjustment.Number+".csv"))}),f(1,"i",61),s(2,"Export"),a()}}function Ko(i,t){i&1&&(F(0),o(1,"th",62),s(2,"Qty"),a(),U())}function $o(i,t){i&1&&(F(0),o(1,"th",62),s(2,"Counted"),a(),o(3,"th",62),s(4,"Expected"),a(),U())}function Jo(i,t){i&1&&(o(0,"th",62),s(1,"Expected"),a(),o(2,"th",62),s(3,"Counted"),a())}function Zo(i,t){if(i&1&&(_(0,$o,5,0,"ng-container",52)(1,Jo,4,0,"ng-template",null,3,Q),o(3,"th",62),s(4,"Difference"),a()),i&2){let e=$(2),r=c(3);p("ngIf",r.data.Adjustment.TypeID===2&&(r.data.Adjustment.StateID===1||r.data.Adjustment.StateID===2))("ngIfElse",e)}}function Xo(i,t){i&1&&(o(0,"th",63),s(1," Cost "),a())}function Yo(i,t){i&1&&(o(0,"th",63),s(1," Price "),a())}function ea(i,t){if(i&1&&(F(0),f(1,"p",68),U()),i&2){let e=c().$implicit;l(),p("innerHTML",e.Note,K)}}function ta(i,t){if(i&1&&(F(0),o(1,"td",69),s(2),a(),U()),i&2){let e=c().$implicit;l(),De(Mt(3,jn,e.Quantity>0,e.Quantity<0)),l(),I(" ",e.Quantity," ")}}function na(i,t){if(i&1&&(F(0),o(1,"td",69),s(2),a(),o(3,"td",69),s(4),a(),U()),i&2){let e=c(2).$implicit;l(2),I(" ",e.Counted," "),l(2),I(" ",e.Expected," ")}}function ia(i,t){if(i&1&&(o(0,"td",69),s(1),a(),o(2,"td",69),s(3),a()),i&2){let e=c(2).$implicit;l(),I(" ",e.Expected," "),l(2),I(" ",e.Counted," ")}}function ra(i,t){if(i&1&&(_(0,na,5,2,"ng-container",52)(1,ia,4,2,"ng-template",null,3,Q),o(3,"td",69),s(4),v(5,"number"),a()),i&2){let e=$(2),r=c().$implicit,n=c(3);p("ngIf",n.data.Adjustment.TypeID===2&&(n.data.Adjustment.StateID===1||n.data.Adjustment.StateID===2))("ngIfElse",e),l(3),De(Mt(7,jo,r.Expected>r.Counted,r.Expected<r.Counted)),l(),I(" ",w(5,5,r.Difference)," ")}}function oa(i,t){if(i&1&&(f(0,"td",70),v(1,"number")),i&2){let e=c().$implicit;p("innerHTML",w(1,1,e.UnitCost),K)}}function aa(i,t){if(i&1&&(f(0,"td",70),v(1,"number")),i&2){let e=c().$implicit;p("innerHTML",w(1,1,e.UnitPrice),K)}}function la(i,t){if(i&1&&(o(0,"tr"),f(1,"td",64),o(2,"td")(3,"a",65),s(4),a(),o(5,"div"),s(6),a(),f(7,"app-serial-note",66),_(8,ea,2,1,"ng-container",21),a(),_(9,ta,3,6,"ng-container",52)(10,ra,6,10,"ng-template",null,4,Q)(12,oa,2,3,"td",67)(13,aa,2,3,"td",67),a()),i&2){let e=t.$implicit,r=t.index,n=$(11),m=c(3);l(),p("innerHTML",r+1+".",K),l(2),p("queryParams",V(10,Kt,e.VariantID)),l(),S(e.Name),l(2),S(e.Code),l(),p("serials",e.Serial),l(),p("ngIf",e.Note!=null),l(),p("ngIf",m.data.Adjustment.TypeID==m.adjustmentType.AdjustDifferences||m.data.Adjustment.StateID==m.adjustmentState.Accepted&&m.data.Adjustment.TypeID==m.adjustmentType.CountQuantity)("ngIfElse",n),l(3),p("ngIf",m.roleService.product.Cost),l(),p("ngIf",m.roleService.sell.PriceVisible)}}function sa(i,t){if(i&1&&(o(0,"b"),v(1,"sum"),v(2,"sum"),s(3),v(4,"sum"),v(5,"number"),a()),i&2){let e=c(3);De(Mt(14,jn,j(1,3,e.data.DifferencesArray,"Quantity")>0,j(2,6,e.data.DifferencesArray,"Quantity")<0)),l(3),S(w(5,12,j(4,9,e.data.DifferencesArray,"Quantity")))}}function ma(i,t){if(i&1&&(o(0,"b",71),v(1,"sum"),v(2,"sum"),s(3),v(4,"sum"),v(5,"number"),a()),i&2){let e=c(3);p("ngClass",Mt(13,jn,j(1,2,e.data.DifferencesArray,"Difference")>0,j(2,5,e.data.DifferencesArray,"Difference")<0)),l(3),I(" ",w(5,11,j(4,8,e.data.DifferencesArray,"Difference"))," ")}}function pa(i,t){if(i&1&&(o(0,"td",72)(1,"b"),s(2),v(3,"sum"),v(4,"number"),a()()),i&2){let e=c(3);l(2),S(w(4,4,j(3,1,e.data.DifferencesArray,"TotalCost")))}}function ca(i,t){if(i&1&&(o(0,"td",73)(1,"b"),s(2),v(3,"sum"),v(4,"number"),a()()),i&2){let e=c(3);l(2),S(w(4,4,j(3,1,e.data.DifferencesArray,"TotalPrice")))}}function da(i,t){if(i&1&&(o(0,"div",12)(1,"div",41)(2,"div")(3,"h2"),s(4),o(5,"small",42),s(6),a()()(),o(7,"div",43)(8,"a",44),f(9,"i",45),s(10,"Print "),a(),_(11,zo,3,0,"a",46),a()(),o(12,"div",18)(13,"div",47)(14,"table",48)(15,"thead",49)(16,"tr")(17,"th",50),s(18,"No"),a(),o(19,"th",51),s(20,"Name"),a(),_(21,Ko,3,0,"ng-container",52)(22,Zo,5,2,"ng-template",null,1,Q)(24,Xo,2,0,"th",53)(25,Yo,2,0,"th",53),a()(),o(26,"tbody"),_(27,la,14,12,"tr",54),a(),o(28,"tfoot")(29,"tr")(30,"td",55)(31,"b"),s(32,"Total :"),a()(),o(33,"td",56),_(34,sa,6,17,"b",57)(35,ma,6,16,"ng-template",null,2,Q),a(),_(37,pa,5,6,"td",58)(38,ca,5,6,"td",59),a()()()()()()),i&2){let e=$(23),r=$(36),n=c(2);l(4),I(" ",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity?"Adjusted":"Counted"," Inventory"),l(2),I(" (",n.data.DifferencesArray.length," SKU)"),l(2),p("routerLink",ne(15,Jr))("queryParams",V(16,Kt,n.paramId)),l(3),p("ngIf",n.roleService.global.Export),l(10),p("ngIf",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity)("ngIfElse",e),l(3),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.sell.PriceVisible),l(2),p("ngForOf",n.data.DifferencesArray),l(3),p("colSpan",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity?2:4),l(4),p("ngIf",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity)("ngIfElse",r),l(3),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.sell.PriceVisible)}}function ua(i,t){if(i&1&&(o(0,"h2"),s(1," Counted Inventory "),o(2,"small",42),s(3),a()()),i&2){let e=c(3);l(3),I("(",e.data.CountedArray.length," SKU)")}}function _a(i,t){if(i&1){let e=y();o(0,"a",60),g("click",function(){d(e);let n=c(3);return u(n.exportCSV(n.csvConverter,"Adjustment/AdjustmentCountedExport","Adjustment_Counted#"+n.data.Adjustment.Number+".csv"))}),f(1,"i",61),s(2,"Export"),a()}}function ga(i,t){if(i&1&&(o(0,"tr"),f(1,"td",64),o(2,"td")(3,"a",65),s(4),a(),o(5,"div"),s(6),a()(),o(7,"td",69),s(8),a(),o(9,"td",69),s(10),a(),o(11,"td",69),s(12),a()()),i&2){let e=t.$implicit,r=t.index;l(),p("innerHTML",r+1+".",K),l(2),p("queryParams",V(9,Kt,e.VariantID)),l(),S(e.Name),l(2),S(e.Code),l(2),S(e.Counted),l(2),S(e.Expected),l(),De(Mt(11,jn,e.Difference>0,e.Difference<0)),l(),I(" ",e.Difference," ")}}function fa(i,t){if(i&1&&(o(0,"div",12)(1,"div",41)(2,"div"),_(3,ua,4,1,"h2",21),a(),o(4,"div",43)(5,"a",44),f(6,"i",45),s(7,"Print "),a(),_(8,_a,3,0,"a",46),a()(),o(9,"div",18)(10,"div",47)(11,"table",48)(12,"thead",49)(13,"tr")(14,"th",50),s(15,"No"),a(),o(16,"th",51),s(17,"Name"),a(),o(18,"th",74),s(19,"Counted"),a(),o(20,"th",74),s(21,"Expected"),a(),o(22,"th",74),s(23,"Difference"),a()()(),o(24,"tbody"),_(25,ga,13,14,"tr",54),a()()()()()),i&2){let e=c(2);l(3),p("ngIf",e.data.CountedArray.length>0&&e.data.Adjustment.TypeID==e.adjustmentState.Pending),l(2),p("routerLink",ne(5,Jr))("queryParams",V(6,Kt,e.paramId)),l(3),p("ngIf",e.roleService.global.Export),l(17),p("ngForOf",e.data.CountedArray)}}function Ca(i,t){if(i&1&&(o(0,"mainpanel-cmp",6)(1,"actions"),_(2,No,7,0,"div",7),o(3,"div",7),_(4,Lo,2,2)(5,Qo,1,1)(6,Bo,3,0,"button",8),a()(),o(7,"content")(8,"div",9)(9,"div",10)(10,"div",11)(11,"div",12)(12,"div",13)(13,"div",14),f(14,"h2",15,0),o(16,"div",16),f(17,"i",17),o(18,"span"),s(19),a()()()(),o(20,"div",18)(21,"table",19)(22,"tr")(23,"th"),s(24,"Date"),a(),o(25,"td"),s(26,":"),a(),f(27,"td",20),a(),o(28,"tr")(29,"th"),s(30,"PIC"),a(),o(31,"td"),s(32,":"),a(),f(33,"td",20),a(),o(34,"tr")(35,"th"),s(36,"Type"),a(),o(37,"td"),s(38,":"),a(),f(39,"td",20),a(),o(40,"tr")(41,"th"),s(42,"Note"),a(),o(43,"td"),s(44,":"),a(),f(45,"td",20),a(),_(46,Ho,8,2,"tr",21),o(47,"tr")(48,"th"),s(49,"Tag"),a(),o(50,"td"),s(51,":"),a(),f(52,"td",20),a()()()(),o(53,"div")(54,"div",12)(55,"div",13)(56,"h2"),s(57,"Status"),a()(),o(58,"div",18),Ee(59,Go,1,1,"div",10,yt),a()()()(),o(61,"div",22),_(62,da,39,18,"div",23)(63,fa,26,8,"div",23),a()(),f(64,"pos-footer-alert",24),a()()()),i&2){let e=$(15),r=c();p("pageData",r.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),J(r.hasAccRejButton?2:-1),l(2),J(r.roleService.adjustment.Create?4:-1),l(),J(r.roleService.adjustment.Edit?5:-1),l(),J(r.roleService.adjustment.Delete?6:-1),l(8),p("matTooltip",e.classList.contains("text-truncate")?r.data.Adjustment.OutletName:"")("innerHTML",r.data.Adjustment.OutletName,K),l(2),p("ngClass",r.determineStatusClasses),l(),p("ngClass",r.getStatusIconClasses),l(2),S((r.data.Adjustment==null?null:r.data.Adjustment.StateLabel)||""),l(8),p("innerHTML",r.data.Adjustment.Date,K),l(6),p("innerHTML",r.data.Adjustment.PIC,K),l(6),p("innerHTML",r.data.Adjustment.TypeLabel,K),l(6),p("innerHTML",r.data.Adjustment.Note,K),l(),p("ngIf",r.data.AppsAccoutingActive&&r.roleService.accounting.View),l(6),p("innerHTML",r.data.Adjustment.TagName,K),l(7),Oe(r.data.StatusProcess),l(3),p("ngIf",r.data.DifferencesArray.length>0),l(),p("ngIf",(r.data.CountedArray==null?null:r.data.CountedArray.length)>0&&r.data.Adjustment.TypeID==r.adjustmentState.Pending),l(),p("created",r.data.CreatedInfo.Created)("modified",r.data.CreatedInfo.Modified)}}var kn=class i extends Ce{constructor(e,r,n,m,h,x,le,te){super(e,r,"Adjustment/AuditInventoryAdjustmentInfo",null,null,m);this.httpService=r;this.toastr=n;this.csvConverter=h;this.router=x;this.roleService=le;this.dialog=te;this.initQueryParam()}paramId;hasAccRejButton=!1;isEditable=!1;adjustmentType=xi;adjustmentState=bi;preGetList(){let e=this.route.snapshot.queryParams;this.pageData.Filter=e}initQueryParam(){let e=this.route.snapshot.queryParams;this.paramId=e.ID}postInit(e){this.menuData.H=e.PageTitle,e.Adjustment.StateID==2&&this.roleService.adjustment.Approval&&e.Config.WithApproval?this.hasAccRejButton=!0:this.hasAccRejButton=!1,(this.data.Adjustment.StateID==1||this.data.Adjustment.StateID==2)&&(this.isEditable=!0)}exportCSV(e,r,n){this.httpService.get(`/api/${r}`,[{key:"ID",value:this.paramId}]).subscribe(m=>{e.convertToCSV(m,n)})}reject(){if(!confirm("Are you sure you want to reject this?"))return;let e={ID:this.data.Adjustment.ID};this.httpService.post("/API/Adjustment/RejectCountedItem",e).subscribe({next:r=>{this.toastr.success("Success reject adjustment",ee.Success),this.hasAccRejButton=!1,this.isEditable=!1,this.getListData()}})}accept(){if(!confirm("Are you sure you want to accept this?"))return;let e={ID:this.data.Adjustment.ID};this.httpService.post("/API/Adjustment/AcceptCountedItem",e).subscribe({next:r=>{this.toastr.success("Success accept adjustment",ee.Success),this.hasAccRejButton=!1,this.isEditable=!1,this.getListData()}})}delete(){confirm("Are you sure you want to delete this?")&&this.httpService.delete("/api/Adjustment/DeleteInventoryAdjustmentInfo",{params:[{key:"ID",value:this.data.Adjustment.ID}]}).subscribe(()=>{this.toastr.success("Success delete record.",ee.Success),this.router.navigate(["/menu/Adjustment/Adjustment/Archive"])})}get determineStatusClasses(){let e=this.data?.Adjustment?.StateLabel;return e?{"bg-draft":e.includes("Draft"),"bg-in-review":e.includes("Pending"),"bg-rejected":e.includes("Rejected"),"bg-accepted":e.includes("Accepted")}:{"bg-draft":!1,"bg-in-review":!1,"bg-rejected":!1,"bg-accepted":!1}}get getStatusIconClasses(){let e=this.data?.Adjustment?.StateLabel;return e?{"fa-check":e.includes("Accepted"),"fa-bookmark":e.includes("Draft"),"fa-hourglass-start":e.includes("Pending"),"fa-xmark":e.includes("Rejected")}:{"fa-check":!1,"fa-bookmark":!1,"fa-hourglass-start":!1,"fa-xmark":!1}}onSubmit(){this.dialog.open(Ur,{data:{title:"Submit Review",message:`
|
|
2
2
|
<h4>Are you sure you want to Change status to pending review?</h4>
|
|
3
3
|
`,headerType:ee.Warning}}).afterClosed().pipe(me(e=>e===!0),Y(()=>this.httpService.post(Te.AdjusmentSubmitReview,{ID:this.data.Adjustment.ID}))).subscribe(e=>{this.toastr.success(e.Message,ee.Success),this.getListData()})}get adjustmentTypeStatus(){return this.data?this.data.Adjustment.TypeID==this.adjustmentType.AdjustDifferences||this.data.Adjustment.StateID==this.adjustmentState.Accepted&&this.data.Adjustment.TypeID==this.adjustmentType.CountQuantity?1:2:-1}static \u0275fac=function(r){return new(r||i)(b(oe),b(A),b(fe),b(dt),b(ke),b(Fe),b(L),b(X))};static \u0275cmp=M({type:i,selectors:[["POS-adjustment-info"]],standalone:!1,features:[pe],decls:1,vars:1,consts:[["outletName",""],["NOTACC",""],["COUNTEDTOTAL",""],["ELSE_BLOCK",""],["NOTACCDATA",""],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"btn-group","me-4"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-4"],[1,"card"],[1,"card-header"],[1,"d-flex","gap-4"],[1,"text-truncate",3,"matTooltip","innerHTML"],[1,"badge","rounded-pill","d-flex","align-items-center","gap-3","fs-6",3,"ngClass"],[1,"fa-solid",3,"ngClass"],[1,"card-body"],[1,"table-sm","table-borderless"],[3,"innerHTML"],[4,"ngIf"],[1,"col-sm-8"],["class","card",4,"ngIf"],[3,"created","modified"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-thumbs-down","me-3"],[1,"fa-solid","fa-thumbs-up","me-3"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-pen-to-square","me-3"],[1,"fa-solid","fa-floppy-disk","me-3"],[1,"fa-solid","fa-trash","me-3"],[3,"href"],["class","row",4,"ngIf"],[1,"col","text-end"],[1,"mt-3"],[1,"col-3","text-center","position-relative"],[1,"fa-solid","fa-angle-up","current-status-icon"],[1,"d-flex","justify-content-center","h-100"],[1,"col-5"],[1,"timeline"],[1,"card-header","d-flex","justify-content-between"],[1,"fst-italic","fs-6"],[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"],[4,"ngIf","ngIfElse"],["class","text-end","style","width: 120px",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"text-end","empty-column",3,"colSpan"],[1,"text-end","empty-column"],[3,"class",4,"ngIf","ngIfElse"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Cost",4,"ngIf"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Price",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"fa-solid","fa-upload","me-3"],[1,"text-end",2,"width","80px"],[1,"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,"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"],[3,"ngClass"],["matTooltipPosition","above","matTooltip","Total from Quantity x Cost",1,"text-end","empty-column"],["matTooltipPosition","above","matTooltip","Total from Quantity x Price",1,"text-end","empty-column"],[1,"text-end",2,"width","100px"]],template:function(r,n){r&1&&_(0,Ca,65,22,"mainpanel-cmp",5),r&2&&p("ngIf",n.data)},dependencies:[Ne,ie,B,de,ae,jt,qt,An,W,He,Lt],styles:[".current-status-icon[_ngcontent-%COMP%]{background-color:#fff;border-radius:50%;box-shadow:0 2px #b8b8b8;width:35px;height:35px;font-size:35px}.timeline[_ngcontent-%COMP%]{border-left:3px solid #e1e1e1;height:100%;width:0px}.bg-draft[_ngcontent-%COMP%]{background-color:#ffa72a!important}.bg-in-review[_ngcontent-%COMP%]{background-color:#7e7e7e!important}.bg-rejected[_ngcontent-%COMP%]{background-color:#ff382e!important}.bg-accepted[_ngcontent-%COMP%]{background-color:#2fad1a!important}"]})};var ya=()=>["/menu/Adjustment/Adjustment/Archive/Form"],va=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Sa=i=>({ID:i}),xa=i=>({"text-success":i}),ba=i=>({"text-danger":i});function Ia(i,t){if(i&1){let e=y();o(0,"a",23),g("click",function(){d(e);let n=c(3);return u(n.httpPostListID("Adjustment/DeleteInventoryAdjustmentList"))}),f(1,"i",24),s(2,"Delete "),a()}}function Da(i,t){if(i&1){let e=y();o(0,"a",25),g("click",function(){d(e);let n=c(3);return u(n.onMergeAdjustment())}),f(1,"i",26),s(2," Merge "),a()}}function Pa(i,t){if(i&1&&(o(0,"div",5),_(1,Ia,3,0,"a",21)(2,Da,3,0,"a",22),a()),i&2){let e=c(2);l(),p("ngIf",e.getSelectedData().length>0&&(e.roleService==null||e.roleService.adjustment==null?null:e.roleService.adjustment.Delete)),l(),p("ngIf",e.getSelectedData().length>=2&&(e.roleService==null||e.roleService.adjustment==null?null:e.roleService.adjustment.Edit))}}function Ta(i,t){if(i&1){let e=y();o(0,"button",27),g("click",function(){d(e);let n=c(2);return u(n.openExportModal())}),f(1,"i",28),s(2," Export "),a()}}function wa(i,t){i&1&&(o(0,"a",29),s(1,"New"),a()),i&2&&p("routerLink",ne(1,ya))}function Ma(i,t){if(i&1){let e=y();o(0,"div")(1,"div",30)(2,"h6"),s(3,"Outlet"),a(),o(4,"ng-select",31),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.EntityID,n)||(m.pageData.Filter.EntityID=n),u(n)}),a(),o(5,"h6"),s(6,"Date From - To"),a(),o(7,"div",32)(8,"div",33)(9,"datepicker",34),P("dateChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.From,n)||(m.pageData.Filter.From=n),u(n)}),a()(),o(10,"div",35)(11,"datepicker",36),P("dateChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.To,n)||(m.pageData.Filter.To=n),u(n)}),a()()(),o(12,"h6"),s(13,"Quantity From - To"),a(),o(14,"div",37)(15,"input",38),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.QuantityFrom,n)||(m.pageData.Filter.QuantityFrom=n),u(n)}),a(),s(16," - "),o(17,"input",38),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.QuantityTo,n)||(m.pageData.Filter.QuantityTo=n),u(n)}),a()(),o(18,"h6"),s(19,"State"),a(),o(20,"ng-select",39),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.State,n)||(m.pageData.Filter.State=n),u(n)}),a(),o(21,"h6"),s(22,"Adjustment Type"),a(),o(23,"ng-select",40),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.Type,n)||(m.pageData.Filter.Type=n),u(n)}),a(),o(24,"h6"),s(25,"Adjustment Tag"),a(),o(26,"ng-select",41),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.TagID,n)||(m.pageData.Filter.TagID=n),u(n)}),a(),o(27,"h6"),s(28,"Rows"),a(),o(29,"input",42),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.RowCount,n)||(m.pageData.Filter.RowCount=n),u(n)}),a(),o(30,"h6"),s(31,"Exclude Zero"),a(),o(32,"radio-options",43),P("modelChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.ExcludeZero,n)||(m.pageData.Filter.ExcludeZero=n),u(n)}),a()()()}if(i&2){let e=c(2);l(4),p("items",e.pageData.Options.Entities),T("ngModel",e.pageData.Filter.EntityID),l(5),p("isFloatingLabel",!1),T("date",e.pageData.Filter.From),l(2),p("isFloatingLabel",!1),T("date",e.pageData.Filter.To),l(4),T("ngModel",e.pageData.Filter.QuantityFrom),l(2),T("ngModel",e.pageData.Filter.QuantityTo),l(3),p("items",e.pageData.Options.States),T("ngModel",e.pageData.Filter.State),l(3),p("items",e.pageData.Options.Types),T("ngModel",e.pageData.Filter.Type),l(3),p("items",e.pageData.Options.AdjustmentTagsOptions),T("ngModel",e.pageData.Filter.TagID),l(3),T("ngModel",e.pageData.Filter.RowCount),p("max",1e4),l(3),T("model",e.pageData.Filter.ExcludeZero)}}function Ea(i,t){if(i&1){let e=y();o(0,"th",12)(1,"input",44),g("change",function(n){d(e);let m=c(2);return u(m.onSelectAllData(n.target.checked))}),a()()}}function Oa(i,t){i&1&&(o(0,"th",18),s(1,"Cost"),a())}function Aa(i,t){if(i&1){let e=y();o(0,"td")(1,"input",51),P("ngModelChange",function(n){d(e);let m=c().$implicit;return D(m.selected,n)||(m.selected=n),u(n)}),a()()}if(i&2){let e=c().$implicit;l(),T("ngModel",e.selected)}}function ka(i,t){if(i&1&&(o(0,"td",47),s(1),v(2,"quantityFraction"),a()),i&2){let e=c().$implicit;l(),I(" ",w(2,1,e.Quantity)," ")}}function Va(i,t){if(i&1&&(o(0,"td",47),s(1),v(2,"quantityFraction"),a()),i&2){let e=c().$implicit;De(V(5,xa,e.Quantity>0)),l(),I(" +",w(2,3,e.Quantity)," ")}}function ja(i,t){if(i&1&&(o(0,"td",47),s(1),v(2,"quantityFraction"),a()),i&2){let e=c().$implicit;De(V(5,ba,e.Quantity<0)),l(),I(" ",w(2,3,e.Quantity)," ")}}function Na(i,t){if(i&1&&(o(0,"td",47),s(1),v(2,"amountFraction"),a()),i&2){let e=c().$implicit;l(),S(w(2,1,e.Cost))}}function Fa(i,t){if(i&1&&(o(0,"tr",45),_(1,Aa,2,1,"td"),o(2,"td"),s(3),a(),o(4,"td")(5,"a",46),s(6),a()(),o(7,"td"),s(8),v(9,"date"),a(),o(10,"td",47),s(11),v(12,"number"),a(),_(13,ka,3,3,"td",48)(14,Va,3,7,"td",49)(15,ja,3,7,"td",49),o(16,"td"),s(17),a(),_(18,Na,3,3,"td",47),o(19,"td"),s(20),a(),o(21,"td"),f(22,"div",50),a()()),i&2){let e=t.$implicit,r=c(2);l(),J(!(r.roleService==null||r.roleService.adjustment==null)&&r.roleService.adjustment.Delete||!(r.roleService==null||r.roleService.adjustment==null)&&r.roleService.adjustment.Edit?1:-1),l(2),S(e.EntityName),l(2),p("routerLink",ne(21,va))("queryParams",V(22,Sa,e.ID)),l(),S(e.Number),l(2),S(j(9,16,e.Date,"dd MMM yyyy")),l(3),S(w(12,19,e.SKUCount)),l(2),p("ngIf",e.Quantity==0),l(),p("ngIf",e.Quantity>0),l(),p("ngIf",e.Quantity<0),l(2),S(e.TypeLabel),l(),J(!(r.roleService==null||r.roleService.product==null)&&r.roleService.product.Cost?18:-1),l(),Qi(r.stateColored(+e.StateID)),l(),I(" ",e.StateLabel," "),l(2),p("innerHTML",e.Note,K)}}function Ua(i,t){if(i&1){let e=y();o(0,"mainpanel-cmp",2),P("textChange",function(n){d(e);let m=c();return D(m.pageData.Filter.Number,n)||(m.pageData.Filter.Number=n),u(n)}),g("onSubmit",function(){d(e);let n=c();return u(n.searchFromPageOne())}),P("filterChange",function(n){d(e);let m=c();return D(m.pageData.Filter,n)||(m.pageData.Filter=n),u(n)}),o(1,"actions")(2,"a",3),f(3,"i",4),s(4,"Scanner App "),a(),_(5,Pa,3,2,"div",5)(6,Ta,3,0,"button",6)(7,wa,2,2,"a",7),a(),o(8,"filters"),_(9,Ma,33,17,"ng-template",null,0,Q),a(),o(11,"content")(12,"div",8)(13,"div",9)(14,"table",10)(15,"thead",11)(16,"tr"),_(17,Ea,2,0,"th",12),o(18,"th",13),s(19,"Outlet"),a(),o(20,"th",13),s(21,"Number"),a(),o(22,"th",14),s(23,"Date"),a(),o(24,"th",15),s(25,"SKU"),a(),o(26,"th",16),s(27," Qty "),a(),o(28,"th",17),s(29,"Type"),a(),_(30,Oa,2,0,"th",18),o(31,"th",14),s(32,"State"),a(),o(33,"th"),s(34,"Note"),a()()(),o(35,"tbody"),_(36,Fa,23,24,"tr",19),a()()(),o(37,"POS-complex-pagination",20),g("jumpToPage",function(){d(e);let n=c();return u(n.getListData())})("previousPage",function(){d(e);let n=c();return u(n.getListData())})("nextPage",function(){d(e);let n=c();return u(n.getListData())}),a()()()()}if(i&2){let e=c();p("pageData",e.menuData),T("text",e.pageData.Filter.Number),p("isFilterOnDropdown",!1),T("filter",e.pageData.Filter),l(5),J(!(e.roleService==null||e.roleService.adjustment==null)&&e.roleService.adjustment.Delete||!(e.roleService==null||e.roleService.adjustment==null)&&e.roleService.adjustment.Edit?5:-1),l(),p("ngIf",e.roleService.global.Export),l(),p("ngIf",e.roleService.adjustment.Create),l(10),J(!(e.roleService==null||e.roleService.adjustment==null)&&e.roleService.adjustment.Delete||!(e.roleService==null||e.roleService.adjustment==null)&&e.roleService.adjustment.Edit?17:-1),l(13),J(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?30:-1),l(6),p("ngForOf",e.data.Data),l(),p("total",e.data.Data.length)("pageData",e.pageData)}}var Nn=class i extends Ce{constructor(e,r,n,m,h,x){super(e,r,"Adjustment/GetInventoryAdjustmentList","AdjustmentLoader/GetInventoryAdjustmentList",n);this.toastr=n;this.csvConverter=m;this.roleService=h;this.matDialog=x}hideMore=!1;openExportModal(){this.matDialog.open(Le,{data:{title:"Inventory Adjustment",exportTypes:[{ID:"AdjustmentExport/GetInventoryAdjustmentList",Value:"Default",FileName:"Inventory Adjustment"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/GetInventoryAdjustmentListCount",pagination:!0}})}onMergeAdjustment(){let e=this.getSelectedData();this.matDialog.open(Fr,{data:{data:e,title:"Choose Merge Target",columns:[{type:"text",field:"Number"},{type:"date",field:"Date"},{type:"number",field:"Quantity"},{type:"text",field:"TypeLabel"},{type:"text",field:"StateLabel"}],headers:["Number","Date","Qty","Type","Status"]},width:"600px"}).afterClosed().pipe(me(r=>r),Y(r=>this.httpService.put(Te.MergeAdjustment,r))).subscribe(()=>{this.toastrService.success("Inventory Adjustment records have been merged successfully.",ee.Success),this.getListData()})}stateColored(e){switch(e){case 1:return{color:"#FFA72A"};case 2:return{color:"#7E7E7E"};case 3:return{color:"#FF382E"};case 4:return{color:"#2FAD1A"}}}static \u0275fac=function(r){return new(r||i)(b(oe),b(A),b(fe),b(ke),b(L),b(X))};static \u0275cmp=M({type:i,selectors:[["POS-inventory-adjustment"]],standalone:!1,features:[pe],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["href","https://www.dealpos.co.id/tour/scanner","target","_blank",1,"btn","btn-outline-secondary","me-3"],[1,"fa-solid","fa-scanner","me-3"],[1,"btn-group","me-3"],["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"],[2,"width","14px"],[2,"width","120px"],[2,"width","100px"],[1,"text-end",2,"width","55px"],["matTooltipPosition","above","matTooltip","Adjusted Quantity",1,"text-end",2,"width","50px"],[2,"width","130px"],[1,"text-end",2,"width","95px"],["class","border-bottom",4,"ngFor","ngForOf"],["api","Adjustment/GetInventoryAdjustmentListCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash","me-3"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-merge","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"button","btn","btn-success",3,"routerLink"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModelChange","items","ngModel"],[1,"row"],[1,"col-6","pe-2"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"col-6","ps-2"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"d-flex","align-items-center",2,"column-gap","8px"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an State",3,"ngModelChange","items","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose an Type",3,"ngModelChange","items","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose an Tags",3,"ngModelChange","items","ngModel"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel","max"],[3,"modelChange","model"],["type","checkbox",3,"change"],[1,"border-bottom"],[3,"routerLink","queryParams"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end",3,"class",4,"ngIf"],[3,"innerHTML"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(r,n){r&1&&_(0,Ua,38,12,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[ie,B,de,ae,Ae,zi,q,re,Bt,ce,Ge,Dn,Ue,jt,W,He,cr,dr],encapsulation:2})};var Un=class i{config;dialogRef=C(he);data=C(ft);filterKeys=["From","To","PageNumber","RowCount","EntityID","TagID"];httpService=C(A);summaryData=z(null);constructor(){this.config=new ye,this.config.title="Total Adjustment Summary",this.config.hideFooter=!0,this.config.customWidth="382px"}ngOnInit(){console.log("DialogAdjustmentSummaryComponent",this.data.pageData),console.log("data",this.data);let t=Object.entries(this.data.pageData).filter(([r,n])=>this.filterKeys.includes(r)).map(([r,n])=>{if(r==="From"||r==="To"){let m=new Date(n);return{[r]:new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}).format(m).replace(/(\d{4})\/(\d{2})\/(\d{2})/,"$1-$2-$3")+"T00:00:00.000"}}return{[r]:n}}),e=t.reduce((r,n)=>O(O({},r),n),{});this.httpService.post("api/Adjustment/AuditAdjustmentSumReport",e).pipe(Me(r=>r.Data),R(r=>this.summaryData.set(r))).subscribe(),console.log("tdf",t)}onOK(){}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["pos-dialog-adjustment-summary"]],decls:29,vars:13,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid"],[1,"table","table-bordered"],[1,"py-2",2,"width","40%"],[1,"text-end","py-2"]],template:function(e,r){e&1&&(o(0,"modal-material",0),g("onCancel",function(){return r.dialogRef.close()})("onClose",function(){return r.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"table",2)(4,"tbody")(5,"tr")(6,"th",3),s(7,"Quantity"),a(),o(8,"td",4),s(9),v(10,"number"),a()(),o(11,"tr")(12,"th",3),s(13,"Weight"),a(),o(14,"td",4),s(15),v(16,"number"),a()(),o(17,"tr")(18,"th",3),s(19,"Total Cost"),a(),o(20,"td",4),s(21),v(22,"number"),a()(),o(23,"tr")(24,"th",3),s(25,"Total Price"),a(),o(26,"td",4),s(27),v(28,"number"),a()()()()()()()),e&2&&(p("config",r.config),l(9),I(" ",w(10,5,r.summaryData().Quantity)," "),l(6),I(" ",w(16,7,r.summaryData().Weight)," "),l(6),I(" ",w(22,9,r.summaryData().TotalCost)," "),l(6),I(" ",w(28,11,r.summaryData().TotalPrice)," "))},dependencies:[ue,ve,ge,W],encapsulation:2,changeDetection:0})};var Ra=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Qa=i=>({ID:i});function Ba(i,t){if(i&1){let e=y();o(0,"button",4),g("click",function(){d(e);let n=c();return u(n.openExportModal())}),f(1,"i",5),s(2," Export "),a()}}function Ha(i,t){if(i&1){let e=y();o(0,"div",6)(1,"h6"),s(2,"Outlets"),a(),o(3,"outlet-selector",7),P("ngModelChange",function(n){d(e);let m=c();return D(m.pageData.Filter.EntityID,n)||(m.pageData.Filter.EntityID=n),u(n)}),a(),o(4,"h6"),s(5,"From"),a(),o(6,"datepicker",8),P("dateChange",function(n){d(e);let m=c();return D(m.pageData.Filter.From,n)||(m.pageData.Filter.From=n),u(n)}),a(),o(7,"h6"),s(8,"To"),a(),o(9,"datepicker",9),P("dateChange",function(n){d(e);let m=c();return D(m.pageData.Filter.To,n)||(m.pageData.Filter.To=n),u(n)}),a(),o(10,"h6"),s(11,"Adjustment Tag"),a(),o(12,"ng-select",10),P("ngModelChange",function(n){d(e);let m=c();return D(m.pageData.Filter.TagID,n)||(m.pageData.Filter.TagID=n),u(n)}),a()()}if(i&2){let e=c();l(3),p("accessType",2),T("ngModel",e.pageData.Filter.EntityID),p("multiple",!1),l(3),p("isFloatingLabel",!1),T("date",e.pageData.Filter.From),l(3),p("isFloatingLabel",!1),T("date",e.pageData.Filter.To),l(3),p("items",e.pageData.Options.AdjustmentTagsOptions),T("ngModel",e.pageData.Filter.TagID)}}function Wa(i,t){i&1&&(o(0,"th",22),s(1," @ Cost "),a())}function qa(i,t){i&1&&(o(0,"th",22),s(1," @ Price "),a())}function Ga(i,t){if(i&1&&(o(0,"th",36),s(1),v(2,"number"),a()),i&2){let e=c().$implicit;l(),I(" ",w(2,1,e.UnitCost)," ")}}function za(i,t){if(i&1&&(o(0,"th",36),s(1),v(2,"number"),a()),i&2){let e=c().$implicit;l(),I(" ",w(2,1,e.UnitPrice)," ")}}function Ka(i,t){if(i&1&&(o(0,"tr")(1,"th",32),s(2),a(),o(3,"th",33),s(4),a(),o(5,"th",34),s(6),v(7,"number"),a(),_(8,Ga,3,3,"th",35)(9,za,3,3,"th",35),a()),i&2){let e=t.$implicit,r=c(3);l(2),I(" ",e.VariantName," "),l(2),I(" ",e.VariantCode," "),l(2),I(" ",w(7,5,e.Quantity)," "),l(2),p("ngIf",r.roleService.product.Cost),l(),p("ngIf",r.roleService.sell.UnitPriceEditor)}}function $a(i,t){if(i&1&&(o(0,"div")(1,"div",23)(2,"div",24)(3,"a",25),f(4,"span",26),v(5,"date"),f(6,"small",27),v(7,"date"),o(8,"small",28),s(9),a()()()(),o(10,"div")(11,"strong",29),s(12),a(),f(13,"div",30),a(),o(14,"table",31)(15,"tbody"),_(16,Ka,10,7,"tr",18),a()()()),i&2){let e=t.$implicit;l(3),p("routerLink",ne(14,Ra))("queryParams",V(15,Qa,e.ID)),l(),p("innerHTML",e.EntityName+" #"+e.Number+" - "+j(5,8,e.Created,"dd MMM yyyy"),K),l(2),p("innerHTML","("+j(7,11,e.Created,"HH:mm")+")",K),l(3),I(" ",e.PIC,""),l(3),I("[Q:",e.Quantity,"]"),l(),p("innerHTML",e.Note,K),l(3),p("ngForOf",e.Items)}}function Ja(i,t){if(i&1){let e=y();o(0,"div",11)(1,"table",12)(2,"thead",13)(3,"tr")(4,"th",14),s(5,"Name"),a(),o(6,"th",15),s(7,"Code"),a(),o(8,"th",16),s(9,"Qty"),a(),_(10,Wa,2,0,"th",17)(11,qa,2,0,"th",17),a()()(),_(12,$a,17,17,"div",18),o(13,"div",19)(14,"button",20),g("click",function(){d(e);let n=c();return u(n.onDialogSummary())}),s(15," View Adjustment Summary "),a()(),o(16,"POS-complex-pagination",21),g("jumpToPage",function(){d(e);let n=c();return u(n.getListData())})("previousPage",function(){d(e);let n=c();return u(n.getListData())})("nextPage",function(){d(e);let n=c();return u(n.getListData())}),a()()}if(i&2){let e=c();l(10),p("ngIf",e.roleService.product.Cost),l(),p("ngIf",e.roleService.sell.UnitPriceEditor),l(),p("ngForOf",e.data.Data),l(4),p("total",e.data.Data.length)("pageData",e.pageData)}}var Ln=class i extends Ce{constructor(e,r,n,m,h){super(e,r,"Adjustment/AuditAdjustmentReport","AdjustmentLoader/AuditAdjustmentReport",void 0,void 0,!0);this.httpService=r;this.csvConverter=n;this.roleService=m;this.matDialog=h}dataEndpoint="/api/Adjustment/AuditAdjustmentReport";loaderEndpoint="/api/AdjustmentLoader/AuditAdjustmentReport";countEndpoint="/api/Adjustment/AuditAdjustmentReportCount";data$;loader$;loader;onOpenExportDialog(e){}openExportModal(){this.matDialog.open(Le,{data:{title:"Adjustment Report",exportTypes:[{ID:"AdjustmentExport/AuditAdjustmentReport",Value:"Default",FileName:"Adjustment Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/AuditAdjustmentReportCount",pagination:!0}})}preInitList(){super.preInitList();let e=this.pageData.Options.AdjustmentTagsOptions.findIndex(r=>r.ID===this.pageData.Filter.TagID);this.pageData=N(O({},this.pageData),{Filter:N(O({},this.pageData.Filter),{TagID:e!==-1?this.pageData.Filter.TagID:null})})}onDialogSummary(){this.matDialog.open(Un,{data:{pageData:this.pageData.Filter}})}static \u0275fac=function(r){return new(r||i)(b(oe),b(A),b(ke),b(L),b(X))};static \u0275cmp=M({type:i,selectors:[["POS-adjustment-reports"]],standalone:!1,features:[pe],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","Choose a tag","bindLabel","Name","bindValue","ID","appendTo","body",3,"ngModelChange","items","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","w-100"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[1,"text-end",2,"width","60px"],[1,"text-end",2,"width","50px"],["class","text-end","style","width: 80px",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-center","w-100","my-6"],["type","button",1,"btn","btn-outline-primary",3,"click"],["api","Adjustment/AuditAdjustmentReportCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"text-end",2,"width","80px"],[1,"d-lg-flex","mt-sm-0"],[1,"mt-5","ms-3"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHTML"],[1,"fst-italic","text-dark",3,"innerHTML"],[1,"fst-italic","text-dark"],[1,"text-danger","ms-3"],[3,"innerHTML"],[1,"table","table-bordered"],[1,"fw-normal",2,"width","645px","word-break","break-all"],[1,"fw-normal","text-end",2,"width","60px","word-break","break-all"],[1,"fw-normal","text-end",2,"width","50px"],["class","fw-normal text-end","style","width: 80px",4,"ngIf"],[1,"fw-normal","text-end",2,"width","80px"]],template:function(r,n){if(r&1){let m=y();o(0,"mainpanel-cmp",1),P("textChange",function(x){return d(m),D(n.pageData.Filter.Number,x)||(n.pageData.Filter.Number=x),u(x)}),g("onSubmit",function(){return d(m),u(n.searchFromPageOne())}),P("filterChange",function(x){return d(m),D(n.pageData.Filter,x)||(n.pageData.Filter=x),u(x)}),o(1,"actions"),_(2,Ba,3,0,"button",2),a(),o(3,"filters"),_(4,Ha,13,9,"ng-template",null,0,Q),a(),o(6,"content"),_(7,Ja,17,5,"div",3),a()()}r&2&&(p("pageData",n.menuData),T("text",n.pageData.Filter.Number),p("isFilterOnDropdown",!1),T("filter",n.pageData.Filter),l(2),p("ngIf",n.roleService.global.Export),l(5),p("ngIf",n.data&&n.data.Data))},dependencies:[ie,B,de,ae,q,re,Bt,ce,Ge,Qt,W,He],encapsulation:2})};var Rn=class extends xn{constructor(e,r){super(e);this.httpService=r;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(Fi(()=>this.httpService.post(this.loaderApi,this.requestPayload))).subscribe(e=>this.loaderData=e)}getProduct(e){this.products=[],this.httpService.post(this.productsApi,e).subscribe(r=>{r.forEach(n=>{n.Counted="",this.products.push(n),this.originalProducts.push(n)})})}submitAdjustment(e){this.beforeSubmit(),this.httpService.post(this.submitApi,e).subscribe({next:r=>{this.adjustmentID=r.OrderID,this.completeInfo=r,this.error=null,this.onSubmitSuccess()},error:r=>{this.error=r,this.onSubmiterror()}})}onSubmitSuccess(){}beforeSubmit(){}onSubmiterror(){}};var Xa=["stepper"],Yr=i=>({"nb-button-override":i}),Ya=i=>({custom:i}),eo=()=>["/menu/Products/Catalog/Variants/Info"],Di=i=>({ID:i}),el=i=>({"bg-gradient-warning":i}),tl=i=>({Filter:i}),nl=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function il(i,t){if(i&1){let e=y();o(0,"button",9),g("click",function(){d(e);let n=c(2);return u(n.validateFilter())}),s(1," Next "),a()}if(i&2){let e=c(2);p("disabled",!e.roleService.adjustment.Create)}}function rl(i,t){if(i&1){let e=y();o(0,"div",10)(1,"button",11),g("click",function(){d(e);let n=c(2);return u(n.stepper.previous())}),s(2," Back "),a(),o(3,"button",12),g("click",function(){d(e);let n=c(2);return u(n.stepper.next())}),s(4," Next "),a()()}if(i&2){let e=c(2);p("ngClass",V(1,Yr,e.currentSubStatus!=e.subStatusEnum.PAID))}}function ol(i,t){if(i&1){let e=y();o(0,"div",10)(1,"button",13),g("click",function(){d(e);let n=c(2);return u(n.stepper.previous())}),s(2," Back "),a(),o(3,"button",12),g("click",function(){d(e);let n=c(2);return u(n.stepper.next())}),s(4," Confirm Adjustment "),a()()}if(i&2){let e=c(2);p("ngClass",V(1,Yr,e.currentSubStatus!=e.subStatusEnum.PAID))}}function al(i,t){i&1&&(f(0,"i",56),s(1,"Filter"))}function ll(i,t){i&1&&(o(0,"small",57),s(1,"Outlet option is required."),a())}function sl(i,t){i&1&&(f(0,"i",58),s(1,"Input"))}function ml(i,t){i&1&&(o(0,"th",44),s(1," Expected "),a())}function pl(i,t){i&1&&(o(0,"th",44),s(1," Changes "),a())}function cl(i,t){if(i&1&&(o(0,"td"),s(1),a()),i&2){let e=c().$implicit;l(),I(" ",e.Quantity," ")}}function dl(i,t){if(i&1&&(o(0,"td"),s(1),f(2,"i",65),s(3),v(4,"number"),a()),i&2){let e=c().$implicit;ot("bg-gradient-danger",e.Counted<e.Quantity)("bg-gradient-success",e.Counted>e.Quantity),l(),I(" ",e.Quantity," "),l(2),vt(" ",e.Counted," (",(e.Counted-e.Quantity>0?"+":"")+w(4,7,e.Counted-e.Quantity),") ")}}function ul(i,t){if(i&1){let e=y();o(0,"i",66),g("click",function(){d(e);let n=c().$implicit,m=c(3);return u(m.clear(n))}),a()}}function _l(i,t){if(i&1){let e=y();o(0,"tr")(1,"td"),s(2),a(),o(3,"td",59),s(4),a(),o(5,"td",59),s(6),a(),o(7,"td")(8,"a",60),s(9),a()(),o(10,"td"),s(11),a(),_(12,cl,2,1,"td",46),o(13,"td")(14,"input",61,2),P("ngModelChange",function(n){let m=d(e).$implicit;return D(m.Counted,n)||(m.Counted=n),u(n)}),g("ngModelChange",function(){let n=d(e).$implicit,m=$(15),h=c(3);return u(h.onReset(n,m))}),a()(),_(16,dl,5,9,"td",62),o(17,"td",63),_(18,ul,1,0,"i",64),a()()}if(i&2){let e=t.$implicit,r=t.index,n=c(3);l(2),S(r+1+"."),l(2),I(" ",e.CategoryName," "),l(2),I(" ",e.ProductName," "),l(2),p("routerLink",ne(14,eo))("queryParams",V(15,Di,e.ID)),l(),S(e.Model),l(2),S(e.Code),l(),p("ngIf",n.roleService.inventory.View),l(2),De(V(17,el,e.Counted!==""&&e.Counted!=e.Quantity&&!n.roleService.inventory.View)),p("modifyValueOnWheel",!1),T("ngModel",e.Counted),l(2),p("ngIf",e.Counted!==""&&n.roleService.inventory.View),l(2),p("ngIf",e.Counted!=="")}}function gl(i,t){if(i&1){let e=y();F(0),o(1,"POS-complex-pagination",67),g("jumpToPage",function(){d(e);let n=c(3);return u(n.getProduct(n.filter))})("previousPage",function(){d(e);let n=c(3);return u(n.getProduct(n.filter))})("nextPage",function(){d(e);let n=c(3);return u(n.getProduct(n.filter))}),a(),U()}if(i&2){let e=c(3);l(),p("total",e.products.length)("pageData",V(2,tl,e.filter))}}function fl(i,t){i&1&&(f(0,"i",68),s(1,"Review"))}function Cl(i,t){i&1&&(o(0,"th",44),s(1," Expected "),a())}function hl(i,t){i&1&&(o(0,"th",44),s(1," Differences "),a())}function yl(i,t){if(i&1&&(o(0,"td"),s(1),a()),i&2){let e=c(2).$implicit;l(),I(" ",e.Quantity," ")}}function vl(i,t){if(i&1&&(o(0,"span"),s(1),v(2,"number"),a()),i&2){let e=c(3).$implicit;l(),I("+",w(2,1,e.Counted-e.Quantity),"")}}function Sl(i,t){if(i&1&&(o(0,"span"),s(1),v(2,"number"),a()),i&2){let e=c(3).$implicit;l(),S(w(2,1,e.Counted-e.Quantity))}}function xl(i,t){if(i&1&&(o(0,"td"),_(1,vl,3,3,"span",46)(2,Sl,3,3,"span",46),a()),i&2){let e=c(2).$implicit;l(),p("ngIf",e.Counted>=e.Quantity),l(),p("ngIf",e.Counted<e.Quantity)}}function bl(i,t){if(i&1&&(o(0,"tr")(1,"td"),s(2),a(),o(3,"td",59),s(4),a(),o(5,"td")(6,"a",60),s(7),a()(),o(8,"td"),s(9),a(),_(10,yl,2,1,"td",46),o(11,"td"),s(12),a(),_(13,xl,3,2,"td",46),a()),i&2){let e=c(),r=e.$implicit,n=e.index,m=c(3);ot("soft-yellow",r.Counted<r.Quantity)("soft-green",r.Counted>r.Quantity),l(2),S(n+1+"."),l(2),I(" ",r.ProductName," "),l(2),p("routerLink",ne(13,eo))("queryParams",V(14,Di,r.ID)),l(),S(r.Model),l(2),S(r.Code),l(),p("ngIf",m.roleService.inventory.View),l(2),I(" ",r.Counted," "),l(),p("ngIf",m.roleService.inventory.View)}}function Il(i,t){if(i&1&&(F(0),_(1,bl,14,16,"tr",69),U()),i&2){let e=t.$implicit;l(),p("ngIf",e.Counted!=="")}}function Dl(i,t){i&1&&(f(0,"i",70),s(1,"Finish"))}function Pl(i,t){if(i&1&&(o(0,"div",71),f(1,"i",72),s(2),a()),i&2){let e=c(3);l(2),I("",e.error.error.Message," ")}}function Tl(i,t){if(i&1){let e=y();o(0,"mat-stepper",14,0),g("selectionChange",function(n){d(e);let m=c(2);return u(m.onNextStep(n))}),o(2,"mat-step",15),_(3,al,2,0,"ng-template",16),o(4,"div",17)(5,"div",18)(6,"div",19)(7,"div",18)(8,"h3",20),s(9,"Outlet"),a()(),o(10,"div",21)(11,"ng-select",22,1),g("change",function(){d(e);let n=c(2);return u(n.toggleIsFilterFilled())}),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.filter.EntityID,n)||(m.filter.EntityID=n),u(n)}),a(),_(13,ll,2,0,"small",23),a()()(),o(14,"div",24)(15,"div",19)(16,"div",18)(17,"h3",20),s(18," Category "),o(19,"small",25)(20,"em"),s(21,"Optional"),a()()()(),o(22,"div",21)(23,"POS-product-category-select",26),P("selectedCategoryIDChange",function(n){d(e);let m=c(2);return D(m.filter.CategoryID,n)||(m.filter.CategoryID=n),u(n)}),a()()()(),o(24,"div",24)(25,"div",19)(26,"div",18)(27,"h3",20),s(28," Contain Text "),o(29,"small",25)(30,"em"),s(31,"Optional"),a()()()(),o(32,"div",27)(33,"input",28),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.filter.ProductName,n)||(m.filter.ProductName=n),u(n)}),a()()()(),o(34,"div",24)(35,"div",19)(36,"div",18)(37,"div",29)(38,"h3",30),s(39,"Tag"),a(),o(40,"small",25)(41,"em"),s(42,"Optional"),a()()()(),o(43,"div",27)(44,"ng-select",31),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.filter.TagID,n)||(m.filter.TagID=n),u(n)}),a()()()(),o(45,"div",24)(46,"div",19)(47,"div",18)(48,"h3",20),s(49,"Storage Location"),a()(),o(50,"div",21)(51,"POS-storage-location-select",32),g("selectedCategoryIDChange",function(n){d(e);let m=c(2);return u(m.onSelectStorageLocation(n))}),a()()()(),o(52,"div",24)(53,"div",19)(54,"div",18)(55,"h3",20),s(56," Note "),o(57,"small",25)(58,"em"),s(59,"Optional"),a()()()(),o(60,"div",21)(61,"textarea",33),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.note,n)||(m.note=n),u(n)}),a()()()()()(),o(62,"mat-step",34),_(63,sl,2,0,"ng-template",16),o(64,"div",35)(65,"table",36),g("matSortChange",function(n){d(e);let m=c(2);return u(m.sortData(n))}),o(66,"thead",37)(67,"tr")(68,"th",38),s(69,"No"),a(),o(70,"th",39),s(71," Category "),a(),o(72,"th",40),s(73," Product "),a(),o(74,"th",41),s(75,"Variant"),a(),o(76,"th",42),s(77,"Code"),a(),_(78,ml,2,0,"th",43),o(79,"th",44),s(80,"Counted"),a(),_(81,pl,2,0,"th",43),f(82,"th",38),a()(),o(83,"tbody"),_(84,_l,19,19,"tr",45),a()(),_(85,gl,2,4,"ng-container",46),a()(),o(86,"mat-step",47),_(87,fl,2,0,"ng-template",16),o(88,"div",48)(89,"div",49)(90,"table",50),g("matSortChange",function(n){d(e);let m=c(2);return u(m.sortData(n))}),o(91,"thead",51)(92,"tr"),f(93,"th",38),o(94,"th",52),s(95," Name "),a(),o(96,"th",53),s(97,"Variant"),a(),o(98,"th",44),s(99,"Code"),a(),_(100,Cl,2,0,"th",43),o(101,"th",44),s(102,"Counted"),a(),_(103,hl,2,0,"th",43),a()(),o(104,"tbody"),_(105,Il,2,1,"ng-container",45),a()()()()(),o(106,"mat-step",54),_(107,Dl,2,0,"ng-template",16)(108,Pl,3,1,"div",55),a()()}if(i&2){let e=$(12),r=c(2);p("linear",!0),l(2),p("completed",r.isFilterFilled),l(9),De(V(24,Ya,e.touched&&r.filter.EntityID==null)),p("items",r.loaderData.Entities),T("ngModel",r.filter.EntityID),p("clearable",!1),l(2),p("ngIf",e.touched&&r.filter.EntityID==null),l(10),T("selectedCategoryID",r.filter.CategoryID),p("showClear",!0),l(10),T("ngModel",r.filter.ProductName),l(11),p("items",r.loaderData.AdjustmentTagsOptions),T("ngModel",r.filter.TagID),p("clearable",!1),l(7),p("showClear",!0),l(10),T("ngModel",r.note),l(17),p("ngIf",r.roleService.inventory.View),l(3),p("ngIf",r.roleService.inventory.View),l(3),p("ngForOf",r.products),l(),p("ngIf",r.products.length>0),l(15),p("ngIf",r.roleService.inventory.View),l(3),p("ngIf",r.roleService.inventory.View),l(2),p("ngForOf",r.reviewedItems),l(3),p("ngIf",r.error)}}function wl(i,t){i&1&&(o(0,"div",89),s(1," Difference "),a())}function Ml(i,t){if(i&1&&(o(0,"div",94),s(1),a()),i&2){let e=c().$implicit;De(e.Quantity-e.OriginalQuantity<0?"text-danger":"text-success"),l(),I(" ",(e.Quantity-e.OriginalQuantity>0?"+":" ")+(e.Quantity-e.OriginalQuantity)," ")}}function El(i,t){if(i&1&&(o(0,"div",96)(1,"div",93),s(2),a(),o(3,"div",94),s(4),a(),_(5,Ml,2,3,"div",95),a()),i&2){let e=t.$implicit,r=c(3);l(2),vt("",e.Name," (",e.Model,")"),l(2),S(e.Quantity),l(),p("ngIf",r.roleService.inventory.View)}}function Ol(i,t){if(i&1&&(o(0,"div",94),v(1,"sum"),v(2,"sum"),s(3),v(4,"sum"),v(5,"sum"),v(6,"sum"),v(7,"sum"),a()),i&2){let e=c(3);De(j(1,3,e.displayedItems,"Quantity")-j(2,6,e.displayedItems,"OriginalQuantity")<0?"text-danger":"text-success"),l(3),I(" ",(j(4,9,e.displayedItems,"Quantity")-j(5,12,e.displayedItems,"OriginalQuantity")>0?"+":" ")+(j(6,15,e.displayedItems,"Quantity")-j(7,18,e.displayedItems,"OriginalQuantity"))," ")}}function Al(i,t){if(i&1){let e=y();o(0,"div",73)(1,"div",74)(2,"div",75)(3,"div",76)(4,"h1",77),f(5,"i",70),s(6,"Inventory Adjustment Completed "),a()(),o(7,"div",78)(8,"div",79)(9,"div",80)(10,"a",81),g("click",function(){d(e);let n=c(2);return u(n.newStockCount())}),s(11,"New Adjustment (F8)"),a()()()()()(),o(12,"div",82)(13,"div",75)(14,"div",83)(15,"h2",84)(16,"a",85),s(17),a()()(),o(18,"div",86)(19,"div",87)(20,"div",88),s(21," Product Name (Variant) "),a(),o(22,"div",89),s(23,"Counted"),a(),_(24,wl,2,0,"div",90),a(),_(25,El,6,4,"div",91),o(26,"div",92)(27,"div",93),s(28,"Total"),a(),o(29,"div",94),s(30),v(31,"sum"),a(),_(32,Ol,8,21,"div",95),a()()()()()}if(i&2){let e=c(2);l(16),p("routerLink",ne(10,nl))("queryParams",V(11,Di,e.adjustmentID)),l(),I("Adjustment #",e.completeInfo.InvoiceNumber,""),l(7),p("ngIf",e.roleService.inventory.View),l(),p("ngForOf",e.displayedItems),l(5),S(j(31,7,e.displayedItems,"Quantity")),l(2),p("ngIf",e.roleService.inventory.View)}}function kl(i,t){if(i&1){let e=y();o(0,"mainpanel-cmp",4),P("textChange",function(n){d(e);let m=c();return D(m.filter.ProductName,n)||(m.filter.ProductName=n),u(n)}),g("onSubmit",function(){d(e);let n=c();return u(n.filterProduct())}),o(1,"actions"),_(2,il,2,1,"button",5)(3,rl,5,3,"div",6)(4,ol,5,3,"div",6),a(),o(5,"content"),_(6,Tl,109,26,"mat-stepper",7)(7,Al,33,13,"div",8),a()()}if(i&2){let e=c();p("pageData",e.menuData),T("text",e.filter.ProductName),p("hideSearchBox",e.currentStep!="input")("hideSearchDropdown",!0),l(2),p("ngIf",e.currentStep=="filter"),l(),p("ngIf",e.currentStep=="input"),l(),p("ngIf",e.currentStep=="review"),l(2),p("ngIf",!e.isCompleted),l(),p("ngIf",e.isCompleted)}}var Qn=class i extends Rn{constructor(e,r,n,m,h){super(e,r);this.toastr=n;this.ngZone=m;this.roleService=h;this.isFilterFilled=!1,this.filter={CategoryID:null,EntityID:null,ProductName:"",SupplierID:E.GuidEmpty,RowCount:500,PageNumber:1,TagID:null,StorageID:E.GuidEmpty},this.oldFilter={CategoryID:"dummy",EntityID:"dummy",ProductName:"dummy",SupplierID:"dummy",RowCount:500,PageNumber:1,TagID:null,StorageID:E.GuidEmpty},this.Items=[],this.initSubscriptionStatus()}stepper;isFilterFilled;currentStep="filter";Items;reviewedItems=[];displayedItems=[];note;isCompleted=!1;filter;oldFilter;currentSubStatus;subStatusEnum=Gi;ngOnDestroy(){}initSubscriptionStatus(){this.currentSubStatus=parseInt(localStorage.getItem("SubscriptionStatus"))}onSelectStorageLocation(e){this.filter=N(O({},this.filter),{StorageID:e})}handleF8(){this.currentStep=="finish"&&this.newStockCount()}handleNextButton(){this.stepper&&this.ngZone.run(()=>{this.roleService.adjustment.Create&&(this.isFilterFilled?this.stepper.next():this.validateFilter())})}onReset(e,r){r.value==""&&this.clear(e)}handlePreviousButton(){this.stepper&&this.ngZone.run(()=>{this.stepper.previous()})}toggleIsFilterFilled(){this.isFilterFilled=!0}updateFilterStorage(e){this.filter=N(O({},this.filter),{StorageID:e})}onNextStep(e){if(e.selectedStep.label=="filter")this.currentStep="filter";else if(e.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(e.selectedStep.label=="review"){this.products=this.originalProducts,this.currentStep="review";let r=0;this.products.forEach(n=>{n.Counted!==""&&n.Counted!=n.Quantity&&(n.Status=n.Counted>n.Quantity?"Over":"Under",r++)}),this.reviewedItems=this.products.filter(n=>n.Counted!==""),r&&!this.roleService.inventory.View&&this.toastr.warning("There are some items inventory that does not match! Click next to automatically adjust inventory.",ee.Warning)}else if(e.selectedStep.label=="finish"){this.products=this.originalProducts,this.currentStep="finish",this.Items=[],this.products.forEach(m=>{if(m.Counted!==""){let h={Name:m.ProductName,Cost:m.UnitCost,Price:m.UnitPrice,Quantity:m.Counted,OriginalQuantity:m.Quantity,VariantID:m.ID,Model:m.Model};this.Items.push(h)}});let r={Date:new Date,EntityID:this.filter.EntityID,Note:this.note,ID:this.adjustmentID||E.GuidEmpty,TagID:this.filter.TagID},n={Items:this.Items,Order:r,TypeID:2};this.displayedItems=this.Items.filter(m=>m.Quantity-m.OriginalQuantity!=0),this.submitAdjustment(n)}}validateFilter(){if(!this.isFilterFilled){this.toastr.error("Outlet is required",ee.Error);return}this.stepper.next()}clear(e){e.Counted=""}newStockCount(){window.location.reload()}beforeSubmit(){this.isCompleted=!0}onSubmiterror(){this.isCompleted=!1}sortData(e){let r=this.products.slice();if(!e.active||e.direction===""){this.products=this.originalProducts;return}this.products=r.sort((n,m)=>{let h=e.direction==="asc",x=typeof n[e.active];switch(E.IsEmpty(n.Code)&&(n.Code=""),E.IsEmpty(m.Code)&&(m.Code=""),x){case"string":return E.compare(n[e.active].toLocaleLowerCase(),m[e.active].toLocaleLowerCase(),h);case"number":return E.compare(n[e.active],m[e.active],h);default:return 0}})}filterProduct(){this.filter.PageNumber=1,this.getProduct(this.filter)}static \u0275fac=function(r){return new(r||i)(b(oe),b(A),b(fe),b(Cn),b(L))};static \u0275cmp=M({type:i,selectors:[["POS-spreadsheet-stock-take"]],viewQuery:function(r,n){if(r&1&&Pt(Xa,5),r&2){let m;Tt(m=wt())&&(n.stepper=m.first)}},hostBindings:function(r,n){r&1&&g("keydown.F8",function(){return n.handleF8()},!1,Be)("keydown.ArrowRight",function(){return n.handleNextButton()},!1,Be)("keydown.ArrowLeft",function(){return n.handlePreviousButton()},!1,Be)},standalone:!1,features:[pe],decls:1,vars:1,consts:[["stepper",""],["outletFilter","ngModel"],["input",""],[3,"pageData","text","hideSearchBox","hideSearchDropdown","textChange","onSubmit",4,"ngIf"],[3,"textChange","onSubmit","pageData","text","hideSearchBox","hideSearchDropdown"],["matTooltip","Press right arrow key to go to the next page","class","btn btn-success ms-auto me-0 d-block",3,"disabled","click",4,"ngIf"],["class","mt-5 nb-button",3,"ngClass",4,"ngIf"],[3,"linear","selectionChange",4,"ngIf"],["class","container-fluid row mt-5",4,"ngIf"],["matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success","ms-auto","me-0","d-block",3,"click","disabled"],[1,"mt-5","nb-button",3,"ngClass"],["matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-2",3,"click"],["matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success",3,"click"],["matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-5",3,"click"],[3,"selectionChange","linear"],["label","filter",3,"completed"],["matStepLabel",""],[1,"row","px-5","w-50","mx-auto"],[1,"col-12"],[1,"row"],[1,"fw-normal","text-dark","m-0"],[1,"col-12","mt-3"],["dropdownPosition","bottom","placeholder","Choose an outlet","bindLabel","Name","bindValue","ID",3,"change","ngModelChange","items","ngModel","clearable"],["style","color: red",4,"ngIf"],[1,"col-12",2,"margin-top","25px"],[1,"text-body-secondary","h6"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"col-12","mt-3","mb-0"],["type","text","name","text","placeholder","Type the product name you want to adjust",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","gap-4","align-items-baseline","w-100"],[1,"fw-normal","text-dark","m-0","d-inline-block"],["bindLabel","Name","bindValue","ID","placeholder","Choose an adjustment tag",3,"ngModelChange","items","ngModel","clearable"],["endPoint","api/catalog/product/GetProductStorageOptions",1,"tree-select-as-filter",3,"selectedCategoryIDChange","showClear"],["rows","6","type","text","name","note",1,"form-control",3,"ngModelChange","ngModel"],["label","input"],[1,"container-fluid",2,"height","calc(100vh - 180px)","overflow","auto","padding","0 24px","padding-bottom","20px"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","30px"],["mat-sort-header","CategoryName",2,"width","175px"],["mat-sort-header","ProductName",2,"width","200px"],["mat-sort-header","Model",2,"width","100px"],["mat-sort-header","Code",2,"width","75px"],["style","width: 75px",4,"ngIf"],[2,"width","75px"],[4,"ngFor","ngForOf"],[4,"ngIf"],["label","review"],[1,"container-fluid",2,"padding","0 24px"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom","w-100",2,"table-layout","fixed",3,"matSortChange"],[1,"thead-light"],["mat-sort-header","ProductName",2,"width","175px"],[2,"width","150px"],["label","finish"],["class","alert",4,"ngIf"],[1,"fa-solid","fa-filter","me-3"],[2,"color","red"],[1,"fa-solid","fa-calculator","me-3"],[2,"word-break","break-word"],["target","_blank",2,"color","#0976b4 !important",3,"routerLink","queryParams"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","modifyValueOnWheel","ngModel"],[3,"bg-gradient-danger","bg-gradient-success",4,"ngIf"],[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,"soft-yellow","soft-green",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(r,n){r&1&&_(0,kl,8,9,"mainpanel-cmp",3),r&2&&p("ngIf",n.loaderData)},dependencies:[Pn,Ne,ie,B,de,ae,Ae,q,re,ce,Ge,wn,Tn,Mn,Ue,jt,Nt,Ft,qe,W,Lt],styles:['@import"https://fonts.googleapis.com/icon?family=Material+Icons";ng-select.custom[_ngcontent-%COMP%] .ng-select-container{border:1px solid red!important}.soft-green[_ngcontent-%COMP%]{background-color:#acd1af}.sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{top:0!important}.soft-yellow[_ngcontent-%COMP%]{background-color:#eeee9b}.alert[_ngcontent-%COMP%]{color:#691917;background-color:#f4d6d5;border-color:#f0c5c4}input[_ngcontent-%COMP%]::-webkit-outer-spin-button, input[_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.nb-button[_ngcontent-%COMP%]{position:absolute;right:10px;top:-2px;z-index:9999}.nb-button-override[_ngcontent-%COMP%]{top:40px!important} .mat-horizontal-content-container{padding:0!important} .main-panel-content{padding-bottom:0!important}']})};var Vl=()=>["/menu/Products/Catalog/Products/Info"],jl=i=>({ID:i});function Nl(i,t){if(i&1){let e=y();o(0,"button",13),g("click",function(){d(e);let n=c(2);return u(n.confirmAdjust())}),s(1,"Confirm Adjustment"),a()}}function Fl(i,t){if(i&1){let e=y();o(0,"div")(1,"div",14)(2,"h6"),s(3,"Outlets"),a(),o(4,"ng-select",15),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.EntityID,n)||(m.pageData.Filter.EntityID=n),u(n)}),a()()()}if(i&2){let e=c(2);l(4),p("items",e.pageData.Entities),T("ngModel",e.pageData.Filter.EntityID)}}function Ul(i,t){if(i&1){let e=y();o(0,"tr",16)(1,"td"),f(2,"a",17),a(),f(3,"td",18)(4,"td",18)(5,"td",18)(6,"td",19)(7,"td",19),o(8,"td",20)(9,"input",21),P("ngModelChange",function(n){let m=d(e).$implicit;return D(m.NewQuantity,n)||(m.NewQuantity=n),u(n)}),a()(),o(10,"td",20),s(11),v(12,"number"),a(),o(13,"td")(14,"a",22),g("click",function(){let n=d(e).$implicit,m=c(2);return u(m.confirmAdjust(n))}),s(15,"Adjust"),a()()()}if(i&2){let e=t.$implicit;l(2),p("routerLink",ne(12,Vl))("queryParams",V(13,jl,e.ProductID))("innerHTML",e.ProductName,K),l(),p("innerHTML",e.ParentCode,K),l(),p("innerHTML",e.Model,K),l(),p("innerHTML",e.ParentModel,K),l(),p("innerHTML",e.Ratio,K),l(),p("innerHTML",e.Inventory,K),l(2),T("ngModel",e.NewQuantity),l(2),I(" ",w(12,10,e.Inventory-e.NewQuantity*e.Ratio)," ")}}function Ll(i,t){if(i&1){let e=y();o(0,"mainpanel-cmp",2),g("onSubmit",function(){d(e);let n=c();return u(n.searchFromPageOne())}),P("filterChange",function(n){d(e);let m=c();return D(m.pageData.Filter,n)||(m.pageData.Filter=n),u(n)}),o(1,"actions"),_(2,Nl,2,0,"button",3),a(),o(3,"filters"),_(4,Fl,5,2,"ng-template",null,0,Q),a(),o(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th"),s(13,"Product Name"),a(),o(14,"th",8),s(15,"Code"),a(),o(16,"th",8),s(17,"From"),a(),o(18,"th",8),s(19,"To"),a(),o(20,"th",9),s(21,"Ratio"),a(),o(22,"th",9),s(23,"Inventory"),a(),o(24,"th",10),s(25,"Convert Qty "),a(),o(26,"th",10),s(27,"Remaining"),a(),f(28,"th",11),a()(),o(29,"tbody"),_(30,Ul,16,15,"tr",12),a()()()()()()}if(i&2){let e=c();p("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),T("filter",e.pageData.Filter),l(2),p("ngIf",e.roleService.adjustment.Create),l(28),p("ngForOf",e.Items)}}var Bn=class i extends Ce{constructor(e,r,n,m,h){super(e,r,"Adjustment/GetAdjustToParentList","Outlet/GetByUserAccessWrite");this.toastr=n;this.router=m;this.roleService=h}Items;preGetList(){E.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=this.pageData.Entities[0].ID)}postInit(e){this.Items=e,this.Items.forEach(r=>r.NewQuantity=Math.floor(r.Inventory/r.Ratio))}confirmAdjust(e){let r=[],n=[];if(e?n.push(e):n=this.Items,n.forEach(h=>{let x={VariantID:h.ParentID,Quantity:h.NewQuantity,Cost:h.UnitCost*h.Ratio,Price:h.UnitPrice*h.Ratio};r.push(x),x={VariantID:h.ID,Quantity:h.NewQuantity*h.Ratio*-1,Cost:h.UnitCost,Price:h.UnitPrice},r.push(x)}),r.length<1)return alert("You must atleast have one item to adjust!"),!1;if(E.IsEmpty(this.pageData.Filter.EntityID))return alert("Outlet is require"),!1;let m={Order:{EntityID:this.pageData.Filter.EntityID},Items:r};this.httpService.post("/API/Adjustment/SubmitUseDefault",m).subscribe({next:h=>{h.Success?this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Info"],{queryParams:{ID:h.OrderID}}).then(()=>window.location.reload()):this.toastr.success(h.Message,ee.Success)},error:h=>{this.toastr.error(h,ee.Error)}})}static \u0275fac=function(r){return new(r||i)(b(oe),b(A),b(fe),b(Fe),b(L))};static \u0275cmp=M({type:i,selectors:[["POS-convert-inventory"]],standalone:!1,features:[pe],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(r,n){r&1&&_(0,Ll,31,6,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[ie,B,de,ae,Ae,q,re,ce,Ue,W],encapsulation:2})};function Rl(i,t){if(i&1){let e=y();o(0,"button",12),g("click",function(){d(e);let n=c();return u(n.openExportModal())}),f(1,"i",13),s(2," Export "),a()}}function Ql(i,t){if(i&1){let e=y();o(0,"td",10)(1,"input",17),P("ngModelChange",function(n){d(e);let m=c().$implicit;return D(m.Quantity,n)||(m.Quantity=n),u(n)}),a()()}if(i&2){let e=c().$implicit;l(),T("ngModel",e.Quantity)}}function Bl(i,t){if(i&1&&(o(0,"td",10),s(1),a()),i&2){let e=c().$implicit;l(),I(" ",e==null?null:e.Quantity," ")}}function Hl(i,t){if(i&1){let e=y();o(0,"tr",14)(1,"td")(2,"i",15),g("click",function(){let n=d(e).$index,m=c(2);return u(m.products.splice(n,1))}),a()(),o(3,"td"),s(4),a(),o(5,"td",10),s(6),a(),_(7,Ql,2,1,"td",16)(8,Bl,2,1,"td",16),a()}if(i&2){let e=t.$implicit,r=c(2);l(4),S(e==null?null:e.Name),l(2),S(e==null?null:e.Code),l(),p("ngIf",r.roleService.adjustment.InventoryProductCount),l(),p("ngIf",!r.roleService.adjustment.InventoryProductCount)}}function Wl(i,t){if(i&1&&Ee(0,Hl,9,4,"tr",14,yt),i&2){let e=c();Oe(e.products)}}function ql(i,t){i&1&&(o(0,"tr")(1,"td",18),f(2,"app-empty-state"),a()())}var Hn=class i extends xn{constructor(e,r,n,m,h){super(e);this.httpService=r;this.csvConverter=n;this.roleService=m;this.matDialog=h;this.products=[],this.menuData$.subscribe()}products;onBarcodeEnter(e){let r=this.products.findIndex(n=>n.Code===e);r!=-1?this.products[r].Quantity++:this.httpService.post("/API/catalog/product/ProductCountByCode",{code:e}).subscribe(n=>{n.Quantity=1,this.products.push(n)})}openExportModal(){var e={Products:this.products,Export:!0};this.matDialog.open(Le,{data:{title:"Count Product Inventory",exportTypes:[{ID:"ProductExport/ProductCountInventory",Value:"Default",FileName:"Count Product Inventory"}],filterExport:e,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(b(oe),b(A),b(ke),b(L),b(X))};static \u0275cmp=M({type:i,selectors:[["POS-count-product-inventory"]],standalone:!1,features:[pe],decls:23,vars:7,consts:[[3,"barcodeQueryChange","pageData","hideSearchDropdown","hideSearchBox","showBarcodeScanner","autoFocusBarcodeScanInput"],["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,"content"],[1,"table"],["id","tableGrid",1,"cart","table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],["width","15px"],[1,"text-end"],[1,"text-end",2,"width","150px"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"border-bottom"],[1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],["class","text-end",4,"ngIf"],["type","text","autoNum","",1,"text-end","form-control",3,"ngModelChange","ngModel"],["colspan","4"]],template:function(r,n){r&1&&(o(0,"mainpanel-cmp",0),g("barcodeQueryChange",function(h){return n.onBarcodeEnter(h)}),o(1,"actions"),_(2,Rl,3,0,"button",1),a(),o(3,"content")(4,"div",2)(5,"section",3)(6,"main")(7,"section",4)(8,"div",5)(9,"div",6)(10,"table",7)(11,"thead",8)(12,"tr"),f(13,"th",9),o(14,"th"),s(15,"Name"),a(),o(16,"th",10),s(17,"Code"),a(),o(18,"th",11),s(19,"Qty"),a()()(),o(20,"tbody"),_(21,Wl,2,0)(22,ql,3,0,"tr"),a()()()()()()()()()()),r&2&&(p("pageData",n.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0)("showBarcodeScanner",!0)("autoFocusBarcodeScanInput",!0),l(2),p("ngIf",n.roleService.global.Export),l(19),J(n.products.length>0?21:22))},dependencies:[B,ae,Ae,q,re,Ue,yr],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 Gl(i,t){if(i&1){let e=y();o(0,"button",15),g("click",function(){d(e);let n=c(2);return u(n.openExportModal())}),f(1,"i",16),s(2," Export"),a()}}function zl(i,t){if(i&1){let e=y();o(0,"div")(1,"div",17)(2,"h6"),s(3,"Outlets"),a(),o(4,"ng-select",18),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.EntityID,n)||(m.pageData.Filter.EntityID=n),u(n)}),a(),o(5,"h6"),s(6,"Category"),a(),o(7,"POS-product-category-select",19),P("selectedCategoryIDChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.CategoryID,n)||(m.pageData.Filter.CategoryID=n),u(n)}),a(),o(8,"h6"),s(9,"Sort By"),a(),o(10,"ng-select",20),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.SortByid,n)||(m.pageData.Filter.SortByid=n),u(n)}),a()()()}if(i&2){let e=c(2);l(4),p("items",e.pageData.Options.Entities),T("ngModel",e.pageData.Filter.EntityID),l(3),T("selectedCategoryID",e.pageData.Filter.CategoryID),p("showClear",!0),l(3),p("items",e.pageData.Options.SortBy),T("ngModel",e.pageData.Filter.SortByid)}}function Kl(i,t){if(i&1&&(o(0,"span"),s(1),a()),i&2){let e=t.$implicit;l(),S(e+" ")}}function $l(i,t){if(i&1&&(o(0,"tr")(1,"td"),s(2),a(),o(3,"td"),s(4),a(),o(5,"td",14),s(6),v(7,"number"),a(),o(8,"td",14),s(9),v(10,"number"),a(),o(11,"td",21),_(12,Kl,2,1,"span",11),a()()),i&2){let e=t.$implicit;l(2),S(e.ProductCode),l(2),S(e.ProductName),l(2),S(w(7,5,e.UnitPrice)),l(3),S(w(10,7,e.Qty)),l(3),p("ngForOf",e.Models)}}function Jl(i,t){if(i&1){let e=y();o(0,"mainpanel-cmp",2),g("onSubmit",function(){d(e);let n=c();return u(n.searchFromPageOne())}),P("filterChange",function(n){d(e);let m=c();return D(m.pageData.Filter,n)||(m.pageData.Filter=n),u(n)}),o(1,"actions"),_(2,Gl,3,0,"button",3),a(),o(3,"filters"),_(4,zl,11,6,"ng-template",null,0,Q),a(),o(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),s(12,"Code"),a(),o(13,"th",8),s(14,"Name"),a(),o(15,"th",9),s(16,"UnitPrice"),a(),o(17,"th",10),s(18,"Qty"),a(),o(19,"th"),s(20,"Available Models"),a()()(),o(21,"tbody"),_(22,$l,13,9,"tr",11),a(),o(23,"tfoot")(24,"tr",12),f(25,"td",13),o(26,"td",14),s(27),v(28,"sum"),v(29,"number"),a(),f(30,"td"),a()()()()()()}if(i&2){let e=c();p("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),T("filter",e.pageData.Filter),l(2),p("ngIf",e.roleService.global.Export),l(20),p("ngForOf",e.data.Data),l(5),S(w(29,10,j(28,7,e.data.Data,"Qty")))}}var Wn=class i extends Ce{constructor(e,r,n,m,h){super(e,r,"catalog/product/GetOutletProductSheet","catalog/ProductLoader/GetOutletProductSheet");this.csvConverter=n;this.roleService=m;this.matDialog=h}openExportModal(){this.matDialog.open(Le,{data:{title:"Product Sheet",exportTypes:[{ID:"ProductExport/GetOutletProductSheet",Value:"Default",FileName:"Product Sheet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(b(oe),b(A),b(ke),b(L),b(X))};static \u0275cmp=M({type:i,selectors:[["POS-product-sheet"]],standalone:!1,features:[pe],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(r,n){r&1&&_(0,Jl,31,12,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[ie,B,ae,q,re,ce,qe,W,Lt],encapsulation:2})};var to=hi(gr());var G=class i{INITIAL_STATE={loadForm:{},outlet:{ID:E.GuidEmpty,Name:""},isOpenDialog:!0,isComplete:!1,adjustmentState:0,quickeyItems:{},cartItems:[],order:{Date:(0,to.default)().utcOffset("+07:00").format(),EntityID:"",ID:E.GuidEmpty,StateID:4,TypeID:1,Number:"",PIC:"",Note:"",TagID:0},orderComplete:{},NewOrderID:""};#e=Nr(this.INITIAL_STATE);AppConfigJSON=this.#e.select(t=>t.loadForm().AppConfigJSON);LoadForm=this.#e.select(t=>t.loadForm());IsOpenDialog=this.#e.select(t=>t.isOpenDialog());Outlets=this.#e.select(t=>t.loadForm().Entities);Outlet=this.#e.select(t=>t.outlet());IsComplete=this.#e.select(t=>t.isComplete());QuickeyItems=this.#e.select(t=>t.quickeyItems());AdjustmentTypes=this.#e.select(t=>Array.isArray(t.loadForm().AdjustmentTypes)?t.loadForm().AdjustmentTypes.map(e=>N(O({},e),{Value:e.Value.replaceAll("Adjust Differences","Adjust").replaceAll("Update Inventory","Count")})):t.loadForm().AdjustmentTypes);CartItems=this.#e.select(t=>t.cartItems());QtyCartItems=this.#e.select(t=>t.cartItems().reduce((e,r)=>e+r.Quantity,0));Order=this.#e.select(t=>t.order());OrderComplete=this.#e.select(t=>t.orderComplete());AdjustmentState=this.#e.select(t=>t.adjustmentState());SubTotal=this.#e.select(t=>t.cartItems().reduce((e,r)=>e+r.Price*r.Quantity,0));NewOrderID=this.#e.select(t=>t.NewOrderID());constructor(){switch(this.AdjustmentState()){case 0:this.onChangeIsOpenDialog(!0);break;case 1:this.onChangeIsOpenDialog(!1);break;case 2:this.onChangeIsOpenDialog(!1);break}}onChangeLoadform(t){this.#e.update("loadForm",t)}onChangeIsOpenDialog(t){this.#e.update("isOpenDialog",t)}onChangeOutlet(t){this.#e.update("outlet",t)}onChangeAdjustmentState(t){this.#e.update("adjustmentState",t)}onChangeQuickeyItems(t){this.#e.update("quickeyItems",t)}onChangeCartItems(t){this.#e.update("cartItems",t)}onChangeIsComplete(){this.#e.update("isComplete",!this.IsComplete())}onChangeAdjustmentOrder(t){this.#e.update("order",t)}onChangeOrderComplete(t){this.#e.update("orderComplete",t)}onChangeNewOrderID(t){this.#e.update("NewOrderID",t)}onResetState(){this.#e.reset()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Pi=class{ID;VariantID;Quantity;Cost;Price;Expense;Discount;DiscountAmount;Note;Taxable;LoyaltyPoint;EntityID;UnitQuantity;VariantUnitQuantity;InventoryTypeID;Variant;SalesID;UnitCost;UnitPrice;SplitQuantity;isMaxInventory;PromotionGift;constructor(t,e,r,n,m,h,x,le,te,se,be,Ve,$e,Je,Ze,Xe,Ye,et,tt,nt,it,rt){this.ID=t,this.VariantID=e,this.Quantity=r,this.Cost=n,this.Price=m,this.Expense=h,this.Discount=x,this.DiscountAmount=le,this.Note=te,this.Taxable=se,this.LoyaltyPoint=be,this.EntityID=Ve,this.UnitQuantity=$e,this.VariantUnitQuantity=Je,this.InventoryTypeID=Ze,this.Variant=Xe,this.SalesID=Ye,this.UnitCost=et,this.UnitPrice=tt,this.SplitQuantity=nt,this.isMaxInventory=it,this.PromotionGift=rt}},qn=class i{adapt(t){return new Pi(t.ID??null,t.VariantID??null,t.Quantity??null,t.Cost??null,t.Price??null,t.Expense??null,t.Discount??null,t.DiscountAmount??null,t.Note??null,t.Taxable??null,t.LoyaltyPoint??null,t.EntityID??null,t.UnitQuantity??null,t.VariantUnitQuantity??null,t.InventoryTypeID??null,t.Variant??null,t.SalesID??null,t.UnitCost??null,t.UnitPrice??null,t.SplitQuantity??null,t.isMaxInventory??null,t.PromotionGift??null)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})},Ti=class{constructor(t,e,r,n,m,h,x,le,te,se,be,Ve,$e,Je,Ze,Xe,Ye,et,tt,nt,it,rt,Zt,Xt,Yt,en,tn,nn,rn,on,an){this.ID=t,this.Name=e,this.Code=r,this.UnitCost=n,this.UnitPrice=m,this.UnitExpense=h,this.UnitQuantity=x,this.PriceDiscount=le,this.UnitPriceOriginal=te,this.Description=se,this.UOM=be,this.UOMName=Ve,this.ImageUrl=$e,this.TypeID=Je,this.SellPriceType=Ze,this.OnHand=Xe,this.Ordered=Ye,this.OrderPrice=et,this.OrderPriceDiscount=tt,this.Taxable=nt,this.LoyaltyPoint=it,this.CategoryName=rt,this.CategoryID=Zt,this.CategoryTypeID=Xt,this.PriceNote=Yt,this.PaymentTypeID=en,this.ThumbnailUrl=tn,this.Storage=nn,this.Component=rn,this.PriceBook=on,this.VariantUnitQuantity=an}ID;Name;Code;UnitCost;UnitPrice;UnitExpense;UnitQuantity;PriceDiscount;UnitPriceOriginal;Description;UOM;UOMName;ImageUrl;TypeID;SellPriceType;OnHand;Ordered;OrderPrice;OrderPriceDiscount;Taxable;LoyaltyPoint;CategoryName;CategoryID;CategoryTypeID;PriceNote;PaymentTypeID;ThumbnailUrl;Storage;Component;PriceBook;VariantUnitQuantity},Gn=class i{adapt(t){return new Ti(t.ID??null,t.Name??null,t.Code??null,t.UnitCost??null,t.UnitPrice??null,t.UnitExpense??null,t.UnitQuantity??null,t.PriceDiscount??null,t.UnitPriceOriginal??null,t.Description??null,t.UOM??null,t.UOMName??null,t.ImageUrl??null,t.TypeID??null,t.SellPriceType??null,t.OnHand??null,t.Ordered??null,t.OrderPrice??null,t.OrderPriceDiscount??null,t.Taxable??null,t.LoyaltyPoint??null,t.CategoryName??null,t.CategoryID??null,t.CategoryTypeID??null,t.PriceNote??null,t.PaymentTypeID??null,t.ThumbnailUrl??null,t.Storage??null,t.Component??null,t.PriceBook??null,t.VariantUnitQuantity??null)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var zn=class i{adapt(t){return{ID:t.ID,VariantID:t.VariantID,Quantity:t.Quantity,Cost:t.Cost,Price:t.Price,Expense:t.Expense,Discount:t.Discount,DiscountAmount:t.DiscountAmount,Note:t.Note,Taxable:t.Taxable,Serial:t.Serial,LoyaltyPoint:t.LoyaltyPoint,EntityID:t.EntityID,UnitQuantity:t.UnitQuantity,VariantUnitQuantity:t.VariantUnitQuantity,InventoryTypeID:t.InventoryTypeID,Variant:t.Variant,SalesID:t.SalesID,UnitCost:t.UnitCost,UnitPrice:t.UnitPrice,SplitQuantity:t.SplitQuantity,isMaxInventory:t.IsMaxInventory,PromotionGift:t.PromotionGift}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})},Kn=class i{adapt(t){return{ID:t.ID,Name:t.Name,Code:t.Code,UnitCost:t.UnitCost,UnitPrice:t.UnitPrice,UnitExpense:t.UnitExpense,UnitQuantity:t.UnitQuantity,PriceDiscount:t.PriceDiscount,UnitPriceOriginal:t.UnitPriceOriginal,Description:t.Description,UOM:t.UOM,UOMName:t.UOMName,ImageUrl:t.ImageUrl,TypeID:t.TypeID,SellPriceType:t.SellPriceType,OnHand:t.OnHand,Ordered:t.Ordered,OrderPrice:t.OrderPrice,OrderPriceDiscount:t.OrderPriceDiscount,Taxable:t.OrderPriceDiscount,LoyaltyPoint:t.LoyaltyPoint,CategoryName:t.CategoryName,CategoryID:t.CategoryID,CategoryTypeID:t.CategoryTypeID,PriceNote:t.PriceNote,PaymentTypeID:t.PaymentTypeID,ThumbnailUrl:t.ThumbnailUrl,Storage:t.Storage,Component:t.Component,PriceBook:t.PriceBook,VariantUnitQuantity:t.VariantUnitQuantity}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})},no=class i{adapt(t){return{Number:t.Number,Quantity:t.Quantity,ExpiryDate:t.ExpiryDate}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Re=class i{destroy$=new we;#e=C(G);#t=C(A);#n=C(qn);#i=C(Gn);#r=C(_e);#o=C(zn);#a=C(Kn);constructor(){}processOrder(){let t=[...this.#e.CartItems()].map(e=>N(O({},this.#o.adapt(e)),{EntityID:E.GuidEmpty,Note:e.Note??"",SalesID:e.SalesID??"",isMaxInventory:!1,PromotionGift:!1,SplitQuantity:0,UnitCost:e.Cost,Cost:e.Cost,Variant:N(O({},this.#a.adapt(e.Variant)),{Taxable:!!e.Variant.Taxable})}));if(this.#e.AdjustmentState()===0){let e={Items:[...t],Order:{Date:this.#e.Order().Date,EntityID:this.#e.Outlet().ID,ID:E.GuidEmpty,Number:this.#e.Order().Number,StateID:this.#e.Order().StateID,TypeID:this.#e.Order().TypeID,Note:this.#e.Order().Note,PIC:this.#e.Order().PIC,TagID:this.#e.Order().TagID},NewOrderID:this.#e.NewOrderID()};return this.#t.post(Te.SubmitAdjustment,e).pipe(Ie(this.destroy$))}if(this.#e.AdjustmentState()===1){let e=N(O({},this.#e.LoadForm().Data),{Order:N(O({},this.#e.LoadForm().Data.Order),{Note:this.#e.Order().Note,PIC:this.#e.Order().PIC,TagID:this.#e.Order().TagID,Number:this.#e.Order().Number||this.#e.LoadForm().Data.Order.Number,StateID:this.#e.Order().StateID,Date:this.#e.Order().Date||this.#e.LoadForm().Data.Order.Date}),Items:[...t]});return this.#t.post(Te.SubmitAdjustment,e).pipe(Ie(this.destroy$))}}onUpdateOrderState(t,e){if(Object.keys(this.#e.Order()).includes(t)){let n=N(O({},this.#e.Order()),{[t]:e});this.#e.onChangeAdjustmentOrder(n)}else console.error(`Error updating order state with key ${t}`)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var $t=class i{destroy$=new we;#e=C(A);#t=C(G);#n=C(_e);orderService=C(Re);getLoadForm$=this.#e.post("/API/Adjustment/LoadForm",{EntityID:E.GuidEmpty,ID:E.GuidEmpty}).pipe(vn(),R(t=>{this.#t.onChangeLoadform(t)}));constructor(){}httpRequestLoadForm$(t){return Pe(this.#t.IsComplete,{injector:this.#n}).pipe(Ie(this.destroy$),me(e=>!e),Y(e=>this.#e.post("/API/Adjustment/LoadForm",O({EntityID:"00000000-0000-0000-0000-000000000000",ID:"00000000-0000-0000-0000-000000000000"},t))),R(e=>{this.#t.onChangeLoadform(e),this.orderService.onUpdateOrderState("TypeID",e.AppConfigJSON.ModuleAdjustment.Advance.AdjustmentInputType)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var $n=class i{destroy$=new we;#e=C(G);#t=C(A);#n=C(Re);#i=C(_e);constructor(){this.initialize()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initialize(){Ni([Pe(this.#e.Outlet,{injector:this.#i}),Pe(this.#e.AdjustmentState,{injector:this.#i}),Pe(this.#e.IsComplete,{injector:this.#i})]).pipe(vn(),me(([t,e,r])=>E.IsNotEmpty(t.ID)&&!r),Y(([t,e])=>this.handleStateChange(t,e))).subscribe()}handleStateChange(t,e){switch(e){case 0:return this.handleStateZero(t);case 1:return this.handleStateOne(t);default:return cn}}handleStateZero(t){return this.#t.get(`/api/AdjustmentLoader/LoadRegister?EntityID=${t.ID}&IsEdit=false`).pipe(Ie(this.destroy$),R(e=>{this.#e.onChangeQuickeyItems(e.QuickKey),this.#n.onUpdateOrderState("Number",e.Number),this.#e.onChangeNewOrderID(e.NewOrderID)}))}handleStateOne(t){return this.getQuickey(t.ID).pipe(Ie(this.destroy$),R(e=>{this.#e.onChangeQuickeyItems(e)}))}getQuickey(t){return this.#t.get(Te.GetQuickKeyByEntityID,[{key:"ID",value:t}])}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var wi=class{get Variant(){return this._Variant}set Variant(t){this._Variant=t}get QtyRequested(){return this._QtyRequested}set QtyRequested(t){this._QtyRequested=t}get TotalPrice(){return this._TotalPrice}set TotalPrice(t){this._TotalPrice=t}get SalesName(){return this._SalesName}set SalesName(t){this._SalesName=t}get PriceNote(){return this._PriceNote}set PriceNote(t){this._PriceNote=t}get SalesID(){return this._SalesID}set SalesID(t){this._SalesID=t}get InventoryTypeID(){return this._InventoryTypeID}set InventoryTypeID(t){this._InventoryTypeID=t}get ID(){return this._ID}set ID(t){this._ID=t}get Code(){return this._Code}set Code(t){this._Code=t}get VariantID(){return this._VariantID}set VariantID(t){this._VariantID=t}get Quantity(){return this._Quantity}set Quantity(t){this._Quantity=t}get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(t){this._UnitQuantity=t}get Expense(){return this._Expense}set Expense(t){this._Expense=t}get Cost(){return this._Cost}set Cost(t){this._Cost=t}get Price(){return this._Price}set Price(t){this._Price=t}get Discount(){return this._Discount}set Discount(t){this._Discount=t}get Note(){return this._Note}set Note(t){this._Note=t}get Taxable(){return this._Taxable}set Taxable(t){this._Taxable=t}get LoyaltyPoint(){return this._LoyaltyPoint}set LoyaltyPoint(t){this._LoyaltyPoint=t}get UnitPriceOriginal(){return this._UnitPriceOriginal}set UnitPriceOriginal(t){this._UnitPriceOriginal=t}get DiscountAmount(){return this._DiscountAmount}set DiscountAmount(t){this._DiscountAmount=t}get Name(){return this._Name}set Name(t){this._Name=t}get PriceTypeID(){return this._PriceTypeID}set PriceTypeID(t){this._PriceTypeID=t}get Storage(){return this._Storage}set Storage(t){this._Storage=t}get Serial(){return this._Serial}set Serial(t){this._Serial=t}get ThumbnailUrl(){return this._ThumbnailUrl}set ThumbnailUrl(t){this._ThumbnailUrl=t}get UnitPrice(){return this._UnitPrice}set UnitPrice(t){this._UnitPrice=t}get TypeID(){return this._TypeID}set TypeID(t){this._TypeID=t}get VariantUnitQuantity(){return this._VariantUnitQuantity}set VariantUnitQuantity(t){this._VariantUnitQuantity=t}get UOM(){return this._UOM}set UOM(t){this._UOM=t}get UOMName(){return this._UOMName}set UOMName(t){this._UOMName=t}get SalesCommission(){return this._SalesCommission}set SalesCommission(t){this._SalesCommission=t}_Variant;_QtyRequested;_TotalPrice;_SalesName;_PriceNote;_SalesID;_InventoryTypeID;_ID;_Code;_VariantID;_Quantity;_UnitQuantity;_Expense;_Cost;_Price;_Discount;_Note;_Taxable;_LoyaltyPoint;_UnitPriceOriginal;_DiscountAmount;_Name;_PriceTypeID;_Storage;_Serial;_ThumbnailUrl;_UnitPrice;_TypeID;_VariantUnitQuantity;_UOM;_UOMName;_SalesCommission;constructor(t,e,r,n,m,h,x,le,te,se,be,Ve,$e,Je,Ze,Xe,Ye,et,tt,nt,it,rt,Zt,Xt,Yt,en,tn,nn,rn,on,an,Ci){this._Variant=t,this._QtyRequested=e,this._TotalPrice=r,this._SalesName=n,this._PriceNote=m,this._SalesID=h,this._InventoryTypeID=x,this._ID=le,this._Code=te,this._VariantID=se,this._Quantity=be,this._UnitQuantity=Ve,this._Expense=$e,this._Cost=Je,this._Price=Ze,this._Discount=Xe,this._Note=Ye,this._Taxable=et,this._LoyaltyPoint=tt,this._UnitPriceOriginal=nt,this._DiscountAmount=it,this._Name=rt,this._PriceTypeID=Zt,this._Storage=Xt,this._Serial=Yt,this._ThumbnailUrl=en,this._UnitPrice=tn,this._TypeID=nn,this._VariantUnitQuantity=rn,this._UOM=on,this._UOMName=an,this._SalesCommission=Ci}toJSON(){return{Variant:this.Variant,QtyRequested:this.QtyRequested,TotalPrice:this.TotalPrice,SalesName:this.SalesName,PriceNote:this.PriceNote,SalesID:this.SalesID,InventoryTypeID:this.InventoryTypeID,ID:this.ID,Code:this.Code,VariantID:this.VariantID,Quantity:this.Quantity,UnitQuantity:this.UnitQuantity,Expense:this.Expense,Cost:this.Cost,Price:this.Price,Discount:this.Discount,Note:this.Note,Taxable:this.Taxable,LoyaltyPoint:this.LoyaltyPoint,UnitPriceOriginal:this.UnitPriceOriginal,DiscountAmount:this.DiscountAmount,Name:this.Name,PriceTypeID:this.PriceTypeID,Storage:this.Storage,Serial:this.Serial,ThumbnailUrl:this.ThumbnailUrl,UnitPrice:this.UnitPrice,TypeID:this.TypeID,VariantUnitQuantity:this.VariantUnitQuantity,UOM:this.UOM,UOMName:this.UOMName,SalesCommission:this.SalesCommission}}},Mi=class{get OnHand(){return this._OnHand}set OnHand(t){this._OnHand=t}get CategoryName(){return this._CategoryName}set CategoryName(t){this._CategoryName=t}get CategoryTypeID(){return this._CategoryTypeID}set CategoryTypeID(t){this._CategoryTypeID=t}get PriceTypeID(){return this._PriceTypeID}set PriceTypeID(t){this._PriceTypeID=t}get PriceNote(){return this._PriceNote}set PriceNote(t){this._PriceNote=t}get UnitPriceOriginal(){return this._UnitPriceOriginal}set UnitPriceOriginal(t){this._UnitPriceOriginal=t}get Ordered(){return this._Ordered}set Ordered(t){this._Ordered=t}get BrandName(){return this._BrandName}set BrandName(t){this._BrandName=t}get ImageUrl(){return this._ImageUrl}set ImageUrl(t){this._ImageUrl=t}get ThumbnailUrl(){return this._ThumbnailUrl}set ThumbnailUrl(t){this._ThumbnailUrl=t}get Component(){return this._Component}set Component(t){this._Component=t}get PriceBook(){return this._PriceBook}set PriceBook(t){this._PriceBook=t}get UOMName(){return this._UOMName}set UOMName(t){this._UOMName=t}get Storage(){return this._Storage}set Storage(t){this._Storage=t}get CategoryID(){return this._CategoryID}set CategoryID(t){this._CategoryID=t}get DiscountAmount(){return this._DiscountAmount}set DiscountAmount(t){this._DiscountAmount=t}get VariantUnitQuantity(){return this._VariantUnitQuantity}set VariantUnitQuantity(t){this._VariantUnitQuantity=t}get ProductCreated(){return this._ProductCreated}set ProductCreated(t){this._ProductCreated=t}get ProductID(){return this._ProductID}set ProductID(t){this._ProductID=t}get ProductIndex(){return this._ProductIndex}set ProductIndex(t){this._ProductIndex=t}get Code(){return this._Code}set Code(t){this._Code=t}get TypeID(){return this._TypeID}set TypeID(t){this._TypeID=t}get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(t){this._UnitQuantity=t}get SalesCommission(){return this._SalesCommission}set SalesCommission(t){this._SalesCommission=t}get Description(){return this._Description}set Description(t){this._Description=t}get Image(){return this._Image}set Image(t){this._Image=t}get Discontinued(){return this._Discontinued}set Discontinued(t){this._Discontinued=t}get Taxable(){return this._Taxable}set Taxable(t){this._Taxable=t}get LoyaltyPoint(){return this._LoyaltyPoint}set LoyaltyPoint(t){this._LoyaltyPoint=t}get PackSize(){return this._PackSize}set PackSize(t){this._PackSize=t}get CreatorId(){return this._CreatorId}set CreatorId(t){this._CreatorId=t}get Created(){return this._Created}set Created(t){this._Created=t}get UnitExpense(){return this._UnitExpense}set UnitExpense(t){this._UnitExpense=t}get SellPriceType(){return this._SellPriceType}set SellPriceType(t){this._SellPriceType=t}get VariantType(){return this._VariantType}set VariantType(t){this._VariantType=t}get CostCurrencyID(){return this._CostCurrencyID}set CostCurrencyID(t){this._CostCurrencyID=t}get UnitCost(){return this._UnitCost}set UnitCost(t){this._UnitCost=t}get OrderPrice(){return this._OrderPrice}set OrderPrice(t){this._OrderPrice=t}get OrderPriceDiscount(){return this._OrderPriceDiscount}set OrderPriceDiscount(t){this._OrderPriceDiscount=t}get OrderPriceDiscountDetail(){return this._OrderPriceDiscountDetail}set OrderPriceDiscountDetail(t){this._OrderPriceDiscountDetail=t}get PriceCurrencyID(){return this._PriceCurrencyID}set PriceCurrencyID(t){this._PriceCurrencyID=t}get UnitPrice(){return this._UnitPrice}set UnitPrice(t){this._UnitPrice=t}get PriceDiscount(){return this._PriceDiscount}set PriceDiscount(t){this._PriceDiscount=t}get PaymentTypeID(){return this._PaymentTypeID}set PaymentTypeID(t){this._PaymentTypeID=t}get PaymentTypeString(){return this._PaymentTypeString}set PaymentTypeString(t){this._PaymentTypeString=t}get SellPriceTypeString(){return this._SellPriceTypeString}set SellPriceTypeString(t){this._SellPriceTypeString=t}get Weight(){return this._Weight}set Weight(t){this._Weight=t}get CostCurrencySymbol(){return this._CostCurrencySymbol}set CostCurrencySymbol(t){this._CostCurrencySymbol=t}get PriceCurrencySymbol(){return this._PriceCurrencySymbol}set PriceCurrencySymbol(t){this._PriceCurrencySymbol=t}get UOM(){return this._UOM}set UOM(t){this._UOM=t}get MeasurementID(){return this._MeasurementID}set MeasurementID(t){this._MeasurementID=t}get UOMQ(){return this._UOMQ}set UOMQ(t){this._UOMQ=t}get Name(){return this._Name}set Name(t){this._Name=t}get Model(){return this._Model}set Model(t){this._Model=t}get ID(){return this._ID}set ID(t){this._ID=t}_OnHand;_CategoryName;_CategoryTypeID;_PriceTypeID;_PriceNote;_UnitPriceOriginal;_Ordered;_BrandName;_ImageUrl;_ThumbnailUrl;_Component;_PriceBook;_UOMName;_Storage;_CategoryID;_DiscountAmount;_VariantUnitQuantity;_ProductCreated;_ProductID;_ProductIndex;_Code;_TypeID;_UnitQuantity;_SalesCommission;_Description;_Image;_Discontinued;_Taxable;_LoyaltyPoint;_PackSize;_CreatorId;_Created;_UnitExpense;_SellPriceType;_VariantType;_CostCurrencyID;_UnitCost;_OrderPrice;_OrderPriceDiscount;_OrderPriceDiscountDetail;_PriceCurrencyID;_UnitPrice;_PriceDiscount;_PaymentTypeID;_PaymentTypeString;_SellPriceTypeString;_Weight;_CostCurrencySymbol;_PriceCurrencySymbol;_UOM;_MeasurementID;_UOMQ;_Name;_Model;_ID;constructor(t,e,r,n,m,h,x,le,te,se,be,Ve,$e,Je,Ze,Xe,Ye,et,tt,nt,it,rt,Zt,Xt,Yt,en,tn,nn,rn,on,an,Ci,po,co,uo,_o,go,fo,Co,ho,yo,vo,So,xo,bo,Io,Do,Po,To,wo,Mo,Eo,Oo,Ao,ko){this._OnHand=t,this._CategoryName=e,this._CategoryTypeID=r,this._PriceTypeID=n,this._PriceNote=m,this._UnitPriceOriginal=h,this._Ordered=x,this._BrandName=le,this._ImageUrl=te,this._ThumbnailUrl=se,this._Component=be,this._PriceBook=Ve,this._UOMName=$e,this._Storage=Je,this._CategoryID=Ze,this._DiscountAmount=Xe,this._VariantUnitQuantity=Ye,this._ProductCreated=et,this._ProductID=tt,this._ProductIndex=nt,this._Code=it,this._TypeID=rt,this._UnitQuantity=Zt,this._SalesCommission=Xt,this._Description=Yt,this._Image=en,this._Discontinued=tn,this._Taxable=nn,this._LoyaltyPoint=rn,this._PackSize=on,this._CreatorId=an,this._Created=Ci,this._UnitExpense=po,this._SellPriceType=co,this._VariantType=uo,this._CostCurrencyID=_o,this._UnitCost=go,this._OrderPrice=fo,this._OrderPriceDiscount=Co,this._OrderPriceDiscountDetail=ho,this._PriceCurrencyID=yo,this._UnitPrice=vo,this._PriceDiscount=So,this._PaymentTypeID=xo,this._PaymentTypeString=bo,this._SellPriceTypeString=Io,this._Weight=Do,this._CostCurrencySymbol=Po,this._PriceCurrencySymbol=To,this._UOM=wo,this._MeasurementID=Mo,this._UOMQ=Eo,this._Name=Oo,this._Model=Ao,this._ID=ko}toJSON(){return{OnHand:this.OnHand,CategoryName:this.CategoryName,CategoryTypeID:this.CategoryTypeID,PriceTypeID:this.PriceTypeID,PriceNote:this.PriceNote,UnitPriceOriginal:this.UnitPriceOriginal,Ordered:this.Ordered,BrandName:this.BrandName,ImageUrl:this.ImageUrl,ThumbnailUrl:this.ThumbnailUrl,Component:this.Component,PriceBook:this.PriceBook,UOMName:this.UOMName,Storage:this.Storage,CategoryID:this.CategoryID,DiscountAmount:this.DiscountAmount,VariantUnitQuantity:this.VariantUnitQuantity,ProductCreated:this.ProductCreated,ProductID:this.ProductID,ProductIndex:this.ProductIndex,Code:this.Code,TypeID:this.TypeID,UnitQuantity:this.UnitQuantity,SalesCommission:this.SalesCommission,Description:this.Description,Image:this.Image,Discontinued:this.Discontinued,Taxable:this.Taxable,LoyaltyPoint:this.LoyaltyPoint,PackSize:this.PackSize,CreatorId:this.CreatorId,Created:this.Created,UnitExpense:this.UnitExpense,SellPriceType:this.SellPriceType,VariantType:this.VariantType,CostCurrencyID:this.CostCurrencyID,UnitCost:this.UnitCost,OrderPrice:this.OrderPrice,OrderPriceDiscount:this.OrderPriceDiscount,OrderPriceDiscountDetail:this.OrderPriceDiscountDetail,PriceCurrencyID:this.PriceCurrencyID,UnitPrice:this.UnitPrice,PriceDiscount:this.PriceDiscount,PaymentTypeID:this.PaymentTypeID,PaymentTypeString:this.PaymentTypeString,SellPriceTypeString:this.SellPriceTypeString,Weight:this.Weight,CostCurrencySymbol:this.CostCurrencySymbol,PriceCurrencySymbol:this.PriceCurrencySymbol,UOM:this.UOM,MeasurementID:this.MeasurementID,UOMQ:this.UOMQ,Name:this.Name,Model:this.Model,ID:this.ID}}},Ke=class i{adapt(t){return new wi(t.Variant??null,t.QtyRequested??null,t.TotalPrice??null,t.SalesName??null,t.PriceNote??null,t.SalesID??null,t.InventoryTypeID??null,t.ID??null,t.Code??null,t.VariantID??null,t.Quantity??null,t.UnitQuantity??null,t.Expense??null,t.Cost??null,t.Price??null,t.Discount??null,t.Note??null,t.Taxable??null,t.LoyaltyPoint??null,t.UnitPriceOriginal??null,t.DiscountAmount??null,t.Name??null,t.PriceTypeID??null,t.Storage??null,t.Serial??null,t.ThumbnailUrl??null,t.UnitPrice??null,t.TypeID??null,t.VariantUnitQuantity??null,t.UOM??null,t.UOMName??null,t.SalesCommission??null).toJSON()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})},Jt=class i{adapt(t){return new Mi(t.OnHand??null,t.CategoryName??null,t.CategoryTypeID??null,t.PriceTypeID??null,t.PriceNote??null,t.UnitPriceOriginal??null,t.Ordered??null,t.BrandName??null,t.ImageUrl??null,t.ThumbnailUrl??null,t.Component??null,t.PriceBook??null,t.UOMName??null,t.Storage??null,t.CategoryID??null,t.DiscountAmount??null,t.VariantUnitQuantity??null,t.ProductCreated??null,t.ProductID??null,t.ProductIndex??null,t.Code??null,t.TypeID??null,t.UnitQuantity??null,t.SalesCommission??null,t.Description??null,t.Image??null,t.Discontinued??null,t.Taxable??null,t.LoyaltyPoint??null,t.PackSize??null,t.CreatorId??null,t.Created??null,t.UnitExpense??null,t.SellPriceType??null,t.VariantType??null,t.CostCurrencyID??null,t.UnitCost??null,t.OrderPrice??null,t.OrderPriceDiscount??null,t.OrderPriceDiscountDetail??null,t.PriceCurrencyID??null,t.UnitPrice??null,t.PriceDiscount??null,t.PaymentTypeID??null,t.PaymentTypeString??null,t.SellPriceTypeString??null,t.Weight??null,t.CostCurrencySymbol??null,t.PriceCurrencySymbol??null,t.UOM??null,t.MeasurementID??null,t.UOMQ??null,t.Name??null,t.Model??null,t.ID??null).toJSON()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Zl=i=>({selected:i});function Xl(i,t){if(i&1){let e=y();o(0,"button",9),g("click",function(){let n=d(e).$implicit,m=c();return u(m.onTabChange(n.value))}),s(1),a()}if(i&2){let e=t.$implicit;De(e.class),p("ngClass",V(4,Zl,e.active)),l(),I(" ",e.label," ")}}function Yl(i,t){i&1&&(o(0,"div",10)(1,"strong",11),s(2,"PIC"),a(),f(3,"input",12),a(),o(4,"div",10)(5,"strong",13),s(6,"Note"),a(),f(7,"POS-tinymce-editor",14),a())}function es(i,t){if(i&1){let e=y();o(0,"div",15),f(1,"input",16,0),o(3,"button",17),g("click",function(){d(e);let n=$(2);return u(n.click())}),s(4),a()()}if(i&2){let e=t.$implicit,r=c(2);l(),at("id","tag-",e.ID,""),p("value",e.ID),l(2),ot("active",r.form.get("TagID").value===e.ID),l(),I(" ",e.Name," ")}}function ts(i,t){if(i&1&&(o(0,"div",7),Ee(1,es,5,6,"div",15,yt),a()),i&2){let e=c();l(),Oe(e.storeService.LoadForm().AdjustmentTags)}}var Jn=class i{modalConfig;storeService=C(G);#e=C(Vt);#t=C(he);form;tabs=z([]);activeTab=ct(()=>this.tabs().find(t=>t.active));constructor(){this.modalConfig=new ye,this.modalConfig.customWidth="600px",this.modalConfig.title="Adjustment Note",this.modalConfig.disableKeyup=!0}generateForm(){this.form=this.#e.group({PIC:[this.storeService.Order().PIC||""],Note:[this.storeService.Order().Note||""],TagID:new ut(this.storeService.Order().TagID||this.storeService.LoadForm().AdjustmentTags[0].ID)})}onOK(){let t=this.form.value;this.#t.close(t)}onCancel(){this.#t.close()}ngOnInit(){this.generateForm(),this.tabs.set([{label:"Note",value:"note",active:!0,class:"note-tab"},{label:"Tag",value:"tag",active:!1,class:"tag-tab"}])}handleKeyDown(t){console.log("event",t),t.code==="F2"&&this.onOK()}onTabChange(t){this.tabs.update(e=>e.map(r=>N(O({},r),{active:r.value===t})))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["POS-modal-cart-note"]],hostBindings:function(e,r){e&1&&g("keydown",function(m){return r.handleKeyDown(m)},!1,Be)},decls:12,vars:4,consts:[["tagInput",""],[3,"onOk","onCancel","onClose","config"],[2,"min-height","400px"],[1,"container-fluid"],[1,"row","border-bottom"],[1,"btn","btn-link",3,"class","ngClass"],[1,"w-100","h-100","d-flex","flex-column","gap-4","my-6",3,"formGroup"],[1,"d-flex","flex-wrap","gap-3","mt-3"],[1,"w-100","h-100","d-flex","flex-column","gap-4",3,"formGroup"],[1,"btn","btn-link",3,"click","ngClass"],[1,"w-100"],[1,"mt-3","mb-3"],["type","text","formControlName","PIC",1,"form-control","w-100","height-input"],[1,"mb-3"],["formControlName","Note"],[1,""],["type","radio","formControlName","TagID","name","TagID",1,"d-none",3,"value","id"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(e,r){if(e&1&&(o(0,"modal-material",1),g("onOk",function(){return r.onOK()})("onCancel",function(){return r.onCancel()})("onClose",function(){return r.onCancel()}),o(1,"content")(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),Ee(6,Xl,2,6,"button",5,yt),a()()(),o(8,"div",6),_(9,Yl,8,0)(10,ts,3,0,"div",7),a(),f(11,"div",8),a()()()),e&2){let n;p("config",r.modalConfig),l(6),Oe(r.tabs()),l(2),p("formGroup",r.form),l(),J((n=r.activeTab().value)==="note"?9:n==="tag"?10:-1),l(2),p("formGroup",r.form)}},dependencies:[ue,ve,_t,Ae,Ki,q,Ot,gt,At,kt,ge,Ne,Ct,Wt],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}a.btn.btn-link.note-tab[_ngcontent-%COMP%]{color:inherit}.active[_ngcontent-%COMP%]{background:#dcdcdc;border:1px solid #dcdcdc}"]})};var Zn=class i{modalConfig;#e=C(he);constructor(){this.modalConfig=new ye,this.modalConfig.customWidth="400px",this.modalConfig.title="Void Transaction?"}onOK(){this.#e.close({type:"OK",data:null})}onCancel(){this.#e.close({type:"Cancel",data:null})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["POS-modal-cart-void"]],decls:5,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"fw-normal"]],template:function(e,r){e&1&&(o(0,"modal-material",0),g("onOk",function(){return r.onOK()})("onCancel",function(){return r.onCancel()})("onClose",function(){return r.onCancel()}),o(1,"content")(2,"div",1)(3,"h4",2),s(4,"This will erase all current data. Are you sure?"),a()()()()),e&2&&p("config",r.modalConfig)},dependencies:[ue,ve],encapsulation:2})};var xe=class i{variantSearchCTRL=new ut({});#e=C(G);#t=C(A);#n=C(_e);#i=C(Ke);#r=C(X);#o=C(Jt);destroy$=new we;toastr=C(fe);httpGetVariantByID(t,e=!0){let r={entityID:this.#e.Outlet().ID,id:t};return this.#t.post("/API/catalog/variant/GetVariantByID",r).pipe(Me(n=>this.generateCartItem(n)),R(n=>{e&&this.onAddCartItem(n)}))}httpRequestVariantByCode(t){let{Digit:e,QuantityDivider:r,Regex:n}=this.#e.LoadForm().AppConfigJSON.ModuleAdjustment.DigitalScale;if(t.length===e){let h=new RegExp(n).exec(t);if(Object.is(h,null))return this.#t.get(`${Te.GetVariantByCode}?Code=${t}&EntityID=${this.#e.Outlet().ID}`).pipe(Me(x=>this.generateCartItem(x)),R(x=>{this.onAddCartItem(x)}));{console.log(h,"decodedRegex");let x=h[1],le=parseFloat(h[2]);return le=le/r||1,this.#t.get(`${Te.GetVariantByCode}?Code=${x}&EntityID=${this.#e.Outlet().ID}`).pipe(Me(te=>this.generateCartItem(te)),R(te=>{this.onAddCartItem(te,!1,le)}),pt(te=>(this.toastr.info("Matching Regex Rule to Barcode","Digital Scale"),this.#t.get(`${Te.GetVariantByCode}?Code=${t}&EntityID=${this.#e.Outlet().ID}`).pipe(Me(se=>this.generateCartItem(se)),R(se=>{this.onAddCartItem(se)})))))}}else return this.#t.get(`${Te.GetVariantByCode}?Code=${t}&EntityID=${this.#e.Outlet().ID}`).pipe(Me(m=>this.generateCartItem(m)),R(m=>{this.onAddCartItem(m)}))}httpRequestGetInventoryByVariantID(t){return Pe(this.#e.Outlet,{injector:this.#n}).pipe(Ie(this.destroy$),me(e=>E.IsNotEmpty(e.ID)),_n(),Y(e=>this.#t.get(Te.GetVariantStockByID,[{key:"EntityID",value:e.ID},{key:"ID",value:t}])))}addItemByVariantID(t){this.httpGetVariantByID(t).pipe(Ie(this.destroy$)).subscribe()}onAddCartItem(t,e=!1,r=1){let n=this.#e.CartItems(),m=n.findIndex(x=>x.VariantID===t.VariantID),h=[];m!==-1?e?h=[...n,t]:(n[m].Quantity+=r,h=[...n]):h=[...n,N(O({},t),{Quantity:r})],this.#e.onChangeCartItems(h)}generateCartItem(t){return this.#i.adapt(N(O({},t),{ID:E.GuidEmpty,Cost:t.UnitCost,Expense:t.UnitCost,SplitQuantity:0,UnitCost:t.UnitCost,InventoryTypeID:t.TypeID,Price:t.UnitPrice,Name:t.Name,ThumbnailUrl:t.ThumbnailUrl,UnitPrice:t.UnitPrice,UnitQuantity:t.UnitQuantity,Quantity:1,Code:t.Code,TypeID:t.TypeID,Discount:t.PriceDiscount,EntityID:E.GuidEmpty,VariantUnitQuantity:t.VariantUnitQuantity,Storage:t.Storage,UOM:t.UOM,UOMName:t.UOMName,VariantID:t.ID,Variant:this.#o.adapt(t)}))}onRemoveCartItem(t){let e=this.#e.CartItems().filter((r,n)=>t!==n);this.#e.onChangeCartItems(e)}onOpenCartNoteModal(){return this.#r.open(Jn)}onOpenCartVoidModal(){return this.#r.open(Zn)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var ns=["unitCost"],is=i=>({selected:i}),rs=()=>["/menu/Products/Catalog/Variants/Info"],os=(i,t)=>t.key;function as(i,t){if(i&1){let e=y();o(0,"a",7),g("click",function(){d(e);let n=c().$implicit,m=c();return u(m.onTabChange(n.key))}),s(1),a()}if(i&2){let e=c().$implicit,r=c();p("ngClass",V(2,is,r.activeTab().key===e.key)),l(),I(" ",e.label," ")}}function ls(i,t){if(i&1&&_(0,as,2,4,"a",6),i&2){let e=t.$implicit;J(e.isVisible?0:-1)}}function ss(i,t){i&1&&(o(0,"div",11)(1,"h5"),s(2,"Cost"),a(),f(3,"input",17),a())}function ms(i,t){if(i&1&&(o(0,"div")(1,"div",8)(2,"div",9)(3,"h5"),s(4,"Qty"),a(),f(5,"input",10,0),a(),o(7,"div",11)(8,"h5"),s(9,"Price"),a(),f(10,"input",12),a(),_(11,ss,4,0,"div",13),a(),F(12),o(13,"div",8)(14,"div",14)(15,"h5",15),s(16,"Note"),a(),f(17,"POS-tinymce-editor",16),a()(),U(),a()),i&2){let e=c();l(11),p("ngIf",e.roleService.product.Cost)}}function ps(i,t){if(i&1&&f(0,"img",31),i&2){let e=c(3);p("ngSrc",e.cartItem.ThumbnailUrl)}}function cs(i,t){i&1&&_(0,ps,1,1,"ng-template")}function ds(i,t){i&1&&(F(0),f(1,"i",32),o(2,"h6"),s(3,"No Image"),a(),U())}function us(i,t){if(i&1&&(o(0,"div",14)(1,"table",33)(2,"thead")(3,"tr")(4,"th",34),s(5,"Storage Location"),a()()(),o(6,"tbody")(7,"tr")(8,"td"),s(9),a()()()()()),i&2){let e=c(2);l(9),I(" ",e.cartItem.Variant.Storage," ")}}function _s(i,t){if(i&1&&(F(0),o(1,"div",18)(2,"div",19)(3,"a",20),_(4,cs,1,0)(5,ds,4,0,"ng-container"),a()(),o(6,"div",21)(7,"div",22)(8,"div",14)(9,"div",23),f(10,"i",24),o(11,"div",25),s(12," Inventory "),a()(),o(13,"table",26)(14,"thead")(15,"tr")(16,"th",27),s(17," On Hand "),a(),o(18,"th",27),s(19," Allocated "),a(),o(20,"th",28),s(21," Available "),a()()(),o(22,"tbody")(23,"tr")(24,"td",29),s(25),a(),o(26,"td",29),s(27),a(),o(28,"td",29),s(29),a()()()()(),_(30,us,10,1,"div",30),a()(),f(31,"div",18),a(),U()),i&2){let e=c();l(3),p("routerLink",ne(6,rs)),l(),J(e.cartItem.ThumbnailUrl?4:5),l(21),I(" ",e.inventory().ON_HAND," "),l(2),I(" ",e.inventory().ALLOCATED," "),l(2),I(" ",e.inventory().ON_HAND-e.inventory().ALLOCATED," "),l(),p("ngIf",(e.AppConfigJSON==null||e.AppConfigJSON.ModuleSell==null||e.AppConfigJSON.ModuleSell.Grid==null?null:e.AppConfigJSON.ModuleSell.Grid.StorageVisible)&&e.cartItem.Variant.Storage)}}function gs(i,t){if(i&1){let e=y();o(0,"POS-tab-serial",35),P("variantChange",function(n){d(e);let m=c();return D(m.cartItem,n)||(m.cartItem=n),u(n)}),g("variantChange",function(n){d(e);let m=c();return u(m.onSerialChange(n))}),P("serialsChange",function(n){d(e);let m=c();return D(m.serials,n)||(m.serials=n),u(n)})("isFocusOnSerialInputChange",function(n){d(e);let m=c();return D(m.isFocusOnSerialInput,n)||(m.isFocusOnSerialInput=n),u(n)}),a()}if(i&2){let e=c();p("disabledEditQty",e.isAdjustmentEdit())("disabledAddSerial",e.isAdjustmentEdit())("outletID",e.storeService.Outlet().ID),T("variant",e.cartItem)("serials",e.serials)("isFocusOnSerialInput",e.isFocusOnSerialInput)}}var Xn=class i{constructor(t){this.data=t;this.isAdjustmentEdit.set(this.data.isAdjustmentEdit);let e=this.storeService.CartItems()[this.data.index];this.cartItem=JSON.parse(JSON.stringify(e)),this.modalConfig.title=this.cartItem.Variant.Name,this.modalConfig.customWidth="650px",this.modalConfig.bodyScrollable=!0,this.AppConfigJSON=this.storeService.AppConfigJSON(),Wi(()=>{this.tabs()&&this.tabs()[1].isActive&&this.tabs()[1].isActive&&setTimeout(()=>{this._costElement?.nativeElement?.click(),this._costElement.nativeElement.focus()},500)})}storeService=C(G);roleService=C(L);AppConfigJSON;modalConfig=new ye;cartItem;form;tabs=z([]);activeTab=ct(()=>this.tabs().filter(t=>t.isActive)[0]);isItemSerial=z(!1);inventory=z({ON_HAND:0,ALLOCATED:0,AVAILABLE:0,ROP:0,MAX:0});serials=[];isFocusOnSerialInput=z(!1);_costElement;cdr=C(Hi);#e=C(Vt);#t=C(he);#n=C(Ke);#i=C(xe);#r=C(_e);#o=C(fe);isAdjustmentEdit=z(!1);onTabChange(t){let e=this.tabs().map(r=>r.key===t?N(O({},r),{isActive:!0}):N(O({},r),{isActive:!1}));this.tabs.set(e),this.cdr.detectChanges()}generateForm(){this.form=this.#e.group({Quantity:this.cartItem.Quantity??0,Price:this.cartItem.Price??0,Cost:this.cartItem.Cost??0,Note:this.cartItem.Note??""})}ngOnInit(){this.generateForm(),this.isItemSerial.set(this.checkIsSerial()),this.tabs.set([{key:0,value:"cart",label:"Cart",isActive:!0,isVisible:!0},{key:1,value:"product",label:"Product",isActive:!1,isVisible:this.roleService.inventory.View&&this.cartItem.Variant.Name.length>0},{key:2,value:"serial",label:"Serial",isActive:!1,isVisible:this.checkIsSerial()}]),this.requestUnitInStock().subscribe({next:t=>this.inventory.set(N(O({},this.inventory()),{ALLOCATED:Number(t.Allocated),MAX:Number(t.Max),ON_HAND:Number(t.OnHand),ROP:Number(t.ROP),AVAILABLE:Number(+t.OnHand-+t.Allocated)}))})}onSerialChange(t){let e=this.form.get("Quantity"),r=t.Quantity;e.setValue(r)}onNoteChange(t){this.form.get("Note").setValue(t)}onOK(){if(this.checkIsSerial()){if(this.generateSerials(),Array.isArray(this.cartItem.Serial)&&this.cartItem.Serial.length){let t=this.cartItem.Serial.reduce((r,n)=>r+n.Quantity,0);if(this.form.get("Quantity")?.value!==t){this.#o.warning("Serial must be equal with the quantity",ee.Warning);return}}if(this.cartItem.Quantity<0){let t=this.storeService.CartItems().reduce((e,r,n)=>(this.data.index===n?e.push(O({},this.#n.adapt(N(O({},r),{Quantity:+this.form.get("Quantity")?.value,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):e.push(r),e),[]);this.storeService.onChangeCartItems(t)}if(this.cartItem.Quantity>0){let t=this.storeService.CartItems().reduce((e,r,n)=>(this.data.index===n?e.push(O({},this.#n.adapt(N(O({},r),{Quantity:+this.form.get("Quantity")?.value,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):e.push(r),e),[]);this.storeService.onChangeCartItems(t)}}else{let t=this.storeService.CartItems().reduce((e,r,n)=>(this.data.index===n?e.push(O({},this.#n.adapt(N(O({},r),{Quantity:+this.form.get("Quantity")?.value,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value})))):e.push(r),e),[]);this.storeService.onChangeCartItems(t)}this.#t.close()}checkIsSerial(){return this.cartItem.Variant!==void 0?this.cartItem.Variant.TypeID===4:!1}generateSerials(){if(!this.isFocusOnSerialInput()&&this.serials.length>0){let t=this.serials.map(e=>({Quantity:1,Number:e}));this.cartItem.Serial=[...this.cartItem.Serial,...t]}}requestUnitInStock(){if(E.IsEmpty(this.storeService.Outlet().ID)){this.#o.error("Please select outlet before proceding...",ee.Error);return}return Pe(this.activeTab,{injector:this.#r}).pipe(me(t=>t.key===1),_n(),Y(t=>this.#i.httpRequestGetInventoryByVariantID(this.cartItem.VariantID)))}onCancel(){this.#t.close()}static \u0275fac=function(e){return new(e||i)(b(ft))};static \u0275cmp=M({type:i,selectors:[["adjustment-modal-edit-product"]],viewQuery:function(e,r){if(e&1&&Pt(ns,5),e&2){let n;Tt(n=wt())&&(r._costElement=n.first)}},decls:11,vars:3,consts:[["qty",""],[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"row","border-bottom"],[1,"container-fluid","mt-5",3,"formGroup"],[3,"disabledEditQty","disabledAddSerial","outletID","variant","serials","isFocusOnSerialInput"],[1,"btn","btn-link",3,"ngClass"],[1,"btn","btn-link",3,"click","ngClass"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["formControlName","Price","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],["class","col-auto ps-0",4,"ngIf"],[1,"col-12"],[1,"mb-5"],["formControlName","Note","height","220px"],["formControlName","Cost","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"row"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink"],[1,"col"],[1,"row","row-gap-4"],[1,"d-flex"],["aria-hidden","true",1,"fa-archive","fa-solid","fa-1x","pt-3","pe-2"],[2,"font-size","15px","font-family",'"Roboto Slab"'],[1,"table","table-bordered","text-center","inventory-table"],[1,"table-light","py-6","border-end",2,"text-transform","none"],[1,"table-light","py-6",2,"text-transform","none"],[1,"py-6"],["class","col-12",4,"ngIf"],["width","400","height","400",1,"border","rounded",3,"ngSrc"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"table","table-bordered","text-center"],[1,"table-light"],[3,"variantChange","serialsChange","isFocusOnSerialInputChange","disabledEditQty","disabledAddSerial","outletID","variant","serials","isFocusOnSerialInput"]],template:function(e,r){if(e&1&&(o(0,"modal-material",1),g("onOk",function(){return r.onOK()})("onCancel",function(){return r.onCancel()})("onClose",function(){return r.onCancel()}),o(1,"content")(2,"div",2)(3,"div",3)(4,"div"),Ee(5,ls,1,1,null,null,os),a()()(),o(7,"div",4),_(8,ms,18,1,"div")(9,_s,32,7,"ng-container")(10,gs,1,6,"POS-tab-serial",5),a()()()),e&2){let n;p("config",r.modalConfig),l(5),Oe(r.tabs()),l(2),p("formGroup",r.form),l(),J((n=r.activeTab().key)===0?8:n===1?9:n===2?10:-1)}},dependencies:[ue,ve,ge,Ne,B,gt,Ae,q,Ot,At,kt,Ct,Wt,ln,de,qi,On,Ut,Ue,Sn],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}autocompleteV2[_ngcontent-%COMP%] mat-form-field input{padding:10px 15px!important}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}.inventory-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .inventory-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:6px!important}p-chips[_ngcontent-%COMP%] ul.p-inputtext{width:570px;max-width:570px;border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] ul.p-inputtext li.p-chips-input-token>input[type=text]{border:none}p-chips[_ngcontent-%COMP%] .p-chips .p-chips-multiple-container:not(.p-disabled):hover{border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container{display:inline-block}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container .p-chips-token{margin:2px;background:#96bf48}"]})};function fs(i,t){if(i&1){let e=y();o(0,"div",26)(1,"button",27),g("click",function(){d(e);let n=c().index,m=c(2);return u(m.onReturnVariant(n))}),s(2," Return "),a(),o(3,"button",27),g("click",function(){d(e);let n=c().index,m=c(2);return u(m.onPurchaseVariant(n))}),s(4," Purchase "),a()()}}function Cs(i,t){if(i&1&&(o(0,"td",28),s(1),a()),i&2){let e=c().index;l(),I(" ",e+1,". ")}}function hs(i,t){if(i&1){let e=y();F(0),o(1,"div",29)(2,"img",30),g("error",function(n){d(e);let m=c(3);return u(m.onErrorImage(n))}),a()(),U()}if(i&2){let e=c().$implicit;l(2),p("src",e.Variant.ThumbnailUrl,It)("alt",e.Variant.Name)}}function ys(i,t){i&1&&(o(0,"div",31),f(1,"i",32),a())}function vs(i,t){if(i&1&&(o(0,"span"),s(1),v(2,"number"),a()),i&2){let e=c().$implicit;l(),S(w(2,1,e.Quantity))}}function Ss(i,t){i&1&&(o(0,"span",33),s(1," x "),a())}function xs(i,t){if(i&1&&(o(0,"span"),s(1),v(2,"number"),a()),i&2){let e=c().$implicit;l(),S(w(2,1,e.UnitQuantity))}}function bs(i,t){if(i&1&&(F(0),o(1,"small",34),s(2),a(),U()),i&2){let e=c().$implicit;l(2),S(e.Variant.UOM?e.Variant.UOMName:"")}}function Is(i,t){if(i&1&&(F(0),o(1,"div",35),s(2),v(3,"number"),a(),U()),i&2){let e=c().$implicit;l(2),I(" ",j(3,1,e.Price,"1.0-4")," ")}}function Ds(i,t){if(i&1){let e=y();F(0),o(1,"tr",7),g("click",function(){let n=d(e).index,m=c(2);return u(m.onOpenModalEditProduct(n))}),_(2,fs,5,0,"ng-template",null,1,Q)(4,Cs,2,1,"td",8),o(5,"td",9)(6,"div",10),_(7,hs,3,2,"ng-container",3)(8,ys,2,0,"ng-template",null,2,Q),o(10,"div",11)(11,"div"),s(12),a(),o(13,"span",12),s(14),a(),o(15,"div"),f(16,"app-serial-note",13),a(),f(17,"small",14),a()()(),o(18,"td",15)(19,"div",16)(20,"div",17)(21,"span"),_(22,vs,3,3,"span",18)(23,Ss,2,0,"span",19)(24,xs,3,3,"span",18),a(),_(25,bs,3,1,"ng-container",18),a()()(),o(26,"td"),_(27,Is,4,4,"ng-container",18),a(),o(28,"td",20)(29,"div",16)(30,"div",21),s(31),v(32,"number"),a()()(),o(33,"td",22)(34,"div",23)(35,"span",24),g("click",function(){let n=d(e).index,m=c(2);return u(m.removeCartItem(n))}),f(36,"i",25),a()()()(),U()}if(i&2){let e,r,n=t.$implicit,m=$(3),h=$(9),x=c(2);l(),p("cdkContextMenuTriggerFor",m)("cdkDragDisabled",x.isMobileDevice()),l(3),p("ngIf",(e=x.AppConfigJSON())==null?null:e.ModuleSell.Grid.RowNumberVisible),l(3),p("ngIf",n.Variant.ThumbnailUrl)("ngIfElse",h),l(5),S(n.Variant.Name),l(2),S(n.Variant.Code),l(2),p("serials",n.Serial),l(),p("innerHtml",n.Note,K),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&&((r=x.AppConfigJSON())==null||r.ModuleSell==null?null:r.ModuleSell.Grid.UOMVisible)),l(2),p("ngIf",n.UnitPrice!==n.Total&&n.Quantity>1),l(4),I(" ",x.roleService.product!=null&&x.roleService.product.Price?w(32,15,+(n.Quantity*+n.Price)):" - "," ")}}function Ps(i,t){if(i&1){let e=y();F(0),o(1,"table",4)(2,"tbody",5),g("cdkDropListDropped",function(n){d(e);let m=c();return u(m.onDrop(n))}),_(3,Ds,37,17,"ng-container",6),a()(),U()}if(i&2){let e=c();l(3),p("ngForOf",e.CartItems())}}function Ts(i,t){i&1&&(o(0,"div",36)(1,"div",37)(2,"div",38)(3,"div",39)(4,"div",40),f(5,"i",41),a(),o(6,"div",42)(7,"span"),s(8,"Empty Cart"),a(),f(9,"br"),o(10,"span"),s(11,"Add products to the cart"),a(),f(12,"br"),o(13,"span"),s(14,"or scan barcode"),a()()()()()())}var Yn=class i{roleService=C(L);storeService=C(G);cartService=C(xe);matDialog=C(X);renderer=C(Li);#e=C(Ke);route=C(dt);isAdjustmentEdit=ct(()=>{let t=this.route.snapshot?.queryParams;return E.IsNotEmpty(t.ID)});CartItems=this.storeService.CartItems;AppConfigJSON=this.storeService.AppConfigJSON;onDrop(t){}onOpenModalEditProduct(t){this.matDialog.open(Xn,{data:{index:t,isAdjustmentEdit:this.isAdjustmentEdit()}})}removeCartItem(t){this.cartService.onRemoveCartItem(t)}onErrorImage(t){console.log("img erro",t);let e=t.target;this.renderer.setStyle(e,"border","1px solid #dddddd"),this.renderer.setStyle(e,"border-radius","4px"),this.renderer.setAttribute(e,"alt","")}onReturnVariant(t){let e=this.storeService.CartItems().reduce((r,n,m)=>(t===m?r.push(O({},this.#e.adapt(N(O({},n),{Quantity:-Math.abs(n.Quantity),TotalPrice:-Math.abs(n.Quantity)*n.Price})))):r.push(n),r),[]);this.storeService.onChangeCartItems(e)}onPurchaseVariant(t){let e=this.storeService.CartItems().reduce((r,n,m)=>(t===m?r.push(O({},this.#e.adapt(N(O({},n),{Quantity:Math.abs(n.Quantity),TotalPrice:Math.abs(n.Quantity)*n.Price})))):r.push(n),r),[]);this.storeService.onChangeCartItems(e)}isMobileDevice(){let t=navigator.userAgent||"";return/android|avantgo|bada\/|blackberry|bb10|blazer|compal|elaine|fennec|hiptop|iemobile|iphone|ipod|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|acer|airn|al(av|ca)|amoi|anex|anyw|aptu|ar(ch|go)|as(te|us)|attw|au(di|m)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw(n|u)|c55\/|capi|ccwa|cdm|cell|chtm|cldc|cmd|co(mp|nd)|craw|da(it|ll)|dbte|dc|devi|dica|dmob|do(c|p)o|ds(12|d)|el(ai)|em(l2)|er(ic|k0)|esl8|ez(40|os|wa|ze)|fetc|fly|g1 u|g560|gene|gf5|gmo|go(\.w|od)|gr(ad|un)|haie|hcit|hd(m|p|t)|hei|hi(pt|ta)|hp i|hs(c)|ht(c|tp)|hu(aw|tc)|i(ma|go)|i230|iac|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(v)a|jbro|jemu|jigs|kddi|keji|kgt|klon|kpt |kwc|kyo|le(no|xi)|lg( g|\/k|50)|libw|lynx|m1|m3ga|m50|ma(te|ui|xo)|mc(01|21)|me(rc|ri)|mi(o8|oa)|mmef|mo(01|bi|zz)|mt(50|p1)|mwbp|mywa|n10|n20|n30|n50|n70|ne(c|m)|nok|nzph|o2im|opwv|oran|pdxg|pg(13|c)|phil|pire|pl(ay|uc)|pn|po(ck|se)|prox|psio|pt|qa|qc(07|12|21|60)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55|sa(ma|ny)|sc(01|p)|sdk|se(c|47|mc)|sgh|shar|sie|sk|sl45|sm(al|t5)|so(ft|ny)|sp(01|v)|sy|t2(18|50)|t6(00|18)|ta(gt)|tcl|tdg|tim|tmo|to(pl)|ts(70|m3)|tx|up(\.b)|utst|v400|v750|veri|vi(te)|vk(40)|vm40|voda|vx(52|53|60|70)|w3c|webc|whit|wi(g|nc)|wmlb|wonu|x700|yas|zeto|zte/i.test(t.substring(0,4))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["adjustment-cart-display"]],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","cdkDragDisabled"],["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"],["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(e,r){if(e&1&&_(0,Ps,4,1,"ng-container",3)(1,Ts,15,0,"ng-template",null,0,Q),e&2){let n=$(2);p("ngIf",r.CartItems().length>0)("ngIfElse",n)}},dependencies:[B,lr,ie,ar,qt,W,kr,Or,Er,Ar],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 ei=class i{storeService=C(G);cartService=C(xe);orderService=C(Re);loadFormService=C($t);roleService=C(L);#e=C(Fe);onProcess=new fn;onOpenModalNote=new fn;onOpenModalVoid=new fn;constructor(){}onProcessHandler(){this.onProcess.emit()}onOpenModalNoteHandler(){this.onOpenModalNote.emit(),this.cartService.onOpenCartNoteModal().afterClosed().subscribe({next:e=>{Object.keys(e).forEach(r=>{this.orderService.onUpdateOrderState(r,e[r])})}})}onOpenModalVoidHandler(){this.onOpenModalVoid.emit(),this.cartService.onOpenCartVoidModal().afterClosed().pipe(me(e=>e.type==="OK"),Y(()=>this.loadFormService.getLoadForm$),R(()=>{this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeCartItems([]),this.storeService.onChangeIsOpenDialog(!1),this.#e.navigate(["/menu/Adjustment/Adjustment/Archive/Form"])})).subscribe()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["adjustment-cart-action"]],outputs:{onProcess:"onProcess",onOpenModalNote:"onOpenModalNote",onOpenModalVoid:"onOpenModalVoid"},decls:17,vars:5,consts:[[1,"row","g-0","pb-6","px-5"],[1,"col-5","d-flex","justify-content-between","pe-5",2,"column-gap","12px"],["type","button",1,"btn","btn-gray","fs-3","py-6","headings-font-family",2,"flex-grow","1",3,"click"],[1,"fa-regular","fa-note-sticky","fa-xl"],["type","button",1,"btn","btn-gray","fs-3","px-0","py-6","headings-font-family","d-flex","gap-2","justify-content-center","align-items-center",2,"flex-grow","8",3,"click"],[1,"fa-solid"],[1,"col-7"],["type","button",1,"btn","btn-success","w-100","px-6","py-6","d-flex","justify-content-between","align-items-center","headings-font-family",2,"border-left","0.1px solid #fff","font-size","22px",3,"click"],[1,"fs-6"]],template:function(e,r){e&1&&(o(0,"div",0)(1,"div",1)(2,"button",2),g("click",function(){return r.onOpenModalNoteHandler()}),f(3,"i",3),a(),o(4,"button",4),g("click",function(){return r.onOpenModalVoidHandler()}),f(5,"i",5),o(6,"span"),s(7,"Clear"),a()()(),o(8,"div",6)(9,"button",7),g("click",function(){return r.onProcessHandler()}),o(10,"div"),s(11," Submit "),o(12,"small",8),s(13),a()(),o(14,"div"),s(15),v(16,"number"),a()()()()),e&2&&(l(13),vt("(",r.storeService.CartItems().length," items, ",r.storeService.QtyCartItems()," Qty)"),l(2),S(w(16,3,r.storeService.SubTotal())))},dependencies:[W],styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};function ws(i,t){if(i&1&&(o(0,"div",6)(1,"div",7)(2,"div"),s(3),a(),o(4,"small",8),s(5),a()(),o(6,"div",9)(7,"span"),s(8),v(9,"number"),a()()()),i&2){let e=t.data;l(3),S(e==null?null:e.Value),l(2),S(e==null?null:e.Code),l(3),S(w(9,3,e==null?null:e.UnitPrice))}}var ti=class i{cartService=C(xe);query=new ut({});#e=C(A);storeService=C(G);skipXHR=!1;spinnerService=C(Gr);constructor(){}onBarcodeScan(t){console.log("Scanned barcode:",t),this.cartService.httpRequestVariantByCode(t).pipe().subscribe()}ngOnInit(){this.query.valueChanges.pipe(Ht("query"),me(t=>t&&Object.keys(t).length>0),R(t=>{this.spinnerService.show()}),Y(t=>{this.spinnerService.show();let e;if(t.type==="ID")e=this.cartService.httpGetVariantByID(t.str);else if(t.type==="Code")e=this.cartService.httpRequestVariantByCode(t.str);else return cn;return e.pipe(pt(r=>r.status>=400&&r.status<=451?(console.error("Variant not found:",r.message),dn(null)):un(()=>r)))}),R(()=>{this.spinnerService.hide()})).subscribe({next:t=>{},error:t=>{this.spinnerService.hide(),console.error("An error occurred:",t)}})}onSelectVariant(t){this.cartService.addItemByVariantID(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["adjustment-cart-header"]],decls:7,vars:4,consts:[["itemTemplate",""],[1,"row"],[1,"col"],[1,""],[1,"px-4","py-4"],["inputID","product","requestUrl","/API/AC/GetVariantSuggestionByCodeNNameWithEntityID","prefixIcon","fa fa-barcode","placeholder","Search product by name / code","localStorage","products","notFoundMessageFor","product","data_cy","txt-product",1,"form-control","autocomplete-product",3,"onInputEnter","onSelect","clearOnSelect","useCustomTemplate","itemTemplate","outletId"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"],[1,"ps-4"]],template:function(e,r){if(e&1){let n=y();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"autocompleteV2",5),g("onInputEnter",function(h){return d(n),u(r.onBarcodeScan(h))})("onSelect",function(h){return d(n),u(r.onSelectVariant(h))}),a()(),_(5,ws,10,5,"ng-template",null,0,Q),a()()()}if(e&2){let n=$(6);l(4),p("clearOnSelect",!0)("useCustomTemplate",!0)("itemTemplate",n)("outletId",r.storeService.Outlet().ID)}},dependencies:[ge,W,xr,_t,gt,Rt,We],styles:["[_nghost-%COMP%] autocompleteV2.autocomplete-product>mat-form-field>input{height:38px!important;border-radius:.375rem}[_nghost-%COMP%] autocompleteV2.autocomplete-product>mat-form-field>div.position-relative>span.prefix-icon{top:10px}"]})};var Ei=class{constructor(t,e,r,n,m,h,x,le,te,se,be){this._StateID=t,this._StateLabel=e,this._Success=r,this._Message=n,this._InvoiceID=m,this._OrderID=h,this._InvoiceNumber=x,this._PrintMode=le,this._DeliveryID=te,this._PaymentStateID=se,this._PaymentStateLabel=be}_StateID;get StateID(){return this._StateID}set StateID(t){this._StateID=t}_StateLabel;get StateLabel(){return this._StateLabel}set StateLabel(t){this._StateLabel=t}_Success;get Success(){return this._Success}set Success(t){this._Success=t}_Message;get Message(){return this._Message}set Message(t){this._Message=t}_InvoiceID;get InvoiceID(){return this._InvoiceID}set InvoiceID(t){this._InvoiceID=t}_OrderID;get OrderID(){return this._OrderID}set OrderID(t){this._OrderID=t}_InvoiceNumber;get InvoiceNumber(){return this._InvoiceNumber}set InvoiceNumber(t){this._InvoiceNumber=t}_PrintMode;get PrintMode(){return this._PrintMode}set PrintMode(t){this._PrintMode=t}_DeliveryID;get DeliveryID(){return this._DeliveryID}set DeliveryID(t){this._DeliveryID=t}_PaymentStateID;get PaymentStateID(){return this._PaymentStateID}set PaymentStateID(t){this._PaymentStateID=t}_PaymentStateLabel;get PaymentStateLabel(){return this._PaymentStateLabel}set PaymentStateLabel(t){this._PaymentStateLabel=t}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}}},ii=class i{adapt(t){return new Ei(t.StateID,t.StateLabel,t.Success,t.Message,t.InvoiceID,t.OrderID,t.InvoiceNumber,t.PrintMode,t.DeliveryID,t.PaymentStateID,t.PaymentStateLabel).toJSON()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ms=(i,t)=>t.key;function Es(i,t){if(i&1){let e=y();o(0,"div",3),g("click",function(){let n=d(e).$implicit,m=c();return u(m.submit(n.key))}),f(1,"i",4),s(2),a()}if(i&2){let e=t.$implicit;l(),p("ngClass",e.icon),l(),I(" ",e.label," ")}}var ri=class i{constructor(t,e){this.dialogRef=t;this.data=e;this.config=new ye,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0}config;adjustmentState=z([]);onClose(){this.dialogRef.close({role:"close"})}onCancel(){this.dialogRef.close({role:"cancel"})}ngOnInit(){this.adjustmentState.set([{key:1,value:"draft",label:"Draft",icon:"fa-file-pen"},{key:2,value:"submitted",label:"Submit for Review",icon:"fa-user-magnifying-glass"}])}submit(t){this.dialogRef.close({role:"ok",data:t})}static \u0275fac=function(e){return new(e||i)(b(he),b(ft))};static \u0275cmp=M({type:i,selectors:[["POS-modal-with-approval"]],decls:5,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid","d-flex","gap-3","justify-content-between",2,"width","500px"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid",3,"ngClass"]],template:function(e,r){e&1&&(o(0,"modal-material",0),g("onCancel",function(){return r.dialogRef.close()})("onClose",function(){return r.dialogRef.close()}),o(1,"content")(2,"div",1),Ee(3,Es,3,2,"div",2,Ms),a()()()),e&2&&(p("config",r.config),l(3),Oe(r.adjustmentState()))},dependencies:[ge,Ne,ue,ve],encapsulation:2})};var oi=class i{destroy$=new we;#e=C(Re);#t=C(G);#n=C(ii);injector=C(_e);toastr=C(fe);matDialog=C(X);constructor(){}ngOnInit(){}onProcessOrder(){if(E.IsEmpty(this.#t.Outlet().ID)){this.toastr.error("Please select outlet before proceeding..",ee.Error);return}if(this.#t.CartItems().length==0){this.toastr.error("You must have at least one item.",ee.Error);return}if(E.IsEmpty(this.#t.Order().Number)){this.toastr.error("Number cannot be empty.",ee.Error);return}if(this.#t.Order().TypeID==2){let t=[...this.#t.CartItems()].map(r=>r.VariantID),e=new Set(t);if(t.length!=e.size){this.toastr.error("Count adjustment type doesn't allow the same product/code in different rows. Please check again!","Submit Restricted!");return}}this.#t.AppConfigJSON().ModuleAdjustment.Basic.Workflow==1?this.#e.processOrder().pipe(Ie(this.destroy$)).subscribe({next:t=>{this.#t.onChangeIsComplete(),this.#t.onChangeOrderComplete(this.#n.adapt(t))},error:t=>{console.log("error",t)}}):(console.log(this.#t.Order().StateID),Pe(this.#t.LoadForm,{injector:this.injector}).pipe(Y(t=>!t.Data||t.Data&&t.Data.Order.StateID&&t.Data.Order.StateID==1?this.matDialog.open(ri).afterClosed().pipe(me(e=>e!=null&&e.role==="ok"),R(e=>{let r=e.data;this.#e.onUpdateOrderState("StateID",Number(r))}),Y(()=>this.#e.processOrder())):this.#e.processOrder()),R(t=>{this.#t.onChangeIsComplete(),this.#t.onChangeOrderComplete(this.#n.adapt(t))})).subscribe())}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["adjustment-cart"]],decls:9,vars:0,consts:[[1,"h-100","d-flex","flex-column"],[1,"pt-4"],[1,"row"],[1,"col"],["PinScrollingBottom","",1,"",2,"overflow-y","auto","flex","1 1 0%","max-height","calc(100vh - 170px)"],[1,""],[3,"onProcess"]],template:function(e,r){e&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),f(4,"adjustment-cart-header"),a()()(),o(5,"div",4),f(6,"adjustment-cart-display"),a(),o(7,"div",5)(8,"adjustment-cart-action",6),g("onProcess",function(){return r.onProcessOrder()}),a()()())},dependencies:[Yn,ei,ti,Rr],encapsulation:2})};function Os(i,t){if(i&1&&(o(0,"div",25)(1,"div",26),s(2),a(),o(3,"div",26),s(4),a()()),i&2){let e=t.$implicit;l(2),S(e.Variant.Name),l(2),S(e.Quantity)}}var ai=class i{menu$;storeService=C(G);#e=C(Fe);#t=C(oe);#n=C(yn);cartItems;fullContainerEl=document.getElementById("full-container");constructor(){this.#t.setMenu$(),this.menu$=this.#t.menu$.pipe(Me(t=>N(O({},t),{H:"Inventory Adjustment",T:t.T.replace("undefined","Inventory Adjustment")})),R(t=>this.#n.setTitle(t.T)))}ngAfterViewInit(){this.fullContainerEl.classList.remove("full-container")}ngOnDestroy(){this.fullContainerEl.classList.add("full-container")}handleF8(){this.onNewAdjustment()}onPrintReceipt(){return pn(this,null,function*(){window.open(`/print/Adjustment?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onGotoAdjustmentDetail(){return pn(this,null,function*(){window.open(`/menu/Adjustment/Adjustment/Archive/Info?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onNewAdjustment(){return pn(this,null,function*(){this.storeService.onChangeCartItems([]),yield this.#e.navigate(["menu/Adjustment/Adjustment/Archive/Form"],{queryParams:{}}),this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeIsComplete(),this.storeService.onChangeCartItems([])})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["adjustment-order-complete"]],hostBindings:function(e,r){e&1&&g("keydown.F8",function(){return r.handleF8()},!1,Be)},inputs:{cartItems:"cartItems"},decls:36,vars:11,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"order-complete","mt-6"],[1,"container-fluid"],[1,"row"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"fa-solid","fa-check","me-3"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"card-footer"],[1,"d-flex","justify-content-between","py-5"],["target","_blank",1,"btn","bg-light-gray","btn-secondary",3,"click"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],["target","_blank",1,"",2,"cursor","pointer",3,"href"],[1,"card-body"],["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(e,r){e&1&&(o(0,"mainpanel-cmp",0),v(1,"async"),o(2,"content")(3,"section",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"h1",7),f(10,"i",8),s(11,"Inventory Adjustment Complete "),a()(),o(12,"div",9)(13,"div",10)(14,"div",11)(15,"a",12),g("click",function(){return r.onNewAdjustment()}),s(16," New Adjustment (F8)"),a()()()(),o(17,"div",13)(18,"div",14)(19,"a",15),g("click",function(){return r.onPrintReceipt()}),f(20,"i",16),s(21,"Print Receipt"),a()()()()(),o(22,"div",17)(23,"div",5)(24,"div",18)(25,"h3",19)(26,"a",20),s(27),a()()(),o(28,"div",21),_(29,Os,5,2,"div",22),o(30,"div",23)(31,"div",24),s(32,"Total:"),a(),o(33,"div",24),s(34),v(35,"number"),a()()()()()()()()()()),e&2&&(p("pageData",w(1,7,r.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),l(26),p("href","/menu/Adjustment/Adjustment/Archive/Info?ID="+r.storeService.OrderComplete().OrderID,It),l(),I("Adjustment #",r.storeService.OrderComplete().InvoiceNumber,""),l(2),p("ngForOf",r.cartItems),l(5),I(" ",w(35,9,r.storeService.QtyCartItems())," "))},dependencies:[Et,W,In,ae,ie,bn],styles:[".print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block;text-align:left}.order-complete[_ngcontent-%COMP%]{display:none}}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.125);padding-bottom:.9375rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:2rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{max-width:500px;margin-top:30px;margin-bottom:30px}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle;line-height:15px!important}"]})};var As=["qty"];function ks(i,t){if(i&1&&(o(0,"div",16)(1,"div",17)(2,"div"),s(3),a(),o(4,"small",18),s(5),a()()()),i&2){let e=t.data;l(3),S(e==null?null:e.Value),l(2),S(e==null?null:e.Code)}}var mn=class i{modalConfig=new ye;cartService=C(xe);cartItem=z(null);query=new ut(null);form;#e=C(he);unsubscribe$=new we;#t=C(Vt);quantityRef;focusTimeoutID;ngZone=C(Cn);constructor(){this.modalConfig.customWidth="650px",this.modalConfig.title="Add Item"}onOK(){this.#e.close({type:"OK"});let t=this.cartItem();t.Quantity=this.form.get("Quantity").value,t.Price=this.form.get("Price").value,t.Cost=this.form.get("Cost").value,t.Note=this.form.get("Note").value,this.cartService.onAddCartItem(t,!0,t.Quantity)}onChangeNote(t){this.form.get("Note").setValue(t)}onClose(){this.#e.close({type:"close"})}onCancel(){this.#e.close({type:"cancel"})}initForm(){this.form=this.#t.group({Quantity:[""],Price:[""],Cost:[""],Note:[""]})}ngOnInit(){this.initForm(),this.query.valueChanges.pipe(Ie(this.unsubscribe$),Y(t=>this.cartService.httpGetVariantByID(t,!1).pipe()),Ht("get cart item")).subscribe({next:t=>{this.focusTimeoutID=setTimeout(()=>{this.quantityRef&&this.quantityRef.nativeElement&&(this.quantityRef.nativeElement.focus(),this.quantityRef.nativeElement.select())},0),this.cartItem.set(t),this.form.patchValue({Quantity:t.Quantity,Price:t.Price,Cost:t.Cost,Note:t.Note}),this.modalConfig.title=t.Variant.Name}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete(),this.focusTimeoutID&&clearTimeout(this.focusTimeoutID)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["adjustment-modal-cart-add"]],viewQuery:function(e,r){if(e&1&&Pt(As,5),e&2){let n;Tt(n=wt())&&(r.quantityRef=n.first)}},decls:29,vars:6,consts:[["itemTemplate",""],["qty",""],[3,"onCancel","onClose","onOk","config"],[1,"container","w-100","h-100"],[1,"row"],[1,"col-12"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"keyup.enter","formControl","renderThumbnail","useCustomTemplate","itemTemplate"],[3,"formGroup"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["autoNum","","formControlName","Price","type","text",1,"mt-5","form-control",2,"width","100px"],["autoNum","","formControlName","Cost","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"mb-5"],["formControlName","Note","height","220px"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"]],template:function(e,r){if(e&1){let n=y();o(0,"modal-material",2),g("onCancel",function(){return d(n),u(r.onCancel())})("onClose",function(){return d(n),u(r.onCancel())})("onOk",function(){return d(n),u(r.onOK())}),o(1,"content")(2,"div",3)(3,"div",4)(4,"div",5)(5,"autocompleteV2",6),g("keyup.enter",function(h){return d(n),u(h.stopPropagation())}),a(),_(6,ks,6,2,"ng-template",null,0,Q),a()(),o(8,"div",7)(9,"div",8)(10,"div",9)(11,"h5"),s(12,"Qty"),a(),f(13,"input",10,1),a(),o(15,"div",11)(16,"h5"),s(17,"Price"),a(),f(18,"input",12),a(),o(19,"div",11)(20,"h5"),s(21,"Cost"),a(),f(22,"input",13),a()(),F(23),o(24,"div",8)(25,"div",5)(26,"h5",14),s(27,"Note"),a(),f(28,"POS-tinymce-editor",15),a()(),U(),a()()()()}if(e&2){let n=$(7);p("config",r.modalConfig),l(5),p("formControl",r.query)("renderThumbnail",!0)("useCustomTemplate",!0)("itemTemplate",n),l(3),p("formGroup",r.form)}},dependencies:[Ut,Ue,Rt,We,ue,ve,Cr,gt,Ae,q,Ot,$i,At,kt,Ct,Wt],encapsulation:2})};var ro=hi(Vo());function Vs(i,t){if(i&1){let e=y();F(0),o(1,"POS-uppy",3),g("onParser",function(n){d(e);let m=c(2);return u(m.onParser(n))})("fileUploaded",function(n){d(e);let m=c(2);return u(m.onUploadCsv(n))})("fileRemoved",function(){d(e);let n=c(2);return u(n.onRemovedFile())}),a(),U()}if(i&2){let e=c(2);l(),p("sampleUrl",e.sampleURL)}}function js(i,t){if(i&1){let e=y();F(0),o(1,"POS-uppy",3),g("onParser",function(n){d(e);let m=c(2);return u(m.onParser(n))})("fileUploaded",function(n){d(e);let m=c(2);return u(m.onUploadCsv(n))})("fileRemoved",function(){d(e);let n=c(2);return u(n.onRemovedFile())}),a(),U()}if(i&2){let e=c(2);l(),p("sampleUrl",e.sampleURL)}}function Ns(i,t){if(i&1&&_(0,Vs,2,1,"ng-container",2)(1,js,2,1,"ng-container",2),i&2){let e=c();p("ngIf",e.uploadState()===e.uploadStateEnum.Idle||e.uploadState()===e.uploadStateEnum.Uploading),l(),p("ngIf",e.uploadState()===e.uploadStateEnum.Success||e.uploadState()===e.uploadStateEnum.Error)}}var li=class i{modalConfig;sampleURL;fileInput=z(null);unsubscribe$=new we;#e=C(he);#t=C(A);#n=C(G);#i=C(xe);#r=C(_e);cartItem=z([]);skipEmptyLines=!0;rowCount=z(0);rowEmpty=z(0);totalRows=ct(()=>this.rowCount()-this.rowEmpty());file=z(null);uploadState=z(0);uploadStateEnum=En;constructor(){this.modalConfig=new ye,this.modalConfig.title="Import Items",this.modalConfig.customWidth="500px",this.sampleURL="https://cdn.dealpos.xyz/web-import-template/ImportItem_Adjustment_TemplateV2.csv"}onOK(){this.uploadState.set(1);let t={EntityID:this.#n.Outlet().ID,CartItems:this.cartItem()};return this.#t.post("/API/Adjustment/UploadCsvV2",t).pipe(Ht("response"),pt(e=>(e instanceof hn&&this.uploadState.set(3),[])),R(e=>{Array.isArray(e)&&e.length>0&&(this.uploadState.set(2),e.map(r=>(delete r?.Discount,delete r?.DiscountAmount,r)).forEach(r=>{this.#i.onAddCartItem(r,!0,r.Quantity)}),this.#e.close())}),gn(1)).subscribe()}onCancel(){this.#e.close()}onClose(){this.#e.close()}assignFile(t){this.fileInput.set(t)}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}ngOnInit(){}onRemovedFile(){this.file.set(null),this.rowCount.set(0),this.rowEmpty.set(0)}onUploadCsv(t){let e;t instanceof Blob&&(e=new File([t],"file.csv",{type:t.type})),t instanceof File&&(e=t),this.file.set(e),ro.default.parse(e,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:r=>{let n=r.split(/\r?\n/).slice(1);return n[n.length-1]===""&&n.pop(),this.rowCount.set(n.length),n.forEach(m=>{m.split(",").every(x=>x==="")&&this.rowEmpty.update(x=>x+=1)}),r},error(r,n){console.log("ERROR",r,n)},complete:(r,n)=>{console.log("COMPLETE",r),this.cartItem.set(r.data),console.log("row count",this.rowCount),console.log("row empy",this.rowEmpty)}})}onParser(t){console.log("row",t),this.cartItem.set(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["adjustment-modal-cart-upload"]],decls:3,vars:1,consts:[["modalContent",""],[3,"onOk","onCancel","onClose","config"],[4,"ngIf"],[3,"onParser","fileUploaded","fileRemoved","sampleUrl"]],template:function(e,r){if(e&1){let n=y();o(0,"modal-material",1),g("onOk",function(){return d(n),u(r.onOK())})("onCancel",function(){return d(n),u(r.onClose())})("onClose",function(){return d(n),u(r.onClose())}),_(1,Ns,2,2,"ng-template",null,0,Q),a()}e&2&&p("config",r.modalConfig)},dependencies:[ge,B,ue,ve,Gt],encapsulation:2})};function Fs(i,t){if(i&1){let e=y();o(0,"li",11),g("click",function(){let n=d(e).$implicit,m=c(3);return u(m.onClickMenu(n))}),f(1,"POS-dropdown-item-more-action",12),a()}if(i&2){let e=t.$implicit;l(),p("icon",e.icon)("label",e.title)}}function Us(i,t){if(i&1&&Ee(0,Fs,2,2,"li",10,yi),i&2){let e=c().$implicit;Oe(e.children)}}function Ls(i,t){if(i&1&&(o(0,"div",7)(1,"div",8),s(2),a(),f(3,"div",9),_(4,Us,2,0),a()),i&2){let e=t.$implicit;l(2),S(e.title),l(2),J(e.children.length>0?4:-1)}}var si=class i{menu=z([]);#e=C(X);router=C(Fe);handleF8(){this.#e.openDialogs&&this.#e.openDialogs.length>0||this.#e.open(mn)}constructor(){}ngOnInit(){this.#t()}#t(){let t=[{title:"Item",icon:"",children:[{title:"Add",value:"add",icon:"fa-circle-plus fa-solid"},{title:"Upload",icon:"fa-solid fa-upload",value:"upload"}]}];this.menu.set(t)}onClickMenu(t){switch(t.value){case"add":this.#e.open(mn);break;case"upload":this.#e.open(li);break}}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["adjustment-more-actions"]],hostBindings:function(e,r){e&1&&g("keydown.F4",function(m){return r.handleF8(m)},!1,Be)},decls:10,vars:0,consts:[["id","moreMenu","data-bs-toggle","dropdown",1,"d-flex","align-items-center","cursor-pointer"],[1,"me-2"],[1,"fa-solid","fa-caret-down","fa-lg"],[1,"fs-6","headings-font-family","pb-1"],[1,"h-100","d-flex","align-items-center","justify-content-between"],["aria-labelledby","moreMenu",1,"dropdown-menu","more-actions",2,"min-width","150px"],[1,"d-flex"],[1,"dropdown-header","text-dark","col"],[1,"h5","mb-4"],[1,"dropdown-divider","m-0"],[1,"cursor-pointer"],[1,"cursor-pointer",3,"click"],[3,"icon","label"]],template:function(e,r){e&1&&(o(0,"span",0)(1,"span",1),f(2,"i",2),a(),o(3,"span",3),s(4,"More Actions"),a()(),o(5,"div",4)(6,"div",5)(7,"div",6),Ee(8,Ls,5,2,"div",7,yi),a()()()),e&2&&(l(8),Oe(r.menu()))},dependencies:[jr],encapsulation:2})};var Oi=class{constructor(t,e,r,n){this._Order=t,this._Items=e,this._OrderItems=r,this._CountedItems=n}_Order;get Order(){return this._Order}set Order(t){this._Order=t}_Items;get Items(){return this._Items}set Items(t){this._Items=t}_OrderItems;get OrderItems(){return this._OrderItems}set OrderItems(t){this._OrderItems=t}_CountedItems;get CountedItems(){return this._CountedItems}set CountedItems(t){this._CountedItems=t}},mi=class i{adapt(t){return new Oi(t.Order,t.Items,t.OrderItems,t.CountedItems)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})},Ai=class{constructor(t,e,r,n,m,h,x,le,te,se,be,Ve,$e,Je,Ze,Xe,Ye,et,tt,nt,it,rt){this._EntityID=t,this._Number=e,this._Date=r,this._PIC=n,this._Note=m,this._EntityName=h,this._StateID=x,this._StateLabel=le,this._ReviewDate=te,this._ReviewerID=se,this._TypeID=be,this._TypeLabel=Ve,this._Quantity=$e,this._UnitPrice=Je,this._UnitCost=Ze,this._TotalPrice=Xe,this._AdjustedQuantity=Ye,this._CreatorID=et,this._Created=tt,this._ModifierID=nt,this._Modified=it,this._ID=rt}_EntityID;get EntityID(){return this._EntityID}set EntityID(t){this._EntityID=t}_Number;get Number(){return this._Number}set Number(t){this._Number=t}_Date;get Date(){return this._Date}set Date(t){this._Date=t}_PIC;get PIC(){return this._PIC}set PIC(t){this._PIC=t}_Note;get Note(){return this._Note}set Note(t){this._Note=t}_EntityName;get EntityName(){return this._EntityName}set EntityName(t){this._EntityName=t}_StateID;get StateID(){return this._StateID}set StateID(t){this._StateID=t}_StateLabel;get StateLabel(){return this._StateLabel}set StateLabel(t){this._StateLabel=t}_ReviewDate;get ReviewDate(){return this._ReviewDate}set ReviewDate(t){this._ReviewDate=t}_ReviewerID;get ReviewerID(){return this._ReviewerID}set ReviewerID(t){this._ReviewerID=t}_TypeID;get TypeID(){return this._TypeID}set TypeID(t){this._TypeID=t}_TypeLabel;get TypeLabel(){return this._TypeLabel}set TypeLabel(t){this._TypeLabel=t}_Quantity;get Quantity(){return this._Quantity}set Quantity(t){this._Quantity=t}_UnitPrice;get UnitPrice(){return this._UnitPrice}set UnitPrice(t){this._UnitPrice=t}_UnitCost;get UnitCost(){return this._UnitCost}set UnitCost(t){this._UnitCost=t}_TotalPrice;get TotalPrice(){return this._TotalPrice}set TotalPrice(t){this._TotalPrice=t}_AdjustedQuantity;get AdjustedQuantity(){return this._AdjustedQuantity}set AdjustedQuantity(t){this._AdjustedQuantity=t}_CreatorID;get CreatorID(){return this._CreatorID}set CreatorID(t){this._CreatorID=t}_Created;get Created(){return this._Created}set Created(t){this._Created=t}_ModifierID;get ModifierID(){return this._ModifierID}set ModifierID(t){this._ModifierID=t}_Modified;get Modified(){return this._Modified}set Modified(t){this._Modified=t}_ID;get ID(){return this._ID}set ID(t){this._ID=t}},oo=class i{adapt(t){return new Ai(t.EntityID,t.Number,t.Date,t.PIC,t.Note,t.EntityName,t.StateID,t.StateLabel,t.ReviewDate,t.ReviewerID,t.TypeID,t.TypeLabel,t.Quantity,t.UnitPrice,t.UnitCost,t.TotalPrice,t.AdjustedQuantity,t.CreatorID,t.Created,t.ModifierID,t.Modified,t.ID)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})},ki=class{constructor(t,e,r,n,m,h,x,le,te,se,be,Ve){this._LostNFoundID=t,this._UnitCost=e,this._InventoryTypeID=r,this._UnitPrice=n,this._Discount=m,this._VariantID=h,this._Note=x,this._Quantity=le,this._UnitQuantity=te,this._Index=se,this._Serial=be,this._ID=Ve}_LostNFoundID;get LostNFoundID(){return this._LostNFoundID}set LostNFoundID(t){this._LostNFoundID=t}_UnitCost;get UnitCost(){return this._UnitCost}set UnitCost(t){this._UnitCost=t}_InventoryTypeID;get InventoryTypeID(){return this._InventoryTypeID}set InventoryTypeID(t){this._InventoryTypeID=t}_UnitPrice;get UnitPrice(){return this._UnitPrice}set UnitPrice(t){this._UnitPrice=t}_Discount;get Discount(){return this._Discount}set Discount(t){this._Discount=t}_VariantID;get VariantID(){return this._VariantID}set VariantID(t){this._VariantID=t}_Note;get Note(){return this._Note}set Note(t){this._Note=t}_Quantity;get Quantity(){return this._Quantity}set Quantity(t){this._Quantity=t}_UnitQuantity;get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(t){this._UnitQuantity=t}_Index;get Index(){return this._Index}set Index(t){this._Index=t}_Serial;get Serial(){return this._Serial}set Serial(t){this._Serial=t}_ID;get ID(){return this._ID}set ID(t){this._ID=t}},ao=class i{adapt(t){return new ki(t.LostNFoundID,t.UnitCost,t.InventoryTypeID,t.UnitPrice,t.Discount,t.VariantID,t.Note,t.Quantity,t.UnitQuantity,t.Index,t.Serial,t.ID)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})},Vi=class{constructor(t,e,r,n,m,h,x,le,te,se,be,Ve){this._ParentID=t,this._Start=e,this._Finish=r,this._UnitPrice=n,this._UnitCost=m,this._VariantID=h,this._Note=x,this._Quantity=le,this._UnitQuantity=te,this._Index=se,this._Serial=be,this._ID=Ve}_ParentID;get ParentID(){return this._ParentID}set ParentID(t){this._ParentID=t}_Start;get Start(){return this._Start}set Start(t){this._Start=t}_Finish;get Finish(){return this._Finish}set Finish(t){this._Finish=t}_UnitPrice;get UnitPrice(){return this._UnitPrice}set UnitPrice(t){this._UnitPrice=t}_UnitCost;get UnitCost(){return this._UnitCost}set UnitCost(t){this._UnitCost=t}_VariantID;get VariantID(){return this._VariantID}set VariantID(t){this._VariantID=t}_Note;get Note(){return this._Note}set Note(t){this._Note=t}_Quantity;get Quantity(){return this._Quantity}set Quantity(t){this._Quantity=t}_UnitQuantity;get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(t){this._UnitQuantity=t}_Index;get Index(){return this._Index}set Index(t){this._Index=t}_Serial;get Serial(){return this._Serial}set Serial(t){this._Serial=t}_ID;get ID(){return this._ID}set ID(t){this._ID=t}},lo=class i{adapt(t){return new Vi(t.ParentID,t.Start,t.Finish,t.UnitPrice,t.UnitCost,t.VariantID,t.Note,t.Quantity,t.UnitQuantity,t.Index,t.Serial,t.ID)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var so=hi(gr());function Rs(i,t){if(i&1&&(F(0),f(1,"adjustment-order-complete",2),U()),i&2){let e=c();l(),p("cartItems",e.storeService.CartItems())}}function Qs(i,t){if(i&1){let e=y();o(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"POS-select-outlet-form",8),v(6,"async"),g("ngModelChange",function(n){d(e);let m=c();return u(m.storeService.onChangeOutlet(n))}),a(),o(7,"POS-invoice-number-form",9),v(8,"async"),g("ngModelChange",function(n){d(e);let m=c();return u(m.onInvoiceNumberChange(n))}),a()(),o(9,"POS-invoice-date",10),g("ngModelChange",function(n){d(e);let m=c();return u(m.onChangeOrderDate(n))}),a()()(),o(10,"div",11)(11,"div",12)(12,"div",13),f(13,"adjustment-more-actions"),a(),o(14,"div",14),f(15,"i",15),o(16,"ng-select",16),g("ngModelChange",function(n){d(e);let m=c();return u(m.onChangeAdjustmentType(n))}),a()()()()(),o(17,"div",17)(18,"div",18)(19,"POS-quick-key",19),g("onSelectVariant",function(n){d(e);let m=c();return u(m.onSelectVariant(n))}),a()(),o(20,"div",20),f(21,"adjustment-cart"),a()()()}if(i&2){let e=c();l(5),p("disabled",e.storeService.AdjustmentState()===1)("isOpenAfterLoad",w(6,16,e.isOpenDiaglog$))("outlets",e.storeService.Outlets())("ngModel",e.storeService.Outlet()),l(2),p("ngModel",e.storeService.Order().Number)("transactionType",w(8,18,e.transactionType$))("disabled",!(e.roleService.global!=null&&e.roleService.global.Number)),l(2),p("ngModel",e.storeService.Order().Date)("disabled",!(e.roleService.global!=null&&e.roleService.global.Date))("tooltip",e.roleService.global!=null&&e.roleService.global.Date?"":"Date role is required"),l(7),p("clearable",!1)("ngModel",e.storeService.Order().TypeID)("disabled",!!e.storeService.Order().TypeID&&e.storeService.AdjustmentState()===1)("items",e.storeService.AdjustmentTypes()),l(3),p("quickKey",e.storeService.QuickeyItems())("outletID",e.storeService.Outlet().ID)}}var pi=class i{isOpenDialog=z(!0);loadFormService=C($t);intercom=C(Ji);storeService=C(G);quickeyService=C($n);cartService=C(xe);orderService=C(Re);isOpenDiaglog$;Outlets$;loadForm$;adjustmentEditDataAdapter=C(mi);roleService=C(L);#e=C(Ke);#t=C(Jt);#n=C(dt);transactionType$=this.#n.queryParamMap.pipe(Me(t=>(t.has("ID"),"Adjustment")));title=C(yn);injector=C(_e);test=[];ngOnInit(){this.storeService.onResetState(),this.intercom.hideLauncher();let t=JSON.parse(localStorage.getItem("AccountInfo"));this.title.setTitle(t.BrandName+" POS | Inventory Adjustment"),this.test=this.storeService.Outlets()&&this.storeService.Outlets().filter((e,r)=>r===0),this.#n.queryParamMap.pipe(Y(e=>{if(e.has("ID")){this.storeService.onChangeAdjustmentState(1);let r={EntityID:"00000000-0000-0000-0000-000000000000",ID:e.get("ID")};return this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeAdjustmentState(1),this.loadFormService.httpRequestLoadForm$(r).pipe(R(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 m=n.Data.Items.map(h=>this.#e.adapt(N(O({},h),{Variant:this.#t.adapt(h.Variant)})));if(this.storeService.onChangeCartItems(m),this.orderService.onUpdateOrderState("PIC",n.Data.Order.PIC),this.orderService.onUpdateOrderState("Note",n.Data.Order.Note),this.orderService.onUpdateOrderState("TagID",n.Data.Order.TagID),n.Entities.length>0){let h=n.Entities.findIndex(x=>x.ID===n.Data.Order.EntityID);h!==-1&&this.storeService.onChangeOutlet(n.Entities[h])}}}))}return this.storeService.onChangeAdjustmentState(0),this.loadFormService.httpRequestLoadForm$()})).subscribe({}),Pe(this.storeService.IsOpenDialog,{injector:this.injector}).pipe().subscribe(),this.isOpenDiaglog$=Pe(this.storeService.IsOpenDialog,{injector:this.injector})}onChangeAdjustmentType(t){let e=this.storeService.AdjustmentTypes().filter(r=>r.Key===t)[0];this.orderService.onUpdateOrderState("TypeID",e.Key)}onInvoiceNumberChange(t){this.orderService.onUpdateOrderState("Number",t)}onChangeOrderDate(t){this.orderService.onUpdateOrderState("Date",(0,so.default)(t).startOf("day").format("YYYY-MM-DDTHH:mm:ss.SSS"))}onSelectVariant(t){this.cartService.addItemByVariantID(t)}ngOnDestroy(){this.storeService.onResetState(),this.intercom.showLauncher()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["POS-adjustment-v2"]],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(e,r){if(e&1&&_(0,Rs,2,1,"ng-container",1)(1,Qs,22,20,"ng-template",null,0,Q),e&2){let n=$(2);p("ngIf",r.storeService.IsComplete())("ngIfElse",n)}},dependencies:[B,Et,vr,wr,Mr,Tr,_t,q,re,ce,oi,ai,si],styles:[".left-toolbar-container[_ngcontent-%COMP%]{position:relative}.left-toolbar-container[_ngcontent-%COMP%] POS-invoice-number-form[_ngcontent-%COMP%]{position:absolute;top:34px;left:32px}.header[_ngcontent-%COMP%]{min-height:60px}.content[_ngcontent-%COMP%]{height:calc(100vh - 60px);overflow:hidden}.supplier-more-menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.cart-display[_ngcontent-%COMP%]{flex-grow:1;height:0px;overflow-y:auto}input[_ngcontent-%COMP%]{width:100%;height:38px!important;border:0;border-bottom:1px solid #ced4da;padding-left:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i[_ngcontent-%COMP%]{font-size:16px;top:10.6px;left:13px}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]{transition:.4s}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(1){-webkit-transform:rotate(-45deg) translate(-8px,4px);transform:rotate(-45deg) translate(-8px,4px)}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(2){opacity:0}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(45deg) translate(-5px,0px);transform:rotate(45deg) translate(-5px)}.mobile-button[_ngcontent-%COMP%]{display:none}@media (max-width: 990px){.mobile-button[_ngcontent-%COMP%]{display:block}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.more-actions[_ngcontent-%COMP%] div.d-flex[_ngcontent-%COMP%]{width:30rem}[_nghost-%COMP%] .ng-select .ng-select-container{border:none}"]})};var Bs=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Hs=i=>({ID:i});function Ws(i,t){if(i&1){let e=y();o(0,"button",11),g("click",function(){d(e);let n=c(2);return u(n.openExportModal())}),f(1,"i",12),s(2," Export "),a()}}function qs(i,t){if(i&1){let e=y();o(0,"div")(1,"div",13)(2,"h6"),s(3,"Variant"),a(),o(4,"autocompleteV2",14),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.ID,n)||(m.pageData.Filter.ID=n),u(n)}),a(),o(5,"h6"),s(6,"Outlet"),a(),o(7,"ng-select",15),P("ngModelChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.EntityID,n)||(m.pageData.Filter.EntityID=n),u(n)}),a(),o(8,"h6"),s(9,"From"),a(),o(10,"datepicker",16),P("dateChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.From,n)||(m.pageData.Filter.From=n),u(n)}),a(),o(11,"h6"),s(12,"To"),a(),o(13,"datepicker",17),P("dateChange",function(n){d(e);let m=c(2);return D(m.pageData.Filter.To,n)||(m.pageData.Filter.To=n),u(n)}),a()()()}if(i&2){let e=c(2);l(4),T("ngModel",e.pageData.Filter.ID),p("inputTextValue",e.pageData.Filter.VariantName),l(3),p("items",e.pageData.Options.Entities),T("ngModel",e.pageData.Filter.EntityID),l(3),p("isFloatingLabel",!1),T("date",e.pageData.Filter.From),l(3),p("isFloatingLabel",!1),T("date",e.pageData.Filter.To)}}function Gs(i,t){i&1&&(o(0,"th"),s(1,"Variant"),a())}function zs(i,t){if(i&1&&(o(0,"td"),s(1),a()),i&2){let e=c().$implicit;l(),S(e.Name)}}function Ks(i,t){if(i&1&&(o(0,"tr",18),_(1,zs,2,1,"td",8),v(2,"async"),o(3,"td"),s(4),a(),o(5,"td")(6,"a",19),s(7),a()(),o(8,"td"),s(9),v(10,"number"),a(),o(11,"td"),s(12),v(13,"date"),a()()),i&2){let e=t.$implicit,r=c(2);l(),p("ngIf",!w(2,7,r.isRedirect$)),l(3),S(e.EntityName),l(2),p("routerLink",ne(14,Bs))("queryParams",V(15,Hs,e.ID)),l(),S(e.Number),l(2),S(w(10,9,e.Quantity)),l(3),S(j(13,11,e.Date,"dd/MM/yy"))}}function $s(i,t){if(i&1){let e=y();o(0,"mainpanel-cmp",2),P("textChange",function(n){d(e);let m=c();return D(m.pageData.Filter.Number,n)||(m.pageData.Filter.Number=n),u(n)}),g("onSubmit",function(){d(e);let n=c();return u(n.searchFromPageOne())}),P("filterChange",function(n){d(e);let m=c();return D(m.pageData.Filter,n)||(m.pageData.Filter=n),u(n)}),o(1,"actions"),_(2,Ws,3,0,"button",3),a(),o(3,"filters"),_(4,qs,14,8,"ng-template",null,0,Q),a(),o(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr"),_(12,Gs,2,0,"th",8),v(13,"async"),o(14,"th"),s(15,"Outlet"),a(),o(16,"th"),s(17,"Number"),a(),o(18,"th"),s(19,"Quantity"),a(),o(20,"th"),s(21,"Date"),a()()(),o(22,"tbody"),_(23,Ks,14,17,"tr",9),a()()(),o(24,"POS-complex-pagination",10),g("jumpToPage",function(){d(e);let n=c();return u(n.getListData())})("previousPage",function(){d(e);let n=c();return u(n.getListData())})("nextPage",function(){d(e);let n=c();return u(n.getListData())}),a()()()()}if(i&2){let e=c();p("pageData",e.menuData),T("text",e.pageData.Filter.Number),p("isFilterOnDropdown",!1),T("filter",e.pageData.Filter),l(2),p("ngIf",e.roleService.global.Export),l(10),p("ngIf",!w(13,9,e.isRedirect$)),l(11),p("ngForOf",e.data.Data),l(),p("total",e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var ci=class i extends Ce{constructor(e,r,n,m,h){super(e,r,"catalog/product/GetAdjustmentHistory","catalog/productLoader/GetAdjustmentHistoryLoader",null,n);this.matDialog=m;this.roleService=h;this.isRedirect$=dn(this.route.snapshot.queryParamMap).pipe(Me(x=>x.has("ID")),gn(1))}isRedirect$;openExportModal(){this.matDialog.open(Le,{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(r){return new(r||i)(b(oe),b(A),b(dt),b(X),b(L))};static \u0275cmp=M({type:i,selectors:[["POS-history-variant"]],standalone:!1,features:[pe],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(r,n){r&1&&_(0,$s,25,11,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[ie,B,de,ae,q,re,Bt,ce,We,Ge,Et,W,He],encapsulation:2})};function Js(i,t){if(i&1){let e=y();F(0),o(1,"div",3)(2,"h6",1),s(3,"Category"),a(),o(4,"POS-product-category-select",11),P("selectedCategoryIDChange",function(n){d(e);let m=c();return D(m.categoryId,n)||(m.categoryId=n),u(n)}),g("selectedCategoryIDChange",function(){d(e);let n=c();return u(n.toggleTotalRows=!1)}),a()(),o(5,"div",3)(6,"h6",1),s(7,"Supplier"),a(),o(8,"autocompleteV2",12),P("ngModelChange",function(n){d(e);let m=c();return D(m.supplierID,n)||(m.supplierID=n),u(n)}),g("ngModelChange",function(){d(e);let n=c();return u(n.toggleTotalRows=!1)}),a()(),o(9,"div",3)(10,"h6"),s(11,"Brand"),a(),o(12,"ng-select",13),P("ngModelChange",function(n){d(e);let m=c();return D(m.loader.Filter.BrandID,n)||(m.loader.Filter.BrandID=n),u(n)}),g("ngModelChange",function(){d(e);let n=c();return u(n.toggleTotalRows=!1)}),a()(),U()}if(i&2){let e=c();l(4),T("selectedCategoryID",e.categoryId),p("showClear",!0)("continuedCategoriesOnly",!0),l(4),T("ngModel",e.supplierID),l(4),p("items",e.loader.Options==null?null:e.loader.Options.BrandOptions),T("ngModel",e.loader.Filter.BrandID)}}function Zs(i,t){if(i&1){let e=y();o(0,"span",14),g("click",function(){d(e);let n=c();return u(n.getTotalRows())}),f(1,"i",15),a()}}function Xs(i,t){if(i&1&&(o(0,"span"),s(1),v(2,"number"),a()),i&2){let e=c();l(),I("",w(2,1,e.totalRows)," rows")}}var di=class i{constructor(t,e,r){this.dialogRef=t;this.http=r;this.configModal=new ye,this.configModal.title="Download Template",this.configModal.customWidth="400px",this.configModal.hideScrollbar=!0,this.configModal.okText="Download",this.loader=e.loader,this.outletId=e.outletID}toggleTotalRows=!1;totalRows=0;exportFormat="CSV";configModal;onHandInventory=!0;stockCount="0";categoryId=null;supplierID=null;outletId="";loader;stockCountOptions=[{Key:"0",Value:"Full Count"},{Key:"1",Value:"Partial Count"}];exportFormatOptions=[{Key:"CSV",Value:"CSV"},{Key:"XLSX",Value:"XLSX"}];close(){this.dialogRef.close()}confirm(){this.dialogRef.close({IncludeZeroOnHand:this.onHandInventory,CategoryID:this.stockCount==="1"?this.categoryId:null,From:this.loader?.Filter.From,To:this.loader?.Filter.To,FormatType:this.exportFormat=="CSV"?0:this.exportFormat=="XLSX"?1:2,SupplierID:this.stockCount==="1"?this.supplierID:null,BrandID:this.stockCount==="1"?this.loader?.Filter.BrandID:null})}getTotalRows(){this.http.post("/api/InventoryExport/GetStockTakeSpreadsheetV2Count",{OutletID:this.outletId,IncludeZeroOnHand:this.onHandInventory,CategoryID:this.stockCount==="1"?this.categoryId:null,SupplierID:this.stockCount==="1"?this.supplierID:null,From:this.loader?.Filter.From,To:this.loader?.Filter.To,BrandID:this.stockCount==="1"?this.loader?.Filter.BrandID:null}).subscribe(t=>{this.totalRows=t.Count,this.toggleTotalRows=!0})}static \u0275fac=function(e){return new(e||i)(b(he),b(ft),b(A))};static \u0275cmp=M({type:i,selectors:[["POS-dialog-download-template"]],standalone:!1,decls:21,vars:9,consts:[[3,"onOk","onCancel","onClose","config"],[1,"mb-4"],["name","onHandInventory",3,"modelChange","model"],[1,"mt-5"],["name","stockCount",3,"modelChange","model","options"],[4,"ngIf"],["name","exportFormat",3,"modelChange","model","options"],[1,"col-12","mt-8"],[1,"p-3",2,"background-color","#add8e6","border-radius","4px"],[1,"fa-solid","fa-circle-exclamation","mx-3"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear","continuedCategoriesOnly"],["requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose...","appendTo","body",3,"ngModelChange","items","ngModel"],[2,"cursor","pointer",3,"click"],[1,"fa-solid","fa-circle-question","mt-1",2,"font-size","14px"]],template:function(e,r){e&1&&(o(0,"modal-material",0),g("onOk",function(){return r.confirm()})("onCancel",function(){return r.close()})("onClose",function(){return r.close()}),o(1,"content")(2,"div")(3,"h6",1),s(4,"On Hand Inventory < 1"),a(),o(5,"radio-options",2),P("modelChange",function(m){return D(r.onHandInventory,m)||(r.onHandInventory=m),m}),g("modelChange",function(){return r.toggleTotalRows=!1}),a()(),o(6,"div",3)(7,"h6",1),s(8,"Stock Count"),a(),o(9,"radio-options",4),P("modelChange",function(m){return D(r.stockCount,m)||(r.stockCount=m),m}),g("modelChange",function(){return r.toggleTotalRows=!1}),a()(),_(10,Js,13,6,"ng-container",5),o(11,"div",3)(12,"h6",1),s(13,"Format"),a(),o(14,"radio-options",6),P("modelChange",function(m){return D(r.exportFormat,m)||(r.exportFormat=m),m}),g("modelChange",function(){return r.toggleTotalRows=!1}),a()(),o(15,"div",7)(16,"div",8),f(17,"i",9),s(18," Exporting data from "),_(19,Zs,2,0,"span",10)(20,Xs,3,3,"span",5),a()()()()),e&2&&(p("config",r.configModal),l(5),T("model",r.onHandInventory),l(4),T("model",r.stockCount),p("options",r.stockCountOptions),l(),p("ngIf",r.stockCount=="1"),l(4),T("model",r.exportFormat),p("options",r.exportFormatOptions),l(5),p("ngIf",!r.toggleTotalRows),l(),p("ngIf",r.toggleTotalRows))},dependencies:[B,q,re,ce,We,ve,Dn,qe,W],encapsulation:2})};var Ys=i=>({"text-danger":i}),em=()=>["/menu/Products/Catalog/Variants/Info"],tm=i=>({ID:i});function nm(i,t){if(i&1){let e=y();o(0,"button",40),g("click",function(){d(e);let n=c(),m=$(8);return u(n.onPreview(m))}),s(1," Next "),a()}}function im(i,t){if(i&1){let e=y();F(0),o(1,"button",41),g("click",function(){d(e);let n=c(),m=$(8);return m.selected.completed=!0,n.fileImport=null,m.previous(),u(n.uploadState.set(n.uploadStateEnum.Uploading))}),s(2," Back "),a(),o(3,"button",42),g("click",function(){d(e);let n=c(),m=$(8);return u(n.upload(m))}),s(4," Next "),a(),U()}if(i&2){let e=c();l(3),p("disabled",!e.canProceedPreview)}}function rm(i,t){if(i&1){let e=y();F(0),o(1,"button",40),g("click",function(){d(e);let n=c(),m=$(8);return u(n.newUpload(m))}),s(2,"New"),a(),U()}}function om(i,t){if(i&1&&s(0),i&2){let e=t.index;S(e+1)}}function am(i,t){i&1&&(f(0,"i",43),s(1,"Upload"))}function lm(i,t){if(i&1&&(o(0,"div",44),s(1),v(2,"limitText"),a()),i&2){let e=t.item;p("title",(e==null||e.Name==null?null:e.Name.length)>23?e.Name:""),l(),I(" ",j(2,2,e.Name,25)," ")}}function sm(i,t){if(i&1){let e=y();o(0,"div",45)(1,"button",46),g("click",function(){d(e);let n=c();return u(n.openDownloadTemplateDialog())}),f(2,"i",47),s(3," Download Template "),a()()}}function mm(i,t){if(i&1){let e=y();o(0,"POS-uppy",48),g("fileUploaded",function(n){d(e);let m=c();return u(m.onUploadCsv(n))}),a()}if(i&2){let e=c();p("dashboardPropsConfiguration",e.dashboardPropsConfiguration)("subtitle","Accepted file formats: .csv & max file size: 1 MB")}}function pm(i,t){if(i&1){let e=y();o(0,"POS-uppy",48),g("fileUploaded",function(n){d(e);let m=c();return u(m.onUploadCsv(n))}),a()}if(i&2){let e=c();p("dashboardPropsConfiguration",e.dashboardPropsConfiguration)("subtitle","Accepted file formats: .csv & max file size: 1 MB")}}function cm(i,t){i&1&&(f(0,"i",49),s(1,"Preview"))}function dm(i,t){i&1&&(o(0,"th",50),s(1," Difference "),a())}function um(i,t){i&1&&(o(0,"th",51),s(1," Cost "),a())}function _m(i,t){i&1&&(o(0,"th"),s(1," Message "),a())}function gm(i,t){if(i&1&&(o(0,"a",58),s(1),a()),i&2){let e=c().$implicit;p("routerLink",ne(3,em))("queryParams",V(4,tm,e.VariantID)),l(),S(e.VariantName)}}function fm(i,t){if(i&1&&(o(0,"span",59),s(1),a()),i&2){let e=c().$implicit;l(),S(e.VariantName)}}function Cm(i,t){if(i&1&&(o(0,"td"),s(1),a()),i&2){let e=c().$implicit;ot("text-danger",e.Differences<0)("text-success",e.Differences>0),l(),I(" ",e.Differences," ")}}function hm(i,t){if(i&1&&(o(0,"td"),s(1),v(2,"number"),a()),i&2){let e=c().$implicit;ot("text-danger",e.CostChange<0)("text-success",e.CostChange>0),l(),I(" ",w(2,5,e.CostChange)," ")}}function ym(i,t){if(i&1&&(o(0,"div"),s(1),a()),i&2){let e=t.$implicit;l(),vt(" ",e.Issue," ",e.Solution," ")}}function vm(i,t){if(i&1&&(o(0,"td"),_(1,ym,2,2,"div",34),a()),i&2){let e=c().$implicit;ot("bg-gradient-danger",e.Issues==null?null:e.Issues.length),l(),p("ngForOf",e.Issues)}}function Sm(i,t){if(i&1&&(o(0,"tr")(1,"td"),s(2),a(),o(3,"td",52),s(4),a(),o(5,"td",53),_(6,gm,2,6,"a",54)(7,fm,2,1,"span",55),a(),o(8,"td",53),s(9),a(),o(10,"td",53),s(11),a(),o(12,"td"),s(13),a(),_(14,Cm,2,5,"td",56)(15,hm,3,7,"td",56)(16,vm,2,3,"td",57),a()),i&2){let e=t.$implicit,r=t.index,n=c();l(2),S(r+1+"."),l(),p("ngClass",V(11,Ys,!e.VariantCode)),l(),I(" ",e.ProductName," "),l(2),p("ngIf",e.VariantID),l(),p("ngIf",!e.VariantID),l(2),I(" ",e.VariantCode," "),l(2),I(" ",e.Expected," "),l(2),I(" ",e.Counted," "),l(),p("ngIf",n.importedDataState!="matched"),l(),p("ngIf",n.role.product.Cost&&n.importedDataState=="unmatched"),l(),p("ngIf",n.importedDataState=="error"||n.importedDataState=="all")}}function xm(i,t){i&1&&(f(0,"i",60),s(1,"Finish"))}var ui=class i extends Ce{constructor(e,r,n,m,h,x,le,te){super(e,r,null,"Outlet/GetByUserAccessWrite");this.toastr=n;this.csvConverter=m;this.router=h;this.importService=x;this.roleService=le;this.matDialog=te;this.formData={},this.opNames=[],r.get("/api/AdjustmentLoader/ImportAdjustmentV2Loader").subscribe(se=>{this.loader=se,console.log(this.loader)})}loader=null;importedDataState="unmatched";selectedTabIndex=0;sampleUrl="https://res.cloudinary.com/pos/raw/upload/v1724644913/POS/CSV/Products_DealPOS4.csv";state="upload";dashboardPropsConfiguration={width:600};fileImport;role=C(L);exp=C(pr);cacheKey="";canProceedPreview=!1;importedData=[];summary=["Category","Product","Variant"];summaryData={};uploaded=!1;importHttpResponse=[];isPreviewState=!1;isSuccessState=!1;msgSuccessImport;isDisabledImportBtn=!1;originalData=[];formData;opNames;outletName;uploadState=z(0);uploadStateEnum=En;preInitList(){this.formData.EntityID=this.pageData.Entities[0].ID,this.outletName=this.pageData.Entities[0].Name,this.formData.ProductWithoutInventory="1"}getEntityName(e){this.outletName=e.Name}onPreview(e){this.uploadState.set(1),this.selectedTabIndex=0,this.importedDataState="unmatched";let r=this.importService.generateFormData(this.fileImport,null);this.importService.previewImport(`/api/Adjustment/ImportAdjustmentV2Preview?outletID=${this.formData.EntityID}`,r).pipe(pt(n=>(n instanceof hn&&(this.uploadState.set(3),this.state="upload",console.error("Error during import preview:",n)),un(()=>n)))).subscribe(n=>{e.selected.completed=!0,e.next(),this.cacheKey=n.CacheKey,this.canProceedPreview=n.CanProceed,this.importedData=n.DataRow,this.summaryData=n.Summary,this.importedData.filter(m=>m.Action=="Error").length>0?(this.importedDataState="error",this.selectedTabIndex=3):this.importedData.filter(m=>m.Action=="Update").length==0&&(this.importedDataState="matched",this.selectedTabIndex=1),this.initIsDisabledImport(),this.uploadState.set(2)})}initIsDisabledImport(){let e=JSON.stringify(this.importHttpResponse).toLowerCase().includes('"statusid":2');this.isDisabledImportBtn=e}alertConfirmInventory(){return!(this.formData.InventoryUpdate&&!confirm("Update Inventory is YES. This is will replace current inventory. Do you want to proceed?"))}onImportFileChange(e){this.fileImport=e,this.isPreviewState=!1}onNewImport(){this.isSuccessState=!1}onUploadCsv(e){this.fileImport=e}selectionChange(e){let r=e.selectedStep.label;this.state=r}postInit(e){this.originalData=e.Data}upload(e){this.httpService.post(`/api/Adjustment/ImportAdjustmentV2Confirm?outletID=${this.formData.EntityID}`,{CacheKey:this.cacheKey}).subscribe(r=>{e.selected.completed=!0,this.toastr.success(r.Message,ee.Success),e.next(),this.uploaded=!0})}newUpload(e){e.reset(),this.uploaded=!1,this.state="upload",this.fileImport=null,this.cacheKey="",this.canProceedPreview=!1,this.importedData=[],this.summaryData={},this.uploadState.set(0)}downloadData(e){e==0?this.exp.exportCSV("InventoryExport/GetStockTakeSpreadsheet",this.formData):this.exp.exportXlsx("InventoryExport/GetStockTakeSpreadsheet",this.formData)}sortData(e){let r=this.importedData.slice();if(!e.active||e.direction===""){this.importedData=this.originalData;return}this.importedData=r.sort((n,m)=>{let h=e.direction==="asc",x=typeof n[e.active];switch(E.IsEmpty(n.Code)&&(n.Code=""),E.IsEmpty(m.Code)&&(m.Code=""),x){case"string":return E.compare(n[e.active].toLocaleLowerCase(),m[e.active].toLocaleLowerCase(),h);case"number":return E.compare(n[e.active],m[e.active],h);default:return 0}})}get filteredData(){return this.importedDataState==="all"?this.importedData:this.importedDataState==="matched"?this.importedData.filter(e=>e.Action=="Unchanged"):this.importedDataState==="unmatched"?this.importedData.filter(e=>e.Action=="Update"):this.importedDataState==="error"?this.importedData.filter(e=>e.Action=="Error"):this.importedData}openDownloadTemplateDialog(){this.matDialog.open(di,{data:{loader:this.loader,outletID:this.formData.EntityID}}).afterClosed().pipe(me(e=>E.IsNotEmpty(e))).subscribe(e=>{this.exp.exportCSV("InventoryExport/GetStockTakeSpreadsheetV2",{OutletID:this.formData.EntityID,IncludeZeroOnHand:e.IncludeZeroOnHand,CategoryID:e.CategoryID,From:e.From,To:e.To,FormatType:e.FormatType,SupplierID:e.SupplierID,BrandID:e.BrandID})})}onTabChange(e){e==0?this.importedDataState="unmatched":e==1?this.importedDataState="matched":e==2?this.importedDataState="all":e==3&&(this.importedDataState="error")}static \u0275fac=function(r){return new(r||i)(b(oe),b(A),b(fe),b(ke),b(Fe),b(Lr),b(L),b(X))};static \u0275cmp=M({type:i,selectors:[["POS-csv-stock-take-v2"]],standalone:!1,features:[pe],decls:70,vars:33,consts:[["stepper",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["class","btn btn-success",3,"click",4,"ngIf"],[4,"ngIf"],["orientation","horizontal",3,"selectionChange","linear"],["matStepperIcon","edit"],["label","upload","state","upload",2,"margin-top","50px",3,"editable","completed"],["matStepLabel",""],[1,"row","border-bottom","mt-10","ms-2"],[1,"col-md-2"],[1,"fw-bold"],[1,"h6","fst-italic"],[1,"col-md-10"],[1,"row"],[1,"col-md-12","mb-10",2,"display","flex"],["bindLabel","Name","bindValue","ID",2,"width","200px",3,"ngModelChange","change","items","clearable","ngModel"],["ng-option-tmp",""],["class","ms-3",4,"ngIf"],[1,"row","border-bottom","ms-2","mt-10","pb-10"],[1,"col-md-auto"],[3,"dashboardPropsConfiguration","subtitle","fileUploaded",4,"ngIf"],["label","preview","state","preview",3,"editable","completed"],[2,"width","600px",3,"selectedIndexChange","selectedIndex"],[3,"label"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","30px"],["mat-sort-header","ProductName",2,"width","175px"],["mat-sort-header","VariantName",2,"width","175px"],["mat-sort-header","VariantCode",2,"width","100px"],["mat-sort-header","Expected",2,"width","200px"],["mat-sort-header","Counted",2,"width","100px"],["mat-sort-header","Differences","style","width: 75px",4,"ngIf"],["mat-sort-header","UnitCost","style","width: 100px",4,"ngIf"],[4,"ngFor","ngForOf"],["label","finish","state","finish"],[1,"d-flex","flex-column","align-items-center"],[1,"fa-solid","fa-circle-check","text-success",2,"font-size","110px"],[1,"mt-8"],[1,"fw-normal","mt-2"],[1,"btn","btn-success",3,"click"],[1,"btn","btn-outline-secondary",3,"click"],[1,"btn","btn-success","ms-3",3,"click","disabled"],[1,"fa-solid","fa-upload","me-3"],[3,"title"],[1,"ms-3"],["type","button","aria-expanded","false",1,"btn","btn-outline-secondary","mb-2",2,"height","37px !important","font-size","12px !important",3,"click"],[1,"fa","fa-download","me-3"],[3,"fileUploaded","dashboardPropsConfiguration","subtitle"],[1,"fa-regular","fa-file","me-3"],["mat-sort-header","Differences",2,"width","75px"],["mat-sort-header","UnitCost",2,"width","100px"],[3,"ngClass"],[2,"word-break","break-word"],[3,"routerLink","queryParams",4,"ngIf"],["class","text-danger",4,"ngIf"],[3,"text-danger","text-success",4,"ngIf"],[3,"bg-gradient-danger",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-danger"],[1,"fa-solid","fa-check","me-3"]],template:function(r,n){if(r&1){let m=y();o(0,"mainpanel-cmp",1)(1,"actions"),F(2),_(3,nm,2,0,"button",2),U(),_(4,im,5,1,"ng-container",3)(5,rm,3,0,"ng-container",3),a(),o(6,"content")(7,"mat-stepper",4,0),g("selectionChange",function(x){return d(m),u(n.selectionChange(x))}),_(9,om,1,1,"ng-template",5),o(10,"mat-step",6),_(11,am,2,0,"ng-template",7),o(12,"div",8)(13,"div",9)(14,"h5",10),s(15,"Outlet"),a(),o(16,"small",11),s(17,"Stock take location"),a()(),o(18,"div",12)(19,"div",13)(20,"div",14)(21,"div")(22,"ng-select",15),P("ngModelChange",function(x){return d(m),D(n.formData.EntityID,x)||(n.formData.EntityID=x),u(x)}),g("change",function(x){return d(m),u(n.getEntityName(x))}),_(23,lm,3,5,"ng-template",16),a()(),_(24,sm,4,0,"div",17),a()()()(),o(25,"div",18)(26,"div",9)(27,"h5",10),s(28,"Upload File"),a(),o(29,"small",11),s(30,".csv format"),a()(),o(31,"div",19),_(32,mm,1,2,"POS-uppy",20)(33,pm,1,2,"POS-uppy",20),a()()(),o(34,"mat-step",21),_(35,cm,2,0,"ng-template",7),o(36,"div")(37,"mat-tab-group",22),g("selectedIndexChange",function(x){return d(m),u(n.onTabChange(x))}),f(38,"mat-tab",23)(39,"mat-tab",23)(40,"mat-tab",23)(41,"mat-tab",23),a(),o(42,"table",24),g("matSortChange",function(x){return d(m),u(n.sortData(x))}),o(43,"thead",25)(44,"tr")(45,"th",26),s(46,"No"),a(),o(47,"th",27),s(48," Product "),a(),o(49,"th",28),s(50," Variant "),a(),o(51,"th",29),s(52,"Code"),a(),o(53,"th",30),s(54," Expected "),a(),o(55,"th",31),s(56,"Counted"),a(),_(57,dm,2,0,"th",32)(58,um,2,0,"th",33)(59,_m,2,0,"th",3),a()(),o(60,"tbody"),_(61,Sm,17,13,"tr",34),a()()()(),o(62,"mat-step",35),_(63,xm,2,0,"ng-template",7),o(64,"div",36),f(65,"i",37),o(66,"h1",38),s(67,"Adjustment Complete!"),a(),o(68,"h6",39),s(69),a()()()()()()}r&2&&(p("pageData",n.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),l(3),p("ngIf",n.state=="upload"&&n.fileImport),l(),p("ngIf",n.state=="preview"),l(),p("ngIf",n.state=="finish"),l(2),p("linear",!0),l(3),p("editable",!n.uploaded)("completed",!1),l(12),p("items",n.pageData.Entities)("clearable",!1),T("ngModel",n.formData.EntityID),l(2),p("ngIf",n.role.adjustment.Create||n.role.adjustment.Edit),l(8),p("ngIf",n.uploadState()===n.uploadStateEnum.Idle||n.uploadState()===n.uploadStateEnum.Uploading),l(),p("ngIf",n.uploadState()===n.uploadStateEnum.Success||n.uploadState()===n.uploadStateEnum.Error),l(),p("editable",!n.uploaded)("completed",!1),l(3),p("selectedIndex",n.selectedTabIndex),l(),at("label","Unmatched (",n.summaryData.Updated,")"),l(),at("label","Matched (",n.summaryData.NoChanges,")"),l(),at("label","All (",n.summaryData.Total,")"),l(),at("label","Error (",n.summaryData.Error,")"),l(16),p("ngIf",n.importedDataState!="matched"),l(),p("ngIf",n.role.product.Cost&&n.importedDataState=="unmatched"),l(),p("ngIf",n.importedDataState=="error"||n.importedDataState=="all"),l(2),p("ngForOf",n.filteredData),l(8),Bi(" ",n.summaryData.Total," items with ",n.summaryData.Updated," unmatched & ",n.summaryData.NoChanges," matched quantities imported. "))},dependencies:[Ne,ie,B,de,ae,q,re,ce,wn,Tn,Mn,Ir,Nt,Ft,Gt,nr,ir,mr,W,Zi],styles:[".sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{top:48px!important}"]})};var bm=i=>({ID:i});function Im(i,t){if(i&1){let e=y();o(0,"button",4),g("click",function(){d(e);let n=c();return u(n.openExportModal())}),f(1,"i",5),s(2," Export "),a()}}function Dm(i,t){if(i&1){let e=y();o(0,"div",6)(1,"h6"),s(2,"Outlets"),a(),o(3,"outlet-selector",7),P("ngModelChange",function(n){d(e);let m=c();return D(m.pageData.Filter.OutletId,n)||(m.pageData.Filter.OutletId=n),u(n)}),a(),o(4,"h6"),s(5,"Supplier"),a(),o(6,"autocompleteV2",8),P("ngModelChange",function(n){d(e);let m=c();return D(m.pageData.Filter.SupplierId,n)||(m.pageData.Filter.SupplierId=n),u(n)}),a(),o(7,"h6"),s(8,"Category"),a(),o(9,"POS-product-category-select",9),P("selectedCategoryIDChange",function(n){d(e);let m=c();return D(m.pageData.Filter.CategoryId,n)||(m.pageData.Filter.CategoryId=n),u(n)}),a()()}if(i&2){let e=c();l(3),p("accessType",2),T("ngModel",e.pageData.Filter.OutletId),p("multiple",!1)("clearable",!1),l(3),T("ngModel",e.pageData.Filter.SupplierId),l(3),T("selectedCategoryID",e.pageData.Filter.CategoryId),p("showClear",!0)}}function Pm(i,t){i&1&&(o(0,"th",20),s(1," On Hand "),a())}function Tm(i,t){if(i&1&&(o(0,"td",22),s(1),a()),i&2){let e=c().$implicit;l(),S(e.OnHand)}}function wm(i,t){if(i&1&&(o(0,"tr")(1,"td")(2,"a",21),s(3),a()(),o(4,"td"),s(5),a(),o(6,"td"),s(7),v(8,"date"),a(),o(9,"td",22),s(10),a(),_(11,Tm,2,1,"td",23),a()),i&2){let e=t.$implicit,r=c(2);l(2),p("queryParams",V(9,bm,e.ID)),l(),S(e.Name),l(2),S(e.Code),l(2),S(j(8,6,e.LastCountDate,"dd MMM yyyy")),l(3),S(e.DaysSinceLastCount),l(),p("ngIf",r.role.inventory.View)}}function Mm(i,t){if(i&1){let e=y();o(0,"div",10)(1,"table",11),g("matSortChange",function(n){d(e);let m=c();return u(m.sortData(n))}),o(2,"thead",12)(3,"tr")(4,"th",13),s(5,"Name"),a(),o(6,"th",14),s(7,"Code"),a(),o(8,"th",15),s(9,"Last Count"),a(),o(10,"th",16),s(11," Days Since Last Count "),a(),_(12,Pm,2,0,"th",17),a()(),o(13,"tbody"),_(14,wm,12,11,"tr",18),a()(),o(15,"POS-complex-pagination",19),g("jumpToPage",function(){d(e);let n=c();return u(n.getListData())})("previousPage",function(){d(e);let n=c();return u(n.getListData())})("nextPage",function(){d(e);let n=c();return u(n.getListData())}),a()()}if(i&2){let e=c();l(12),p("ngIf",e.role.inventory.View),l(2),p("ngForOf",e.data.Data),l(),p("total",e.data.Data.length)("pageData",e.pageData)}}var _i=class i extends Ce{constructor(e,r,n,m,h){super(e,r,"Adjustment/AdjustmentLastCountDate","AdjustmentLoader/AdjustmentLastCountDate",void 0,void 0,!0);this.httpService=r;this.csvConverter=n;this.roleService=m;this.matDialog=h}role=C(L);originalData=[];postInit(e){this.originalData=e.Data,this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(Le,{data:{title:"Adjustment Report",exportTypes:[{ID:"AdjustmentExport/ExportAdjustmentLastCountDate",Value:"Default",FileName:"Adjustment Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/AdjustmentLastCountDate",pagination:!0}})}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((n,m)=>{let h=e.direction==="asc",x=typeof n[e.active];switch(E.IsEmpty(n.Code)&&(n.Code=""),E.IsEmpty(m.Code)&&(m.Code=""),x){case"string":return E.compare(n[e.active].toLocaleLowerCase(),m[e.active].toLocaleLowerCase(),h);case"number":return E.compare(n[e.active],m[e.active],h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(b(oe),b(A),b(ke),b(L),b(X))};static \u0275cmp=M({type:i,selectors:[["POS-last-count"]],standalone:!1,features:[pe],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple","clearable"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table","w-100",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","Code"],["mat-sort-header","LastCountDate"],["mat-sort-header","DaysSinceLastCount",1,"align-right"],["mat-sort-header","OnHand","class","align-right",4,"ngIf"],[4,"ngFor","ngForOf"],["api","Adjustment/CountAdjustmentLastCountDate",3,"jumpToPage","previousPage","nextPage","total","pageData"],["mat-sort-header","OnHand",1,"align-right"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[1,"text-end"],["class","text-end",4,"ngIf"]],template:function(r,n){if(r&1){let m=y();o(0,"mainpanel-cmp",1),P("textChange",function(x){return d(m),D(n.pageData.Filter.Text,x)||(n.pageData.Filter.Text=x),u(x)}),g("onSubmit",function(){return d(m),u(n.searchFromPageOne())}),P("filterChange",function(x){return d(m),D(n.pageData.Filter,x)||(n.pageData.Filter=x),u(x)}),o(1,"actions"),_(2,Im,3,0,"button",2),a(),o(3,"filters"),_(4,Dm,10,7,"ng-template",null,0,Q),a(),o(6,"content"),_(7,Mm,16,4,"div",3),a()()}r&2&&(p("pageData",n.menuData),T("text",n.pageData.Filter.Text),p("isFilterOnDropdown",!1),T("filter",n.pageData.Filter),l(2),p("ngIf",n.roleService.global.Export),l(5),p("ngIf",n.data&&n.data.Data))},dependencies:[ie,B,de,ae,q,re,We,Ge,Nt,Ft,qe,Qt,He],encapsulation:2})};var Em=[{path:"Adjustment/Archive",component:Nn},{path:"Adjustment/Archive/Info",component:kn},{path:"Adjustment/Archive/Form",component:pi,canActivate:[qr],data:{roles:[vi.adjustment.Create,vi.adjustment.Edit]}},{path:"Tools/Count_Product_Inventory",component:Hn},{path:"Tools/Convert_Inventory_to_Parent_UOM",component:Bn},{path:"Tools/Product_Sheet",component:Wn},{path:"Report/Last_Count",component:_i},{path:"Report/Adjustment",component:Ln},{path:"History/Variant",component:ci},{path:"Adjustment/Stock_Take_by_Web_Spreadsheet",component:Qn},{path:"Adjustment/Stock_Take_by_CSV",component:ui},{path:"",redirectTo:"Adjustment/Archive",pathMatch:"full"}],gi=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=Dt({type:i});static \u0275inj=bt({imports:[ln.forChild(Em),ln]})};var ji=class i{constructor(t){this.http=t}currentUntilPage;toggleFetchTotalData;totalData;pageNumber;isNextBtnDisabled;isOnLastPage;calcCurrentUntilPage(t,e,r){this.currentUntilPage=t*(e-1)+r}setPageNumber(t){this.pageNumber=t}setPaginationButtonState(t,e,r){r==0?this.isNextBtnDisabled=!0:this.isNextBtnDisabled=!(r<t*e)}setTotalData(t,e,r){this.toggleFetchTotalData=!0,this.http.post(t,e).pipe(R(r)).subscribe(n=>this.totalData=n)}setPaginationState(t,e,r){this.calcCurrentUntilPage(t,e,r),this.setPageNumber(e),this.setPaginationButtonState(t,e,r)}static \u0275fac=function(e){return new(e||i)(Ui(A))};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var fi=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=Dt({type:i});static \u0275inj=bt({imports:[ge]})};var mo=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=Dt({type:i});static \u0275inj=bt({imports:[Pn,ge,gi,In,_t,bn,fr,ce,Qr,Rt,ue,Sr,sr,_r,ue,Dr,br,Si,ur,Ut,Sn,tr,hr,er,Wr,Si,Xi,Br,Hr,Pr,Ct,Vr,fi,qt,qe,Qt,On,An,Gt,rr,Yi,or]})};export{mo as AdjustmentModule};
|