dealpos 25.35.3 → 25.35.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-ZWEHXDXR.js → chunk-24D6MNU3.js} +1 -1
- package/browser/{chunk-YGUNDEOT.js → chunk-2DTTV3WZ.js} +1 -1
- package/browser/{chunk-3T3RRVKX.js → chunk-2SKOS425.js} +1 -1
- package/browser/{chunk-HJZUPJW2.js → chunk-355IJ673.js} +1 -1
- package/browser/{chunk-CUD4PHJT.js → chunk-3F5XHWCR.js} +1 -1
- package/browser/{chunk-7J6JNI44.js → chunk-4JHNDDWK.js} +1 -1
- package/browser/{chunk-EIPWN4ZG.js → chunk-4VFWQO4F.js} +1 -1
- package/browser/{chunk-RYONOB6O.js → chunk-55FBOF2K.js} +1 -1
- package/browser/{chunk-MLMSIZGP.js → chunk-5FX6PF7H.js} +1 -1
- package/browser/{chunk-F3QKO3WX.js → chunk-5KMED3ED.js} +1 -1
- package/browser/{chunk-MXRJZC7D.js → chunk-5QSJVXLI.js} +2 -2
- package/browser/{chunk-4E4L6WXO.js → chunk-5XUCKBED.js} +1 -1
- package/browser/chunk-6RT4JFSL.js +12 -0
- package/browser/{chunk-GWY532ZF.js → chunk-AFE2LULB.js} +2 -2
- package/browser/{chunk-NY4SVPPU.js → chunk-AXIZQIWB.js} +1 -1
- package/browser/{chunk-KQLFNIFZ.js → chunk-BMSGPTDT.js} +1 -1
- package/browser/{chunk-32XPQS72.js → chunk-BZVJPFC7.js} +1 -1
- package/browser/{chunk-ZFMK7BOT.js → chunk-C2OBU263.js} +1 -1
- package/browser/{chunk-S7QH3NMD.js → chunk-CACQ5CUG.js} +1 -1
- package/browser/{chunk-7IVZ7O4B.js → chunk-CBANXZYR.js} +1 -1
- package/browser/{chunk-JUDTCQVV.js → chunk-CLANG4EJ.js} +1 -1
- package/browser/{chunk-FQSQUAUB.js → chunk-CMJU4DQE.js} +1 -1
- package/browser/{chunk-DU2U47CB.js → chunk-CWCCIUHW.js} +1 -1
- package/browser/{chunk-JRMGNV6W.js → chunk-DYBM7A4I.js} +1 -1
- package/browser/{chunk-AAVH5EBY.js → chunk-E3FB6FNJ.js} +1 -1
- package/browser/{chunk-O3IGBF5Z.js → chunk-FJ5ZH62P.js} +1 -1
- package/browser/{chunk-SKFIRYCU.js → chunk-G6FSBVZ3.js} +2 -2
- package/browser/{chunk-BXFKD2CO.js → chunk-GATE2JGN.js} +1 -1
- package/browser/{chunk-LS4LCNAF.js → chunk-GDGOECTK.js} +12 -12
- package/browser/{chunk-W2TSDYEA.js → chunk-GPQTHDC7.js} +1 -1
- package/browser/{chunk-HSQKKFE6.js → chunk-HZYCS27T.js} +1 -1
- package/browser/{chunk-MUFGLBTW.js → chunk-IH5LFEXQ.js} +1 -1
- package/browser/{chunk-6DJNKKNB.js → chunk-IVJDR4KT.js} +1 -1
- package/browser/{chunk-CESIM7I2.js → chunk-JDH4IG5J.js} +1 -1
- package/browser/{chunk-H5EACBML.js → chunk-JG3KZOXF.js} +4 -4
- package/browser/{chunk-DDSUKJHT.js → chunk-KFUZ5H2E.js} +1 -1
- package/browser/{chunk-BZAN6DNV.js → chunk-KSHAUAR4.js} +1 -1
- package/browser/{chunk-KHHM6IFR.js → chunk-KXWV7BWA.js} +1 -1
- package/browser/{chunk-NHVQ6BHI.js → chunk-LCWRAZ53.js} +1 -1
- package/browser/{chunk-DKX7YVH4.js → chunk-MAPKCEZS.js} +1 -1
- package/browser/{chunk-DO6W6BG2.js → chunk-MB3LC2X7.js} +1 -1
- package/browser/{chunk-BN2DUB4S.js → chunk-MDKBJ76E.js} +1 -1
- package/browser/{chunk-YCPSIUQ3.js → chunk-OJXWHEVJ.js} +1 -1
- package/browser/{chunk-W7HVLC6V.js → chunk-OQWULNHJ.js} +1 -1
- package/browser/{chunk-KM4YGIPJ.js → chunk-OSEOSRN3.js} +1 -1
- package/browser/{chunk-HKACPPVL.js → chunk-OTJ5RPOM.js} +1 -1
- package/browser/{chunk-MERQX2AF.js → chunk-PB3U4CET.js} +2 -2
- package/browser/{chunk-2XMIL3M5.js → chunk-POYTNEZA.js} +1 -1
- package/browser/{chunk-K4YUTEMS.js → chunk-PX3AGMFG.js} +1 -1
- package/browser/{chunk-H24HNIUV.js → chunk-QG3ZXK25.js} +1 -1
- package/browser/{chunk-NMGT5PYX.js → chunk-QKLEIIBF.js} +1 -1
- package/browser/{chunk-TYIDA4YO.js → chunk-QMC7IUQ4.js} +1 -1
- package/browser/{chunk-BUFUGEKP.js → chunk-RMW7CTND.js} +1 -1
- package/browser/{chunk-E7SOAHON.js → chunk-RPXKX6SA.js} +1 -1
- package/browser/{chunk-XEKUUP6Y.js → chunk-RRAQ3HCY.js} +1 -1
- package/browser/{chunk-DHQUQTIV.js → chunk-RRMVK7YL.js} +1 -1
- package/browser/{chunk-NLWPMDWU.js → chunk-S2UMTJT4.js} +1 -1
- package/browser/chunk-SEJO3YK3.js +1 -0
- package/browser/chunk-SKDFYIAR.js +1 -0
- package/browser/{chunk-P4TUOMJ4.js → chunk-SW7527Y6.js} +1 -1
- package/browser/{chunk-RJSPJ6CG.js → chunk-T36LQESB.js} +1 -1
- package/browser/{chunk-5LVF3GQO.js → chunk-TXT5K5RP.js} +1 -1
- package/browser/{chunk-QZFGYG5J.js → chunk-U6PF57EL.js} +1 -1
- package/browser/{chunk-3BF3LB6Z.js → chunk-UST6Q3MS.js} +1 -1
- package/browser/{chunk-7BDVBLHM.js → chunk-UZ4DOUGB.js} +1 -1
- package/browser/{chunk-NQPOGM3H.js → chunk-V4XBT2DG.js} +1 -1
- package/browser/{chunk-GIMMGWIY.js → chunk-VQFGGKMC.js} +1 -1
- package/browser/{chunk-AK6EELSP.js → chunk-W2D3QHHC.js} +1 -1
- package/browser/{chunk-BMNZHUI6.js → chunk-WO5244FM.js} +1 -1
- package/browser/{chunk-3Z3TRQBS.js → chunk-WQCHGJR2.js} +1 -1
- package/browser/{chunk-SJ7OFVH5.js → chunk-WRP2Q4PH.js} +1 -1
- package/browser/{chunk-IWQEXFGO.js → chunk-WUXJOKKF.js} +1 -1
- package/browser/{chunk-BGQQUPTZ.js → chunk-Y7V3HTAD.js} +1 -1
- package/browser/{chunk-OFNXPEBH.js → chunk-ZPTXDCKQ.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-XQZCWN5T.js → main-SRAUXRZ3.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-33A5UPQJ.js +0 -1
- package/browser/chunk-7AAAKDTU.js +0 -12
- package/browser/chunk-H7DCK5WJ.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as qr}from"./chunk-QEMZLEBM.js";import{a as Ur}from"./chunk-K6OQJCJ6.js";import{a as Rr,b as Qr,c as Hr}from"./chunk-DXROSW6B.js";import{a as Br}from"./chunk-L755Z2UU.js";import{a as Lr}from"./chunk-OCIWZUYR.js";import{b as Wr}from"./chunk-GFDEHNOL.js";import{a as Fr}from"./chunk-M6C7J4PM.js";import{a as kn}from"./chunk-6V2AFFCL.js";import{a as Tn}from"./chunk-YGUNDEOT.js";import{d as Cr}from"./chunk-CESIM7I2.js";import"./chunk-TOWVTOFV.js";import"./chunk-EYCYL6AL.js";import"./chunk-3YXP5Q5V.js";import{a as br,b as wn,c as Ir,e as Mn,f as En,g as Dr}from"./chunk-SJIEANJU.js";import{I as xr}from"./chunk-NHVQ6BHI.js";import"./chunk-NPJ272AZ.js";import"./chunk-UX2MPDGZ.js";import"./chunk-TK5H65DN.js";import"./chunk-6L6CIH5M.js";import{e as Sr}from"./chunk-QMPKHU2W.js";import"./chunk-3PXI2XBC.js";import"./chunk-THRGCK26.js";import"./chunk-2IT6TVBI.js";import{a as hr}from"./chunk-DYCGOJEI.js";import"./chunk-KVPIGIZJ.js";import"./chunk-5VFKAJV6.js";import"./chunk-W2UCLTBY.js";import"./chunk-NJSJDYUI.js";import{a as cr}from"./chunk-UBUC3CPO.js";import{a as An}from"./chunk-M4GPXLRN.js";import{a as Mr,b as Er,c as Or,d as Ar,e as kr,f as jr}from"./chunk-WZEGUTUH.js";import{a as Vr}from"./chunk-WC4MWHJJ.js";import{a as Tr}from"./chunk-Q5AWNSSD.js";import{a as gt}from"./chunk-6SK3XWNT.js";import"./chunk-UU5RJKWG.js";import"./chunk-GE53XQ2Q.js";import{b as xi}from"./chunk-7BU64MD2.js";import{a as Pr}from"./chunk-7HI7DCIJ.js";import"./chunk-5JZJ4OL3.js";import"./chunk-SE7OFLAL.js";import"./chunk-NOLQHNIQ.js";import{a as On}from"./chunk-WLRXTHLM.js";import"./chunk-SZKR6UME.js";import"./chunk-QLFKPTZA.js";import"./chunk-5VAXIJEW.js";import{a as Vo,b as Gt}from"./chunk-YOKPVEGO.js";import"./chunk-BYXBJQAS.js";import{g as yr}from"./chunk-4L4E5MG3.js";import{a as gr,d as Ht,e as fr}from"./chunk-3VKLFFAF.js";import"./chunk-NI6KAEXM.js";import"./chunk-3RK6DDJD.js";import{a as tr}from"./chunk-L2EDFSBR.js";import{a as Nr}from"./chunk-SX7VXZQI.js";import"./chunk-H2VTVYZY.js";import"./chunk-B5FODXLM.js";import"./chunk-6365PJN3.js";import"./chunk-VOU4625O.js";import"./chunk-I4MJUIXL.js";import"./chunk-MUCQWTKH.js";import{a as wr}from"./chunk-YWF2JYRN.js";import"./chunk-A6YCCT6G.js";import{a as Zi}from"./chunk-O7MCO2N7.js";import"./chunk-UZKYLAUE.js";import"./chunk-47MDCKEY.js";import{b as vr}from"./chunk-FIS6Q5OG.js";import{a as Wt,b as ft}from"./chunk-33A5UPQJ.js";import{q as er}from"./chunk-GEWY5VWO.js";import"./chunk-TEFNN3TY.js";import{d as Yi}from"./chunk-GOQ3ZCDK.js";import{c as nr,d as ir,e as rr}from"./chunk-XY7FDLSK.js";import"./chunk-JKYTSC2D.js";import{a as qt}from"./chunk-TGAOY65D.js";import"./chunk-IVP3GL2V.js";import"./chunk-HT35KHLT.js";import"./chunk-BYXBJQAS.js";import{a as Gr}from"./chunk-BWWLIKSO.js";import{a as Ae}from"./chunk-KUUYZ5UQ.js";import{d as Pn,e as ur}from"./chunk-ZR4YNJBZ.js";import{a as dr}from"./chunk-XX6Z7QPA.js";import"./chunk-VQ7WKMGF.js";import{f as qe}from"./chunk-QZFGYG5J.js";import"./chunk-B7E3DL2Y.js";import"./chunk-H6BFHXJX.js";import"./chunk-VYUMNVGD.js";import{a as Ge,b as _r}from"./chunk-3J6SPHP2.js";import{a as pr,b as Le}from"./chunk-XVFIUKXR.js";import{a as Ft,b as Ut,c as Xi}from"./chunk-AVWEAAID.js";import{a as he}from"./chunk-NLWPMDWU.js";import"./chunk-H24HNIUV.js";import"./chunk-IQO7F652.js";import{c as or}from"./chunk-YQCR57JN.js";import"./chunk-MHBOKOSN.js";import"./chunk-S6TMUVGC.js";import"./chunk-PPWHSAY6.js";import"./chunk-FD5YMPRL.js";import"./chunk-MV3QRRW6.js";import{d as ar,f as lr,h as sr}from"./chunk-6ZOGADBZ.js";import{a as Lt,b as Ue}from"./chunk-7ENHJR7R.js";import{a as Bt}from"./chunk-3AY3BZNI.js";import{h as re,i as Dn}from"./chunk-MERQX2AF.js";import"./chunk-4E4L6WXO.js";import{a as bn,b as ie}from"./chunk-DHQUQTIV.js";import"./chunk-AZT6QE56.js";import"./chunk-5UL73W4S.js";import{F as We,G as Qt,u as ve,v as Se,w as ue}from"./chunk-677WPFLK.js";import{b as Nt,c as xn}from"./chunk-CIBQBSM6.js";import{O as In,P as Ve,g as Rt}from"./chunk-L2RZWAX3.js";import"./chunk-ZT4RBJMM.js";import"./chunk-GIKR6Y2K.js";import{a as mr,e as pe}from"./chunk-VMY3JQDA.js";import{a as Sn,b as Ce,e as ye,f as _t,g as Z}from"./chunk-D35OBUDE.js";import"./chunk-567HXZXC.js";import"./chunk-WEJYVCCX.js";import"./chunk-AAJJTF33.js";import{a as se}from"./chunk-2FWFPV5I.js";import"./chunk-3PYW74LR.js";import{C as jt,D as dt,E as ut,b as zi,c as Oe,h as G,i as At,l as ct,o as ne,r as Ki,s as $i,t as kt,u as Vt}from"./chunk-P7HKWFZT.js";import{a as Gi}from"./chunk-HSQKKFE6.js";import{a as Ji}from"./chunk-7BDVBLHM.js";import{a as O,c as Si,d as R}from"./chunk-AHCRE4GP.js";import"./chunk-W7HVLC6V.js";import{$a as l,$b as Tt,Ac as w,Ba as _e,Bc as N,Db as Y,E as ce,Eb as ht,Fa as fn,Fb as vi,Fc as B,Ga as Cn,Gb as Me,Hb as Ee,I as pt,Ib as o,Jb as a,K as Ui,Kb as f,Kc as Hi,Lb as U,Ma as Q,Mb as L,Ob as y,Od as Ot,Pc as Mt,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 bt,Wc as Ne,Y as gn,Yc as te,Yd as A,Za as Be,Zb as Dt,Zc as H,_b as Pt,aa as le,cb as hn,cd as Et,d as Te,da as De,db as b,dc as $,ec as s,ed as He,fa as F,fc as S,gc as I,gd as q,hc as yt,ic as Bi,ja as W,jc as P,jd as ge,k as cn,ka as xt,kb as M,kc as D,lb as It,lc as T,ma as Li,md as qi,na as C,o as dn,ob as me,p as un,qb as _,qc as ee,rc as V,sc as wt,sd as yn,t as we,u as Fi,va as d,vb as p,wa as u,wb as Ri,wd as vn,xb as ot,yb as Qi,zb as Pe,zc as v}from"./chunk-DZT5XHBQ.js";import{a as E,b as j,g as yi,j as pn}from"./chunk-7DCB7DB2.js";var bi=(e=>(e[e.AdjustDifferences=1]="AdjustDifferences",e[e.CountQuantity=2]="CountQuantity",e))(bi||{});var Ii=(n=>(n[n.Draft=1]="Draft",n[n.Pending=2]="Pending",n[n.Rejected=3]="Rejected",n[n.Accepted=4]="Accepted",n))(Ii||{});var $r=()=>["/menu/Adjustment/Adjustment/Archive/Form"],Kt=i=>({ID:i}),Jr=()=>["/print/Adjustment"],Nn=(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",ee(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);Y(e.data.Adjustment.StateID==e.adjustmentState.Draft?0:-1),l(),Y(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",ee(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);Y(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,"",bt)}}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(N(4,7,r.Date,"dd MMM yyyy")),l(3),S(N(7,10,r.Date,"HH:mm a")),l(3),Ri("color",n==0?"blue":"black"),l(),Y(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&&(U(0),o(1,"th",62),s(2,"Qty"),a(),L())}function $o(i,t){i&1&&(U(0),o(1,"th",62),s(2,"Counted"),a(),o(3,"th",62),s(4,"Expected"),a(),L())}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,B),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&&(U(0),f(1,"p",68),L()),i&2){let e=c().$implicit;l(),p("innerHTML",e.Note,K)}}function ta(i,t){if(i&1&&(U(0),o(1,"td",69),s(2),a(),L()),i&2){let e=c().$implicit;l(),Pe(wt(3,Nn,e.Quantity>0,e.Quantity<0)),l(),I(" ",e.Quantity," ")}}function na(i,t){if(i&1&&(U(0),o(1,"td",69),s(2),a(),o(3,"td",69),s(4),a(),L()),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,B),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),Pe(wt(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,B)(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);Pe(wt(14,Nn,N(1,3,e.data.DifferencesArray,"Quantity")>0,N(2,6,e.data.DifferencesArray,"Quantity")<0)),l(3),S(w(5,12,N(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",wt(13,Nn,N(1,2,e.data.DifferencesArray,"Difference")>0,N(2,5,e.data.DifferencesArray,"Difference")<0)),l(3),I(" ",w(5,11,N(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,N(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,N(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,B)(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,B),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",ee(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(),Pe(wt(11,Nn,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",ee(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),Me(59,Go,1,1,"div",10,ht),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),Y(r.hasAccRejButton?2:-1),l(2),Y(r.roleService.adjustment.Create?4:-1),l(),Y(r.roleService.adjustment.Edit?5:-1),l(),Y(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),Ee(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 Vn=class i extends he{constructor(e,r,n,m,h,x,oe,X){super(e,r,"Adjustment/AuditInventoryAdjustmentInfo",null,null,m);this.httpService=r;this.toastr=n;this.csvConverter=h;this.router=x;this.roleService=oe;this.dialog=X;this.initQueryParam()}paramId;hasAccRejButton=!1;isEditable=!1;adjustmentType=bi;adjustmentState=Ii;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",se.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",se.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.",se.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(Fr,{data:{title:"Submit Review",message:`
|
|
1
|
+
import{a as qr}from"./chunk-QEMZLEBM.js";import{a as Ur}from"./chunk-K6OQJCJ6.js";import{a as Rr,b as Qr,c as Hr}from"./chunk-DXROSW6B.js";import{a as Br}from"./chunk-L755Z2UU.js";import{a as Lr}from"./chunk-OCIWZUYR.js";import{b as Wr}from"./chunk-GFDEHNOL.js";import{a as Fr}from"./chunk-M6C7J4PM.js";import{a as kn}from"./chunk-6V2AFFCL.js";import{a as Tn}from"./chunk-2DTTV3WZ.js";import{d as Cr}from"./chunk-JDH4IG5J.js";import"./chunk-TOWVTOFV.js";import"./chunk-EYCYL6AL.js";import"./chunk-3YXP5Q5V.js";import{a as br,b as wn,c as Ir,e as Mn,f as En,g as Dr}from"./chunk-SJIEANJU.js";import{I as xr}from"./chunk-LCWRAZ53.js";import"./chunk-NPJ272AZ.js";import"./chunk-UX2MPDGZ.js";import"./chunk-TK5H65DN.js";import"./chunk-6L6CIH5M.js";import{e as Sr}from"./chunk-QMPKHU2W.js";import"./chunk-3PXI2XBC.js";import"./chunk-THRGCK26.js";import"./chunk-2IT6TVBI.js";import{a as hr}from"./chunk-DYCGOJEI.js";import"./chunk-KVPIGIZJ.js";import"./chunk-5VFKAJV6.js";import"./chunk-W2UCLTBY.js";import"./chunk-NJSJDYUI.js";import{a as cr}from"./chunk-UBUC3CPO.js";import{a as An}from"./chunk-M4GPXLRN.js";import{a as Mr,b as Er,c as Or,d as Ar,e as kr,f as jr}from"./chunk-WZEGUTUH.js";import{a as Vr}from"./chunk-WC4MWHJJ.js";import{a as Tr}from"./chunk-Q5AWNSSD.js";import{a as gt}from"./chunk-6SK3XWNT.js";import"./chunk-UU5RJKWG.js";import"./chunk-GE53XQ2Q.js";import{b as xi}from"./chunk-7BU64MD2.js";import{a as Pr}from"./chunk-7HI7DCIJ.js";import"./chunk-5JZJ4OL3.js";import"./chunk-SE7OFLAL.js";import"./chunk-NOLQHNIQ.js";import{a as On}from"./chunk-WLRXTHLM.js";import"./chunk-SZKR6UME.js";import"./chunk-QLFKPTZA.js";import"./chunk-5VAXIJEW.js";import{a as Vo,b as Gt}from"./chunk-YOKPVEGO.js";import"./chunk-BYXBJQAS.js";import{g as yr}from"./chunk-4L4E5MG3.js";import{a as gr,d as Ht,e as fr}from"./chunk-3VKLFFAF.js";import"./chunk-NI6KAEXM.js";import"./chunk-3RK6DDJD.js";import{a as tr}from"./chunk-L2EDFSBR.js";import{a as Nr}from"./chunk-SX7VXZQI.js";import"./chunk-H2VTVYZY.js";import"./chunk-B5FODXLM.js";import"./chunk-6365PJN3.js";import"./chunk-VOU4625O.js";import"./chunk-I4MJUIXL.js";import"./chunk-MUCQWTKH.js";import{a as wr}from"./chunk-YWF2JYRN.js";import"./chunk-A6YCCT6G.js";import{a as Zi}from"./chunk-O7MCO2N7.js";import"./chunk-UZKYLAUE.js";import"./chunk-47MDCKEY.js";import{b as vr}from"./chunk-FIS6Q5OG.js";import{a as Wt,b as ft}from"./chunk-SEJO3YK3.js";import{q as er}from"./chunk-GEWY5VWO.js";import"./chunk-TEFNN3TY.js";import{d as Yi}from"./chunk-GOQ3ZCDK.js";import{c as nr,d as ir,e as rr}from"./chunk-XY7FDLSK.js";import"./chunk-JKYTSC2D.js";import{a as qt}from"./chunk-TGAOY65D.js";import"./chunk-IVP3GL2V.js";import"./chunk-HT35KHLT.js";import"./chunk-BYXBJQAS.js";import{a as Gr}from"./chunk-BWWLIKSO.js";import{a as Ae}from"./chunk-KUUYZ5UQ.js";import{d as Pn,e as ur}from"./chunk-ZR4YNJBZ.js";import{a as dr}from"./chunk-XX6Z7QPA.js";import"./chunk-VQ7WKMGF.js";import{f as qe}from"./chunk-U6PF57EL.js";import"./chunk-B7E3DL2Y.js";import"./chunk-H6BFHXJX.js";import"./chunk-VYUMNVGD.js";import{a as Ge,b as _r}from"./chunk-3J6SPHP2.js";import{a as pr,b as Le}from"./chunk-XVFIUKXR.js";import{a as Ft,b as Ut,c as Xi}from"./chunk-AVWEAAID.js";import{a as he}from"./chunk-S2UMTJT4.js";import"./chunk-QG3ZXK25.js";import"./chunk-IQO7F652.js";import{c as or}from"./chunk-YQCR57JN.js";import"./chunk-MHBOKOSN.js";import"./chunk-S6TMUVGC.js";import"./chunk-PPWHSAY6.js";import"./chunk-FD5YMPRL.js";import"./chunk-MV3QRRW6.js";import{d as ar,f as lr,h as sr}from"./chunk-6ZOGADBZ.js";import{a as Lt,b as Ue}from"./chunk-7ENHJR7R.js";import{a as Bt}from"./chunk-3AY3BZNI.js";import{h as re,i as Dn}from"./chunk-PB3U4CET.js";import"./chunk-5XUCKBED.js";import{a as bn,b as ie}from"./chunk-RRMVK7YL.js";import"./chunk-AZT6QE56.js";import"./chunk-5UL73W4S.js";import{F as We,G as Qt,u as ve,v as Se,w as ue}from"./chunk-677WPFLK.js";import{b as Nt,c as xn}from"./chunk-CIBQBSM6.js";import{O as In,P as Ve,g as Rt}from"./chunk-L2RZWAX3.js";import"./chunk-ZT4RBJMM.js";import"./chunk-GIKR6Y2K.js";import{a as mr,e as pe}from"./chunk-VMY3JQDA.js";import{a as Sn,b as Ce,e as ye,f as _t,g as Z}from"./chunk-D35OBUDE.js";import"./chunk-567HXZXC.js";import"./chunk-WEJYVCCX.js";import"./chunk-AAJJTF33.js";import{a as se}from"./chunk-2FWFPV5I.js";import"./chunk-3PYW74LR.js";import{C as jt,D as dt,E as ut,b as zi,c as Oe,h as G,i as At,l as ct,o as ne,r as Ki,s as $i,t as kt,u as Vt}from"./chunk-P7HKWFZT.js";import{a as Gi}from"./chunk-HZYCS27T.js";import{a as Ji}from"./chunk-UZ4DOUGB.js";import{a as O,c as Si,d as R}from"./chunk-AHCRE4GP.js";import"./chunk-OQWULNHJ.js";import{$a as l,$b as Tt,Ac as w,Ba as _e,Bc as N,Db as Y,E as ce,Eb as ht,Fa as fn,Fb as vi,Fc as B,Ga as Cn,Gb as Me,Hb as Ee,I as pt,Ib as o,Jb as a,K as Ui,Kb as f,Kc as Hi,Lb as U,Ma as Q,Mb as L,Ob as y,Od as Ot,Pc as Mt,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 bt,Wc as Ne,Y as gn,Yc as te,Yd as A,Za as Be,Zb as Dt,Zc as H,_b as Pt,aa as le,cb as hn,cd as Et,d as Te,da as De,db as b,dc as $,ec as s,ed as He,fa as F,fc as S,gc as I,gd as q,hc as yt,ic as Bi,ja as W,jc as P,jd as ge,k as cn,ka as xt,kb as M,kc as D,lb as It,lc as T,ma as Li,md as qi,na as C,o as dn,ob as me,p as un,qb as _,qc as ee,rc as V,sc as wt,sd as yn,t as we,u as Fi,va as d,vb as p,wa as u,wb as Ri,wd as vn,xb as ot,yb as Qi,zb as Pe,zc as v}from"./chunk-DZT5XHBQ.js";import{a as E,b as j,g as yi,j as pn}from"./chunk-7DCB7DB2.js";var bi=(e=>(e[e.AdjustDifferences=1]="AdjustDifferences",e[e.CountQuantity=2]="CountQuantity",e))(bi||{});var Ii=(n=>(n[n.Draft=1]="Draft",n[n.Pending=2]="Pending",n[n.Rejected=3]="Rejected",n[n.Accepted=4]="Accepted",n))(Ii||{});var $r=()=>["/menu/Adjustment/Adjustment/Archive/Form"],Kt=i=>({ID:i}),Jr=()=>["/print/Adjustment"],Nn=(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",ee(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);Y(e.data.Adjustment.StateID==e.adjustmentState.Draft?0:-1),l(),Y(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",ee(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);Y(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,"",bt)}}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(N(4,7,r.Date,"dd MMM yyyy")),l(3),S(N(7,10,r.Date,"HH:mm a")),l(3),Ri("color",n==0?"blue":"black"),l(),Y(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&&(U(0),o(1,"th",62),s(2,"Qty"),a(),L())}function $o(i,t){i&1&&(U(0),o(1,"th",62),s(2,"Counted"),a(),o(3,"th",62),s(4,"Expected"),a(),L())}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,B),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&&(U(0),f(1,"p",68),L()),i&2){let e=c().$implicit;l(),p("innerHTML",e.Note,K)}}function ta(i,t){if(i&1&&(U(0),o(1,"td",69),s(2),a(),L()),i&2){let e=c().$implicit;l(),Pe(wt(3,Nn,e.Quantity>0,e.Quantity<0)),l(),I(" ",e.Quantity," ")}}function na(i,t){if(i&1&&(U(0),o(1,"td",69),s(2),a(),o(3,"td",69),s(4),a(),L()),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,B),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),Pe(wt(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,B)(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);Pe(wt(14,Nn,N(1,3,e.data.DifferencesArray,"Quantity")>0,N(2,6,e.data.DifferencesArray,"Quantity")<0)),l(3),S(w(5,12,N(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",wt(13,Nn,N(1,2,e.data.DifferencesArray,"Difference")>0,N(2,5,e.data.DifferencesArray,"Difference")<0)),l(3),I(" ",w(5,11,N(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,N(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,N(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,B)(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,B),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",ee(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(),Pe(wt(11,Nn,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",ee(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),Me(59,Go,1,1,"div",10,ht),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),Y(r.hasAccRejButton?2:-1),l(2),Y(r.roleService.adjustment.Create?4:-1),l(),Y(r.roleService.adjustment.Edit?5:-1),l(),Y(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),Ee(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 Vn=class i extends he{constructor(e,r,n,m,h,x,oe,X){super(e,r,"Adjustment/AuditInventoryAdjustmentInfo",null,null,m);this.httpService=r;this.toastr=n;this.csvConverter=h;this.router=x;this.roleService=oe;this.dialog=X;this.initQueryParam()}paramId;hasAccRejButton=!1;isEditable=!1;adjustmentType=bi;adjustmentState=Ii;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",se.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",se.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.",se.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(Fr,{data:{title:"Submit Review",message:`
|
|
2
2
|
<h4>Are you sure you want to Change status to pending review?</h4>
|
|
3
3
|
`,headerType:se.Warning}}).afterClosed().pipe(ce(e=>e===!0),le(()=>this.httpService.post(Ve.AdjusmentSubmitReview,{ID:this.data.Adjustment.ID}))).subscribe(e=>{this.toastr.success(e.Message,se.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(ie),b(A),b(fe),b(Ot),b(Ae),b(Fe),b(R),b(Z))};static \u0275cmp=M({type:i,selectors:[["POS-adjustment-info"]],standalone:!1,features:[me],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,te,H,de,re,Nt,qt,kn,q,He,Rt],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",21),g("click",function(){d(e);let n=c(2);return u(n.httpPostListID("Adjustment/DeleteInventoryAdjustmentList"))}),f(1,"i",22),s(2,"Delete "),a()}}function Da(i,t){if(i&1){let e=y();o(0,"button",23),g("click",function(){d(e);let n=c(2);return u(n.openExportModal())}),f(1,"i",24),s(2," Export "),a()}}function Pa(i,t){i&1&&(o(0,"a",25),s(1,"New"),a()),i&2&&p("routerLink",ee(1,ya))}function Ta(i,t){if(i&1){let e=y();o(0,"div")(1,"div",26)(2,"h6"),s(3,"Outlet"),a(),o(4,"ng-select",27),T("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",28)(8,"div",29)(9,"datepicker",30),T("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",31)(11,"datepicker",32),T("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",33)(15,"input",34),T("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",34),T("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",35),T("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",36),T("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",37),T("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",38),T("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",39),T("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),P("ngModel",e.pageData.Filter.EntityID),l(5),p("isFloatingLabel",!1),P("date",e.pageData.Filter.From),l(2),p("isFloatingLabel",!1),P("date",e.pageData.Filter.To),l(4),P("ngModel",e.pageData.Filter.QuantityFrom),l(2),P("ngModel",e.pageData.Filter.QuantityTo),l(3),p("items",e.pageData.Options.States),P("ngModel",e.pageData.Filter.State),l(3),p("items",e.pageData.Options.Types),P("ngModel",e.pageData.Filter.Type),l(3),p("items",e.pageData.Options.AdjustmentTagsOptions),P("ngModel",e.pageData.Filter.TagID),l(3),P("ngModel",e.pageData.Filter.RowCount),p("max",1e4),l(3),P("model",e.pageData.Filter.ExcludeZero)}}function wa(i,t){if(i&1){let e=y();o(0,"th",40)(1,"input",41),g("change",function(n){d(e);let m=c(2);return u(m.onSelectAllData(n.target.checked))}),a()()}}function Ma(i,t){i&1&&(o(0,"th",18),s(1,"Cost"),a())}function Ea(i,t){if(i&1){let e=y();o(0,"td")(1,"input",49),T("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(),P("ngModel",e.selected)}}function Oa(i,t){if(i&1&&(o(0,"td",45),s(1),v(2,"quantityFraction"),a()),i&2){let e=c().$implicit;l(),I(" ",w(2,1,e.Quantity)," ")}}function Aa(i,t){if(i&1&&(o(0,"td",45),s(1),v(2,"quantityFraction"),a()),i&2){let e=c().$implicit;Pe(V(5,xa,e.Quantity>0)),l(),I(" +",w(2,3,e.Quantity)," ")}}function ka(i,t){if(i&1&&(o(0,"td",45),s(1),v(2,"quantityFraction"),a()),i&2){let e=c().$implicit;Pe(V(5,ba,e.Quantity<0)),l(),I(" ",w(2,3,e.Quantity)," ")}}function Va(i,t){if(i&1&&(o(0,"td",45),s(1),v(2,"amountFraction"),a()),i&2){let e=c().$implicit;l(),S(w(2,1,e.Cost))}}function ja(i,t){if(i&1&&(o(0,"tr",42),_(1,Ea,2,1,"td",43),o(2,"td"),s(3),a(),o(4,"td")(5,"a",44),s(6),a()(),o(7,"td"),s(8),v(9,"date"),a(),o(10,"td",45),s(11),v(12,"number"),a(),_(13,Oa,3,3,"td",46)(14,Aa,3,7,"td",47)(15,ka,3,7,"td",47),o(16,"td"),s(17),a(),_(18,Va,3,3,"td",45),o(19,"td"),s(20),a(),o(21,"td"),f(22,"div",48),a()()),i&2){let e=t.$implicit,r=c(2);l(),p("ngIf",r.roleService.adjustment.Delete),l(2),S(e.EntityName),l(2),p("routerLink",ee(21,va))("queryParams",V(22,Sa,e.ID)),l(),S(e.Number),l(2),S(N(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(),Y(!(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 Na(i,t){if(i&1){let e=y();o(0,"mainpanel-cmp",2),T("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())}),T("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,"Download Scanner App "),a(),_(5,Ia,3,0,"a",5)(6,Da,3,0,"button",6)(7,Pa,2,2,"a",7),a(),o(8,"filters"),_(9,Ta,33,17,"ng-template",null,0,B),a(),o(11,"content")(12,"div",8)(13,"div",9)(14,"table",10)(15,"thead",11)(16,"tr"),_(17,wa,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,Ma,2,0,"th",18),o(31,"th",14),s(32,"State"),a(),o(33,"th"),s(34,"Note"),a()()(),o(35,"tbody"),_(36,ja,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),P("text",e.pageData.Filter.Number),p("isFilterOnDropdown",!1),P("filter",e.pageData.Filter),l(5),p("ngIf",e.getSelectedData().length>0),l(),p("ngIf",e.roleService.global.Export),l(),p("ngIf",e.roleService.adjustment.Create),l(10),p("ngIf",e.roleService.adjustment.Delete),l(13),Y(!(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 Fn=class i extends he{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}})}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(ie),b(A),b(fe),b(Ae),b(R),b(Z))};static \u0275cmp=M({type:i,selectors:[["POS-inventory-adjustment"]],standalone:!1,features:[me],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"],["class","btn btn-outline-secondary me-5",3,"click",4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","button btn btn-success",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 14px",4,"ngIf"],[2,"width","120px"],[2,"width","100px"],[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"],[1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fa-solid","fa-trash","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"button","btn","btn-success",3,"routerLink"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModelChange","items","ngModel"],[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"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom"],[4,"ngIf"],[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,Na,38,12,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[te,H,de,re,Oe,zi,G,ne,Ht,pe,Ge,Pn,Ue,Nt,q,He,cr,dr],encapsulation:2})};var Ln=class i{config;dialogRef=C(ye);data=C(_t);filterKeys=["From","To","PageNumber","RowCount","EntityID","TagID"];httpService=C(A);summaryData=Q(null);constructor(){this.config=new ve,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)=>E(E({},r),n),{});this.httpService.post("api/Adjustment/AuditAdjustmentSumReport",e).pipe(we(r=>r.Data),F(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,Se,ge,q],encapsulation:2,changeDetection:0})};var Ua=()=>["/menu/Adjustment/Adjustment/Archive/Info"],La=i=>({ID:i});function Ra(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 Qa(i,t){if(i&1){let e=y();o(0,"div",6)(1,"h6"),s(2,"Outlets"),a(),o(3,"outlet-selector",7),T("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),T("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),T("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),T("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),P("ngModel",e.pageData.Filter.EntityID),p("multiple",!1),l(3),p("isFloatingLabel",!1),P("date",e.pageData.Filter.From),l(3),p("isFloatingLabel",!1),P("date",e.pageData.Filter.To),l(3),p("items",e.pageData.Options.AdjustmentTagsOptions),P("ngModel",e.pageData.Filter.TagID)}}function Ba(i,t){i&1&&(o(0,"th",22),s(1," @ Cost "),a())}function Ha(i,t){i&1&&(o(0,"th",22),s(1," @ Price "),a())}function Wa(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 qa(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 Ga(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,Wa,3,3,"th",35)(9,qa,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 za(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,Ga,10,7,"tr",18),a()()()),i&2){let e=t.$implicit;l(3),p("routerLink",ee(14,Ua))("queryParams",V(15,La,e.ID)),l(),p("innerHTML",e.EntityName+" #"+e.Number+" - "+N(5,8,e.Created,"dd MMM yyyy"),K),l(2),p("innerHTML","("+N(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 Ka(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,Ba,2,0,"th",17)(11,Ha,2,0,"th",17),a()()(),_(12,za,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 Rn=class i extends he{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=j(E({},this.pageData),{Filter:j(E({},this.pageData.Filter),{TagID:e!==-1?this.pageData.Filter.TagID:null})})}onDialogSummary(){this.matDialog.open(Ln,{data:{pageData:this.pageData.Filter}})}static \u0275fac=function(r){return new(r||i)(b(ie),b(A),b(Ae),b(R),b(Z))};static \u0275cmp=M({type:i,selectors:[["POS-adjustment-reports"]],standalone:!1,features:[me],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),T("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())}),T("filterChange",function(x){return d(m),D(n.pageData.Filter,x)||(n.pageData.Filter=x),u(x)}),o(1,"actions"),_(2,Ra,3,0,"button",2),a(),o(3,"filters"),_(4,Qa,13,9,"ng-template",null,0,B),a(),o(6,"content"),_(7,Ka,17,5,"div",3),a()()}r&2&&(p("pageData",n.menuData),P("text",n.pageData.Filter.Number),p("isFilterOnDropdown",!1),P("filter",n.pageData.Filter),l(2),p("ngIf",n.roleService.global.Export),l(5),p("ngIf",n.data&&n.data.Data))},dependencies:[te,H,de,re,G,ne,Ht,pe,Ge,Bt,q,He],encapsulation:2})};var Qn=class extends bn{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(Ui(()=>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 Ja=["stepper"],Yr=i=>({"nb-button-override":i}),Za=i=>({custom:i}),eo=()=>["/menu/Products/Catalog/Variants/Info"],Pi=i=>({ID:i}),Xa=i=>({"bg-gradient-warning":i}),Ya=i=>({Filter:i}),el=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function tl(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 nl(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 il(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 rl(i,t){i&1&&(f(0,"i",56),s(1,"Filter"))}function ol(i,t){i&1&&(o(0,"small",57),s(1,"Outlet option is required."),a())}function al(i,t){i&1&&(f(0,"i",58),s(1,"Input"))}function ll(i,t){i&1&&(o(0,"th",44),s(1," Expected "),a())}function sl(i,t){i&1&&(o(0,"th",44),s(1," Changes "),a())}function ml(i,t){if(i&1&&(o(0,"td"),s(1),a()),i&2){let e=c().$implicit;l(),I(" ",e.Quantity," ")}}function pl(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),yt(" ",e.Counted," (",(e.Counted-e.Quantity>0?"+":"")+w(4,7,e.Counted-e.Quantity),") ")}}function cl(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 dl(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,ml,2,1,"td",46),o(13,"td")(14,"input",61,2),T("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,pl,5,9,"td",62),o(17,"td",63),_(18,cl,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",ee(14,eo))("queryParams",V(15,Pi,e.ID)),l(),S(e.Model),l(2),S(e.Code),l(),p("ngIf",n.roleService.inventory.View),l(2),Pe(V(17,Xa,e.Counted!==""&&e.Counted!=e.Quantity&&!n.roleService.inventory.View)),p("modifyValueOnWheel",!1),P("ngModel",e.Counted),l(2),p("ngIf",e.Counted!==""&&n.roleService.inventory.View),l(2),p("ngIf",e.Counted!=="")}}function ul(i,t){if(i&1){let e=y();U(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(),L()}if(i&2){let e=c(3);l(),p("total",e.products.length)("pageData",V(2,Ya,e.filter))}}function _l(i,t){i&1&&(f(0,"i",68),s(1,"Review"))}function gl(i,t){i&1&&(o(0,"th",44),s(1," Expected "),a())}function fl(i,t){i&1&&(o(0,"th",44),s(1," Differences "),a())}function Cl(i,t){if(i&1&&(o(0,"td"),s(1),a()),i&2){let e=c(2).$implicit;l(),I(" ",e.Quantity," ")}}function hl(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 yl(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 vl(i,t){if(i&1&&(o(0,"td"),_(1,hl,3,3,"span",46)(2,yl,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 Sl(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,Cl,2,1,"td",46),o(11,"td"),s(12),a(),_(13,vl,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",ee(13,eo))("queryParams",V(14,Pi,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 xl(i,t){if(i&1&&(U(0),_(1,Sl,14,16,"tr",69),L()),i&2){let e=t.$implicit;l(),p("ngIf",e.Counted!=="")}}function bl(i,t){i&1&&(f(0,"i",70),s(1,"Finish"))}function Il(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 Dl(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,rl,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())}),T("ngModelChange",function(n){d(e);let m=c(2);return D(m.filter.EntityID,n)||(m.filter.EntityID=n),u(n)}),a(),_(13,ol,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),T("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),T("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),T("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),T("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,al,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,ll,2,0,"th",43),o(79,"th",44),s(80,"Counted"),a(),_(81,sl,2,0,"th",43),f(82,"th",38),a()(),o(83,"tbody"),_(84,dl,19,19,"tr",45),a()(),_(85,ul,2,4,"ng-container",46),a()(),o(86,"mat-step",47),_(87,_l,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,gl,2,0,"th",43),o(101,"th",44),s(102,"Counted"),a(),_(103,fl,2,0,"th",43),a()(),o(104,"tbody"),_(105,xl,2,1,"ng-container",45),a()()()()(),o(106,"mat-step",54),_(107,bl,2,0,"ng-template",16)(108,Il,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),Pe(V(24,Za,e.touched&&r.filter.EntityID==null)),p("items",r.loaderData.Entities),P("ngModel",r.filter.EntityID),p("clearable",!1),l(2),p("ngIf",e.touched&&r.filter.EntityID==null),l(10),P("selectedCategoryID",r.filter.CategoryID),p("showClear",!0),l(10),P("ngModel",r.filter.ProductName),l(11),p("items",r.loaderData.AdjustmentTagsOptions),P("ngModel",r.filter.TagID),p("clearable",!1),l(7),p("showClear",!0),l(10),P("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 Pl(i,t){i&1&&(o(0,"div",89),s(1," Difference "),a())}function Tl(i,t){if(i&1&&(o(0,"div",94),s(1),a()),i&2){let e=c().$implicit;Pe(e.Quantity-e.OriginalQuantity<0?"text-danger":"text-success"),l(),I(" ",(e.Quantity-e.OriginalQuantity>0?"+":" ")+(e.Quantity-e.OriginalQuantity)," ")}}function wl(i,t){if(i&1&&(o(0,"div",96)(1,"div",93),s(2),a(),o(3,"div",94),s(4),a(),_(5,Tl,2,3,"div",95),a()),i&2){let e=t.$implicit,r=c(3);l(2),yt("",e.Name," (",e.Model,")"),l(2),S(e.Quantity),l(),p("ngIf",r.roleService.inventory.View)}}function Ml(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);Pe(N(1,3,e.displayedItems,"Quantity")-N(2,6,e.displayedItems,"OriginalQuantity")<0?"text-danger":"text-success"),l(3),I(" ",(N(4,9,e.displayedItems,"Quantity")-N(5,12,e.displayedItems,"OriginalQuantity")>0?"+":" ")+(N(6,15,e.displayedItems,"Quantity")-N(7,18,e.displayedItems,"OriginalQuantity"))," ")}}function El(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,Pl,2,0,"div",90),a(),_(25,wl,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,Ml,8,21,"div",95),a()()()()()}if(i&2){let e=c(2);l(16),p("routerLink",ee(10,el))("queryParams",V(11,Pi,e.adjustmentID)),l(),I("Adjustment #",e.completeInfo.InvoiceNumber,""),l(7),p("ngIf",e.roleService.inventory.View),l(),p("ngForOf",e.displayedItems),l(5),S(N(31,7,e.displayedItems,"Quantity")),l(2),p("ngIf",e.roleService.inventory.View)}}function Ol(i,t){if(i&1){let e=y();o(0,"mainpanel-cmp",4),T("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,tl,2,1,"button",5)(3,nl,5,3,"div",6)(4,il,5,3,"div",6),a(),o(5,"content"),_(6,Dl,109,26,"mat-stepper",7)(7,El,33,13,"div",8),a()()}if(i&2){let e=c();p("pageData",e.menuData),P("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 Bn=class i extends Qn{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:O.GuidEmpty,RowCount:500,PageNumber:1,TagID:null,StorageID:O.GuidEmpty},this.oldFilter={CategoryID:"dummy",EntityID:"dummy",ProductName:"dummy",SupplierID:"dummy",RowCount:500,PageNumber:1,TagID:null,StorageID:O.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=j(E({},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=j(E({},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.",se.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||O.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",se.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(O.IsEmpty(n.Code)&&(n.Code=""),O.IsEmpty(m.Code)&&(m.Code=""),x){case"string":return O.compare(n[e.active].toLocaleLowerCase(),m[e.active].toLocaleLowerCase(),h);case"number":return O.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(ie),b(A),b(fe),b(Cn),b(R))};static \u0275cmp=M({type:i,selectors:[["POS-spreadsheet-stock-take"]],viewQuery:function(r,n){if(r&1&&Dt(Ja,5),r&2){let m;Pt(m=Tt())&&(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:[me],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,Ol,8,9,"mainpanel-cmp",3),r&2&&p("ngIf",n.loaderData)},dependencies:[Tn,Ne,te,H,de,re,Oe,G,ne,pe,Ge,Mn,wn,En,Ue,Nt,Ft,Ut,qe,q,Rt],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 Al=()=>["/menu/Products/Catalog/Products/Info"],kl=i=>({ID:i});function Vl(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 jl(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),T("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),P("ngModel",e.pageData.Filter.EntityID)}}function Nl(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),T("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",ee(12,Al))("queryParams",V(13,kl,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),P("ngModel",e.NewQuantity),l(2),I(" ",w(12,10,e.Inventory-e.NewQuantity*e.Ratio)," ")}}function Fl(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())}),T("filterChange",function(n){d(e);let m=c();return D(m.pageData.Filter,n)||(m.pageData.Filter=n),u(n)}),o(1,"actions"),_(2,Vl,2,0,"button",3),a(),o(3,"filters"),_(4,jl,5,2,"ng-template",null,0,B),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,Nl,16,15,"tr",12),a()()()()()()}if(i&2){let e=c();p("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),P("filter",e.pageData.Filter),l(2),p("ngIf",e.roleService.adjustment.Create),l(28),p("ngForOf",e.Items)}}var Hn=class i extends he{constructor(e,r,n,m,h){super(e,r,"Adjustment/GetAdjustToParentList","Outlet/GetByUserAccessWrite");this.toastr=n;this.router=m;this.roleService=h}Items;preGetList(){O.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(O.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,se.Success)},error:h=>{this.toastr.error(h,se.Error)}})}static \u0275fac=function(r){return new(r||i)(b(ie),b(A),b(fe),b(Fe),b(R))};static \u0275cmp=M({type:i,selectors:[["POS-convert-inventory"]],standalone:!1,features:[me],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,Fl,31,6,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[te,H,de,re,Oe,G,ne,pe,Ue,q],encapsulation:2})};function Ul(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 Ll(i,t){if(i&1){let e=y();o(0,"td",10)(1,"input",17),T("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(),P("ngModel",e.Quantity)}}function Rl(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 Ql(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,Ll,2,1,"td",16)(8,Rl,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 Bl(i,t){if(i&1&&Me(0,Ql,9,4,"tr",14,ht),i&2){let e=c();Ee(e.products)}}function Hl(i,t){i&1&&(o(0,"tr")(1,"td",18),f(2,"app-empty-state"),a()())}var Wn=class i extends bn{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(ie),b(A),b(Ae),b(R),b(Z))};static \u0275cmp=M({type:i,selectors:[["POS-count-product-inventory"]],standalone:!1,features:[me],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,Ul,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,Bl,2,0)(22,Hl,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),Y(n.products.length>0?21:22))},dependencies:[H,re,Oe,G,ne,Ue,hr],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 Wl(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 ql(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),T("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),T("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),T("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),P("ngModel",e.pageData.Filter.EntityID),l(3),P("selectedCategoryID",e.pageData.Filter.CategoryID),p("showClear",!0),l(3),p("items",e.pageData.Options.SortBy),P("ngModel",e.pageData.Filter.SortByid)}}function Gl(i,t){if(i&1&&(o(0,"span"),s(1),a()),i&2){let e=t.$implicit;l(),S(e+" ")}}function zl(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,Gl,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 Kl(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())}),T("filterChange",function(n){d(e);let m=c();return D(m.pageData.Filter,n)||(m.pageData.Filter=n),u(n)}),o(1,"actions"),_(2,Wl,3,0,"button",3),a(),o(3,"filters"),_(4,ql,11,6,"ng-template",null,0,B),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,zl,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),P("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,N(28,7,e.data.Data,"Qty")))}}var qn=class i extends he{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(ie),b(A),b(Ae),b(R),b(Z))};static \u0275cmp=M({type:i,selectors:[["POS-product-sheet"]],standalone:!1,features:[me],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,Kl,31,12,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[te,H,re,G,ne,pe,qe,q,Rt],encapsulation:2})};var to=yi(gr());var z=class i{INITIAL_STATE={loadForm:{},outlet:{ID:O.GuidEmpty,Name:""},isOpenDialog:!0,isComplete:!1,adjustmentState:0,quickeyItems:{},cartItems:[],order:{Date:(0,to.default)().utcOffset("+07:00").format(),EntityID:"",ID:O.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=>j(E({},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.Variant.UnitPrice*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=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ti=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,oe,X,ae,Ie,ke,$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=oe,this.Note=X,this.Taxable=ae,this.LoyaltyPoint=Ie,this.EntityID=ke,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}},Gn=class i{adapt(t){return new Ti(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=W({token:i,factory:i.\u0275fac,providedIn:"root"})},wi=class{constructor(t,e,r,n,m,h,x,oe,X,ae,Ie,ke,$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=oe,this.UnitPriceOriginal=X,this.Description=ae,this.UOM=Ie,this.UOMName=ke,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},zn=class i{adapt(t){return new wi(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=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Kn=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=W({token:i,factory:i.\u0275fac,providedIn:"root"})},$n=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=W({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=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Re=class i{destroy$=new Te;#e=C(z);#t=C(A);#n=C(Gn);#i=C(zn);#r=C(_e);#o=C(Kn);#a=C($n);constructor(){}processOrder(){let t=[...this.#e.CartItems()].map(e=>j(E({},this.#o.adapt(e)),{EntityID:O.GuidEmpty,Note:e.Note??"",SalesID:e.SalesID??"",isMaxInventory:!1,PromotionGift:!1,SplitQuantity:0,UnitCost:e.Cost,Cost:e.Cost,Variant:j(E({},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:O.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(Ve.SubmitAdjustment,e).pipe(De(this.destroy$))}if(this.#e.AdjustmentState()===1){let e=j(E({},this.#e.LoadForm().Data),{Order:j(E({},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(Ve.SubmitAdjustment,e).pipe(De(this.destroy$))}}onUpdateOrderState(t,e){if(Object.keys(this.#e.Order()).includes(t)){let n=j(E({},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=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var $t=class i{destroy$=new Te;#e=C(A);#t=C(z);#n=C(_e);orderService=C(Re);getLoadForm$=this.#e.post("/API/Adjustment/LoadForm",{EntityID:O.GuidEmpty,ID:O.GuidEmpty}).pipe(Sn(),F(t=>{this.#t.onChangeLoadform(t)}));constructor(){}httpRequestLoadForm$(t){return Ce(this.#t.IsComplete,{injector:this.#n}).pipe(De(this.destroy$),ce(e=>!e),le(e=>this.#e.post("/API/Adjustment/LoadForm",E({EntityID:"00000000-0000-0000-0000-000000000000",ID:"00000000-0000-0000-0000-000000000000"},t))),F(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=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Jn=class i{destroy$=new Te;#e=C(z);#t=C(A);#n=C(Re);#i=C(_e);constructor(){this.initialize()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initialize(){Fi([Ce(this.#e.Outlet,{injector:this.#i}),Ce(this.#e.AdjustmentState,{injector:this.#i}),Ce(this.#e.IsComplete,{injector:this.#i})]).pipe(Sn(),ce(([t,e,r])=>O.IsNotEmpty(t.ID)&&!r),le(([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(De(this.destroy$),F(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(De(this.destroy$),F(e=>{this.#e.onChangeQuickeyItems(e)}))}getQuickey(t){return this.#t.get(Ve.GetQuickKeyByEntityID,[{key:"ID",value:t}])}static \u0275fac=function(e){return new(e||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Mi=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,oe,X,ae,Ie,ke,$e,Je,Ze,Xe,Ye,et,tt,nt,it,rt,Zt,Xt,Yt,en,tn,nn,rn,on,an,hi){this._Variant=t,this._QtyRequested=e,this._TotalPrice=r,this._SalesName=n,this._PriceNote=m,this._SalesID=h,this._InventoryTypeID=x,this._ID=oe,this._Code=X,this._VariantID=ae,this._Quantity=Ie,this._UnitQuantity=ke,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=hi}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}}},Ei=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,oe,X,ae,Ie,ke,$e,Je,Ze,Xe,Ye,et,tt,nt,it,rt,Zt,Xt,Yt,en,tn,nn,rn,on,an,hi,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=oe,this._ImageUrl=X,this._ThumbnailUrl=ae,this._Component=Ie,this._PriceBook=ke,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=hi,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 Mi(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=W({token:i,factory:i.\u0275fac,providedIn:"root"})},Jt=class i{adapt(t){return new Ei(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=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var $l=i=>({selected:i});function Jl(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;Pe(e.class),p("ngClass",V(4,$l,e.active)),l(),I(" ",e.label," ")}}function Zl(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 Xl(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 Yl(i,t){if(i&1&&(o(0,"div",7),Me(1,Xl,5,6,"div",15,ht),a()),i&2){let e=c();l(),Ee(e.storeService.LoadForm().AdjustmentTags)}}var Zn=class i{modalConfig;storeService=C(z);#e=C(jt);#t=C(ye);form;tabs=Q([]);activeTab=Mt(()=>this.tabs().find(t=>t.active));constructor(){this.modalConfig=new ve,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 ct(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=>j(E({},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"),Me(6,Jl,2,6,"button",5,ht),a()()(),o(8,"div",6),_(9,Zl,8,0)(10,Yl,3,0,"div",7),a(),f(11,"div",8),a()()()),e&2){let n;p("config",r.modalConfig),l(6),Ee(r.tabs()),l(2),p("formGroup",r.form),l(),Y((n=r.activeTab().value)==="note"?9:n==="tag"?10:-1),l(2),p("formGroup",r.form)}},dependencies:[ue,Se,dt,Oe,Ki,G,At,ut,kt,Vt,ge,Ne,ft,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 Xn=class i{modalConfig;#e=C(ye);constructor(){this.modalConfig=new ve,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,Se],encapsulation:2})};var be=class i{variantSearchCTRL=new ct({});#e=C(z);#t=C(A);#n=C(_e);#i=C(Ke);#r=C(Z);#o=C(Jt);destroy$=new Te;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(we(n=>this.generateCartItem(n)),F(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(`${Ve.GetVariantByCode}?Code=${t}&EntityID=${this.#e.Outlet().ID}`).pipe(we(x=>this.generateCartItem(x)),F(x=>{this.onAddCartItem(x)}));{console.log(h,"decodedRegex");let x=h[1],oe=parseFloat(h[2]);return oe=oe/r||1,this.#t.get(`${Ve.GetVariantByCode}?Code=${x}&EntityID=${this.#e.Outlet().ID}`).pipe(we(X=>this.generateCartItem(X)),F(X=>{this.onAddCartItem(X,!1,oe)}),pt(X=>(this.toastr.info("Matching Regex Rule to Barcode","Digital Scale"),this.#t.get(`${Ve.GetVariantByCode}?Code=${t}&EntityID=${this.#e.Outlet().ID}`).pipe(we(ae=>this.generateCartItem(ae)),F(ae=>{this.onAddCartItem(ae)})))))}}else return this.#t.get(`${Ve.GetVariantByCode}?Code=${t}&EntityID=${this.#e.Outlet().ID}`).pipe(we(m=>this.generateCartItem(m)),F(m=>{this.onAddCartItem(m)}))}httpRequestGetInventoryByVariantID(t){return Ce(this.#e.Outlet,{injector:this.#n}).pipe(De(this.destroy$),ce(e=>O.IsNotEmpty(e.ID)),_n(),le(e=>this.#t.get(Ve.GetVariantStockByID,[{key:"EntityID",value:e.ID},{key:"ID",value:t}])))}addItemByVariantID(t){this.httpGetVariantByID(t).pipe(De(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,j(E({},t),{Quantity:r})],this.#e.onChangeCartItems(h)}generateCartItem(t){return this.#i.adapt(j(E({},t),{ID:O.GuidEmpty,Cost:t.UnitCost,Expense:t.UnitCost,SplitQuantity:0,UnitCost:t.UnitCost,InventoryTypeID:4,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:O.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(Zn)}onOpenCartVoidModal(){return this.#r.open(Xn)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var es=["unitCost"],ts=i=>({selected:i}),ns=()=>["/menu/Products/Catalog/Variants/Info"],is=(i,t)=>t.key;function rs(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,ts,r.activeTab().key===e.key)),l(),I(" ",e.label," ")}}function os(i,t){if(i&1&&_(0,rs,2,4,"a",6),i&2){let e=t.$implicit;Y(e.isVisible?0:-1)}}function as(i,t){i&1&&(o(0,"div",11)(1,"h5"),s(2,"Cost"),a(),f(3,"input",17),a())}function ls(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,as,4,0,"div",13),a(),U(12),o(13,"div",8)(14,"div",14)(15,"h5",15),s(16,"Note"),a(),f(17,"POS-tinymce-editor",16),a()(),L(),a()),i&2){let e=c();l(11),p("ngIf",e.roleService.product.Cost)}}function ss(i,t){if(i&1&&f(0,"img",31),i&2){let e=c(3);p("ngSrc",e.cartItem.ThumbnailUrl)}}function ms(i,t){i&1&&_(0,ss,1,1,"ng-template")}function ps(i,t){i&1&&(U(0),f(1,"i",32),o(2,"h6"),s(3,"No Image"),a(),L())}function cs(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 ds(i,t){if(i&1&&(U(0),o(1,"div",18)(2,"div",19)(3,"a",20),_(4,ms,1,0)(5,ps,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,cs,10,1,"div",30),a()(),f(31,"div",18),a(),L()),i&2){let e=c();l(3),p("routerLink",ee(6,ns)),l(),Y(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 us(i,t){if(i&1){let e=y();o(0,"POS-tab-serial",35),T("variantChange",function(n){d(e);let m=c();return D(m.cartItem,n)||(m.cartItem=n),u(n)})("serialsChange",function(n){d(e);let m=c();return D(m.serials,n)||(m.serials=n),u(n)}),a()}if(i&2){let e=c();p("isEditBuyForm",!1)("outletID",e.storeService.Outlet().ID),P("variant",e.cartItem)("serials",e.serials)}}var Yn=class i{constructor(t){this.data=t;this.cartItem=JSON.parse(JSON.stringify(this.storeService.CartItems()[this.data.index])),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&&this.isEditCostEnabled()&&setTimeout(()=>{this._costElement?.nativeElement?.click(),this._costElement.nativeElement.focus()},500)})}storeService=C(z);roleService=C(R);AppConfigJSON;modalConfig=new ve;cartItem;form;tabs=Q([]);activeTab=Mt(()=>this.tabs().filter(t=>t.isActive)[0]);isItemSerial=Q(!1);inventory=Q({ON_HAND:0,ALLOCATED:0,AVAILABLE:0,ROP:0,MAX:0});serials=[];_costElement;cdr=C(Hi);#e=C(jt);#t=C(ye);#n=C(Ke);#i=C(be);#r=C(_e);#o=C(fe);itemQuantity=Q(1);itemPrice=Q("");itemCost=Q("");itemNote=Q("");isEditCostEnabled=Q(!1);ngAfterViewInit(){}handleIsEditCostEnabled(){this.isEditCostEnabled.update(t=>!t),this.cdr.detectChanges()}onTabChange(t){let e=this.tabs().map(r=>r.key===t?j(E({},r),{isActive:!0}):j(E({},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(){Ce(this.storeService.CartItems,{injector:this.#r}).pipe(F(t=>{this.cartItem=t[this.data.index]})).subscribe(),this.generateForm(),this.isItemSerial.set(this.checkIsSerial()),this.tabs.set([{key:0,value:"cart",label:"Cart",isActive:!0,isVisible:!0},{key:1,value:"product",label:"Product",isActive:!1,isVisible:this.roleService.inventory.View&&this.cartItem.Variant.Name.length>0},{key:2,value:"serial",label:"Serial",isActive:!1,isVisible:!0}]),this.requestUnitInStock().subscribe({next:t=>this.inventory.set(j(E({},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)}))}),this.form.valueChanges.pipe(F(t=>{let e=this.storeService.CartItems().reduce((r,n,m)=>(this.data.index===m?r.push(E({},this.#n.adapt(j(E({},n),{Quantity:+t.Quantity,Price:+t.Price,Cost:+t.Cost,Note:t.Note})))):r.push(n),r),[]);this.storeService.onChangeCartItems(e)}),gt("edit")).subscribe()}onNoteChange(t){this.form.get("Note").setValue(t)}onOK(){if(this.checkIsSerial()){if(Array.isArray(this.cartItem.Serial)&&this.cartItem.Serial.length){let t=this.cartItem.Serial.reduce((e,r)=>e+r.Quantity,0);if(this.cartItem.Quantity!==t){this.#o.warning("Serial must be equal with the quantity",se.Warning);return}}if(this.cartItem.Quantity<0){let t=this.storeService.CartItems().reduce((e,r,n)=>(this.data.index===n?e.push(E({},this.#n.adapt(j(E({},r),{Quantity:+this.cartItem.Quantity,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):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(E({},this.#n.adapt(j(E({},r),{Quantity:+this.cartItem.Quantity,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):e.push(r),e),[]);this.storeService.onChangeCartItems(t)}}else{let t=this.storeService.CartItems().reduce((e,r,n)=>(this.data.index===n?e.push(E({},this.#n.adapt(j(E({},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}requestUnitInStock(){if(O.IsEmpty(this.storeService.Outlet().ID)){this.#o.error("Please select outlet before proceding...",se.Error);return}return Ce(this.activeTab,{injector:this.#r}).pipe(ce(t=>t.key===1),_n(),le(t=>this.#i.httpRequestGetInventoryByVariantID(this.cartItem.VariantID)))}onCancel(){this.#t.close()}static \u0275fac=function(e){return new(e||i)(b(_t))};static \u0275cmp=M({type:i,selectors:[["adjustment-modal-edit-product"]],viewQuery:function(e,r){if(e&1&&Dt(es,5),e&2){let n;Pt(n=Tt())&&(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,"isEditBuyForm","outletID","variant","serials"],[1,"btn","btn-link",3,"ngClass"],[1,"btn","btn-link",3,"click","ngClass"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["formControlName","Price","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],["class","col-auto ps-0",4,"ngIf"],[1,"col-12"],[1,"mb-5"],["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","isEditBuyForm","outletID","variant","serials"]],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"),Me(5,os,1,1,null,null,is),a()()(),o(7,"div",4),_(8,ls,18,1,"div")(9,ds,32,7,"ng-container")(10,us,1,4,"POS-tab-serial",5),a()()()),e&2){let n;p("config",r.modalConfig),l(5),Ee(r.tabs()),l(2),p("formGroup",r.form),l(),Y((n=r.activeTab().key)===0?8:n===1?9:n===2?10:-1)}},dependencies:[ue,Se,ge,Ne,H,ut,Oe,G,At,kt,Vt,ft,Wt,ln,de,qi,An,Lt,Ue,xn],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 _s(i,t){if(i&1){let e=y();o(0,"div",27)(1,"button",28),g("click",function(){d(e);let n=c().index,m=c(2);return u(m.onReturnVariant(n))}),s(2," Return "),a(),o(3,"button",28),g("click",function(){d(e);let n=c().index,m=c(2);return u(m.onPurchaseVariant(n))}),s(4," Purchase "),a()()}}function gs(i,t){if(i&1&&(o(0,"td",29),s(1),a()),i&2){let e=c().index;l(),I(" ",e+1,". ")}}function fs(i,t){if(i&1){let e=y();U(0),o(1,"div",30)(2,"img",31),g("error",function(n){d(e);let m=c(3);return u(m.onErrorImage(n))}),a()(),L()}if(i&2){let e=c().$implicit;l(2),p("src",e.Variant.ThumbnailUrl,bt)("alt",e.Variant.Name)}}function Cs(i,t){i&1&&(o(0,"div",32),f(1,"i",33),a())}function hs(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 ys(i,t){i&1&&(o(0,"span",34),s(1," x "),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.UnitQuantity))}}function Ss(i,t){if(i&1&&(U(0),o(1,"small",35),s(2),a(),L()),i&2){let e=c().$implicit;l(2),S(e.Variant.UOM?e.Variant.UOMName:"")}}function xs(i,t){if(i&1&&(U(0),o(1,"div",36),s(2),v(3,"number"),a(),L()),i&2){let e=c().$implicit;l(2),I(" ",N(3,1,e.Price,"1.0-4")," ")}}function bs(i,t){if(i&1){let e=y();U(0),o(1,"tr",7),g("click",function(){let n=d(e).index,m=c(2);return u(m.onOpenModalEditProduct(n))}),_(2,_s,5,0,"ng-template",null,1,B)(4,gs,2,1,"td",8),o(5,"td",9)(6,"div",10),_(7,fs,3,2,"ng-container",3)(8,Cs,2,0,"ng-template",null,2,B),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,hs,3,3,"span",18)(23,ys,2,0,"span",19)(24,vs,3,3,"span",18),a(),_(25,Ss,3,1,"ng-container",18),a()()(),o(26,"td"),_(27,xs,4,4,"ng-container",18),a(),o(28,"td")(29,"div",20),s(30),v(31,"number"),a()(),o(32,"td",21)(33,"div",16)(34,"div",22),s(35),v(36,"number"),a()()(),o(37,"td",23)(38,"div",24)(39,"span",25),g("click",function(){let n=d(e).index,m=c(2);return u(m.removeCartItem(n))}),f(40,"i",26),a()()()(),L()}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(3),I(" ",n.Discount?w(31,16,n.Discount*-1)+"%":""," "),l(5),I(" ",x.roleService.product!=null&&x.roleService.product.Price?w(36,18,+n.Quantity*+n.Variant.UnitPrice):" - "," ")}}function Is(i,t){if(i&1){let e=y();U(0),o(1,"table",4)(2,"tbody",5),g("cdkDropListDropped",function(n){d(e);let m=c();return u(m.onDrop(n))}),_(3,bs,41,20,"ng-container",6),a()(),L()}if(i&2){let e=c();l(3),p("ngForOf",e.CartItems())}}function Ds(i,t){i&1&&(o(0,"div",37)(1,"div",38)(2,"div",39)(3,"div",40)(4,"div",41),f(5,"i",42),a(),o(6,"div",43)(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 ei=class i{roleService=C(R);storeService=C(z);cartService=C(be);matDialog=C(Z);renderer=C(hn);#e=C(Ke);CartItems=this.storeService.CartItems;AppConfigJSON=this.storeService.AppConfigJSON;onDrop(t){}onOpenModalEditProduct(t){let e=this.matDialog.open(Yn,{data:{index:t}})}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(E({},this.#e.adapt(j(E({},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(E({},this.#e.adapt(j(E({},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"],[1,"fw-normal","fs-5","text-danger"],["data-test","total",1,"pe-0"],[1,"fs-5"],[1,"mt-6","ps-0"],[1,"d-flex","justify-content-end","align-items-center"],["role","button","title","Delete Item",1,"fs-3","cursor-pointer",3,"click"],[1,"fa","fa-trash","text-danger","fs-4"],["cdkMenu","",1,"example-menu"],["cdkMenuItem","",1,"example-menu-item",3,"click"],[2,"width","10px","padding-left","12px"],[1,""],[1,"object-fit-contain",2,"height","55px","width","55px",3,"error","src","alt"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6"],["title","UOM",1,"ps-1","fs-5"],[1,"fs-5","text-end"],[1,"row","g-0","h-100"],[1,"col-12"],[1,"d-flex","justify-content-center","align-items-center","h-100"],[1,"row"],[1,"col-12","d-flex","justify-content-center"],[1,"fa-regular","fa-cart-arrow-up","text-secondary",2,"font-size","110px"],[1,"col-12","justify-content-center","text-center","mt-5","empty-cart-description","text-secondary","headings-font-family"]],template:function(e,r){if(e&1&&_(0,Is,4,1,"ng-container",3)(1,Ds,15,0,"ng-template",null,0,B),e&2){let n=$(2);p("ngIf",r.CartItems().length>0)("ngIfElse",n)}},dependencies:[H,lr,te,ar,qt,q,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 ti=class i{storeService=C(z);cartService=C(be);orderService=C(Re);loadFormService=C($t);roleService=C(R);#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(ce(e=>e.type==="OK"),le(()=>this.loadFormService.getLoadForm$),F(()=>{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","fa-rectangle-xmark"],[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,"Void"),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),yt("(",r.storeService.CartItems().length," items, ",r.storeService.QtyCartItems()," Qty)"),l(2),S(w(16,3,r.storeService.SubTotal())))},dependencies:[q],styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};function Ps(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 ni=class i{cartService=C(be);query=new ct({});#e=C(A);storeService=C(z);skipXHR=!1;spinnerService=C(Gr);constructor(){}onBarcodeScan(t){console.log("Scanned barcode:",t),this.cartService.httpRequestVariantByCode(t).pipe().subscribe()}ngOnInit(){this.query.valueChanges.pipe(gt("query"),ce(t=>t&&Object.keys(t).length>0),F(t=>{this.spinnerService.show()}),le(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)))}),F(()=>{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,Ps,10,5,"ng-template",null,0,B),a()()()}if(e&2){let n=$(6);l(4),p("clearOnSelect",!0)("useCustomTemplate",!0)("itemTemplate",n)("outletId",r.storeService.Outlet().ID)}},dependencies:[ge,q,xr,dt,ut,Qt,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 Oi=class{constructor(t,e,r,n,m,h,x,oe,X,ae,Ie){this._StateID=t,this._StateLabel=e,this._Success=r,this._Message=n,this._InvoiceID=m,this._OrderID=h,this._InvoiceNumber=x,this._PrintMode=oe,this._DeliveryID=X,this._PaymentStateID=ae,this._PaymentStateLabel=Ie}_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}}},ri=class i{adapt(t){return new Oi(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=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ts=(i,t)=>t.key;function ws(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 oi=class i{constructor(t,e){this.dialogRef=t;this.data=e;this.config=new ve,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0}config;adjustmentState=Q([]);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(ye),b(_t))};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),Me(3,ws,3,2,"div",2,Ts),a()()()),e&2&&(p("config",r.config),l(3),Ee(r.adjustmentState()))},dependencies:[ge,Ne,ue,Se],encapsulation:2})};var ai=class i{destroy$=new Te;#e=C(Re);#t=C(z);#n=C(ri);injector=C(_e);toastr=C(fe);matDialog=C(Z);constructor(){}ngOnInit(){}onProcessOrder(){if(O.IsEmpty(this.#t.Outlet().ID)){this.toastr.error("Please select outlet before proceeding..",se.Error);return}if(this.#t.CartItems().length==0){this.toastr.error("You must have at least one item.",se.Error);return}if(O.IsEmpty(this.#t.Order().Number)){this.toastr.error("Number cannot be empty.",se.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(De(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),Ce(this.#t.LoadForm,{injector:this.injector}).pipe(le(t=>!t.Data||t.Data&&t.Data.Order.StateID&&t.Data.Order.StateID==1?this.matDialog.open(oi).afterClosed().pipe(ce(e=>e!=null&&e.role==="ok"),F(e=>{let r=e.data;this.#e.onUpdateOrderState("StateID",Number(r))}),le(()=>this.#e.processOrder())):this.#e.processOrder()),F(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:[ei,ti,ni,Lr],encapsulation:2})};function Ms(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 li=class i{menu$;storeService=C(z);#e=C(Fe);#t=C(ie);#n=C(vn);cartItems;fullContainerEl=document.getElementById("full-container");constructor(){this.#t.setMenu$(),this.menu$=this.#t.menu$.pipe(we(t=>j(E({},t),{H:"Inventory Adjustment",T:t.T.replace("undefined","Inventory Adjustment")})),F(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,Ms,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,bt),l(),I("Adjustment #",r.storeService.OrderComplete().InvoiceNumber,""),l(2),p("ngForOf",r.cartItems),l(5),I(" ",w(35,9,r.storeService.QtyCartItems())," "))},dependencies:[Et,q,Dn,re,te,In],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 Es=["qty"];function Os(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 ve;cartService=C(be);cartItem=Q(null);query=new ct(null);form;#e=C(ye);unsubscribe$=new Te;#t=C(jt);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(De(this.unsubscribe$),le(t=>this.cartService.httpGetVariantByID(t,!1).pipe()),gt("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&&Dt(Es,5),e&2){let n;Pt(n=Tt())&&(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,Os,6,2,"ng-template",null,0,B),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()(),U(23),o(24,"div",8)(25,"div",5)(26,"h5",14),s(27,"Note"),a(),f(28,"POS-tinymce-editor",15),a()(),L(),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:[Lt,Ue,Qt,We,ue,Se,Cr,ut,Oe,G,At,$i,kt,Vt,ft,Wt],encapsulation:2})};var ro=yi(Vo());function As(i,t){if(i&1){let e=y();U(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(),L()}if(i&2){let e=c(2);l(),p("sampleUrl",e.sampleURL)}}function ks(i,t){if(i&1){let e=y();U(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(),L()}if(i&2){let e=c(2);l(),p("sampleUrl",e.sampleURL)}}function Vs(i,t){if(i&1&&_(0,As,2,1,"ng-container",2)(1,ks,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 si=class i{modalConfig;sampleURL;fileInput=Q(null);unsubscribe$=new Te;#e=C(ye);#t=C(A);#n=C(z);#i=C(be);#r=C(_e);cartItem=Q([]);skipEmptyLines=!0;rowCount=Q(0);rowEmpty=Q(0);totalRows=Mt(()=>this.rowCount()-this.rowEmpty());file=Q(null);uploadState=Q(0);uploadStateEnum=On;constructor(){this.modalConfig=new ve,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(gt("response"),pt(e=>(e instanceof yn&&this.uploadState.set(3),[])),F(e=>{Array.isArray(e)&&e.length>0&&(this.uploadState.set(2),e.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,Vs,2,2,"ng-template",null,0,B),a()}e&2&&p("config",r.modalConfig)},dependencies:[ge,H,ue,Se,Gt],encapsulation:2})};function js(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 Ns(i,t){if(i&1&&Me(0,js,2,2,"li",10,vi),i&2){let e=c().$implicit;Ee(e.children)}}function Fs(i,t){if(i&1&&(o(0,"div",7)(1,"div",8),s(2),a(),f(3,"div",9),_(4,Ns,2,0),a()),i&2){let e=t.$implicit;l(2),S(e.title),l(2),Y(e.children.length>0?4:-1)}}var mi=class i{menu=Q([]);#e=C(Z);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(si);break;case"adjustment v1":this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Form"]);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),Me(8,Fs,5,2,"div",7,vi),a()()()),e&2&&(l(8),Ee(r.menu()))},dependencies:[jr],encapsulation:2})};var Ai=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}},pi=class i{adapt(t){return new Ai(t.Order,t.Items,t.OrderItems,t.CountedItems)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},ki=class{constructor(t,e,r,n,m,h,x,oe,X,ae,Ie,ke,$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=oe,this._ReviewDate=X,this._ReviewerID=ae,this._TypeID=Ie,this._TypeLabel=ke,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 ki(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=W({token:i,factory:i.\u0275fac,providedIn:"root"})},Vi=class{constructor(t,e,r,n,m,h,x,oe,X,ae,Ie,ke){this._LostNFoundID=t,this._UnitCost=e,this._InventoryTypeID=r,this._UnitPrice=n,this._Discount=m,this._VariantID=h,this._Note=x,this._Quantity=oe,this._UnitQuantity=X,this._Index=ae,this._Serial=Ie,this._ID=ke}_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 Vi(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=W({token:i,factory:i.\u0275fac,providedIn:"root"})},ji=class{constructor(t,e,r,n,m,h,x,oe,X,ae,Ie,ke){this._ParentID=t,this._Start=e,this._Finish=r,this._UnitPrice=n,this._UnitCost=m,this._VariantID=h,this._Note=x,this._Quantity=oe,this._UnitQuantity=X,this._Index=ae,this._Serial=Ie,this._ID=ke}_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 ji(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=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var so=yi(gr());function Us(i,t){if(i&1&&(U(0),f(1,"adjustment-order-complete",2),L()),i&2){let e=c();l(),p("cartItems",e.storeService.CartItems())}}function Ls(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 ci=class i{isOpenDialog=Q(!0);loadFormService=C($t);intercom=C(Ji);storeService=C(z);quickeyService=C(Jn);cartService=C(be);orderService=C(Re);isOpenDiaglog$;Outlets$;loadForm$;adjustmentEditDataAdapter=C(pi);roleService=C(R);#e=C(Ke);#t=C(Jt);#n=C(Ot);transactionType$=this.#n.queryParamMap.pipe(we(t=>(t.has("ID"),"Adjustment")));title=C(vn);injector=C(_e);renderer=C(hn);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(le(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(F(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(j(E({},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({}),Ce(this.storeService.IsOpenDialog,{injector:this.injector}).pipe().subscribe(),this.isOpenDiaglog$=Ce(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,Us,2,1,"ng-container",1)(1,Ls,22,20,"ng-template",null,0,B),e&2){let n=$(2);p("ngIf",r.storeService.IsComplete())("ngIfElse",n)}},dependencies:[H,Et,vr,wr,Mr,Tr,dt,G,ne,pe,ai,li,mi],styles:[".left-toolbar-container[_ngcontent-%COMP%]{position:relative}.left-toolbar-container[_ngcontent-%COMP%] POS-invoice-number-form[_ngcontent-%COMP%]{position:absolute;top:34px;left:28px}.header[_ngcontent-%COMP%]{min-height:60px}.content[_ngcontent-%COMP%]{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 Rs=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Qs=i=>({ID:i});function Bs(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 Hs(i,t){if(i&1){let e=y();o(0,"div")(1,"div",13)(2,"h6"),s(3,"Variant"),a(),o(4,"autocompleteV2",14),T("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),T("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),T("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),T("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),P("ngModel",e.pageData.Filter.ID),p("inputTextValue",e.pageData.Filter.VariantName),l(3),p("items",e.pageData.Options.Entities),P("ngModel",e.pageData.Filter.EntityID),l(3),p("isFloatingLabel",!1),P("date",e.pageData.Filter.From),l(3),p("isFloatingLabel",!1),P("date",e.pageData.Filter.To)}}function Ws(i,t){i&1&&(o(0,"th"),s(1,"Variant"),a())}function qs(i,t){if(i&1&&(o(0,"td"),s(1),a()),i&2){let e=c().$implicit;l(),S(e.Name)}}function Gs(i,t){if(i&1&&(o(0,"tr",18),_(1,qs,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",ee(14,Rs))("queryParams",V(15,Qs,e.ID)),l(),S(e.Number),l(2),S(w(10,9,e.Quantity)),l(3),S(N(13,11,e.Date,"dd/MM/yy"))}}function zs(i,t){if(i&1){let e=y();o(0,"mainpanel-cmp",2),T("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())}),T("filterChange",function(n){d(e);let m=c();return D(m.pageData.Filter,n)||(m.pageData.Filter=n),u(n)}),o(1,"actions"),_(2,Bs,3,0,"button",3),a(),o(3,"filters"),_(4,Hs,14,8,"ng-template",null,0,B),a(),o(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr"),_(12,Ws,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,Gs,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),P("text",e.pageData.Filter.Number),p("isFilterOnDropdown",!1),P("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 di=class i extends he{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(we(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(ie),b(A),b(Ot),b(Z),b(R))};static \u0275cmp=M({type:i,selectors:[["POS-history-variant"]],standalone:!1,features:[me],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,zs,25,11,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[te,H,de,re,G,ne,Ht,pe,We,Ge,Et,q,He],encapsulation:2})};function Ks(i,t){if(i&1){let e=y();U(0),o(1,"div",3)(2,"h6",1),s(3,"Category"),a(),o(4,"POS-product-category-select",11),T("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),T("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),T("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()(),L()}if(i&2){let e=c();l(4),P("selectedCategoryID",e.categoryId),p("showClear",!0)("continuedCategoriesOnly",!0),l(4),P("ngModel",e.supplierID),l(4),p("items",e.loader.Options==null?null:e.loader.Options.BrandOptions),P("ngModel",e.loader.Filter.BrandID)}}function $s(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 Js(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 ui=class i{constructor(t,e,r){this.dialogRef=t;this.http=r;this.configModal=new ve,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(ye),b(_t),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),T("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),T("modelChange",function(m){return D(r.stockCount,m)||(r.stockCount=m),m}),g("modelChange",function(){return r.toggleTotalRows=!1}),a()(),_(10,Ks,13,6,"ng-container",5),o(11,"div",3)(12,"h6",1),s(13,"Format"),a(),o(14,"radio-options",6),T("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,$s,2,0,"span",10)(20,Js,3,3,"span",5),a()()()()),e&2&&(p("config",r.configModal),l(5),P("model",r.onHandInventory),l(4),P("model",r.stockCount),p("options",r.stockCountOptions),l(),p("ngIf",r.stockCount=="1"),l(4),P("model",r.exportFormat),p("options",r.exportFormatOptions),l(5),p("ngIf",!r.toggleTotalRows),l(),p("ngIf",r.toggleTotalRows))},dependencies:[H,G,ne,pe,We,Se,Pn,qe,q],encapsulation:2})};var Zs=i=>({"text-danger":i}),Xs=()=>["/menu/Products/Catalog/Variants/Info"],Ys=i=>({ID:i});function em(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 tm(i,t){if(i&1){let e=y();U(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(),L()}if(i&2){let e=c();l(3),p("disabled",!e.canProceedPreview)}}function nm(i,t){if(i&1){let e=y();U(0),o(1,"button",40),g("click",function(){d(e);let n=c(),m=$(8);return u(n.newUpload(m))}),s(2,"New"),a(),L()}}function im(i,t){if(i&1&&s(0),i&2){let e=t.index;S(e+1)}}function rm(i,t){i&1&&(f(0,"i",43),s(1,"Upload"))}function om(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(" ",N(2,2,e.Name,25)," ")}}function am(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 lm(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 sm(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 mm(i,t){i&1&&(f(0,"i",49),s(1,"Preview"))}function pm(i,t){i&1&&(o(0,"th",50),s(1," Difference "),a())}function cm(i,t){i&1&&(o(0,"th",51),s(1," Cost "),a())}function dm(i,t){i&1&&(o(0,"th"),s(1," Message "),a())}function um(i,t){if(i&1&&(o(0,"a",58),s(1),a()),i&2){let e=c().$implicit;p("routerLink",ee(3,Xs))("queryParams",V(4,Ys,e.VariantID)),l(),S(e.VariantName)}}function _m(i,t){if(i&1&&(o(0,"span",59),s(1),a()),i&2){let e=c().$implicit;l(),S(e.VariantName)}}function gm(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 fm(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 Cm(i,t){if(i&1&&(o(0,"div"),s(1),a()),i&2){let e=t.$implicit;l(),yt(" ",e.Issue," ",e.Solution," ")}}function hm(i,t){if(i&1&&(o(0,"td"),_(1,Cm,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 ym(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,um,2,6,"a",54)(7,_m,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,gm,2,5,"td",56)(15,fm,3,7,"td",56)(16,hm,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,Zs,!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 vm(i,t){i&1&&(f(0,"i",60),s(1,"Finish"))}var _i=class i extends he{constructor(e,r,n,m,h,x,oe,X){super(e,r,null,"Outlet/GetByUserAccessWrite");this.toastr=n;this.csvConverter=m;this.router=h;this.importService=x;this.roleService=oe;this.matDialog=X;this.formData={},this.opNames=[],r.get("/api/AdjustmentLoader/ImportAdjustmentV2Loader").subscribe(ae=>{this.loader=ae,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(R);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=Q(0);uploadStateEnum=On;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 yn&&(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,se.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(O.IsEmpty(n.Code)&&(n.Code=""),O.IsEmpty(m.Code)&&(m.Code=""),x){case"string":return O.compare(n[e.active].toLocaleLowerCase(),m[e.active].toLocaleLowerCase(),h);case"number":return O.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(ui,{data:{loader:this.loader,outletID:this.formData.EntityID}}).afterClosed().pipe(ce(e=>O.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(ie),b(A),b(fe),b(Ae),b(Fe),b(Ur),b(R),b(Z))};static \u0275cmp=M({type:i,selectors:[["POS-csv-stock-take-v2"]],standalone:!1,features:[me],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"),U(2),_(3,em,2,0,"button",2),L(),_(4,tm,5,1,"ng-container",3)(5,nm,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,im,1,1,"ng-template",5),o(10,"mat-step",6),_(11,rm,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),T("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,om,3,5,"ng-template",16),a()(),_(24,am,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,lm,1,2,"POS-uppy",20)(33,sm,1,2,"POS-uppy",20),a()()(),o(34,"mat-step",21),_(35,mm,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,pm,2,0,"th",32)(58,cm,2,0,"th",33)(59,dm,2,0,"th",3),a()(),o(60,"tbody"),_(61,ym,17,13,"tr",34),a()()()(),o(62,"mat-step",35),_(63,vm,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),P("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,te,H,de,re,G,ne,pe,Mn,wn,En,Ir,Ft,Ut,Gt,nr,ir,mr,q,Zi],styles:[".sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{top:48px!important}"]})};var Sm=i=>({ID:i});function xm(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 bm(i,t){if(i&1){let e=y();o(0,"div",6)(1,"h6"),s(2,"Outlets"),a(),o(3,"outlet-selector",7),T("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),T("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),T("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),P("ngModel",e.pageData.Filter.OutletId),p("multiple",!1)("clearable",!1),l(3),P("ngModel",e.pageData.Filter.SupplierId),l(3),P("selectedCategoryID",e.pageData.Filter.CategoryId),p("showClear",!0)}}function Im(i,t){i&1&&(o(0,"th",20),s(1," On Hand "),a())}function Dm(i,t){if(i&1&&(o(0,"td",22),s(1),a()),i&2){let e=c().$implicit;l(),S(e.OnHand)}}function Pm(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,Dm,2,1,"td",23),a()),i&2){let e=t.$implicit,r=c(2);l(2),p("queryParams",V(9,Sm,e.ID)),l(),S(e.Name),l(2),S(e.Code),l(2),S(N(8,6,e.LastCountDate,"dd MMM yyyy")),l(3),S(e.DaysSinceLastCount),l(),p("ngIf",r.role.inventory.View)}}function Tm(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,Im,2,0,"th",17),a()(),o(13,"tbody"),_(14,Pm,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 gi=class i extends he{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(R);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(O.IsEmpty(n.Code)&&(n.Code=""),O.IsEmpty(m.Code)&&(m.Code=""),x){case"string":return O.compare(n[e.active].toLocaleLowerCase(),m[e.active].toLocaleLowerCase(),h);case"number":return O.compare(n[e.active],m[e.active],h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(b(ie),b(A),b(Ae),b(R),b(Z))};static \u0275cmp=M({type:i,selectors:[["POS-last-count"]],standalone:!1,features:[me],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),T("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())}),T("filterChange",function(x){return d(m),D(n.pageData.Filter,x)||(n.pageData.Filter=x),u(x)}),o(1,"actions"),_(2,xm,3,0,"button",2),a(),o(3,"filters"),_(4,bm,10,7,"ng-template",null,0,B),a(),o(6,"content"),_(7,Tm,16,4,"div",3),a()()}r&2&&(p("pageData",n.menuData),P("text",n.pageData.Filter.Text),p("isFilterOnDropdown",!1),P("filter",n.pageData.Filter),l(2),p("ngIf",n.roleService.global.Export),l(5),p("ngIf",n.data&&n.data.Data))},dependencies:[te,H,de,re,G,ne,We,Ge,Ft,Ut,qe,Bt,He],encapsulation:2})};var wm=[{path:"Adjustment/Archive",component:Fn},{path:"Adjustment/Archive/Info",component:Vn},{path:"Adjustment/Archive/Form",component:ci,canActivate:[qr],data:{roles:[Si.adjustment.Create,Si.adjustment.Edit]}},{path:"Tools/Count_Product_Inventory",component:Wn},{path:"Tools/Convert_Inventory_to_Parent_UOM",component:Hn},{path:"Tools/Product_Sheet",component:qn},{path:"Report/Last_Count",component:gi},{path:"Report/Adjustment",component:Rn},{path:"History/Variant",component:di},{path:"Adjustment/Stock_Take_by_Web_Spreadsheet",component:Bn},{path:"Adjustment/Stock_Take_by_CSV",component:_i},{path:"",redirectTo:"Adjustment/Archive",pathMatch:"full"}],fi=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=It({type:i});static \u0275inj=xt({imports:[ln.forChild(wm),ln]})};var Ni=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(F(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)(Li(A))};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ci=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=It({type:i});static \u0275inj=xt({imports:[ge]})};var mo=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=It({type:i});static \u0275inj=xt({imports:[Tn,ge,fi,Dn,dt,In,fr,pe,Rr,Qr,Qt,ue,Sr,sr,_r,ue,Dr,br,xi,ur,Lt,xn,tr,yr,er,Wr,xi,Xi,Br,Hr,Pr,ft,Vr,Ci,qt,qe,Bt,An,kn,Gt,rr,Yi,or]})};export{mo as AdjustmentModule};
|