dealpos 25.31.1 → 25.31.3
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-FCHQAB7C.js → chunk-2272UHVJ.js} +1 -1
- package/browser/{chunk-NAAO6ZOQ.js → chunk-26WIZL6M.js} +1 -1
- package/browser/{chunk-PCQLOEIW.js → chunk-2OQ5CGDZ.js} +1 -1
- package/browser/{chunk-HLMWKNVN.js → chunk-2Y7RQ5GK.js} +1 -1
- package/browser/{chunk-ESHESDRD.js → chunk-2ZRIS5SY.js} +1 -1
- package/browser/{chunk-IHJNKEC5.js → chunk-324YW32W.js} +1 -1
- package/browser/{chunk-VIKFXLKK.js → chunk-3ESJIRJI.js} +1 -1
- package/browser/{chunk-BLWVWRVF.js → chunk-3HZQ2MWE.js} +1 -1
- package/browser/{chunk-3XXNFJJ5.js → chunk-4LCG2U7W.js} +1 -1
- package/browser/{chunk-NDY4KZR7.js → chunk-4NCDQTGK.js} +1 -1
- package/browser/{chunk-4YPD7UH7.js → chunk-67AKWIMD.js} +1 -1
- package/browser/{chunk-WWZM7AAB.js → chunk-6IWEI2S7.js} +1 -1
- package/browser/{chunk-TUMGNSSG.js → chunk-6W2MNUMT.js} +1 -1
- package/browser/{chunk-S3SV7V3K.js → chunk-A4WFJLPW.js} +1 -1
- package/browser/{chunk-NYQISX25.js → chunk-ACQ5WGFA.js} +1 -1
- package/browser/{chunk-AY3YOHGT.js → chunk-AYNFEJS7.js} +1 -1
- package/browser/{chunk-BTKE7LGO.js → chunk-BNP5MTYZ.js} +2 -2
- package/browser/{chunk-ZYKH2C6R.js → chunk-BU6O2DK4.js} +1 -1
- package/browser/{chunk-KSQYIDAI.js → chunk-C6XGSCT2.js} +1 -1
- package/browser/{chunk-VWT32Q5D.js → chunk-CC72HMXK.js} +1 -1
- package/browser/{chunk-LMI3TQ2W.js → chunk-CQR6IIYD.js} +1 -1
- package/browser/{chunk-YL6MOVLM.js → chunk-DI72TVEV.js} +1 -1
- package/browser/{chunk-S45NMNLU.js → chunk-EBBLJUWQ.js} +2 -2
- package/browser/{chunk-J7P6BRKJ.js → chunk-FETPS43Y.js} +2 -2
- package/browser/{chunk-L6EYB75T.js → chunk-GYGWAZRQ.js} +1 -1
- package/browser/{chunk-XG4KOCGE.js → chunk-GYU26T5D.js} +1 -1
- package/browser/{chunk-VNTG35UI.js → chunk-HVMYNIC7.js} +1 -1
- package/browser/{chunk-IQ6RFZ5S.js → chunk-I3DTU2HT.js} +1 -1
- package/browser/{chunk-HQLAADHA.js → chunk-J7DAVGHL.js} +1 -1
- package/browser/{chunk-YNIEDDDQ.js → chunk-JDV2UBEW.js} +1 -1
- package/browser/{chunk-PLWZSTWZ.js → chunk-JVBQVJGY.js} +1 -1
- package/browser/{chunk-RWFIJSVW.js → chunk-JVDAP5PW.js} +1 -1
- package/browser/{chunk-DDJKPHO7.js → chunk-KFKCXJAT.js} +1 -1
- package/browser/{chunk-Q73OU5X3.js → chunk-KKTDFA34.js} +1 -1
- package/browser/{chunk-TVGSMZS3.js → chunk-L3UTRSNX.js} +1 -1
- package/browser/{chunk-2H22PSYN.js → chunk-LNQFPG7E.js} +1 -1
- package/browser/{chunk-DP46NUW4.js → chunk-M5L4RIM5.js} +1 -1
- package/browser/{chunk-FMLRA5XH.js → chunk-MNFGMEQY.js} +1 -1
- package/browser/{chunk-RSHIMZ5V.js → chunk-MZPCKRS4.js} +1 -1
- package/browser/{chunk-2SZLN7C3.js → chunk-NJ2M4SPG.js} +2 -2
- package/browser/{chunk-GGZUD2KJ.js → chunk-NYXJPCQQ.js} +1 -1
- package/browser/{chunk-XV7A7YTQ.js → chunk-OUSV72N6.js} +1 -1
- package/browser/{chunk-M6VZPCA2.js → chunk-QGOX7DS2.js} +1 -1
- package/browser/{chunk-T6DIPRDJ.js → chunk-QLHKMGW3.js} +1 -1
- package/browser/{chunk-W4XQ5DKR.js → chunk-QWGD3H2A.js} +1 -1
- package/browser/{chunk-5SUX6ZNW.js → chunk-QYHR4HH4.js} +1 -1
- package/browser/{chunk-RQGQWLFQ.js → chunk-ROCCL6ZZ.js} +1 -1
- package/browser/{chunk-L5FJOPFR.js → chunk-RUK3LROA.js} +1 -1
- package/browser/{chunk-FG7QBACB.js → chunk-S376SJCF.js} +1 -1
- package/browser/{chunk-ZGJ4TRZD.js → chunk-S4LIME7D.js} +1 -1
- package/browser/{chunk-DPUSXBI5.js → chunk-SGBQHIZU.js} +1 -1
- package/browser/{chunk-H5ELG5JJ.js → chunk-SV4FKYKZ.js} +1 -1
- package/browser/{chunk-2SOGIEWV.js → chunk-SYJVFU7L.js} +1 -1
- package/browser/{chunk-XB33M363.js → chunk-TB76PPLM.js} +1 -1
- package/browser/{chunk-JXT76I5Q.js → chunk-TOYMRMYW.js} +1 -1
- package/browser/{chunk-ZQ2IWZAB.js → chunk-TTNKBC6N.js} +1 -1
- package/browser/{chunk-CLAKUCJG.js → chunk-UKS3DBYD.js} +1 -1
- package/browser/{chunk-GPIPW4YR.js → chunk-UN3S23DX.js} +1 -1
- package/browser/{chunk-FNKFETSF.js → chunk-UNSEWD4O.js} +2 -2
- package/browser/{chunk-2LYDVSWL.js → chunk-VK7PYTOE.js} +2 -2
- package/browser/{chunk-N7K5OSWB.js → chunk-VO66LJVM.js} +1 -1
- package/browser/{chunk-BN254E72.js → chunk-VXJJ2WHN.js} +1 -1
- package/browser/{chunk-7TV5WKNO.js → chunk-WZV65ZPB.js} +1 -1
- package/browser/{chunk-6YXOEKO2.js → chunk-X5TDTRYL.js} +1 -1
- package/browser/{chunk-IZTOY5MQ.js → chunk-XBVJ7UUC.js} +1 -1
- package/browser/{chunk-REOKW3HE.js → chunk-XME4MZYW.js} +1 -1
- package/browser/{chunk-OL3Z36UO.js → chunk-XN3D4O7F.js} +1 -1
- package/browser/{chunk-GRNVPJO3.js → chunk-YI6KEE7Q.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-AXE74WRR.js → main-GCKOWN2G.js} +2 -2
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as Wr}from"./chunk-PRP3IQBW.js";import{a as Lr,b as Rr,c as Br}from"./chunk-NL7S7KQQ.js";import{a as Qr}from"./chunk-WBNC22YT.js";import{a as Ur}from"./chunk-4H22QACY.js";import{b as Hr}from"./chunk-FFCRLFNZ.js";import{I as Sr}from"./chunk-BN254E72.js";import"./chunk-TK5H65DN.js";import"./chunk-F6GAPEFT.js";import"./chunk-6L6CIH5M.js";import"./chunk-NENKJMEE.js";import{e as vr}from"./chunk-YJ6B4M6K.js";import{a as Cr}from"./chunk-OODLC64P.js";import"./chunk-XHQEBHKJ.js";import"./chunk-XZP4NVQ2.js";import"./chunk-7FWWTBUM.js";import"./chunk-3UUGLVI6.js";import{a as An}from"./chunk-X67XFL3D.js";import{a as wr,b as Er,c as Mr,d as Or,e as Ar,f as kr}from"./chunk-7U4BQOYK.js";import{a as Pr}from"./chunk-3ECAJQZJ.js";import"./chunk-QZL2N7RS.js";import"./chunk-GJBRFK6B.js";import{a as Dr}from"./chunk-IB4OA2UP.js";import"./chunk-U6ZE6JHA.js";import"./chunk-SE7OFLAL.js";import"./chunk-NZ5FHQC2.js";import"./chunk-QIFUG6DJ.js";import"./chunk-DZEEABI4.js";import{a as jr}from"./chunk-HQVJ5VFI.js";import"./chunk-LPQK2QMJ.js";import"./chunk-B5FODXLM.js";import"./chunk-SOEYA75P.js";import{a as Tr}from"./chunk-DPNYTL25.js";import{a as Ji}from"./chunk-63P7EQO4.js";import"./chunk-YE5MVXZP.js";import{b as yr}from"./chunk-AVTNS5RR.js";import{a as Nr}from"./chunk-2WNPA6ML.js";import{a as Fr}from"./chunk-EPZFCP76.js";import{a as Vn}from"./chunk-L3IX2MLE.js";import{a as xr,b as wn,c as Ir,e as En,f as Mn,g as br}from"./chunk-WAUVVAGQ.js";import{a as Vr}from"./chunk-K7XZQCVH.js";import{b as xi}from"./chunk-EDVO723W.js";import"./chunk-TT7SCPVV.js";import{a as On}from"./chunk-WLRXTHLM.js";import{a as Ao,b as Ht}from"./chunk-37R7LYLY.js";import{g as hr}from"./chunk-QHABVTRX.js";import"./chunk-6365PJN3.js";import"./chunk-PBTXCNEF.js";import{a as Tn,b as Qt}from"./chunk-GZ37HATO.js";import{a as Bt}from"./chunk-4E6VHPVL.js";import"./chunk-FCHZ7VUL.js";import"./chunk-BYXBJQAS.js";import{a as qr}from"./chunk-KGE6Y7J2.js";import"./chunk-3PXI2XBC.js";import"./chunk-EI4HJP6K.js";import"./chunk-2IT6TVBI.js";import{a as pr}from"./chunk-CUHDJOL5.js";import{a as ut}from"./chunk-NGYLX3KZ.js";import"./chunk-BYXBJQAS.js";import"./chunk-KVJLJDFI.js";import{a as Pn}from"./chunk-VNTG35UI.js";import{d as fr}from"./chunk-Q73OU5X3.js";import"./chunk-ZGNVJTWS.js";import"./chunk-OVWOWSSR.js";import"./chunk-27P7O3J2.js";import{a as Ee}from"./chunk-XTP25C6R.js";import{a as _r,d as Rt,e as gr}from"./chunk-L6LENOKK.js";import"./chunk-I5NNQWTT.js";import"./chunk-3RK6DDJD.js";import{a as er}from"./chunk-736IGW3M.js";import"./chunk-I4MJUIXL.js";import{q as Yi}from"./chunk-ZMWGK26F.js";import{c as tr,d as nr,e as ir}from"./chunk-PK5RRGFE.js";import"./chunk-DCBD5TOU.js";import{d as Xi}from"./chunk-QOFLU7G4.js";import"./chunk-GXRCWDD7.js";import"./chunk-HT35KHLT.js";import{f as qe}from"./chunk-XB33M363.js";import"./chunk-35R6HA62.js";import"./chunk-LNXXY6IT.js";import"./chunk-RCUV6EEF.js";import{a as Ge,b as ur}from"./chunk-BIFPTMSG.js";import{a as mr,b as Ne}from"./chunk-65O6NGE3.js";import{a as kt,b as jt,c as Zi}from"./chunk-KERM64H3.js";import{a as Ce}from"./chunk-JXT76I5Q.js";import"./chunk-5SUX6ZNW.js";import{d as Dn,e as dr}from"./chunk-JVLCOYIS.js";import"./chunk-KLEBNCTU.js";import{c as rr}from"./chunk-QYL74IT3.js";import"./chunk-5Y3O4QKE.js";import"./chunk-VBPW7TJ3.js";import"./chunk-SZQE7PE4.js";import"./chunk-2QMJPLEB.js";import"./chunk-JZDKPV7H.js";import{a as cr}from"./chunk-HD7L5UBP.js";import"./chunk-ASYK5WSN.js";import{d as or,f as ar,h as lr}from"./chunk-SRTWXKQO.js";import{a as Nt,b as je}from"./chunk-5P2LSOX6.js";import{a as Lt}from"./chunk-RZNX7JQX.js";import{h as re,i as bn}from"./chunk-XV7A7YTQ.js";import"./chunk-ZYKH2C6R.js";import{a as xn,b as ie}from"./chunk-NDY4KZR7.js";import"./chunk-YQGBGJ5U.js";import"./chunk-XUP2FY5D.js";import{C as ye,D as ve,E as ue,N as We,O as Ut,u as he,v as dt,w as Z}from"./chunk-5UTBAGIS.js";import{ga as Vt,ha as Sn}from"./chunk-JLOQTYOI.js";import{O as In,P as Ae,g as Ft}from"./chunk-YJVLRBSS.js";import"./chunk-UM35BDBC.js";import"./chunk-GIKR6Y2K.js";import{a as sr,d as ne}from"./chunk-XOSCYHF7.js";import{a as vn,b as fe}from"./chunk-B4243VJD.js";import"./chunk-7I6FDVVN.js";import"./chunk-7COMDF6M.js";import{a as se}from"./chunk-2FWFPV5I.js";import"./chunk-NEEN2JO2.js";import{C as At,D as pt,E as ct,b as zi,c as we,h as G,i as Et,l as mt,o as te,s as Ki,t as Mt,u as Ot}from"./chunk-LNLGRZBB.js";import{a as Gi}from"./chunk-PCQLOEIW.js";import{a as $i}from"./chunk-L5FJOPFR.js";import{a as O,c as Si,d as R}from"./chunk-MP62IGYR.js";import"./chunk-NAAO6ZOQ.js";import{$a as l,$b as Dt,Ba as _e,Db as pe,Dc as Q,E as ce,Eb as fn,Fa as un,Fb as vi,Ga as _n,Gb as Ue,Hb as Le,I as st,Ib as o,Ic as Hi,Jb as a,K as Ui,Kb as f,Lb as U,Ma as W,Mb as L,Md as wt,Nc as Cn,Ob as y,Oc as Wi,Od as ke,Pd as de,Q as cn,Qb as g,Rb as c,Rd as rn,Td as ge,Uc as Be,Va as K,Vb as ft,Wa as St,Wc as ee,Wd as A,Xc as B,Y as dn,Za as Qe,Zb as It,_b as bt,aa as le,ad as Tt,cb as gn,cd as He,d as De,da as Ie,db as I,dc as $,ec as s,ed as q,fa as j,fc as S,gc as b,hc as Ct,hd as Te,ic as Bi,ja as H,jc as P,k as sn,ka as vt,kb as E,kc as D,kd as qi,lb as xt,lc as T,ma as Li,na as C,o as mn,ob as me,oc as Y,p as pn,pc as N,qb as _,qc as Pt,qd as hn,t as Pe,u as Fi,ud as yn,va as d,vb as p,wa as u,wb as Ri,xb as gt,xc as v,yb as Qi,yc as w,zb as Oe,zc as k}from"./chunk-EDB2BAIG.js";import{a as M,b as F,g as yi,j as ln}from"./chunk-7DCB7DB2.js";var Ii=(e=>(e[e.AdjustDifferences=1]="AdjustDifferences",e[e.CountQuantity=2]="CountQuantity",e))(Ii||{});var bi=(n=>(n[n.Draft=1]="Draft",n[n.Pending=2]="Pending",n[n.Rejected=3]="Rejected",n[n.Accepted=4]="Accepted",n))(bi||{});var Kr=()=>["/menu/Adjustment/Adjustment/Archive/Form"],qt=i=>({ID:i}),$r=()=>["/print/Adjustment"],Nn=(i,t)=>({"text-success":i,"text-danger":t}),Vo=(i,t)=>({"text-danger":i,"text-success":t});function ko(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 jo(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",Y(2,Kr))("queryParams",N(3,qt,e.data.ID))}}function No(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 Fo(i,t){if(i&1&&_(0,jo,3,5,"a",28)(1,No,3,0,"button",8),i&2){let e=c(2);pe(e.data.Adjustment.StateID==e.adjustmentState.Draft?0:-1),l(),pe(e.data.Adjustment.StateID==e.adjustmentState.Draft?1:-1)}}function Uo(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",Y(2,Kr))("queryParams",N(3,qt,e.data.ID))}}function Lo(i,t){if(i&1&&_(0,Uo,3,5,"a",28),i&2){let e=c(2);pe(e.data.Adjustment.TypeID==e.adjustmentType.AdjustDifferences&&(e.data.Adjustment.StateID==e.adjustmentState.Pending||e.data.Adjustment.StateID==e.adjustmentState.Accepted)?0:-1)}}function Ro(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 Qo(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),ft("href","https://accounting.dealpos.app/pages/journal-entry;TransID=",e.data.ID,"",St)}}function Bo(i,t){i&1&&(o(0,"div",38),f(1,"div",40),a())}function Ho(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,Bo,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(k(4,7,r.Date,"dd MMM yyyy")),l(3),S(k(7,10,r.Date,"HH:mm a")),l(3),Ri("color",n==0?"blue":"black"),l(),pe(n!=m.data.StatusProcess.length-1?10:-1),l(3),S(r.Status),l(2),S(r.Creator)}}function Wo(i,t){if(i&1&&_(0,Ho,16,13,"div",33),i&2){let e=t.$implicit;p("ngIf",e.Date)}}function qo(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 Go(i,t){i&1&&(U(0),o(1,"th",62),s(2,"Qty"),a(),L())}function zo(i,t){i&1&&(U(0),o(1,"th",62),s(2,"Counted"),a(),o(3,"th",62),s(4,"Expected"),a(),L())}function Ko(i,t){i&1&&(o(0,"th",62),s(1,"Expected"),a(),o(2,"th",62),s(3,"Counted"),a())}function $o(i,t){if(i&1&&(_(0,zo,5,0,"ng-container",52)(1,Ko,4,0,"ng-template",null,3,Q),o(3,"th",62),s(4,"Difference"),a()),i&2){let e=$(2),r=c(3);p("ngIf",r.data.Adjustment.TypeID===2&&(r.data.Adjustment.StateID===1||r.data.Adjustment.StateID===2))("ngIfElse",e)}}function Jo(i,t){i&1&&(o(0,"th",63),s(1," Cost "),a())}function Zo(i,t){i&1&&(o(0,"th",63),s(1," Price "),a())}function Xo(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 Yo(i,t){if(i&1&&(U(0),o(1,"td",69),s(2),a(),L()),i&2){let e=c().$implicit;l(),Oe(Pt(3,Nn,e.Quantity>0,e.Quantity<0)),l(),b(" ",e.Quantity," ")}}function ea(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),b(" ",e.Counted," "),l(2),b(" ",e.Expected," ")}}function ta(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(),b(" ",e.Expected," "),l(2),b(" ",e.Counted," ")}}function na(i,t){if(i&1&&(_(0,ea,5,2,"ng-container",52)(1,ta,4,2,"ng-template",null,3,Q),o(3,"td",69),s(4),v(5,"number"),a()),i&2){let e=$(2),r=c().$implicit,n=c(3);p("ngIf",n.data.Adjustment.TypeID===2&&(n.data.Adjustment.StateID===1||n.data.Adjustment.StateID===2))("ngIfElse",e),l(3),Oe(Pt(7,Vo,r.Expected>r.Counted,r.Expected<r.Counted)),l(),b(" ",w(5,5,r.Difference)," ")}}function ia(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 ra(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 oa(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,Xo,2,1,"ng-container",21),a(),_(9,Yo,3,6,"ng-container",52)(10,na,6,10,"ng-template",null,4,Q)(12,ia,2,3,"td",67)(13,ra,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",N(10,qt,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 aa(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);Oe(Pt(14,Nn,k(1,3,e.data.DifferencesArray,"Quantity")>0,k(2,6,e.data.DifferencesArray,"Quantity")<0)),l(3),S(w(5,12,k(4,9,e.data.DifferencesArray,"Quantity")))}}function la(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",Pt(13,Nn,k(1,2,e.data.DifferencesArray,"Difference")>0,k(2,5,e.data.DifferencesArray,"Difference")<0)),l(3),b(" ",w(5,11,k(4,8,e.data.DifferencesArray,"Difference"))," ")}}function sa(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,k(3,1,e.data.DifferencesArray,"TotalCost")))}}function ma(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,k(3,1,e.data.DifferencesArray,"TotalPrice")))}}function pa(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,qo,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,Go,3,0,"ng-container",52)(22,$o,5,2,"ng-template",null,1,Q)(24,Jo,2,0,"th",53)(25,Zo,2,0,"th",53),a()(),o(26,"tbody"),_(27,oa,14,12,"tr",54),a(),o(28,"tfoot")(29,"tr")(30,"td",55)(31,"b"),s(32,"Total :"),a()(),o(33,"td",56),_(34,aa,6,17,"b",57)(35,la,6,16,"ng-template",null,2,Q),a(),_(37,sa,5,6,"td",58)(38,ma,5,6,"td",59),a()()()()()()),i&2){let e=$(23),r=$(36),n=c(2);l(4),b(" ",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),b(" (",n.data.DifferencesArray.length," SKU)"),l(2),p("routerLink",Y(15,$r))("queryParams",N(16,qt,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 ca(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),b("(",e.data.CountedArray.length," SKU)")}}function da(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 ua(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",N(9,qt,e.VariantID)),l(),S(e.Name),l(2),S(e.Code),l(2),S(e.Counted),l(2),S(e.Expected),l(),Oe(Pt(11,Nn,e.Difference>0,e.Difference<0)),l(),b(" ",e.Difference," ")}}function _a(i,t){if(i&1&&(o(0,"div",12)(1,"div",41)(2,"div"),_(3,ca,4,1,"h2",21),a(),o(4,"div",43)(5,"a",44),f(6,"i",45),s(7,"Print "),a(),_(8,da,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,ua,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",Y(5,$r))("queryParams",N(6,qt,e.paramId)),l(3),p("ngIf",e.roleService.global.Export),l(17),p("ngForOf",e.data.CountedArray)}}function ga(i,t){if(i&1&&(o(0,"mainpanel-cmp",6)(1,"actions"),_(2,ko,7,0,"div",7),o(3,"div",7),_(4,Fo,2,2)(5,Lo,1,1)(6,Ro,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,Qo,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),Ue(59,Wo,1,1,"div",10,fn),a()()()(),o(61,"div",22),_(62,pa,39,18,"div",23)(63,_a,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),pe(r.hasAccRejButton?2:-1),l(2),pe(r.roleService.adjustment.Create?4:-1),l(),pe(r.roleService.adjustment.Edit?5:-1),l(),pe(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),Le(r.data.StatusProcess),l(3),p("ngIf",r.data.DifferencesArray.length>0),l(),p("ngIf",(r.data.CountedArray==null?null:r.data.CountedArray.length)>0&&r.data.Adjustment.TypeID==r.adjustmentState.Pending),l(),p("created",r.data.CreatedInfo.Created)("modified",r.data.CreatedInfo.Modified)}}var kn=class i extends Ce{constructor(e,r,n,m,h,x,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=Ii;adjustmentState=bi;preGetList(){let e=this.route.snapshot.queryParams;this.pageData.Filter=e}initQueryParam(){let e=this.route.snapshot.queryParams;this.paramId=e.ID}postInit(e){this.menuData.H=e.PageTitle,e.Adjustment.StateID==2&&this.roleService.adjustment.Approval&&e.Config.WithApproval?this.hasAccRejButton=!0:this.hasAccRejButton=!1,(this.data.Adjustment.StateID==1||this.data.Adjustment.StateID==2)&&(this.isEditable=!0)}exportCSV(e,r,n){this.httpService.get(`/api/${r}`,[{key:"ID",value:this.paramId}]).subscribe(m=>{e.convertToCSV(m,n)})}reject(){if(!confirm("Are you sure you want to reject this?"))return;let e={ID:this.data.Adjustment.ID};this.httpService.post("/API/Adjustment/RejectCountedItem",e).subscribe({next:r=>{this.toastr.success("Success reject adjustment",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(Nr,{data:{title:"Submit Review",message:`
|
|
1
|
+
import{a as Wr}from"./chunk-PRP3IQBW.js";import{a as Lr,b as Rr,c as Br}from"./chunk-NL7S7KQQ.js";import{a as Qr}from"./chunk-WBNC22YT.js";import{a as Ur}from"./chunk-4H22QACY.js";import{b as Hr}from"./chunk-FFCRLFNZ.js";import{I as Sr}from"./chunk-VXJJ2WHN.js";import"./chunk-TK5H65DN.js";import"./chunk-F6GAPEFT.js";import"./chunk-6L6CIH5M.js";import"./chunk-NENKJMEE.js";import{e as vr}from"./chunk-YJ6B4M6K.js";import{a as Cr}from"./chunk-OODLC64P.js";import"./chunk-XHQEBHKJ.js";import"./chunk-XZP4NVQ2.js";import"./chunk-7FWWTBUM.js";import"./chunk-3UUGLVI6.js";import{a as An}from"./chunk-X67XFL3D.js";import{a as wr,b as Er,c as Mr,d as Or,e as Ar,f as kr}from"./chunk-7U4BQOYK.js";import{a as Pr}from"./chunk-3ECAJQZJ.js";import"./chunk-QZL2N7RS.js";import"./chunk-GJBRFK6B.js";import{a as Dr}from"./chunk-IB4OA2UP.js";import"./chunk-U6ZE6JHA.js";import"./chunk-SE7OFLAL.js";import"./chunk-NZ5FHQC2.js";import"./chunk-QIFUG6DJ.js";import"./chunk-DZEEABI4.js";import{a as jr}from"./chunk-HQVJ5VFI.js";import"./chunk-LPQK2QMJ.js";import"./chunk-B5FODXLM.js";import"./chunk-SOEYA75P.js";import{a as Tr}from"./chunk-DPNYTL25.js";import{a as Ji}from"./chunk-63P7EQO4.js";import"./chunk-YE5MVXZP.js";import{b as yr}from"./chunk-AVTNS5RR.js";import{a as Nr}from"./chunk-2WNPA6ML.js";import{a as Fr}from"./chunk-EPZFCP76.js";import{a as Vn}from"./chunk-L3IX2MLE.js";import{a as xr,b as wn,c as Ir,e as En,f as Mn,g as br}from"./chunk-WAUVVAGQ.js";import{a as Vr}from"./chunk-K7XZQCVH.js";import{b as xi}from"./chunk-EDVO723W.js";import"./chunk-TT7SCPVV.js";import{a as On}from"./chunk-WLRXTHLM.js";import{a as Ao,b as Ht}from"./chunk-37R7LYLY.js";import{g as hr}from"./chunk-QHABVTRX.js";import"./chunk-6365PJN3.js";import"./chunk-PBTXCNEF.js";import{a as Tn,b as Qt}from"./chunk-GZ37HATO.js";import{a as Bt}from"./chunk-4E6VHPVL.js";import"./chunk-FCHZ7VUL.js";import"./chunk-BYXBJQAS.js";import{a as qr}from"./chunk-KGE6Y7J2.js";import"./chunk-3PXI2XBC.js";import"./chunk-EI4HJP6K.js";import"./chunk-2IT6TVBI.js";import{a as pr}from"./chunk-CUHDJOL5.js";import{a as ut}from"./chunk-NGYLX3KZ.js";import"./chunk-BYXBJQAS.js";import"./chunk-KVJLJDFI.js";import{a as Pn}from"./chunk-HVMYNIC7.js";import{d as fr}from"./chunk-KKTDFA34.js";import"./chunk-ZGNVJTWS.js";import"./chunk-OVWOWSSR.js";import"./chunk-27P7O3J2.js";import{a as Ee}from"./chunk-XTP25C6R.js";import{a as _r,d as Rt,e as gr}from"./chunk-L6LENOKK.js";import"./chunk-I5NNQWTT.js";import"./chunk-3RK6DDJD.js";import{a as er}from"./chunk-736IGW3M.js";import"./chunk-I4MJUIXL.js";import{q as Yi}from"./chunk-ZMWGK26F.js";import{c as tr,d as nr,e as ir}from"./chunk-PK5RRGFE.js";import"./chunk-DCBD5TOU.js";import{d as Xi}from"./chunk-QOFLU7G4.js";import"./chunk-GXRCWDD7.js";import"./chunk-HT35KHLT.js";import{f as qe}from"./chunk-TB76PPLM.js";import"./chunk-35R6HA62.js";import"./chunk-LNXXY6IT.js";import"./chunk-RCUV6EEF.js";import{a as Ge,b as ur}from"./chunk-BIFPTMSG.js";import{a as mr,b as Ne}from"./chunk-65O6NGE3.js";import{a as kt,b as jt,c as Zi}from"./chunk-KERM64H3.js";import{a as Ce}from"./chunk-TOYMRMYW.js";import"./chunk-QYHR4HH4.js";import{d as Dn,e as dr}from"./chunk-JVLCOYIS.js";import"./chunk-KLEBNCTU.js";import{c as rr}from"./chunk-QYL74IT3.js";import"./chunk-5Y3O4QKE.js";import"./chunk-VBPW7TJ3.js";import"./chunk-SZQE7PE4.js";import"./chunk-2QMJPLEB.js";import"./chunk-JZDKPV7H.js";import{a as cr}from"./chunk-HD7L5UBP.js";import"./chunk-ASYK5WSN.js";import{d as or,f as ar,h as lr}from"./chunk-SRTWXKQO.js";import{a as Nt,b as je}from"./chunk-5P2LSOX6.js";import{a as Lt}from"./chunk-RZNX7JQX.js";import{h as re,i as bn}from"./chunk-OUSV72N6.js";import"./chunk-BU6O2DK4.js";import{a as xn,b as ie}from"./chunk-4NCDQTGK.js";import"./chunk-YQGBGJ5U.js";import"./chunk-XUP2FY5D.js";import{C as ye,D as ve,E as ue,N as We,O as Ut,u as he,v as dt,w as Z}from"./chunk-5UTBAGIS.js";import{ga as Vt,ha as Sn}from"./chunk-JLOQTYOI.js";import{O as In,P as Ae,g as Ft}from"./chunk-YJVLRBSS.js";import"./chunk-UM35BDBC.js";import"./chunk-GIKR6Y2K.js";import{a as sr,d as ne}from"./chunk-XOSCYHF7.js";import{a as vn,b as fe}from"./chunk-B4243VJD.js";import"./chunk-7I6FDVVN.js";import"./chunk-7COMDF6M.js";import{a as se}from"./chunk-2FWFPV5I.js";import"./chunk-NEEN2JO2.js";import{C as At,D as pt,E as ct,b as zi,c as we,h as G,i as Et,l as mt,o as te,s as Ki,t as Mt,u as Ot}from"./chunk-LNLGRZBB.js";import{a as Gi}from"./chunk-2OQ5CGDZ.js";import{a as $i}from"./chunk-RUK3LROA.js";import{a as O,c as Si,d as R}from"./chunk-MP62IGYR.js";import"./chunk-26WIZL6M.js";import{$a as l,$b as Dt,Ba as _e,Db as pe,Dc as Q,E as ce,Eb as fn,Fa as un,Fb as vi,Ga as _n,Gb as Ue,Hb as Le,I as st,Ib as o,Ic as Hi,Jb as a,K as Ui,Kb as f,Lb as U,Ma as W,Mb as L,Md as wt,Nc as Cn,Ob as y,Oc as Wi,Od as ke,Pd as de,Q as cn,Qb as g,Rb as c,Rd as rn,Td as ge,Uc as Be,Va as K,Vb as ft,Wa as St,Wc as ee,Wd as A,Xc as B,Y as dn,Za as Qe,Zb as It,_b as bt,aa as le,ad as Tt,cb as gn,cd as He,d as De,da as Ie,db as I,dc as $,ec as s,ed as q,fa as j,fc as S,gc as b,hc as Ct,hd as Te,ic as Bi,ja as H,jc as P,k as sn,ka as vt,kb as E,kc as D,kd as qi,lb as xt,lc as T,ma as Li,na as C,o as mn,ob as me,oc as Y,p as pn,pc as N,qb as _,qc as Pt,qd as hn,t as Pe,u as Fi,ud as yn,va as d,vb as p,wa as u,wb as Ri,xb as gt,xc as v,yb as Qi,yc as w,zb as Oe,zc as k}from"./chunk-EDB2BAIG.js";import{a as M,b as F,g as yi,j as ln}from"./chunk-7DCB7DB2.js";var Ii=(e=>(e[e.AdjustDifferences=1]="AdjustDifferences",e[e.CountQuantity=2]="CountQuantity",e))(Ii||{});var bi=(n=>(n[n.Draft=1]="Draft",n[n.Pending=2]="Pending",n[n.Rejected=3]="Rejected",n[n.Accepted=4]="Accepted",n))(bi||{});var Kr=()=>["/menu/Adjustment/Adjustment/Archive/Form"],qt=i=>({ID:i}),$r=()=>["/print/Adjustment"],Nn=(i,t)=>({"text-success":i,"text-danger":t}),Vo=(i,t)=>({"text-danger":i,"text-success":t});function ko(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 jo(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",Y(2,Kr))("queryParams",N(3,qt,e.data.ID))}}function No(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 Fo(i,t){if(i&1&&_(0,jo,3,5,"a",28)(1,No,3,0,"button",8),i&2){let e=c(2);pe(e.data.Adjustment.StateID==e.adjustmentState.Draft?0:-1),l(),pe(e.data.Adjustment.StateID==e.adjustmentState.Draft?1:-1)}}function Uo(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",Y(2,Kr))("queryParams",N(3,qt,e.data.ID))}}function Lo(i,t){if(i&1&&_(0,Uo,3,5,"a",28),i&2){let e=c(2);pe(e.data.Adjustment.TypeID==e.adjustmentType.AdjustDifferences&&(e.data.Adjustment.StateID==e.adjustmentState.Pending||e.data.Adjustment.StateID==e.adjustmentState.Accepted)?0:-1)}}function Ro(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 Qo(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),ft("href","https://accounting.dealpos.app/pages/journal-entry;TransID=",e.data.ID,"",St)}}function Bo(i,t){i&1&&(o(0,"div",38),f(1,"div",40),a())}function Ho(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,Bo,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(k(4,7,r.Date,"dd MMM yyyy")),l(3),S(k(7,10,r.Date,"HH:mm a")),l(3),Ri("color",n==0?"blue":"black"),l(),pe(n!=m.data.StatusProcess.length-1?10:-1),l(3),S(r.Status),l(2),S(r.Creator)}}function Wo(i,t){if(i&1&&_(0,Ho,16,13,"div",33),i&2){let e=t.$implicit;p("ngIf",e.Date)}}function qo(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 Go(i,t){i&1&&(U(0),o(1,"th",62),s(2,"Qty"),a(),L())}function zo(i,t){i&1&&(U(0),o(1,"th",62),s(2,"Counted"),a(),o(3,"th",62),s(4,"Expected"),a(),L())}function Ko(i,t){i&1&&(o(0,"th",62),s(1,"Expected"),a(),o(2,"th",62),s(3,"Counted"),a())}function $o(i,t){if(i&1&&(_(0,zo,5,0,"ng-container",52)(1,Ko,4,0,"ng-template",null,3,Q),o(3,"th",62),s(4,"Difference"),a()),i&2){let e=$(2),r=c(3);p("ngIf",r.data.Adjustment.TypeID===2&&(r.data.Adjustment.StateID===1||r.data.Adjustment.StateID===2))("ngIfElse",e)}}function Jo(i,t){i&1&&(o(0,"th",63),s(1," Cost "),a())}function Zo(i,t){i&1&&(o(0,"th",63),s(1," Price "),a())}function Xo(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 Yo(i,t){if(i&1&&(U(0),o(1,"td",69),s(2),a(),L()),i&2){let e=c().$implicit;l(),Oe(Pt(3,Nn,e.Quantity>0,e.Quantity<0)),l(),b(" ",e.Quantity," ")}}function ea(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),b(" ",e.Counted," "),l(2),b(" ",e.Expected," ")}}function ta(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(),b(" ",e.Expected," "),l(2),b(" ",e.Counted," ")}}function na(i,t){if(i&1&&(_(0,ea,5,2,"ng-container",52)(1,ta,4,2,"ng-template",null,3,Q),o(3,"td",69),s(4),v(5,"number"),a()),i&2){let e=$(2),r=c().$implicit,n=c(3);p("ngIf",n.data.Adjustment.TypeID===2&&(n.data.Adjustment.StateID===1||n.data.Adjustment.StateID===2))("ngIfElse",e),l(3),Oe(Pt(7,Vo,r.Expected>r.Counted,r.Expected<r.Counted)),l(),b(" ",w(5,5,r.Difference)," ")}}function ia(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 ra(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 oa(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,Xo,2,1,"ng-container",21),a(),_(9,Yo,3,6,"ng-container",52)(10,na,6,10,"ng-template",null,4,Q)(12,ia,2,3,"td",67)(13,ra,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",N(10,qt,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 aa(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);Oe(Pt(14,Nn,k(1,3,e.data.DifferencesArray,"Quantity")>0,k(2,6,e.data.DifferencesArray,"Quantity")<0)),l(3),S(w(5,12,k(4,9,e.data.DifferencesArray,"Quantity")))}}function la(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",Pt(13,Nn,k(1,2,e.data.DifferencesArray,"Difference")>0,k(2,5,e.data.DifferencesArray,"Difference")<0)),l(3),b(" ",w(5,11,k(4,8,e.data.DifferencesArray,"Difference"))," ")}}function sa(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,k(3,1,e.data.DifferencesArray,"TotalCost")))}}function ma(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,k(3,1,e.data.DifferencesArray,"TotalPrice")))}}function pa(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,qo,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,Go,3,0,"ng-container",52)(22,$o,5,2,"ng-template",null,1,Q)(24,Jo,2,0,"th",53)(25,Zo,2,0,"th",53),a()(),o(26,"tbody"),_(27,oa,14,12,"tr",54),a(),o(28,"tfoot")(29,"tr")(30,"td",55)(31,"b"),s(32,"Total :"),a()(),o(33,"td",56),_(34,aa,6,17,"b",57)(35,la,6,16,"ng-template",null,2,Q),a(),_(37,sa,5,6,"td",58)(38,ma,5,6,"td",59),a()()()()()()),i&2){let e=$(23),r=$(36),n=c(2);l(4),b(" ",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),b(" (",n.data.DifferencesArray.length," SKU)"),l(2),p("routerLink",Y(15,$r))("queryParams",N(16,qt,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 ca(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),b("(",e.data.CountedArray.length," SKU)")}}function da(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 ua(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",N(9,qt,e.VariantID)),l(),S(e.Name),l(2),S(e.Code),l(2),S(e.Counted),l(2),S(e.Expected),l(),Oe(Pt(11,Nn,e.Difference>0,e.Difference<0)),l(),b(" ",e.Difference," ")}}function _a(i,t){if(i&1&&(o(0,"div",12)(1,"div",41)(2,"div"),_(3,ca,4,1,"h2",21),a(),o(4,"div",43)(5,"a",44),f(6,"i",45),s(7,"Print "),a(),_(8,da,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,ua,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",Y(5,$r))("queryParams",N(6,qt,e.paramId)),l(3),p("ngIf",e.roleService.global.Export),l(17),p("ngForOf",e.data.CountedArray)}}function ga(i,t){if(i&1&&(o(0,"mainpanel-cmp",6)(1,"actions"),_(2,ko,7,0,"div",7),o(3,"div",7),_(4,Fo,2,2)(5,Lo,1,1)(6,Ro,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,Qo,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),Ue(59,Wo,1,1,"div",10,fn),a()()()(),o(61,"div",22),_(62,pa,39,18,"div",23)(63,_a,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),pe(r.hasAccRejButton?2:-1),l(2),pe(r.roleService.adjustment.Create?4:-1),l(),pe(r.roleService.adjustment.Edit?5:-1),l(),pe(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),Le(r.data.StatusProcess),l(3),p("ngIf",r.data.DifferencesArray.length>0),l(),p("ngIf",(r.data.CountedArray==null?null:r.data.CountedArray.length)>0&&r.data.Adjustment.TypeID==r.adjustmentState.Pending),l(),p("created",r.data.CreatedInfo.Created)("modified",r.data.CreatedInfo.Modified)}}var kn=class i extends Ce{constructor(e,r,n,m,h,x,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=Ii;adjustmentState=bi;preGetList(){let e=this.route.snapshot.queryParams;this.pageData.Filter=e}initQueryParam(){let e=this.route.snapshot.queryParams;this.paramId=e.ID}postInit(e){this.menuData.H=e.PageTitle,e.Adjustment.StateID==2&&this.roleService.adjustment.Approval&&e.Config.WithApproval?this.hasAccRejButton=!0:this.hasAccRejButton=!1,(this.data.Adjustment.StateID==1||this.data.Adjustment.StateID==2)&&(this.isEditable=!0)}exportCSV(e,r,n){this.httpService.get(`/api/${r}`,[{key:"ID",value:this.paramId}]).subscribe(m=>{e.convertToCSV(m,n)})}reject(){if(!confirm("Are you sure you want to reject this?"))return;let e={ID:this.data.Adjustment.ID};this.httpService.post("/API/Adjustment/RejectCountedItem",e).subscribe({next:r=>{this.toastr.success("Success reject adjustment",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(Nr,{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(Ae.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)(I(ie),I(A),I(ge),I(wt),I(Ee),I(ke),I(R),I(Z))};static \u0275cmp=E({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,ga,65,22,"mainpanel-cmp",5),r&2&&p("ngIf",n.data)},dependencies:[Be,ee,B,de,re,Vt,Bt,Vn,q,He,Ft],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 Ca=()=>["/menu/Adjustment/Adjustment/Archive/Form"],ha=()=>["/menu/Adjustment/Adjustment/Archive/Info"],ya=i=>({ID:i}),va=i=>({"text-success":i}),Sa=i=>({"text-danger":i});function xa(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 Ia(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 ba(i,t){i&1&&(o(0,"a",25),s(1,"New"),a()),i&2&&p("routerLink",Y(1,Ca))}function Da(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 Pa(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 Ta(i,t){i&1&&(o(0,"th",18),s(1,"Cost"),a())}function wa(i,t){if(i&1){let e=y();o(0,"td")(1,"input",48),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 Ea(i,t){if(i&1&&(o(0,"td",45),s(1),v(2,"quantityFraction"),a()),i&2){let e=c().$implicit;l(),b(" ",w(2,1,e.Quantity)," ")}}function Ma(i,t){if(i&1&&(o(0,"td",45),s(1),v(2,"quantityFraction"),a()),i&2){let e=c().$implicit;Oe(N(5,va,e.Quantity>0)),l(),b(" +",w(2,3,e.Quantity)," ")}}function Oa(i,t){if(i&1&&(o(0,"td",45),s(1),v(2,"quantityFraction"),a()),i&2){let e=c().$implicit;Oe(N(5,Sa,e.Quantity<0)),l(),b(" ",w(2,3,e.Quantity)," ")}}function Aa(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 Va(i,t){if(i&1&&(o(0,"tr",42),_(1,wa,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,Ea,3,3,"td",46)(14,Ma,3,7,"td",47)(15,Oa,3,7,"td",47),o(16,"td"),s(17),a(),_(18,Aa,3,3,"td",45),o(19,"td"),s(20),a(),o(21,"td"),s(22),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",Y(21,ha))("queryParams",N(22,ya,e.ID)),l(),S(e.Number),l(2),S(k(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(),pe(!(r.roleService==null||r.roleService.product==null)&&r.roleService.product.Cost?18:-1),l(),Qi(r.stateColored(+e.StateID)),l(),b(" ",e.StateLabel," "),l(2),S(e.Note)}}function ka(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,xa,3,0,"a",5)(6,Ia,3,0,"button",6)(7,ba,2,2,"a",7),a(),o(8,"filters"),_(9,Da,33,17,"ng-template",null,0,Q),a(),o(11,"content")(12,"div",8)(13,"div",9)(14,"table",10)(15,"thead",11)(16,"tr"),_(17,Pa,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,Ta,2,0,"th",18),o(31,"th",14),s(32,"State"),a(),o(33,"th"),s(34,"Note"),a()()(),o(35,"tbody"),_(36,Va,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),pe(!(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 Ce{constructor(e,r,n,m,h,x){super(e,r,"Adjustment/GetInventoryAdjustmentList","AdjustmentLoader/GetInventoryAdjustmentList",n);this.toastr=n;this.csvConverter=m;this.roleService=h;this.matDialog=x}hideMore=!1;openExportModal(){this.matDialog.open(Ne,{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)(I(ie),I(A),I(ge),I(Ee),I(R),I(Z))};static \u0275cmp=E({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"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(r,n){r&1&&_(0,ka,38,12,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[ee,B,de,re,we,zi,G,te,Rt,ne,Ge,Dn,je,Vt,q,He,pr,cr],encapsulation:2})};var Ln=class i{config;dialogRef=C(he);data=C(dt);filterKeys=["From","To","PageNumber","RowCount","EntityID","TagID"];httpService=C(A);summaryData=W(null);constructor(){this.config=new ye,this.config.title="Total Adjustment Summary",this.config.hideFooter=!0,this.config.customWidth="382px"}ngOnInit(){console.log("DialogAdjustmentSummaryComponent",this.data.pageData),console.log("data",this.data);let t=Object.entries(this.data.pageData).filter(([r,n])=>this.filterKeys.includes(r)).map(([r,n])=>{if(r==="From"||r==="To"){let m=new Date(n);return{[r]:new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}).format(m).replace(/(\d{4})\/(\d{2})\/(\d{2})/,"$1-$2-$3")+"T00:00:00.000"}}return{[r]:n}}),e=t.reduce((r,n)=>M(M({},r),n),{});this.httpService.post("api/Adjustment/AuditAdjustmentSumReport",e).pipe(Pe(r=>r.Data),j(r=>this.summaryData.set(r))).subscribe(),console.log("tdf",t)}onOK(){}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({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),b(" ",w(10,5,r.summaryData().Quantity)," "),l(6),b(" ",w(16,7,r.summaryData().Weight)," "),l(6),b(" ",w(22,9,r.summaryData().TotalCost)," "),l(6),b(" ",w(28,11,r.summaryData().TotalPrice)," "))},dependencies:[ue,ve,Te,q],encapsulation:2,changeDetection:0})};var Na=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Fa=i=>({ID:i});function Ua(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 La(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 Ra(i,t){i&1&&(o(0,"th",22),s(1," @ Cost "),a())}function Qa(i,t){i&1&&(o(0,"th",22),s(1," @ Price "),a())}function Ba(i,t){if(i&1&&(o(0,"th",36),s(1),v(2,"number"),a()),i&2){let e=c().$implicit;l(),b(" ",w(2,1,e.UnitCost)," ")}}function Ha(i,t){if(i&1&&(o(0,"th",36),s(1),v(2,"number"),a()),i&2){let e=c().$implicit;l(),b(" ",w(2,1,e.UnitPrice)," ")}}function Wa(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,Ba,3,3,"th",35)(9,Ha,3,3,"th",35),a()),i&2){let e=t.$implicit,r=c(3);l(2),b(" ",e.VariantName," "),l(2),b(" ",e.VariantCode," "),l(2),b(" ",w(7,5,e.Quantity)," "),l(2),p("ngIf",r.roleService.product.Cost),l(),p("ngIf",r.roleService.sell.UnitPriceEditor)}}function qa(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,Wa,10,7,"tr",18),a()()()),i&2){let e=t.$implicit;l(3),p("routerLink",Y(14,Na))("queryParams",N(15,Fa,e.ID)),l(),p("innerHTML",e.EntityName+" #"+e.Number+" - "+k(5,8,e.Created,"dd MMM yyyy"),K),l(2),p("innerHTML","("+k(7,11,e.Created,"HH:mm")+")",K),l(3),b(" ",e.PIC,""),l(3),b("[Q:",e.Quantity,"]"),l(),p("innerHTML",e.Note,K),l(3),p("ngForOf",e.Items)}}function Ga(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,Ra,2,0,"th",17)(11,Qa,2,0,"th",17),a()()(),_(12,qa,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 Ce{constructor(e,r,n,m,h){super(e,r,"Adjustment/AuditAdjustmentReport","AdjustmentLoader/AuditAdjustmentReport",void 0,void 0,!0);this.httpService=r;this.csvConverter=n;this.roleService=m;this.matDialog=h}dataEndpoint="/api/Adjustment/AuditAdjustmentReport";loaderEndpoint="/api/AdjustmentLoader/AuditAdjustmentReport";countEndpoint="/api/Adjustment/AuditAdjustmentReportCount";data$;loader$;loader;onOpenExportDialog(e){}openExportModal(){this.matDialog.open(Ne,{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=F(M({},this.pageData),{Filter:F(M({},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)(I(ie),I(A),I(Ee),I(R),I(Z))};static \u0275cmp=E({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,Ua,3,0,"button",2),a(),o(3,"filters"),_(4,La,13,9,"ng-template",null,0,Q),a(),o(6,"content"),_(7,Ga,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:[ee,B,de,re,G,te,Rt,ne,Ge,Lt,q,He],encapsulation:2})};var Qn=class extends xn{constructor(e,r){super(e);this.httpService=r;this.loaderApi="/API/AdjustmentLoader/StockTakeByCSV",this.productsApi="/API/Adjustment/GetSpreadsheetPagination",this.submitApi="/API/Adjustment/SubmitUseDefault",this.requestPayload=3,this.products=this.originalProducts=[],this.getDataFromLoader()}loaderData;products;originalProducts;adjustmentID;completeInfo;error;loaderApi;productsApi;submitApi;requestPayload;getDataFromLoader(){this.menuData$.pipe(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 Ka=["stepper"],Xr=i=>({"nb-button-override":i}),$a=i=>({custom:i}),Yr=()=>["/menu/Products/Catalog/Variants/Info"],Pi=i=>({ID:i}),Ja=i=>({"bg-gradient-warning":i}),Za=i=>({Filter:i}),Xa=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function Ya(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 el(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",N(1,Xr,e.currentSubStatus!=e.subStatusEnum.PAID))}}function tl(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",N(1,Xr,e.currentSubStatus!=e.subStatusEnum.PAID))}}function nl(i,t){i&1&&(f(0,"i",56),s(1,"Filter"))}function il(i,t){i&1&&(o(0,"small",57),s(1,"Outlet option is required."),a())}function rl(i,t){i&1&&(f(0,"i",58),s(1,"Input"))}function ol(i,t){i&1&&(o(0,"th",44),s(1," Expected "),a())}function al(i,t){i&1&&(o(0,"th",44),s(1," Changes "),a())}function ll(i,t){if(i&1&&(o(0,"td"),s(1),a()),i&2){let e=c().$implicit;l(),b(" ",e.Quantity," ")}}function sl(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;gt("bg-gradient-danger",e.Counted<e.Quantity)("bg-gradient-success",e.Counted>e.Quantity),l(),b(" ",e.Quantity," "),l(2),Ct(" ",e.Counted," (",(e.Counted-e.Quantity>0?"+":"")+w(4,7,e.Counted-e.Quantity),") ")}}function ml(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 pl(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,ll,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,sl,5,9,"td",62),o(17,"td",63),_(18,ml,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),b(" ",e.CategoryName," "),l(2),b(" ",e.ProductName," "),l(2),p("routerLink",Y(14,Yr))("queryParams",N(15,Pi,e.ID)),l(),S(e.Model),l(2),S(e.Code),l(),p("ngIf",n.roleService.inventory.View),l(2),Oe(N(17,Ja,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 cl(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",N(2,Za,e.filter))}}function dl(i,t){i&1&&(f(0,"i",68),s(1,"Review"))}function ul(i,t){i&1&&(o(0,"th",44),s(1," Expected "),a())}function _l(i,t){i&1&&(o(0,"th",44),s(1," Differences "),a())}function gl(i,t){if(i&1&&(o(0,"td"),s(1),a()),i&2){let e=c(2).$implicit;l(),b(" ",e.Quantity," ")}}function fl(i,t){if(i&1&&(o(0,"span"),s(1),v(2,"number"),a()),i&2){let e=c(3).$implicit;l(),b("+",w(2,1,e.Counted-e.Quantity),"")}}function Cl(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 hl(i,t){if(i&1&&(o(0,"td"),_(1,fl,3,3,"span",46)(2,Cl,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 yl(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,gl,2,1,"td",46),o(11,"td"),s(12),a(),_(13,hl,3,2,"td",46),a()),i&2){let e=c(),r=e.$implicit,n=e.index,m=c(3);gt("soft-yellow",r.Counted<r.Quantity)("soft-green",r.Counted>r.Quantity),l(2),S(n+1+"."),l(2),b(" ",r.ProductName," "),l(2),p("routerLink",Y(13,Yr))("queryParams",N(14,Pi,r.ID)),l(),S(r.Model),l(2),S(r.Code),l(),p("ngIf",m.roleService.inventory.View),l(2),b(" ",r.Counted," "),l(),p("ngIf",m.roleService.inventory.View)}}function vl(i,t){if(i&1&&(U(0),_(1,yl,14,16,"tr",69),L()),i&2){let e=t.$implicit;l(),p("ngIf",e.Counted!=="")}}function Sl(i,t){i&1&&(f(0,"i",70),s(1,"Finish"))}function xl(i,t){if(i&1&&(o(0,"div",71),f(1,"i",72),s(2),a()),i&2){let e=c(3);l(2),b("",e.error.error.Message," ")}}function Il(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,nl,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,il,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,rl,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,ol,2,0,"th",43),o(79,"th",44),s(80,"Counted"),a(),_(81,al,2,0,"th",43),f(82,"th",38),a()(),o(83,"tbody"),_(84,pl,19,19,"tr",45),a()(),_(85,cl,2,4,"ng-container",46),a()(),o(86,"mat-step",47),_(87,dl,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,ul,2,0,"th",43),o(101,"th",44),s(102,"Counted"),a(),_(103,_l,2,0,"th",43),a()(),o(104,"tbody"),_(105,vl,2,1,"ng-container",45),a()()()()(),o(106,"mat-step",54),_(107,Sl,2,0,"ng-template",16)(108,xl,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),Oe(N(24,$a,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 bl(i,t){i&1&&(o(0,"div",89),s(1," Difference "),a())}function Dl(i,t){if(i&1&&(o(0,"div",94),s(1),a()),i&2){let e=c().$implicit;Oe(e.Quantity-e.OriginalQuantity<0?"text-danger":"text-success"),l(),b(" ",(e.Quantity-e.OriginalQuantity>0?"+":" ")+(e.Quantity-e.OriginalQuantity)," ")}}function Pl(i,t){if(i&1&&(o(0,"div",96)(1,"div",93),s(2),a(),o(3,"div",94),s(4),a(),_(5,Dl,2,3,"div",95),a()),i&2){let e=t.$implicit,r=c(3);l(2),Ct("",e.Name," (",e.Model,")"),l(2),S(e.Quantity),l(),p("ngIf",r.roleService.inventory.View)}}function Tl(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);Oe(k(1,3,e.displayedItems,"Quantity")-k(2,6,e.displayedItems,"OriginalQuantity")<0?"text-danger":"text-success"),l(3),b(" ",(k(4,9,e.displayedItems,"Quantity")-k(5,12,e.displayedItems,"OriginalQuantity")>0?"+":" ")+(k(6,15,e.displayedItems,"Quantity")-k(7,18,e.displayedItems,"OriginalQuantity"))," ")}}function wl(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,bl,2,0,"div",90),a(),_(25,Pl,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,Tl,8,21,"div",95),a()()()()()}if(i&2){let e=c(2);l(16),p("routerLink",Y(10,Xa))("queryParams",N(11,Pi,e.adjustmentID)),l(),b("Adjustment #",e.completeInfo.InvoiceNumber,""),l(7),p("ngIf",e.roleService.inventory.View),l(),p("ngForOf",e.displayedItems),l(5),S(k(31,7,e.displayedItems,"Quantity")),l(2),p("ngIf",e.roleService.inventory.View)}}function El(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,Ya,2,1,"button",5)(3,el,5,3,"div",6)(4,tl,5,3,"div",6),a(),o(5,"content"),_(6,Il,109,26,"mat-stepper",7)(7,wl,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=F(M({},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=F(M({},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)(I(ie),I(A),I(ge),I(_n),I(R))};static \u0275cmp=E({type:i,selectors:[["POS-spreadsheet-stock-take"]],viewQuery:function(r,n){if(r&1&&It(Ka,5),r&2){let m;bt(m=Dt())&&(n.stepper=m.first)}},hostBindings:function(r,n){r&1&&g("keydown.F8",function(){return n.handleF8()},!1,Qe)("keydown.ArrowRight",function(){return n.handleNextButton()},!1,Qe)("keydown.ArrowLeft",function(){return n.handlePreviousButton()},!1,Qe)},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,El,8,9,"mainpanel-cmp",3),r&2&&p("ngIf",n.loaderData)},dependencies:[Pn,Be,ee,B,de,re,we,G,te,ne,Ge,En,wn,Mn,je,Vt,kt,jt,qe,q,Ft],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 Ml=()=>["/menu/Products/Catalog/Products/Info"],Ol=i=>({ID:i});function Al(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 Vl(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 kl(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",Y(12,Ml))("queryParams",N(13,Ol,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),b(" ",w(12,10,e.Inventory-e.NewQuantity*e.Ratio)," ")}}function jl(i,t){if(i&1){let e=y();o(0,"mainpanel-cmp",2),g("onSubmit",function(){d(e);let n=c();return u(n.searchFromPageOne())}),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,Al,2,0,"button",3),a(),o(3,"filters"),_(4,Vl,5,2,"ng-template",null,0,Q),a(),o(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th"),s(13,"Product Name"),a(),o(14,"th",8),s(15,"Code"),a(),o(16,"th",8),s(17,"From"),a(),o(18,"th",8),s(19,"To"),a(),o(20,"th",9),s(21,"Ratio"),a(),o(22,"th",9),s(23,"Inventory"),a(),o(24,"th",10),s(25,"Convert Qty "),a(),o(26,"th",10),s(27,"Remaining"),a(),f(28,"th",11),a()(),o(29,"tbody"),_(30,kl,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 Ce{constructor(e,r,n,m,h){super(e,r,"Adjustment/GetAdjustToParentList","Outlet/GetByUserAccessWrite");this.toastr=n;this.router=m;this.roleService=h}Items;preGetList(){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)(I(ie),I(A),I(ge),I(ke),I(R))};static \u0275cmp=E({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,jl,31,6,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[ee,B,de,re,we,G,te,ne,je,q],encapsulation:2})};function Nl(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 Fl(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 Ul(i,t){if(i&1&&(o(0,"td",10),s(1),a()),i&2){let e=c().$implicit;l(),b(" ",e==null?null:e.Quantity," ")}}function Ll(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,Fl,2,1,"td",16)(8,Ul,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 Rl(i,t){if(i&1&&Ue(0,Ll,9,4,"tr",14,fn),i&2){let e=c();Le(e.products)}}function Ql(i,t){i&1&&(o(0,"tr")(1,"td",18),f(2,"app-empty-state"),a()())}var Wn=class i extends xn{constructor(e,r,n,m,h){super(e);this.httpService=r;this.csvConverter=n;this.roleService=m;this.matDialog=h;this.products=[],this.menuData$.subscribe()}products;onBarcodeEnter(e){let r=this.products.findIndex(n=>n.Code===e);r!=-1?this.products[r].Quantity++:this.httpService.post("/API/catalog/product/ProductCountByCode",{code:e}).subscribe(n=>{n.Quantity=1,this.products.push(n)})}openExportModal(){var e={Products:this.products,Export:!0};this.matDialog.open(Ne,{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)(I(ie),I(A),I(Ee),I(R),I(Z))};static \u0275cmp=E({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,Nl,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,Rl,2,0)(22,Ql,3,0,"tr"),a()()()()()()()()()()),r&2&&(p("pageData",n.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0)("showBarcodeScanner",!0)("autoFocusBarcodeScanInput",!0),l(2),p("ngIf",n.roleService.global.Export),l(19),pe(n.products.length>0?21:22))},dependencies:[B,re,we,G,te,je,Cr],styles:[".barcode_counter[_ngcontent-%COMP%]{position:fixed;right:10px;bottom:20px;background:#fff;border:1px solid #ddd;padding:8px 10px;border-radius:3px}.barcode_counter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border-radius:3px;border:1px solid #b7b7b7;background-repeat:no-repeat;background-position:5px -211px;padding:4px 5px 4px 35px}.barcode_counter[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{position:relative;left:35px;vertical-align:middle}.barcode_counter[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:5px;color:#868686;left:30px;position:relative;margin-left:-25px}"]})};function Bl(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 Hl(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 Wl(i,t){if(i&1&&(o(0,"span"),s(1),a()),i&2){let e=t.$implicit;l(),S(e+" ")}}function ql(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,Wl,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 Gl(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,Bl,3,0,"button",3),a(),o(3,"filters"),_(4,Hl,11,6,"ng-template",null,0,Q),a(),o(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),s(12,"Code"),a(),o(13,"th",8),s(14,"Name"),a(),o(15,"th",9),s(16,"UnitPrice"),a(),o(17,"th",10),s(18,"Qty"),a(),o(19,"th"),s(20,"Available Models"),a()()(),o(21,"tbody"),_(22,ql,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,k(28,7,e.data.Data,"Qty")))}}var qn=class i extends Ce{constructor(e,r,n,m,h){super(e,r,"catalog/product/GetOutletProductSheet","catalog/ProductLoader/GetOutletProductSheet");this.csvConverter=n;this.roleService=m;this.matDialog=h}openExportModal(){this.matDialog.open(Ne,{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)(I(ie),I(A),I(Ee),I(R),I(Z))};static \u0275cmp=E({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,Gl,31,12,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[ee,B,re,G,te,ne,qe,q,Ft],encapsulation:2})};var eo=yi(_r());var z=class i{INITIAL_STATE={loadForm:{},outlet:{ID:O.GuidEmpty,Name:""},isOpenDialog:!0,isComplete:!1,adjustmentState:0,quickeyItems:{},cartItems:[],order:{Date:(0,eo.default)().utcOffset("+07:00").format(),EntityID:"",ID:O.GuidEmpty,StateID:4,TypeID:1,Number:"",PIC:"",Note:"",TagID:0},orderComplete:{},NewOrderID:""};#e=jr(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=>F(M({},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=H({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,xe,Me,$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=xe,this.EntityID=Me,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=H({token:i,factory:i.\u0275fac,providedIn:"root"})},wi=class{constructor(t,e,r,n,m,h,x,oe,X,ae,xe,Me,$e,Je,Ze,Xe,Ye,et,tt,nt,it,rt,Kt,$t,Jt,Zt,Xt,Yt,en,tn,nn){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=xe,this.UOMName=Me,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=Kt,this.CategoryTypeID=$t,this.PriceNote=Jt,this.PaymentTypeID=Zt,this.ThumbnailUrl=Xt,this.Storage=Yt,this.Component=en,this.PriceBook=tn,this.VariantUnitQuantity=nn}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=H({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=H({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=H({token:i,factory:i.\u0275fac,providedIn:"root"})},to=class i{adapt(t){return{Number:t.Number,Quantity:t.Quantity,ExpiryDate:t.ExpiryDate}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Fe=class i{destroy$=new De;#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=>F(M({},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:F(M({},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(Ae.SubmitAdjustment,e).pipe(Ie(this.destroy$))}if(this.#e.AdjustmentState()===1){let e=F(M({},this.#e.LoadForm().Data),{Order:F(M({},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(Ae.SubmitAdjustment,e).pipe(Ie(this.destroy$))}}onUpdateOrderState(t,e){if(Object.keys(this.#e.Order()).includes(t)){let n=F(M({},this.#e.Order()),{[t]:e});this.#e.onChangeAdjustmentOrder(n)}else console.error(`Error updating order state with key ${t}`)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Gt=class i{destroy$=new De;#e=C(A);#t=C(z);#n=C(_e);orderService=C(Fe);getLoadForm$=this.#e.post("/API/Adjustment/LoadForm",{EntityID:O.GuidEmpty,ID:O.GuidEmpty}).pipe(vn(),j(t=>{this.#t.onChangeLoadform(t)}));constructor(){}httpRequestLoadForm$(t){return fe(this.#t.IsComplete,{injector:this.#n}).pipe(Ie(this.destroy$),ce(e=>!e),le(e=>this.#e.post("/API/Adjustment/LoadForm",M({EntityID:"00000000-0000-0000-0000-000000000000",ID:"00000000-0000-0000-0000-000000000000"},t))),j(e=>{this.#t.onChangeLoadform(e),this.orderService.onUpdateOrderState("TypeID",e.AppConfigJSON.ModuleAdjustment.Advance.AdjustmentInputType)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Jn=class i{destroy$=new De;#e=C(z);#t=C(A);#n=C(Fe);#i=C(_e);constructor(){this.initialize()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initialize(){Fi([fe(this.#e.Outlet,{injector:this.#i}),fe(this.#e.AdjustmentState,{injector:this.#i}),fe(this.#e.IsComplete,{injector:this.#i})]).pipe(vn(),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 sn}}handleStateZero(t){return this.#t.get(`/api/AdjustmentLoader/LoadRegister?EntityID=${t.ID}&IsEdit=false`).pipe(Ie(this.destroy$),j(e=>{this.#e.onChangeQuickeyItems(e.QuickKey),this.#n.onUpdateOrderState("Number",e.Number),this.#e.onChangeNewOrderID(e.NewOrderID)}))}handleStateOne(t){return this.getQuickey(t.ID).pipe(Ie(this.destroy$),j(e=>{this.#e.onChangeQuickeyItems(e)}))}getQuickey(t){return this.#t.get(Ae.GetQuickKeyByEntityID,[{key:"ID",value:t}])}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ei=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,xe,Me,$e,Je,Ze,Xe,Ye,et,tt,nt,it,rt,Kt,$t,Jt,Zt,Xt,Yt,en,tn,nn,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=xe,this._UnitQuantity=Me,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=Kt,this._Storage=$t,this._Serial=Jt,this._ThumbnailUrl=Zt,this._UnitPrice=Xt,this._TypeID=Yt,this._VariantUnitQuantity=en,this._UOM=tn,this._UOMName=nn,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}}},Mi=class{get OnHand(){return this._OnHand}set OnHand(t){this._OnHand=t}get CategoryName(){return this._CategoryName}set CategoryName(t){this._CategoryName=t}get CategoryTypeID(){return this._CategoryTypeID}set CategoryTypeID(t){this._CategoryTypeID=t}get PriceTypeID(){return this._PriceTypeID}set PriceTypeID(t){this._PriceTypeID=t}get PriceNote(){return this._PriceNote}set PriceNote(t){this._PriceNote=t}get UnitPriceOriginal(){return this._UnitPriceOriginal}set UnitPriceOriginal(t){this._UnitPriceOriginal=t}get Ordered(){return this._Ordered}set Ordered(t){this._Ordered=t}get BrandName(){return this._BrandName}set BrandName(t){this._BrandName=t}get ImageUrl(){return this._ImageUrl}set ImageUrl(t){this._ImageUrl=t}get ThumbnailUrl(){return this._ThumbnailUrl}set ThumbnailUrl(t){this._ThumbnailUrl=t}get Component(){return this._Component}set Component(t){this._Component=t}get PriceBook(){return this._PriceBook}set PriceBook(t){this._PriceBook=t}get UOMName(){return this._UOMName}set UOMName(t){this._UOMName=t}get Storage(){return this._Storage}set Storage(t){this._Storage=t}get CategoryID(){return this._CategoryID}set CategoryID(t){this._CategoryID=t}get DiscountAmount(){return this._DiscountAmount}set DiscountAmount(t){this._DiscountAmount=t}get VariantUnitQuantity(){return this._VariantUnitQuantity}set VariantUnitQuantity(t){this._VariantUnitQuantity=t}get ProductCreated(){return this._ProductCreated}set ProductCreated(t){this._ProductCreated=t}get ProductID(){return this._ProductID}set ProductID(t){this._ProductID=t}get ProductIndex(){return this._ProductIndex}set ProductIndex(t){this._ProductIndex=t}get Code(){return this._Code}set Code(t){this._Code=t}get TypeID(){return this._TypeID}set TypeID(t){this._TypeID=t}get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(t){this._UnitQuantity=t}get SalesCommission(){return this._SalesCommission}set SalesCommission(t){this._SalesCommission=t}get Description(){return this._Description}set Description(t){this._Description=t}get Image(){return this._Image}set Image(t){this._Image=t}get Discontinued(){return this._Discontinued}set Discontinued(t){this._Discontinued=t}get Taxable(){return this._Taxable}set Taxable(t){this._Taxable=t}get LoyaltyPoint(){return this._LoyaltyPoint}set LoyaltyPoint(t){this._LoyaltyPoint=t}get PackSize(){return this._PackSize}set PackSize(t){this._PackSize=t}get CreatorId(){return this._CreatorId}set CreatorId(t){this._CreatorId=t}get Created(){return this._Created}set Created(t){this._Created=t}get UnitExpense(){return this._UnitExpense}set UnitExpense(t){this._UnitExpense=t}get SellPriceType(){return this._SellPriceType}set SellPriceType(t){this._SellPriceType=t}get VariantType(){return this._VariantType}set VariantType(t){this._VariantType=t}get CostCurrencyID(){return this._CostCurrencyID}set CostCurrencyID(t){this._CostCurrencyID=t}get UnitCost(){return this._UnitCost}set UnitCost(t){this._UnitCost=t}get OrderPrice(){return this._OrderPrice}set OrderPrice(t){this._OrderPrice=t}get OrderPriceDiscount(){return this._OrderPriceDiscount}set OrderPriceDiscount(t){this._OrderPriceDiscount=t}get OrderPriceDiscountDetail(){return this._OrderPriceDiscountDetail}set OrderPriceDiscountDetail(t){this._OrderPriceDiscountDetail=t}get PriceCurrencyID(){return this._PriceCurrencyID}set PriceCurrencyID(t){this._PriceCurrencyID=t}get UnitPrice(){return this._UnitPrice}set UnitPrice(t){this._UnitPrice=t}get PriceDiscount(){return this._PriceDiscount}set PriceDiscount(t){this._PriceDiscount=t}get PaymentTypeID(){return this._PaymentTypeID}set PaymentTypeID(t){this._PaymentTypeID=t}get PaymentTypeString(){return this._PaymentTypeString}set PaymentTypeString(t){this._PaymentTypeString=t}get SellPriceTypeString(){return this._SellPriceTypeString}set SellPriceTypeString(t){this._SellPriceTypeString=t}get Weight(){return this._Weight}set Weight(t){this._Weight=t}get CostCurrencySymbol(){return this._CostCurrencySymbol}set CostCurrencySymbol(t){this._CostCurrencySymbol=t}get PriceCurrencySymbol(){return this._PriceCurrencySymbol}set PriceCurrencySymbol(t){this._PriceCurrencySymbol=t}get UOM(){return this._UOM}set UOM(t){this._UOM=t}get MeasurementID(){return this._MeasurementID}set MeasurementID(t){this._MeasurementID=t}get UOMQ(){return this._UOMQ}set UOMQ(t){this._UOMQ=t}get Name(){return this._Name}set Name(t){this._Name=t}get Model(){return this._Model}set Model(t){this._Model=t}get ID(){return this._ID}set ID(t){this._ID=t}_OnHand;_CategoryName;_CategoryTypeID;_PriceTypeID;_PriceNote;_UnitPriceOriginal;_Ordered;_BrandName;_ImageUrl;_ThumbnailUrl;_Component;_PriceBook;_UOMName;_Storage;_CategoryID;_DiscountAmount;_VariantUnitQuantity;_ProductCreated;_ProductID;_ProductIndex;_Code;_TypeID;_UnitQuantity;_SalesCommission;_Description;_Image;_Discontinued;_Taxable;_LoyaltyPoint;_PackSize;_CreatorId;_Created;_UnitExpense;_SellPriceType;_VariantType;_CostCurrencyID;_UnitCost;_OrderPrice;_OrderPriceDiscount;_OrderPriceDiscountDetail;_PriceCurrencyID;_UnitPrice;_PriceDiscount;_PaymentTypeID;_PaymentTypeString;_SellPriceTypeString;_Weight;_CostCurrencySymbol;_PriceCurrencySymbol;_UOM;_MeasurementID;_UOMQ;_Name;_Model;_ID;constructor(t,e,r,n,m,h,x,oe,X,ae,xe,Me,$e,Je,Ze,Xe,Ye,et,tt,nt,it,rt,Kt,$t,Jt,Zt,Xt,Yt,en,tn,nn,hi,so,mo,po,co,uo,_o,go,fo,Co,ho,yo,vo,So,xo,Io,bo,Do,Po,To,wo,Eo,Mo,Oo){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=xe,this._PriceBook=Me,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=Kt,this._SalesCommission=$t,this._Description=Jt,this._Image=Zt,this._Discontinued=Xt,this._Taxable=Yt,this._LoyaltyPoint=en,this._PackSize=tn,this._CreatorId=nn,this._Created=hi,this._UnitExpense=so,this._SellPriceType=mo,this._VariantType=po,this._CostCurrencyID=co,this._UnitCost=uo,this._OrderPrice=_o,this._OrderPriceDiscount=go,this._OrderPriceDiscountDetail=fo,this._PriceCurrencyID=Co,this._UnitPrice=ho,this._PriceDiscount=yo,this._PaymentTypeID=vo,this._PaymentTypeString=So,this._SellPriceTypeString=xo,this._Weight=Io,this._CostCurrencySymbol=bo,this._PriceCurrencySymbol=Do,this._UOM=Po,this._MeasurementID=To,this._UOMQ=wo,this._Name=Eo,this._Model=Mo,this._ID=Oo}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 Ei(t.Variant??null,t.QtyRequested??null,t.TotalPrice??null,t.SalesName??null,t.PriceNote??null,t.SalesID??null,t.InventoryTypeID??null,t.ID??null,t.Code??null,t.VariantID??null,t.Quantity??null,t.UnitQuantity??null,t.Expense??null,t.Cost??null,t.Price??null,t.Discount??null,t.Note??null,t.Taxable??null,t.LoyaltyPoint??null,t.UnitPriceOriginal??null,t.DiscountAmount??null,t.Name??null,t.PriceTypeID??null,t.Storage??null,t.Serial??null,t.ThumbnailUrl??null,t.UnitPrice??null,t.TypeID??null,t.VariantUnitQuantity??null,t.UOM??null,t.UOMName??null,t.SalesCommission??null).toJSON()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})},zt=class i{adapt(t){return new Mi(t.OnHand??null,t.CategoryName??null,t.CategoryTypeID??null,t.PriceTypeID??null,t.PriceNote??null,t.UnitPriceOriginal??null,t.Ordered??null,t.BrandName??null,t.ImageUrl??null,t.ThumbnailUrl??null,t.Component??null,t.PriceBook??null,t.UOMName??null,t.Storage??null,t.CategoryID??null,t.DiscountAmount??null,t.VariantUnitQuantity??null,t.ProductCreated??null,t.ProductID??null,t.ProductIndex??null,t.Code??null,t.TypeID??null,t.UnitQuantity??null,t.SalesCommission??null,t.Description??null,t.Image??null,t.Discontinued??null,t.Taxable??null,t.LoyaltyPoint??null,t.PackSize??null,t.CreatorId??null,t.Created??null,t.UnitExpense??null,t.SellPriceType??null,t.VariantType??null,t.CostCurrencyID??null,t.UnitCost??null,t.OrderPrice??null,t.OrderPriceDiscount??null,t.OrderPriceDiscountDetail??null,t.PriceCurrencyID??null,t.UnitPrice??null,t.PriceDiscount??null,t.PaymentTypeID??null,t.PaymentTypeString??null,t.SellPriceTypeString??null,t.Weight??null,t.CostCurrencySymbol??null,t.PriceCurrencySymbol??null,t.UOM??null,t.MeasurementID??null,t.UOMQ??null,t.Name??null,t.Model??null,t.ID??null).toJSON()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Zn=class i{modalConfig;storeService=C(z);#e=C(At);#t=C(he);form;constructor(){this.modalConfig=new ye,this.modalConfig.customWidth="400px",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 mt(this.storeService.Order().TagID||null)})}onOK(){let t=this.form.value;this.#t.close(t)}onCancel(){this.#t.close()}ngOnInit(){this.generateForm()}handleKeyDown(t){console.log("event",t),t.code==="F2"&&this.onOK()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["POS-modal-cart-note"]],hostBindings:function(e,r){e&1&&g("keydown",function(m){return r.handleKeyDown(m)},!1,Qe)},decls:15,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],[1,"w-100","h-100","d-flex","flex-column","gap-4",3,"formGroup"],[1,"w-100"],[1,"mb-3"],["placeholder","Choose Adjustment Tag","formControlName","TagID","bindLabel","Name","bindValue","ID","appendTo","body",3,"items"],["type","text","formControlName","PIC",1,"form-control","w-100","height-input"],["formControlName","Note","rows","4",1,"form-control","w-100","ps-2"]],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,"div",2)(4,"strong",3),s(5,"Tag"),a(),f(6,"ng-select",4),a(),o(7,"div",2)(8,"strong",3),s(9,"PIC"),a(),f(10,"input",5),a(),o(11,"div",2)(12,"strong",3),s(13,"Note"),a(),f(14,"textarea",6),a()()()()),e&2&&(p("config",r.modalConfig),l(2),p("formGroup",r.form),l(4),p("items",r.storeService.LoadForm().AdjustmentTags))},dependencies:[ue,ve,pt,we,G,Et,ct,Mt,Ot,ne],encapsulation:2})};var Xn=class i{modalConfig;#e=C(he);constructor(){this.modalConfig=new ye,this.modalConfig.customWidth="400px",this.modalConfig.title="Void Transaction?"}onOK(){this.#e.close({type:"OK",data:null})}onCancel(){this.#e.close({type:"Cancel",data:null})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["POS-modal-cart-void"]],decls:5,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"fw-normal"]],template:function(e,r){e&1&&(o(0,"modal-material",0),g("onOk",function(){return r.onOK()})("onCancel",function(){return r.onCancel()})("onClose",function(){return r.onCancel()}),o(1,"content")(2,"div",1)(3,"h4",2),s(4,"This will erase all current data. Are you sure?"),a()()()()),e&2&&p("config",r.modalConfig)},dependencies:[ue,ve],encapsulation:2})};var Se=class i{variantSearchCTRL=new mt({});#e=C(z);#t=C(A);#n=C(_e);#i=C(Ke);#r=C(Z);#o=C(zt);destroy$=new De;toastr=C(ge);httpGetVariantByID(t,e=!0){let r={entityID:this.#e.Outlet().ID,id:t};return this.#t.post("/API/catalog/variant/GetVariantByID",r).pipe(Pe(n=>this.generateCartItem(n)),j(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(`${Ae.GetVariantByCode}?Code=${t}&EntityID=${this.#e.Outlet().ID}`).pipe(Pe(x=>this.generateCartItem(x)),j(x=>{this.onAddCartItem(x)}));{console.log(h,"decodedRegex");let x=h[1],oe=parseFloat(h[2]);return oe=oe/r||1,this.#t.get(`${Ae.GetVariantByCode}?Code=${x}&EntityID=${this.#e.Outlet().ID}`).pipe(Pe(X=>this.generateCartItem(X)),j(X=>{this.onAddCartItem(X,!1,oe)}),st(X=>(this.toastr.info("Matching Regex Rule to Barcode","Digital Scale"),this.#t.get(`${Ae.GetVariantByCode}?Code=${t}&EntityID=${this.#e.Outlet().ID}`).pipe(Pe(ae=>this.generateCartItem(ae)),j(ae=>{this.onAddCartItem(ae)})))))}}else return this.#t.get(`${Ae.GetVariantByCode}?Code=${t}&EntityID=${this.#e.Outlet().ID}`).pipe(Pe(m=>this.generateCartItem(m)),j(m=>{this.onAddCartItem(m)}))}httpRequestGetInventoryByVariantID(t){return fe(this.#e.Outlet,{injector:this.#n}).pipe(Ie(this.destroy$),ce(e=>O.IsNotEmpty(e.ID)),cn(),le(e=>this.#t.get(Ae.GetVariantStockByID,[{key:"EntityID",value:e.ID},{key:"ID",value:t}])))}addItemByVariantID(t){this.httpGetVariantByID(t).pipe(Ie(this.destroy$)).subscribe()}onAddCartItem(t,e=!1,r=1){let n=this.#e.CartItems(),m=n.findIndex(x=>x.VariantID===t.VariantID),h=[];m!==-1?e?h=[...n,t]:(n[m].Quantity+=r,h=[...n]):h=[...n,F(M({},t),{Quantity:r})],this.#e.onChangeCartItems(h)}generateCartItem(t){return this.#i.adapt(F(M({},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=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Kl=["unitCost"],$l=i=>({selected:i}),Jl=()=>["/menu/Products/Catalog/Variants/Info"],Zl=(i,t)=>t.key;function Xl(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",N(2,$l,r.activeTab().key===e.key)),l(),b(" ",e.label," ")}}function Yl(i,t){if(i&1&&_(0,Xl,2,4,"a",6),i&2){let e=t.$implicit;pe(e.isVisible?0:-1)}}function es(i,t){i&1&&(o(0,"div",11)(1,"h5"),s(2,"Cost"),a(),f(3,"input",17),a())}function ts(i,t){if(i&1){let e=y();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,es,4,0,"div",13),a(),U(12),o(13,"div",8)(14,"div",14)(15,"h5",15),s(16,"Note"),a(),o(17,"POS-tinymce-editor",16),g("valueChange",function(n){d(e);let m=c();return u(m.onNoteChange(n))}),a()()(),L(),a()}if(i&2){let e,r=c();l(11),p("ngIf",r.roleService.product.Cost),l(6),p("value",(e=r.form.get("Note"))==null?null:e.value)}}function ns(i,t){if(i&1&&f(0,"img",31),i&2){let e=c(3);p("ngSrc",e.cartItem.ThumbnailUrl)}}function is(i,t){i&1&&_(0,ns,1,1,"ng-template")}function rs(i,t){i&1&&(U(0),f(1,"i",32),o(2,"h6"),s(3,"No Image"),a(),L())}function os(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),b(" ",e.cartItem.Variant.Storage," ")}}function as(i,t){if(i&1&&(U(0),o(1,"div",18)(2,"div",19)(3,"a",20),_(4,is,1,0)(5,rs,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,os,10,1,"div",30),a()(),f(31,"div",18),a(),L()),i&2){let e=c();l(3),p("routerLink",Y(6,Jl)),l(),pe(e.cartItem.ThumbnailUrl?4:5),l(21),b(" ",e.inventory().ON_HAND," "),l(2),b(" ",e.inventory().ALLOCATED," "),l(2),b(" ",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 ls(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 ye;cartItem;form;tabs=W([]);activeTab=Cn(()=>this.tabs().filter(t=>t.isActive)[0]);isItemSerial=W(!1);inventory=W({ON_HAND:0,ALLOCATED:0,AVAILABLE:0,ROP:0,MAX:0});serials=[];_costElement;cdr=C(Hi);#e=C(At);#t=C(he);#n=C(Ke);#i=C(Se);#r=C(_e);#o=C(ge);itemQuantity=W(1);itemPrice=W("");itemCost=W("");itemNote=W("");isEditCostEnabled=W(!1);ngAfterViewInit(){}handleIsEditCostEnabled(){this.isEditCostEnabled.update(t=>!t),this.cdr.detectChanges()}onTabChange(t){let e=this.tabs().map(r=>r.key===t?F(M({},r),{isActive:!0}):F(M({},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(){fe(this.storeService.CartItems,{injector:this.#r}).pipe(j(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(F(M({},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(j(t=>{let e=this.storeService.CartItems().reduce((r,n,m)=>(this.data.index===m?r.push(M({},this.#n.adapt(F(M({},n),{Quantity:+t.Quantity,Price:+t.Price,Cost:+t.Cost,Note:t.Note})))):r.push(n),r),[]);this.storeService.onChangeCartItems(e)}),ut("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(M({},this.#n.adapt(F(M({},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(M({},this.#n.adapt(F(M({},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(M({},this.#n.adapt(F(M({},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 fe(this.activeTab,{injector:this.#r}).pipe(ce(t=>t.key===1),cn(),le(t=>this.#i.httpRequestGetInventoryByVariantID(this.cartItem.VariantID)))}onCancel(){this.#t.close()}static \u0275fac=function(e){return new(e||i)(I(dt))};static \u0275cmp=E({type:i,selectors:[["adjustment-modal-edit-product"]],viewQuery:function(e,r){if(e&1&&It(Kl,5),e&2){let n;bt(n=Dt())&&(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"],["height","220px",3,"valueChange","value"],["formControlName","Cost","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"row"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink"],[1,"col"],[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"),Ue(5,Yl,1,1,null,null,Zl),a()()(),o(7,"div",4),_(8,ts,18,2,"div")(9,as,32,7,"ng-container")(10,ls,1,4,"POS-tab-serial",5),a()()()),e&2){let n;p("config",r.modalConfig),l(5),Le(r.tabs()),l(2),p("formGroup",r.form),l(),pe((n=r.activeTab().key)===0?8:n===1?9:n===2?10:-1)}},dependencies:[ue,ve,Te,Be,B,ct,we,G,Et,Mt,Ot,Qt,Tn,rn,de,qi,An,Nt,je,Sn],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}autocompleteV2[_ngcontent-%COMP%] mat-form-field input{padding:10px 15px!important}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}.inventory-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .inventory-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:6px!important}p-chips[_ngcontent-%COMP%] ul.p-inputtext{width:570px;max-width:570px;border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] ul.p-inputtext li.p-chips-input-token>input[type=text]{border:none}p-chips[_ngcontent-%COMP%] .p-chips .p-chips-multiple-container:not(.p-disabled):hover{border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container{display:inline-block}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container .p-chips-token{margin:2px;background:#96bf48}"]})};function ss(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 ms(i,t){if(i&1&&(o(0,"td",29),s(1),a()),i&2){let e=c().index;l(),b(" ",e+1,". ")}}function ps(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,St)("alt",e.Variant.Name)}}function cs(i,t){i&1&&(o(0,"div",32),f(1,"i",33),a())}function ds(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 us(i,t){i&1&&(o(0,"span",34),s(1," x "),a())}function _s(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 gs(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 fs(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),b(" ",k(3,1,e.Price,"1.0-4")," ")}}function Cs(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,ss,5,0,"ng-template",null,1,Q)(4,ms,2,1,"td",8),o(5,"td",9)(6,"div",10),_(7,ps,3,2,"ng-container",3)(8,cs,2,0,"ng-template",null,2,Q),o(10,"div",11)(11,"div"),s(12),a(),o(13,"span",12),s(14),a(),o(15,"div"),f(16,"app-serial-note",13),a(),f(17,"small",14),a()()(),o(18,"td",15)(19,"div",16)(20,"div",17)(21,"span"),_(22,ds,3,3,"span",18)(23,us,2,0,"span",19)(24,_s,3,3,"span",18),a(),_(25,gs,3,1,"ng-container",18),a()()(),o(26,"td"),_(27,fs,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),b(" ",n.Discount?w(31,16,n.Discount*-1)+"%":""," "),l(5),b(" ",x.roleService.product!=null&&x.roleService.product.Price?w(36,18,+n.Quantity*+n.Variant.UnitPrice):" - "," ")}}function hs(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,Cs,41,20,"ng-container",6),a()(),L()}if(i&2){let e=c();l(3),p("ngForOf",e.CartItems())}}function ys(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(Se);matDialog=C(Z);renderer=C(gn);#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(M({},this.#e.adapt(F(M({},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(M({},this.#e.adapt(F(M({},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=E({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,hs,4,1,"ng-container",3)(1,ys,15,0,"ng-template",null,0,Q),e&2){let n=$(2);p("ngIf",r.CartItems().length>0)("ngIfElse",n)}},dependencies:[B,ar,ee,or,Bt,q,Ar,Mr,Er,Or],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(Se);orderService=C(Fe);loadFormService=C(Gt);roleService=C(R);#e=C(ke);onProcess=new un;onOpenModalNote=new un;onOpenModalVoid=new un;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$),j(()=>{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=E({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),Ct("(",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 vs(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(Se);query=new mt({});#e=C(A);storeService=C(z);skipXHR=!1;spinnerService=C(qr);constructor(){}onBarcodeScan(t){console.log("Scanned barcode:",t),this.cartService.httpRequestVariantByCode(t).pipe().subscribe()}ngOnInit(){this.query.valueChanges.pipe(ut("query"),ce(t=>t&&Object.keys(t).length>0),j(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 sn;return e.pipe(st(r=>r.status>=400&&r.status<=451?(console.error("Variant not found:",r.message),mn(null)):pn(()=>r)))}),j(()=>{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=E({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,vs,10,5,"ng-template",null,0,Q),a()()()}if(e&2){let n=$(6);l(4),p("clearOnSelect",!0)("useCustomTemplate",!0)("itemTemplate",n)("outletId",r.storeService.Outlet().ID)}},dependencies:[Te,q,Sr,pt,ct,Ut,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,xe){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=xe}_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=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ss=(i,t)=>t.key;function xs(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(),b(" ",e.label," ")}}var oi=class i{constructor(t,e){this.dialogRef=t;this.data=e;this.config=new ye,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0}config;adjustmentState=W([]);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)(I(he),I(dt))};static \u0275cmp=E({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),Ue(3,xs,3,2,"div",2,Ss),a()()()),e&2&&(p("config",r.config),l(3),Le(r.adjustmentState()))},dependencies:[Te,Be,ue,ve],encapsulation:2})};var ai=class i{destroy$=new De;#e=C(Fe);#t=C(z);#n=C(ri);injector=C(_e);toastr=C(ge);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(Ie(this.destroy$)).subscribe({next:t=>{this.#t.onChangeIsComplete(),this.#t.onChangeOrderComplete(this.#n.adapt(t))},error:t=>{console.log("error",t)}}):(console.log(this.#t.Order().StateID),fe(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"),j(e=>{let r=e.data;this.#e.onUpdateOrderState("StateID",Number(r))}),le(()=>this.#e.processOrder())):this.#e.processOrder()),j(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=E({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,Ur],encapsulation:2})};function Is(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(ke);#t=C(ie);#n=C(yn);cartItems;fullContainerEl=document.getElementById("full-container");constructor(){this.#t.setMenu$(),this.menu$=this.#t.menu$.pipe(Pe(t=>F(M({},t),{H:"Inventory Adjustment",T:t.T.replace("undefined","Inventory Adjustment")})),j(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 ln(this,null,function*(){window.open(`/print/Adjustment?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onGotoAdjustmentDetail(){return ln(this,null,function*(){window.open(`/menu/Adjustment/Adjustment/Archive/Info?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onNewAdjustment(){return ln(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=E({type:i,selectors:[["adjustment-order-complete"]],hostBindings:function(e,r){e&1&&g("keydown.F8",function(){return r.handleF8()},!1,Qe)},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,Is,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,St),l(),b("Adjustment #",r.storeService.OrderComplete().InvoiceNumber,""),l(2),p("ngForOf",r.cartItems),l(5),b(" ",w(35,9,r.storeService.QtyCartItems())," "))},dependencies:[Tt,q,bn,re,ee,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 bs=["qty"];function Ds(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 an=class i{modalConfig=new ye;cartService=C(Se);cartItem=W(null);query=new mt(null);form;#e=C(he);unsubscribe$=new De;#t=C(At);quantityRef;focusTimeoutID;ngZone=C(_n);constructor(){this.modalConfig.customWidth="650px",this.modalConfig.title="Add Item"}onOK(){this.#e.close({type:"OK"});let t=this.cartItem();t.Quantity=this.form.get("Quantity").value,t.Price=this.form.get("Price").value,t.Cost=this.form.get("Cost").value,t.Note=this.form.get("Note").value,this.cartService.onAddCartItem(t,!0,t.Quantity)}onChangeNote(t){this.form.get("Note").setValue(t)}onClose(){this.#e.close({type:"close"})}onCancel(){this.#e.close({type:"cancel"})}initForm(){this.form=this.#t.group({Quantity:[""],Price:[""],Cost:[""],Note:[""]})}ngOnInit(){this.initForm(),this.query.valueChanges.pipe(Ie(this.unsubscribe$),le(t=>this.cartService.httpGetVariantByID(t,!1).pipe()),ut("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=E({type:i,selectors:[["adjustment-modal-cart-add"]],viewQuery:function(e,r){if(e&1&&It(bs,5),e&2){let n;bt(n=Dt())&&(r.quantityRef=n.first)}},decls:29,vars:7,consts:[["itemTemplate",""],["qty",""],[3,"onCancel","onClose","onOk","config"],[1,"container","w-100","h-100"],[1,"row"],[1,"col-12"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"keyup.enter","formControl","renderThumbnail","useCustomTemplate","itemTemplate"],[3,"formGroup"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["autoNum","","formControlName","Price","type","text",1,"mt-5","form-control",2,"width","100px"],["autoNum","","formControlName","Cost","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"mb-5"],["height","220px",3,"valueChange","value"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"]],template:function(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,Ds,6,2,"ng-template",null,0,Q),a()(),o(8,"div",7)(9,"div",8)(10,"div",9)(11,"h5"),s(12,"Qty"),a(),f(13,"input",10,1),a(),o(15,"div",11)(16,"h5"),s(17,"Price"),a(),f(18,"input",12),a(),o(19,"div",11)(20,"h5"),s(21,"Cost"),a(),f(22,"input",13),a()(),U(23),o(24,"div",8)(25,"div",5)(26,"h5",14),s(27,"Note"),a(),o(28,"POS-tinymce-editor",15),g("valueChange",function(h){return d(n),u(r.onChangeNote(h))}),a()()(),L(),a()()()()}if(e&2){let n,m=$(7);p("config",r.modalConfig),l(5),p("formControl",r.query)("renderThumbnail",!0)("useCustomTemplate",!0)("itemTemplate",m),l(3),p("formGroup",r.form),l(20),p("value",(n=r.form.get("Note"))==null?null:n.value)}},dependencies:[Nt,je,Ut,We,ue,ve,fr,ct,we,G,Et,Ki,Mt,Ot,Qt,Tn],encapsulation:2})};var no=yi(Ao());function Ps(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 Ts(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 ws(i,t){if(i&1&&_(0,Ps,2,1,"ng-container",2)(1,Ts,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=W(null);unsubscribe$=new De;#e=C(he);#t=C(A);#n=C(z);#i=C(Se);#r=C(_e);cartItem=W([]);skipEmptyLines=!0;rowCount=W(0);rowEmpty=W(0);totalRows=Cn(()=>this.rowCount()-this.rowEmpty());file=W(null);uploadState=W(0);uploadStateEnum=On;constructor(){this.modalConfig=new ye,this.modalConfig.title="Import Items",this.modalConfig.customWidth="500px",this.sampleURL="https://cdn.dealpos.xyz/web-import-template/ImportItem_Adjustment_TemplateV2.csv"}onOK(){this.uploadState.set(1);let t={EntityID:this.#n.Outlet().ID,CartItems:this.cartItem()};return this.#t.post("/API/Adjustment/UploadCsvV2",t).pipe(ut("response"),st(e=>(e instanceof hn&&this.uploadState.set(3),[])),j(e=>{Array.isArray(e)&&e.length>0&&(this.uploadState.set(2),e.forEach(r=>this.#i.onAddCartItem(r,!0,r.Quantity)),this.#e.close())}),dn(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),no.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=E({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,ws,2,2,"ng-template",null,0,Q),a()}e&2&&p("config",r.modalConfig)},dependencies:[Te,B,ue,ve,Ht],encapsulation:2})};function Es(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 Ms(i,t){if(i&1&&Ue(0,Es,2,2,"li",10,vi),i&2){let e=c().$implicit;Le(e.children)}}function Os(i,t){if(i&1&&(o(0,"div",7)(1,"div",8),s(2),a(),f(3,"div",9),_(4,Ms,2,0),a()),i&2){let e=t.$implicit;l(2),S(e.title),l(2),pe(e.children.length>0?4:-1)}}var mi=class i{menu=W([]);#e=C(Z);router=C(ke);handleF8(){this.#e.openDialogs&&this.#e.openDialogs.length>0||this.#e.open(an)}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(an);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=E({type:i,selectors:[["adjustment-more-actions"]],hostBindings:function(e,r){e&1&&g("keydown.F4",function(m){return r.handleF8(m)},!1,Qe)},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),Ue(8,Os,5,2,"div",7,vi),a()()()),e&2&&(l(8),Le(r.menu()))},dependencies:[kr],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=H({token:i,factory:i.\u0275fac,providedIn:"root"})},Vi=class{constructor(t,e,r,n,m,h,x,oe,X,ae,xe,Me,$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=xe,this._TypeLabel=Me,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}},io=class i{adapt(t){return new Vi(t.EntityID,t.Number,t.Date,t.PIC,t.Note,t.EntityName,t.StateID,t.StateLabel,t.ReviewDate,t.ReviewerID,t.TypeID,t.TypeLabel,t.Quantity,t.UnitPrice,t.UnitCost,t.TotalPrice,t.AdjustedQuantity,t.CreatorID,t.Created,t.ModifierID,t.Modified,t.ID)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})},ki=class{constructor(t,e,r,n,m,h,x,oe,X,ae,xe,Me){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=xe,this._ID=Me}_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}},ro=class i{adapt(t){return new ki(t.LostNFoundID,t.UnitCost,t.InventoryTypeID,t.UnitPrice,t.Discount,t.VariantID,t.Note,t.Quantity,t.UnitQuantity,t.Index,t.Serial,t.ID)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})},ji=class{constructor(t,e,r,n,m,h,x,oe,X,ae,xe,Me){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=xe,this._ID=Me}_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}},oo=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=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var ao=yi(_r());function As(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 Vs(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=W(!0);loadFormService=C(Gt);intercom=C($i);storeService=C(z);quickeyService=C(Jn);cartService=C(Se);orderService=C(Fe);isOpenDiaglog$;Outlets$;loadForm$;adjustmentEditDataAdapter=C(pi);roleService=C(R);#e=C(Ke);#t=C(zt);#n=C(wt);transactionType$=this.#n.queryParamMap.pipe(Pe(t=>(t.has("ID"),"Adjustment")));title=C(yn);injector=C(_e);renderer=C(gn);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(j(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(F(M({},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({}),fe(this.storeService.IsOpenDialog,{injector:this.injector}).pipe().subscribe(),this.isOpenDiaglog$=fe(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,ao.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=E({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,As,2,1,"ng-container",1)(1,Vs,22,20,"ng-template",null,0,Q),e&2){let n=$(2);p("ngIf",r.storeService.IsComplete())("ngIfElse",n)}},dependencies:[B,Tt,yr,Tr,wr,Pr,pt,G,te,ne,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 ks=()=>["/menu/Adjustment/Adjustment/Archive/Info"],js=i=>({ID:i});function Ns(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 Fs(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 Us(i,t){i&1&&(o(0,"th"),s(1,"Variant"),a())}function Ls(i,t){if(i&1&&(o(0,"td"),s(1),a()),i&2){let e=c().$implicit;l(),S(e.Name)}}function Rs(i,t){if(i&1&&(o(0,"tr",18),_(1,Ls,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",Y(14,ks))("queryParams",N(15,js,e.ID)),l(),S(e.Number),l(2),S(w(10,9,e.Quantity)),l(3),S(k(13,11,e.Date,"dd/MM/yy"))}}function Qs(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,Ns,3,0,"button",3),a(),o(3,"filters"),_(4,Fs,14,8,"ng-template",null,0,Q),a(),o(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr"),_(12,Us,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,Rs,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 Ce{constructor(e,r,n,m,h){super(e,r,"catalog/product/GetAdjustmentHistory","catalog/productLoader/GetAdjustmentHistoryLoader",null,n);this.matDialog=m;this.roleService=h;this.isRedirect$=mn(this.route.snapshot.queryParamMap).pipe(Pe(x=>x.has("ID")),dn(1))}isRedirect$;openExportModal(){this.matDialog.open(Ne,{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)(I(ie),I(A),I(wt),I(Z),I(R))};static \u0275cmp=E({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,Qs,25,11,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[ee,B,de,re,G,te,Rt,ne,We,Ge,Tt,q,He],encapsulation:2})};function Bs(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 Hs(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 Ws(i,t){if(i&1&&(o(0,"span"),s(1),v(2,"number"),a()),i&2){let e=c();l(),b("",w(2,1,e.totalRows)," rows")}}var ui=class i{constructor(t,e,r){this.dialogRef=t;this.http=r;this.configModal=new ye,this.configModal.title="Download Template",this.configModal.customWidth="400px",this.configModal.hideScrollbar=!0,this.configModal.okText="Download",this.loader=e.loader,this.outletId=e.outletID}toggleTotalRows=!1;totalRows=0;exportFormat="CSV";configModal;onHandInventory=!0;stockCount="0";categoryId=null;supplierID=null;outletId="";loader;stockCountOptions=[{Key:"0",Value:"Full Count"},{Key:"1",Value:"Partial Count"}];exportFormatOptions=[{Key:"CSV",Value:"CSV"},{Key:"XLSX",Value:"XLSX"}];close(){this.dialogRef.close()}confirm(){this.dialogRef.close({IncludeZeroOnHand:this.onHandInventory,CategoryID:this.stockCount==="1"?this.categoryId:null,From:this.loader?.Filter.From,To:this.loader?.Filter.To,FormatType:this.exportFormat=="CSV"?0:this.exportFormat=="XLSX"?1:2,SupplierID:this.stockCount==="1"?this.supplierID:null,BrandID:this.stockCount==="1"?this.loader?.Filter.BrandID:null})}getTotalRows(){this.http.post("/api/InventoryExport/GetStockTakeSpreadsheetV2Count",{OutletID:this.outletId,IncludeZeroOnHand:this.onHandInventory,CategoryID:this.stockCount==="1"?this.categoryId:null,SupplierID:this.stockCount==="1"?this.supplierID:null,From:this.loader?.Filter.From,To:this.loader?.Filter.To,BrandID:this.stockCount==="1"?this.loader?.Filter.BrandID:null}).subscribe(t=>{this.totalRows=t.Count,this.toggleTotalRows=!0})}static \u0275fac=function(e){return new(e||i)(I(he),I(dt),I(A))};static \u0275cmp=E({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,Bs,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,Hs,2,0,"span",10)(20,Ws,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:[B,G,te,ne,We,ve,Dn,qe,q],encapsulation:2})};var qs=i=>({"text-danger":i}),Gs=()=>["/menu/Products/Catalog/Variants/Info"],zs=i=>({ID:i});function Ks(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 $s(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 Js(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 Zs(i,t){if(i&1&&s(0),i&2){let e=t.index;S(e+1)}}function Xs(i,t){i&1&&(f(0,"i",43),s(1,"Upload"))}function Ys(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(),b(" ",k(2,2,e.Name,25)," ")}}function em(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 tm(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 nm(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 im(i,t){i&1&&(f(0,"i",49),s(1,"Preview"))}function rm(i,t){i&1&&(o(0,"th",50),s(1," Difference "),a())}function om(i,t){i&1&&(o(0,"th",51),s(1," Cost "),a())}function am(i,t){i&1&&(o(0,"th"),s(1," Message "),a())}function lm(i,t){if(i&1&&(o(0,"a",58),s(1),a()),i&2){let e=c().$implicit;p("routerLink",Y(3,Gs))("queryParams",N(4,zs,e.VariantID)),l(),S(e.VariantName)}}function sm(i,t){if(i&1&&(o(0,"span",59),s(1),a()),i&2){let e=c().$implicit;l(),S(e.VariantName)}}function mm(i,t){if(i&1&&(o(0,"td"),s(1),a()),i&2){let e=c().$implicit;gt("text-danger",e.Differences<0)("text-success",e.Differences>0),l(),b(" ",e.Differences," ")}}function pm(i,t){if(i&1&&(o(0,"td"),s(1),v(2,"number"),a()),i&2){let e=c().$implicit;gt("text-danger",e.CostChange<0)("text-success",e.CostChange>0),l(),b(" ",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(),Ct(" ",e.Issue," ",e.Solution," ")}}function dm(i,t){if(i&1&&(o(0,"td"),_(1,cm,2,2,"div",34),a()),i&2){let e=c().$implicit;gt("bg-gradient-danger",e.Issues==null?null:e.Issues.length),l(),p("ngForOf",e.Issues)}}function um(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,lm,2,6,"a",54)(7,sm,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,mm,2,5,"td",56)(15,pm,3,7,"td",56)(16,dm,2,3,"td",57),a()),i&2){let e=t.$implicit,r=t.index,n=c();l(2),S(r+1+"."),l(),p("ngClass",N(11,qs,!e.VariantCode)),l(),b(" ",e.ProductName," "),l(2),p("ngIf",e.VariantID),l(),p("ngIf",!e.VariantID),l(2),b(" ",e.VariantCode," "),l(2),b(" ",e.Expected," "),l(2),b(" ",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 _m(i,t){i&1&&(f(0,"i",60),s(1,"Finish"))}var _i=class i extends Ce{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(mr);cacheKey="";canProceedPreview=!1;importedData=[];summary=["Category","Product","Variant"];summaryData={};uploaded=!1;importHttpResponse=[];isPreviewState=!1;isSuccessState=!1;msgSuccessImport;isDisabledImportBtn=!1;originalData=[];formData;opNames;outletName;uploadState=W(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(st(n=>(n instanceof hn&&(this.uploadState.set(3),this.state="upload",console.error("Error during import preview:",n)),pn(()=>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)(I(ie),I(A),I(ge),I(Ee),I(ke),I(Fr),I(R),I(Z))};static \u0275cmp=E({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,Ks,2,0,"button",2),L(),_(4,$s,5,1,"ng-container",3)(5,Js,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,Zs,1,1,"ng-template",5),o(10,"mat-step",6),_(11,Xs,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,Ys,3,5,"ng-template",16),a()(),_(24,em,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,tm,1,2,"POS-uppy",20)(33,nm,1,2,"POS-uppy",20),a()()(),o(34,"mat-step",21),_(35,im,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,rm,2,0,"th",32)(58,om,2,0,"th",33)(59,am,2,0,"th",3),a()(),o(60,"tbody"),_(61,um,17,13,"tr",34),a()()()(),o(62,"mat-step",35),_(63,_m,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(),ft("label","Unmatched (",n.summaryData.Updated,")"),l(),ft("label","Matched (",n.summaryData.NoChanges,")"),l(),ft("label","All (",n.summaryData.Total,")"),l(),ft("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:[Be,ee,B,de,re,G,te,ne,En,wn,Mn,Ir,kt,jt,Ht,tr,nr,sr,q,Ji],styles:[".sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{top:48px!important}"]})};var gm=i=>({ID:i});function fm(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 Cm(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 hm(i,t){i&1&&(o(0,"th",20),s(1," On Hand "),a())}function ym(i,t){if(i&1&&(o(0,"td",22),s(1),a()),i&2){let e=c().$implicit;l(),S(e.OnHand)}}function vm(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,ym,2,1,"td",23),a()),i&2){let e=t.$implicit,r=c(2);l(2),p("queryParams",N(9,gm,e.ID)),l(),S(e.Name),l(2),S(e.Code),l(2),S(k(8,6,e.LastCountDate,"dd MMM yyyy")),l(3),S(e.DaysSinceLastCount),l(),p("ngIf",r.role.inventory.View)}}function Sm(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,hm,2,0,"th",17),a()(),o(13,"tbody"),_(14,vm,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 Ce{constructor(e,r,n,m,h){super(e,r,"Adjustment/AdjustmentLastCountDate","AdjustmentLoader/AdjustmentLastCountDate",void 0,void 0,!0);this.httpService=r;this.csvConverter=n;this.roleService=m;this.matDialog=h}role=C(R);originalData=[];postInit(e){this.originalData=e.Data,this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(Ne,{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)(I(ie),I(A),I(Ee),I(R),I(Z))};static \u0275cmp=E({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,fm,3,0,"button",2),a(),o(3,"filters"),_(4,Cm,10,7,"ng-template",null,0,Q),a(),o(6,"content"),_(7,Sm,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:[ee,B,de,re,G,te,We,Ge,kt,jt,qe,Lt,He],encapsulation:2})};var xm=[{path:"Adjustment/Archive",component:Fn},{path:"Adjustment/Archive/Info",component:kn},{path:"Adjustment/Archive/Form",component:ci,canActivate:[Wr],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=xt({type:i});static \u0275inj=vt({imports:[rn.forChild(xm),rn]})};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(j(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=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ci=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=xt({type:i});static \u0275inj=vt({imports:[Te]})};var lo=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=xt({type:i});static \u0275inj=vt({imports:[Pn,Te,fi,bn,pt,In,gr,ne,Lr,Rr,Ut,ue,vr,lr,ur,ue,br,xr,xi,dr,Nt,Sn,er,hr,Yi,Hr,xi,Zi,Qr,Br,Dr,Qt,Vr,Ci,Bt,qe,Lt,An,Vn,Ht,ir,Xi,rr]})};export{lo as AdjustmentModule};
|