dealpos 25.49.4 → 25.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-WYRHUSXS.js → chunk-2ENLMKGR.js} +1 -1
- package/browser/{chunk-QS32TZGB.js → chunk-2FJNMKCN.js} +1 -1
- package/browser/{chunk-OYEU5L3I.js → chunk-2ITJBRJU.js} +1 -1
- package/browser/{chunk-34X4ZZD5.js → chunk-2KI73XNT.js} +1 -1
- package/browser/{chunk-T4E5A3KH.js → chunk-2SZZVWQD.js} +11 -11
- package/browser/{chunk-JZFX4FNK.js → chunk-3AZAILT2.js} +1 -1
- package/browser/{chunk-INWLOCX3.js → chunk-3CUT73ZP.js} +1 -1
- package/browser/{chunk-D2OMTDKS.js → chunk-3ZWJMFYL.js} +1 -1
- package/browser/{chunk-SY463GX6.js → chunk-4KYROBKJ.js} +1 -1
- package/browser/{chunk-IFKUMLMD.js → chunk-4MQZXTMM.js} +1 -1
- package/browser/{chunk-KWFL5YOV.js → chunk-4YZVDERU.js} +1 -1
- package/browser/{chunk-F3YWM4BJ.js → chunk-5SIEW7SH.js} +1 -1
- package/browser/{chunk-FTZZHFXM.js → chunk-7L5VMLEF.js} +1 -1
- package/browser/{chunk-P2R2O6GD.js → chunk-7MJWZXSK.js} +2 -2
- package/browser/{chunk-ROVDZJVT.js → chunk-A5CTHLE4.js} +1 -1
- package/browser/{chunk-C777CYT4.js → chunk-A6Z5ZHVO.js} +1 -1
- package/browser/{chunk-SFXDXOSB.js → chunk-B7BVEOOI.js} +1 -1
- package/browser/{chunk-LNZY3GKF.js → chunk-BFNGPKGX.js} +1 -1
- package/browser/{chunk-52ONOTHS.js → chunk-BLEJLNEO.js} +1 -1
- package/browser/{chunk-QOCGWG6L.js → chunk-BQ7QT5RB.js} +1 -1
- package/browser/chunk-BZ3GMUQ7.js +14 -0
- package/browser/{chunk-Y4XWHUVX.js → chunk-CB6QEEJX.js} +1 -1
- package/browser/{chunk-ASHEF37H.js → chunk-CCJ6SHBL.js} +1 -1
- package/browser/{chunk-7V6NCJRQ.js → chunk-COL56R4A.js} +1 -1
- package/browser/chunk-CXWICNFP.js +1 -0
- package/browser/{chunk-TLLI6Z5X.js → chunk-CZHWPDAM.js} +1 -1
- package/browser/{chunk-XOQUXJ6S.js → chunk-DYBRYTEM.js} +1 -1
- package/browser/{chunk-SO3RL6QR.js → chunk-EAEOJMTA.js} +1 -1
- package/browser/{chunk-LI6G74I7.js → chunk-F765TCAS.js} +1 -1
- package/browser/{chunk-RGO36X34.js → chunk-FMKY4THI.js} +1 -1
- package/browser/{chunk-KJ5BS7KR.js → chunk-FSOHJLXB.js} +1 -1
- package/browser/{chunk-APHRANVH.js → chunk-FV4MYFQI.js} +1 -1
- package/browser/{chunk-7V2CY4DW.js → chunk-G3DZI5XK.js} +1 -1
- package/browser/{chunk-YTXYAEFO.js → chunk-G5JGQBAG.js} +1 -1
- package/browser/{chunk-BVMFVFGN.js → chunk-GBSRXCWH.js} +1 -1
- package/browser/{chunk-BSV3Y4MG.js → chunk-GDQGP7DV.js} +1 -1
- package/browser/{chunk-TAVEJBKL.js → chunk-GESNWWTD.js} +2 -2
- package/browser/{chunk-3Y2TKGP4.js → chunk-GRLVYPPM.js} +1 -1
- package/browser/{chunk-WZWXE6GT.js → chunk-HFDJ5XSI.js} +1 -1
- package/browser/{chunk-NTCQH6TH.js → chunk-HFOJZ3B5.js} +1 -1
- package/browser/{chunk-ADQOH7YA.js → chunk-HFZ437GH.js} +1 -1
- package/browser/{chunk-OXMLRZZ4.js → chunk-IPPIH4F4.js} +1 -1
- package/browser/{chunk-RULBTV6L.js → chunk-ISN5K6K2.js} +1 -1
- package/browser/{chunk-V45WTUQ2.js → chunk-ISQHQTAS.js} +1 -1
- package/browser/chunk-JCLYKROE.js +1 -0
- package/browser/chunk-KUF3JPB2.js +1 -0
- package/browser/{chunk-743523SK.js → chunk-KZBVWICA.js} +1 -1
- package/browser/{chunk-CLO7U3RB.js → chunk-LIX7XJ55.js} +1 -1
- package/browser/{chunk-ZEI66KM2.js → chunk-LIXEWT4U.js} +3 -3
- package/browser/{chunk-XTU3LHA6.js → chunk-M2HEFQUY.js} +1 -1
- package/browser/{chunk-HOZ6XJ4Z.js → chunk-MFJH22SW.js} +1 -1
- package/browser/{chunk-NFODKKJI.js → chunk-MZSJCSUV.js} +2 -2
- package/browser/{chunk-6H5XBM35.js → chunk-O3ENARQZ.js} +1 -1
- package/browser/{chunk-QE5OFO56.js → chunk-OZ3MKU4C.js} +1 -1
- package/browser/chunk-PHYDJ3P5.js +1 -0
- package/browser/{chunk-HCMW3RC5.js → chunk-PIAQ4TBN.js} +1 -1
- package/browser/{chunk-N7M4OSQZ.js → chunk-PLR55YR2.js} +1 -1
- package/browser/{chunk-CD6ZWSFG.js → chunk-PMDFKXZY.js} +1 -1
- package/browser/{chunk-XFJYJSZU.js → chunk-PV4YHZX5.js} +1 -1
- package/browser/chunk-PVBS6SYW.js +3 -0
- package/browser/{chunk-WFSJDUCV.js → chunk-PXIMA665.js} +2 -2
- package/browser/{chunk-OETRAGYY.js → chunk-Q3DS2RLM.js} +1 -1
- package/browser/chunk-QWB3USYP.js +3 -0
- package/browser/{chunk-K3V25WUQ.js → chunk-QZRMHLML.js} +1 -1
- package/browser/{chunk-XWXXETJY.js → chunk-RE6SQEP6.js} +1 -1
- package/browser/{chunk-GT5IX3D6.js → chunk-S4D5UGSM.js} +1 -1
- package/browser/{chunk-IQ5KAZ7I.js → chunk-S65MPEJS.js} +1 -1
- package/browser/{chunk-46D5QBZT.js → chunk-SBTTKQ4L.js} +1 -1
- package/browser/{chunk-UJ63ZNAO.js → chunk-SK6Y77W4.js} +4 -4
- package/browser/{chunk-XBRNDXDZ.js → chunk-SOW7VMSU.js} +1 -1
- package/browser/{chunk-R2Y4JAXW.js → chunk-T3ZHKT2K.js} +1 -1
- package/browser/{chunk-WP2FVSCM.js → chunk-T7PBUS2H.js} +1 -1
- package/browser/{chunk-FD7ICK7T.js → chunk-TTCSYFRX.js} +1 -1
- package/browser/{chunk-3YFVIHNY.js → chunk-UZN4OKOJ.js} +2 -2
- package/browser/{chunk-TBBZ7RAN.js → chunk-WXYXGYFH.js} +1 -1
- package/browser/{chunk-H4U5GDQZ.js → chunk-X2GHGFH2.js} +2 -2
- package/browser/{chunk-LX26RD3F.js → chunk-XFAV2VZL.js} +1 -1
- package/browser/{chunk-YZY45SFB.js → chunk-XSZJISVJ.js} +1 -1
- package/browser/{chunk-5DNDULL7.js → chunk-Y5DX5U5Q.js} +1 -1
- package/browser/{chunk-GNIF2YD2.js → chunk-Y7KCHRMM.js} +1 -1
- package/browser/{chunk-3RQ35Y7Q.js → chunk-YBUERVXV.js} +1 -1
- package/browser/{chunk-V3KYBOFM.js → chunk-YLEKN2EU.js} +1 -1
- package/browser/{chunk-QVI22QDX.js → chunk-YUILNWDI.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-DAVMX2B6.js → main-4PHVOJ3C.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-3PJCCDIY.js +0 -14
- package/browser/chunk-6LSNTX2C.js +0 -1
- package/browser/chunk-FQVYXDHS.js +0 -3
- package/browser/chunk-KJF3M7DY.js +0 -1
- package/browser/chunk-N6JQHXKN.js +0 -3
- package/browser/chunk-NZBKYR7R.js +0 -1
- package/browser/chunk-OWK34F6X.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as mr}from"./chunk-JTZHHVPI.js";import{a as dr}from"./chunk-SOW7VMSU.js";import{b as sr}from"./chunk-COGKLKKE.js";import{a as er}from"./chunk-KUG5VVV4.js";import{a as ir}from"./chunk-IISHJIET.js";import{a as nr}from"./chunk-HSIXOQO7.js";import{a as Rn}from"./chunk-RESN2GAB.js";import{a as rr,b as lr}from"./chunk-FQZELIHB.js";import{a as ar}from"./chunk-4HEJOI53.js";import{a as or}from"./chunk-TCUCRGQD.js";import{a as Qn}from"./chunk-ZTU3TIGR.js";import{a as Ko,b as $o,c as Jo,d as Zo,e as Xo,f as Yo}from"./chunk-PPVORSJQ.js";import{a as Go}from"./chunk-H74MLHRV.js";import{a as tr}from"./chunk-ARYZHNFV.js";import{a as zo}from"./chunk-T4MU3R7Y.js";import"./chunk-USD2ALDX.js";import{a as kn}from"./chunk-Y5DX5U5Q.js";import{a as ze}from"./chunk-DOCQN2VL.js";import{a as Bo,b as Nn,c as Ho,e as Fn,f as Un,g as Wo}from"./chunk-BYTV42NJ.js";import{L as Ro}from"./chunk-SK6Y77W4.js";import"./chunk-YXCPHYC5.js";import"./chunk-JFLT7NX3.js";import"./chunk-RACYAEOL.js";import"./chunk-GGDW5WFA.js";import{e as Lo}from"./chunk-QJUU75N6.js";import"./chunk-D7DUI5NF.js";import"./chunk-TXJJUZ26.js";import"./chunk-BNNKSBQ6.js";import"./chunk-6C2HPRJZ.js";import"./chunk-IZLEZJ6U.js";import"./chunk-4XJWQAS6.js";import{b as Ai}from"./chunk-DC3TCY6D.js";import{a as qo}from"./chunk-7DAPNQYU.js";import"./chunk-NM3IQUNN.js";import"./chunk-NQX7EX5A.js";import"./chunk-A2EVMYAR.js";import{a as Ln}from"./chunk-P3KIIKY4.js";import"./chunk-CQLZHUT4.js";import"./chunk-S27D5MBU.js";import"./chunk-HGSF7LOB.js";import{b as ta,c as Je}from"./chunk-2VE2WNSA.js";import"./chunk-7BVPHIEF.js";import"./chunk-PF33HK6M.js";import"./chunk-5UDUWK67.js";import{a as po}from"./chunk-T7XU5W5A.js";import"./chunk-25H27N7N.js";import{b as Uo}from"./chunk-MNJSQKLX.js";import"./chunk-OXWQ7ZZS.js";import{a as Ke,b as Ie}from"./chunk-FW4OCSXV.js";import{a as $e}from"./chunk-4CPRMZL6.js";import{a as Qo}from"./chunk-ESDXMFGP.js";import"./chunk-J6U6UYNI.js";import"./chunk-NSNUUKNK.js";import"./chunk-EN2Y56CS.js";import"./chunk-Z3E24JZW.js";import"./chunk-BYXBJQAS.js";import"./chunk-PXDS3HXW.js";import"./chunk-NQKVYQ6V.js";import"./chunk-WKM2QOAU.js";import{a as Vn}from"./chunk-ZMJLTU5O.js";import{g as Fo}from"./chunk-PRVQ3NAP.js";import"./chunk-BYXBJQAS.js";import{c as fo,d as ho,e as yo}from"./chunk-O2VVATBW.js";import{a as cr}from"./chunk-HWPSC7RE.js";import{c as No}from"./chunk-Y7KCHRMM.js";import"./chunk-DTVCBHPA.js";import"./chunk-5USF4MRW.js";import{a as To}from"./chunk-363IDTE3.js";import{a as Do}from"./chunk-QZZ2NRA3.js";import{a as ko,d as Ge,e as Vo}from"./chunk-WMZLH4YK.js";import"./chunk-72RZBOHX.js";import"./chunk-3RK6DDJD.js";import{a as go}from"./chunk-M3DKYPGC.js";import{q as Co}from"./chunk-6WATOQG3.js";import"./chunk-VM4K4MNV.js";import{d as _o}from"./chunk-XTCEZONP.js";import"./chunk-LNDHYAFW.js";import{d as jn,e as Oo}from"./chunk-5ZD6KTDH.js";import"./chunk-ZZBF7AOW.js";import{a as Qe,b as Re,c as uo}from"./chunk-AQW4VS3Y.js";import{a as te,b as jo}from"./chunk-4W3WYXI2.js";import{f as Yt}from"./chunk-GBSRXCWH.js";import{c as qe}from"./chunk-B7BVEOOI.js";import{a as En,b as Rt}from"./chunk-VXPORXGI.js";import{a as bt}from"./chunk-T3ZHKT2K.js";import"./chunk-HFOJZ3B5.js";import"./chunk-L6PKNRWO.js";import{c as Ao}from"./chunk-SIQZO2WM.js";import{a as kt}from"./chunk-J6M7UWVR.js";import{b as Mo,c as Eo,e as lt,f as An}from"./chunk-BFNGPKGX.js";import"./chunk-G3DZI5XK.js";import"./chunk-7YUPYNWQ.js";import"./chunk-2CL5FM3P.js";import"./chunk-LGINK7BD.js";import{c as xo}from"./chunk-IKKPP4JS.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-KZFNI67M.js";import"./chunk-4BXCIT62.js";import{a as Be,c as Qt}from"./chunk-D4FCXEV4.js";import{c as vo,e as So,g as bo}from"./chunk-6P2ASCNY.js";import{c as Po,d as wo}from"./chunk-OZ3MKU4C.js";import{a as Mn,b as at}from"./chunk-JCLYKROE.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import{F as Xt,G as We,u as Ct,v as gt,w as ut}from"./chunk-26YFRPR2.js";import{b as be,c as Le}from"./chunk-JBS5UYZC.js";import{N as On,O as wt,g as He}from"./chunk-TEGIL5RZ.js";import"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import{a as Io,d as pt}from"./chunk-THT6CY5E.js";import{a as Ue,b as Pt,e as _t,f as Zt,g as it}from"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-S7FOJJP2.js";import"./chunk-FU2ZGMX4.js";import{a as Y}from"./chunk-2FWFPV5I.js";import"./chunk-SLX34TWD.js";import{E as Fe,F as Jt,G as Se,b as lo,c as St,h as B,i as ke,l as ve,o as X,r as so,s as mo,t as Ve,w as Ne}from"./chunk-DWZ5JTI2.js";import{a as ao}from"./chunk-KZBVWICA.js";import{a as co}from"./chunk-SBTTKQ4L.js";import"./chunk-36GWLMZX.js";import{a as Oi,b as H}from"./chunk-WFQIMZGL.js";import{a as A}from"./chunk-WUV22SZ4.js";import{a as ro}from"./chunk-EAEOJMTA.js";import{p as vt,s as L}from"./chunk-LGOSIAUC.js";import{Ab as g,Bb as qt,Ca as K,Cb as et,Db as N,E as dt,Eb as F,Fb as c,Fc as y,Fd as Pn,Gb as a,Gc as T,Hb as r,Hc as V,I as ge,Ib as f,Ja as Xi,Jb as fe,Jd as wn,K as $i,Kb as cn,Lb as Mi,Lc as $,M as Ji,Mb as At,Nb as jt,Nd as xe,Ob as Ei,Oc as he,Pb as v,Pc as eo,Pd as Lt,Q as Me,Qa as q,Qd as ct,Sa as vn,Sb as _,Sd as un,Tb as In,Ub as m,Va as Wt,Xa as l,Y as xn,Ya as Sn,Yb as Gt,Za as bn,Zb as zt,Zc as no,_b as Kt,aa as ot,cc as J,d as ht,da as Tt,db as Yi,dc as pn,eb as D,ec as Nt,fa as Q,fc as to,gc as ft,gd as Ut,hc as s,ib as O,ic as S,id as Tn,jb as Oe,jc as I,jd as ye,k as fn,kc as Ft,la as W,lc as Dn,ma as Ee,mb as mt,mc as M,nc as P,nd as io,o as hn,oa as Zi,ob as E,oc as w,od as je,p as yn,pa as h,qd as $t,sd as G,t as Ot,ta as p,tc as Pe,u as Ki,ua as u,vd as xt,xa as yt,xc as Z,yb as C,yc as k,yd as oo,zc as Ae}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import{a as j,b as R,h as wi,k as gn}from"./chunk-SNAKHGZS.js";var ji=(t=>(t[t.AdjustDifferences=1]="AdjustDifferences",t[t.CountQuantity=2]="CountQuantity",t))(ji||{});var ki=(i=>(i[i.Draft=1]="Draft",i[i.Pending=2]="Pending",i[i.Rejected=3]="Rejected",i[i.Accepted=4]="Accepted",i))(ki||{});var ea=["productSearchInput"],na=()=>["/menu/Products/Catalog/Variants/Info"],ia=n=>({ID:n});function oa(n,e){n&1&&(a(0,"div"),s(1,"Name"),r())}function ra(n,e){if(n&1){let t=v();a(0,"input",15,0),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.productNameFilter,i)||(d.productNameFilter=i),u(i)}),_("ngModelChange",function(){p(t);let i=m(2);return u(i.onProductNameFilterChange())})("click",function(i){return p(t),u(i.stopPropagation())}),r()}if(n&2){let t=m(2);M("ngModel",t.productNameFilter)}}function aa(n,e){if(n&1){let t=v();a(0,"div",12),E(1,ra,2,1,"input",13),a(2,"i",14),_("click",function(i){p(t);let d=m();return i.stopPropagation(),u(d.toggleProductFilter())}),r()()}if(n&2){let t=m();pn("width",t.filterProductToggle?"100%":"auto"),l(),c("ngIf",t.filterProductToggle),l(),Nt("fa-filter",!t.filterProductToggle)("fa-filter-slash",t.filterProductToggle),c("matTooltip",t.searchTooltip)}}function la(n,e){if(n&1&&(a(0,"tr")(1,"td")(2,"a",16),s(3),r()(),a(4,"td"),s(5),r(),a(6,"td",17),s(7),r()()),n&2){let t=e.$implicit;l(2),c("routerLink",Z(5,na))("queryParams",k(6,ia,t.ID)),l(),I(" ",t.Name," "),l(2),S(t.Code),l(2),S(t.OnHand)}}function sa(n,e){if(n&1&&N(0,la,8,8,"tr",null,qt),n&2){let t=m();F(t.data.Data)}}function da(n,e){n&1&&(a(0,"tr",11)(1,"td",18),f(2,"empty-state-table"),r()())}var Bn=class n{constructor(e){this.data=e;this.modalConfig.title=`${e.ListTotal} Uncounted Products`,this.modalConfig.customWidth="600px",this.modalConfig.okText="<div> <i class='fa fa-print' aria-hidden='true'></i> Export </div>",this.modalConfig.hideCancel=!1,this.modalConfig.headerType=Y.Warning,this.originalData=e.Data,this.initSearchKeywordListener()}exportService=h(En);productSearchInput;modalConfig=new Ct;dialogRef=h(_t);filterProductToggle=!1;productNameFilter="";searchSubject=new ht;originalData=[];initSearchKeywordListener(){this.searchSubject.pipe(Ji(500),Me(),Ue(),Q(e=>{let t=e?.trim()?.toLowerCase()||"";this.data.Data=t?this.originalData.filter(o=>o.Name.toLowerCase().includes(t)):this.originalData})).subscribe()}onOk(){this.exportService.exportCSV("AdjustmentExport/GetExportMissingVariantAdjustment",{AdjustmentID:this.data.Adjustment.ID,OutletID:this.data.Adjustment.OutletID,ExportPageNumber:1,ExportRowCount:1e4,Export:!0,Format:0})}onCancel(){this.dialogRef.close()}onProductNameFilterChange(){this.searchSubject.next(this.productNameFilter)}toggleProductFilter(){this.filterProductToggle=!this.filterProductToggle,this.filterProductToggle?setTimeout(()=>this.productSearchInput?.nativeElement?.focus(),0):(this.productNameFilter="",this.onProductNameFilterChange())}get searchTooltip(){return this.filterProductToggle?"Click to hide search bar":"Click to search product"}static \u0275fac=function(t){return new(t||n)(D(Zt))};static \u0275cmp=O({type:n,selectors:[["POS-dialog-unscanned-products"]],viewQuery:function(t,o){if(t&1&&Gt(ea,5,Xi),t&2){let i;zt(i=Kt())&&(o.productSearchInput=i.first)}},decls:19,vars:4,consts:[["productSearchInput",""],[3,"onOk","onCancel","onClose","config"],[1,"container"],[1,"mt-4"],[1,"table","table-bordered"],[1,"thead-light"],[1,"d-flex","justify-content-between","align-items-center"],[4,"ngIf"],[1,"d-flex","justify-content-between","align-items-center",2,"cursor","pointer",3,"width"],[2,"width","120px"],[1,"text-end",2,"width","80px"],[1,"table-border-bottom-0"],[1,"d-flex","justify-content-between","align-items-center",2,"cursor","pointer"],["type","text","class","txtFilter form-control","placeholder","Search Product by Name","aria-label","Search","style","width: 100%; max-width: 250px","autofocus","",3,"ngModel","ngModelChange","click",4,"ngIf"],["matTooltipPosition","below",1,"fa-solid","ms-2",3,"click","matTooltip"],["type","text","placeholder","Search Product by Name","aria-label","Search","autofocus","",1,"txtFilter","form-control",2,"width","100%","max-width","250px",3,"ngModelChange","click","ngModel"],["target","_blank",3,"routerLink","queryParams"],[1,"text-end"],["colspan","3"]],template:function(t,o){t&1&&(a(0,"modal-material",1),_("onOk",function(){return o.onOk()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),a(1,"content")(2,"div",2)(3,"div")(4,"div",3)(5,"table",4)(6,"thead",5)(7,"tr")(8,"th")(9,"div",6),E(10,oa,2,0,"div",7),C(11,aa,3,8,"div",8),r()(),a(12,"th",9),s(13,"Code"),r(),a(14,"th",10),s(15,"On-Hand"),r()()(),a(16,"tbody"),C(17,sa,2,0)(18,da,3,0,"tr",11),r()()()()()()()),t&2&&(c("config",o.modalConfig),l(10),c("ngIf",!o.filterProductToggle),l(),g(o.data.Data.length>5?11:-1),l(6),g(o.data.Data.length>0?17:18))},dependencies:[ut,gt,ct,Qo,xt,ye,Jt,St,B,X,Le,be],styles:[".txtFilter[_ngcontent-%COMP%]{transition:all .3s ease;border:1px solid #ccc;border-radius:4px;padding:.5rem .75rem;font-size:.7rem;background-color:#fff;color:#333}.txtFilter[_ngcontent-%COMP%]::placeholder{color:#999}.txtFilter[_ngcontent-%COMP%]:hover{border-color:#89b03e;background-color:#f7fdf0}.txtFilter[_ngcontent-%COMP%]:focus{border-color:#89b03e;outline:none;box-shadow:0 0 0 .25rem #89b03e40;background-color:#fff}.txtFilter[_ngcontent-%COMP%]:not(:focus):not(:hover){background-color:#fff}"]})};var ur=()=>["/menu/Adjustment/Adjustment/Archive/Form"],Xe=n=>({ID:n}),_r=()=>["/print/Adjustment"],Cr=n=>({"border-end-0":n}),ca=()=>({arrayName:"DifferencesArray"}),qn=(n,e)=>({"text-success":n,"text-danger":e}),pa=(n,e)=>({"text-danger":n,"text-success":e}),ua=()=>({arrayName:"CountedArray"});function _a(n,e){if(n&1){let t=v();a(0,"button",29),f(1,"b",30),r(),a(2,"ul",31)(3,"li")(4,"button",32),_("click",function(){p(t);let i=m(3);return u(i.onRevertToDraft())}),s(5," Revert to Draft "),r()()()}}function Ca(n,e){if(n&1){let t=v();a(0,"div",9)(1,"button",26),_("click",function(){p(t);let i=m(2);return u(i.reject())}),f(2,"i",27),s(3,"Reject"),r(),a(4,"button",26),_("click",function(){p(t);let i=m(2);return u(i.accept())}),f(5,"i",28),s(6,"Accept "),r(),C(7,_a,6,0),r()}if(n&2){let t=m(2);l(7),g(t.data.Adjustment.TypeID==t.adjustmentType.CountQuantity?7:-1)}}function ga(n,e){if(n&1&&(a(0,"a",33),f(1,"i",34),s(2,"Resume "),r()),n&2){let t=m(3);c("routerLink",Z(2,ur))("queryParams",k(3,Xe,t.data.ID))}}function fa(n,e){if(n&1){let t=v();a(0,"button",26),_("click",function(){p(t);let i=m(3);return u(i.onSubmit())}),f(1,"i",35),s(2,"Submit "),r()}}function ha(n,e){if(n&1&&(C(0,ga,3,5,"a",33),C(1,fa,3,0,"button",10)),n&2){let t=m(2);g(t.data.Adjustment.StateID==t.adjustmentState.Draft?0:-1),l(),g(t.data.Adjustment.StateID==t.adjustmentState.Draft?1:-1)}}function ya(n,e){if(n&1&&(a(0,"a",33),f(1,"i",34),s(2,"Edit "),r()),n&2){let t=m(3);c("routerLink",Z(2,ur))("queryParams",k(3,Xe,t.data.ID))}}function xa(n,e){if(n&1&&C(0,ya,3,5,"a",33),n&2){let t=m(2);g(t.data.Adjustment.TypeID==t.adjustmentType.AdjustDifferences&&(t.data.Adjustment.StateID==t.adjustmentState.Pending||t.data.Adjustment.StateID==t.adjustmentState.Accepted)?0:-1)}}function va(n,e){if(n&1){let t=v();a(0,"button",26),_("click",function(){p(t);let i=m(2);return u(i.delete())}),f(1,"i",36),s(2,"Delete "),r()}}function Sa(n,e){n&1&&(a(0,"div",42),f(1,"div",44),r())}function ba(n,e){if(n&1&&(a(0,"div",12)(1,"div",38)(2,"h4"),s(3),y(4,"date"),r(),a(5,"p",39),s(6),y(7,"date"),r()(),a(8,"div",40),f(9,"i",41),C(10,Sa,2,0,"div",42),r(),a(11,"div",43)(12,"h4"),s(13),r(),a(14,"p",39),s(15),r()()()),n&2){let t=m(),o=t.$implicit,i=t.$index,d=m(2);l(3),S(V(4,7,o.Date,"dd MMM yyyy")),l(3),S(V(7,10,o.Date,"HH:mm a")),l(3),pn("color",i==0?"blue":"black"),l(),g(i!=d.data.StatusProcess.length-1?10:-1),l(3),S(o.Status),l(2),S(o.Creator)}}function Ia(n,e){if(n&1&&E(0,ba,16,13,"div",37),n&2){let t=e.$implicit;c("ngIf",t.Date)}}function Da(n,e){if(n&1){let t=v();a(0,"div",47)(1,"i",60),_("click",function(){p(t);let i=m(3);return u(i.showUnscannedProducts())}),r()()}}function Ta(n,e){if(n&1){let t=v();a(0,"a",61),_("click",function(){p(t);let i=m(3);return u(i.exportCSV(i.csvConverter,i.adjustmentTypeStatus!==-1&&i.adjustmentTypeStatus===1?"Adjustment/AdjustmentInfoExport":"Adjustment/AdjustmentCountedExport","Adjustment#"+i.data.Adjustment.Number+".csv"))}),f(1,"i",62),s(2,"Export"),r()}}function Pa(n,e){n&1&&(At(0),a(1,"th",63),s(2,"Qty"),r(),jt())}function wa(n,e){n&1&&(At(0),a(1,"th",63),s(2,"Counted"),r(),a(3,"th",63),s(4,"Expected"),r(),jt())}function Ma(n,e){n&1&&(a(0,"th",63),s(1,"Expected"),r(),a(2,"th",63),s(3,"Counted"),r())}function Ea(n,e){n&1&&Ei(0)}function Oa(n,e){if(n&1&&E(0,Ea,1,0,"ng-container",66),n&2){m(4);let t=J(2);c("ngTemplateOutlet",t)("ngTemplateOutletContext",Z(2,ca))}}function Aa(n,e){if(n&1&&(E(0,wa,5,0,"ng-container",58)(1,Ma,4,0,"ng-template",null,3,$),a(3,"th",63)(4,"div",64)(5,"span",65),s(6," Diff "),r(),C(7,Oa,1,3,"ng-container"),r()()),n&2){let t=J(2),o=m(3);c("ngIf",o.data.Adjustment.TypeID===2&&(o.data.Adjustment.StateID===1||o.data.Adjustment.StateID===2))("ngIfElse",t),l(7),g(o.data.Adjustment.TypeID!=o.adjustmentType.AdjustDifferences&&!(o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity)?7:-1)}}function ja(n,e){n&1&&(a(0,"th",67),s(1," Cost "),r())}function ka(n,e){n&1&&(a(0,"th",67),s(1," Price "),r())}function Va(n,e){if(n&1&&(a(0,"div",71),f(1,"POS-item-accordion",75),r()),n&2){let t=m(),o=t.$implicit,i=t.index;l(),c("items",o.TID)("label","TID")("badgeLabel","TIDs")("index",i)}}function Na(n,e){if(n&1&&(At(0),f(1,"p",76),jt()),n&2){let t=m().$implicit;l(),c("innerHTML",t.Note,q)}}function Fa(n,e){if(n&1&&(At(0),a(1,"td",77),s(2),y(3,"number"),r(),jt()),n&2){let t=m().$implicit;l(),ft(Ae(5,qn,t.Quantity>0,t.Quantity<0)),l(),I(" ",T(3,3,t.Quantity)," ")}}function Ua(n,e){if(n&1&&(At(0),a(1,"td",77),s(2),y(3,"number"),r(),a(4,"td",77),s(5),y(6,"number"),r(),jt()),n&2){let t=m(2).$implicit;l(2),I(" ",T(3,2,t.Counted)," "),l(3),I(" ",T(6,4,t.Expected)," ")}}function La(n,e){if(n&1&&(a(0,"td",77),s(1),y(2,"number"),r(),a(3,"td",77),s(4),y(5,"number"),r()),n&2){let t=m(2).$implicit;l(),I(" ",T(2,2,t.Expected)," "),l(3),I(" ",T(5,4,t.Counted)," ")}}function Qa(n,e){if(n&1&&(E(0,Ua,7,6,"ng-container",58)(1,La,6,6,"ng-template",null,3,$),a(3,"td",77),s(4),y(5,"number"),r()),n&2){let t=J(2),o=m().$implicit,i=m(4);c("ngIf",i.data.Adjustment.TypeID===2&&(i.data.Adjustment.StateID===1||i.data.Adjustment.StateID===2))("ngIfElse",t),l(3),ft(Ae(7,pa,o.Expected>o.Counted,o.Expected<o.Counted)),l(),I(" ",T(5,5,o.Difference)," ")}}function Ra(n,e){if(n&1&&(f(0,"td",78),y(1,"number")),n&2){let t=m().$implicit;c("innerHTML",T(1,1,t.UnitCost),q)}}function Ba(n,e){if(n&1&&(f(0,"td",78),y(1,"number")),n&2){let t=m().$implicit;c("innerHTML",T(1,1,t.UnitPrice),q)}}function Ha(n,e){if(n&1&&(a(0,"tr"),f(1,"td",69),a(2,"td")(3,"a",70),s(4),r(),a(5,"div"),s(6),r(),C(7,Va,2,4,"div",71),f(8,"app-serial-note",72),E(9,Na,2,1,"ng-container",73),r(),E(10,Fa,4,8,"ng-container",58)(11,Qa,6,10,"ng-template",null,4,$)(13,Ra,2,3,"td",74)(14,Ba,2,3,"td",74),r()),n&2){let t=e.$implicit,o=e.index,i=J(12),d=m(4);l(),c("innerHTML",o+1+".",q),l(2),c("queryParams",k(11,Xe,t.VariantID)),l(),S(t.Name),l(2),S(t.Code),l(),g(t.TID&&t.TID.length>0?7:-1),l(),c("serials",t.Serial),l(),c("ngIf",t.Note!=null),l(),c("ngIf",d.data.Adjustment.TypeID==d.adjustmentType.AdjustDifferences||d.data.Adjustment.StateID==d.adjustmentState.Accepted&&d.data.Adjustment.TypeID==d.adjustmentType.CountQuantity)("ngIfElse",i),l(3),c("ngIf",d.roleService.product.Cost),l(),c("ngIf",d.roleService.sell.PriceVisible)}}function Wa(n,e){if(n&1&&E(0,Ha,15,13,"tr",68),n&2){let t=m(3);c("ngForOf",t.filteredDifferences)}}function qa(n,e){n&1&&(a(0,"tr")(1,"td",79),f(2,"app-empty-state"),r()())}function Ga(n,e){if(n&1&&(a(0,"td",81)(1,"b"),s(2),y(3,"sum"),y(4,"number"),r()()),n&2){let t=m(4);l(2),S(T(4,4,V(3,1,t.filteredDifferences,"Counted")))}}function za(n,e){if(n&1&&(a(0,"td",81)(1,"b"),s(2),y(3,"sum"),y(4,"number"),r()()),n&2){let t=m(4);l(2),S(T(4,4,V(3,1,t.filteredDifferences,"Expected")))}}function Ka(n,e){if(n&1&&(a(0,"b"),y(1,"sum"),y(2,"sum"),s(3),y(4,"sum"),y(5,"number"),r()),n&2){let t=m(4);ft(Ae(14,qn,V(1,3,t.filteredDifferences,"Quantity")>0,V(2,6,t.filteredDifferences,"Quantity")<0)),l(3),S(T(5,12,V(4,9,t.filteredDifferences,"Quantity")))}}function $a(n,e){if(n&1&&(a(0,"b",86),y(1,"sum"),y(2,"sum"),s(3),y(4,"sum"),y(5,"number"),r()),n&2){let t=m(4);c("ngClass",Ae(13,qn,V(1,2,t.filteredDifferences,"Difference")>0,V(2,5,t.filteredDifferences,"Difference")<0)),l(3),I(" ",T(5,11,V(4,8,t.filteredDifferences,"Difference"))," ")}}function Ja(n,e){if(n&1&&(a(0,"td",87)(1,"b"),s(2),y(3,"sum"),y(4,"number"),r()()),n&2){let t=m(4);l(2),S(T(4,4,V(3,1,t.filteredDifferences,"TotalCost")))}}function Za(n,e){if(n&1&&(a(0,"td",88)(1,"b"),s(2),y(3,"sum"),y(4,"number"),r()()),n&2){let t=m(4);l(2),S(T(4,4,V(3,1,t.filteredDifferences,"TotalPrice")))}}function Xa(n,e){if(n&1&&(a(0,"tfoot")(1,"tr")(2,"td",80)(3,"b"),s(4,"Total :"),r()(),C(5,Ga,5,6,"td",81),C(6,za,5,6,"td",81),a(7,"td",82),E(8,Ka,6,17,"b",83)(9,$a,6,16,"ng-template",null,5,$),r(),E(11,Ja,5,6,"td",84)(12,Za,5,6,"td",85),r()()),n&2){let t=J(10),o=m(3);l(2),c("colSpan",o.data.Adjustment.TypeID==o.adjustmentType.AdjustDifferences||o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity||o.data.Adjustment.TypeID!=o.adjustmentType.AdjustDifferences&&!(o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity)?2:4),l(3),g(o.data.Adjustment.TypeID!=o.adjustmentType.AdjustDifferences&&!(o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity)?5:-1),l(),g(o.data.Adjustment.TypeID!=o.adjustmentType.AdjustDifferences&&!(o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity)?6:-1),l(2),c("ngIf",o.data.Adjustment.TypeID==o.adjustmentType.AdjustDifferences||o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity)("ngIfElse",t),l(3),c("ngIf",o.roleService.product.Cost),l(),c("ngIf",o.roleService.sell.PriceVisible)}}function Ya(n,e){if(n&1&&(a(0,"div",14)(1,"div",45)(2,"div",46)(3,"h2"),s(4),r(),C(5,Da,2,0,"div",47),r(),a(6,"div",48)(7,"a",49),f(8,"i",50),s(9,"Print "),r(),E(10,Ta,3,0,"a",51),r()(),a(11,"div",20)(12,"div",52)(13,"table",53)(14,"thead",54)(15,"tr")(16,"th",55),s(17,"No"),r(),a(18,"th",56),s(19," Name "),a(20,"small",57),s(21),y(22,"sum"),y(23,"number"),r()(),E(24,Pa,3,0,"ng-container",58)(25,Aa,8,3,"ng-template",null,2,$)(27,ja,2,0,"th",59)(28,ka,2,0,"th",59),r()(),a(29,"tbody"),C(30,Wa,1,1,"tr")(31,qa,3,0,"tr"),r(),C(32,Xa,13,7,"tfoot"),r()()()()),n&2){let t=J(26),o=m(2);l(4),I(" ",o.data.Adjustment.TypeID==o.adjustmentType.AdjustDifferences||o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity?"Adjusted":"Counted"," Inventory "),l(),g(o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity&&(o.data.Adjustment.StateID==o.adjustmentState.Draft||o.data.Adjustment.StateID==o.adjustmentState.Pending)?5:-1),l(2),c("routerLink",Z(20,_r))("queryParams",k(21,Xe,o.paramId))("ngClass",k(23,Cr,o.roleService.global.Export)),l(3),c("ngIf",o.roleService.global.Export),l(11),Dn(" (",o.filteredDifferences&&o.filteredDifferences.length>0?o.filteredDifferences.length:0," SKU - ",T(23,18,V(22,15,o.filteredDifferences,"Quantity"))," ",o.data.Adjustment.TypeID==o.adjustmentType.AdjustDifferences||o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity?"Adjusted":"Counted",")"),l(3),c("ngIf",o.data.Adjustment.TypeID==o.adjustmentType.AdjustDifferences||o.data.Adjustment.StateID==o.adjustmentState.Accepted&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity)("ngIfElse",t),l(3),c("ngIf",o.roleService.product.Cost),l(),c("ngIf",o.roleService.sell.PriceVisible),l(2),g(o.filteredDifferences&&o.filteredDifferences.length>0?30:31),l(2),g(o.filteredDifferences&&o.filteredDifferences.length>0&&o.filteredDifferences.length?32:-1)}}function tl(n,e){n&1&&(a(0,"h2"),s(1," Counted Inventory "),r())}function el(n,e){if(n&1){let t=v();a(0,"a",61),_("click",function(){p(t);let i=m(3);return u(i.exportCSV(i.csvConverter,"Adjustment/AdjustmentCountedExport","Adjustment_Counted#"+i.data.Adjustment.Number+".csv"))}),f(1,"i",62),s(2,"Export"),r()}}function nl(n,e){n&1&&Ei(0)}function il(n,e){if(n&1&&(a(0,"div",71),f(1,"POS-item-accordion",94),r()),n&2){let t=m(),o=t.$implicit,i=t.index;l(),c("items",o.TID)("label","TID")("badgeLabel","TIDs")("index",i)("icon","fa-regular fa-tag")}}function ol(n,e){if(n&1&&(a(0,"tr"),f(1,"td",69),a(2,"td")(3,"a",70),s(4),r(),a(5,"div"),s(6),r(),C(7,il,2,5,"div",71),r(),a(8,"td",77),s(9),y(10,"number"),r(),a(11,"td",77),s(12),y(13,"number"),r(),a(14,"td",93),s(15),y(16,"number"),r()()),n&2){let t=e.$implicit,o=e.index;l(),c("innerHTML",o+1+".",q),l(2),c("queryParams",k(16,Xe,t.VariantID)),l(),S(t.Name),l(2),S(t.Code),l(),g(t.TID&&t.TID.length>0?7:-1),l(2),S(T(10,10,t.Counted)),l(3),S(T(13,12,t.Expected)),l(2),ft(Ae(18,qn,t.Difference>0,t.Difference<0)),l(),I(" ",T(16,14,t.Difference)," ")}}function rl(n,e){if(n&1&&E(0,ol,17,21,"tr",68),n&2){let t=m(3);c("ngForOf",t.filteredCounted)}}function al(n,e){n&1&&(a(0,"tr")(1,"td",95),f(2,"app-empty-state"),r()())}function ll(n,e){if(n&1&&(a(0,"tfoot")(1,"tr")(2,"td",80)(3,"b"),s(4,"Total :"),r()(),a(5,"td",81)(6,"b"),s(7),y(8,"sum"),y(9,"number"),r()(),a(10,"td",81)(11,"b"),s(12),y(13,"sum"),y(14,"number"),r()(),a(15,"td",96)(16,"b"),s(17),y(18,"sum"),y(19,"number"),r()()()()),n&2){let t=m(3);l(2),c("colSpan",2),l(5),S(T(9,7,V(8,4,t.filteredCounted,"Counted"))),l(5),S(T(14,12,V(13,9,t.filteredCounted,"Expected"))),l(5),S(T(19,17,V(18,14,t.filteredCounted,"Difference")))}}function sl(n,e){if(n&1&&(a(0,"div",14)(1,"div",45)(2,"div",89),E(3,tl,2,0,"h2",73),r(),a(4,"div",48)(5,"a",49),f(6,"i",50),s(7,"Print "),r(),E(8,el,3,0,"a",51),r()(),a(9,"div",20)(10,"div",52)(11,"table",53)(12,"thead",54)(13,"tr")(14,"th",55),s(15,"No"),r(),a(16,"th",56),s(17," Name "),a(18,"small",57),s(19),y(20,"sum"),y(21,"number"),r()(),a(22,"th",90),s(23,"Counted"),r(),a(24,"th",90),s(25,"Expected"),r(),a(26,"th",90)(27,"div",91)(28,"span",92),s(29," Diff "),r(),E(30,nl,1,0,"ng-container",66),r()()()(),a(31,"tbody"),C(32,rl,1,1,"tr")(33,al,3,0,"tr"),r(),C(34,ll,20,19,"tfoot"),r()()()()),n&2){let t=m(2),o=J(2);l(3),c("ngIf",t.data.CountedArray.length>0&&t.data.Adjustment.TypeID==t.adjustmentType.CountQuantity),l(2),c("routerLink",Z(16,_r))("queryParams",k(17,Xe,t.paramId))("ngClass",k(19,Cr,t.roleService.global.Export)),l(3),c("ngIf",t.roleService.global.Export),l(11),Ft(" (",t.filteredCounted&&t.filteredCounted.length>0?t.filteredCounted.length:0," SKU - ",T(21,14,V(20,11,t.filteredCounted,"Counted"))," Counted) "),l(11),c("ngTemplateOutlet",o)("ngTemplateOutletContext",Z(21,ua)),l(2),g(t.filteredCounted&&t.filteredCounted.length>0?32:33),l(2),g(t.filteredCounted&&t.filteredCounted.length>0&&t.filteredCounted.length?34:-1)}}function dl(n,e){if(n&1&&(a(0,"mainpanel-cmp",8)(1,"actions"),C(2,Ca,8,1,"div",9),a(3,"div",9),C(4,ha,2,2),C(5,xa,1,1),C(6,va,3,0,"button",10),r()(),a(7,"content")(8,"div",11)(9,"div",12)(10,"div",13)(11,"div",14)(12,"div",15)(13,"div",16),f(14,"h2",17,1),a(16,"div",18),f(17,"i",19),a(18,"span"),s(19),r()()()(),a(20,"div",20)(21,"table",21)(22,"tr")(23,"th"),s(24,"Date"),r(),a(25,"td"),s(26,":"),r(),f(27,"td",22),r(),a(28,"tr")(29,"th"),s(30,"PIC"),r(),a(31,"td"),s(32,":"),r(),f(33,"td",22),r(),a(34,"tr")(35,"th"),s(36,"Type"),r(),a(37,"td"),s(38,":"),r(),f(39,"td",22),r(),a(40,"tr")(41,"th"),s(42,"Note"),r(),a(43,"td"),s(44,":"),r(),f(45,"td",22),r(),a(46,"tr")(47,"th"),s(48,"Tag"),r(),a(49,"td"),s(50,":"),r(),f(51,"td",22),r()()()(),a(52,"div")(53,"div",14)(54,"div",15)(55,"h2"),s(56,"Status"),r()(),a(57,"div",20),N(58,Ia,1,1,"div",12,qt),r()()()(),a(60,"div",23),E(61,Ya,33,25,"div",24)(62,sl,35,22,"div",24),r()(),f(63,"pos-footer-alert",25),r()()()),n&2){let t=J(15),o=m();c("pageData",o.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),g(o.hasAccRejButton?2:-1),l(2),g(o.roleService.adjustment.Create?4:-1),l(),g(o.roleService.adjustment.Edit?5:-1),l(),g(o.roleService.adjustment.Delete?6:-1),l(8),c("matTooltip",t.classList.contains("text-truncate")?o.data.Adjustment.OutletName:"")("innerHTML",o.data.Adjustment.OutletName,q),l(2),c("ngClass",o.determineStatusClasses),l(),c("ngClass",o.getStatusIconClasses),l(2),S((o.data.Adjustment==null?null:o.data.Adjustment.StateLabel)||""),l(8),c("innerHTML",o.data.Adjustment.Date,q),l(6),c("innerHTML",o.data.Adjustment.PIC,q),l(6),c("innerHTML",o.data.Adjustment.TypeLabel,q),l(6),c("innerHTML",o.data.Adjustment.Note,q),l(6),c("innerHTML",o.data.Adjustment.TagName,q),l(7),F(o.data.StatusProcess),l(3),c("ngIf",o.data.DifferencesArray.length>0),l(),c("ngIf",(o.data.CountedArray==null?null:o.data.CountedArray.length)>0&&o.data.Adjustment.TypeID==o.adjustmentType.CountQuantity),l(),c("created",o.data.CreatedInfo.Created)("modified",o.data.CreatedInfo.Modified)}}function ml(n,e){if(n&1){let t=v();a(0,"div",101)(1,"p-checkbox",103),w("ngModelChange",function(i){p(t);let d=m(3);return P(d.filterTreeCondition,i)||(d.filterTreeCondition=i),u(i)}),_("ngModelChange",function(){p(t);let i=m(2).arrayName,d=m();return u(d.onFilterChange(i))}),r(),a(2,"label",104),s(3),r()()}if(n&2){let t=m().$implicit,o=m(2);l(),M("ngModel",o.filterTreeCondition),c("label",t.Value)("value",t.Key)("inputId",t.Value),l(),c("for",t.Value),l(),Ft("",t.Value," (",t.Key===1?o.data.MatchItemCount:o.data.UnmatchItemCount,")")}}function cl(n,e){if(n&1){let t=v();a(0,"div",102)(1,"p-checkbox",105),w("ngModelChange",function(i){p(t);let d=m(3);return P(d.isAllSelected,i)||(d.isAllSelected=i),u(i)}),_("ngModelChange",function(i){p(t);let d=m(2).arrayName,x=m();return u(x.selectAll(i,d))}),r(),a(2,"label",104),s(3,"All"),r()()}if(n&2){let t=m().$implicit,o=m(2);l(),c("binary",!0),M("ngModel",o.isAllSelected),c("label",t.Value)("inputId",t.Value),l(),c("for",t.Value)}}function pl(n,e){if(n&1&&C(0,ml,4,7,"div",101)(1,cl,4,5,"div",102),n&2){let t=e.$implicit;g(t.Key>=0?0:1)}}function ul(n,e){if(n&1){let t=v();a(0,"div",97)(1,"i",98),_("click",function(i){let d=p(t).arrayName,x=J(3),b=m();return u(b.toggleFilter(i,x,d))}),r(),a(2,"p-popover",99,6)(4,"div",100),N(5,pl,2,1,null,null,qt),r()()()}if(n&2){let t=e.arrayName,o=m();l(),pn("margin-top",t==="CountedArray"?"5px":"0px"),Nt("ms-2",t==="CountedArray"),l(),c("dismissable",!0)("modal",!1),l(3),F(o.CountItemDifferenceOptions)}}var Hn=class n extends bt{constructor(t,o,i,d,x,b,nt,rt){super(t,o,"Adjustment/AuditInventoryAdjustmentInfo",null,null,d);this.httpService=o;this.toastr=i;this.csvConverter=x;this.router=b;this.roleService=nt;this.dialog=rt;this.initQueryParam()}paramId;hasAccRejButton=!1;isEditable=!1;adjustmentType=ji;adjustmentState=ki;isAllSelected=!0;filterTreeCondition=[1,0];filteredDifferences=[];filteredCounted=[];preGetList(){let t=this.route.snapshot.queryParams;this.pageData.Filter=t}initQueryParam(){let t=this.route.snapshot.queryParams;this.paramId=t.ID}postInit(t){this.menuData.H=t.PageTitle,t.Adjustment.StateID==2&&this.roleService.adjustment.Approval&&t.Config.WithApproval?this.hasAccRejButton=!0:this.hasAccRejButton=!1,(this.data.Adjustment.StateID==1||this.data.Adjustment.StateID==2)&&(this.isEditable=!0),this.CountItemDifferenceOptions&&(this.filterTreeCondition=this.CountItemDifferenceOptions.filter(o=>o.Key>=0).map(o=>o.Key)),this.isAllSelected=!0,this.filteredDifferences=this.data.DifferencesArray,this.filteredCounted=this.data.CountedArray}exportCSV(t,o,i){let d=this.filterTreeCondition.includes(-1)||this.filterTreeCondition.length>=2?-1:this.filterTreeCondition[0];this.httpService.get(`/api/${o}`,[{key:"ID",value:this.paramId},{key:"CountItemDifference",value:d}]).subscribe(x=>{t.convertToCSV(x,i)})}reject(){if(!confirm("Are you sure you want to reject this?"))return;let t={ID:this.data.Adjustment.ID};this.httpService.post("/API/Adjustment/RejectCountedItem",t).subscribe({next:o=>{this.toastr.success("Success reject adjustment",Y.Success),this.hasAccRejButton=!1,this.isEditable=!1,this.getListData()}})}accept(){if(!confirm("Are you sure you want to accept this?"))return;let t={ID:this.data.Adjustment.ID};this.httpService.post("/API/Adjustment/AcceptCountedItem",t).subscribe({next:o=>{this.toastr.success("Success accept adjustment",Y.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.",Y.Success),this.router.navigate(["/menu/Adjustment/Adjustment/Archive"])})}get determineStatusClasses(){let t=this.data?.Adjustment?.StateLabel;return t?{"bg-draft":t.includes("Draft"),"bg-in-review":t.includes("Pending"),"bg-rejected":t.includes("Rejected"),"bg-accepted":t.includes("Accepted")}:{"bg-draft":!1,"bg-in-review":!1,"bg-rejected":!1,"bg-accepted":!1}}get getStatusIconClasses(){let t=this.data?.Adjustment?.StateLabel;return t?{"fa-check":t.includes("Accepted"),"fa-bookmark":t.includes("Draft"),"fa-hourglass-start":t.includes("Pending"),"fa-xmark":t.includes("Rejected")}:{"fa-check":!1,"fa-bookmark":!1,"fa-hourglass-start":!1,"fa-xmark":!1}}onSubmit(){this.dialog.open(nr,{data:{title:"Submit Review",message:`
|
|
2
|
+
<h4>Are you sure you want to Change status to pending review?</h4>
|
|
3
|
+
`,headerType:Y.Warning}}).afterClosed().pipe(dt(t=>t===!0),ot(()=>this.httpService.post(wt.AdjusmentSubmitReview,{ID:this.data.Adjustment.ID}))).subscribe(t=>{this.toastr.success(t.Message,Y.Success),this.getListData()})}showUnscannedProducts(){this.httpService.post("/api/Adjustment/GetListMissingVariantAdjustment",{AdjustmentID:this.data.Adjustment.ID,OutletID:this.data.Adjustment.EntityID,PageNumber:1,RowCount:100}).subscribe(t=>{let o={Data:t.Data,Adjustment:{ID:this.data.Adjustment.ID,OutletID:this.data.Adjustment.EntityID},ListTotal:t.ListTotal};this.dialog.open(Bn,{data:o})})}selectAll(t,o){this.isAllSelected=t,t?this.filterTreeCondition=this.CountItemDifferenceOptions.filter(i=>i.Key>=0).map(i=>i.Key):this.filterTreeCondition=[],this.onFilterChange(o),o==="DifferencesArray"&&this.data?.DifferencesArray?this.data.DifferencesArray.forEach(i=>i.selected=t):o==="CountedArray"&&this.data?.CountedArray&&this.data.CountedArray.forEach(i=>i.selected=t)}onFilterChange(t){let o=this.CountItemDifferenceOptions.filter(i=>i.Key>=0).map(i=>i.Key);this.isAllSelected=o.every(i=>this.filterTreeCondition.includes(i)),t==="DifferencesArray"?this.filteredDifferences=this.applyFilter(this.data.DifferencesArray,t):this.filteredCounted=this.applyFilter(this.data.CountedArray,t)}toggleFilter(t,o,i){o.toggle(t)}applyFilter(t,o){let{filterTreeCondition:i}=this;return!i||i.length===0?[]:this.CountItemDifferenceOptions.filter(b=>b.Key>=0).map(b=>b.Key).every(b=>i.includes(b))?o==="DifferencesArray"?this.data.DifferencesArray:this.data.CountedArray:t.filter(b=>{let nt=b.Difference!==0;return!!(i.includes(0)&&nt||i.includes(1)&&!nt)})}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}onRevertToDraft(){let t={ID:this.data.Adjustment.ID,OutletID:this.data.Adjustment.EntityID};this.httpService.put("api/adjustment/updaterevert",t).pipe(Q(o=>{o&&o.Message&&(this.toastr.success(o.Message,Y.Success),this.getListData())})).subscribe()}get CountItemDifferenceOptions(){return!this.data||!this.data.Options?[]:[...this.data.Options.CountItemDifferenceOptions].sort((t,o)=>Number(t.Key)-Number(o.Key))}static \u0275fac=function(o){return new(o||n)(D(at),D(L),D(vt),D(xe),D(kt),D(Lt),D(H),D(it))};static \u0275cmp=O({type:n,selectors:[["POS-adjustment-info"]],standalone:!1,features:[mt],decls:3,vars:1,consts:[["filterTemplate",""],["outletName",""],["NOTACC",""],["ELSE_BLOCK",""],["NOTACCDATA",""],["COUNTEDTOTAL",""],["op",""],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"btn-group","me-4"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-4"],[1,"card"],[1,"card-header"],[1,"d-flex","gap-4"],[1,"text-truncate",3,"matTooltip","innerHTML"],[1,"badge","rounded-pill","d-flex","align-items-center","gap-3","fs-6",3,"ngClass"],[1,"fa-solid",3,"ngClass"],[1,"card-body"],[1,"table-sm","table-borderless"],[3,"innerHTML"],[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"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer","color","black"],["role","button","matTooltipPosition","above","matTooltip","Revert this adjustment to Draft to allow further edits","target","_blank",1,"dropdown-item",3,"click"],[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"],["class","row",4,"ngIf"],[1,"col","text-end"],[1,"mt-3"],[1,"col-3","text-center","position-relative"],[1,"fa-solid","fa-angle-up","current-status-icon"],[1,"d-flex","justify-content-center","h-100"],[1,"col-5"],[1,"timeline"],[1,"card-header","d-flex","justify-content-between"],[1,"d-flex","gap-3","align-items-center"],[1,"d-flex","justify-content-center","align-items-center","unscanned-btn-wrapper"],[1,"btn-group"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams","ngClass"],[1,"fa-solid","fa-print","me-3"],["class","btn btn-outline-secondary btn-sm","role","button",3,"click",4,"ngIf"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-center",2,"width","1px"],[2,"width","300px"],[1,"fst-italic","fs-6"],[4,"ngIf","ngIfElse"],["class","text-end","style","width: 120px",4,"ngIf"],["matTooltip","Show outlet products with stock but haven't been counted/scanned yet","matTooltipPosition","above",1,"fa-solid","fa-magnifying-glass","cursor-pointer","unscanned-icon",3,"click"],["role","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"fa-solid","fa-upload","me-3"],[1,"text-end",2,"width","80px"],[1,"d-flex","align-items-center","justify-content-end","gap-2"],["matTooltip","Difference = Counted - Expected","matTooltipPosition","above",1,"text-end"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"text-end",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"text-center",3,"innerHTML"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[2,"width","fit-content"],[3,"serials"],[4,"ngIf"],["class","text-end",3,"innerHTML",4,"ngIf"],[3,"items","label","badgeLabel","index"],[1,"special-TinyMCE","fst-italic","text-warning","mb-0",2,"word-break","break-all",3,"innerHTML"],[1,"text-end"],[1,"text-end",3,"innerHTML"],["colspan","7"],[1,"text-end","empty-column",3,"colSpan"],["matTooltipPosition","above",1,"text-end","empty-column"],[1,"text-end","empty-column"],[3,"class",4,"ngIf","ngIfElse"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Cost",4,"ngIf"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Price",4,"ngIf"],[3,"ngClass"],["matTooltipPosition","above","matTooltip","Total from Quantity x Cost",1,"text-end","empty-column"],["matTooltipPosition","above","matTooltip","Total from Quantity x Price",1,"text-end","empty-column"],[1,"d-flex","align-items-center","gap-2"],[1,"text-end",2,"width","100px"],[1,"d-flex","align-items-center","justify-content-end","pe-4"],["matTooltip","Difference = Counted - Expected","matTooltipPosition","above",1,"me-2"],[1,"text-end",2,"padding-right","18px"],[3,"items","label","badgeLabel","index","icon"],["colspan","5"],["matTooltipPosition","above",1,"text-end","empty-column",2,"padding-right","14px"],["matTooltip","Click to Filter Unmatched / Matched Items Only","matTooltipPosition","above",2,"cursor","pointer"],[1,"fa","fa-filter","pointer",3,"click"],[3,"dismissable","modal"],[1,"p-3",2,"width","150px"],[1,"mt-4","d-flex","align-items-center","column-gap-3"],[1,"border-bottom","pb-3","d-flex","align-items-center","column-gap-3"],[3,"ngModelChange","ngModel","label","value","inputId"],[1,"ms-2",3,"for"],[3,"ngModelChange","binary","ngModel","label","inputId"]],template:function(o,i){o&1&&E(0,dl,64,21,"mainpanel-cmp",7)(1,ul,7,6,"ng-template",null,0,$),o&2&&c("ngIf",i.data)},dependencies:[Ut,Tn,ye,io,ct,lt,B,X,be,Po,Mo,$e,Rn,Vn,mr,G,$t,He],styles:[".current-status-icon[_ngcontent-%COMP%]{background-color:#fff;border-radius:50%;box-shadow:0 2px #b8b8b8;width:35px;height:35px;font-size:35px}.timeline[_ngcontent-%COMP%]{border-left:3px solid #e1e1e1;height:100%;width:0px}.bg-draft[_ngcontent-%COMP%]{background-color:#ffa72a!important}.bg-in-review[_ngcontent-%COMP%]{background-color:#7e7e7e!important}.bg-rejected[_ngcontent-%COMP%]{background-color:#ff382e!important}.bg-accepted[_ngcontent-%COMP%]{background-color:#2fad1a!important}.unscanned-btn-wrapper[_ngcontent-%COMP%]{padding:3px;border-radius:120px;width:28px;height:28px;background-color:#ddd}.unscanned-icon[_ngcontent-%COMP%]{font-size:12px;margin-bottom:0}"]})};var Cl=["complexPagination"],gl=()=>["/menu/Adjustment/Adjustment/Archive/Form"],fl=()=>["/menu/Adjustment/Adjustment/Archive/Info"],hl=n=>({ID:n}),fr=n=>({"text-success":n}),hr=n=>({"text-danger":n});function yl(n,e){if(n&1){let t=v();a(0,"a",24),_("click",function(){p(t);let i=m(3);return u(i.httpPostListID("Adjustment/DeleteInventoryAdjustmentList"))}),f(1,"i",25),s(2,"Delete "),r()}}function xl(n,e){if(n&1){let t=v();a(0,"a",26),_("click",function(){p(t);let i=m(3);return u(i.onMergeAdjustment())}),f(1,"i",27),s(2," Merge "),r()}}function vl(n,e){if(n&1&&(a(0,"div",6),C(1,yl,3,0,"a",22),C(2,xl,3,0,"a",23),r()),n&2){let t=m(2);l(),g(t.getSelectedData().length>0&&(!(t.roleService==null||t.roleService.adjustment==null)&&t.roleService.adjustment.Delete)?1:-1),l(),g(t.getSelectedData().length>=2&&(!(t.roleService==null||t.roleService.adjustment==null)&&t.roleService.adjustment.Edit)?2:-1)}}function Sl(n,e){if(n&1){let t=v();a(0,"button",28),_("click",function(){p(t);let i=m(2);return u(i.openExportModal())}),f(1,"i",29),s(2," Export "),r()}}function bl(n,e){n&1&&(a(0,"a",8),s(1,"New"),r()),n&2&&c("routerLink",Z(1,gl))}function Il(n,e){if(n&1){let t=v();a(0,"div")(1,"div",30)(2,"h6"),s(3,"Outlet"),r(),a(4,"ng-select",31),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.EntityID,i)||(d.pageData.Filter.EntityID=i),u(i)}),r(),a(5,"h6"),s(6,"Date From - To"),r(),a(7,"div",32)(8,"div",33)(9,"datepicker",34),w("dateChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.From,i)||(d.pageData.Filter.From=i),u(i)}),r()(),a(10,"div",35)(11,"datepicker",36),w("dateChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.To,i)||(d.pageData.Filter.To=i),u(i)}),r()()(),a(12,"h6"),s(13,"Quantity From - To"),r(),a(14,"div",37)(15,"input",38),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.QuantityFrom,i)||(d.pageData.Filter.QuantityFrom=i),u(i)}),r(),s(16," - "),a(17,"input",38),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.QuantityTo,i)||(d.pageData.Filter.QuantityTo=i),u(i)}),r()(),a(18,"h6"),s(19,"State"),r(),a(20,"ng-select",39),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.State,i)||(d.pageData.Filter.State=i),u(i)}),r(),a(21,"h6"),s(22,"Adjustment Type"),r(),a(23,"ng-select",40),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.Type,i)||(d.pageData.Filter.Type=i),u(i)}),r(),a(24,"h6"),s(25,"Adjustment Tag"),r(),a(26,"ng-select",41),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.TagID,i)||(d.pageData.Filter.TagID=i),u(i)}),r(),a(27,"h6"),s(28,"Number Filter Comparator"),r(),a(29,"ng-select",42),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.NumberFilterComparator,i)||(d.pageData.Filter.NumberFilterComparator=i),u(i)}),r(),a(30,"h6"),s(31,"Rows"),r(),a(32,"input",43),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.RowCount,i)||(d.pageData.Filter.RowCount=i),u(i)}),r(),a(33,"h6"),s(34,"Exclude Zero"),r(),a(35,"radio-options",44),w("modelChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.ExcludeZero,i)||(d.pageData.Filter.ExcludeZero=i),u(i)}),r()()()}if(n&2){let t=m(2);l(4),c("items",t.pageData.Options.Entities),M("ngModel",t.pageData.Filter.EntityID),l(5),c("isFloatingLabel",!1),M("date",t.pageData.Filter.From),l(2),c("isFloatingLabel",!1),M("date",t.pageData.Filter.To),l(4),M("ngModel",t.pageData.Filter.QuantityFrom),l(2),M("ngModel",t.pageData.Filter.QuantityTo),l(3),c("items",t.pageData.Options.States),M("ngModel",t.pageData.Filter.State),l(3),c("items",t.pageData.Options.Types),M("ngModel",t.pageData.Filter.Type),l(3),c("items",t.pageData.Options.AdjustmentTagsOptions),M("ngModel",t.pageData.Filter.TagID),l(3),M("ngModel",t.pageData.Filter.NumberFilterComparator),c("items",t.pageData.Options.NumberFilterComparators)("clearable",!1),l(3),M("ngModel",t.pageData.Filter.RowCount),c("max",1e4),l(3),M("model",t.pageData.Filter.ExcludeZero)}}function Dl(n,e){if(n&1){let t=v();a(0,"th",13)(1,"input",45),_("change",function(i){p(t);let d=m(2);return u(d.onSelectAllData(i.target.checked))}),r()()}}function Tl(n,e){n&1&&(a(0,"th",19),s(1,"Cost"),r())}function Pl(n,e){if(n&1){let t=v();a(0,"td")(1,"input",49),w("ngModelChange",function(i){p(t);let d=m().$implicit;return P(d.selected,i)||(d.selected=i),u(i)}),r()()}if(n&2){let t=m().$implicit;l(),M("ngModel",t.selected)}}function wl(n,e){if(n&1&&(a(0,"td",47),s(1),y(2,"quantityFraction"),r()),n&2){let t=m(2).$implicit;l(),I(" ",T(2,1,t.Quantity)," ")}}function Ml(n,e){if(n&1&&(a(0,"td",47),s(1),y(2,"quantityFraction"),r()),n&2){let t=m(2).$implicit;ft(k(5,fr,t.Quantity>0)),l(),I(" +",T(2,3,t.Quantity)," ")}}function El(n,e){if(n&1&&(a(0,"td",47),s(1),y(2,"quantityFraction"),r()),n&2){let t=m(2).$implicit;ft(k(5,hr,t.Quantity<0)),l(),I(" ",T(2,3,t.Quantity)," ")}}function Ol(n,e){if(n&1&&(C(0,wl,3,3,"td",47),C(1,Ml,3,7,"td",50),C(2,El,3,7,"td",50)),n&2){let t=m().$implicit;g(t.Quantity==0?0:-1),l(),g(t.Quantity>0?1:-1),l(),g(t.Quantity<0?2:-1)}}function Al(n,e){if(n&1&&(a(0,"td",47),s(1),y(2,"quantityFraction"),r()),n&2){let t=m(2).$implicit;l(),I(" ",T(2,1,t.CountedQuantity)," ")}}function jl(n,e){if(n&1&&(a(0,"td",47),s(1),y(2,"quantityFraction"),r()),n&2){let t=m(2).$implicit;ft(k(5,fr,t.CountedQuantity>0)),l(),I(" +",T(2,3,t.CountedQuantity)," ")}}function kl(n,e){if(n&1&&(a(0,"td",47),s(1),y(2,"quantityFraction"),r()),n&2){let t=m(2).$implicit;ft(k(5,hr,t.CountedQuantity<0)),l(),I(" ",T(2,3,t.CountedQuantity)," ")}}function Vl(n,e){if(n&1&&(C(0,Al,3,3,"td",47),C(1,jl,3,7,"td",50),C(2,kl,3,7,"td",50)),n&2){let t=m().$implicit;g(t.CountedQuantity==0?0:-1),l(),g(t.CountedQuantity>0?1:-1),l(),g(t.CountedQuantity<0?2:-1)}}function Nl(n,e){if(n&1&&(a(0,"td",47),s(1),y(2,"amountFraction"),r()),n&2){let t=m().$implicit;l(),S(T(2,1,t.Cost))}}function Fl(n,e){n&1&&(a(0,"span",52),s(1,"All SKU Quantity are Matched"),r())}function Ul(n,e){if(n&1&&(a(0,"span",53),s(1),r()),n&2){let t=m(2).$implicit;l(),Ft(" ",t.Quantity," Qty from ",t.UnmatchSKUCount," SKU ")}}function Ll(n,e){if(n&1&&(f(0,"div",48),a(1,"div",51)(2,"span",52),s(3,"Adjusted Note: "),r(),C(4,Fl,2,0,"span",52)(5,Ul,2,2,"span",53),r()),n&2){let t=m().$implicit;c("innerHTML",t.Note,q),l(4),g(t.Quantity===0&&t.UnmatchSKUCount===0?4:5)}}function Ql(n,e){if(n&1&&f(0,"div",48),n&2){let t=m().$implicit;c("innerHTML",t.Note,q)}}function Rl(n,e){if(n&1&&(a(0,"tr",20),C(1,Pl,2,1,"td"),a(2,"td"),s(3),r(),a(4,"td")(5,"a",46),s(6),r()(),a(7,"td"),s(8),y(9,"date"),r(),a(10,"td",47),s(11),y(12,"number"),r(),C(13,Ol,3,3),C(14,Vl,3,3),a(15,"td"),s(16),r(),C(17,Nl,3,3,"td",47),a(18,"td"),s(19),r(),a(20,"td"),C(21,Ll,6,2)(22,Ql,1,1,"div",48),r()()),n&2){let t=e.$implicit,o=m(2);l(),g(!(o.roleService==null||o.roleService.adjustment==null)&&o.roleService.adjustment.Delete||!(o.roleService==null||o.roleService.adjustment==null)&&o.roleService.adjustment.Edit?1:-1),l(2),S(t.EntityName),l(2),c("routerLink",Z(20,fl))("queryParams",k(21,hl,t.ID)),l(),S(t.Number),l(2),S(V(9,15,t.Date,"dd MMM yyyy")),l(3),S(T(12,18,t.SKUCount)),l(2),g(t.TypeLabel.includes("Adjust")?13:-1),l(),g(t.TypeLabel.includes("Count")?14:-1),l(2),S(t.TypeLabel),l(),g(!(o.roleService==null||o.roleService.product==null)&&o.roleService.product.Cost?17:-1),l(),to(o.stateColored(+t.StateID)),l(),I(" ",t.StateLabel," "),l(2),g(t.TypeLabel.includes("Count")?21:22)}}function Bl(n,e){if(n&1){let t=v();a(0,"mainpanel-cmp",3),w("textChange",function(i){p(t);let d=m();return P(d.pageData.Filter.Number,i)||(d.pageData.Filter.Number=i),u(i)}),_("onSubmit",function(){p(t);let i=m();return u(i.searchFromPageOne())}),w("filterChange",function(i){p(t);let d=m();return P(d.pageData.Filter,i)||(d.pageData.Filter=i),u(i)}),a(1,"actions")(2,"a",4),f(3,"i",5),s(4,"Scanner App "),r(),C(5,vl,3,2,"div",6),C(6,Sl,3,0,"button",7),C(7,bl,2,2,"a",8),r(),a(8,"filters"),E(9,Il,36,20,"ng-template",null,0,$),r(),a(11,"content")(12,"div",9)(13,"div",10)(14,"table",11)(15,"thead",12)(16,"tr"),C(17,Dl,2,0,"th",13),a(18,"th",14),s(19,"Outlet"),r(),a(20,"th",14),s(21,"Number"),r(),a(22,"th",15),s(23,"Date"),r(),a(24,"th",16),s(25,"SKU"),r(),a(26,"th",17),s(27," Qty "),r(),a(28,"th",18),s(29,"Type"),r(),C(30,Tl,2,0,"th",19),a(31,"th",15),s(32,"State"),r(),a(33,"th"),s(34,"Note"),r()()(),a(35,"tbody"),N(36,Rl,23,23,"tr",20,et),r()()(),a(38,"POS-complex-pagination",21,1),_("jumpToPage",function(){p(t);let i=m();return u(i.getListData())})("previousPage",function(){p(t);let i=m();return u(i.getListData())})("nextPage",function(){p(t);let i=m();return u(i.getListData())}),r()()()()}if(n&2){let t=m();c("pageData",t.menuData),M("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),M("filter",t.pageData.Filter),l(5),g(!(t.roleService==null||t.roleService.adjustment==null)&&t.roleService.adjustment.Delete||!(t.roleService==null||t.roleService.adjustment==null)&&t.roleService.adjustment.Edit?5:-1),l(),g(t.roleService.global.Export?6:-1),l(),g(t.roleService.adjustment.Create?7:-1),l(10),g(!(t.roleService==null||t.roleService.adjustment==null)&&t.roleService.adjustment.Delete||!(t.roleService==null||t.roleService.adjustment==null)&&t.roleService.adjustment.Edit?17:-1),l(13),g(!(t.roleService==null||t.roleService.product==null)&&t.roleService.product.Cost?30:-1),l(6),F(t.data.Data),l(2),c("total",t.data.Data.length)("pageData",t.pageData)}}var Gn=class n extends bt{constructor(t,o,i,d,x,b){super(t,o,"Adjustment/GetInventoryAdjustmentList","AdjustmentLoader/GetInventoryAdjustmentList",i);this.toastr=i;this.csvConverter=d;this.roleService=x;this.matDialog=b}complexPagination;hideMore=!1;openExportModal(){this.matDialog.open(Rt,{data:{title:"Inventory Adjustment",exportTypes:[{ID:"AdjustmentExport/GetInventoryAdjustmentList",Value:"Default",FileName:"Inventory Adjustment"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/GetInventoryAdjustmentListCount",pagination:!0}})}onMergeAdjustment(){let t=this.getSelectedData();this.matDialog.open(er,{data:{data:t,title:"Choose Merge Target",columns:[{type:"text",field:"Number"},{type:"date",field:"Date"},{type:"number",field:"Quantity"},{type:"text",field:"TypeLabel"},{type:"text",field:"StateLabel"}],headers:["Number","Date","Qty","Type","Status"]},width:"600px"}).afterClosed().pipe(dt(o=>o),ot(o=>this.httpService.put(wt.MergeAdjustment,o))).subscribe(()=>{this.toastrService.success("Inventory Adjustment records have been merged successfully.",Y.Success),this.getListData()})}stateColored(t){switch(t){case 1:return{color:"#FFA72A"};case 2:return{color:"#7E7E7E"};case 3:return{color:"#FF382E"};case 4:return{color:"#2FAD1A"}}}postInit(t){super.postInit(t),this.complexPagination&&this.complexPagination.totalAllData()>=0&&this.complexPagination.StoreRowsCountAPIResult()}static \u0275fac=function(o){return new(o||n)(D(at),D(L),D(vt),D(kt),D(H),D(it))};static \u0275cmp=O({type:n,selectors:[["POS-inventory-adjustment"]],viewQuery:function(o,i){if(o&1&&Gt(Cl,5),o&2){let d;zt(d=Kt())&&(i.complexPagination=d.first)}},standalone:!1,features:[mt],decls:1,vars:1,consts:[["pageFilterTemplate",""],["complexPagination",""],[3,"pageData","text","isFilterOnDropdown","filter"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["href","https://www.dealpos.co.id/tour/scanner","target","_blank",1,"btn","btn-outline-secondary","me-3"],[1,"fa-solid","fa-scanner","me-3"],[1,"btn-group","me-3"],[1,"btn","btn-outline-secondary","me-3"],[1,"button","btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","14px"],[2,"width","120px"],[2,"width","100px"],[1,"text-end",2,"width","55px"],["matTooltipPosition","above","matTooltip","Adjusted Quantity",1,"text-end",2,"width","100px"],[2,"width","40px"],[1,"text-end",2,"width","95px"],[1,"border-bottom"],["api","Adjustment/GetInventoryAdjustmentListCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary"],["role","button",1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash","me-3"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-merge","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModelChange","items","ngModel"],[1,"row"],[1,"col-6","pe-2"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"col-6","ps-2"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"d-flex","align-items-center",2,"column-gap","8px"],["type","text","autoNum","","emptyInputBehavior","null",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"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an Comparator",3,"ngModelChange","ngModel","items","clearable"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel","max"],[3,"modelChange","model"],["type","checkbox",3,"change"],[3,"routerLink","queryParams"],[1,"text-end"],[3,"innerHTML"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end",3,"class"],[1,"mt-1","small"],[1,"fst-italic"],["matTooltip","SKU adjustment summary - not included in CSV export","matTooltipPosition","above",1,"fst-italic"]],template:function(o,i){o&1&&C(0,Bl,40,11,"mainpanel-cmp",2),o&2&&g(i.data?0:-1)},dependencies:[ct,lt,St,lo,B,X,Ge,pt,te,jn,Qt,be,G,$t,Do,To],encapsulation:2})};var Kn=class n{config;dialogRef=h(_t);data=h(Zt);filterKeys=["From","To","PageNumber","RowCount","EntityID","TagID"];httpService=h(L);summaryData=K(null);constructor(){this.config=new Ct,this.config.title="Total Adjustment Summary",this.config.hideFooter=!0,this.config.customWidth="382px"}ngOnInit(){console.log("DialogAdjustmentSummaryComponent",this.data.pageData),console.log("data",this.data);let e=Object.entries(this.data.pageData).filter(([o,i])=>this.filterKeys.includes(o)).map(([o,i])=>{if(o==="From"||o==="To"){let d=new Date(i);return{[o]:new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}).format(d).replace(/(\d{4})\/(\d{2})\/(\d{2})/,"$1-$2-$3")+"T00:00:00.000"}}return{[o]:i}}),t=e.reduce((o,i)=>j(j({},o),i),{});this.httpService.post("api/Adjustment/AuditAdjustmentSumReport",t).pipe(Ot(o=>o.Data),Q(o=>this.summaryData.set(o))).subscribe(),console.log("tdf",e)}onOK(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["pos-dialog-adjustment-summary"]],decls:29,vars:13,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid"],[1,"table","table-bordered"],[1,"py-2",2,"width","40%"],[1,"text-end","py-2"]],template:function(t,o){t&1&&(a(0,"modal-material",0),_("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),a(1,"content")(2,"div",1)(3,"table",2)(4,"tbody")(5,"tr")(6,"th",3),s(7,"Quantity"),r(),a(8,"td",4),s(9),y(10,"number"),r()(),a(11,"tr")(12,"th",3),s(13,"Weight"),r(),a(14,"td",4),s(15),y(16,"number"),r()(),a(17,"tr")(18,"th",3),s(19,"Total Cost"),r(),a(20,"td",4),s(21),y(22,"number"),r()(),a(23,"tr")(24,"th",3),s(25,"Total Price"),r(),a(26,"td",4),s(27),y(28,"number"),r()()()()()()()),t&2&&(c("config",o.config),l(9),I(" ",T(10,5,o.summaryData().Quantity)," "),l(6),I(" ",T(16,7,o.summaryData().Weight)," "),l(6),I(" ",T(22,9,o.summaryData().TotalCost)," "),l(6),I(" ",T(28,11,o.summaryData().TotalPrice)," "))},dependencies:[ut,gt,xt,G],encapsulation:2,changeDetection:0})};var Wl=()=>["/menu/Adjustment/Adjustment/Archive/Info"],ql=n=>({ID:n});function Gl(n,e){if(n&1){let t=v();a(0,"button",4),_("click",function(){p(t);let i=m();return u(i.openExportModal())}),f(1,"i",5),s(2," Export "),r()}}function zl(n,e){if(n&1){let t=v();a(0,"div",6)(1,"h6"),s(2,"Outlets"),r(),a(3,"outlet-selector",7),w("ngModelChange",function(i){p(t);let d=m();return P(d.pageData.Filter.EntityID,i)||(d.pageData.Filter.EntityID=i),u(i)}),r(),a(4,"h6"),s(5,"From"),r(),a(6,"datepicker",8),w("dateChange",function(i){p(t);let d=m();return P(d.pageData.Filter.From,i)||(d.pageData.Filter.From=i),u(i)}),r(),a(7,"h6"),s(8,"To"),r(),a(9,"datepicker",9),w("dateChange",function(i){p(t);let d=m();return P(d.pageData.Filter.To,i)||(d.pageData.Filter.To=i),u(i)}),r(),a(10,"h6"),s(11,"Adjustment Tag"),r(),a(12,"ng-select",10),w("ngModelChange",function(i){p(t);let d=m();return P(d.pageData.Filter.TagID,i)||(d.pageData.Filter.TagID=i),u(i)}),r()()}if(n&2){let t=m();l(3),c("accessType",2),M("ngModel",t.pageData.Filter.EntityID),c("multiple",!1),l(3),c("isFloatingLabel",!1),M("date",t.pageData.Filter.From),l(3),c("isFloatingLabel",!1),M("date",t.pageData.Filter.To),l(3),c("items",t.pageData.Options.AdjustmentTagsOptions),M("ngModel",t.pageData.Filter.TagID)}}function Kl(n,e){n&1&&(a(0,"th",22),s(1," @ Cost "),r())}function $l(n,e){n&1&&(a(0,"th",22),s(1," @ Price "),r())}function Jl(n,e){if(n&1&&(a(0,"th",36),s(1),y(2,"number"),r()),n&2){let t=m().$implicit;l(),I(" ",T(2,1,t.UnitCost)," ")}}function Zl(n,e){if(n&1&&(a(0,"th",36),s(1),y(2,"number"),r()),n&2){let t=m().$implicit;l(),I(" ",T(2,1,t.UnitPrice)," ")}}function Xl(n,e){if(n&1&&(a(0,"tr")(1,"th",32),s(2),r(),a(3,"th",33),s(4),r(),a(5,"th",34),s(6),y(7,"number"),r(),E(8,Jl,3,3,"th",35)(9,Zl,3,3,"th",35),r()),n&2){let t=e.$implicit,o=m(3);l(2),I(" ",t.VariantName," "),l(2),I(" ",t.VariantCode," "),l(2),I(" ",T(7,5,t.Quantity)," "),l(2),c("ngIf",o.roleService.product.Cost),l(),c("ngIf",o.roleService.sell.UnitPriceEditor)}}function Yl(n,e){if(n&1&&(a(0,"div")(1,"div",23)(2,"div",24)(3,"a",25),f(4,"span",26),y(5,"date"),f(6,"small",27),y(7,"date"),a(8,"small",28),s(9),r()()()(),a(10,"div")(11,"strong",29),s(12),r(),f(13,"div",30),r(),a(14,"table",31)(15,"tbody"),E(16,Xl,10,7,"tr",18),r()()()),n&2){let t=e.$implicit;l(3),c("routerLink",Z(14,Wl))("queryParams",k(15,ql,t.ID)),l(),c("innerHTML",t.EntityName+" #"+t.Number+" - "+V(5,8,t.Created,"dd MMM yyyy"),q),l(2),c("innerHTML","("+V(7,11,t.Created,"HH:mm")+")",q),l(3),I(" ",t.PIC),l(3),I("[Q:",t.Quantity,"]"),l(),c("innerHTML",t.Note,q),l(3),c("ngForOf",t.Items)}}function ts(n,e){if(n&1){let t=v();a(0,"div",11)(1,"table",12)(2,"thead",13)(3,"tr")(4,"th",14),s(5,"Name"),r(),a(6,"th",15),s(7,"Code"),r(),a(8,"th",16),s(9,"Qty"),r(),E(10,Kl,2,0,"th",17)(11,$l,2,0,"th",17),r()()(),E(12,Yl,17,17,"div",18),a(13,"div",19)(14,"button",20),_("click",function(){p(t);let i=m();return u(i.onDialogSummary())}),s(15," View Adjustment Summary "),r()(),a(16,"POS-complex-pagination",21),_("jumpToPage",function(){p(t);let i=m();return u(i.getListData())})("previousPage",function(){p(t);let i=m();return u(i.getListData())})("nextPage",function(){p(t);let i=m();return u(i.getListData())}),r()()}if(n&2){let t=m();l(10),c("ngIf",t.roleService.product.Cost),l(),c("ngIf",t.roleService.sell.UnitPriceEditor),l(),c("ngForOf",t.data.Data),l(4),c("total",t.data.Data.length)("pageData",t.pageData)}}var $n=class n extends bt{constructor(t,o,i,d,x){super(t,o,"Adjustment/AuditAdjustmentReport","AdjustmentLoader/AuditAdjustmentReport",void 0,void 0,!0);this.httpService=o;this.csvConverter=i;this.roleService=d;this.matDialog=x}dataEndpoint="/api/Adjustment/AuditAdjustmentReport";loaderEndpoint="/api/AdjustmentLoader/AuditAdjustmentReport";countEndpoint="/api/Adjustment/AuditAdjustmentReportCount";data$;loader$;loader;onOpenExportDialog(t){}openExportModal(){this.matDialog.open(Rt,{data:{title:"Adjustment Report",exportTypes:[{ID:"AdjustmentExport/AuditAdjustmentReport",Value:"Default",FileName:"Adjustment Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/AuditAdjustmentReportCount",pagination:!0}})}preInitList(){super.preInitList();let t=this.pageData.Options.AdjustmentTagsOptions.findIndex(o=>o.ID===this.pageData.Filter.TagID);this.pageData=R(j({},this.pageData),{Filter:R(j({},this.pageData.Filter),{TagID:t!==-1?this.pageData.Filter.TagID:null})})}onDialogSummary(){this.matDialog.open(Kn,{data:{pageData:this.pageData.Filter}})}static \u0275fac=function(o){return new(o||n)(D(at),D(L),D(kt),D(H),D(it))};static \u0275cmp=O({type:n,selectors:[["POS-adjustment-reports"]],standalone:!1,features:[mt],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","Choose a tag","bindLabel","Name","bindValue","ID","appendTo","body",3,"ngModelChange","items","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","w-100"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[1,"text-end",2,"width","60px"],[1,"text-end",2,"width","50px"],["class","text-end","style","width: 80px",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-center","w-100","my-6"],["type","button",1,"btn","btn-outline-primary",3,"click"],["api","Adjustment/AuditAdjustmentReportCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"text-end",2,"width","80px"],[1,"d-lg-flex","mt-sm-0"],[1,"mt-5","ms-3"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHTML"],[1,"fst-italic","text-dark",3,"innerHTML"],[1,"fst-italic","text-dark"],[1,"text-danger","ms-3"],[3,"innerHTML"],[1,"table","table-bordered"],[1,"fw-normal",2,"width","645px","word-break","break-all"],[1,"fw-normal","text-end",2,"width","60px","word-break","break-all"],[1,"fw-normal","text-end",2,"width","50px"],["class","fw-normal text-end","style","width: 80px",4,"ngIf"],[1,"fw-normal","text-end",2,"width","80px"]],template:function(o,i){if(o&1){let d=v();a(0,"mainpanel-cmp",1),w("textChange",function(b){return p(d),P(i.pageData.Filter.Number,b)||(i.pageData.Filter.Number=b),u(b)}),_("onSubmit",function(){return p(d),u(i.searchFromPageOne())}),w("filterChange",function(b){return p(d),P(i.pageData.Filter,b)||(i.pageData.Filter=b),u(b)}),a(1,"actions"),E(2,Gl,3,0,"button",2),r(),a(3,"filters"),E(4,zl,13,9,"ng-template",null,0,$),r(),a(6,"content"),E(7,ts,17,5,"div",3),r()()}o&2&&(c("pageData",i.menuData),M("text",i.pageData.Filter.Number),c("isFilterOnDropdown",!1),M("filter",i.pageData.Filter),l(2),c("ngIf",i.roleService.global.Export),l(5),c("ngIf",i.data&&i.data.Data))},dependencies:[Tn,ye,ct,lt,B,X,Ge,pt,te,qe,G,$t],encapsulation:2})};var Jn=class extends Mn{constructor(t,o){super(t);this.httpService=o;this.loaderApi="/API/AdjustmentLoader/StockTakeByCSV",this.productsApi="/API/Adjustment/GetSpreadsheetPagination",this.submitApi="/API/Adjustment/SubmitUseDefault",this.requestPayload=3,this.products=this.originalProducts=[],this.getDataFromLoader()}loaderData;products;originalProducts;adjustmentID;completeInfo;error;loaderApi;productsApi;submitApi;requestPayload;getDataFromLoader(){this.menuData$.pipe($i(()=>this.httpService.post(this.loaderApi,this.requestPayload))).subscribe(t=>this.loaderData=t)}getProduct(t){this.products=[],this.httpService.post(this.productsApi,t).subscribe(o=>{o.forEach(i=>{i.Counted="",this.products.push(i),this.originalProducts.push(i)})})}submitAdjustment(t){this.beforeSubmit(),this.httpService.post(this.submitApi,t).subscribe({next:o=>{this.adjustmentID=o.OrderID,this.completeInfo=o,this.error=null,this.onSubmitSuccess()},error:o=>{this.error=o,this.onSubmiterror()}})}onSubmitSuccess(){}beforeSubmit(){}onSubmiterror(){}};var ns=["stepper"],xr=n=>({"nb-button-override":n}),is=n=>({custom:n}),vr=()=>["/menu/Products/Catalog/Variants/Info"],Fi=n=>({ID:n}),os=n=>({"bg-gradient-warning":n}),rs=n=>({Filter:n}),as=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function ls(n,e){if(n&1){let t=v();a(0,"button",9),_("click",function(){p(t);let i=m(2);return u(i.validateFilter())}),s(1," Next "),r()}if(n&2){let t=m(2);c("disabled",!t.roleService.adjustment.Create)}}function ss(n,e){if(n&1){let t=v();a(0,"div",6)(1,"button",10),_("click",function(){p(t);let i=m(2);return u(i.stepper.previous())}),s(2," Back "),r(),a(3,"button",11),_("click",function(){p(t);let i=m(2);return u(i.stepper.next())}),s(4," Next "),r()()}if(n&2){let t=m(2);c("ngClass",k(1,xr,t.currentSubStatus!=t.subStatusEnum.PAID))}}function ds(n,e){if(n&1){let t=v();a(0,"div",6)(1,"button",12),_("click",function(){p(t);let i=m(2);return u(i.stepper.previous())}),s(2," Back "),r(),a(3,"button",11),_("click",function(){p(t);let i=m(2);return u(i.stepper.next())}),s(4," Confirm Adjustment "),r()()}if(n&2){let t=m(2);c("ngClass",k(1,xr,t.currentSubStatus!=t.subStatusEnum.PAID))}}function ms(n,e){n&1&&(f(0,"i",54),s(1,"Filter"))}function cs(n,e){n&1&&(a(0,"small",55),s(1,"Outlet option is required."),r())}function ps(n,e){n&1&&(f(0,"i",56),s(1,"Input"))}function us(n,e){n&1&&(a(0,"th",43),s(1,"Expected"),r())}function _s(n,e){n&1&&(a(0,"th",43),s(1,"Changes"),r())}function Cs(n,e){if(n&1&&(a(0,"td"),s(1),r()),n&2){let t=m().$implicit;l(),I(" ",t.Quantity," ")}}function gs(n,e){if(n&1&&(a(0,"td"),s(1),f(2,"i",63),s(3),y(4,"number"),r()),n&2){let t=m().$implicit;Nt("bg-gradient-danger",t.Counted<t.Quantity)("bg-gradient-success",t.Counted>t.Quantity),l(),I(" ",t.Quantity," "),l(2),Ft(" ",t.Counted," (",(t.Counted-t.Quantity>0?"+":"")+T(4,7,t.Counted-t.Quantity),") ")}}function fs(n,e){if(n&1){let t=v();a(0,"i",64),_("click",function(){p(t);let i=m().$implicit,d=m(3);return u(d.clear(i))}),r()}}function hs(n,e){if(n&1){let t=v();a(0,"tr")(1,"td"),s(2),r(),a(3,"td",57),s(4),r(),a(5,"td",57),s(6),r(),a(7,"td")(8,"a",58),s(9),r()(),a(10,"td"),s(11),r(),C(12,Cs,2,1,"td"),a(13,"td")(14,"input",59,2),w("ngModelChange",function(i){let d=p(t).$implicit;return P(d.Counted,i)||(d.Counted=i),u(i)}),_("ngModelChange",function(){let i=p(t).$implicit,d=J(15),x=m(3);return u(x.onReset(i,d))}),r()(),C(16,gs,5,9,"td",60),a(17,"td",61),C(18,fs,1,0,"i",62),r()()}if(n&2){let t=e.$implicit,o=e.$index,i=m(3);l(2),S(o+1+"."),l(2),I(" ",t.CategoryName," "),l(2),I(" ",t.ProductName," "),l(2),c("routerLink",Z(14,vr))("queryParams",k(15,Fi,t.ID)),l(),S(t.Model),l(2),S(t.Code),l(),g(i.roleService.inventory.View?12:-1),l(2),ft(k(17,os,t.Counted!==""&&t.Counted!=t.Quantity&&!i.roleService.inventory.View)),c("modifyValueOnWheel",!1),M("ngModel",t.Counted),l(2),g(t.Counted!==""&&i.roleService.inventory.View?16:-1),l(2),g(t.Counted!==""?18:-1)}}function ys(n,e){if(n&1){let t=v();a(0,"POS-complex-pagination",65),_("jumpToPage",function(){p(t);let i=m(3);return u(i.getProduct(i.filter))})("previousPage",function(){p(t);let i=m(3);return u(i.getProduct(i.filter))})("nextPage",function(){p(t);let i=m(3);return u(i.getProduct(i.filter))}),r()}if(n&2){let t=m(3);c("total",t.products.length)("pageData",k(2,rs,t.filter))}}function xs(n,e){n&1&&(f(0,"i",66),s(1,"Review"))}function vs(n,e){n&1&&(a(0,"th",43),s(1,"Expected"),r())}function Ss(n,e){n&1&&(a(0,"th",43),s(1,"Differences"),r())}function bs(n,e){if(n&1&&(a(0,"td"),s(1),r()),n&2){let t=m(2).$implicit;l(),I(" ",t.Quantity," ")}}function Is(n,e){if(n&1&&(a(0,"span"),s(1),y(2,"number"),r()),n&2){let t=m(3).$implicit;l(),I("+",T(2,1,t.Counted-t.Quantity))}}function Ds(n,e){if(n&1&&(a(0,"span"),s(1),y(2,"number"),r()),n&2){let t=m(3).$implicit;l(),S(T(2,1,t.Counted-t.Quantity))}}function Ts(n,e){if(n&1&&(a(0,"td"),C(1,Is,3,3,"span"),C(2,Ds,3,3,"span"),r()),n&2){let t=m(2).$implicit;l(),g(t.Counted>=t.Quantity?1:-1),l(),g(t.Counted<t.Quantity?2:-1)}}function Ps(n,e){if(n&1&&(a(0,"tr")(1,"td"),s(2),r(),a(3,"td",57),s(4),r(),a(5,"td")(6,"a",58),s(7),r()(),a(8,"td"),s(9),r(),C(10,bs,2,1,"td"),a(11,"td"),s(12),r(),C(13,Ts,3,2,"td"),r()),n&2){let t=m(),o=t.$implicit,i=t.$index,d=m(3);Nt("soft-yellow",o.Counted<o.Quantity)("soft-green",o.Counted>o.Quantity),l(2),S(i+1+"."),l(2),I(" ",o.ProductName," "),l(2),c("routerLink",Z(13,vr))("queryParams",k(14,Fi,o.ID)),l(),S(o.Model),l(2),S(o.Code),l(),g(d.roleService.inventory.View?10:-1),l(2),I(" ",o.Counted," "),l(),g(d.roleService.inventory.View?13:-1)}}function ws(n,e){if(n&1&&C(0,Ps,14,16,"tr",67),n&2){let t=e.$implicit;g(t.Counted!==""?0:-1)}}function Ms(n,e){n&1&&(f(0,"i",68),s(1,"Finish"))}function Es(n,e){if(n&1&&(a(0,"div",53),f(1,"i",69),s(2),r()),n&2){let t=m(3);l(2),I("",t.error.error.Message," ")}}function Os(n,e){if(n&1){let t=v();a(0,"mat-stepper",13,0),_("selectionChange",function(i){p(t);let d=m(2);return u(d.onNextStep(i))}),a(2,"mat-step",14),E(3,ms,2,0,"ng-template",15),a(4,"div",16)(5,"div",17)(6,"div",18)(7,"div",17)(8,"h3",19),s(9,"Outlet"),r()(),a(10,"div",20)(11,"ng-select",21,1),_("change",function(){p(t);let i=m(2);return u(i.toggleIsFilterFilled())}),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.filter.EntityID,i)||(d.filter.EntityID=i),u(i)}),r(),E(13,cs,2,0,"small",22),r()()(),a(14,"div",23)(15,"div",18)(16,"div",17)(17,"h3",19),s(18," Category "),a(19,"small",24)(20,"em"),s(21,"Optional"),r()()()(),a(22,"div",20)(23,"POS-product-category-select",25),w("selectedCategoryIDChange",function(i){p(t);let d=m(2);return P(d.filter.CategoryID,i)||(d.filter.CategoryID=i),u(i)}),r()()()(),a(24,"div",23)(25,"div",18)(26,"div",17)(27,"h3",19),s(28," Contain Text "),a(29,"small",24)(30,"em"),s(31,"Optional"),r()()()(),a(32,"div",26)(33,"input",27),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.filter.ProductName,i)||(d.filter.ProductName=i),u(i)}),r()()()(),a(34,"div",23)(35,"div",18)(36,"div",17)(37,"div",28)(38,"h3",29),s(39," Tag "),r(),a(40,"small",24)(41,"em"),s(42,"Optional"),r()()()(),a(43,"div",26)(44,"ng-select",30),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.filter.TagID,i)||(d.filter.TagID=i),u(i)}),r()()()(),a(45,"div",23)(46,"div",18)(47,"div",17)(48,"h3",19),s(49,"Storage Location"),r()(),a(50,"div",20)(51,"POS-storage-location-select",31),_("selectedCategoryIDChange",function(i){p(t);let d=m(2);return u(d.onSelectStorageLocation(i))}),r()()()(),a(52,"div",32)(53,"div",18)(54,"div",17)(55,"h3",19),s(56," Note "),a(57,"small",24)(58,"em"),s(59,"Optional"),r()()()(),a(60,"div",20)(61,"textarea",33),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.note,i)||(d.note=i),u(i)}),r()()()()()(),a(62,"mat-step",34),E(63,ps,2,0,"ng-template",15),a(64,"div",35)(65,"table",36),_("matSortChange",function(i){p(t);let d=m(2);return u(d.sortData(i))}),a(66,"thead",37)(67,"tr")(68,"th",38),s(69,"No"),r(),a(70,"th",39),s(71," Category "),r(),a(72,"th",40),s(73," Product "),r(),a(74,"th",41),s(75," Variant "),r(),a(76,"th",42),s(77,"Code"),r(),C(78,us,2,0,"th",43),a(79,"th",43),s(80,"Counted"),r(),C(81,_s,2,0,"th",43),f(82,"th",38),r()(),a(83,"tbody"),N(84,hs,19,19,"tr",null,et),r()(),C(86,ys,1,4,"POS-complex-pagination",44),r()(),a(87,"mat-step",45),E(88,xs,2,0,"ng-template",15),a(89,"div",46)(90,"div",47)(91,"table",48),_("matSortChange",function(i){p(t);let d=m(2);return u(d.sortData(i))}),a(92,"thead",49)(93,"tr"),f(94,"th",38),a(95,"th",50),s(96," Name "),r(),a(97,"th",51),s(98,"Variant"),r(),a(99,"th",43),s(100,"Code"),r(),C(101,vs,2,0,"th",43),a(102,"th",43),s(103,"Counted"),r(),C(104,Ss,2,0,"th",43),r()(),a(105,"tbody"),N(106,ws,1,1,null,null,et),r()()()()(),a(108,"mat-step",52),E(109,Ms,2,0,"ng-template",15),C(110,Es,3,1,"div",53),r()()}if(n&2){let t=J(12),o=m(2);c("linear",!0),l(2),c("completed",o.isFilterFilled),l(9),ft(k(26,is,t.touched&&o.filter.EntityID==null)),c("items",o.loaderData.Entities),M("ngModel",o.filter.EntityID),c("clearable",!1),l(2),c("ngIf",t.touched&&o.filter.EntityID==null),l(10),M("selectedCategoryID",o.filter.CategoryID),c("showClear",!0)("placeholder","Choose Category")("isInitializedCategoryLabel",!0),l(10),M("ngModel",o.filter.ProductName),l(11),c("items",o.loaderData.AdjustmentTagsOptions),M("ngModel",o.filter.TagID),c("clearable",!1),l(7),c("showClear",!0)("placeholder","Choose Storage Location")("isInitializedCategoryLabel",!0),l(10),M("ngModel",o.note),l(17),g(o.roleService.inventory.View?78:-1),l(3),g(o.roleService.inventory.View?81:-1),l(3),F(o.products),l(2),g(o.products.length>0?86:-1),l(15),g(o.roleService.inventory.View?101:-1),l(3),g(o.roleService.inventory.View?104:-1),l(2),F(o.reviewedItems),l(4),g(o.error?110:-1)}}function As(n,e){n&1&&(a(0,"div",85),s(1,"Difference"),r())}function js(n,e){if(n&1&&(a(0,"div",89),s(1),r()),n&2){let t=m().$implicit;ft(t.Quantity-t.OriginalQuantity<0?"text-danger":"text-success"),l(),I(" ",(t.Quantity-t.OriginalQuantity>0?"+":" ")+(t.Quantity-t.OriginalQuantity)," ")}}function ks(n,e){if(n&1&&(a(0,"div",86)(1,"div",88),s(2),r(),a(3,"div",89),s(4),r(),C(5,js,2,3,"div",90),r()),n&2){let t=e.$implicit,o=m(3);l(2),Ft("",t.Name," (",t.Model,")"),l(2),S(t.Quantity),l(),g(o.roleService.inventory.View?5:-1)}}function Vs(n,e){if(n&1&&(a(0,"div",89),y(1,"sum"),y(2,"sum"),s(3),y(4,"sum"),y(5,"sum"),y(6,"sum"),y(7,"sum"),r()),n&2){let t=m(3);ft(V(1,3,t.displayedItems,"Quantity")-V(2,6,t.displayedItems,"OriginalQuantity")<0?"text-danger":"text-success"),l(3),I(" ",(V(4,9,t.displayedItems,"Quantity")-V(5,12,t.displayedItems,"OriginalQuantity")>0?"+":" ")+(V(6,15,t.displayedItems,"Quantity")-V(7,18,t.displayedItems,"OriginalQuantity"))," ")}}function Ns(n,e){if(n&1){let t=v();a(0,"div",8)(1,"div",70)(2,"div",71)(3,"div",72)(4,"h1",73),f(5,"i",68),s(6,"Inventory Adjustment Completed "),r()(),a(7,"div",74)(8,"div",75)(9,"div",76)(10,"a",77),_("click",function(){p(t);let i=m(2);return u(i.newStockCount())}),s(11,"New Adjustment (F8)"),r()()()()()(),a(12,"div",78)(13,"div",71)(14,"div",79)(15,"h2",80)(16,"a",81),s(17),r()()(),a(18,"div",82)(19,"div",83)(20,"div",84),s(21," Product Name (Variant) "),r(),a(22,"div",85),s(23,"Counted"),r(),C(24,As,2,0,"div",85),r(),N(25,ks,6,4,"div",86,et),a(27,"div",87)(28,"div",88),s(29,"Total"),r(),a(30,"div",89),s(31),y(32,"sum"),r(),C(33,Vs,8,21,"div",90),r()()()()()}if(n&2){let t=m(2);l(16),c("routerLink",Z(9,as))("queryParams",k(10,Fi,t.adjustmentID)),l(),I("Adjustment #",t.completeInfo.InvoiceNumber),l(7),g(t.roleService.inventory.View?24:-1),l(),F(t.displayedItems),l(6),I(" ",V(32,6,t.displayedItems,"Quantity")," "),l(2),g(t.roleService.inventory.View?33:-1)}}function Fs(n,e){if(n&1){let t=v();a(0,"mainpanel-cmp",4),w("textChange",function(i){p(t);let d=m();return P(d.filter.ProductName,i)||(d.filter.ProductName=i),u(i)}),_("onSubmit",function(){p(t);let i=m();return u(i.filterProduct())}),a(1,"actions"),C(2,ls,2,1,"button",5),C(3,ss,5,3,"div",6),C(4,ds,5,3,"div",6),r(),a(5,"content"),C(6,Os,111,28,"mat-stepper",7),C(7,Ns,34,12,"div",8),r()()}if(n&2){let t=m();c("pageData",t.menuData),M("text",t.filter.ProductName),c("hideSearchBox",t.currentStep!="input")("hideSearchDropdown",!0),l(2),g(t.currentStep=="filter"?2:-1),l(),g(t.currentStep=="input"?3:-1),l(),g(t.currentStep=="review"?4:-1),l(2),g(t.isCompleted?-1:6),l(),g(t.isCompleted?7:-1)}}var Zn=class n extends Jn{constructor(t,o,i,d,x){super(t,o);this.toastr=i;this.ngZone=d;this.roleService=x;this.isFilterFilled=!1,this.filter={CategoryID:null,EntityID:null,ProductName:"",SupplierID:A.GuidEmpty,RowCount:500,PageNumber:1,TagID:null,StorageID:A.GuidEmpty},this.oldFilter={CategoryID:"dummy",EntityID:"dummy",ProductName:"dummy",SupplierID:"dummy",RowCount:500,PageNumber:1,TagID:null,StorageID:A.GuidEmpty},this.Items=[],this.initSubscriptionStatus()}stepper;isFilterFilled;currentStep="filter";Items;reviewedItems=[];displayedItems=[];note;isCompleted=!1;filter;oldFilter;currentSubStatus;subStatusEnum=ao;ngOnDestroy(){}initSubscriptionStatus(){this.currentSubStatus=parseInt(localStorage.getItem("SubscriptionStatus"))}onSelectStorageLocation(t){this.filter=R(j({},this.filter),{StorageID:t})}handleF8(){this.currentStep=="finish"&&this.newStockCount()}handleNextButton(){this.stepper&&this.ngZone.run(()=>{this.roleService.adjustment.Create&&(this.isFilterFilled?this.stepper.next():this.validateFilter())})}onReset(t,o){o.value==""&&this.clear(t)}handlePreviousButton(){this.stepper&&this.ngZone.run(()=>{this.stepper.previous()})}toggleIsFilterFilled(){this.isFilterFilled=!0}updateFilterStorage(t){this.filter=R(j({},this.filter),{StorageID:t})}onNextStep(t){if(t.selectedStep.label=="filter")this.currentStep="filter";else if(t.selectedStep.label=="input")this.currentStep="input",(this.oldFilter.CategoryID!=this.filter.CategoryID||this.oldFilter.EntityID!=this.filter.EntityID||this.filter.ProductName!=this.oldFilter.ProductName)&&(this.getProduct(this.filter),this.oldFilter=Object.assign({},this.filter));else if(t.selectedStep.label=="review"){this.products=this.originalProducts,this.currentStep="review";let o=0;this.products.forEach(i=>{i.Counted!==""&&i.Counted!=i.Quantity&&(i.Status=i.Counted>i.Quantity?"Over":"Under",o++)}),this.reviewedItems=this.products.filter(i=>i.Counted!==""),o&&!this.roleService.inventory.View&&this.toastr.warning("There are some items inventory that does not match! Click next to automatically adjust inventory.",Y.Warning)}else if(t.selectedStep.label=="finish"){this.products=this.originalProducts,this.currentStep="finish",this.Items=[],this.products.forEach(d=>{if(d.Counted!==""){let x={Name:d.ProductName,Cost:d.UnitCost,Price:d.UnitPrice,Quantity:d.Counted,OriginalQuantity:d.Quantity,VariantID:d.ID,Model:d.Model};this.Items.push(x)}});let o={Date:new Date,EntityID:this.filter.EntityID,Note:this.note,ID:this.adjustmentID||A.GuidEmpty,TagID:this.filter.TagID},i={Items:this.Items,Order:o,TypeID:2};this.displayedItems=this.Items.filter(d=>d.Quantity-d.OriginalQuantity!=0),this.submitAdjustment(i)}}validateFilter(){if(!this.isFilterFilled){this.toastr.error("Outlet is required",Y.Error);return}this.stepper.next()}clear(t){t.Counted=""}newStockCount(){window.location.reload()}beforeSubmit(){this.isCompleted=!0}onSubmiterror(){this.isCompleted=!1}sortData(t){let o=this.products.slice();if(!t.active||t.direction===""){this.products=this.originalProducts;return}this.products=o.sort((i,d)=>{let x=t.direction==="asc",b=typeof i[t.active];switch(A.IsEmpty(i.Code)&&(i.Code=""),A.IsEmpty(d.Code)&&(d.Code=""),b){case"string":return A.compare(i[t.active].toLocaleLowerCase(),d[t.active].toLocaleLowerCase(),x);case"number":return A.compare(i[t.active],d[t.active],x);default:return 0}})}filterProduct(){this.filter.PageNumber=1,this.getProduct(this.filter)}static \u0275fac=function(o){return new(o||n)(D(at),D(L),D(vt),D(bn),D(H))};static \u0275cmp=O({type:n,selectors:[["POS-spreadsheet-stock-take"]],viewQuery:function(o,i){if(o&1&&Gt(ns,5),o&2){let d;zt(d=Kt())&&(i.stepper=d.first)}},hostBindings:function(o,i){o&1&&_("keydown.F8",function(){return i.handleF8()},Wt)("keydown.ArrowRight",function(){return i.handleNextButton()},Wt)("keydown.ArrowLeft",function(){return i.handlePreviousButton()},Wt)},standalone:!1,features:[mt],decls:1,vars:1,consts:[["stepper",""],["outletFilter","ngModel"],["input",""],[3,"pageData","text","hideSearchBox","hideSearchDropdown"],[3,"textChange","onSubmit","pageData","text","hideSearchBox","hideSearchDropdown"],["matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success","ms-auto","me-0","d-block",3,"disabled"],[1,"mt-5","nb-button",3,"ngClass"],[3,"linear"],[1,"container-fluid","row","mt-5"],["matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success","ms-auto","me-0","d-block",3,"click","disabled"],["matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-2",3,"click"],["matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success",3,"click"],["matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-5",3,"click"],[3,"selectionChange","linear"],["label","filter",3,"completed"],["matStepLabel",""],[1,"row","px-5","w-50","mx-auto"],[1,"col-12"],[1,"row"],[1,"fw-normal","text-dark","m-0"],[1,"col-12","mt-3"],["dropdownPosition","bottom","placeholder","Choose an outlet","bindLabel","Name","bindValue","ID",3,"change","ngModelChange","items","ngModel","clearable"],["style","color: red",4,"ngIf"],[1,"col-12",2,"margin-top","25px"],[1,"text-body-secondary","h6"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear","placeholder","isInitializedCategoryLabel"],[1,"col-12","mt-3","mb-0"],["type","text","name","text","placeholder","Type the product name you want to adjust",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","gap-4","align-items-baseline","w-100"],[1,"fw-normal","text-dark","m-0","d-inline-block"],["bindLabel","Name","bindValue","ID","placeholder","Choose an adjustment tag",3,"ngModelChange","items","ngModel","clearable"],["endPoint","api/catalog/product/GetProductStorageOptions",1,"tree-select-as-filter",3,"selectedCategoryIDChange","showClear","placeholder","isInitializedCategoryLabel"],[1,"col-12",2,"margin-top","25px","padding-bottom","25px"],["rows","6","type","text","name","note",1,"form-control",3,"ngModelChange","ngModel"],["label","input"],[1,"container-fluid",2,"height","calc(100vh - 180px)","overflow","auto","padding","0 24px","padding-bottom","20px"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","30px"],["mat-sort-header","CategoryName",2,"width","175px"],["mat-sort-header","ProductName",2,"width","200px"],["mat-sort-header","Model",2,"width","100px"],["mat-sort-header","Code",2,"width","75px"],[2,"width","75px"],["api","Adjustment/GetSpreadsheetCount",3,"total","pageData"],["label","review"],[1,"container-fluid",2,"padding","0 24px"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom","w-100",2,"table-layout","fixed",3,"matSortChange"],[1,"thead-light"],["mat-sort-header","ProductName",2,"width","175px"],[2,"width","150px"],["label","finish"],[1,"alert"],[1,"fa-solid","fa-filter","me-3"],[2,"color","red"],[1,"fa-solid","fa-calculator","me-3"],[2,"word-break","break-word"],["target","_blank",2,"color","#0976b4 !important",3,"routerLink","queryParams"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","modifyValueOnWheel","ngModel"],[3,"bg-gradient-danger","bg-gradient-success"],[1,"text-center"],["matTooltipPosition","above","matTooltip","reset counter",1,"fa-solid","fa-delete-left","fa-2x","clear","align-middle"],[1,"fa-solid","fa-right-long"],["matTooltipPosition","above","matTooltip","reset counter",1,"fa-solid","fa-delete-left","fa-2x","clear","align-middle",3,"click"],["api","Adjustment/GetSpreadsheetCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"fa-solid","fa-user-check","me-3"],[3,"soft-yellow","soft-green"],[1,"fa-solid","fa-check","me-3"],[1,"fa-solid","fa-circle-exclamation","me-3"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px","border-bottom","1px solid rgba(0, 0, 0, 0.125)","background-color","rgba(203, 203, 210, 0.15) !important"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body"],[1,"row","justify-content-between"],[1,"col-6",2,"font-size","14px"],[1,"col-3",2,"font-size","14px"],[1,"row","justify-content-between","my-5"],[1,"row","justify-content-between","fw-bold"],[1,"col-6"],[1,"col-3"],[1,"col-3",3,"class"]],template:function(o,i){o&1&&C(0,Fs,8,9,"mainpanel-cmp",3),o&2&&g(i.loaderData?0:-1)},dependencies:[kn,Ut,ye,ct,lt,St,B,X,pt,te,Fn,Nn,Un,Qt,be,Qe,Re,Yt,G,He],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 Us=()=>["/menu/Products/Catalog/Products/Info"],Ls=n=>({ID:n});function Qs(n,e){if(n&1){let t=v();a(0,"button",13),_("click",function(){p(t);let i=m(2);return u(i.confirmAdjust())}),s(1,"Confirm Adjustment"),r()}}function Rs(n,e){if(n&1){let t=v();a(0,"div")(1,"div",14)(2,"h6"),s(3,"Outlets"),r(),a(4,"ng-select",15),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.EntityID,i)||(d.pageData.Filter.EntityID=i),u(i)}),r()()()}if(n&2){let t=m(2);l(4),c("items",t.pageData.Entities),M("ngModel",t.pageData.Filter.EntityID)}}function Bs(n,e){if(n&1){let t=v();a(0,"tr",12)(1,"td"),f(2,"a",16),r(),f(3,"td",17)(4,"td",17)(5,"td",17)(6,"td",18)(7,"td",18),a(8,"td",19)(9,"input",20),w("ngModelChange",function(i){let d=p(t).$implicit;return P(d.NewQuantity,i)||(d.NewQuantity=i),u(i)}),r()(),a(10,"td",19),s(11),y(12,"number"),r(),a(13,"td")(14,"a",21),_("click",function(){let i=p(t).$implicit,d=m(2);return u(d.confirmAdjust(i))}),s(15,"Adjust"),r()()()}if(n&2){let t=e.$implicit;l(2),c("routerLink",Z(12,Us))("queryParams",k(13,Ls,t.ProductID))("innerHTML",t.ProductName,q),l(),c("innerHTML",t.ParentCode,q),l(),c("innerHTML",t.Model,q),l(),c("innerHTML",t.ParentModel,q),l(),c("innerHTML",t.Ratio,q),l(),c("innerHTML",t.Inventory,q),l(2),M("ngModel",t.NewQuantity),l(2),I(" ",T(12,10,t.Inventory-t.NewQuantity*t.Ratio)," ")}}function Hs(n,e){if(n&1){let t=v();a(0,"mainpanel-cmp",2),_("onSubmit",function(){p(t);let i=m();return u(i.searchFromPageOne())}),w("filterChange",function(i){p(t);let d=m();return P(d.pageData.Filter,i)||(d.pageData.Filter=i),u(i)}),a(1,"actions"),C(2,Qs,2,0,"button",3),r(),a(3,"filters"),E(4,Rs,5,2,"ng-template",null,0,$),r(),a(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th"),s(13,"Product Name"),r(),a(14,"th",8),s(15,"Code"),r(),a(16,"th",8),s(17,"From"),r(),a(18,"th",8),s(19,"To"),r(),a(20,"th",9),s(21,"Ratio"),r(),a(22,"th",9),s(23,"Inventory"),r(),a(24,"th",10),s(25,"Convert Qty "),r(),a(26,"th",10),s(27,"Remaining"),r(),f(28,"th",11),r()(),a(29,"tbody"),N(30,Bs,16,15,"tr",12,et),r()()()()()()}if(n&2){let t=m();c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),M("filter",t.pageData.Filter),l(2),g(t.roleService.adjustment.Create?2:-1),l(28),F(t.Items)}}var Xn=class n extends bt{constructor(t,o,i,d,x){super(t,o,"Adjustment/GetAdjustToParentList","Outlet/GetByUserAccessWrite");this.toastr=i;this.router=d;this.roleService=x}Items;preGetList(){A.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=this.pageData.Entities[0].ID)}postInit(t){this.Items=t,this.Items.forEach(o=>o.NewQuantity=Math.floor(o.Inventory/o.Ratio))}confirmAdjust(t){let o=[],i=[];if(t?i.push(t):i=this.Items,i.forEach(x=>{let b={VariantID:x.ParentID,Quantity:x.NewQuantity,Cost:x.UnitCost*x.Ratio,Price:x.UnitPrice*x.Ratio};o.push(b),b={VariantID:x.ID,Quantity:x.NewQuantity*x.Ratio*-1,Cost:x.UnitCost,Price:x.UnitPrice},o.push(b)}),o.length<1)return alert("You must atleast have one item to adjust!"),!1;if(A.IsEmpty(this.pageData.Filter.EntityID))return alert("Outlet is require"),!1;let d={Order:{EntityID:this.pageData.Filter.EntityID},Items:o};this.httpService.post("/API/Adjustment/SubmitUseDefault",d).subscribe({next:x=>{x.Success?this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Info"],{queryParams:{ID:x.OrderID}}).then(()=>window.location.reload()):this.toastr.success(x.Message,Y.Success)},error:x=>{this.toastr.error(x,Y.Error)}})}static \u0275fac=function(o){return new(o||n)(D(at),D(L),D(vt),D(Lt),D(H))};static \u0275cmp=O({type:n,selectors:[["POS-convert-inventory"]],standalone:!1,features:[mt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-success"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","125px"],[1,"text-end",2,"width","125px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],[1,"border-bottom"],[1,"btn","btn-success",3,"click"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","appendTo","body",3,"ngModelChange","items","ngModel"],[3,"routerLink","queryParams","innerHTML"],[3,"innerHTML"],[1,"text-end",3,"innerHTML"],[1,"text-end"],["type","text","autoNum","",1,"text-end",3,"ngModelChange","ngModel"],[3,"click"]],template:function(o,i){o&1&&C(0,Hs,32,5,"mainpanel-cmp",1),o&2&&g(i.data?0:-1)},dependencies:[ct,lt,St,B,X,pt,Qt,G],encapsulation:2})};function Ws(n,e){if(n&1){let t=v();a(0,"button",12),_("click",function(){p(t);let i=m();return u(i.openExportModal())}),f(1,"i",13),s(2," Export "),r()}}function qs(n,e){if(n&1){let t=v();a(0,"td",10)(1,"input",16),w("ngModelChange",function(i){p(t);let d=m().$implicit;return P(d.Quantity,i)||(d.Quantity=i),u(i)}),r()()}if(n&2){let t=m().$implicit;l(),M("ngModel",t.Quantity)}}function Gs(n,e){if(n&1&&(a(0,"td",10),s(1),r()),n&2){let t=m().$implicit;l(),I(" ",t==null?null:t.Quantity," ")}}function zs(n,e){if(n&1){let t=v();a(0,"tr",14)(1,"td")(2,"i",15),_("click",function(){let i=p(t).$index,d=m(2);return u(d.products.splice(i,1))}),r()(),a(3,"td"),s(4),r(),a(5,"td",10),s(6),r(),C(7,qs,2,1,"td",10),C(8,Gs,2,1,"td",10),r()}if(n&2){let t=e.$implicit,o=m(2);l(4),S(t==null?null:t.Name),l(2),S(t==null?null:t.Code),l(),g(o.roleService.adjustment.InventoryProductCount?7:-1),l(),g(o.roleService.adjustment.InventoryProductCount?-1:8)}}function Ks(n,e){if(n&1&&N(0,zs,9,4,"tr",14,qt),n&2){let t=m();F(t.products)}}function $s(n,e){n&1&&(a(0,"tr")(1,"td",17),f(2,"app-empty-state"),r()())}var Yn=class n extends Mn{constructor(t,o,i,d,x){super(t);this.httpService=o;this.csvConverter=i;this.roleService=d;this.matDialog=x;this.products=[],this.menuData$.subscribe()}products;onBarcodeEnter(t){let o=this.products.findIndex(i=>i.Code===t);o!=-1?this.products[o].Quantity++:this.httpService.post("/API/catalog/product/ProductCountByCode",{code:t}).subscribe(i=>{i.Quantity=1,this.products.push(i)})}openExportModal(){var t={Products:this.products,Export:!0};this.matDialog.open(Rt,{data:{title:"Count Product Inventory",exportTypes:[{ID:"ProductExport/ProductCountInventory",Value:"Default",FileName:"Count Product Inventory"}],filterExport:t,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||n)(D(at),D(L),D(kt),D(H),D(it))};static \u0275cmp=O({type:n,selectors:[["POS-count-product-inventory"]],standalone:!1,features:[mt],decls:23,vars:7,consts:[[3,"barcodeQueryChange","pageData","hideSearchDropdown","hideSearchBox","showBarcodeScanner","autoFocusBarcodeScanInput"],[1,"btn","btn-outline-secondary","me-3"],[1,"container-fluid","mt-5"],[1,"cashier"],[1,"cart","big-cart","scan-cart"],[1,"content"],[1,"table"],["id","tableGrid",1,"cart","table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],["width","15px"],[1,"text-end"],[1,"text-end",2,"width","150px"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"border-bottom"],[1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],["type","text","autoNum","",1,"text-end","form-control",3,"ngModelChange","ngModel"],["colspan","4"]],template:function(o,i){o&1&&(a(0,"mainpanel-cmp",0),_("barcodeQueryChange",function(x){return i.onBarcodeEnter(x)}),a(1,"actions"),C(2,Ws,3,0,"button",1),r(),a(3,"content")(4,"div",2)(5,"section",3)(6,"main")(7,"section",4)(8,"div",5)(9,"div",6)(10,"table",7)(11,"thead",8)(12,"tr"),f(13,"th",9),a(14,"th"),s(15,"Name"),r(),a(16,"th",10),s(17,"Code"),r(),a(18,"th",11),s(19,"Qty"),r()()(),a(20,"tbody"),C(21,Ks,2,0)(22,$s,3,0,"tr"),r()()()()()()()()()()),o&2&&(c("pageData",i.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0)("showBarcodeScanner",!0)("autoFocusBarcodeScanInput",!0),l(2),g(i.roleService.global.Export?2:-1),l(19),g(i.products.length>0?21:22))},dependencies:[lt,St,B,X,Qt,Vn],styles:[".barcode_counter[_ngcontent-%COMP%]{position:fixed;right:10px;bottom:20px;background:#fff;border:1px solid #ddd;padding:8px 10px;border-radius:3px}.barcode_counter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border-radius:3px;border:1px solid #b7b7b7;background-repeat:no-repeat;background-position:5px -211px;padding:4px 5px 4px 35px}.barcode_counter[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{position:relative;left:35px;vertical-align:middle}.barcode_counter[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:5px;color:#868686;left:30px;position:relative;margin-left:-25px}"]})};function Js(n,e){if(n&1){let t=v();a(0,"button",14),_("click",function(){p(t);let i=m(2);return u(i.openExportModal())}),f(1,"i",15),s(2," Export"),r()}}function Zs(n,e){if(n&1){let t=v();a(0,"div")(1,"div",16)(2,"h6"),s(3,"Outlets"),r(),a(4,"ng-select",17),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.EntityID,i)||(d.pageData.Filter.EntityID=i),u(i)}),r(),a(5,"h6"),s(6,"Category"),r(),a(7,"POS-product-category-select",18),w("selectedCategoryIDChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.CategoryID,i)||(d.pageData.Filter.CategoryID=i),u(i)}),r(),a(8,"h6"),s(9,"Sort By"),r(),a(10,"ng-select",19),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.SortByid,i)||(d.pageData.Filter.SortByid=i),u(i)}),r()()()}if(n&2){let t=m(2);l(4),c("items",t.pageData.Options.Entities),M("ngModel",t.pageData.Filter.EntityID),l(3),M("selectedCategoryID",t.pageData.Filter.CategoryID),c("showClear",!0),l(3),c("items",t.pageData.Options.SortBy),M("ngModel",t.pageData.Filter.SortByid)}}function Xs(n,e){if(n&1&&(a(0,"span"),s(1),r()),n&2){let t=e.$implicit;l(),S(t+" ")}}function Ys(n,e){if(n&1&&(a(0,"tr")(1,"td"),s(2),r(),a(3,"td"),s(4),r(),a(5,"td",13),s(6),y(7,"number"),r(),a(8,"td",13),s(9),y(10,"number"),r(),a(11,"td",20),N(12,Xs,2,1,"span",null,et),r()()),n&2){let t=e.$implicit;l(2),S(t.ProductCode),l(2),S(t.ProductName),l(2),S(T(7,4,t.UnitPrice)),l(3),S(T(10,6,t.Qty)),l(3),F(t.Models)}}function td(n,e){if(n&1){let t=v();a(0,"mainpanel-cmp",2),_("onSubmit",function(){p(t);let i=m();return u(i.searchFromPageOne())}),w("filterChange",function(i){p(t);let d=m();return P(d.pageData.Filter,i)||(d.pageData.Filter=i),u(i)}),a(1,"actions"),C(2,Js,3,0,"button",3),r(),a(3,"filters"),E(4,Zs,11,6,"ng-template",null,0,$),r(),a(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),s(12,"Code"),r(),a(13,"th",8),s(14,"Name"),r(),a(15,"th",9),s(16,"UnitPrice"),r(),a(17,"th",10),s(18,"Qty"),r(),a(19,"th"),s(20,"Available Models"),r()()(),a(21,"tbody"),N(22,Ys,14,8,"tr",null,et),r(),a(24,"tfoot")(25,"tr",11),f(26,"td",12),a(27,"td",13),s(28),y(29,"sum"),y(30,"number"),r(),f(31,"td"),r()()()()()()}if(n&2){let t=m();c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),M("filter",t.pageData.Filter),l(2),g(t.roleService.global.Export?2:-1),l(20),F(t.data.Data),l(6),S(T(30,9,V(29,6,t.data.Data,"Qty")))}}var ti=class n extends bt{constructor(t,o,i,d,x){super(t,o,"catalog/product/GetOutletProductSheet","catalog/ProductLoader/GetOutletProductSheet");this.csvConverter=i;this.roleService=d;this.matDialog=x}openExportModal(){this.matDialog.open(Rt,{data:{title:"Product Sheet",exportTypes:[{ID:"ProductExport/GetOutletProductSheet",Value:"Default",FileName:"Product Sheet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||n)(D(at),D(L),D(kt),D(H),D(it))};static \u0275cmp=O({type:n,selectors:[["POS-product-sheet"]],standalone:!1,features:[mt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","70px"],[2,"width","260px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","100px"],[1,"table-footer"],["colspan","3"],[1,"text-end"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","placeholder","Choose an outlet","bindLabel","Name","bindValue","ID",3,"ngModelChange","items","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[2,"word-spacing","20px"]],template:function(o,i){o&1&&C(0,td,32,11,"mainpanel-cmp",1),o&2&&g(i.data?0:-1)},dependencies:[lt,B,X,pt,Yt,G,He],encapsulation:2})};var Sr=wi(ko());var z=class n{INITIAL_STATE={loadForm:{},outlet:{ID:A.GuidEmpty,Name:""},isOpenDialog:!0,isComplete:!1,adjustmentState:0,quickeyItems:{},cartItems:[],order:{Date:(0,Sr.default)().utcOffset("+07:00").format(),EntityID:"",ID:A.GuidEmpty,StateID:4,TypeID:1,Number:"",PIC:"",Note:"",TagID:0},orderComplete:{},NewOrderID:""};#t=tr(this.INITIAL_STATE);AppConfigJSON=this.#t.select(e=>e.loadForm().AppConfigJSON);LoadForm=this.#t.select(e=>e.loadForm());IsOpenDialog=this.#t.select(e=>e.isOpenDialog());Outlets=this.#t.select(e=>e.loadForm().Entities);Outlet=this.#t.select(e=>e.outlet());IsComplete=this.#t.select(e=>e.isComplete());QuickeyItems=this.#t.select(e=>e.quickeyItems());AdjustmentTypes=this.#t.select(e=>Array.isArray(e.loadForm().AdjustmentTypes)?e.loadForm().AdjustmentTypes.map(t=>R(j({},t),{Value:t.Value.replaceAll("Adjust Differences","Adjust").replaceAll("Update Inventory","Count")})):e.loadForm().AdjustmentTypes);CartItems=this.#t.select(e=>e.cartItems());QtyCartItems=this.#t.select(e=>e.cartItems().reduce((t,o)=>t+o.Quantity,0));Order=this.#t.select(e=>e.order());OrderComplete=this.#t.select(e=>e.orderComplete());AdjustmentState=this.#t.select(e=>e.adjustmentState());SubTotal=this.#t.select(e=>e.cartItems().reduce((t,o)=>t+o.Price*o.Quantity,0));NewOrderID=this.#t.select(e=>e.NewOrderID());constructor(){switch(this.AdjustmentState()){case 0:this.onChangeIsOpenDialog(!0);break;case 1:this.onChangeIsOpenDialog(!1);break;case 2:this.onChangeIsOpenDialog(!1);break}}onChangeLoadform(e){this.#t.update("loadForm",e)}onChangeIsOpenDialog(e){this.#t.update("isOpenDialog",e)}onChangeOutlet(e){this.#t.update("outlet",e)}onChangeAdjustmentState(e){this.#t.update("adjustmentState",e)}onChangeQuickeyItems(e){this.#t.update("quickeyItems",e)}onChangeCartItems(e){this.#t.update("cartItems",e)}onChangeIsComplete(){this.#t.update("isComplete",!this.IsComplete())}onChangeAdjustmentOrder(e){this.#t.update("order",e)}onChangeOrderComplete(e){this.#t.update("orderComplete",e)}onChangeNewOrderID(e){this.#t.update("NewOrderID",e)}onResetState(){this.#t.reset()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ui=class{ID;VariantID;Quantity;Cost;Price;Expense;Discount;DiscountAmount;Note;Taxable;LoyaltyPoint;EntityID;UnitQuantity;VariantUnitQuantity;InventoryTypeID;Variant;SalesID;UnitCost;UnitPrice;SplitQuantity;isMaxInventory;PromotionGift;constructor(e,t,o,i,d,x,b,nt,rt,st,Dt,Vt,ie,oe,re,ae,le,se,de,me,ce,pe){this.ID=e,this.VariantID=t,this.Quantity=o,this.Cost=i,this.Price=d,this.Expense=x,this.Discount=b,this.DiscountAmount=nt,this.Note=rt,this.Taxable=st,this.LoyaltyPoint=Dt,this.EntityID=Vt,this.UnitQuantity=ie,this.VariantUnitQuantity=oe,this.InventoryTypeID=re,this.Variant=ae,this.SalesID=le,this.UnitCost=se,this.UnitPrice=de,this.SplitQuantity=me,this.isMaxInventory=ce,this.PromotionGift=pe}},ei=class n{adapt(e){return new Ui(e.ID??null,e.VariantID??null,e.Quantity??null,e.Cost??null,e.Price??null,e.Expense??null,e.Discount??null,e.DiscountAmount??null,e.Note??null,e.Taxable??null,e.LoyaltyPoint??null,e.EntityID??null,e.UnitQuantity??null,e.VariantUnitQuantity??null,e.InventoryTypeID??null,e.Variant??null,e.SalesID??null,e.UnitCost??null,e.UnitPrice??null,e.SplitQuantity??null,e.isMaxInventory??null,e.PromotionGift??null)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})},Li=class{constructor(e,t,o,i,d,x,b,nt,rt,st,Dt,Vt,ie,oe,re,ae,le,se,de,me,ce,pe,en,nn,on,rn,an,ln,sn,dn,mn){this.ID=e,this.Name=t,this.Code=o,this.UnitCost=i,this.UnitPrice=d,this.UnitExpense=x,this.UnitQuantity=b,this.PriceDiscount=nt,this.UnitPriceOriginal=rt,this.Description=st,this.UOM=Dt,this.UOMName=Vt,this.ImageUrl=ie,this.TypeID=oe,this.SellPriceType=re,this.OnHand=ae,this.Ordered=le,this.OrderPrice=se,this.OrderPriceDiscount=de,this.Taxable=me,this.LoyaltyPoint=ce,this.CategoryName=pe,this.CategoryID=en,this.CategoryTypeID=nn,this.PriceNote=on,this.PaymentTypeID=rn,this.ThumbnailUrl=an,this.Storage=ln,this.Component=sn,this.PriceBook=dn,this.VariantUnitQuantity=mn}ID;Name;Code;UnitCost;UnitPrice;UnitExpense;UnitQuantity;PriceDiscount;UnitPriceOriginal;Description;UOM;UOMName;ImageUrl;TypeID;SellPriceType;OnHand;Ordered;OrderPrice;OrderPriceDiscount;Taxable;LoyaltyPoint;CategoryName;CategoryID;CategoryTypeID;PriceNote;PaymentTypeID;ThumbnailUrl;Storage;Component;PriceBook;VariantUnitQuantity},ni=class n{adapt(e){return new Li(e.ID??null,e.Name??null,e.Code??null,e.UnitCost??null,e.UnitPrice??null,e.UnitExpense??null,e.UnitQuantity??null,e.PriceDiscount??null,e.UnitPriceOriginal??null,e.Description??null,e.UOM??null,e.UOMName??null,e.ImageUrl??null,e.TypeID??null,e.SellPriceType??null,e.OnHand??null,e.Ordered??null,e.OrderPrice??null,e.OrderPriceDiscount??null,e.Taxable??null,e.LoyaltyPoint??null,e.CategoryName??null,e.CategoryID??null,e.CategoryTypeID??null,e.PriceNote??null,e.PaymentTypeID??null,e.ThumbnailUrl??null,e.Storage??null,e.Component??null,e.PriceBook??null,e.VariantUnitQuantity??null)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})};var ii=class n{adapt(e){return{ID:e.ID,VariantID:e.VariantID,Quantity:e.Quantity,Cost:e.Cost,Price:e.Price,Expense:e.Expense,Discount:e.Discount,DiscountAmount:e.DiscountAmount,Note:e.Note,Taxable:e.Taxable,Serial:e.Serial,LoyaltyPoint:e.LoyaltyPoint,EntityID:e.EntityID,UnitQuantity:e.UnitQuantity,VariantUnitQuantity:e.VariantUnitQuantity,InventoryTypeID:e.InventoryTypeID,Variant:e.Variant,SalesID:e.SalesID,UnitCost:e.UnitCost,UnitPrice:e.UnitPrice,SplitQuantity:e.SplitQuantity,isMaxInventory:e.IsMaxInventory,PromotionGift:e.PromotionGift}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})},oi=class n{adapt(e){return{ID:e.ID,Name:e.Name,Code:e.Code,UnitCost:e.UnitCost,UnitPrice:e.UnitPrice,UnitExpense:e.UnitExpense,UnitQuantity:e.UnitQuantity,PriceDiscount:e.PriceDiscount,UnitPriceOriginal:e.UnitPriceOriginal,Description:e.Description,UOM:e.UOM,UOMName:e.UOMName,ImageUrl:e.ImageUrl,TypeID:e.TypeID,SellPriceType:e.SellPriceType,OnHand:e.OnHand,Ordered:e.Ordered,OrderPrice:e.OrderPrice,OrderPriceDiscount:e.OrderPriceDiscount,Taxable:e.OrderPriceDiscount,LoyaltyPoint:e.LoyaltyPoint,CategoryName:e.CategoryName,CategoryID:e.CategoryID,CategoryTypeID:e.CategoryTypeID,PriceNote:e.PriceNote,PaymentTypeID:e.PaymentTypeID,ThumbnailUrl:e.ThumbnailUrl,Storage:e.Storage,Component:e.Component,PriceBook:e.PriceBook,VariantUnitQuantity:e.VariantUnitQuantity}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})},br=class n{adapt(e){return{Number:e.Number,Quantity:e.Quantity,ExpiryDate:e.ExpiryDate}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})};var Bt=class n{destroy$=new ht;#t=h(z);#e=h(L);#n=h(ei);#i=h(ni);#o=h(yt);#r=h(ii);#a=h(oi);constructor(){}processOrder(){let e=[...this.#t.CartItems()].map(t=>R(j({},this.#r.adapt(t)),{EntityID:A.GuidEmpty,Note:t.Note??"",SalesID:t.SalesID??"",isMaxInventory:!1,PromotionGift:!1,SplitQuantity:0,UnitCost:t.Cost,Cost:t.Cost,Variant:R(j({},this.#a.adapt(t.Variant)),{Taxable:!!t.Variant.Taxable})}));if(this.#t.AdjustmentState()===0){let t={Items:[...e],Order:{Date:this.#t.Order().Date,EntityID:this.#t.Outlet().ID,ID:A.GuidEmpty,Number:this.#t.Order().Number,StateID:this.#t.Order().StateID,TypeID:this.#t.Order().TypeID,Note:this.#t.Order().Note,PIC:this.#t.Order().PIC,TagID:this.#t.Order().TagID},NewOrderID:this.#t.NewOrderID()};return this.#e.post(wt.SubmitAdjustment,t).pipe(Tt(this.destroy$))}if(this.#t.AdjustmentState()===1){let t=R(j({},this.#t.LoadForm().Data),{Order:R(j({},this.#t.LoadForm().Data.Order),{Note:this.#t.Order().Note,PIC:this.#t.Order().PIC,TagID:this.#t.Order().TagID,Number:this.#t.Order().Number||this.#t.LoadForm().Data.Order.Number,StateID:this.#t.Order().StateID,Date:this.#t.Order().Date||this.#t.LoadForm().Data.Order.Date}),Items:[...e]});return this.#e.post(wt.SubmitAdjustment,t).pipe(Tt(this.destroy$))}}onUpdateOrderState(e,t){if(Object.keys(this.#t.Order()).includes(e)){let i=R(j({},this.#t.Order()),{[e]:t});this.#t.onChangeAdjustmentOrder(i)}else console.error(`Error updating order state with key ${e}`)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ye=class n{destroy$=new ht;#t=h(L);#e=h(z);#n=h(yt);orderService=h(Bt);getLoadForm$=this.#t.post("/API/Adjustment/LoadForm",{EntityID:A.GuidEmpty,ID:A.GuidEmpty}).pipe(Ue(),Q(e=>{this.#e.onChangeLoadform(e)}));constructor(){}httpRequestLoadForm$(e){return Pt(this.#e.IsComplete,{injector:this.#n}).pipe(Tt(this.destroy$),dt(t=>!t),ot(t=>this.#t.post("/API/Adjustment/LoadForm",j({EntityID:"00000000-0000-0000-0000-000000000000",ID:"00000000-0000-0000-0000-000000000000"},e))),Q(t=>{this.#e.onChangeLoadform(t),this.orderService.onUpdateOrderState("TypeID",t.AppConfigJSON.ModuleAdjustment.Advance.AdjustmentInputType)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})};var ri=class n{destroy$=new ht;#t=h(z);#e=h(L);#n=h(Bt);#i=h(yt);constructor(){this.initialize()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initialize(){Ki([Pt(this.#t.Outlet,{injector:this.#i}),Pt(this.#t.AdjustmentState,{injector:this.#i}),Pt(this.#t.IsComplete,{injector:this.#i})]).pipe(Ue(),dt(([e,t,o])=>A.IsNotEmpty(e.ID)&&!o),ot(([e,t])=>this.handleStateChange(e,t))).subscribe()}handleStateChange(e,t){switch(t){case 0:return this.handleStateZero(e);case 1:return this.handleStateOne(e);default:return fn}}handleStateZero(e){return this.#e.get(`/api/AdjustmentLoader/LoadRegister?EntityID=${e.ID}&IsEdit=false`).pipe(Tt(this.destroy$),Q(t=>{this.#t.onChangeQuickeyItems(t.QuickKey),this.#n.onUpdateOrderState("Number",t.Number),this.#t.onChangeNewOrderID(t.NewOrderID)}))}handleStateOne(e){return this.getQuickey(e.ID).pipe(Tt(this.destroy$),Q(t=>{this.#t.onChangeQuickeyItems(t)}))}getQuickey(e){return this.#e.get(wt.GetQuickKeyByEntityID,[{key:"ID",value:e}])}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})};var Qi=class{get Variant(){return this._Variant}set Variant(e){this._Variant=e}get QtyRequested(){return this._QtyRequested}set QtyRequested(e){this._QtyRequested=e}get TotalPrice(){return this._TotalPrice}set TotalPrice(e){this._TotalPrice=e}get SalesName(){return this._SalesName}set SalesName(e){this._SalesName=e}get PriceNote(){return this._PriceNote}set PriceNote(e){this._PriceNote=e}get SalesID(){return this._SalesID}set SalesID(e){this._SalesID=e}get InventoryTypeID(){return this._InventoryTypeID}set InventoryTypeID(e){this._InventoryTypeID=e}get ID(){return this._ID}set ID(e){this._ID=e}get Code(){return this._Code}set Code(e){this._Code=e}get VariantID(){return this._VariantID}set VariantID(e){this._VariantID=e}get Quantity(){return this._Quantity}set Quantity(e){this._Quantity=e}get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(e){this._UnitQuantity=e}get Expense(){return this._Expense}set Expense(e){this._Expense=e}get Cost(){return this._Cost}set Cost(e){this._Cost=e}get Price(){return this._Price}set Price(e){this._Price=e}get Discount(){return this._Discount}set Discount(e){this._Discount=e}get Note(){return this._Note}set Note(e){this._Note=e}get Taxable(){return this._Taxable}set Taxable(e){this._Taxable=e}get LoyaltyPoint(){return this._LoyaltyPoint}set LoyaltyPoint(e){this._LoyaltyPoint=e}get UnitPriceOriginal(){return this._UnitPriceOriginal}set UnitPriceOriginal(e){this._UnitPriceOriginal=e}get DiscountAmount(){return this._DiscountAmount}set DiscountAmount(e){this._DiscountAmount=e}get Name(){return this._Name}set Name(e){this._Name=e}get PriceTypeID(){return this._PriceTypeID}set PriceTypeID(e){this._PriceTypeID=e}get Storage(){return this._Storage}set Storage(e){this._Storage=e}get Serial(){return this._Serial}set Serial(e){this._Serial=e}get ThumbnailUrl(){return this._ThumbnailUrl}set ThumbnailUrl(e){this._ThumbnailUrl=e}get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}get TypeID(){return this._TypeID}set TypeID(e){this._TypeID=e}get VariantUnitQuantity(){return this._VariantUnitQuantity}set VariantUnitQuantity(e){this._VariantUnitQuantity=e}get UOM(){return this._UOM}set UOM(e){this._UOM=e}get UOMName(){return this._UOMName}set UOMName(e){this._UOMName=e}get SalesCommission(){return this._SalesCommission}set SalesCommission(e){this._SalesCommission=e}_Variant;_QtyRequested;_TotalPrice;_SalesName;_PriceNote;_SalesID;_InventoryTypeID;_ID;_Code;_VariantID;_Quantity;_UnitQuantity;_Expense;_Cost;_Price;_Discount;_Note;_Taxable;_LoyaltyPoint;_UnitPriceOriginal;_DiscountAmount;_Name;_PriceTypeID;_Storage;_Serial;_ThumbnailUrl;_UnitPrice;_TypeID;_VariantUnitQuantity;_UOM;_UOMName;_SalesCommission;constructor(e,t,o,i,d,x,b,nt,rt,st,Dt,Vt,ie,oe,re,ae,le,se,de,me,ce,pe,en,nn,on,rn,an,ln,sn,dn,mn,Pi){this._Variant=e,this._QtyRequested=t,this._TotalPrice=o,this._SalesName=i,this._PriceNote=d,this._SalesID=x,this._InventoryTypeID=b,this._ID=nt,this._Code=rt,this._VariantID=st,this._Quantity=Dt,this._UnitQuantity=Vt,this._Expense=ie,this._Cost=oe,this._Price=re,this._Discount=ae,this._Note=le,this._Taxable=se,this._LoyaltyPoint=de,this._UnitPriceOriginal=me,this._DiscountAmount=ce,this._Name=pe,this._PriceTypeID=en,this._Storage=nn,this._Serial=on,this._ThumbnailUrl=rn,this._UnitPrice=an,this._TypeID=ln,this._VariantUnitQuantity=sn,this._UOM=dn,this._UOMName=mn,this._SalesCommission=Pi}toJSON(){return{Variant:this.Variant,QtyRequested:this.QtyRequested,TotalPrice:this.TotalPrice,SalesName:this.SalesName,PriceNote:this.PriceNote,SalesID:this.SalesID,InventoryTypeID:this.InventoryTypeID,ID:this.ID,Code:this.Code,VariantID:this.VariantID,Quantity:this.Quantity,UnitQuantity:this.UnitQuantity,Expense:this.Expense,Cost:this.Cost,Price:this.Price,Discount:this.Discount,Note:this.Note,Taxable:this.Taxable,LoyaltyPoint:this.LoyaltyPoint,UnitPriceOriginal:this.UnitPriceOriginal,DiscountAmount:this.DiscountAmount,Name:this.Name,PriceTypeID:this.PriceTypeID,Storage:this.Storage,Serial:this.Serial,ThumbnailUrl:this.ThumbnailUrl,UnitPrice:this.UnitPrice,TypeID:this.TypeID,VariantUnitQuantity:this.VariantUnitQuantity,UOM:this.UOM,UOMName:this.UOMName,SalesCommission:this.SalesCommission}}},Ri=class{get OnHand(){return this._OnHand}set OnHand(e){this._OnHand=e}get CategoryName(){return this._CategoryName}set CategoryName(e){this._CategoryName=e}get CategoryTypeID(){return this._CategoryTypeID}set CategoryTypeID(e){this._CategoryTypeID=e}get PriceTypeID(){return this._PriceTypeID}set PriceTypeID(e){this._PriceTypeID=e}get PriceNote(){return this._PriceNote}set PriceNote(e){this._PriceNote=e}get UnitPriceOriginal(){return this._UnitPriceOriginal}set UnitPriceOriginal(e){this._UnitPriceOriginal=e}get Ordered(){return this._Ordered}set Ordered(e){this._Ordered=e}get BrandName(){return this._BrandName}set BrandName(e){this._BrandName=e}get ImageUrl(){return this._ImageUrl}set ImageUrl(e){this._ImageUrl=e}get ThumbnailUrl(){return this._ThumbnailUrl}set ThumbnailUrl(e){this._ThumbnailUrl=e}get Component(){return this._Component}set Component(e){this._Component=e}get PriceBook(){return this._PriceBook}set PriceBook(e){this._PriceBook=e}get UOMName(){return this._UOMName}set UOMName(e){this._UOMName=e}get Storage(){return this._Storage}set Storage(e){this._Storage=e}get CategoryID(){return this._CategoryID}set CategoryID(e){this._CategoryID=e}get DiscountAmount(){return this._DiscountAmount}set DiscountAmount(e){this._DiscountAmount=e}get VariantUnitQuantity(){return this._VariantUnitQuantity}set VariantUnitQuantity(e){this._VariantUnitQuantity=e}get ProductCreated(){return this._ProductCreated}set ProductCreated(e){this._ProductCreated=e}get ProductID(){return this._ProductID}set ProductID(e){this._ProductID=e}get ProductIndex(){return this._ProductIndex}set ProductIndex(e){this._ProductIndex=e}get Code(){return this._Code}set Code(e){this._Code=e}get TypeID(){return this._TypeID}set TypeID(e){this._TypeID=e}get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(e){this._UnitQuantity=e}get SalesCommission(){return this._SalesCommission}set SalesCommission(e){this._SalesCommission=e}get Description(){return this._Description}set Description(e){this._Description=e}get Image(){return this._Image}set Image(e){this._Image=e}get Discontinued(){return this._Discontinued}set Discontinued(e){this._Discontinued=e}get Taxable(){return this._Taxable}set Taxable(e){this._Taxable=e}get LoyaltyPoint(){return this._LoyaltyPoint}set LoyaltyPoint(e){this._LoyaltyPoint=e}get PackSize(){return this._PackSize}set PackSize(e){this._PackSize=e}get CreatorId(){return this._CreatorId}set CreatorId(e){this._CreatorId=e}get Created(){return this._Created}set Created(e){this._Created=e}get UnitExpense(){return this._UnitExpense}set UnitExpense(e){this._UnitExpense=e}get SellPriceType(){return this._SellPriceType}set SellPriceType(e){this._SellPriceType=e}get VariantType(){return this._VariantType}set VariantType(e){this._VariantType=e}get CostCurrencyID(){return this._CostCurrencyID}set CostCurrencyID(e){this._CostCurrencyID=e}get UnitCost(){return this._UnitCost}set UnitCost(e){this._UnitCost=e}get OrderPrice(){return this._OrderPrice}set OrderPrice(e){this._OrderPrice=e}get OrderPriceDiscount(){return this._OrderPriceDiscount}set OrderPriceDiscount(e){this._OrderPriceDiscount=e}get OrderPriceDiscountDetail(){return this._OrderPriceDiscountDetail}set OrderPriceDiscountDetail(e){this._OrderPriceDiscountDetail=e}get PriceCurrencyID(){return this._PriceCurrencyID}set PriceCurrencyID(e){this._PriceCurrencyID=e}get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}get PriceDiscount(){return this._PriceDiscount}set PriceDiscount(e){this._PriceDiscount=e}get PaymentTypeID(){return this._PaymentTypeID}set PaymentTypeID(e){this._PaymentTypeID=e}get PaymentTypeString(){return this._PaymentTypeString}set PaymentTypeString(e){this._PaymentTypeString=e}get SellPriceTypeString(){return this._SellPriceTypeString}set SellPriceTypeString(e){this._SellPriceTypeString=e}get Weight(){return this._Weight}set Weight(e){this._Weight=e}get CostCurrencySymbol(){return this._CostCurrencySymbol}set CostCurrencySymbol(e){this._CostCurrencySymbol=e}get PriceCurrencySymbol(){return this._PriceCurrencySymbol}set PriceCurrencySymbol(e){this._PriceCurrencySymbol=e}get UOM(){return this._UOM}set UOM(e){this._UOM=e}get MeasurementID(){return this._MeasurementID}set MeasurementID(e){this._MeasurementID=e}get UOMQ(){return this._UOMQ}set UOMQ(e){this._UOMQ=e}get Name(){return this._Name}set Name(e){this._Name=e}get Model(){return this._Model}set Model(e){this._Model=e}get ID(){return this._ID}set ID(e){this._ID=e}_OnHand;_CategoryName;_CategoryTypeID;_PriceTypeID;_PriceNote;_UnitPriceOriginal;_Ordered;_BrandName;_ImageUrl;_ThumbnailUrl;_Component;_PriceBook;_UOMName;_Storage;_CategoryID;_DiscountAmount;_VariantUnitQuantity;_ProductCreated;_ProductID;_ProductIndex;_Code;_TypeID;_UnitQuantity;_SalesCommission;_Description;_Image;_Discontinued;_Taxable;_LoyaltyPoint;_PackSize;_CreatorId;_Created;_UnitExpense;_SellPriceType;_VariantType;_CostCurrencyID;_UnitCost;_OrderPrice;_OrderPriceDiscount;_OrderPriceDiscountDetail;_PriceCurrencyID;_UnitPrice;_PriceDiscount;_PaymentTypeID;_PaymentTypeString;_SellPriceTypeString;_Weight;_CostCurrencySymbol;_PriceCurrencySymbol;_UOM;_MeasurementID;_UOMQ;_Name;_Model;_ID;constructor(e,t,o,i,d,x,b,nt,rt,st,Dt,Vt,ie,oe,re,ae,le,se,de,me,ce,pe,en,nn,on,rn,an,ln,sn,dn,mn,Pi,Or,Ar,jr,kr,Vr,Nr,Fr,Ur,Lr,Qr,Rr,Br,Hr,Wr,qr,Gr,zr,Kr,$r,Jr,Zr,Xr,Yr){this._OnHand=e,this._CategoryName=t,this._CategoryTypeID=o,this._PriceTypeID=i,this._PriceNote=d,this._UnitPriceOriginal=x,this._Ordered=b,this._BrandName=nt,this._ImageUrl=rt,this._ThumbnailUrl=st,this._Component=Dt,this._PriceBook=Vt,this._UOMName=ie,this._Storage=oe,this._CategoryID=re,this._DiscountAmount=ae,this._VariantUnitQuantity=le,this._ProductCreated=se,this._ProductID=de,this._ProductIndex=me,this._Code=ce,this._TypeID=pe,this._UnitQuantity=en,this._SalesCommission=nn,this._Description=on,this._Image=rn,this._Discontinued=an,this._Taxable=ln,this._LoyaltyPoint=sn,this._PackSize=dn,this._CreatorId=mn,this._Created=Pi,this._UnitExpense=Or,this._SellPriceType=Ar,this._VariantType=jr,this._CostCurrencyID=kr,this._UnitCost=Vr,this._OrderPrice=Nr,this._OrderPriceDiscount=Fr,this._OrderPriceDiscountDetail=Ur,this._PriceCurrencyID=Lr,this._UnitPrice=Qr,this._PriceDiscount=Rr,this._PaymentTypeID=Br,this._PaymentTypeString=Hr,this._SellPriceTypeString=Wr,this._Weight=qr,this._CostCurrencySymbol=Gr,this._PriceCurrencySymbol=zr,this._UOM=Kr,this._MeasurementID=$r,this._UOMQ=Jr,this._Name=Zr,this._Model=Xr,this._ID=Yr}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}}},ne=class n{adapt(e){return new Qi(e.Variant??null,e.QtyRequested??null,e.TotalPrice??null,e.SalesName??null,e.PriceNote??null,e.SalesID??null,e.InventoryTypeID??null,e.ID??null,e.Code??null,e.VariantID??null,e.Quantity??null,e.UnitQuantity??null,e.Expense??null,e.Cost??null,e.Price??null,e.Discount??null,e.Note??null,e.Taxable??null,e.LoyaltyPoint??null,e.UnitPriceOriginal??null,e.DiscountAmount??null,e.Name??null,e.PriceTypeID??null,e.Storage??null,e.Serial??null,e.ThumbnailUrl??null,e.UnitPrice??null,e.TypeID??null,e.VariantUnitQuantity??null,e.UOM??null,e.UOMName??null,e.SalesCommission??null).toJSON()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})},tn=class n{adapt(e){return new Ri(e.OnHand??null,e.CategoryName??null,e.CategoryTypeID??null,e.PriceTypeID??null,e.PriceNote??null,e.UnitPriceOriginal??null,e.Ordered??null,e.BrandName??null,e.ImageUrl??null,e.ThumbnailUrl??null,e.Component??null,e.PriceBook??null,e.UOMName??null,e.Storage??null,e.CategoryID??null,e.DiscountAmount??null,e.VariantUnitQuantity??null,e.ProductCreated??null,e.ProductID??null,e.ProductIndex??null,e.Code??null,e.TypeID??null,e.UnitQuantity??null,e.SalesCommission??null,e.Description??null,e.Image??null,e.Discontinued??null,e.Taxable??null,e.LoyaltyPoint??null,e.PackSize??null,e.CreatorId??null,e.Created??null,e.UnitExpense??null,e.SellPriceType??null,e.VariantType??null,e.CostCurrencyID??null,e.UnitCost??null,e.OrderPrice??null,e.OrderPriceDiscount??null,e.OrderPriceDiscountDetail??null,e.PriceCurrencyID??null,e.UnitPrice??null,e.PriceDiscount??null,e.PaymentTypeID??null,e.PaymentTypeString??null,e.SellPriceTypeString??null,e.Weight??null,e.CostCurrencySymbol??null,e.PriceCurrencySymbol??null,e.UOM??null,e.MeasurementID??null,e.UOMQ??null,e.Name??null,e.Model??null,e.ID??null).toJSON()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})};var ed=n=>({selected:n});function nd(n,e){if(n&1){let t=v();a(0,"button",9),_("click",function(){let i=p(t).$implicit,d=m();return u(d.onTabChange(i.value))}),s(1),r()}if(n&2){let t=e.$implicit;ft(t.class),c("ngClass",k(4,ed,t.active)),l(),I(" ",t.label," ")}}function id(n,e){n&1&&(a(0,"div",10)(1,"strong",11),s(2,"PIC"),r(),f(3,"input",12),r(),a(4,"div",10)(5,"strong",13),s(6,"Note"),r(),f(7,"POS-tinymce-editor",14),r())}function od(n,e){if(n&1){let t=v();a(0,"div",15),f(1,"input",16,0),a(3,"button",17),_("click",function(){p(t);let i=J(2);return u(i.click())}),s(4),r()()}if(n&2){let t=e.$implicit,o=m(2);l(),c("id",Pe("tag-",t.ID))("value",t.ID),l(2),Nt("active",o.form.get("TagID").value===t.ID),l(),I(" ",t.Name," ")}}function rd(n,e){if(n&1&&(a(0,"div",7),N(1,od,5,6,"div",15,qt),r()),n&2){let t=m();l(),F(t.storeService.LoadForm().AdjustmentTags)}}var ai=class n{modalConfig;storeService=h(z);#t=h(Fe);#e=h(_t);form;tabs=K([]);activeTab=he(()=>this.tabs().find(e=>e.active));constructor(){this.modalConfig=new Ct,this.modalConfig.customWidth="600px",this.modalConfig.title="Adjustment Note",this.modalConfig.disableKeyup=!0}generateForm(){this.form=this.#t.group({PIC:[this.storeService.Order().PIC||""],Note:[this.storeService.Order().Note||""],TagID:new ve(this.storeService.Order().TagID||this.storeService.LoadForm().AdjustmentTags[0].ID)})}onOK(){let e=this.form.value;this.#e.close(e)}onCancel(){this.#e.close()}ngOnInit(){this.generateForm(),this.tabs.set([{label:"Note",value:"note",active:!0,class:"note-tab"},{label:"Tag",value:"tag",active:!1,class:"tag-tab"}])}handleKeyDown(e){console.log("event",e),e.code==="F2"&&this.onOK()}onTabChange(e){this.tabs.update(t=>t.map(o=>R(j({},o),{active:o.value===e})))}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["POS-modal-cart-note"]],hostBindings:function(t,o){t&1&&_("keydown",function(d){return o.handleKeyDown(d)},Wt)},decls:12,vars:4,consts:[["tagInput",""],[3,"onOk","onCancel","onClose","config"],[2,"min-height","400px"],[1,"container-fluid"],[1,"row","border-bottom"],[1,"btn","btn-link",3,"class","ngClass"],[1,"w-100","h-100","d-flex","flex-column","gap-4","my-6",3,"formGroup"],[1,"d-flex","flex-wrap","gap-3","mt-3"],[1,"w-100","h-100","d-flex","flex-column","gap-4",3,"formGroup"],[1,"btn","btn-link",3,"click","ngClass"],[1,"w-100"],[1,"mt-3","mb-3"],["type","text","formControlName","PIC",1,"form-control","w-100","height-input"],[1,"mb-3"],["formControlName","Note"],[1,""],["type","radio","formControlName","TagID","name","TagID",1,"d-none",3,"value","id"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(t,o){if(t&1&&(a(0,"modal-material",1),_("onOk",function(){return o.onOK()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),a(1,"content")(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),N(6,nd,2,6,"button",5,qt),r()()(),a(8,"div",6),C(9,id,8,0)(10,rd,3,0,"div",7),r(),f(11,"div",8),r()()()),t&2){let i;c("config",o.modalConfig),l(6),F(o.tabs()),l(2),c("formGroup",o.form),l(),g((i=o.activeTab().value)==="note"?9:i==="tag"?10:-1),l(2),c("formGroup",o.form)}},dependencies:[ut,gt,Jt,St,so,B,ke,Se,Ve,Ne,xt,Ut,Ie,Ke],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}a.btn.btn-link.note-tab[_ngcontent-%COMP%]{color:inherit}.active[_ngcontent-%COMP%]{background:#dcdcdc;border:1px solid #dcdcdc}"]})};var li=class n{modalConfig;#t=h(_t);constructor(){this.modalConfig=new Ct,this.modalConfig.customWidth="400px",this.modalConfig.title="Void Transaction?"}onOK(){this.#t.close({type:"OK",data:null})}onCancel(){this.#t.close({type:"Cancel",data:null})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["POS-modal-cart-void"]],decls:5,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"fw-normal"]],template:function(t,o){t&1&&(a(0,"modal-material",0),_("onOk",function(){return o.onOK()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),a(1,"content")(2,"div",1)(3,"h4",2),s(4,"This will erase all current data. Are you sure?"),r()()()()),t&2&&c("config",o.modalConfig)},dependencies:[ut,gt],encapsulation:2})};var It=class n{variantSearchCTRL=new ve({});#t=h(z);#e=h(L);#n=h(yt);#i=h(ne);#o=h(it);#r=h(tn);destroy$=new ht;toastr=h(vt);httpGetVariantByID(e,t=!0){let o={entityID:this.#t.Outlet().ID,id:e};return this.#e.post("/API/catalog/variant/GetVariantByID",o).pipe(Ot(i=>this.generateCartItem(i)),Q(i=>{t&&this.onAddCartItem(i)}))}httpRequestVariantByCode(e){let{Digit:t,QuantityDivider:o,Regex:i}=this.#t.LoadForm().AppConfigJSON.ModuleAdjustment.DigitalScale;if(e.length===t){let x=new RegExp(i).exec(e);if(Object.is(x,null))return this.#e.get(`${wt.GetVariantByCode}?Code=${e}&EntityID=${this.#t.Outlet().ID}`).pipe(Ot(b=>this.generateCartItem(b)),Q(b=>{this.onAddCartItem(b)}));{console.log(x,"decodedRegex");let b=x[1],nt=parseFloat(x[2]);return nt=nt/o||1,this.#e.get(`${wt.GetVariantByCode}?Code=${b}&EntityID=${this.#t.Outlet().ID}`).pipe(Ot(rt=>this.generateCartItem(rt)),Q(rt=>{this.onAddCartItem(rt,!1,nt)}),ge(rt=>(this.toastr.info("Matching Regex Rule to Barcode","Digital Scale"),this.#e.get(`${wt.GetVariantByCode}?Code=${e}&EntityID=${this.#t.Outlet().ID}`).pipe(Ot(st=>this.generateCartItem(st)),Q(st=>{this.onAddCartItem(st)})))))}}else return this.#e.get(`${wt.GetVariantByCode}?Code=${e}&EntityID=${this.#t.Outlet().ID}`).pipe(Ot(d=>this.generateCartItem(d)),Q(d=>{this.onAddCartItem(d)}))}httpRequestGetInventoryByVariantID(e){return Pt(this.#t.Outlet,{injector:this.#n}).pipe(Tt(this.destroy$),dt(t=>A.IsNotEmpty(t.ID)),Me(),ot(t=>this.#e.get(wt.GetVariantStockByID,[{key:"EntityID",value:t.ID},{key:"ID",value:e}])))}addItemByVariantID(e){this.httpGetVariantByID(e).pipe(Tt(this.destroy$)).subscribe()}onAddCartItem(e,t=!1,o=1){let i=this.#t.CartItems(),d=i.findIndex(b=>b.VariantID===e.VariantID),x=[];d!==-1?t?x=[...i,e]:(i[d].Quantity+=o,x=[...i]):x=[...i,R(j({},e),{Quantity:o})],this.#t.onChangeCartItems(x)}generateCartItem(e){return this.#i.adapt(R(j({},e),{ID:A.GuidEmpty,Cost:e.UnitCost,Expense:e.UnitCost,SplitQuantity:0,UnitCost:e.UnitCost,InventoryTypeID:e.TypeID,Price:e.UnitPrice,Name:e.Name,ThumbnailUrl:e.ThumbnailUrl,UnitPrice:e.UnitPrice,UnitQuantity:e.UnitQuantity,Quantity:1,Code:e.Code,TypeID:e.TypeID,Discount:e.PriceDiscount,EntityID:A.GuidEmpty,VariantUnitQuantity:e.VariantUnitQuantity,Storage:e.Storage,UOM:e.UOM,UOMName:e.UOMName,VariantID:e.ID,Variant:this.#r.adapt(e)}))}onRemoveCartItem(e){let t=this.#t.CartItems().filter((o,i)=>e!==i);this.#t.onChangeCartItems(t)}onOpenCartNoteModal(){return this.#o.open(ai)}onOpenCartVoidModal(){return this.#o.open(li)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})};var ad=["unitCost"],ld=n=>({selected:n}),sd=()=>["/menu/Products/Catalog/Variants/Info"],dd=(n,e)=>e.key;function md(n,e){if(n&1){let t=v();a(0,"a",7),_("click",function(){p(t);let i=m().$implicit,d=m();return u(d.onTabChange(i.key))}),s(1),r()}if(n&2){let t=m().$implicit,o=m();c("ngClass",k(2,ld,o.activeTab().key===t.key)),l(),I(" ",t.label," ")}}function cd(n,e){if(n&1&&C(0,md,2,4,"a",6),n&2){let t=e.$implicit;g(t.isVisible?0:-1)}}function pd(n,e){n&1&&(a(0,"div",11)(1,"h5"),s(2,"Cost"),r(),f(3,"input",16),r())}function ud(n,e){if(n&1&&(a(0,"div")(1,"div",8)(2,"div",9)(3,"h5"),s(4,"Qty"),r(),f(5,"input",10,0),r(),a(7,"div",11)(8,"h5"),s(9,"Price"),r(),f(10,"input",12),r(),C(11,pd,4,0,"div",11),r(),At(12),a(13,"div",8)(14,"div",13)(15,"h5",14),s(16,"Note"),r(),f(17,"POS-tinymce-editor",15),r()(),jt(),r()),n&2){let t=m();l(11),g(t.roleService.product.Cost?11:-1)}}function _d(n,e){if(n&1&&f(0,"img",29),n&2){let t=m(3);c("ngSrc",t.cartItem.ThumbnailUrl)}}function Cd(n,e){n&1&&E(0,_d,1,1,"ng-template")}function gd(n,e){n&1&&(At(0),f(1,"i",30),a(2,"h6"),s(3,"No Image"),r(),jt())}function fd(n,e){if(n&1&&(a(0,"div",13)(1,"table",31)(2,"thead")(3,"tr")(4,"th",32),s(5,"Storage Location"),r()()(),a(6,"tbody")(7,"tr")(8,"td"),s(9),r()()()()()),n&2){let t=m(2);l(9),I(" ",t.cartItem.Variant.Storage," ")}}function hd(n,e){if(n&1&&(At(0),a(1,"div",17)(2,"div",18)(3,"a",19),C(4,Cd,1,0)(5,gd,4,0,"ng-container"),r()(),a(6,"div",20)(7,"div",21)(8,"div",13)(9,"div",22),f(10,"i",23),a(11,"div",24),s(12," Inventory "),r()(),a(13,"table",25)(14,"thead")(15,"tr")(16,"th",26),s(17," On Hand "),r(),a(18,"th",26),s(19," Allocated "),r(),a(20,"th",27),s(21," Available "),r()()(),a(22,"tbody")(23,"tr")(24,"td",28),s(25),r(),a(26,"td",28),s(27),r(),a(28,"td",28),s(29),r()()()()(),C(30,fd,10,1,"div",13),r()(),f(31,"div",17),r(),jt()),n&2){let t=m();l(3),c("routerLink",Z(6,sd)),l(),g(t.cartItem.ThumbnailUrl?4:5),l(21),I(" ",t.inventory().ON_HAND," "),l(2),I(" ",t.inventory().ALLOCATED," "),l(2),I(" ",t.inventory().ON_HAND-t.inventory().ALLOCATED," "),l(),g(!(t.AppConfigJSON==null||t.AppConfigJSON.ModuleSell==null||t.AppConfigJSON.ModuleSell.Grid==null)&&t.AppConfigJSON.ModuleSell.Grid.StorageVisible&&t.cartItem.Variant.Storage?30:-1)}}function yd(n,e){if(n&1){let t=v();a(0,"POS-tab-serial",33),w("variantChange",function(i){p(t);let d=m();return P(d.cartItem,i)||(d.cartItem=i),u(i)}),_("variantChange",function(i){p(t);let d=m();return u(d.onSerialChange(i))}),w("serialsChange",function(i){p(t);let d=m();return P(d.serials,i)||(d.serials=i),u(i)})("isFocusOnSerialInputChange",function(i){p(t);let d=m();return P(d.isFocusOnSerialInput,i)||(d.isFocusOnSerialInput=i),u(i)}),r()}if(n&2){let t=m();c("disabledEditQty",t.isAdjustmentEdit())("disabledAddSerial",t.isAdjustmentEdit())("outletID",t.storeService.Outlet().ID),M("variant",t.cartItem)("serials",t.serials)("isFocusOnSerialInput",t.isFocusOnSerialInput)}}var si=class n{constructor(e){this.data=e;this.isAdjustmentEdit.set(this.data.isAdjustmentEdit);let t=this.storeService.CartItems()[this.data.index];this.cartItem=JSON.parse(JSON.stringify(t)),this.modalConfig.title=this.cartItem.Variant.Name,this.modalConfig.customWidth="650px",this.modalConfig.bodyScrollable=!0,this.AppConfigJSON=this.storeService.AppConfigJSON(),eo(()=>{this.tabs()&&this.tabs()[1].isActive&&this.tabs()[1].isActive&&setTimeout(()=>{this._costElement?.nativeElement?.click(),this._costElement.nativeElement.focus()},500)})}storeService=h(z);roleService=h(H);AppConfigJSON;modalConfig=new Ct;cartItem;form;tabs=K([]);activeTab=he(()=>this.tabs().filter(e=>e.isActive)[0]);isItemSerial=K(!1);inventory=K({ON_HAND:0,ALLOCATED:0,AVAILABLE:0,ROP:0,MAX:0});serials=[];isFocusOnSerialInput=K(!1);_costElement;cdr=h(no);#t=h(Fe);#e=h(_t);#n=h(ne);#i=h(It);#o=h(yt);#r=h(vt);isAdjustmentEdit=K(!1);onTabChange(e){let t=this.tabs().map(o=>o.key===e?R(j({},o),{isActive:!0}):R(j({},o),{isActive:!1}));this.tabs.set(t),this.cdr.detectChanges()}generateForm(){this.form=this.#t.group({Quantity:this.cartItem.Quantity??0,Price:this.cartItem.Price??0,Cost:this.cartItem.Cost??0,Note:this.cartItem.Note??""})}ngOnInit(){this.generateForm(),this.isItemSerial.set(this.checkIsSerial()),this.tabs.set([{key:0,value:"cart",label:"Cart",isActive:!0,isVisible:!0},{key:1,value:"product",label:"Product",isActive:!1,isVisible:this.roleService.inventory.View&&this.cartItem.Variant.Name.length>0},{key:2,value:"serial",label:"Serial",isActive:!1,isVisible:this.checkIsSerial()}]),this.requestUnitInStock().subscribe({next:e=>this.inventory.set(R(j({},this.inventory()),{ALLOCATED:Number(e.Allocated),MAX:Number(e.Max),ON_HAND:Number(e.OnHand),ROP:Number(e.ROP),AVAILABLE:Number(+e.OnHand-+e.Allocated)}))})}onSerialChange(e){let t=this.form.get("Quantity"),o=e.Quantity;t.setValue(o)}onNoteChange(e){this.form.get("Note").setValue(e)}onOK(){if(this.checkIsSerial()){if(this.generateSerials(),Array.isArray(this.cartItem.Serial)&&this.cartItem.Serial.length){let e=this.cartItem.Serial.reduce((o,i)=>o+i.Quantity,0);if(this.form.get("Quantity")?.value!==e){this.#r.warning("Serial must be equal with the quantity",Y.Warning);return}}if(this.cartItem.Quantity<0){let e=this.storeService.CartItems().reduce((t,o,i)=>(this.data.index===i?t.push(j({},this.#n.adapt(R(j({},o),{Quantity:+this.form.get("Quantity")?.value,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):t.push(o),t),[]);this.storeService.onChangeCartItems(e)}if(this.cartItem.Quantity>0){let e=this.storeService.CartItems().reduce((t,o,i)=>(this.data.index===i?t.push(j({},this.#n.adapt(R(j({},o),{Quantity:+this.form.get("Quantity")?.value,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):t.push(o),t),[]);this.storeService.onChangeCartItems(e)}}else{let e=this.storeService.CartItems().reduce((t,o,i)=>(this.data.index===i?t.push(j({},this.#n.adapt(R(j({},o),{Quantity:+this.form.get("Quantity")?.value,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value})))):t.push(o),t),[]);this.storeService.onChangeCartItems(e)}this.#e.close()}checkIsSerial(){return this.cartItem.Variant!==void 0?this.cartItem.Variant.TypeID===4:!1}generateSerials(){if(!this.isFocusOnSerialInput()&&this.serials.length>0){let e=this.serials.map(t=>({Quantity:1,Number:t}));this.cartItem.Serial=[...this.cartItem.Serial,...e]}}requestUnitInStock(){if(A.IsEmpty(this.storeService.Outlet().ID)){this.#r.error("Please select outlet before proceding...",Y.Error);return}return Pt(this.activeTab,{injector:this.#o}).pipe(dt(e=>e.key===1),Me(),ot(e=>this.#i.httpRequestGetInventoryByVariantID(this.cartItem.VariantID)))}onCancel(){this.#e.close()}static \u0275fac=function(t){return new(t||n)(D(Zt))};static \u0275cmp=O({type:n,selectors:[["adjustment-modal-edit-product"]],viewQuery:function(t,o){if(t&1&&Gt(ad,5),t&2){let i;zt(i=Kt())&&(o._costElement=i.first)}},decls:11,vars:3,consts:[["qty",""],[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"row","border-bottom"],[1,"container-fluid","mt-5",3,"formGroup"],[3,"disabledEditQty","disabledAddSerial","outletID","variant","serials","isFocusOnSerialInput"],[1,"btn","btn-link",3,"ngClass"],[1,"btn","btn-link",3,"click","ngClass"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["formControlName","Price","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"col-12"],[1,"mb-5"],["formControlName","Note","height","220px"],["formControlName","Cost","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"row"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink"],[1,"col"],[1,"row","row-gap-4"],[1,"d-flex"],["aria-hidden","true",1,"fa-archive","fa-solid","fa-1x","pt-3","pe-2"],[2,"font-size","15px","font-family",'"Roboto Slab"'],[1,"table","table-bordered","text-center","inventory-table"],[1,"table-light","py-6","border-end",2,"text-transform","none"],[1,"table-light","py-6",2,"text-transform","none"],[1,"py-6"],["width","400","height","400",1,"border","rounded",3,"ngSrc"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"table","table-bordered","text-center"],[1,"table-light"],[3,"variantChange","serialsChange","isFocusOnSerialInputChange","disabledEditQty","disabledAddSerial","outletID","variant","serials","isFocusOnSerialInput"]],template:function(t,o){if(t&1&&(a(0,"modal-material",1),_("onOk",function(){return o.onOK()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),a(1,"content")(2,"div",2)(3,"div",3)(4,"div"),N(5,cd,1,1,null,null,dd),r()()(),a(7,"div",4),C(8,ud,18,1,"div")(9,hd,32,7,"ng-container")(10,yd,1,6,"POS-tab-serial",5),r()()()),t&2){let i;c("config",o.modalConfig),l(5),F(o.tabs()),l(2),c("formGroup",o.form),l(),g((i=o.activeTab().key)===0?8:i===1?9:i===2?10:-1)}},dependencies:[ut,gt,xt,Ut,Se,St,B,ke,Ve,Ne,Ie,Ke,un,ct,oo,Qn,Be,Qt,Le],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 xd(n,e){if(n&1){let t=v();a(0,"div",27)(1,"button",28),_("click",function(){p(t);let i=m().$index,d=m(2);return u(d.onReturnVariant(i))}),s(2," Return "),r(),a(3,"button",28),_("click",function(){p(t);let i=m().$index,d=m(2);return u(d.onPurchaseVariant(i))}),s(4," Purchase "),r()()}}function vd(n,e){if(n&1&&(a(0,"td",6),s(1),r()),n&2){let t=m().$index;l(),I("",t+1,".")}}function Sd(n,e){if(n&1){let t=v();a(0,"div",9)(1,"img",29),_("error",function(i){p(t);let d=m(3);return u(d.onErrorImage(i))}),r()()}if(n&2){let t=m().$implicit;l(),c("src",t.Variant.ThumbnailUrl,vn)("alt",t.Variant.Name)}}function bd(n,e){n&1&&(a(0,"div",10),f(1,"i",30),r())}function Id(n,e){if(n&1&&(a(0,"span"),s(1),y(2,"number"),r()),n&2){let t=m().$implicit;l(),S(T(2,1,t.Quantity))}}function Dd(n,e){n&1&&(a(0,"span",18),s(1," x "),r())}function Td(n,e){if(n&1&&(a(0,"span"),s(1),y(2,"number"),r()),n&2){let t=m().$implicit;l(),S(T(2,1,t.UnitQuantity))}}function Pd(n,e){if(n&1&&(a(0,"small",19),s(1),r()),n&2){let t=m().$implicit;l(),S(t.Variant.UOM?t.Variant.UOMName:"")}}function wd(n,e){if(n&1&&(a(0,"div",20),s(1),y(2,"number"),r()),n&2){let t=m().$implicit;l(),I(" ",V(2,1,t.Price,"1.0-4")," ")}}function Md(n,e){if(n&1){let t=v();a(0,"tr",5),_("click",function(){let i=p(t).$index,d=m(2);return u(d.onOpenModalEditProduct(i))}),E(1,xd,5,0,"ng-template",null,0,$),C(3,vd,2,1,"td",6),a(4,"td",7)(5,"div",8),C(6,Sd,2,2,"div",9)(7,bd,2,0,"div",10),a(8,"div",11)(9,"div"),s(10),r(),a(11,"span",12),s(12),r(),a(13,"div"),f(14,"app-serial-note",13),r(),f(15,"small",14),r()()(),a(16,"td",15)(17,"div",16)(18,"div",17)(19,"span"),C(20,Id,3,3,"span"),C(21,Dd,2,0,"span",18),C(22,Td,3,3,"span"),r(),C(23,Pd,2,1,"small",19),r()()(),a(24,"td"),C(25,wd,3,4,"div",20),r(),a(26,"td",21)(27,"div",16)(28,"div",22),s(29),y(30,"number"),r()()(),a(31,"td",23)(32,"div",24)(33,"span",25),_("click",function(){let i=p(t).$index,d=m(2);return u(d.removeCartItem(i))}),f(34,"i",26),r()()()()}if(n&2){let t,o,i=e.$implicit,d=J(2),x=m(2);c("cdkContextMenuTriggerFor",d)("cdkDragDisabled",x.isMobileDevice()),l(3),g((t=x.AppConfigJSON())!=null&&t.ModuleSell.Grid.RowNumberVisible?3:-1),l(3),g(i.Variant.ThumbnailUrl?6:7),l(4),S(i.Variant.Name),l(2),S(i.Variant.Code),l(2),c("serials",i.Serial),l(),c("innerHtml",i.Note,q),l(5),g(i.Quantity!=1||i.UnitQuantity>1?20:-1),l(),g(i.UnitQuantity>1||i.UnitQuantity<-1?21:-1),l(),g(i.UnitQuantity>1||i.UnitQuantity<-1?22:-1),l(),g(i.Variant.UOM&&(!((o=x.AppConfigJSON())==null||o.ModuleSell==null)&&o.ModuleSell.Grid.UOMVisible)?23:-1),l(2),g(i.UnitPrice!==(i==null?null:i.Total)&&i.Quantity>1?25:-1),l(4),I(" ",x.roleService.product!=null&&x.roleService.product.Price?T(30,14,+(i.Quantity*+i.Price)):" - "," ")}}function Ed(n,e){if(n&1){let t=v();a(0,"table",1)(1,"tbody",3),_("cdkDropListDropped",function(i){p(t);let d=m();return u(d.onDrop(i))}),N(2,Md,35,16,"tr",4,et),r()()}if(n&2){let t=m();l(2),F(t.CartItems())}}function Od(n,e){n&1&&(a(0,"div",2)(1,"div",31)(2,"div",32)(3,"div",33)(4,"div",34),f(5,"i",35),r(),a(6,"div",36)(7,"span"),s(8,"Empty Cart"),r(),f(9,"br"),a(10,"span"),s(11,"Add products to the cart"),r(),f(12,"br"),a(13,"span"),s(14,"or scan barcode"),r()()()()()())}var di=class n{roleService=h(H);storeService=h(z);cartService=h(It);matDialog=h(it);renderer=h(Yi);#t=h(ne);route=h(xe);isAdjustmentEdit=he(()=>{let e=this.route.snapshot?.queryParams;return A.IsNotEmpty(e.ID)});CartItems=this.storeService.CartItems;AppConfigJSON=this.storeService.AppConfigJSON;onDrop(e){}onOpenModalEditProduct(e){this.matDialog.open(si,{data:{index:e,isAdjustmentEdit:this.isAdjustmentEdit()}})}removeCartItem(e){this.cartService.onRemoveCartItem(e)}onErrorImage(e){console.log("img erro",e);let t=e.target;this.renderer.setStyle(t,"border","1px solid #dddddd"),this.renderer.setStyle(t,"border-radius","4px"),this.renderer.setAttribute(t,"alt","")}onReturnVariant(e){let t=this.storeService.CartItems().reduce((o,i,d)=>(e===d?o.push(j({},this.#t.adapt(R(j({},i),{Quantity:-Math.abs(i.Quantity),TotalPrice:-Math.abs(i.Quantity)*i.Price})))):o.push(i),o),[]);this.storeService.onChangeCartItems(t)}onPurchaseVariant(e){let t=this.storeService.CartItems().reduce((o,i,d)=>(e===d?o.push(j({},this.#t.adapt(R(j({},i),{Quantity:Math.abs(i.Quantity),TotalPrice:Math.abs(i.Quantity)*i.Price})))):o.push(i),o),[]);this.storeService.onChangeCartItems(t)}isMobileDevice(){let e=navigator.userAgent||"";return/android|avantgo|bada\/|blackberry|bb10|blazer|compal|elaine|fennec|hiptop|iemobile|iphone|ipod|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|acer|airn|al(av|ca)|amoi|anex|anyw|aptu|ar(ch|go)|as(te|us)|attw|au(di|m)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw(n|u)|c55\/|capi|ccwa|cdm|cell|chtm|cldc|cmd|co(mp|nd)|craw|da(it|ll)|dbte|dc|devi|dica|dmob|do(c|p)o|ds(12|d)|el(ai)|em(l2)|er(ic|k0)|esl8|ez(40|os|wa|ze)|fetc|fly|g1 u|g560|gene|gf5|gmo|go(\.w|od)|gr(ad|un)|haie|hcit|hd(m|p|t)|hei|hi(pt|ta)|hp i|hs(c)|ht(c|tp)|hu(aw|tc)|i(ma|go)|i230|iac|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(v)a|jbro|jemu|jigs|kddi|keji|kgt|klon|kpt |kwc|kyo|le(no|xi)|lg( g|\/k|50)|libw|lynx|m1|m3ga|m50|ma(te|ui|xo)|mc(01|21)|me(rc|ri)|mi(o8|oa)|mmef|mo(01|bi|zz)|mt(50|p1)|mwbp|mywa|n10|n20|n30|n50|n70|ne(c|m)|nok|nzph|o2im|opwv|oran|pdxg|pg(13|c)|phil|pire|pl(ay|uc)|pn|po(ck|se)|prox|psio|pt|qa|qc(07|12|21|60)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55|sa(ma|ny)|sc(01|p)|sdk|se(c|47|mc)|sgh|shar|sie|sk|sl45|sm(al|t5)|so(ft|ny)|sp(01|v)|sy|t2(18|50)|t6(00|18)|ta(gt)|tcl|tdg|tim|tmo|to(pl)|ts(70|m3)|tx|up(\.b)|utst|v400|v750|veri|vi(te)|vk(40)|vm40|voda|vx(52|53|60|70)|w3c|webc|whit|wi(g|nc)|wmlb|wonu|x700|yas|zeto|zte/i.test(e.substring(0,4))}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["adjustment-cart-display"]],decls:2,vars:1,consts:[["context_menu",""],[1,"table","table-borderless"],[1,"row","g-0","h-100"],["cdkDropList","",3,"cdkDropListDropped"],["cdkDrag","",1,"border-bottom",2,"padding-left","12px",3,"cdkContextMenuTriggerFor","cdkDragDisabled"],["cdkDrag","",1,"border-bottom",2,"padding-left","12px",3,"click","cdkContextMenuTriggerFor","cdkDragDisabled"],[2,"width","10px","padding-left","12px"],[1,"pe-0",2,"width","50%","padding-left","12px"],[1,"d-flex","align-items-center"],[1,""],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"d-block","ms-6",2,"line-height","18px"],[1,"fw-normal","fs-6","text-muted"],[3,"serials"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",3,"innerHtml"],[1,"px-0","text-end",2,"width","15%"],[1,"d-flex","align-items-center","justify-content-end"],[1,"d-flex","text-end","fw-normal","align-items-center",2,"line-height","20px"],[1,"fs-6"],["title","UOM",1,"ps-1","fs-5"],[1,"fs-5","text-end"],["data-test","total",1,"pe-0"],[1,"fs-5"],[1,"mt-6","ps-0"],[1,"d-flex","justify-content-end","align-items-center"],["role","button","title","Delete Item",1,"fs-3","cursor-pointer",3,"click"],[1,"fa","fa-trash","text-danger","fs-4"],["cdkMenu","",1,"example-menu"],["cdkMenuItem","",1,"example-menu-item",3,"click"],[1,"object-fit-contain",2,"height","55px","width","55px",3,"error","src","alt"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"col-12"],[1,"d-flex","justify-content-center","align-items-center","h-100"],[1,"row"],[1,"col-12","d-flex","justify-content-center"],[1,"fa-regular","fa-cart-arrow-up","text-secondary",2,"font-size","110px"],[1,"col-12","justify-content-center","text-center","mt-5","empty-cart-description","text-secondary","headings-font-family"]],template:function(t,o){t&1&&C(0,Ed,4,0,"table",1)(1,Od,15,0,"div",2),t&2&&g(o.CartItems().length>0?0:1)},dependencies:[So,vo,$e,Xo,Jo,$o,Zo,G],styles:[".item-image[_ngcontent-%COMP%]{height:50px;width:56px;display:block;border:solid 1px #dddddd;border-radius:5px}.example-menu[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;min-width:180px;max-width:280px;background-color:#fff;padding:6px 0}.example-menu-item[_ngcontent-%COMP%]{background-color:transparent;cursor:pointer;border:none;-webkit-user-select:none;user-select:none;min-width:64px;line-height:36px;padding:0 16px;display:flex;align-items:center;flex-direction:row;flex:1}.example-menu-item[_ngcontent-%COMP%]:hover{background-color:#f5f5f5}.example-menu-item[_ngcontent-%COMP%]:active{background-color:#dcdcdc} .cdk-menu.cdk-menu-group.example-menu{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}"]})};var mi=class n{storeService=h(z);cartService=h(It);orderService=h(Bt);loadFormService=h(Ye);roleService=h(H);#t=h(Lt);onProcess=new Sn;onOpenModalNote=new Sn;onOpenModalVoid=new Sn;constructor(){}onProcessHandler(){this.onProcess.emit()}onOpenModalNoteHandler(){this.onOpenModalNote.emit(),this.cartService.onOpenCartNoteModal().afterClosed().subscribe({next:t=>{Object.keys(t).forEach(o=>{this.orderService.onUpdateOrderState(o,t[o])})}})}onOpenModalVoidHandler(){this.onOpenModalVoid.emit(),this.cartService.onOpenCartVoidModal().afterClosed().pipe(dt(t=>t.type==="OK"),ot(()=>this.loadFormService.getLoadForm$),Q(()=>{this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeCartItems([]),this.storeService.onChangeIsOpenDialog(!1),this.#t.navigate(["/menu/Adjustment/Adjustment/Archive/Form"])})).subscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["adjustment-cart-action"]],outputs:{onProcess:"onProcess",onOpenModalNote:"onOpenModalNote",onOpenModalVoid:"onOpenModalVoid"},decls:17,vars:5,consts:[[1,"row","g-0","pb-6","px-5"],[1,"col-5","d-flex","justify-content-between","pe-5",2,"column-gap","12px"],["type","button",1,"btn","btn-gray","fs-3","py-6","headings-font-family",2,"flex-grow","1",3,"click"],[1,"fa-regular","fa-note-sticky","fa-xl"],["type","button",1,"btn","btn-gray","fs-3","px-0","py-6","headings-font-family","d-flex","gap-2","justify-content-center","align-items-center",2,"flex-grow","8",3,"click"],[1,"fa-solid"],[1,"col-7"],["type","button",1,"btn","btn-success","w-100","px-6","py-6","d-flex","justify-content-between","align-items-center","headings-font-family",2,"border-left","0.1px solid #fff","font-size","22px",3,"click"],[1,"fs-6"]],template:function(t,o){t&1&&(fe(0,"div",0)(1,"div",1)(2,"button",2),In("click",function(){return o.onOpenModalNoteHandler()}),Mi(3,"i",3),cn(),fe(4,"button",4),In("click",function(){return o.onOpenModalVoidHandler()}),Mi(5,"i",5),fe(6,"span"),s(7,"Clear"),cn()()(),fe(8,"div",6)(9,"button",7),In("click",function(){return o.onProcessHandler()}),fe(10,"div"),s(11," Submit "),fe(12,"small",8),s(13),cn()(),fe(14,"div"),s(15),y(16,"number"),cn()()()()),t&2&&(l(13),Ft("(",o.storeService.CartItems().length," items, ",o.storeService.QtyCartItems()," Qty)"),l(2),S(T(16,3,o.storeService.SubTotal())))},dependencies:[G],styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};function Ad(n,e){if(n&1&&(a(0,"div",6)(1,"div",7)(2,"div"),s(3),r(),a(4,"small",8),s(5),r()(),a(6,"div",9)(7,"span"),s(8),y(9,"number"),r()()()),n&2){let t=e.data;l(3),S(t==null?null:t.Value),l(2),S(t==null?null:t.Code),l(3),S(T(9,3,t==null?null:t.UnitPrice))}}var ci=class n{cartService=h(It);query=new ve({});#t=h(L);storeService=h(z);skipXHR=!1;spinnerService=h(cr);constructor(){}onBarcodeScan(e){console.log("Scanned barcode:",e),this.cartService.httpRequestVariantByCode(e).pipe().subscribe()}ngOnInit(){this.query.valueChanges.pipe(ze("query"),dt(e=>e&&Object.keys(e).length>0),Q(e=>{this.spinnerService.show()}),ot(e=>{this.spinnerService.show();let t;if(e.type==="ID")t=this.cartService.httpGetVariantByID(e.str);else if(e.type==="Code")t=this.cartService.httpRequestVariantByCode(e.str);else return fn;return t.pipe(ge(o=>o.status>=400&&o.status<=451?(console.error("Variant not found:",o.message),hn(null)):yn(()=>o)))}),Q(()=>{this.spinnerService.hide()})).subscribe({next:e=>{},error:e=>{this.spinnerService.hide(),console.error("An error occurred:",e)}})}onSelectVariant(e){this.cartService.addItemByVariantID(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["adjustment-cart-header"]],decls:7,vars:4,consts:[["itemTemplate",""],[1,"row"],[1,"col"],[1,""],[1,"px-4","py-4"],["inputID","product","requestUrl","/API/AC/GetVariantSuggestionByCodeNNameWithEntityID","prefixIcon","fa fa-barcode","placeholder","Search product by name / code","localStorage","products","notFoundMessageFor","product","data_cy","txt-product",1,"form-control","autocomplete-product",3,"onInputEnter","onSelect","clearOnSelect","useCustomTemplate","itemTemplate","outletId"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"],[1,"ps-4"]],template:function(t,o){if(t&1){let i=v();a(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"autocompleteV2",5),_("onInputEnter",function(x){return p(i),u(o.onBarcodeScan(x))})("onSelect",function(x){return p(i),u(o.onSelectVariant(x))}),r()(),E(5,Ad,10,5,"ng-template",null,0,$),r()()()}if(t&2){let i=J(6);l(4),c("clearOnSelect",!0)("useCustomTemplate",!0)("itemTemplate",i)("outletId",o.storeService.Outlet().ID)}},dependencies:[xt,Ro,Jt,Se,We,Xt,G],styles:["[_nghost-%COMP%] autocompleteV2.autocomplete-product>mat-form-field>input{height:38px!important;border-radius:.375rem}[_nghost-%COMP%] autocompleteV2.autocomplete-product>mat-form-field>div.position-relative>span.prefix-icon{top:10px}"]})};var Bi=class{constructor(e,t,o,i,d,x,b,nt,rt,st,Dt){this._StateID=e,this._StateLabel=t,this._Success=o,this._Message=i,this._InvoiceID=d,this._OrderID=x,this._InvoiceNumber=b,this._PrintMode=nt,this._DeliveryID=rt,this._PaymentStateID=st,this._PaymentStateLabel=Dt}_StateID;get StateID(){return this._StateID}set StateID(e){this._StateID=e}_StateLabel;get StateLabel(){return this._StateLabel}set StateLabel(e){this._StateLabel=e}_Success;get Success(){return this._Success}set Success(e){this._Success=e}_Message;get Message(){return this._Message}set Message(e){this._Message=e}_InvoiceID;get InvoiceID(){return this._InvoiceID}set InvoiceID(e){this._InvoiceID=e}_OrderID;get OrderID(){return this._OrderID}set OrderID(e){this._OrderID=e}_InvoiceNumber;get InvoiceNumber(){return this._InvoiceNumber}set InvoiceNumber(e){this._InvoiceNumber=e}_PrintMode;get PrintMode(){return this._PrintMode}set PrintMode(e){this._PrintMode=e}_DeliveryID;get DeliveryID(){return this._DeliveryID}set DeliveryID(e){this._DeliveryID=e}_PaymentStateID;get PaymentStateID(){return this._PaymentStateID}set PaymentStateID(e){this._PaymentStateID=e}_PaymentStateLabel;get PaymentStateLabel(){return this._PaymentStateLabel}set PaymentStateLabel(e){this._PaymentStateLabel=e}toJSON(){return{StateID:this.StateID,StateLabel:this.StateLabel,Success:this.Success,Message:this.Message,InvoiceID:this.InvoiceID,OrderID:this.OrderID,InvoiceNumber:this.InvoiceNumber,PrintMode:this.PrintMode,DeliveryID:this.DeliveryID,PaymentStateID:this.PaymentStateID,PaymentStateLabel:this.PaymentStateLabel}}},ui=class n{adapt(e){return new Bi(e.StateID,e.StateLabel,e.Success,e.Message,e.InvoiceID,e.OrderID,e.InvoiceNumber,e.PrintMode,e.DeliveryID,e.PaymentStateID,e.PaymentStateLabel).toJSON()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})};var jd=(n,e)=>e.key;function kd(n,e){if(n&1){let t=v();a(0,"div",3),_("click",function(){let i=p(t).$implicit,d=m();return u(d.submit(i.key))}),f(1,"i",4),s(2),r()}if(n&2){let t=e.$implicit;l(),c("ngClass",t.icon),l(),I(" ",t.label," ")}}var _i=class n{constructor(e,t){this.dialogRef=e;this.data=t;this.config=new Ct,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0}config;adjustmentState=K([]);onClose(){this.dialogRef.close({role:"close"})}onCancel(){this.dialogRef.close({role:"cancel"})}ngOnInit(){this.adjustmentState.set([{key:1,value:"draft",label:"Draft",icon:"fa-file-pen"},{key:2,value:"submitted",label:"Submit for Review",icon:"fa-user-magnifying-glass"}])}submit(e){this.dialogRef.close({role:"ok",data:e})}static \u0275fac=function(t){return new(t||n)(D(_t),D(Zt))};static \u0275cmp=O({type:n,selectors:[["POS-modal-with-approval"]],decls:5,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid","d-flex","gap-3","justify-content-between",2,"width","500px"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid",3,"ngClass"]],template:function(t,o){t&1&&(a(0,"modal-material",0),_("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),a(1,"content")(2,"div",1),N(3,kd,3,2,"div",2,jd),r()()()),t&2&&(c("config",o.config),l(3),F(o.adjustmentState()))},dependencies:[xt,Ut,ut,gt],encapsulation:2})};var Ci=class n{destroy$=new ht;#t=h(Bt);#e=h(z);#n=h(ui);injector=h(yt);toastr=h(vt);matDialog=h(it);constructor(){}ngOnInit(){}onProcessOrder(){if(A.IsEmpty(this.#e.Outlet().ID)){this.toastr.error("Please select outlet before proceeding..",Y.Error);return}if(this.#e.CartItems().length==0){this.toastr.error("You must have at least one item.",Y.Error);return}if(A.IsEmpty(this.#e.Order().Number)){this.toastr.error("Number cannot be empty.",Y.Error);return}if(this.#e.Order().TypeID==2){let e=[...this.#e.CartItems()].map(o=>o.VariantID),t=new Set(e);if(e.length!=t.size){this.toastr.error("Count adjustment type doesn't allow the same product/code in different rows. Please check again!","Submit Restricted!");return}}this.#e.AppConfigJSON().ModuleAdjustment.Basic.Workflow==1?this.#t.processOrder().pipe(Tt(this.destroy$)).subscribe({next:e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))},error:e=>{console.log("error",e)}}):(console.log(this.#e.Order().StateID),Pt(this.#e.LoadForm,{injector:this.injector}).pipe(ot(e=>!e.Data||e.Data&&e.Data.Order.StateID&&e.Data.Order.StateID==1?this.matDialog.open(_i).afterClosed().pipe(dt(t=>t!=null&&t.role==="ok"),Q(t=>{let o=t.data;this.#t.onUpdateOrderState("StateID",Number(o))}),ot(()=>this.#t.processOrder())):this.#t.processOrder()),Q(e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))})).subscribe())}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["adjustment-cart"]],decls:9,vars:0,consts:[[1,"h-100","d-flex","flex-column"],[1,"pt-4"],[1,"row"],[1,"col"],["PinScrollingBottom","",1,"",2,"overflow-y","auto","flex","1 1 0%","max-height","calc(100vh - 170px)"],[1,""],[3,"onProcess"]],template:function(t,o){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),f(4,"adjustment-cart-header"),r()()(),a(5,"div",4),f(6,"adjustment-cart-display"),r(),a(7,"div",5)(8,"adjustment-cart-action",6),_("onProcess",function(){return o.onProcessOrder()}),r()()())},dependencies:[di,mi,ci,or],encapsulation:2})};function Vd(n,e){if(n&1&&(a(0,"div",22)(1,"div",25),s(2),r(),a(3,"div",25),s(4),r()()),n&2){let t=e.$implicit;l(2),S(t.Variant.Name),l(2),S(t.Quantity)}}var gi=class n{menu$;storeService=h(z);#t=h(Lt);#e=h(at);#n=h(wn);cartItems;fullContainerEl=document.getElementById("full-container");constructor(){this.#e.setMenu$(),this.menu$=this.#e.menu$.pipe(Ot(e=>R(j({},e),{H:"Inventory Adjustment",T:e.T.replace("undefined","Inventory Adjustment")})),Q(e=>this.#n.setTitle(e.T)))}ngAfterViewInit(){this.fullContainerEl.classList.remove("full-container")}ngOnDestroy(){this.fullContainerEl.classList.add("full-container")}handleF8(){this.onNewAdjustment()}onPrintReceipt(){return gn(this,null,function*(){window.open(`/print/Adjustment?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onGotoAdjustmentDetail(){return gn(this,null,function*(){window.open(`/menu/Adjustment/Adjustment/Archive/Info?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onNewAdjustment(){return gn(this,null,function*(){this.storeService.onChangeCartItems([]),yield this.#t.navigate(["menu/Adjustment/Adjustment/Archive/Form"],{queryParams:{}}),this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeIsComplete(),this.storeService.onChangeCartItems([])})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["adjustment-order-complete"]],hostBindings:function(t,o){t&1&&_("keydown.F8",function(){return o.handleF8()},Wt)},inputs:{cartItems:"cartItems"},decls:37,vars:10,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"order-complete","mt-6"],[1,"container-fluid"],[1,"row"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"fa-solid","fa-check","me-3"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"card-footer"],[1,"d-flex","justify-content-between","py-5"],["target","_blank",1,"btn","bg-light-gray","btn-secondary",3,"click"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],["target","_blank",1,"",2,"cursor","pointer",3,"href"],[1,"card-body"],[1,"row","justify-content-between","mb-3"],[1,"row","justify-content-end","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col-4","text-end"],[1,"col","text-end"]],template:function(t,o){t&1&&(a(0,"mainpanel-cmp",0),y(1,"async"),a(2,"content")(3,"section",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"h1",7),f(10,"i",8),s(11,"Inventory Adjustment Complete "),r()(),a(12,"div",9)(13,"div",10)(14,"div",11)(15,"a",12),_("click",function(){return o.onNewAdjustment()}),s(16," New Adjustment (F8)"),r()()()(),a(17,"div",13)(18,"div",14)(19,"a",15),_("click",function(){return o.onPrintReceipt()}),f(20,"i",16),s(21,"Print Receipt"),r()()()()(),a(22,"div",17)(23,"div",5)(24,"div",18)(25,"h3",19)(26,"a",20),s(27),r()()(),a(28,"div",21),N(29,Vd,5,2,"div",22,et),a(31,"div",23)(32,"div",24),s(33,"Total:"),r(),a(34,"div",24),s(35),y(36,"number"),r()()()()()()()()()()),t&2&&(c("pageData",T(1,6,o.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),l(26),c("href","/menu/Adjustment/Adjustment/Archive/Info?ID="+o.storeService.OrderComplete().OrderID,vn),l(),I("Adjustment #",o.storeService.OrderComplete().InvoiceNumber),l(2),F(o.cartItems),l(6),I(" ",T(36,8,o.storeService.QtyCartItems())," "))},dependencies:[An,lt,On,je,G],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 Nd=["qty"];function Fd(n,e){if(n&1&&(a(0,"div",16)(1,"div",17)(2,"div"),s(3),r(),a(4,"small",18),s(5),r()()()),n&2){let t=e.data;l(3),S(t==null?null:t.Value),l(2),S(t==null?null:t.Code)}}var Cn=class n{modalConfig=new Ct;cartService=h(It);cartItem=K(null);query=new ve(null);form;#t=h(_t);unsubscribe$=new ht;#e=h(Fe);quantityRef;focusTimeoutID;ngZone=h(bn);constructor(){this.modalConfig.customWidth="650px",this.modalConfig.title="Add Item"}onOK(){this.#t.close({type:"OK"});let e=this.cartItem();e.Quantity=this.form.get("Quantity").value,e.Price=this.form.get("Price").value,e.Cost=this.form.get("Cost").value,e.Note=this.form.get("Note").value,this.cartService.onAddCartItem(e,!0,e.Quantity)}onChangeNote(e){this.form.get("Note").setValue(e)}onClose(){this.#t.close({type:"close"})}onCancel(){this.#t.close({type:"cancel"})}initForm(){this.form=this.#e.group({Quantity:[""],Price:[""],Cost:[""],Note:[""]})}ngOnInit(){this.initForm(),this.query.valueChanges.pipe(Tt(this.unsubscribe$),ot(e=>this.cartService.httpGetVariantByID(e,!1).pipe()),ze("get cart item")).subscribe({next:e=>{this.focusTimeoutID=setTimeout(()=>{this.quantityRef&&this.quantityRef.nativeElement&&(this.quantityRef.nativeElement.focus(),this.quantityRef.nativeElement.select())},0),this.cartItem.set(e),this.form.patchValue({Quantity:e.Quantity,Price:e.Price,Cost:e.Cost,Note:e.Note}),this.modalConfig.title=e.Variant.Name}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete(),this.focusTimeoutID&&clearTimeout(this.focusTimeoutID)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["adjustment-modal-cart-add"]],viewQuery:function(t,o){if(t&1&&Gt(Nd,5),t&2){let i;zt(i=Kt())&&(o.quantityRef=i.first)}},decls:29,vars:6,consts:[["itemTemplate",""],["qty",""],[3,"onCancel","onClose","onOk","config"],[1,"container","w-100","h-100"],[1,"row"],[1,"col-12"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"keyup.enter","formControl","renderThumbnail","useCustomTemplate","itemTemplate"],[3,"formGroup"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["autoNum","","formControlName","Price","type","text",1,"mt-5","form-control",2,"width","100px"],["autoNum","","formControlName","Cost","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"mb-5"],["formControlName","Note","height","220px"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"]],template:function(t,o){if(t&1){let i=v();a(0,"modal-material",2),_("onCancel",function(){return p(i),u(o.onCancel())})("onClose",function(){return p(i),u(o.onCancel())})("onOk",function(){return p(i),u(o.onOK())}),a(1,"content")(2,"div",3)(3,"div",4)(4,"div",5)(5,"autocompleteV2",6),_("keyup.enter",function(x){return p(i),u(x.stopPropagation())}),r(),E(6,Fd,6,2,"ng-template",null,0,$),r()(),a(8,"div",7)(9,"div",8)(10,"div",9)(11,"h5"),s(12,"Qty"),r(),f(13,"input",10,1),r(),a(15,"div",11)(16,"h5"),s(17,"Price"),r(),f(18,"input",12),r(),a(19,"div",11)(20,"h5"),s(21,"Cost"),r(),f(22,"input",13),r()(),At(23),a(24,"div",8)(25,"div",5)(26,"h5",14),s(27,"Note"),r(),f(28,"POS-tinymce-editor",15),r()(),jt(),r()()()()}if(t&2){let i=J(7);c("config",o.modalConfig),l(5),c("formControl",o.query)("renderThumbnail",!0)("useCustomTemplate",!0)("itemTemplate",i),l(3),c("formGroup",o.form)}},dependencies:[Be,Qt,We,Xt,ut,gt,No,Se,St,B,ke,mo,Ve,Ne,Ie,Ke],encapsulation:2})};var Dr=wi(ta());function Ud(n,e){if(n&1){let t=v();a(0,"POS-uppy",3),_("onParser",function(i){p(t);let d=m(2);return u(d.onParser(i))})("fileUploaded",function(i){p(t);let d=m(2);return u(d.onUploadCsv(i))})("fileRemoved",function(){p(t);let i=m(2);return u(i.onRemovedFile())}),r()}if(n&2){let t=m(2);c("sampleUrl",t.sampleImportFileUrl)}}function Ld(n,e){if(n&1){let t=v();a(0,"POS-uppy",3),_("onParser",function(i){p(t);let d=m(2);return u(d.onParser(i))})("fileUploaded",function(i){p(t);let d=m(2);return u(d.onUploadCsv(i))})("fileRemoved",function(){p(t);let i=m(2);return u(i.onRemovedFile())}),r()}if(n&2){let t=m(2);c("sampleUrl",t.sampleImportFileUrl)}}function Qd(n,e){if(n&1&&(C(0,Ud,1,1,"POS-uppy",2),C(1,Ld,1,1,"POS-uppy",2)),n&2){let t=m();g(t.uploadState()===t.uploadStateEnum.Idle||t.uploadState()===t.uploadStateEnum.Uploading?0:-1),l(),g(t.uploadState()===t.uploadStateEnum.Success||t.uploadState()===t.uploadStateEnum.Error?1:-1)}}var fi=class n{modalConfig;sampleImportFileUrl=ro.files.csv.adjustment_item_import;fileInput=K(null);unsubscribe$=new ht;#t=h(_t);#e=h(L);#n=h(z);#i=h(It);#o=h(yt);cartItem=K([]);skipEmptyLines=!0;rowCount=K(0);rowEmpty=K(0);totalRows=he(()=>this.rowCount()-this.rowEmpty());file=K(null);uploadState=K(0);uploadStateEnum=Ln;constructor(){this.modalConfig=new Ct,this.modalConfig.title="Import Items",this.modalConfig.customWidth="500px"}onOK(){this.uploadState.set(1);let e={EntityID:this.#n.Outlet().ID,CartItems:this.cartItem()};return this.#e.post("/API/Adjustment/UploadCsvV2",e).pipe(ze("response"),ge(t=>(t instanceof Pn&&this.uploadState.set(3),[])),Q(t=>{Array.isArray(t)&&t.length>0&&(this.uploadState.set(2),t.map(o=>(delete o?.Discount,delete o?.DiscountAmount,o)).forEach(o=>{this.#i.onAddCartItem(o,!0,o.Quantity)}),this.#t.close())}),xn(1)).subscribe()}onCancel(){this.#t.close()}onClose(){this.#t.close()}assignFile(e){this.fileInput.set(e)}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}ngOnInit(){}onRemovedFile(){this.file.set(null),this.rowCount.set(0),this.rowEmpty.set(0)}onUploadCsv(e){let t;e instanceof Blob&&(t=new File([e],"file.csv",{type:e.type})),e instanceof File&&(t=e),this.file.set(t),Dr.default.parse(t,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:o=>{let i=o.split(/\r?\n/).slice(1);return i[i.length-1]===""&&i.pop(),this.rowCount.set(i.length),i.forEach(d=>{d.split(",").every(b=>b==="")&&this.rowEmpty.update(b=>b+=1)}),o},error(o,i){console.log("ERROR",o,i)},complete:(o,i)=>{console.log("COMPLETE",o),this.cartItem.set(o.data),console.log("row count",this.rowCount),console.log("row empy",this.rowEmpty)}})}onParser(e){console.log("row",e),this.cartItem.set(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["adjustment-modal-cart-upload"]],decls:3,vars:1,consts:[["modalContent",""],[3,"onOk","onCancel","onClose","config"],[3,"sampleUrl"],[3,"onParser","fileUploaded","fileRemoved","sampleUrl"]],template:function(t,o){if(t&1){let i=v();a(0,"modal-material",1),_("onOk",function(){return p(i),u(o.onOK())})("onCancel",function(){return p(i),u(o.onClose())})("onClose",function(){return p(i),u(o.onClose())}),E(1,Qd,2,2,"ng-template",null,0,$),r()}t&2&&c("config",o.modalConfig)},dependencies:[ut,gt,Je],encapsulation:2})};function Rd(n,e){if(n&1){let t=v();a(0,"li",11),_("click",function(){let i=p(t).$implicit,d=m(3);return u(d.onClickMenu(i))}),f(1,"POS-dropdown-item-more-action",12),r()}if(n&2){let t=e.$implicit;l(),c("icon",t.icon)("label",t.title)}}function Bd(n,e){if(n&1&&N(0,Rd,2,2,"li",10,et),n&2){let t=m().$implicit;F(t.children)}}function Hd(n,e){if(n&1&&(a(0,"div",7)(1,"div",8),s(2),r(),f(3,"div",9),C(4,Bd,2,0),r()),n&2){let t=e.$implicit;l(2),S(t.title),l(2),g(t.children.length>0?4:-1)}}var hi=class n{menu=K([]);#t=h(it);router=h(Lt);handleF8(){this.#t.openDialogs&&this.#t.openDialogs.length>0||this.#t.open(Cn)}constructor(){}ngOnInit(){this.#e()}#e(){let e=[{title:"Item",icon:"",children:[{title:"Add",value:"add",icon:"fa-circle-plus fa-solid"},{title:"Upload",icon:"fa-solid fa-upload",value:"upload"}]}];this.menu.set(e)}onClickMenu(e){switch(e.value){case"add":this.#t.open(Cn);break;case"upload":this.#t.open(fi);break}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["adjustment-more-actions"]],hostBindings:function(t,o){t&1&&_("keydown.F4",function(d){return o.handleF8(d)},Wt)},decls:10,vars:0,consts:[["id","moreMenu","data-bs-toggle","dropdown",1,"d-flex","align-items-center","cursor-pointer"],[1,"me-2"],[1,"fa-solid","fa-caret-down","fa-lg"],[1,"fs-6","headings-font-family","pb-1"],[1,"h-100","d-flex","align-items-center","justify-content-between"],["aria-labelledby","moreMenu",1,"dropdown-menu","more-actions",2,"min-width","150px"],[1,"d-flex"],[1,"dropdown-header","text-dark","col"],[1,"h5","mb-4"],[1,"dropdown-divider","m-0"],[1,"cursor-pointer"],[1,"cursor-pointer",3,"click"],[3,"icon","label"]],template:function(t,o){t&1&&(a(0,"span",0)(1,"span",1),f(2,"i",2),r(),a(3,"span",3),s(4,"More Actions"),r()(),a(5,"div",4)(6,"div",5)(7,"div",6),N(8,Hd,5,2,"div",7,et),r()()()),t&2&&(l(8),F(o.menu()))},dependencies:[Yo],encapsulation:2})};var Hi=class{constructor(e,t,o,i){this._Order=e,this._Items=t,this._OrderItems=o,this._CountedItems=i}_Order;get Order(){return this._Order}set Order(e){this._Order=e}_Items;get Items(){return this._Items}set Items(e){this._Items=e}_OrderItems;get OrderItems(){return this._OrderItems}set OrderItems(e){this._OrderItems=e}_CountedItems;get CountedItems(){return this._CountedItems}set CountedItems(e){this._CountedItems=e}},yi=class n{adapt(e){return new Hi(e.Order,e.Items,e.OrderItems,e.CountedItems)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})},Wi=class{constructor(e,t,o,i,d,x,b,nt,rt,st,Dt,Vt,ie,oe,re,ae,le,se,de,me,ce,pe){this._EntityID=e,this._Number=t,this._Date=o,this._PIC=i,this._Note=d,this._EntityName=x,this._StateID=b,this._StateLabel=nt,this._ReviewDate=rt,this._ReviewerID=st,this._TypeID=Dt,this._TypeLabel=Vt,this._Quantity=ie,this._UnitPrice=oe,this._UnitCost=re,this._TotalPrice=ae,this._AdjustedQuantity=le,this._CreatorID=se,this._Created=de,this._ModifierID=me,this._Modified=ce,this._ID=pe}_EntityID;get EntityID(){return this._EntityID}set EntityID(e){this._EntityID=e}_Number;get Number(){return this._Number}set Number(e){this._Number=e}_Date;get Date(){return this._Date}set Date(e){this._Date=e}_PIC;get PIC(){return this._PIC}set PIC(e){this._PIC=e}_Note;get Note(){return this._Note}set Note(e){this._Note=e}_EntityName;get EntityName(){return this._EntityName}set EntityName(e){this._EntityName=e}_StateID;get StateID(){return this._StateID}set StateID(e){this._StateID=e}_StateLabel;get StateLabel(){return this._StateLabel}set StateLabel(e){this._StateLabel=e}_ReviewDate;get ReviewDate(){return this._ReviewDate}set ReviewDate(e){this._ReviewDate=e}_ReviewerID;get ReviewerID(){return this._ReviewerID}set ReviewerID(e){this._ReviewerID=e}_TypeID;get TypeID(){return this._TypeID}set TypeID(e){this._TypeID=e}_TypeLabel;get TypeLabel(){return this._TypeLabel}set TypeLabel(e){this._TypeLabel=e}_Quantity;get Quantity(){return this._Quantity}set Quantity(e){this._Quantity=e}_UnitPrice;get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}_UnitCost;get UnitCost(){return this._UnitCost}set UnitCost(e){this._UnitCost=e}_TotalPrice;get TotalPrice(){return this._TotalPrice}set TotalPrice(e){this._TotalPrice=e}_AdjustedQuantity;get AdjustedQuantity(){return this._AdjustedQuantity}set AdjustedQuantity(e){this._AdjustedQuantity=e}_CreatorID;get CreatorID(){return this._CreatorID}set CreatorID(e){this._CreatorID=e}_Created;get Created(){return this._Created}set Created(e){this._Created=e}_ModifierID;get ModifierID(){return this._ModifierID}set ModifierID(e){this._ModifierID=e}_Modified;get Modified(){return this._Modified}set Modified(e){this._Modified=e}_ID;get ID(){return this._ID}set ID(e){this._ID=e}},Tr=class n{adapt(e){return new Wi(e.EntityID,e.Number,e.Date,e.PIC,e.Note,e.EntityName,e.StateID,e.StateLabel,e.ReviewDate,e.ReviewerID,e.TypeID,e.TypeLabel,e.Quantity,e.UnitPrice,e.UnitCost,e.TotalPrice,e.AdjustedQuantity,e.CreatorID,e.Created,e.ModifierID,e.Modified,e.ID)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})},qi=class{constructor(e,t,o,i,d,x,b,nt,rt,st,Dt,Vt){this._LostNFoundID=e,this._UnitCost=t,this._InventoryTypeID=o,this._UnitPrice=i,this._Discount=d,this._VariantID=x,this._Note=b,this._Quantity=nt,this._UnitQuantity=rt,this._Index=st,this._Serial=Dt,this._ID=Vt}_LostNFoundID;get LostNFoundID(){return this._LostNFoundID}set LostNFoundID(e){this._LostNFoundID=e}_UnitCost;get UnitCost(){return this._UnitCost}set UnitCost(e){this._UnitCost=e}_InventoryTypeID;get InventoryTypeID(){return this._InventoryTypeID}set InventoryTypeID(e){this._InventoryTypeID=e}_UnitPrice;get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}_Discount;get Discount(){return this._Discount}set Discount(e){this._Discount=e}_VariantID;get VariantID(){return this._VariantID}set VariantID(e){this._VariantID=e}_Note;get Note(){return this._Note}set Note(e){this._Note=e}_Quantity;get Quantity(){return this._Quantity}set Quantity(e){this._Quantity=e}_UnitQuantity;get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(e){this._UnitQuantity=e}_Index;get Index(){return this._Index}set Index(e){this._Index=e}_Serial;get Serial(){return this._Serial}set Serial(e){this._Serial=e}_ID;get ID(){return this._ID}set ID(e){this._ID=e}},Pr=class n{adapt(e){return new qi(e.LostNFoundID,e.UnitCost,e.InventoryTypeID,e.UnitPrice,e.Discount,e.VariantID,e.Note,e.Quantity,e.UnitQuantity,e.Index,e.Serial,e.ID)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})},Gi=class{constructor(e,t,o,i,d,x,b,nt,rt,st,Dt,Vt){this._ParentID=e,this._Start=t,this._Finish=o,this._UnitPrice=i,this._UnitCost=d,this._VariantID=x,this._Note=b,this._Quantity=nt,this._UnitQuantity=rt,this._Index=st,this._Serial=Dt,this._ID=Vt}_ParentID;get ParentID(){return this._ParentID}set ParentID(e){this._ParentID=e}_Start;get Start(){return this._Start}set Start(e){this._Start=e}_Finish;get Finish(){return this._Finish}set Finish(e){this._Finish=e}_UnitPrice;get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}_UnitCost;get UnitCost(){return this._UnitCost}set UnitCost(e){this._UnitCost=e}_VariantID;get VariantID(){return this._VariantID}set VariantID(e){this._VariantID=e}_Note;get Note(){return this._Note}set Note(e){this._Note=e}_Quantity;get Quantity(){return this._Quantity}set Quantity(e){this._Quantity=e}_UnitQuantity;get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(e){this._UnitQuantity=e}_Index;get Index(){return this._Index}set Index(e){this._Index=e}_Serial;get Serial(){return this._Serial}set Serial(e){this._Serial=e}_ID;get ID(){return this._ID}set ID(e){this._ID=e}},wr=class n{adapt(e){return new Gi(e.ParentID,e.Start,e.Finish,e.UnitPrice,e.UnitCost,e.VariantID,e.Note,e.Quantity,e.UnitQuantity,e.Index,e.Serial,e.ID)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})};var Mr=wi(ko());function Wd(n,e){if(n&1&&f(0,"adjustment-order-complete",0),n&2){let t=m();c("cartItems",t.storeService.CartItems())}}function qd(n,e){if(n&1){let t=v();a(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"POS-select-outlet-form",6),y(6,"async"),_("ngModelChange",function(i){p(t);let d=m();return u(d.storeService.onChangeOutlet(i))}),r(),a(7,"POS-invoice-number-form",7),y(8,"async"),_("ngModelChange",function(i){p(t);let d=m();return u(d.onInvoiceNumberChange(i))}),r()(),a(9,"POS-invoice-date",8),_("ngModelChange",function(i){p(t);let d=m();return u(d.onChangeOrderDate(i))}),r()()(),a(10,"div",9)(11,"div",10)(12,"div",11),f(13,"adjustment-more-actions"),r(),a(14,"div",12),f(15,"i",13),a(16,"ng-select",14),_("ngModelChange",function(i){p(t);let d=m();return u(d.onChangeAdjustmentType(i))}),r()()()()(),a(17,"div",15)(18,"div",16)(19,"POS-quick-key",17),_("onSelectVariant",function(i){p(t);let d=m();return u(d.onSelectVariant(i))}),r()(),a(20,"div",18),f(21,"adjustment-cart"),r()()()}if(n&2){let t=m();l(5),c("disabled",t.storeService.AdjustmentState()===1)("isOpenAfterLoad",T(6,16,t.isOpenDiaglog$))("outlets",t.storeService.Outlets())("ngModel",t.storeService.Outlet()),l(2),c("ngModel",t.storeService.Order().Number)("transactionType",T(8,18,t.transactionType$))("disabled",!(t.roleService.global!=null&&t.roleService.global.Number)),l(2),c("ngModel",t.storeService.Order().Date)("disabled",!(t.roleService.global!=null&&t.roleService.global.Date))("tooltip",t.roleService.global!=null&&t.roleService.global.Date?"":"Date role is required"),l(7),c("clearable",!1)("ngModel",t.storeService.Order().TypeID)("disabled",!!t.storeService.Order().TypeID&&t.storeService.AdjustmentState()===1)("items",t.storeService.AdjustmentTypes()),l(3),c("quickKey",t.storeService.QuickeyItems())("outletID",t.storeService.Outlet().ID)}}var xi=class n{isOpenDialog=K(!0);loadFormService=h(Ye);intercom=h(co);storeService=h(z);quickeyService=h(ri);cartService=h(It);orderService=h(Bt);isOpenDiaglog$;Outlets$;loadForm$;adjustmentEditDataAdapter=h(yi);roleService=h(H);#t=h(ne);#e=h(tn);#n=h(xe);transactionType$=this.#n.queryParamMap.pipe(Ot(e=>(e.has("ID"),"Adjustment")));title=h(wn);injector=h(yt);test=[];ngOnInit(){this.storeService.onResetState(),this.intercom.hideLauncher();let e=JSON.parse(localStorage.getItem("AccountInfo"));this.title.setTitle(e.BrandName+" POS | Inventory Adjustment"),this.test=this.storeService.Outlets()&&this.storeService.Outlets().filter((t,o)=>o===0),this.#n.queryParamMap.pipe(ot(t=>{if(t.has("ID")){this.storeService.onChangeAdjustmentState(1);let o={EntityID:"00000000-0000-0000-0000-000000000000",ID:t.get("ID")};return this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeAdjustmentState(1),this.loadFormService.httpRequestLoadForm$(o).pipe(Q(i=>{if(i.Data&&Object.keys(i.Data).length>0&&Object.keys(this.storeService.LoadForm().Data).length>0){this.orderService.onUpdateOrderState("Number",i.Data.Order.Number),this.orderService.onUpdateOrderState("Date",new Date(i.Data.Order.Date)),this.orderService.onUpdateOrderState("StateID",i.Data.Order.StateID),this.orderService.onUpdateOrderState("TypeID",i.Data.Order.TypeID),this.orderService.onUpdateOrderState("EntityID",i.Data.Order.EntityID);let d=i.Data.Items.map(x=>this.#t.adapt(R(j({},x),{Variant:this.#e.adapt(x.Variant)})));if(this.storeService.onChangeCartItems(d),this.orderService.onUpdateOrderState("PIC",i.Data.Order.PIC),this.orderService.onUpdateOrderState("Note",i.Data.Order.Note),this.orderService.onUpdateOrderState("TagID",i.Data.Order.TagID),i.Entities.length>0){let x=i.Entities.findIndex(b=>b.ID===i.Data.Order.EntityID);x!==-1&&this.storeService.onChangeOutlet(i.Entities[x])}}}))}return this.storeService.onChangeAdjustmentState(0),this.loadFormService.httpRequestLoadForm$()})).subscribe({}),Pt(this.storeService.IsOpenDialog,{injector:this.injector}).pipe().subscribe(),this.isOpenDiaglog$=Pt(this.storeService.IsOpenDialog,{injector:this.injector})}onChangeAdjustmentType(e){let t=this.storeService.AdjustmentTypes().filter(o=>o.Key===e)[0];this.orderService.onUpdateOrderState("TypeID",t.Key)}onInvoiceNumberChange(e){this.orderService.onUpdateOrderState("Number",e)}onChangeOrderDate(e){this.orderService.onUpdateOrderState("Date",(0,Mr.default)(e).startOf("day").format("YYYY-MM-DDTHH:mm:ss.SSS"))}onSelectVariant(e){this.cartService.addItemByVariantID(e)}ngOnDestroy(){this.storeService.onResetState(),this.intercom.showLauncher()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["POS-adjustment-v2"]],decls:2,vars:1,consts:[[3,"cartItems"],[1,"container-fluid","overflow-x-hidden"],[1,"row","header","border-bottom"],[1,"col-5","border-end"],[1,"left-toolbar-container","h-100","d-flex","align-items-center","justify-content-between"],[1,"d-flex","flex-column"],[3,"ngModelChange","disabled","isOpenAfterLoad","outlets","ngModel"],[3,"ngModelChange","ngModel","transactionType","disabled"],[3,"ngModelChange","ngModel","disabled","tooltip"],[1,"col-7","d-flex","align-items-center"],[1,"row","flex-grow-1"],[1,"col-4","d-flex","align-items-center"],[1,"col","ps-0","d-flex","align-items-center","justify-content-end","gap-1"],[1,"fa-regular","fa-sliders"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",1,"",3,"ngModelChange","clearable","ngModel","disabled","items"],[1,"row","content"],[1,"col-5","border-end",2,"height","inherit"],[3,"onSelectVariant","quickKey","outletID"],[1,"col-7",2,"height","calc(100% - 0)","padding","0"]],template:function(t,o){t&1&&C(0,Wd,1,1,"adjustment-order-complete",0)(1,qd,22,20,"div",1),t&2&&g(o.storeService.IsComplete()?0:1)},dependencies:[Uo,zo,Ko,Go,Jt,B,X,pt,Ci,gi,hi,je],styles:[".left-toolbar-container[_ngcontent-%COMP%]{position:relative}.left-toolbar-container[_ngcontent-%COMP%] POS-invoice-number-form[_ngcontent-%COMP%]{position:absolute;top:34px;left:32px}.header[_ngcontent-%COMP%]{min-height:60px}.content[_ngcontent-%COMP%]{height:calc(100vh - 60px);overflow:hidden}.supplier-more-menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.cart-display[_ngcontent-%COMP%]{flex-grow:1;height:0px;overflow-y:auto}input[_ngcontent-%COMP%]{width:100%;height:38px!important;border:0;border-bottom:1px solid #ced4da;padding-left:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i[_ngcontent-%COMP%]{font-size:16px;top:10.6px;left:13px}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]{transition:.4s}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(1){-webkit-transform:rotate(-45deg) translate(-8px,4px);transform:rotate(-45deg) translate(-8px,4px)}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(2){opacity:0}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(45deg) translate(-5px,0px);transform:rotate(45deg) translate(-5px)}.mobile-button[_ngcontent-%COMP%]{display:none}@media (max-width: 990px){.mobile-button[_ngcontent-%COMP%]{display:block}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.more-actions[_ngcontent-%COMP%] div.d-flex[_ngcontent-%COMP%]{width:30rem}[_nghost-%COMP%] .ng-select .ng-select-container{border:none}"]})};var Gd=()=>["/menu/Adjustment/Adjustment/Archive/Info"],zd=n=>({ID:n});function Kd(n,e){if(n&1){let t=v();a(0,"button",10),_("click",function(){p(t);let i=m(2);return u(i.openExportModal())}),f(1,"i",11),s(2," Export "),r()}}function $d(n,e){if(n&1){let t=v();a(0,"div")(1,"div",12)(2,"h6"),s(3,"Variant"),r(),a(4,"autocompleteV2",13),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.ID,i)||(d.pageData.Filter.ID=i),u(i)}),r(),a(5,"h6"),s(6,"Outlet"),r(),a(7,"ng-select",14),w("ngModelChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.EntityID,i)||(d.pageData.Filter.EntityID=i),u(i)}),r(),a(8,"h6"),s(9,"From"),r(),a(10,"datepicker",15),w("dateChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.From,i)||(d.pageData.Filter.From=i),u(i)}),r(),a(11,"h6"),s(12,"To"),r(),a(13,"datepicker",16),w("dateChange",function(i){p(t);let d=m(2);return P(d.pageData.Filter.To,i)||(d.pageData.Filter.To=i),u(i)}),r()()()}if(n&2){let t=m(2);l(4),M("ngModel",t.pageData.Filter.ID),c("inputTextValue",t.pageData.Filter.VariantName),l(3),c("items",t.pageData.Options.Entities),M("ngModel",t.pageData.Filter.EntityID),l(3),c("isFloatingLabel",!1),M("date",t.pageData.Filter.From),l(3),c("isFloatingLabel",!1),M("date",t.pageData.Filter.To)}}function Jd(n,e){n&1&&(a(0,"th"),s(1,"Variant"),r())}function Zd(n,e){if(n&1&&(a(0,"td"),s(1),r()),n&2){let t=m().$implicit;l(),S(t.Name)}}function Xd(n,e){if(n&1&&(a(0,"tr",8),C(1,Zd,2,1,"td"),y(2,"async"),a(3,"td"),s(4),r(),a(5,"td")(6,"a",17),s(7),r()(),a(8,"td"),s(9),y(10,"number"),r(),a(11,"td"),s(12),y(13,"date"),r()()),n&2){let t=e.$implicit,o=m(2);l(),g(T(2,7,o.isRedirect$)?-1:1),l(3),S(t.EntityName),l(2),c("routerLink",Z(14,Gd))("queryParams",k(15,zd,t.ID)),l(),S(t.Number),l(2),S(T(10,9,t.Quantity)),l(3),S(V(13,11,t.Date,"dd/MM/yy"))}}function Yd(n,e){if(n&1){let t=v();a(0,"mainpanel-cmp",2),w("textChange",function(i){p(t);let d=m();return P(d.pageData.Filter.Number,i)||(d.pageData.Filter.Number=i),u(i)}),_("onSubmit",function(){p(t);let i=m();return u(i.searchFromPageOne())}),w("filterChange",function(i){p(t);let d=m();return P(d.pageData.Filter,i)||(d.pageData.Filter=i),u(i)}),a(1,"actions"),C(2,Kd,3,0,"button",3),r(),a(3,"filters"),E(4,$d,14,8,"ng-template",null,0,$),r(),a(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr"),C(12,Jd,2,0,"th"),y(13,"async"),a(14,"th"),s(15,"Outlet"),r(),a(16,"th"),s(17,"Number"),r(),a(18,"th"),s(19,"Quantity"),r(),a(20,"th"),s(21,"Date"),r()()(),a(22,"tbody"),N(23,Xd,14,17,"tr",8,et),r()()(),a(25,"POS-complex-pagination",9),_("jumpToPage",function(){p(t);let i=m();return u(i.getListData())})("previousPage",function(){p(t);let i=m();return u(i.getListData())})("nextPage",function(){p(t);let i=m();return u(i.getListData())}),r()()()()}if(n&2){let t=m();c("pageData",t.menuData),M("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),M("filter",t.pageData.Filter),l(2),g(t.roleService.global.Export?2:-1),l(10),g(T(13,8,t.isRedirect$)?-1:12),l(11),F(t.data.Data),l(2),c("total",t.data.Data==null?null:t.data.Data.length)("pageData",t.pageData)}}var vi=class n extends bt{constructor(t,o,i,d,x){super(t,o,"catalog/product/GetAdjustmentHistory","catalog/productLoader/GetAdjustmentHistoryLoader",null,i);this.matDialog=d;this.roleService=x;this.isRedirect$=hn(this.route.snapshot.queryParamMap).pipe(Ot(b=>b.has("ID")),xn(1))}isRedirect$;openExportModal(){this.matDialog.open(Rt,{data:{title:"Adjustment History",exportTypes:[{ID:"ProductExport/GetAdjustmentHistory",Value:"Default",FileName:"Adjustment History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"catalog/product/GetCountAdjustmentHistory",pagination:!0}})}static \u0275fac=function(o){return new(o||n)(D(at),D(L),D(xe),D(it),D(H))};static \u0275cmp=O({type:n,selectors:[["POS-history-variant"]],standalone:!1,features:[mt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border-bottom"],["api","catalog/product/GetCountAdjustmentHistory",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Variant","inputID","ID","notFoundMessageFor","variant",1,"form-control","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModelChange","items","ngModel"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],["target","_blank",3,"routerLink","queryParams"]],template:function(o,i){o&1&&C(0,Yd,26,10,"mainpanel-cmp",1),o&2&&g(i.data?0:-1)},dependencies:[ct,lt,B,X,Ge,pt,Xt,te,je,G,$t],encapsulation:2})};function tm(n,e){if(n&1){let t=v();a(0,"div",3)(1,"h6",1),s(2,"Category"),r(),a(3,"POS-product-category-select",10),w("selectedCategoryIDChange",function(i){p(t);let d=m();return P(d.categoryId,i)||(d.categoryId=i),u(i)}),_("selectedCategoryIDChange",function(){p(t);let i=m();return u(i.toggleTotalRows=!1)}),r()(),a(4,"div",3)(5,"h6",1),s(6,"Supplier"),r(),a(7,"autocompleteV2",11),w("ngModelChange",function(i){p(t);let d=m();return P(d.supplierID,i)||(d.supplierID=i),u(i)}),_("ngModelChange",function(){p(t);let i=m();return u(i.toggleTotalRows=!1)}),r()(),a(8,"div",3)(9,"h6"),s(10,"Brand"),r(),a(11,"ng-select",12),w("ngModelChange",function(i){p(t);let d=m();return P(d.loader.Filter.BrandID,i)||(d.loader.Filter.BrandID=i),u(i)}),_("ngModelChange",function(){p(t);let i=m();return u(i.toggleTotalRows=!1)}),r()()}if(n&2){let t=m();l(3),M("selectedCategoryID",t.categoryId),c("showClear",!0)("continuedCategoriesOnly",!0),l(4),M("ngModel",t.supplierID),l(4),c("items",t.loader.Options==null?null:t.loader.Options.BrandOptions),M("ngModel",t.loader.Filter.BrandID)}}function em(n,e){if(n&1){let t=v();a(0,"span",13),_("click",function(){p(t);let i=m();return u(i.getTotalRows())}),f(1,"i",14),r()}}function nm(n,e){if(n&1&&(a(0,"span"),s(1),y(2,"number"),r()),n&2){let t=m();l(),I("",T(2,1,t.totalRows)," rows")}}var Si=class n{constructor(e,t,o){this.dialogRef=e;this.http=o;this.configModal=new Ct,this.configModal.title="Download Template",this.configModal.customWidth="400px",this.configModal.hideScrollbar=!0,this.configModal.okText="Download",this.loader=t.loader,this.outletId=t.outletID}toggleTotalRows=!1;totalRows=0;exportFormat="CSV";configModal;onHandInventory=!0;stockCount="0";categoryId=null;supplierID=null;outletId="";loader;stockCountOptions=[{Key:"0",Value:"Full Count"},{Key:"1",Value:"Partial Count"}];exportFormatOptions=[{Key:"CSV",Value:"CSV"},{Key:"XLSX",Value:"XLSX"}];close(){this.dialogRef.close()}confirm(){this.dialogRef.close({IncludeZeroOnHand:this.onHandInventory,CategoryID:this.stockCount==="1"?this.categoryId:null,From:this.loader?.Filter.From,To:this.loader?.Filter.To,FormatType:this.exportFormat=="CSV"?0:this.exportFormat=="XLSX"?1:2,SupplierID:this.stockCount==="1"?this.supplierID:null,BrandID:this.stockCount==="1"?this.loader?.Filter.BrandID:null})}getTotalRows(){this.http.post("/api/InventoryExport/GetStockTakeSpreadsheetV2Count",{OutletID:this.outletId,IncludeZeroOnHand:this.onHandInventory,CategoryID:this.stockCount==="1"?this.categoryId:null,SupplierID:this.stockCount==="1"?this.supplierID:null,From:this.loader?.Filter.From,To:this.loader?.Filter.To,BrandID:this.stockCount==="1"?this.loader?.Filter.BrandID:null}).subscribe(e=>{this.totalRows=e.Count,this.toggleTotalRows=!0})}static \u0275fac=function(t){return new(t||n)(D(_t),D(Zt),D(L))};static \u0275cmp=O({type:n,selectors:[["POS-dialog-download-template"]],standalone:!1,decls:21,vars:9,consts:[[3,"onOk","onCancel","onClose","config"],[1,"mb-4"],["name","onHandInventory",3,"modelChange","model"],[1,"mt-5"],["name","stockCount",3,"modelChange","model","options"],["name","exportFormat",3,"modelChange","model","options"],[1,"col-12","mt-8"],[1,"p-3",2,"background-color","#add8e6","border-radius","4px"],[1,"fa-solid","fa-circle-exclamation","mx-3"],[2,"cursor","pointer"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear","continuedCategoriesOnly"],["requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose...","appendTo","body",3,"ngModelChange","items","ngModel"],[2,"cursor","pointer",3,"click"],[1,"fa-solid","fa-circle-question","mt-1",2,"font-size","14px"]],template:function(t,o){t&1&&(a(0,"modal-material",0),_("onOk",function(){return o.confirm()})("onCancel",function(){return o.close()})("onClose",function(){return o.close()}),a(1,"content")(2,"div")(3,"h6",1),s(4,"On Hand Inventory < 1"),r(),a(5,"radio-options",2),w("modelChange",function(d){return P(o.onHandInventory,d)||(o.onHandInventory=d),d}),_("modelChange",function(){return o.toggleTotalRows=!1}),r()(),a(6,"div",3)(7,"h6",1),s(8,"Stock Count"),r(),a(9,"radio-options",4),w("modelChange",function(d){return P(o.stockCount,d)||(o.stockCount=d),d}),_("modelChange",function(){return o.toggleTotalRows=!1}),r()(),C(10,tm,12,6),a(11,"div",3)(12,"h6",1),s(13,"Format"),r(),a(14,"radio-options",5),w("modelChange",function(d){return P(o.exportFormat,d)||(o.exportFormat=d),d}),_("modelChange",function(){return o.toggleTotalRows=!1}),r()(),a(15,"div",6)(16,"div",7),f(17,"i",8),s(18," Exporting data from "),C(19,em,2,0,"span",9),C(20,nm,3,3,"span"),r()()()()),t&2&&(c("config",o.configModal),l(5),M("model",o.onHandInventory),l(4),M("model",o.stockCount),c("options",o.stockCountOptions),l(),g(o.stockCount=="1"?10:-1),l(4),M("model",o.exportFormat),c("options",o.exportFormatOptions),l(5),g(o.toggleTotalRows?-1:19),l(),g(o.toggleTotalRows?20:-1))},dependencies:[B,X,pt,Xt,gt,jn,Yt,G],encapsulation:2})};var im=n=>({"text-danger":n}),om=()=>["/menu/Products/Catalog/Variants/Info"],rm=n=>({ID:n});function am(n,e){if(n&1){let t=v();a(0,"button",38),_("click",function(){p(t);let i=m(),d=J(8);return u(i.onPreview(d))}),s(1," Next "),r()}}function lm(n,e){if(n&1){let t=v();a(0,"button",39),_("click",function(){p(t);let i=m(),d=J(8);return d.selected.completed=!0,i.fileImport=null,d.previous(),u(i.uploadState.set(i.uploadStateEnum.Uploading))}),s(1," Back "),r(),a(2,"button",40),_("click",function(){p(t);let i=m(),d=J(8);return u(i.upload(d))}),s(3," Next "),r()}if(n&2){let t=m();l(2),c("disabled",!t.canProceedPreview)}}function sm(n,e){if(n&1){let t=v();a(0,"button",38),_("click",function(){p(t);let i=m(),d=J(8);return u(i.newUpload(d))}),s(1,"New"),r()}}function dm(n,e){if(n&1&&s(0),n&2){let t=e.index;S(t+1)}}function mm(n,e){n&1&&(f(0,"i",41),s(1,"Upload"))}function cm(n,e){if(n&1&&(a(0,"div",42),s(1),y(2,"limitText"),r()),n&2){let t=e.item;c("title",(t==null||t.Name==null?null:t.Name.length)>23?t.Name:""),l(),I(" ",V(2,2,t.Name,25)," ")}}function pm(n,e){if(n&1){let t=v();a(0,"div",16)(1,"button",43),_("click",function(){p(t);let i=m();return u(i.openDownloadTemplateDialog())}),f(2,"i",44),s(3," Download Template "),r()()}}function um(n,e){if(n&1){let t=v();a(0,"POS-uppy",45),_("fileUploaded",function(i){p(t);let d=m();return u(d.onUploadCsv(i))}),r()}if(n&2){let t=m();c("dashboardPropsConfiguration",t.dashboardPropsConfiguration)("subtitle","Accepted file formats: .csv & max file size: 1 MB")}}function _m(n,e){if(n&1){let t=v();a(0,"POS-uppy",45),_("fileUploaded",function(i){p(t);let d=m();return u(d.onUploadCsv(i))}),r()}if(n&2){let t=m();c("dashboardPropsConfiguration",t.dashboardPropsConfiguration)("subtitle","Accepted file formats: .csv & max file size: 1 MB")}}function Cm(n,e){n&1&&(f(0,"i",46),s(1,"Preview"))}function gm(n,e){n&1&&(a(0,"th",31),s(1," Difference "),r())}function fm(n,e){n&1&&(a(0,"th",32),s(1," Cost "),r())}function hm(n,e){n&1&&(a(0,"th"),s(1," Message "),r())}function ym(n,e){if(n&1&&(a(0,"a",49),s(1),r()),n&2){let t=m().$implicit;c("routerLink",Z(3,om))("queryParams",k(4,rm,t.VariantID)),l(),S(t.VariantName)}}function xm(n,e){if(n&1&&(a(0,"span",50),s(1),r()),n&2){let t=m().$implicit;l(),S(t.VariantName)}}function vm(n,e){if(n&1&&(a(0,"td"),s(1),r()),n&2){let t=m().$implicit;Nt("text-danger",t.Differences<0)("text-success",t.Differences>0),l(),I(" ",t.Differences," ")}}function Sm(n,e){if(n&1&&(a(0,"td"),s(1),y(2,"number"),r()),n&2){let t=m().$implicit;Nt("text-danger",t.CostChange<0)("text-success",t.CostChange>0),l(),I(" ",T(2,5,t.CostChange)," ")}}function bm(n,e){if(n&1&&(a(0,"div"),s(1),r()),n&2){let t=e.$implicit;l(),Ft(" ",t.Issue," ",t.Solution," ")}}function Im(n,e){if(n&1&&(a(0,"td"),N(1,bm,2,2,"div",null,et),r()),n&2){let t=m().$implicit;Nt("bg-gradient-danger",t.Issues==null?null:t.Issues.length),l(),F(t.Issues)}}function Dm(n,e){if(n&1&&(a(0,"tr")(1,"td"),s(2),r(),a(3,"td",47),s(4),r(),a(5,"td",48),C(6,ym,2,6,"a",49),C(7,xm,2,1,"span",50),r(),a(8,"td",48),s(9),r(),a(10,"td",48),s(11),r(),a(12,"td"),s(13),r(),C(14,vm,2,5,"td",51),C(15,Sm,3,7,"td",51),C(16,Im,3,2,"td",52),r()),n&2){let t=e.$implicit,o=e.$index,i=m();l(2),S(o+1+"."),l(),c("ngClass",k(11,im,!t.VariantCode)),l(),I(" ",t.ProductName," "),l(2),g(t.VariantID?6:-1),l(),g(t.VariantID?-1:7),l(2),I(" ",t.VariantCode," "),l(2),I(" ",t.Expected," "),l(2),I(" ",t.Counted," "),l(),g(i.importedDataState!="matched"?14:-1),l(),g(i.role.product.Cost&&i.importedDataState=="unmatched"?15:-1),l(),g(i.importedDataState=="error"||i.importedDataState=="all"?16:-1)}}function Tm(n,e){n&1&&(f(0,"i",53),s(1,"Finish"))}var bi=class n extends bt{constructor(t,o,i,d,x,b,nt,rt){super(t,o,null,"Outlet/GetByUserAccessWrite");this.toastr=i;this.csvConverter=d;this.router=x;this.importService=b;this.roleService=nt;this.matDialog=rt;this.formData={},this.opNames=[],o.get("/api/AdjustmentLoader/ImportAdjustmentV2Loader").subscribe(st=>{this.loader=st,console.log(this.loader)})}loader=null;importedDataState="unmatched";selectedTabIndex=0;sampleUrl="https://cdn.dealpos.xyz/web-import-template/Products_DealPOS4.csv";state="upload";dashboardPropsConfiguration={width:600};fileImport;role=h(H);exp=h(En);cacheKey="";canProceedPreview=!1;importedData=[];summary=["Category","Product","Variant"];summaryData={};uploaded=!1;importHttpResponse=[];isPreviewState=!1;isSuccessState=!1;msgSuccessImport;isDisabledImportBtn=!1;originalData=[];formData;opNames;outletName;uploadState=K(0);uploadStateEnum=Ln;preInitList(){this.formData.EntityID=this.pageData.Entities[0].ID,this.outletName=this.pageData.Entities[0].Name,this.formData.ProductWithoutInventory="1"}getEntityName(t){this.outletName=t.Name}onPreview(t){this.uploadState.set(1),this.selectedTabIndex=0,this.importedDataState="unmatched";let o=this.importService.generateFormData(this.fileImport,null);this.importService.previewImport(`/api/Adjustment/ImportAdjustmentV2Preview?outletID=${this.formData.EntityID}`,o).pipe(ge(i=>(i instanceof Pn&&(this.uploadState.set(3),this.state="upload",console.error("Error during import preview:",i)),yn(()=>i)))).subscribe(i=>{t.selected.completed=!0,t.next(),this.cacheKey=i.CacheKey,this.canProceedPreview=i.CanProceed,this.importedData=i.DataRow,this.summaryData=i.Summary,this.importedData.filter(d=>d.Action=="Error").length>0?(this.importedDataState="error",this.selectedTabIndex=3):this.importedData.filter(d=>d.Action=="Update").length==0&&(this.importedDataState="matched",this.selectedTabIndex=1),this.initIsDisabledImport(),this.uploadState.set(2)})}initIsDisabledImport(){let t=JSON.stringify(this.importHttpResponse).toLowerCase().includes('"statusid":2');this.isDisabledImportBtn=t}alertConfirmInventory(){return!(this.formData.InventoryUpdate&&!confirm("Update Inventory is YES. This is will replace current inventory. Do you want to proceed?"))}onImportFileChange(t){this.fileImport=t,this.isPreviewState=!1}onNewImport(){this.isSuccessState=!1}onUploadCsv(t){this.fileImport=t}selectionChange(t){let o=t.selectedStep.label;this.state=o}postInit(t){this.originalData=t.Data}upload(t){this.httpService.post(`/api/Adjustment/ImportAdjustmentV2Confirm?outletID=${this.formData.EntityID}`,{CacheKey:this.cacheKey}).subscribe(o=>{t.selected.completed=!0,this.toastr.success(o.Message,Y.Success),t.next(),this.uploaded=!0})}newUpload(t){t.reset(),this.uploaded=!1,this.state="upload",this.fileImport=null,this.cacheKey="",this.canProceedPreview=!1,this.importedData=[],this.summaryData={},this.uploadState.set(0)}downloadData(t){t==0?this.exp.exportCSV("InventoryExport/GetStockTakeSpreadsheet",this.formData):this.exp.exportXlsx("InventoryExport/GetStockTakeSpreadsheet",this.formData)}sortData(t){let o=this.importedData.slice();if(!t.active||t.direction===""){this.importedData=this.originalData;return}this.importedData=o.sort((i,d)=>{let x=t.direction==="asc",b=typeof i[t.active];switch(A.IsEmpty(i.Code)&&(i.Code=""),A.IsEmpty(d.Code)&&(d.Code=""),b){case"string":return A.compare(i[t.active].toLocaleLowerCase(),d[t.active].toLocaleLowerCase(),x);case"number":return A.compare(i[t.active],d[t.active],x);default:return 0}})}get filteredData(){return this.importedDataState==="all"?this.importedData:this.importedDataState==="matched"?this.importedData.filter(t=>t.Action=="Unchanged"):this.importedDataState==="unmatched"?this.importedData.filter(t=>t.Action=="Update"):this.importedDataState==="error"?this.importedData.filter(t=>t.Action=="Error"):this.importedData}openDownloadTemplateDialog(){this.matDialog.open(Si,{data:{loader:this.loader,outletID:this.formData.EntityID}}).afterClosed().pipe(dt(t=>A.IsNotEmpty(t))).subscribe(t=>{this.exp.exportCSV("InventoryExport/GetStockTakeSpreadsheetV2",{OutletID:this.formData.EntityID,IncludeZeroOnHand:t.IncludeZeroOnHand,CategoryID:t.CategoryID,From:t.From,To:t.To,FormatType:t.FormatType,SupplierID:t.SupplierID,BrandID:t.BrandID})})}onTabChange(t){t==0?this.importedDataState="unmatched":t==1?this.importedDataState="matched":t==2?this.importedDataState="all":t==3&&(this.importedDataState="error")}static \u0275fac=function(o){return new(o||n)(D(at),D(L),D(vt),D(kt),D(Lt),D(ir),D(H),D(it))};static \u0275cmp=O({type:n,selectors:[["POS-csv-stock-take-v2"]],standalone:!1,features:[mt],decls:71,vars:32,consts:[["stepper",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success"],["orientation","horizontal",3,"selectionChange","linear"],["matStepperIcon","edit"],["label","upload","state","upload",2,"margin-top","50px",3,"editable","completed"],["matStepLabel",""],[1,"row","border-bottom","mt-10","ms-2"],[1,"col-md-2"],[1,"fw-bold"],[1,"h6","fst-italic"],[1,"col-md-10"],[1,"row"],[1,"col-md-12","mb-10",2,"display","flex"],["bindLabel","Name","bindValue","ID",2,"width","200px",3,"ngModelChange","change","items","clearable","ngModel"],["ng-option-tmp",""],[1,"ms-3"],[1,"row","border-bottom","ms-2","mt-10","pb-10"],[1,"col-md-auto"],[3,"dashboardPropsConfiguration","subtitle"],["label","preview","state","preview",3,"editable","completed"],[2,"width","600px",3,"selectedIndexChange","selectedIndex"],[3,"label"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","30px"],["mat-sort-header","ProductName",2,"width","175px"],["mat-sort-header","VariantName",2,"width","175px"],["mat-sort-header","VariantCode",2,"width","100px"],["mat-sort-header","Expected",2,"width","200px"],["mat-sort-header","Counted",2,"width","100px"],["mat-sort-header","Differences",2,"width","75px"],["mat-sort-header","UnitCost",2,"width","100px"],["label","finish","state","finish"],[1,"d-flex","flex-column","align-items-center"],[1,"fa-solid","fa-circle-check","text-success",2,"font-size","110px"],[1,"mt-8"],[1,"fw-normal","mt-2"],[1,"btn","btn-success",3,"click"],[1,"btn","btn-outline-secondary",3,"click"],[1,"btn","btn-success","ms-3",3,"click","disabled"],[1,"fa-solid","fa-upload","me-3"],[3,"title"],["type","button","aria-expanded","false",1,"btn","btn-outline-secondary","mb-2",2,"height","37px !important","font-size","12px !important",3,"click"],[1,"fa","fa-download","me-3"],[3,"fileUploaded","dashboardPropsConfiguration","subtitle"],[1,"fa-regular","fa-file","me-3"],[3,"ngClass"],[2,"word-break","break-word"],[3,"routerLink","queryParams"],[1,"text-danger"],[3,"text-danger","text-success"],[3,"bg-gradient-danger"],[1,"fa-solid","fa-check","me-3"]],template:function(o,i){if(o&1){let d=v();a(0,"mainpanel-cmp",1)(1,"actions"),At(2),C(3,am,2,0,"button",2),jt(),C(4,lm,4,1),C(5,sm,2,0,"button",2),r(),a(6,"content")(7,"mat-stepper",3,0),_("selectionChange",function(b){return p(d),u(i.selectionChange(b))}),E(9,dm,1,1,"ng-template",4),a(10,"mat-step",5),E(11,mm,2,0,"ng-template",6),a(12,"div",7)(13,"div",8)(14,"h5",9),s(15,"Outlet"),r(),a(16,"small",10),s(17,"Stock take location"),r()(),a(18,"div",11)(19,"div",12)(20,"div",13)(21,"div")(22,"ng-select",14),w("ngModelChange",function(b){return p(d),P(i.formData.EntityID,b)||(i.formData.EntityID=b),u(b)}),_("change",function(b){return p(d),u(i.getEntityName(b))}),E(23,cm,3,5,"ng-template",15),r()(),C(24,pm,4,0,"div",16),r()()()(),a(25,"div",17)(26,"div",8)(27,"h5",9),s(28,"Upload File"),r(),a(29,"small",10),s(30,".csv format"),r()(),a(31,"div",18),C(32,um,1,2,"POS-uppy",19),C(33,_m,1,2,"POS-uppy",19),r()()(),a(34,"mat-step",20),E(35,Cm,2,0,"ng-template",6),a(36,"div")(37,"mat-tab-group",21),_("selectedIndexChange",function(b){return p(d),u(i.onTabChange(b))}),f(38,"mat-tab",22)(39,"mat-tab",22)(40,"mat-tab",22)(41,"mat-tab",22),r(),a(42,"table",23),_("matSortChange",function(b){return p(d),u(i.sortData(b))}),a(43,"thead",24)(44,"tr")(45,"th",25),s(46,"No"),r(),a(47,"th",26),s(48," Product "),r(),a(49,"th",27),s(50," Variant "),r(),a(51,"th",28),s(52,"Code"),r(),a(53,"th",29),s(54," Expected "),r(),a(55,"th",30),s(56,"Counted"),r(),C(57,gm,2,0,"th",31),C(58,fm,2,0,"th",32),C(59,hm,2,0,"th"),r()(),a(60,"tbody"),N(61,Dm,17,13,"tr",null,et),r()()()(),a(63,"mat-step",33),E(64,Tm,2,0,"ng-template",6),a(65,"div",34),f(66,"i",35),a(67,"h1",36),s(68,"Adjustment Complete!"),r(),a(69,"h6",37),s(70),r()()()()()()}o&2&&(c("pageData",i.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),l(3),g(i.state=="upload"&&i.fileImport?3:-1),l(),g(i.state=="preview"?4:-1),l(),g(i.state=="finish"?5:-1),l(2),c("linear",!0),l(3),c("editable",!i.uploaded)("completed",!1),l(12),c("items",i.pageData.Entities)("clearable",!1),M("ngModel",i.formData.EntityID),l(2),g(i.role.adjustment.Create||i.role.adjustment.Edit?24:-1),l(8),g(i.uploadState()===i.uploadStateEnum.Idle||i.uploadState()===i.uploadStateEnum.Uploading?32:-1),l(),g(i.uploadState()===i.uploadStateEnum.Success||i.uploadState()===i.uploadStateEnum.Error?33:-1),l(),c("editable",!i.uploaded)("completed",!1),l(3),c("selectedIndex",i.selectedTabIndex),l(),c("label",Pe("Unmatched (",i.summaryData.Updated,")")),l(),c("label",Pe("Matched (",i.summaryData.NoChanges,")")),l(),c("label",Pe("All (",i.summaryData.Total,")")),l(),c("label",Pe("Error (",i.summaryData.Error,")")),l(16),g(i.importedDataState!="matched"?57:-1),l(),g(i.role.product.Cost&&i.importedDataState=="unmatched"?58:-1),l(),g(i.importedDataState=="error"||i.importedDataState=="all"?59:-1),l(2),F(i.filteredData),l(9),Dn(" ",i.summaryData.Total," items with ",i.summaryData.Updated," unmatched & ",i.summaryData.NoChanges," matched quantities imported. "))},dependencies:[Ut,ct,lt,B,X,pt,Fn,Nn,Un,Ho,Qe,Re,Je,fo,ho,Io,G,po],styles:[".sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{top:48px!important}"]})};var Pm=n=>({ID:n});function wm(n,e){if(n&1){let t=v();a(0,"button",4),_("click",function(){p(t);let i=m();return u(i.openExportModal())}),f(1,"i",5),s(2," Export "),r()}}function Mm(n,e){if(n&1){let t=v();a(0,"div",6)(1,"h6"),s(2,"Outlets"),r(),a(3,"outlet-selector",7),w("ngModelChange",function(i){p(t);let d=m();return P(d.pageData.Filter.OutletId,i)||(d.pageData.Filter.OutletId=i),u(i)}),r(),a(4,"h6"),s(5,"Supplier"),r(),a(6,"autocompleteV2",8),w("ngModelChange",function(i){p(t);let d=m();return P(d.pageData.Filter.SupplierId,i)||(d.pageData.Filter.SupplierId=i),u(i)}),r(),a(7,"h6"),s(8,"Category"),r(),a(9,"POS-product-category-select",9),w("selectedCategoryIDChange",function(i){p(t);let d=m();return P(d.pageData.Filter.CategoryId,i)||(d.pageData.Filter.CategoryId=i),u(i)}),r()()}if(n&2){let t=m();l(3),c("accessType",2),M("ngModel",t.pageData.Filter.OutletId),c("multiple",!1)("clearable",!1),l(3),M("ngModel",t.pageData.Filter.SupplierId),l(3),M("selectedCategoryID",t.pageData.Filter.CategoryId),c("showClear",!0)}}function Em(n,e){n&1&&(a(0,"th",16),s(1," On Hand "),r())}function Om(n,e){if(n&1&&(a(0,"td",19),s(1),r()),n&2){let t=m().$implicit;l(),S(t.OnHand)}}function Am(n,e){if(n&1&&(a(0,"tr")(1,"td")(2,"a",18),s(3),r()(),a(4,"td"),s(5),r(),a(6,"td"),s(7),y(8,"date"),r(),a(9,"td",19),s(10),r(),C(11,Om,2,1,"td",19),r()),n&2){let t=e.$implicit,o=m(2);l(2),c("queryParams",k(9,Pm,t.ID)),l(),S(t.Name),l(2),S(t.Code),l(2),S(V(8,6,t.LastCountDate,"dd MMM yyyy")),l(3),S(t.DaysSinceLastCount),l(),g(o.role.inventory.View?11:-1)}}function jm(n,e){if(n&1){let t=v();a(0,"div",3)(1,"table",10),_("matSortChange",function(i){p(t);let d=m();return u(d.sortData(i))}),a(2,"thead",11)(3,"tr")(4,"th",12),s(5,"Name"),r(),a(6,"th",13),s(7,"Code"),r(),a(8,"th",14),s(9,"Last Count"),r(),a(10,"th",15),s(11," Days Since Last Count "),r(),C(12,Em,2,0,"th",16),r()(),a(13,"tbody"),N(14,Am,12,11,"tr",null,et),r()(),a(16,"POS-complex-pagination",17),_("jumpToPage",function(){p(t);let i=m();return u(i.getListData())})("previousPage",function(){p(t);let i=m();return u(i.getListData())})("nextPage",function(){p(t);let i=m();return u(i.getListData())}),r()()}if(n&2){let t=m();l(12),g(t.role.inventory.View?12:-1),l(2),F(t.data.Data),l(2),c("total",t.data.Data.length)("pageData",t.pageData)}}var Ii=class n extends bt{constructor(t,o,i,d,x){super(t,o,"Adjustment/AdjustmentLastCountDate","AdjustmentLoader/AdjustmentLastCountDate",void 0,void 0,!0);this.httpService=o;this.csvConverter=i;this.roleService=d;this.matDialog=x}role=h(H);originalData=[];postInit(t){this.originalData=t.Data,this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(Rt,{data:{title:"Adjustment Report",exportTypes:[{ID:"AdjustmentExport/ExportAdjustmentLastCountDate",Value:"Default",FileName:"Adjustment Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/AdjustmentLastCountDate",pagination:!0}})}sortData(t){let o=this.data.Data.slice();if(!t.active||t.direction===""){this.data.Data=this.originalData;return}this.data.Data=o.sort((i,d)=>{let x=t.direction==="asc",b=typeof i[t.active];switch(A.IsEmpty(i.Code)&&(i.Code=""),A.IsEmpty(d.Code)&&(d.Code=""),b){case"string":return A.compare(i[t.active].toLocaleLowerCase(),d[t.active].toLocaleLowerCase(),x);case"number":return A.compare(i[t.active],d[t.active],x);default:return 0}})}static \u0275fac=function(o){return new(o||n)(D(at),D(L),D(kt),D(H),D(it))};static \u0275cmp=O({type:n,selectors:[["POS-last-count"]],standalone:!1,features:[mt],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple","clearable"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["id","tableGrid","matSort","",1,"table","w-100",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","Code"],["mat-sort-header","LastCountDate"],["mat-sort-header","DaysSinceLastCount",1,"align-right"],["mat-sort-header","OnHand",1,"align-right"],["api","Adjustment/CountAdjustmentLastCountDate",3,"jumpToPage","previousPage","nextPage","total","pageData"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[1,"text-end"]],template:function(o,i){if(o&1){let d=v();a(0,"mainpanel-cmp",1),w("textChange",function(b){return p(d),P(i.pageData.Filter.Text,b)||(i.pageData.Filter.Text=b),u(b)}),_("onSubmit",function(){return p(d),u(i.searchFromPageOne())}),w("filterChange",function(b){return p(d),P(i.pageData.Filter,b)||(i.pageData.Filter=b),u(b)}),a(1,"actions"),C(2,wm,3,0,"button",2),r(),a(3,"filters"),E(4,Mm,10,7,"ng-template",null,0,$),r(),a(6,"content"),C(7,jm,17,3,"div",3),r()()}o&2&&(c("pageData",i.menuData),M("text",i.pageData.Filter.Text),c("isFilterOnDropdown",!1),M("filter",i.pageData.Filter),l(2),g(i.roleService.global.Export?2:-1),l(5),g(i.data&&i.data.Data?7:-1))},dependencies:[ct,lt,B,X,Xt,te,Qe,Re,Yt,qe,$t],encapsulation:2})};var km=[{path:"Adjustment/Archive",component:Gn},{path:"Adjustment/Archive/Info",component:Hn},{path:"Adjustment/Archive/Form",component:xi,canActivate:[dr],data:{roles:[Oi.adjustment.Create,Oi.adjustment.Edit]}},{path:"Tools/Count_Product_Inventory",component:Yn},{path:"Tools/Convert_Inventory_to_Parent_UOM",component:Xn},{path:"Tools/Product_Sheet",component:ti},{path:"Report/Last_Count",component:Ii},{path:"Report/Adjustment",component:$n},{path:"History/Variant",component:vi},{path:"Adjustment/Stock_Take_by_Web_Spreadsheet",component:Zn},{path:"Adjustment/Stock_Take_by_CSV",component:bi},{path:"",redirectTo:"Adjustment/Archive",pathMatch:"full"}],Di=class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Oe({type:n});static \u0275inj=Ee({imports:[un.forChild(km),un]})};var zi=class n{constructor(e){this.http=e}currentUntilPage;toggleFetchTotalData;totalData;pageNumber;isNextBtnDisabled;isOnLastPage;calcCurrentUntilPage(e,t,o){this.currentUntilPage=e*(t-1)+o}setPageNumber(e){this.pageNumber=e}setPaginationButtonState(e,t,o){o==0?this.isNextBtnDisabled=!0:this.isNextBtnDisabled=!(o<e*t)}setTotalData(e,t,o){this.toggleFetchTotalData=!0,this.http.post(e,t).pipe(Q(o)).subscribe(i=>this.totalData=i)}setPaginationState(e,t,o){this.calcCurrentUntilPage(e,t,o),this.setPageNumber(t),this.setPaginationButtonState(e,t,o)}static \u0275fac=function(t){return new(t||n)(Zi(L))};static \u0275prov=W({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ti=class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Oe({type:n});static \u0275inj=Ee({imports:[xt]})};var Er=class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Oe({type:n});static \u0275inj=Ee({imports:[kn,xt,Di,An,Jt,On,Vo,pt,rr,We,ut,Lo,bo,jo,ut,Wo,Bo,Ai,Oo,Be,Le,go,Fo,Co,sr,Ai,uo,ar,lr,qo,Ie,Ao,wo,Eo,Ti,$e,Yt,qe,Qn,Rn,Je,yo,_o,xo]})};export{Er as AdjustmentModule};
|