dealpos 25.45.2 → 25.45.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/browser/{chunk-4KBU47GN.js → chunk-22NVMHH6.js} +1 -1
  2. package/browser/{chunk-XRLRUCRR.js → chunk-2C4IBLGB.js} +1 -1
  3. package/browser/{chunk-MXGNASOC.js → chunk-2DIXJDGB.js} +1 -1
  4. package/browser/{chunk-6Q7J43H4.js → chunk-33ZPF662.js} +1 -1
  5. package/browser/{chunk-FAGD2TBB.js → chunk-3BWHPHJH.js} +1 -1
  6. package/browser/{chunk-W5N6DMDQ.js → chunk-3CUAWAR5.js} +1 -1
  7. package/browser/{chunk-JGWQC4DI.js → chunk-3KOU5F5K.js} +1 -1
  8. package/browser/{chunk-KDOS4X4T.js → chunk-3VIZOW4E.js} +1 -1
  9. package/browser/{chunk-7USHMTB5.js → chunk-4625NAET.js} +1 -1
  10. package/browser/{chunk-L453AX2W.js → chunk-46LKSZ72.js} +1 -1
  11. package/browser/{chunk-XF5XKXE6.js → chunk-4AZPLO6R.js} +1 -1
  12. package/browser/{chunk-MHZV4BL7.js → chunk-4EBEGG7N.js} +1 -1
  13. package/browser/{chunk-7FUWLNHK.js → chunk-4ERXA7JB.js} +1 -1
  14. package/browser/{chunk-DU7W2G2L.js → chunk-4F3O7MBT.js} +1 -1
  15. package/browser/{chunk-5ZU5FBGM.js → chunk-5E73XXM5.js} +1 -1
  16. package/browser/{chunk-PUFGTKWO.js → chunk-6OAVGGZR.js} +1 -1
  17. package/browser/{chunk-G4XFK7EF.js → chunk-6VCRA6WE.js} +1 -1
  18. package/browser/{chunk-NM3RF6OH.js → chunk-6YBAFFT7.js} +1 -1
  19. package/browser/{chunk-DG4IHOM2.js → chunk-77EIGTXF.js} +1 -1
  20. package/browser/{chunk-T3HVVJIV.js → chunk-AAIREWAF.js} +1 -1
  21. package/browser/{chunk-FAN4YDVT.js → chunk-AVKLOI56.js} +1 -1
  22. package/browser/{chunk-SICZ4VWZ.js → chunk-BG3UC4MA.js} +1 -1
  23. package/browser/{chunk-OKVQYK4Y.js → chunk-CGHND263.js} +1 -1
  24. package/browser/{chunk-TWVDGGTY.js → chunk-CH65LZTB.js} +1 -1
  25. package/browser/{chunk-M4BTEXS6.js → chunk-CIOPCHTA.js} +1 -1
  26. package/browser/{chunk-NERV3W42.js → chunk-CMG3JZBL.js} +1 -1
  27. package/browser/{chunk-RKCNENWQ.js → chunk-CR53NEWY.js} +1 -1
  28. package/browser/{chunk-WXJTNRD3.js → chunk-CUZ2P4GN.js} +1 -1
  29. package/browser/{chunk-YM2ZQTDF.js → chunk-CYDUVVNV.js} +1 -1
  30. package/browser/{chunk-6VM27TUY.js → chunk-DM5KRX4N.js} +1 -1
  31. package/browser/{chunk-KB64CIW5.js → chunk-DZ5UEHSP.js} +2 -2
  32. package/browser/{chunk-TPHEWWHE.js → chunk-EOVLGUH4.js} +2 -2
  33. package/browser/{chunk-WRZUQ2QI.js → chunk-F5QXBEYT.js} +1 -1
  34. package/browser/{chunk-HC2YTBED.js → chunk-FRIGXAFX.js} +1 -1
  35. package/browser/{chunk-M76YU6SQ.js → chunk-GC42WNFK.js} +1 -1
  36. package/browser/{chunk-BXGUZIC4.js → chunk-GRYOWZWF.js} +1 -1
  37. package/browser/{chunk-W34NDG3T.js → chunk-GVDW25BL.js} +1 -1
  38. package/browser/{chunk-2BSYBLS4.js → chunk-H2F3XJG4.js} +1 -1
  39. package/browser/{chunk-PCFR4J66.js → chunk-HAUYP6EM.js} +1 -1
  40. package/browser/{chunk-MFDMUMA4.js → chunk-HHA2WIAI.js} +1 -1
  41. package/browser/{chunk-A6F6V3WW.js → chunk-HSO5UAHM.js} +1 -1
  42. package/browser/{chunk-VBX5VOJG.js → chunk-I2VB7YW5.js} +1 -1
  43. package/browser/{chunk-KTV4REGV.js → chunk-ILF6INR3.js} +1 -1
  44. package/browser/{chunk-KL5VH4OU.js → chunk-ILVJN5WK.js} +1 -1
  45. package/browser/{chunk-DZA27E5L.js → chunk-ITGKZZKN.js} +1 -1
  46. package/browser/{chunk-HHSXXJFJ.js → chunk-KAP3XAKD.js} +1 -1
  47. package/browser/{chunk-XHA6WGTO.js → chunk-KIGK4MIG.js} +1 -1
  48. package/browser/{chunk-GINPKODK.js → chunk-LJEV2ZV2.js} +1 -1
  49. package/browser/chunk-LX5Y3A5M.js +1 -0
  50. package/browser/{chunk-5I74KDE7.js → chunk-MJ47GTOZ.js} +1 -1
  51. package/browser/{chunk-IPJU7D3K.js → chunk-MWTYJ7IH.js} +1 -1
  52. package/browser/{chunk-UYXD7WPN.js → chunk-NEGD2WNQ.js} +1 -1
  53. package/browser/{chunk-ZEXXJZ7U.js → chunk-NMCQUNZH.js} +1 -1
  54. package/browser/{chunk-IJXCL7KL.js → chunk-O5KA5MMP.js} +1 -1
  55. package/browser/{chunk-IAFZ6YAO.js → chunk-ORRKQYPI.js} +1 -1
  56. package/browser/{chunk-J3OQGBIN.js → chunk-PPZ32IZ2.js} +1 -1
  57. package/browser/{chunk-YQE3PJGM.js → chunk-Q2J2SO2R.js} +2 -2
  58. package/browser/{chunk-IE2H4VRD.js → chunk-Q6OIURPZ.js} +1 -1
  59. package/browser/{chunk-PNN75KZR.js → chunk-QFX4AV7Q.js} +1 -1
  60. package/browser/{chunk-HBH23XBO.js → chunk-QN5Q4MBZ.js} +1 -1
  61. package/browser/{chunk-TCR2YYM5.js → chunk-QWRZNHUN.js} +1 -1
  62. package/browser/{chunk-USEPOJ5L.js → chunk-RGVY2URX.js} +1 -1
  63. package/browser/{chunk-IUE6IUOH.js → chunk-RNR2IPVG.js} +1 -1
  64. package/browser/{chunk-EGADVOKH.js → chunk-RSG2H3EZ.js} +1 -1
  65. package/browser/{chunk-OLT6DXR7.js → chunk-RYP3CAST.js} +1 -1
  66. package/browser/{chunk-GUF6JXSS.js → chunk-SARRXJEA.js} +1 -1
  67. package/browser/{chunk-B6EKSPI2.js → chunk-SF6Y2ZD7.js} +1 -1
  68. package/browser/{chunk-3MUHZKUR.js → chunk-SSWQWX6U.js} +1 -1
  69. package/browser/{chunk-IQ7VK4UE.js → chunk-U3OOMEJP.js} +2 -2
  70. package/browser/{chunk-IAFZ75L3.js → chunk-UIBGGB5A.js} +2 -2
  71. package/browser/{chunk-X6XUOWVT.js → chunk-UJEMS3PZ.js} +2 -2
  72. package/browser/{chunk-PIW2M2DH.js → chunk-UL4VWOCQ.js} +1 -1
  73. package/browser/{chunk-N43HXORE.js → chunk-V7BXEFFF.js} +1 -1
  74. package/browser/{chunk-OKEI5RKW.js → chunk-VIKPSX57.js} +1 -1
  75. package/browser/{chunk-6A3BN6JC.js → chunk-VKFHCLH2.js} +1 -1
  76. package/browser/{chunk-7EVERJPZ.js → chunk-VPLMHY4N.js} +1 -1
  77. package/browser/{chunk-XKAKP3E6.js → chunk-WAGPHMU4.js} +1 -1
  78. package/browser/{chunk-L3JI6OZ3.js → chunk-WLUHQZCT.js} +1 -1
  79. package/browser/{chunk-IT7I47UZ.js → chunk-XFKVXTNV.js} +1 -1
  80. package/browser/{chunk-N7C7P5QN.js → chunk-XHCWRYJP.js} +1 -1
  81. package/browser/{chunk-DJNB7COU.js → chunk-XKPLC5YT.js} +1 -1
  82. package/browser/{chunk-5PWOYB4R.js → chunk-ZD7XFJLT.js} +2 -2
  83. package/browser/{chunk-3RGQWWNI.js → chunk-ZG2NIMQL.js} +1 -1
  84. package/browser/index.html +2 -2
  85. package/browser/{main-7FKCOQYA.js → main-GDASXFAJ.js} +2 -2
  86. package/package.json +1 -1
  87. package/browser/chunk-FSGCO2Z5.js +0 -1
@@ -1,3 +1,3 @@
1
- import{a as nr}from"./chunk-MXGNASOC.js";import{a as Xo,b as tr}from"./chunk-F7EO5OHI.js";import{a as Yo}from"./chunk-IBZF5QXJ.js";import{b as er}from"./chunk-XIXREDEB.js";import{a as Un}from"./chunk-PUXE7FLT.js";import{a as Qo,b as Bo,c as Ho,d as Wo,e as qo,f as Go}from"./chunk-PIYVELLT.js";import{a as $o}from"./chunk-U5HTULBC.js";import{a as Jo}from"./chunk-DELGLVJJ.js";import{a as Ko}from"./chunk-LAQMHKSP.js";import{a as Zo}from"./chunk-JXHHT6R2.js";import{a as Lo}from"./chunk-XXNLATCJ.js";import{a as zo}from"./chunk-VCQBS5CA.js";import{a as Ro}from"./chunk-PQFMYP23.js";import{a as Ln}from"./chunk-VO3NT5EH.js";import"./chunk-TPKU52VV.js";import{a as kn}from"./chunk-GINPKODK.js";import{a as $e}from"./chunk-QMFA3PF5.js";import{a as Uo}from"./chunk-U3WVC6SN.js";import"./chunk-ETTSYVEZ.js";import"./chunk-NQX7EX5A.js";import{a as jo,b as Vn,c as No,e as jn,f as Nn,g as Fo}from"./chunk-PQ65IMRY.js";import"./chunk-FR6L6XAP.js";import{a as Fn}from"./chunk-P3KIIKY4.js";import{L as Vo}from"./chunk-PNN75KZR.js";import"./chunk-JFLT7NX3.js";import"./chunk-YXCPHYC5.js";import"./chunk-W3VF2RCW.js";import"./chunk-4CFMB4IK.js";import{e as Ao}from"./chunk-6DRTZA6S.js";import"./chunk-FFOK3ZNC.js";import"./chunk-B5ORO5G4.js";import"./chunk-QCCKEP2R.js";import"./chunk-EHXTW46H.js";import"./chunk-5DXDXIDO.js";import"./chunk-HDJJJAZJ.js";import"./chunk-O4IQZBVW.js";import"./chunk-GDPQI6PI.js";import"./chunk-GJIFUWGQ.js";import"./chunk-PROSYUA2.js";import"./chunk-PF33HK6M.js";import{a as lo}from"./chunk-OTT6RJHI.js";import"./chunk-3CZ6HKSM.js";import{b as Oo}from"./chunk-XTMUP2BA.js";import"./chunk-PTQCXOVM.js";import{b as Mi}from"./chunk-RPJIPLQS.js";import{a as Wr,b as Ze}from"./chunk-SGSOCLV7.js";import"./chunk-5UDUWK67.js";import{a as Ke,b as Ie}from"./chunk-PXKNGMLL.js";import{a as Je}from"./chunk-KNQEOPID.js";import{a as ko}from"./chunk-MTU6753J.js";import"./chunk-J6U6UYNI.js";import"./chunk-GWL7ZN37.js";import"./chunk-Z3E24JZW.js";import"./chunk-BYXBJQAS.js";import"./chunk-KPZU3ZPZ.js";import"./chunk-NQKVYQ6V.js";import"./chunk-NSNUUKNK.js";import"./chunk-JXXEYFN7.js";import{a as Eo}from"./chunk-NCT5IK4R.js";import{g as Mo}from"./chunk-MREFZR3I.js";import"./chunk-BYXBJQAS.js";import{c as uo,d as _o,e as go}from"./chunk-E4GYCB3G.js";import{a as ir}from"./chunk-XZFHDKIK.js";import{c as wo}from"./chunk-XRLRUCRR.js";import"./chunk-YMVBGQ2W.js";import"./chunk-OGN6JWED.js";import{a as xo}from"./chunk-BG6GTLXF.js";import{a as So}from"./chunk-U3EOEZ3B.js";import{a as Po,d as ze,e as To}from"./chunk-I4WJ5CEN.js";import"./chunk-7IRMDCKA.js";import"./chunk-3RK6DDJD.js";import{a as po}from"./chunk-CKGJCUHW.js";import{q as co}from"./chunk-YL6HCV6T.js";import"./chunk-BJG2UU2M.js";import{d as mo}from"./chunk-ISY4SDFY.js";import"./chunk-RNEU5YBN.js";import{d as An,e as bo}from"./chunk-RO5PWDCR.js";import"./chunk-33B62QHS.js";import{a as Qe,b as Be,c as so}from"./chunk-L5HF7UAT.js";import{a as Kt,b as Do}from"./chunk-IZQ5FNXP.js";import{f as $t}from"./chunk-L453AX2W.js";import{c as Ge}from"./chunk-GUF6JXSS.js";import{a as Mn,b as Lt}from"./chunk-HVRLWPZX.js";import{a as xt}from"./chunk-3MUHZKUR.js";import"./chunk-FAN4YDVT.js";import"./chunk-RFVQHGYD.js";import{c as Io}from"./chunk-V7HBROQ5.js";import{a as kt}from"./chunk-WKB7BKHN.js";import{e as at,f as On}from"./chunk-KDOS4X4T.js";import"./chunk-XF5XKXE6.js";import"./chunk-LJMHI6I5.js";import"./chunk-G7HGWSUU.js";import{c as Co}from"./chunk-67UQKMLX.js";import"./chunk-RCC5SUNH.js";import"./chunk-OYO4SRAO.js";import{c as fo,e as ho,g as yo}from"./chunk-3MU2GNGM.js";import{a as He,c as Ut}from"./chunk-AASKAWJ4.js";import"./chunk-2QD46TNT.js";import"./chunk-YQ5GJPDB.js";import"./chunk-KMYTSO3Q.js";import"./chunk-BRHHRJLT.js";import"./chunk-KTV4REGV.js";import{a as wn,b as rt}from"./chunk-EGADVOKH.js";import"./chunk-3LPZYQS6.js";import"./chunk-BJKHMXAA.js";import{F as zt,G as qe,u as gt,v as Ct,w as ut}from"./chunk-EGUIWOC3.js";import{b as be,c as Re}from"./chunk-VQBUIUJC.js";import{N as En,O as wt,g as We}from"./chunk-HYXSN2J6.js";import{a as vo,d as pt}from"./chunk-2JU7KFOZ.js";import"./chunk-DB3W42KN.js";import"./chunk-EQLHPWVB.js";import{a as Le,b as Tt,e as _t,f as Gt,g as et}from"./chunk-QGYIPOLS.js";import"./chunk-WACBOZDR.js";import"./chunk-TX6ZFPHY.js";import"./chunk-YZP4FX7D.js";import{a as X}from"./chunk-2FWFPV5I.js";import"./chunk-WAXYETAG.js";import{E as Ue,F as qt,G as xe,b as io,c as St,h as H,i as je,l as Se,o as tt,r as oo,s as ro,t as Ne,w as Fe}from"./chunk-OJ5SEYSF.js";import{a as no}from"./chunk-HBH23XBO.js";import{a as ao}from"./chunk-5I74KDE7.js";import{a as A,c as wi,d as B}from"./chunk-TS6CZC3J.js";import"./chunk-7EVERJPZ.js";import{$b as Qt,$d as un,Ab as F,Ad as Pn,Bb as c,Bc as x,Ca as z,Cb as r,Cc as E,Db as a,Dc as L,E as dt,Eb as g,Ed as Tn,Fb as _e,Gb as pn,Hb as Ti,Hc as K,I as ue,Ib as Ot,Ja as Ki,Jb as At,K as Gi,Kc as he,Lb as v,Lc as Yi,M as zi,Nb as _,Ob as bn,Pb as m,Q as Me,Qa as $,Ra as Oe,Tb as ge,Ua as Ht,Ub as Ce,Vb as fe,Vc as to,Wa as l,Wd as ve,Xa as Sn,Y as vn,Ya as xn,Yd as Ft,Zb as it,Zd as ct,_b as In,aa as nt,ac as Zi,bb as Ji,bc as Pt,be as vt,cb as b,cc as s,cd as Nt,d as ft,da as Dt,dc as S,ec as I,ed as Dn,ee as U,fa as Q,fc as Te,fd as ye,gb as O,gc as Xi,hb as Ae,hc as w,ic as P,jc as T,k as fn,kb as mt,kd as Ve,la as W,ma as Ee,mb as M,md as Wt,o as hn,oa as $i,oc as de,od as q,p as yn,pa as h,rd as yt,sc as Y,t as Et,ta as p,tc as V,u as qi,ua as u,ub as C,uc as ke,ud as eo,wb as f,xa as ht,xb as se,yb as Z,zb as N}from"./chunk-VS3RTXZC.js";import"./chunk-WFMAM73Y.js";import{a as k,b as R,h as Pi,k as Cn}from"./chunk-SNAKHGZS.js";var Ei=(t=>(t[t.AdjustDifferences=1]="AdjustDifferences",t[t.CountQuantity=2]="CountQuantity",t))(Ei||{});var Oi=(n=>(n[n.Draft=1]="Draft",n[n.Pending=2]="Pending",n[n.Rejected=3]="Rejected",n[n.Accepted=4]="Accepted",n))(Oi||{});var qr=["productSearchInput"],Gr=()=>["/menu/Products/Catalog/Variants/Info"],zr=i=>({ID:i});function $r(i,e){i&1&&(r(0,"div"),s(1,"Name"),a())}function Kr(i,e){if(i&1){let t=v();r(0,"input",15,0),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.productNameFilter,n)||(d.productNameFilter=n),u(n)}),_("ngModelChange",function(){p(t);let n=m(2);return u(n.onProductNameFilterChange())})("click",function(n){return p(t),u(n.stopPropagation())}),a()}if(i&2){let t=m(2);w("ngModel",t.productNameFilter)}}function Jr(i,e){if(i&1){let t=v();r(0,"div",12),M(1,Kr,2,1,"input",13),r(2,"i",14),_("click",function(n){p(t);let d=m();return n.stopPropagation(),u(d.toggleProductFilter())}),a()()}if(i&2){let t=m();In("width",t.filterProductToggle?"100%":"auto"),l(),c("ngIf",t.filterProductToggle),l(),Qt("fa-filter",!t.filterProductToggle)("fa-filter-slash",t.filterProductToggle),c("matTooltip",t.searchTooltip)}}function Zr(i,e){if(i&1&&(r(0,"tr")(1,"td")(2,"a",16),s(3),a()(),r(4,"td"),s(5),a(),r(6,"td",17),s(7),a()()),i&2){let t=e.$implicit;l(2),c("routerLink",Y(5,Gr))("queryParams",V(6,zr,t.ID)),l(),I(" ",t.Name," "),l(2),S(t.Code),l(2),S(t.OnHand)}}function Xr(i,e){if(i&1&&N(0,Zr,8,8,"tr",null,se),i&2){let t=m();F(t.data.Data)}}function Yr(i,e){i&1&&(r(0,"tr",11)(1,"td",18),g(2,"empty-state-table"),a()())}var Rn=class i{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=X.Warning,this.originalData=e.Data,this.initSearchKeywordListener()}exportService=h(Mn);productSearchInput;modalConfig=new gt;dialogRef=h(_t);filterProductToggle=!1;productNameFilter="";searchSubject=new ft;originalData=[];initSearchKeywordListener(){this.searchSubject.pipe(zi(500),Me(),Le(),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||i)(b(Gt))};static \u0275cmp=O({type:i,selectors:[["POS-dialog-unscanned-products"]],viewQuery:function(t,o){if(t&1&&ge(qr,5,Ki),t&2){let n;Ce(n=fe())&&(o.productSearchInput=n.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&&(r(0,"modal-material",1),_("onOk",function(){return o.onOk()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),r(1,"content")(2,"div",2)(3,"div")(4,"div",3)(5,"table",4)(6,"thead",5)(7,"tr")(8,"th")(9,"div",6),M(10,$r,2,0,"div",7),C(11,Jr,3,8,"div",8),a()(),r(12,"th",9),s(13,"Code"),a(),r(14,"th",10),s(15,"On-Hand"),a()()(),r(16,"tbody"),C(17,Xr,2,0)(18,Yr,3,0,"tr",11),a()()()()()()()),t&2&&(c("config",o.modalConfig),l(10),c("ngIf",!o.filterProductToggle),l(),f(o.data.Data.length>5?11:-1),l(6),f(o.data.Data.length>0?17:18))},dependencies:[ut,Ct,ct,ko,yt,ye,qt,St,H,tt,Re,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 rr=()=>["/menu/Adjustment/Adjustment/Archive/Form"],Ye=i=>({ID:i}),ar=()=>["/print/Adjustment"],lr=i=>({"border-end-0":i}),Hn=(i,e)=>({"text-success":i,"text-danger":e}),ta=(i,e)=>({"text-danger":i,"text-success":e});function ea(i,e){if(i&1){let t=v();r(0,"div",7)(1,"button",25),_("click",function(){p(t);let n=m(2);return u(n.reject())}),g(2,"i",26),s(3,"Reject"),a(),r(4,"button",25),_("click",function(){p(t);let n=m(2);return u(n.accept())}),g(5,"i",27),s(6,"Accept "),a()()}}function na(i,e){if(i&1&&(r(0,"a",28),g(1,"i",29),s(2,"Resume "),a()),i&2){let t=m(3);c("routerLink",Y(2,rr))("queryParams",V(3,Ye,t.data.ID))}}function ia(i,e){if(i&1){let t=v();r(0,"button",25),_("click",function(){p(t);let n=m(3);return u(n.onSubmit())}),g(1,"i",30),s(2,"Submit "),a()}}function oa(i,e){if(i&1&&(C(0,na,3,5,"a",28),C(1,ia,3,0,"button",8)),i&2){let t=m(2);f(t.data.Adjustment.StateID==t.adjustmentState.Draft?0:-1),l(),f(t.data.Adjustment.StateID==t.adjustmentState.Draft?1:-1)}}function ra(i,e){if(i&1&&(r(0,"a",28),g(1,"i",29),s(2,"Edit "),a()),i&2){let t=m(3);c("routerLink",Y(2,rr))("queryParams",V(3,Ye,t.data.ID))}}function aa(i,e){if(i&1&&C(0,ra,3,5,"a",28),i&2){let t=m(2);f(t.data.Adjustment.TypeID==t.adjustmentType.AdjustDifferences&&(t.data.Adjustment.StateID==t.adjustmentState.Pending||t.data.Adjustment.StateID==t.adjustmentState.Accepted)?0:-1)}}function la(i,e){if(i&1){let t=v();r(0,"button",25),_("click",function(){p(t);let n=m(2);return u(n.delete())}),g(1,"i",31),s(2,"Delete "),a()}}function sa(i,e){if(i&1&&(r(0,"tr")(1,"th"),s(2,"Journal Link"),a(),r(3,"td"),s(4,":"),a(),r(5,"td")(6,"a",32),s(7,"View Journal"),a()()()),i&2){let t=m(2);l(6),c("href",de("https://accounting.dealpos.app/pages/journal-entry;TransID=",t.data.ID),Oe)}}function da(i,e){i&1&&(r(0,"div",38),g(1,"div",40),a())}function ma(i,e){if(i&1&&(r(0,"div",10)(1,"div",34)(2,"h4"),s(3),x(4,"date"),a(),r(5,"p",35),s(6),x(7,"date"),a()(),r(8,"div",36),g(9,"i",37),C(10,da,2,0,"div",38),a(),r(11,"div",39)(12,"h4"),s(13),a(),r(14,"p",35),s(15),a()()()),i&2){let t=m(),o=t.$implicit,n=t.$index,d=m(2);l(3),S(L(4,7,o.Date,"dd MMM yyyy")),l(3),S(L(7,10,o.Date,"HH:mm a")),l(3),In("color",n==0?"blue":"black"),l(),f(n!=d.data.StatusProcess.length-1?10:-1),l(3),S(o.Status),l(2),S(o.Creator)}}function ca(i,e){if(i&1&&M(0,ma,16,13,"div",33),i&2){let t=e.$implicit;c("ngIf",t.Date)}}function pa(i,e){if(i&1){let t=v();r(0,"div",43)(1,"i",62),_("click",function(){p(t);let n=m(3);return u(n.showUnscannedProducts())}),a()()}}function ua(i,e){if(i&1){let t=v();r(0,"a",63),_("click",function(){p(t);let n=m(3);return u(n.exportCSV(n.csvConverter,n.adjustmentTypeStatus!==-1&&n.adjustmentTypeStatus===1?"Adjustment/AdjustmentInfoExport":"Adjustment/AdjustmentCountedExport","Adjustment#"+n.data.Adjustment.Number+".csv"))}),g(1,"i",64),s(2,"Export"),a()}}function _a(i,e){i&1&&(Ot(0),r(1,"th",65),s(2,"Qty"),a(),At())}function ga(i,e){i&1&&(Ot(0),r(1,"th",65),s(2,"Counted"),a(),r(3,"th",65),s(4,"Expected"),a(),At())}function Ca(i,e){i&1&&(r(0,"th",65),s(1,"Expected"),a(),r(2,"th",65),s(3,"Counted"),a())}function fa(i,e){if(i&1&&(M(0,ga,5,0,"ng-container",54)(1,Ca,4,0,"ng-template",null,3,K),r(3,"th",65),s(4,"Difference"),a()),i&2){let t=it(2),o=m(3);c("ngIf",o.data.Adjustment.TypeID===2&&(o.data.Adjustment.StateID===1||o.data.Adjustment.StateID===2))("ngIfElse",t)}}function ha(i,e){i&1&&(r(0,"th",66),s(1," Cost "),a())}function ya(i,e){i&1&&(r(0,"th",66),s(1," Price "),a())}function va(i,e){if(i&1&&(Ot(0),g(1,"p",71),At()),i&2){let t=m().$implicit;l(),c("innerHTML",t.Note,$)}}function Sa(i,e){if(i&1&&(Ot(0),r(1,"td",72),s(2),a(),At()),i&2){let t=m().$implicit;l(),Pt(ke(3,Hn,t.Quantity>0,t.Quantity<0)),l(),I(" ",t.Quantity," ")}}function xa(i,e){if(i&1&&(Ot(0),r(1,"td",72),s(2),a(),r(3,"td",72),s(4),a(),At()),i&2){let t=m(2).$implicit;l(2),I(" ",t.Counted," "),l(2),I(" ",t.Expected," ")}}function ba(i,e){if(i&1&&(r(0,"td",72),s(1),a(),r(2,"td",72),s(3),a()),i&2){let t=m(2).$implicit;l(),I(" ",t.Expected," "),l(2),I(" ",t.Counted," ")}}function Ia(i,e){if(i&1&&(M(0,xa,5,2,"ng-container",54)(1,ba,4,2,"ng-template",null,3,K),r(3,"td",72),s(4),x(5,"number"),a()),i&2){let t=it(2),o=m().$implicit,n=m(3);c("ngIf",n.data.Adjustment.TypeID===2&&(n.data.Adjustment.StateID===1||n.data.Adjustment.StateID===2))("ngIfElse",t),l(3),Pt(ke(7,ta,o.Expected>o.Counted,o.Expected<o.Counted)),l(),I(" ",E(5,5,o.Difference)," ")}}function Da(i,e){if(i&1&&(g(0,"td",73),x(1,"number")),i&2){let t=m().$implicit;c("innerHTML",E(1,1,t.UnitCost),$)}}function Pa(i,e){if(i&1&&(g(0,"td",73),x(1,"number")),i&2){let t=m().$implicit;c("innerHTML",E(1,1,t.UnitPrice),$)}}function Ta(i,e){if(i&1&&(r(0,"tr"),g(1,"td",67),r(2,"td")(3,"a",68),s(4),a(),r(5,"div"),s(6),a(),g(7,"app-serial-note",69),M(8,va,2,1,"ng-container",21),a(),M(9,Sa,3,6,"ng-container",54)(10,Ia,6,10,"ng-template",null,4,K)(12,Da,2,3,"td",70)(13,Pa,2,3,"td",70),a()),i&2){let t=e.$implicit,o=e.index,n=it(11),d=m(3);l(),c("innerHTML",o+1+".",$),l(2),c("queryParams",V(10,Ye,t.VariantID)),l(),S(t.Name),l(2),S(t.Code),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",n),l(3),c("ngIf",d.roleService.product.Cost),l(),c("ngIf",d.roleService.sell.PriceVisible)}}function wa(i,e){if(i&1&&(r(0,"b"),x(1,"sum"),x(2,"sum"),s(3),x(4,"sum"),x(5,"number"),a()),i&2){let t=m(3);Pt(ke(14,Hn,L(1,3,t.data.DifferencesArray,"Quantity")>0,L(2,6,t.data.DifferencesArray,"Quantity")<0)),l(3),S(E(5,12,L(4,9,t.data.DifferencesArray,"Quantity")))}}function Ma(i,e){if(i&1&&(r(0,"b",74),x(1,"sum"),x(2,"sum"),s(3),x(4,"sum"),x(5,"number"),a()),i&2){let t=m(3);c("ngClass",ke(13,Hn,L(1,2,t.data.DifferencesArray,"Difference")>0,L(2,5,t.data.DifferencesArray,"Difference")<0)),l(3),I(" ",E(5,11,L(4,8,t.data.DifferencesArray,"Difference"))," ")}}function Ea(i,e){if(i&1&&(r(0,"td",75)(1,"b"),s(2),x(3,"sum"),x(4,"number"),a()()),i&2){let t=m(3);l(2),S(E(4,4,L(3,1,t.data.DifferencesArray,"TotalCost")))}}function Oa(i,e){if(i&1&&(r(0,"td",76)(1,"b"),s(2),x(3,"sum"),x(4,"number"),a()()),i&2){let t=m(3);l(2),S(E(4,4,L(3,1,t.data.DifferencesArray,"TotalPrice")))}}function Aa(i,e){if(i&1&&(r(0,"div",12)(1,"div",41)(2,"div",42)(3,"h2"),s(4),a(),C(5,pa,2,0,"div",43),a(),r(6,"div",44)(7,"a",45),g(8,"i",46),s(9,"Print "),a(),M(10,ua,3,0,"a",47),a()(),r(11,"div",18)(12,"div",48)(13,"table",49)(14,"thead",50)(15,"tr")(16,"th",51),s(17,"No"),a(),r(18,"th",52),s(19," Name "),r(20,"small",53),s(21),a()(),M(22,_a,3,0,"ng-container",54)(23,fa,5,2,"ng-template",null,1,K)(25,ha,2,0,"th",55)(26,ya,2,0,"th",55),a()(),r(27,"tbody"),M(28,Ta,14,12,"tr",56),a(),r(29,"tfoot")(30,"tr")(31,"td",57)(32,"b"),s(33,"Total :"),a()(),r(34,"td",58),M(35,wa,6,17,"b",59)(36,Ma,6,16,"ng-template",null,2,K),a(),M(38,Ea,5,6,"td",60)(39,Oa,5,6,"td",61),a()()()()()()),i&2){let t=it(24),o=it(37),n=m(2);l(4),I(" ",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity?"Adjusted":"Counted"," Inventory "),l(),f(n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity&&(n.data.Adjustment.StateID==n.adjustmentState.Draft||n.data.Adjustment.StateID==n.adjustmentState.Pending)?5:-1),l(2),c("routerLink",Y(17,ar))("queryParams",V(18,Ye,n.paramId))("ngClass",V(20,lr,n.roleService.global.Export)),l(3),c("ngIf",n.roleService.global.Export),l(11),I(" (",n.data.DifferencesArray.length," SKU)"),l(),c("ngIf",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity)("ngIfElse",t),l(3),c("ngIf",n.roleService.product.Cost),l(),c("ngIf",n.roleService.sell.PriceVisible),l(2),c("ngForOf",n.data.DifferencesArray),l(3),c("colSpan",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity?2:4),l(4),c("ngIf",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity)("ngIfElse",o),l(3),c("ngIf",n.roleService.product.Cost),l(),c("ngIf",n.roleService.sell.PriceVisible)}}function ka(i,e){if(i&1&&(r(0,"h2"),s(1," Counted Inventory "),r(2,"small",53),s(3),a()()),i&2){let t=m(3);l(3),I("(",t.data.CountedArray.length," SKU)")}}function Va(i,e){if(i&1){let t=v();r(0,"a",63),_("click",function(){p(t);let n=m(3);return u(n.exportCSV(n.csvConverter,"Adjustment/AdjustmentCountedExport","Adjustment_Counted#"+n.data.Adjustment.Number+".csv"))}),g(1,"i",64),s(2,"Export"),a()}}function ja(i,e){if(i&1&&(r(0,"tr"),g(1,"td",67),r(2,"td")(3,"a",68),s(4),a(),r(5,"div"),s(6),a()(),r(7,"td",72),s(8),a(),r(9,"td",72),s(10),a(),r(11,"td",72),s(12),a()()),i&2){let t=e.$implicit,o=e.index;l(),c("innerHTML",o+1+".",$),l(2),c("queryParams",V(9,Ye,t.VariantID)),l(),S(t.Name),l(2),S(t.Code),l(2),S(t.Counted),l(2),S(t.Expected),l(),Pt(ke(11,Hn,t.Difference>0,t.Difference<0)),l(),I(" ",t.Difference," ")}}function Na(i,e){if(i&1&&(r(0,"div",12)(1,"div",41)(2,"div"),M(3,ka,4,1,"h2",21),a(),r(4,"div",44)(5,"a",45),g(6,"i",46),s(7,"Print "),a(),M(8,Va,3,0,"a",47),a()(),r(9,"div",18)(10,"div",48)(11,"table",49)(12,"thead",50)(13,"tr")(14,"th",51),s(15,"No"),a(),r(16,"th",52),s(17,"Name"),a(),r(18,"th",77),s(19,"Counted"),a(),r(20,"th",77),s(21,"Expected"),a(),r(22,"th",77),s(23,"Difference"),a()()(),r(24,"tbody"),M(25,ja,13,14,"tr",56),a()()()()()),i&2){let t=m(2);l(3),c("ngIf",t.data.CountedArray.length>0&&t.data.Adjustment.TypeID==t.adjustmentState.Pending),l(2),c("routerLink",Y(6,ar))("queryParams",V(7,Ye,t.paramId))("ngClass",V(9,lr,t.roleService.global.Export)),l(3),c("ngIf",t.roleService.global.Export),l(17),c("ngForOf",t.data.CountedArray)}}function Fa(i,e){if(i&1&&(r(0,"mainpanel-cmp",6)(1,"actions"),C(2,ea,7,0,"div",7),r(3,"div",7),C(4,oa,2,2),C(5,aa,1,1),C(6,la,3,0,"button",8),a()(),r(7,"content")(8,"div",9)(9,"div",10)(10,"div",11)(11,"div",12)(12,"div",13)(13,"div",14),g(14,"h2",15,0),r(16,"div",16),g(17,"i",17),r(18,"span"),s(19),a()()()(),r(20,"div",18)(21,"table",19)(22,"tr")(23,"th"),s(24,"Date"),a(),r(25,"td"),s(26,":"),a(),g(27,"td",20),a(),r(28,"tr")(29,"th"),s(30,"PIC"),a(),r(31,"td"),s(32,":"),a(),g(33,"td",20),a(),r(34,"tr")(35,"th"),s(36,"Type"),a(),r(37,"td"),s(38,":"),a(),g(39,"td",20),a(),r(40,"tr")(41,"th"),s(42,"Note"),a(),r(43,"td"),s(44,":"),a(),g(45,"td",20),a(),M(46,sa,8,2,"tr",21),r(47,"tr")(48,"th"),s(49,"Tag"),a(),r(50,"td"),s(51,":"),a(),g(52,"td",20),a()()()(),r(53,"div")(54,"div",12)(55,"div",13)(56,"h2"),s(57,"Status"),a()(),r(58,"div",18),N(59,ca,1,1,"div",10,se),a()()()(),r(61,"div",22),M(62,Aa,40,22,"div",23)(63,Na,26,11,"div",23),a()(),g(64,"pos-footer-alert",24),a()()()),i&2){let t=it(15),o=m();c("pageData",o.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),f(o.hasAccRejButton?2:-1),l(2),f(o.roleService.adjustment.Create?4:-1),l(),f(o.roleService.adjustment.Edit?5:-1),l(),f(o.roleService.adjustment.Delete?6:-1),l(8),c("matTooltip",t.classList.contains("text-truncate")?o.data.Adjustment.OutletName:"")("innerHTML",o.data.Adjustment.OutletName,$),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,$),l(6),c("innerHTML",o.data.Adjustment.PIC,$),l(6),c("innerHTML",o.data.Adjustment.TypeLabel,$),l(6),c("innerHTML",o.data.Adjustment.Note,$),l(),c("ngIf",o.data.AppsAccoutingActive&&o.roleService.accounting.View),l(6),c("innerHTML",o.data.Adjustment.TagName,$),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.adjustmentState.Pending),l(),c("created",o.data.CreatedInfo.Created)("modified",o.data.CreatedInfo.Modified)}}var Qn=class i extends xt{constructor(t,o,n,d,y,D,lt,ot){super(t,o,"Adjustment/AuditInventoryAdjustmentInfo",null,null,d);this.httpService=o;this.toastr=n;this.csvConverter=y;this.router=D;this.roleService=lt;this.dialog=ot;this.initQueryParam()}paramId;hasAccRejButton=!1;isEditable=!1;adjustmentType=Ei;adjustmentState=Oi;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)}exportCSV(t,o,n){this.httpService.get(`/api/${o}`,[{key:"ID",value:this.paramId}]).subscribe(d=>{t.convertToCSV(d,n)})}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",X.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",X.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.",X.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(Ko,{data:{title:"Submit Review",message:`
1
+ import{a as nr}from"./chunk-2DIXJDGB.js";import{a as Xo,b as tr}from"./chunk-F7EO5OHI.js";import{a as Yo}from"./chunk-IBZF5QXJ.js";import{b as er}from"./chunk-XIXREDEB.js";import{a as Un}from"./chunk-PUXE7FLT.js";import{a as Qo,b as Bo,c as Ho,d as Wo,e as qo,f as Go}from"./chunk-PIYVELLT.js";import{a as $o}from"./chunk-U5HTULBC.js";import{a as Jo}from"./chunk-DELGLVJJ.js";import{a as Ko}from"./chunk-LAQMHKSP.js";import{a as Zo}from"./chunk-JXHHT6R2.js";import{a as Lo}from"./chunk-XXNLATCJ.js";import{a as zo}from"./chunk-VCQBS5CA.js";import{a as Ro}from"./chunk-PQFMYP23.js";import{a as Ln}from"./chunk-VO3NT5EH.js";import"./chunk-TPKU52VV.js";import{a as kn}from"./chunk-LJEV2ZV2.js";import{a as $e}from"./chunk-QMFA3PF5.js";import{a as Uo}from"./chunk-U3WVC6SN.js";import"./chunk-ETTSYVEZ.js";import"./chunk-NQX7EX5A.js";import{a as jo,b as Vn,c as No,e as jn,f as Nn,g as Fo}from"./chunk-PQ65IMRY.js";import"./chunk-FR6L6XAP.js";import{a as Fn}from"./chunk-P3KIIKY4.js";import{L as Vo}from"./chunk-QFX4AV7Q.js";import"./chunk-JFLT7NX3.js";import"./chunk-YXCPHYC5.js";import"./chunk-W3VF2RCW.js";import"./chunk-4CFMB4IK.js";import{e as Ao}from"./chunk-6DRTZA6S.js";import"./chunk-FFOK3ZNC.js";import"./chunk-B5ORO5G4.js";import"./chunk-QCCKEP2R.js";import"./chunk-EHXTW46H.js";import"./chunk-5DXDXIDO.js";import"./chunk-HDJJJAZJ.js";import"./chunk-O4IQZBVW.js";import"./chunk-GDPQI6PI.js";import"./chunk-GJIFUWGQ.js";import"./chunk-PROSYUA2.js";import"./chunk-PF33HK6M.js";import{a as lo}from"./chunk-OTT6RJHI.js";import"./chunk-3CZ6HKSM.js";import{b as Oo}from"./chunk-XTMUP2BA.js";import"./chunk-PTQCXOVM.js";import{b as Mi}from"./chunk-RPJIPLQS.js";import{a as Wr,b as Ze}from"./chunk-SGSOCLV7.js";import"./chunk-5UDUWK67.js";import{a as Ke,b as Ie}from"./chunk-PXKNGMLL.js";import{a as Je}from"./chunk-KNQEOPID.js";import{a as ko}from"./chunk-MTU6753J.js";import"./chunk-J6U6UYNI.js";import"./chunk-GWL7ZN37.js";import"./chunk-Z3E24JZW.js";import"./chunk-BYXBJQAS.js";import"./chunk-KPZU3ZPZ.js";import"./chunk-NQKVYQ6V.js";import"./chunk-NSNUUKNK.js";import"./chunk-JXXEYFN7.js";import{a as Eo}from"./chunk-NCT5IK4R.js";import{g as Mo}from"./chunk-MREFZR3I.js";import"./chunk-BYXBJQAS.js";import{c as uo,d as _o,e as go}from"./chunk-E4GYCB3G.js";import{a as ir}from"./chunk-XZFHDKIK.js";import{c as wo}from"./chunk-2C4IBLGB.js";import"./chunk-YMVBGQ2W.js";import"./chunk-OGN6JWED.js";import{a as xo}from"./chunk-BG6GTLXF.js";import{a as So}from"./chunk-U3EOEZ3B.js";import{a as Po,d as ze,e as To}from"./chunk-I4WJ5CEN.js";import"./chunk-7IRMDCKA.js";import"./chunk-3RK6DDJD.js";import{a as po}from"./chunk-CKGJCUHW.js";import{q as co}from"./chunk-YL6HCV6T.js";import"./chunk-BJG2UU2M.js";import{d as mo}from"./chunk-ISY4SDFY.js";import"./chunk-RNEU5YBN.js";import{d as An,e as bo}from"./chunk-RO5PWDCR.js";import"./chunk-33B62QHS.js";import{a as Qe,b as Be,c as so}from"./chunk-L5HF7UAT.js";import{a as Kt,b as Do}from"./chunk-IZQ5FNXP.js";import{f as $t}from"./chunk-46LKSZ72.js";import{c as Ge}from"./chunk-SARRXJEA.js";import{a as Mn,b as Lt}from"./chunk-HVRLWPZX.js";import{a as xt}from"./chunk-SSWQWX6U.js";import"./chunk-AVKLOI56.js";import"./chunk-RFVQHGYD.js";import{c as Io}from"./chunk-V7HBROQ5.js";import{a as kt}from"./chunk-WKB7BKHN.js";import{e as at,f as On}from"./chunk-3VIZOW4E.js";import"./chunk-4AZPLO6R.js";import"./chunk-LJMHI6I5.js";import"./chunk-G7HGWSUU.js";import{c as Co}from"./chunk-67UQKMLX.js";import"./chunk-RCC5SUNH.js";import"./chunk-OYO4SRAO.js";import{c as fo,e as ho,g as yo}from"./chunk-3MU2GNGM.js";import{a as He,c as Ut}from"./chunk-AASKAWJ4.js";import"./chunk-2QD46TNT.js";import"./chunk-YQ5GJPDB.js";import"./chunk-KMYTSO3Q.js";import"./chunk-BRHHRJLT.js";import"./chunk-ILF6INR3.js";import{a as wn,b as rt}from"./chunk-RSG2H3EZ.js";import"./chunk-3LPZYQS6.js";import"./chunk-BJKHMXAA.js";import{F as zt,G as qe,u as gt,v as Ct,w as ut}from"./chunk-EGUIWOC3.js";import{b as be,c as Re}from"./chunk-VQBUIUJC.js";import{N as En,O as wt,g as We}from"./chunk-HYXSN2J6.js";import{a as vo,d as pt}from"./chunk-2JU7KFOZ.js";import"./chunk-DB3W42KN.js";import"./chunk-EQLHPWVB.js";import{a as Le,b as Tt,e as _t,f as Gt,g as et}from"./chunk-QGYIPOLS.js";import"./chunk-WACBOZDR.js";import"./chunk-TX6ZFPHY.js";import"./chunk-YZP4FX7D.js";import{a as X}from"./chunk-2FWFPV5I.js";import"./chunk-WAXYETAG.js";import{E as Ue,F as qt,G as xe,b as io,c as St,h as H,i as je,l as Se,o as tt,r as oo,s as ro,t as Ne,w as Fe}from"./chunk-OJ5SEYSF.js";import{a as no}from"./chunk-QN5Q4MBZ.js";import{a as ao}from"./chunk-MJ47GTOZ.js";import{a as A,c as wi,d as B}from"./chunk-TS6CZC3J.js";import"./chunk-VPLMHY4N.js";import{$b as Qt,$d as un,Ab as F,Ad as Pn,Bb as c,Bc as x,Ca as z,Cb as r,Cc as E,Db as a,Dc as L,E as dt,Eb as g,Ed as Tn,Fb as _e,Gb as pn,Hb as Ti,Hc as K,I as ue,Ib as Ot,Ja as Ki,Jb as At,K as Gi,Kc as he,Lb as v,Lc as Yi,M as zi,Nb as _,Ob as bn,Pb as m,Q as Me,Qa as $,Ra as Oe,Tb as ge,Ua as Ht,Ub as Ce,Vb as fe,Vc as to,Wa as l,Wd as ve,Xa as Sn,Y as vn,Ya as xn,Yd as Ft,Zb as it,Zd as ct,_b as In,aa as nt,ac as Zi,bb as Ji,bc as Pt,be as vt,cb as b,cc as s,cd as Nt,d as ft,da as Dt,dc as S,ec as I,ed as Dn,ee as U,fa as Q,fc as Te,fd as ye,gb as O,gc as Xi,hb as Ae,hc as w,ic as P,jc as T,k as fn,kb as mt,kd as Ve,la as W,ma as Ee,mb as M,md as Wt,o as hn,oa as $i,oc as de,od as q,p as yn,pa as h,rd as yt,sc as Y,t as Et,ta as p,tc as V,u as qi,ua as u,ub as C,uc as ke,ud as eo,wb as f,xa as ht,xb as se,yb as Z,zb as N}from"./chunk-VS3RTXZC.js";import"./chunk-WFMAM73Y.js";import{a as k,b as R,h as Pi,k as Cn}from"./chunk-SNAKHGZS.js";var Ei=(t=>(t[t.AdjustDifferences=1]="AdjustDifferences",t[t.CountQuantity=2]="CountQuantity",t))(Ei||{});var Oi=(n=>(n[n.Draft=1]="Draft",n[n.Pending=2]="Pending",n[n.Rejected=3]="Rejected",n[n.Accepted=4]="Accepted",n))(Oi||{});var qr=["productSearchInput"],Gr=()=>["/menu/Products/Catalog/Variants/Info"],zr=i=>({ID:i});function $r(i,e){i&1&&(r(0,"div"),s(1,"Name"),a())}function Kr(i,e){if(i&1){let t=v();r(0,"input",15,0),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.productNameFilter,n)||(d.productNameFilter=n),u(n)}),_("ngModelChange",function(){p(t);let n=m(2);return u(n.onProductNameFilterChange())})("click",function(n){return p(t),u(n.stopPropagation())}),a()}if(i&2){let t=m(2);w("ngModel",t.productNameFilter)}}function Jr(i,e){if(i&1){let t=v();r(0,"div",12),M(1,Kr,2,1,"input",13),r(2,"i",14),_("click",function(n){p(t);let d=m();return n.stopPropagation(),u(d.toggleProductFilter())}),a()()}if(i&2){let t=m();In("width",t.filterProductToggle?"100%":"auto"),l(),c("ngIf",t.filterProductToggle),l(),Qt("fa-filter",!t.filterProductToggle)("fa-filter-slash",t.filterProductToggle),c("matTooltip",t.searchTooltip)}}function Zr(i,e){if(i&1&&(r(0,"tr")(1,"td")(2,"a",16),s(3),a()(),r(4,"td"),s(5),a(),r(6,"td",17),s(7),a()()),i&2){let t=e.$implicit;l(2),c("routerLink",Y(5,Gr))("queryParams",V(6,zr,t.ID)),l(),I(" ",t.Name," "),l(2),S(t.Code),l(2),S(t.OnHand)}}function Xr(i,e){if(i&1&&N(0,Zr,8,8,"tr",null,se),i&2){let t=m();F(t.data.Data)}}function Yr(i,e){i&1&&(r(0,"tr",11)(1,"td",18),g(2,"empty-state-table"),a()())}var Rn=class i{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=X.Warning,this.originalData=e.Data,this.initSearchKeywordListener()}exportService=h(Mn);productSearchInput;modalConfig=new gt;dialogRef=h(_t);filterProductToggle=!1;productNameFilter="";searchSubject=new ft;originalData=[];initSearchKeywordListener(){this.searchSubject.pipe(zi(500),Me(),Le(),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||i)(b(Gt))};static \u0275cmp=O({type:i,selectors:[["POS-dialog-unscanned-products"]],viewQuery:function(t,o){if(t&1&&ge(qr,5,Ki),t&2){let n;Ce(n=fe())&&(o.productSearchInput=n.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&&(r(0,"modal-material",1),_("onOk",function(){return o.onOk()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),r(1,"content")(2,"div",2)(3,"div")(4,"div",3)(5,"table",4)(6,"thead",5)(7,"tr")(8,"th")(9,"div",6),M(10,$r,2,0,"div",7),C(11,Jr,3,8,"div",8),a()(),r(12,"th",9),s(13,"Code"),a(),r(14,"th",10),s(15,"On-Hand"),a()()(),r(16,"tbody"),C(17,Xr,2,0)(18,Yr,3,0,"tr",11),a()()()()()()()),t&2&&(c("config",o.modalConfig),l(10),c("ngIf",!o.filterProductToggle),l(),f(o.data.Data.length>5?11:-1),l(6),f(o.data.Data.length>0?17:18))},dependencies:[ut,Ct,ct,ko,yt,ye,qt,St,H,tt,Re,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 rr=()=>["/menu/Adjustment/Adjustment/Archive/Form"],Ye=i=>({ID:i}),ar=()=>["/print/Adjustment"],lr=i=>({"border-end-0":i}),Hn=(i,e)=>({"text-success":i,"text-danger":e}),ta=(i,e)=>({"text-danger":i,"text-success":e});function ea(i,e){if(i&1){let t=v();r(0,"div",7)(1,"button",25),_("click",function(){p(t);let n=m(2);return u(n.reject())}),g(2,"i",26),s(3,"Reject"),a(),r(4,"button",25),_("click",function(){p(t);let n=m(2);return u(n.accept())}),g(5,"i",27),s(6,"Accept "),a()()}}function na(i,e){if(i&1&&(r(0,"a",28),g(1,"i",29),s(2,"Resume "),a()),i&2){let t=m(3);c("routerLink",Y(2,rr))("queryParams",V(3,Ye,t.data.ID))}}function ia(i,e){if(i&1){let t=v();r(0,"button",25),_("click",function(){p(t);let n=m(3);return u(n.onSubmit())}),g(1,"i",30),s(2,"Submit "),a()}}function oa(i,e){if(i&1&&(C(0,na,3,5,"a",28),C(1,ia,3,0,"button",8)),i&2){let t=m(2);f(t.data.Adjustment.StateID==t.adjustmentState.Draft?0:-1),l(),f(t.data.Adjustment.StateID==t.adjustmentState.Draft?1:-1)}}function ra(i,e){if(i&1&&(r(0,"a",28),g(1,"i",29),s(2,"Edit "),a()),i&2){let t=m(3);c("routerLink",Y(2,rr))("queryParams",V(3,Ye,t.data.ID))}}function aa(i,e){if(i&1&&C(0,ra,3,5,"a",28),i&2){let t=m(2);f(t.data.Adjustment.TypeID==t.adjustmentType.AdjustDifferences&&(t.data.Adjustment.StateID==t.adjustmentState.Pending||t.data.Adjustment.StateID==t.adjustmentState.Accepted)?0:-1)}}function la(i,e){if(i&1){let t=v();r(0,"button",25),_("click",function(){p(t);let n=m(2);return u(n.delete())}),g(1,"i",31),s(2,"Delete "),a()}}function sa(i,e){if(i&1&&(r(0,"tr")(1,"th"),s(2,"Journal Link"),a(),r(3,"td"),s(4,":"),a(),r(5,"td")(6,"a",32),s(7,"View Journal"),a()()()),i&2){let t=m(2);l(6),c("href",de("https://accounting.dealpos.app/pages/journal-entry;TransID=",t.data.ID),Oe)}}function da(i,e){i&1&&(r(0,"div",38),g(1,"div",40),a())}function ma(i,e){if(i&1&&(r(0,"div",10)(1,"div",34)(2,"h4"),s(3),x(4,"date"),a(),r(5,"p",35),s(6),x(7,"date"),a()(),r(8,"div",36),g(9,"i",37),C(10,da,2,0,"div",38),a(),r(11,"div",39)(12,"h4"),s(13),a(),r(14,"p",35),s(15),a()()()),i&2){let t=m(),o=t.$implicit,n=t.$index,d=m(2);l(3),S(L(4,7,o.Date,"dd MMM yyyy")),l(3),S(L(7,10,o.Date,"HH:mm a")),l(3),In("color",n==0?"blue":"black"),l(),f(n!=d.data.StatusProcess.length-1?10:-1),l(3),S(o.Status),l(2),S(o.Creator)}}function ca(i,e){if(i&1&&M(0,ma,16,13,"div",33),i&2){let t=e.$implicit;c("ngIf",t.Date)}}function pa(i,e){if(i&1){let t=v();r(0,"div",43)(1,"i",62),_("click",function(){p(t);let n=m(3);return u(n.showUnscannedProducts())}),a()()}}function ua(i,e){if(i&1){let t=v();r(0,"a",63),_("click",function(){p(t);let n=m(3);return u(n.exportCSV(n.csvConverter,n.adjustmentTypeStatus!==-1&&n.adjustmentTypeStatus===1?"Adjustment/AdjustmentInfoExport":"Adjustment/AdjustmentCountedExport","Adjustment#"+n.data.Adjustment.Number+".csv"))}),g(1,"i",64),s(2,"Export"),a()}}function _a(i,e){i&1&&(Ot(0),r(1,"th",65),s(2,"Qty"),a(),At())}function ga(i,e){i&1&&(Ot(0),r(1,"th",65),s(2,"Counted"),a(),r(3,"th",65),s(4,"Expected"),a(),At())}function Ca(i,e){i&1&&(r(0,"th",65),s(1,"Expected"),a(),r(2,"th",65),s(3,"Counted"),a())}function fa(i,e){if(i&1&&(M(0,ga,5,0,"ng-container",54)(1,Ca,4,0,"ng-template",null,3,K),r(3,"th",65),s(4,"Difference"),a()),i&2){let t=it(2),o=m(3);c("ngIf",o.data.Adjustment.TypeID===2&&(o.data.Adjustment.StateID===1||o.data.Adjustment.StateID===2))("ngIfElse",t)}}function ha(i,e){i&1&&(r(0,"th",66),s(1," Cost "),a())}function ya(i,e){i&1&&(r(0,"th",66),s(1," Price "),a())}function va(i,e){if(i&1&&(Ot(0),g(1,"p",71),At()),i&2){let t=m().$implicit;l(),c("innerHTML",t.Note,$)}}function Sa(i,e){if(i&1&&(Ot(0),r(1,"td",72),s(2),a(),At()),i&2){let t=m().$implicit;l(),Pt(ke(3,Hn,t.Quantity>0,t.Quantity<0)),l(),I(" ",t.Quantity," ")}}function xa(i,e){if(i&1&&(Ot(0),r(1,"td",72),s(2),a(),r(3,"td",72),s(4),a(),At()),i&2){let t=m(2).$implicit;l(2),I(" ",t.Counted," "),l(2),I(" ",t.Expected," ")}}function ba(i,e){if(i&1&&(r(0,"td",72),s(1),a(),r(2,"td",72),s(3),a()),i&2){let t=m(2).$implicit;l(),I(" ",t.Expected," "),l(2),I(" ",t.Counted," ")}}function Ia(i,e){if(i&1&&(M(0,xa,5,2,"ng-container",54)(1,ba,4,2,"ng-template",null,3,K),r(3,"td",72),s(4),x(5,"number"),a()),i&2){let t=it(2),o=m().$implicit,n=m(3);c("ngIf",n.data.Adjustment.TypeID===2&&(n.data.Adjustment.StateID===1||n.data.Adjustment.StateID===2))("ngIfElse",t),l(3),Pt(ke(7,ta,o.Expected>o.Counted,o.Expected<o.Counted)),l(),I(" ",E(5,5,o.Difference)," ")}}function Da(i,e){if(i&1&&(g(0,"td",73),x(1,"number")),i&2){let t=m().$implicit;c("innerHTML",E(1,1,t.UnitCost),$)}}function Pa(i,e){if(i&1&&(g(0,"td",73),x(1,"number")),i&2){let t=m().$implicit;c("innerHTML",E(1,1,t.UnitPrice),$)}}function Ta(i,e){if(i&1&&(r(0,"tr"),g(1,"td",67),r(2,"td")(3,"a",68),s(4),a(),r(5,"div"),s(6),a(),g(7,"app-serial-note",69),M(8,va,2,1,"ng-container",21),a(),M(9,Sa,3,6,"ng-container",54)(10,Ia,6,10,"ng-template",null,4,K)(12,Da,2,3,"td",70)(13,Pa,2,3,"td",70),a()),i&2){let t=e.$implicit,o=e.index,n=it(11),d=m(3);l(),c("innerHTML",o+1+".",$),l(2),c("queryParams",V(10,Ye,t.VariantID)),l(),S(t.Name),l(2),S(t.Code),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",n),l(3),c("ngIf",d.roleService.product.Cost),l(),c("ngIf",d.roleService.sell.PriceVisible)}}function wa(i,e){if(i&1&&(r(0,"b"),x(1,"sum"),x(2,"sum"),s(3),x(4,"sum"),x(5,"number"),a()),i&2){let t=m(3);Pt(ke(14,Hn,L(1,3,t.data.DifferencesArray,"Quantity")>0,L(2,6,t.data.DifferencesArray,"Quantity")<0)),l(3),S(E(5,12,L(4,9,t.data.DifferencesArray,"Quantity")))}}function Ma(i,e){if(i&1&&(r(0,"b",74),x(1,"sum"),x(2,"sum"),s(3),x(4,"sum"),x(5,"number"),a()),i&2){let t=m(3);c("ngClass",ke(13,Hn,L(1,2,t.data.DifferencesArray,"Difference")>0,L(2,5,t.data.DifferencesArray,"Difference")<0)),l(3),I(" ",E(5,11,L(4,8,t.data.DifferencesArray,"Difference"))," ")}}function Ea(i,e){if(i&1&&(r(0,"td",75)(1,"b"),s(2),x(3,"sum"),x(4,"number"),a()()),i&2){let t=m(3);l(2),S(E(4,4,L(3,1,t.data.DifferencesArray,"TotalCost")))}}function Oa(i,e){if(i&1&&(r(0,"td",76)(1,"b"),s(2),x(3,"sum"),x(4,"number"),a()()),i&2){let t=m(3);l(2),S(E(4,4,L(3,1,t.data.DifferencesArray,"TotalPrice")))}}function Aa(i,e){if(i&1&&(r(0,"div",12)(1,"div",41)(2,"div",42)(3,"h2"),s(4),a(),C(5,pa,2,0,"div",43),a(),r(6,"div",44)(7,"a",45),g(8,"i",46),s(9,"Print "),a(),M(10,ua,3,0,"a",47),a()(),r(11,"div",18)(12,"div",48)(13,"table",49)(14,"thead",50)(15,"tr")(16,"th",51),s(17,"No"),a(),r(18,"th",52),s(19," Name "),r(20,"small",53),s(21),a()(),M(22,_a,3,0,"ng-container",54)(23,fa,5,2,"ng-template",null,1,K)(25,ha,2,0,"th",55)(26,ya,2,0,"th",55),a()(),r(27,"tbody"),M(28,Ta,14,12,"tr",56),a(),r(29,"tfoot")(30,"tr")(31,"td",57)(32,"b"),s(33,"Total :"),a()(),r(34,"td",58),M(35,wa,6,17,"b",59)(36,Ma,6,16,"ng-template",null,2,K),a(),M(38,Ea,5,6,"td",60)(39,Oa,5,6,"td",61),a()()()()()()),i&2){let t=it(24),o=it(37),n=m(2);l(4),I(" ",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity?"Adjusted":"Counted"," Inventory "),l(),f(n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity&&(n.data.Adjustment.StateID==n.adjustmentState.Draft||n.data.Adjustment.StateID==n.adjustmentState.Pending)?5:-1),l(2),c("routerLink",Y(17,ar))("queryParams",V(18,Ye,n.paramId))("ngClass",V(20,lr,n.roleService.global.Export)),l(3),c("ngIf",n.roleService.global.Export),l(11),I(" (",n.data.DifferencesArray.length," SKU)"),l(),c("ngIf",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity)("ngIfElse",t),l(3),c("ngIf",n.roleService.product.Cost),l(),c("ngIf",n.roleService.sell.PriceVisible),l(2),c("ngForOf",n.data.DifferencesArray),l(3),c("colSpan",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity?2:4),l(4),c("ngIf",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity)("ngIfElse",o),l(3),c("ngIf",n.roleService.product.Cost),l(),c("ngIf",n.roleService.sell.PriceVisible)}}function ka(i,e){if(i&1&&(r(0,"h2"),s(1," Counted Inventory "),r(2,"small",53),s(3),a()()),i&2){let t=m(3);l(3),I("(",t.data.CountedArray.length," SKU)")}}function Va(i,e){if(i&1){let t=v();r(0,"a",63),_("click",function(){p(t);let n=m(3);return u(n.exportCSV(n.csvConverter,"Adjustment/AdjustmentCountedExport","Adjustment_Counted#"+n.data.Adjustment.Number+".csv"))}),g(1,"i",64),s(2,"Export"),a()}}function ja(i,e){if(i&1&&(r(0,"tr"),g(1,"td",67),r(2,"td")(3,"a",68),s(4),a(),r(5,"div"),s(6),a()(),r(7,"td",72),s(8),a(),r(9,"td",72),s(10),a(),r(11,"td",72),s(12),a()()),i&2){let t=e.$implicit,o=e.index;l(),c("innerHTML",o+1+".",$),l(2),c("queryParams",V(9,Ye,t.VariantID)),l(),S(t.Name),l(2),S(t.Code),l(2),S(t.Counted),l(2),S(t.Expected),l(),Pt(ke(11,Hn,t.Difference>0,t.Difference<0)),l(),I(" ",t.Difference," ")}}function Na(i,e){if(i&1&&(r(0,"div",12)(1,"div",41)(2,"div"),M(3,ka,4,1,"h2",21),a(),r(4,"div",44)(5,"a",45),g(6,"i",46),s(7,"Print "),a(),M(8,Va,3,0,"a",47),a()(),r(9,"div",18)(10,"div",48)(11,"table",49)(12,"thead",50)(13,"tr")(14,"th",51),s(15,"No"),a(),r(16,"th",52),s(17,"Name"),a(),r(18,"th",77),s(19,"Counted"),a(),r(20,"th",77),s(21,"Expected"),a(),r(22,"th",77),s(23,"Difference"),a()()(),r(24,"tbody"),M(25,ja,13,14,"tr",56),a()()()()()),i&2){let t=m(2);l(3),c("ngIf",t.data.CountedArray.length>0&&t.data.Adjustment.TypeID==t.adjustmentState.Pending),l(2),c("routerLink",Y(6,ar))("queryParams",V(7,Ye,t.paramId))("ngClass",V(9,lr,t.roleService.global.Export)),l(3),c("ngIf",t.roleService.global.Export),l(17),c("ngForOf",t.data.CountedArray)}}function Fa(i,e){if(i&1&&(r(0,"mainpanel-cmp",6)(1,"actions"),C(2,ea,7,0,"div",7),r(3,"div",7),C(4,oa,2,2),C(5,aa,1,1),C(6,la,3,0,"button",8),a()(),r(7,"content")(8,"div",9)(9,"div",10)(10,"div",11)(11,"div",12)(12,"div",13)(13,"div",14),g(14,"h2",15,0),r(16,"div",16),g(17,"i",17),r(18,"span"),s(19),a()()()(),r(20,"div",18)(21,"table",19)(22,"tr")(23,"th"),s(24,"Date"),a(),r(25,"td"),s(26,":"),a(),g(27,"td",20),a(),r(28,"tr")(29,"th"),s(30,"PIC"),a(),r(31,"td"),s(32,":"),a(),g(33,"td",20),a(),r(34,"tr")(35,"th"),s(36,"Type"),a(),r(37,"td"),s(38,":"),a(),g(39,"td",20),a(),r(40,"tr")(41,"th"),s(42,"Note"),a(),r(43,"td"),s(44,":"),a(),g(45,"td",20),a(),M(46,sa,8,2,"tr",21),r(47,"tr")(48,"th"),s(49,"Tag"),a(),r(50,"td"),s(51,":"),a(),g(52,"td",20),a()()()(),r(53,"div")(54,"div",12)(55,"div",13)(56,"h2"),s(57,"Status"),a()(),r(58,"div",18),N(59,ca,1,1,"div",10,se),a()()()(),r(61,"div",22),M(62,Aa,40,22,"div",23)(63,Na,26,11,"div",23),a()(),g(64,"pos-footer-alert",24),a()()()),i&2){let t=it(15),o=m();c("pageData",o.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),f(o.hasAccRejButton?2:-1),l(2),f(o.roleService.adjustment.Create?4:-1),l(),f(o.roleService.adjustment.Edit?5:-1),l(),f(o.roleService.adjustment.Delete?6:-1),l(8),c("matTooltip",t.classList.contains("text-truncate")?o.data.Adjustment.OutletName:"")("innerHTML",o.data.Adjustment.OutletName,$),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,$),l(6),c("innerHTML",o.data.Adjustment.PIC,$),l(6),c("innerHTML",o.data.Adjustment.TypeLabel,$),l(6),c("innerHTML",o.data.Adjustment.Note,$),l(),c("ngIf",o.data.AppsAccoutingActive&&o.roleService.accounting.View),l(6),c("innerHTML",o.data.Adjustment.TagName,$),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.adjustmentState.Pending),l(),c("created",o.data.CreatedInfo.Created)("modified",o.data.CreatedInfo.Modified)}}var Qn=class i extends xt{constructor(t,o,n,d,y,D,lt,ot){super(t,o,"Adjustment/AuditInventoryAdjustmentInfo",null,null,d);this.httpService=o;this.toastr=n;this.csvConverter=y;this.router=D;this.roleService=lt;this.dialog=ot;this.initQueryParam()}paramId;hasAccRejButton=!1;isEditable=!1;adjustmentType=Ei;adjustmentState=Oi;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)}exportCSV(t,o,n){this.httpService.get(`/api/${o}`,[{key:"ID",value:this.paramId}]).subscribe(d=>{t.convertToCSV(d,n)})}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",X.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",X.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.",X.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(Ko,{data:{title:"Submit Review",message:`
2
2
  <h4>Are you sure you want to Change status to pending review?</h4>
3
3
  `,headerType:X.Warning}}).afterClosed().pipe(dt(t=>t===!0),nt(()=>this.httpService.post(wt.AdjusmentSubmitReview,{ID:this.data.Adjustment.ID}))).subscribe(t=>{this.toastr.success(t.Message,X.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(Rn,{data:o})})}get adjustmentTypeStatus(){return this.data?this.data.Adjustment.TypeID==this.adjustmentType.AdjustDifferences||this.data.Adjustment.StateID==this.adjustmentState.Accepted&&this.data.Adjustment.TypeID==this.adjustmentType.CountQuantity?1:2:-1}static \u0275fac=function(o){return new(o||i)(b(rt),b(U),b(vt),b(ve),b(kt),b(Ft),b(B),b(et))};static \u0275cmp=O({type:i,selectors:[["POS-adjustment-info"]],standalone:!1,features:[mt],decls:1,vars:1,consts:[["outletName",""],["NOTACC",""],["COUNTEDTOTAL",""],["ELSE_BLOCK",""],["NOTACCDATA",""],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"btn-group","me-4"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-4"],[1,"card"],[1,"card-header"],[1,"d-flex","gap-4"],[1,"text-truncate",3,"matTooltip","innerHTML"],[1,"badge","rounded-pill","d-flex","align-items-center","gap-3","fs-6",3,"ngClass"],[1,"fa-solid",3,"ngClass"],[1,"card-body"],[1,"table-sm","table-borderless"],[3,"innerHTML"],[4,"ngIf"],[1,"col-sm-8"],["class","card",4,"ngIf"],[3,"created","modified"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-thumbs-down","me-3"],[1,"fa-solid","fa-thumbs-up","me-3"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-pen-to-square","me-3"],[1,"fa-solid","fa-floppy-disk","me-3"],[1,"fa-solid","fa-trash","me-3"],[3,"href"],["class","row",4,"ngIf"],[1,"col","text-end"],[1,"mt-3"],[1,"col-3","text-center","position-relative"],[1,"fa-solid","fa-angle-up","current-status-icon"],[1,"d-flex","justify-content-center","h-100"],[1,"col-5"],[1,"timeline"],[1,"card-header","d-flex","justify-content-between"],[1,"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"],[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"],[4,"ngFor","ngForOf"],[1,"text-end","empty-column",3,"colSpan"],[1,"text-end","empty-column"],[3,"class",4,"ngIf","ngIfElse"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Cost",4,"ngIf"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Price",4,"ngIf"],["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,"text-end",2,"width","120px"],[1,"text-center",3,"innerHTML"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[3,"serials"],["class","text-end",3,"innerHTML",4,"ngIf"],[1,"special-TinyMCE","fst-italic","text-warning","mb-0",2,"word-break","break-all",3,"innerHTML"],[1,"text-end"],[1,"text-end",3,"innerHTML"],[3,"ngClass"],["matTooltipPosition","above","matTooltip","Total from Quantity x Cost",1,"text-end","empty-column"],["matTooltipPosition","above","matTooltip","Total from Quantity x Price",1,"text-end","empty-column"],[1,"text-end",2,"width","100px"]],template:function(o,n){o&1&&M(0,Fa,65,22,"mainpanel-cmp",5),o&2&&c("ngIf",n.data)},dependencies:[Nt,Dn,ye,ct,at,be,Je,Ln,q,Wt,We],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 La=()=>["/menu/Adjustment/Adjustment/Archive/Form"],Ra=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Qa=i=>({ID:i}),Ba=i=>({"text-success":i}),Ha=i=>({"text-danger":i});function Wa(i,e){if(i&1){let t=v();r(0,"a",23),_("click",function(){p(t);let n=m(3);return u(n.httpPostListID("Adjustment/DeleteInventoryAdjustmentList"))}),g(1,"i",24),s(2,"Delete "),a()}}function qa(i,e){if(i&1){let t=v();r(0,"a",25),_("click",function(){p(t);let n=m(3);return u(n.onMergeAdjustment())}),g(1,"i",26),s(2," Merge "),a()}}function Ga(i,e){if(i&1&&(r(0,"div",5),C(1,Wa,3,0,"a",21),C(2,qa,3,0,"a",22),a()),i&2){let t=m(2);l(),f(t.getSelectedData().length>0&&(!(t.roleService==null||t.roleService.adjustment==null)&&t.roleService.adjustment.Delete)?1:-1),l(),f(t.getSelectedData().length>=2&&(!(t.roleService==null||t.roleService.adjustment==null)&&t.roleService.adjustment.Edit)?2:-1)}}function za(i,e){if(i&1){let t=v();r(0,"button",27),_("click",function(){p(t);let n=m(2);return u(n.openExportModal())}),g(1,"i",28),s(2," Export "),a()}}function $a(i,e){i&1&&(r(0,"a",7),s(1,"New"),a()),i&2&&c("routerLink",Y(1,La))}function Ka(i,e){if(i&1){let t=v();r(0,"div")(1,"div",29)(2,"h6"),s(3,"Outlet"),a(),r(4,"ng-select",30),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.EntityID,n)||(d.pageData.Filter.EntityID=n),u(n)}),a(),r(5,"h6"),s(6,"Date From - To"),a(),r(7,"div",31)(8,"div",32)(9,"datepicker",33),T("dateChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.From,n)||(d.pageData.Filter.From=n),u(n)}),a()(),r(10,"div",34)(11,"datepicker",35),T("dateChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.To,n)||(d.pageData.Filter.To=n),u(n)}),a()()(),r(12,"h6"),s(13,"Quantity From - To"),a(),r(14,"div",36)(15,"input",37),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.QuantityFrom,n)||(d.pageData.Filter.QuantityFrom=n),u(n)}),a(),s(16," - "),r(17,"input",37),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.QuantityTo,n)||(d.pageData.Filter.QuantityTo=n),u(n)}),a()(),r(18,"h6"),s(19,"State"),a(),r(20,"ng-select",38),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.State,n)||(d.pageData.Filter.State=n),u(n)}),a(),r(21,"h6"),s(22,"Adjustment Type"),a(),r(23,"ng-select",39),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.Type,n)||(d.pageData.Filter.Type=n),u(n)}),a(),r(24,"h6"),s(25,"Adjustment Tag"),a(),r(26,"ng-select",40),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.TagID,n)||(d.pageData.Filter.TagID=n),u(n)}),a(),r(27,"h6"),s(28,"Rows"),a(),r(29,"input",41),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.RowCount,n)||(d.pageData.Filter.RowCount=n),u(n)}),a(),r(30,"h6"),s(31,"Exclude Zero"),a(),r(32,"radio-options",42),T("modelChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.ExcludeZero,n)||(d.pageData.Filter.ExcludeZero=n),u(n)}),a()()()}if(i&2){let t=m(2);l(4),c("items",t.pageData.Options.Entities),w("ngModel",t.pageData.Filter.EntityID),l(5),c("isFloatingLabel",!1),w("date",t.pageData.Filter.From),l(2),c("isFloatingLabel",!1),w("date",t.pageData.Filter.To),l(4),w("ngModel",t.pageData.Filter.QuantityFrom),l(2),w("ngModel",t.pageData.Filter.QuantityTo),l(3),c("items",t.pageData.Options.States),w("ngModel",t.pageData.Filter.State),l(3),c("items",t.pageData.Options.Types),w("ngModel",t.pageData.Filter.Type),l(3),c("items",t.pageData.Options.AdjustmentTagsOptions),w("ngModel",t.pageData.Filter.TagID),l(3),w("ngModel",t.pageData.Filter.RowCount),c("max",1e4),l(3),w("model",t.pageData.Filter.ExcludeZero)}}function Ja(i,e){if(i&1){let t=v();r(0,"th",12)(1,"input",43),_("change",function(n){p(t);let d=m(2);return u(d.onSelectAllData(n.target.checked))}),a()()}}function Za(i,e){i&1&&(r(0,"th",18),s(1,"Cost"),a())}function Xa(i,e){if(i&1){let t=v();r(0,"td")(1,"input",48),T("ngModelChange",function(n){p(t);let d=m().$implicit;return P(d.selected,n)||(d.selected=n),u(n)}),a()()}if(i&2){let t=m().$implicit;l(),w("ngModel",t.selected)}}function Ya(i,e){if(i&1&&(r(0,"td",45),s(1),x(2,"quantityFraction"),a()),i&2){let t=m().$implicit;l(),I(" ",E(2,1,t.Quantity)," ")}}function tl(i,e){if(i&1&&(r(0,"td",45),s(1),x(2,"quantityFraction"),a()),i&2){let t=m().$implicit;Pt(V(5,Ba,t.Quantity>0)),l(),I(" +",E(2,3,t.Quantity)," ")}}function el(i,e){if(i&1&&(r(0,"td",45),s(1),x(2,"quantityFraction"),a()),i&2){let t=m().$implicit;Pt(V(5,Ha,t.Quantity<0)),l(),I(" ",E(2,3,t.Quantity)," ")}}function nl(i,e){if(i&1&&(r(0,"td",45),s(1),x(2,"amountFraction"),a()),i&2){let t=m().$implicit;l(),S(E(2,1,t.Cost))}}function il(i,e){if(i&1&&(r(0,"tr",19),C(1,Xa,2,1,"td"),r(2,"td"),s(3),a(),r(4,"td")(5,"a",44),s(6),a()(),r(7,"td"),s(8),x(9,"date"),a(),r(10,"td",45),s(11),x(12,"number"),a(),C(13,Ya,3,3,"td",45),C(14,tl,3,7,"td",46),C(15,el,3,7,"td",46),r(16,"td"),s(17),a(),C(18,nl,3,3,"td",45),r(19,"td"),s(20),a(),r(21,"td"),g(22,"div",47),a()()),i&2){let t=e.$implicit,o=m(2);l(),f(!(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",Y(21,Ra))("queryParams",V(22,Qa,t.ID)),l(),S(t.Number),l(2),S(L(9,16,t.Date,"dd MMM yyyy")),l(3),S(E(12,19,t.SKUCount)),l(2),f(t.Quantity==0?13:-1),l(),f(t.Quantity>0?14:-1),l(),f(t.Quantity<0?15:-1),l(2),S(t.TypeLabel),l(),f(!(o.roleService==null||o.roleService.product==null)&&o.roleService.product.Cost?18:-1),l(),Zi(o.stateColored(+t.StateID)),l(),I(" ",t.StateLabel," "),l(2),c("innerHTML",t.Note,$)}}function ol(i,e){if(i&1){let t=v();r(0,"mainpanel-cmp",2),T("textChange",function(n){p(t);let d=m();return P(d.pageData.Filter.Number,n)||(d.pageData.Filter.Number=n),u(n)}),_("onSubmit",function(){p(t);let n=m();return u(n.searchFromPageOne())}),T("filterChange",function(n){p(t);let d=m();return P(d.pageData.Filter,n)||(d.pageData.Filter=n),u(n)}),r(1,"actions")(2,"a",3),g(3,"i",4),s(4,"Scanner App "),a(),C(5,Ga,3,2,"div",5),C(6,za,3,0,"button",6),C(7,$a,2,2,"a",7),a(),r(8,"filters"),M(9,Ka,33,17,"ng-template",null,0,K),a(),r(11,"content")(12,"div",8)(13,"div",9)(14,"table",10)(15,"thead",11)(16,"tr"),C(17,Ja,2,0,"th",12),r(18,"th",13),s(19,"Outlet"),a(),r(20,"th",13),s(21,"Number"),a(),r(22,"th",14),s(23,"Date"),a(),r(24,"th",15),s(25,"SKU"),a(),r(26,"th",16),s(27," Qty "),a(),r(28,"th",17),s(29,"Type"),a(),C(30,Za,2,0,"th",18),r(31,"th",14),s(32,"State"),a(),r(33,"th"),s(34,"Note"),a()()(),r(35,"tbody"),N(36,il,23,24,"tr",19,Z),a()()(),r(38,"POS-complex-pagination",20),_("jumpToPage",function(){p(t);let n=m();return u(n.getListData())})("previousPage",function(){p(t);let n=m();return u(n.getListData())})("nextPage",function(){p(t);let n=m();return u(n.getListData())}),a()()()()}if(i&2){let t=m();c("pageData",t.menuData),w("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),w("filter",t.pageData.Filter),l(5),f(!(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(),f(t.roleService.global.Export?6:-1),l(),f(t.roleService.adjustment.Create?7:-1),l(10),f(!(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),f(!(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 Wn=class i extends xt{constructor(t,o,n,d,y,D){super(t,o,"Adjustment/GetInventoryAdjustmentList","AdjustmentLoader/GetInventoryAdjustmentList",n);this.toastr=n;this.csvConverter=d;this.roleService=y;this.matDialog=D}hideMore=!1;openExportModal(){this.matDialog.open(Lt,{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($o,{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),nt(o=>this.httpService.put(wt.MergeAdjustment,o))).subscribe(()=>{this.toastrService.success("Inventory Adjustment records have been merged successfully.",X.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"}}}static \u0275fac=function(o){return new(o||i)(b(rt),b(U),b(vt),b(kt),b(B),b(et))};static \u0275cmp=O({type:i,selectors:[["POS-inventory-adjustment"]],standalone:!1,features:[mt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[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","50px"],[2,"width","130px"],[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","",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an State",3,"ngModelChange","items","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose an Type",3,"ngModelChange","items","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose an Tags",3,"ngModelChange","items","ngModel"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel","max"],[3,"modelChange","model"],["type","checkbox",3,"change"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end",3,"class"],[3,"innerHTML"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(o,n){o&1&&C(0,ol,39,11,"mainpanel-cmp",1),o&2&&f(n.data?0:-1)},dependencies:[ct,at,St,io,H,tt,ze,pt,Kt,An,Ut,be,q,Wt,So,xo],encapsulation:2})};var Gn=class i{config;dialogRef=h(_t);data=h(Gt);filterKeys=["From","To","PageNumber","RowCount","EntityID","TagID"];httpService=h(U);summaryData=z(null);constructor(){this.config=new gt,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,n])=>this.filterKeys.includes(o)).map(([o,n])=>{if(o==="From"||o==="To"){let d=new Date(n);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]:n}}),t=e.reduce((o,n)=>k(k({},o),n),{});this.httpService.post("api/Adjustment/AuditAdjustmentSumReport",t).pipe(Et(o=>o.Data),Q(o=>this.summaryData.set(o))).subscribe(),console.log("tdf",e)}onOK(){}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["pos-dialog-adjustment-summary"]],decls:29,vars:13,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid"],[1,"table","table-bordered"],[1,"py-2",2,"width","40%"],[1,"text-end","py-2"]],template:function(t,o){t&1&&(r(0,"modal-material",0),_("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),r(1,"content")(2,"div",1)(3,"table",2)(4,"tbody")(5,"tr")(6,"th",3),s(7,"Quantity"),a(),r(8,"td",4),s(9),x(10,"number"),a()(),r(11,"tr")(12,"th",3),s(13,"Weight"),a(),r(14,"td",4),s(15),x(16,"number"),a()(),r(17,"tr")(18,"th",3),s(19,"Total Cost"),a(),r(20,"td",4),s(21),x(22,"number"),a()(),r(23,"tr")(24,"th",3),s(25,"Total Price"),a(),r(26,"td",4),s(27),x(28,"number"),a()()()()()()()),t&2&&(c("config",o.config),l(9),I(" ",E(10,5,o.summaryData().Quantity)," "),l(6),I(" ",E(16,7,o.summaryData().Weight)," "),l(6),I(" ",E(22,9,o.summaryData().TotalCost)," "),l(6),I(" ",E(28,11,o.summaryData().TotalPrice)," "))},dependencies:[ut,Ct,yt,q],encapsulation:2,changeDetection:0})};var al=()=>["/menu/Adjustment/Adjustment/Archive/Info"],ll=i=>({ID:i});function sl(i,e){if(i&1){let t=v();r(0,"button",4),_("click",function(){p(t);let n=m();return u(n.openExportModal())}),g(1,"i",5),s(2," Export "),a()}}function dl(i,e){if(i&1){let t=v();r(0,"div",6)(1,"h6"),s(2,"Outlets"),a(),r(3,"outlet-selector",7),T("ngModelChange",function(n){p(t);let d=m();return P(d.pageData.Filter.EntityID,n)||(d.pageData.Filter.EntityID=n),u(n)}),a(),r(4,"h6"),s(5,"From"),a(),r(6,"datepicker",8),T("dateChange",function(n){p(t);let d=m();return P(d.pageData.Filter.From,n)||(d.pageData.Filter.From=n),u(n)}),a(),r(7,"h6"),s(8,"To"),a(),r(9,"datepicker",9),T("dateChange",function(n){p(t);let d=m();return P(d.pageData.Filter.To,n)||(d.pageData.Filter.To=n),u(n)}),a(),r(10,"h6"),s(11,"Adjustment Tag"),a(),r(12,"ng-select",10),T("ngModelChange",function(n){p(t);let d=m();return P(d.pageData.Filter.TagID,n)||(d.pageData.Filter.TagID=n),u(n)}),a()()}if(i&2){let t=m();l(3),c("accessType",2),w("ngModel",t.pageData.Filter.EntityID),c("multiple",!1),l(3),c("isFloatingLabel",!1),w("date",t.pageData.Filter.From),l(3),c("isFloatingLabel",!1),w("date",t.pageData.Filter.To),l(3),c("items",t.pageData.Options.AdjustmentTagsOptions),w("ngModel",t.pageData.Filter.TagID)}}function ml(i,e){i&1&&(r(0,"th",22),s(1," @ Cost "),a())}function cl(i,e){i&1&&(r(0,"th",22),s(1," @ Price "),a())}function pl(i,e){if(i&1&&(r(0,"th",36),s(1),x(2,"number"),a()),i&2){let t=m().$implicit;l(),I(" ",E(2,1,t.UnitCost)," ")}}function ul(i,e){if(i&1&&(r(0,"th",36),s(1),x(2,"number"),a()),i&2){let t=m().$implicit;l(),I(" ",E(2,1,t.UnitPrice)," ")}}function _l(i,e){if(i&1&&(r(0,"tr")(1,"th",32),s(2),a(),r(3,"th",33),s(4),a(),r(5,"th",34),s(6),x(7,"number"),a(),M(8,pl,3,3,"th",35)(9,ul,3,3,"th",35),a()),i&2){let t=e.$implicit,o=m(3);l(2),I(" ",t.VariantName," "),l(2),I(" ",t.VariantCode," "),l(2),I(" ",E(7,5,t.Quantity)," "),l(2),c("ngIf",o.roleService.product.Cost),l(),c("ngIf",o.roleService.sell.UnitPriceEditor)}}function gl(i,e){if(i&1&&(r(0,"div")(1,"div",23)(2,"div",24)(3,"a",25),g(4,"span",26),x(5,"date"),g(6,"small",27),x(7,"date"),r(8,"small",28),s(9),a()()()(),r(10,"div")(11,"strong",29),s(12),a(),g(13,"div",30),a(),r(14,"table",31)(15,"tbody"),M(16,_l,10,7,"tr",18),a()()()),i&2){let t=e.$implicit;l(3),c("routerLink",Y(14,al))("queryParams",V(15,ll,t.ID)),l(),c("innerHTML",t.EntityName+" #"+t.Number+" - "+L(5,8,t.Created,"dd MMM yyyy"),$),l(2),c("innerHTML","("+L(7,11,t.Created,"HH:mm")+")",$),l(3),I(" ",t.PIC),l(3),I("[Q:",t.Quantity,"]"),l(),c("innerHTML",t.Note,$),l(3),c("ngForOf",t.Items)}}function Cl(i,e){if(i&1){let t=v();r(0,"div",11)(1,"table",12)(2,"thead",13)(3,"tr")(4,"th",14),s(5,"Name"),a(),r(6,"th",15),s(7,"Code"),a(),r(8,"th",16),s(9,"Qty"),a(),M(10,ml,2,0,"th",17)(11,cl,2,0,"th",17),a()()(),M(12,gl,17,17,"div",18),r(13,"div",19)(14,"button",20),_("click",function(){p(t);let n=m();return u(n.onDialogSummary())}),s(15," View Adjustment Summary "),a()(),r(16,"POS-complex-pagination",21),_("jumpToPage",function(){p(t);let n=m();return u(n.getListData())})("previousPage",function(){p(t);let n=m();return u(n.getListData())})("nextPage",function(){p(t);let n=m();return u(n.getListData())}),a()()}if(i&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 zn=class i extends xt{constructor(t,o,n,d,y){super(t,o,"Adjustment/AuditAdjustmentReport","AdjustmentLoader/AuditAdjustmentReport",void 0,void 0,!0);this.httpService=o;this.csvConverter=n;this.roleService=d;this.matDialog=y}dataEndpoint="/api/Adjustment/AuditAdjustmentReport";loaderEndpoint="/api/AdjustmentLoader/AuditAdjustmentReport";countEndpoint="/api/Adjustment/AuditAdjustmentReportCount";data$;loader$;loader;onOpenExportDialog(t){}openExportModal(){this.matDialog.open(Lt,{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(k({},this.pageData),{Filter:R(k({},this.pageData.Filter),{TagID:t!==-1?this.pageData.Filter.TagID:null})})}onDialogSummary(){this.matDialog.open(Gn,{data:{pageData:this.pageData.Filter}})}static \u0275fac=function(o){return new(o||i)(b(rt),b(U),b(kt),b(B),b(et))};static \u0275cmp=O({type:i,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,n){if(o&1){let d=v();r(0,"mainpanel-cmp",1),T("textChange",function(D){return p(d),P(n.pageData.Filter.Number,D)||(n.pageData.Filter.Number=D),u(D)}),_("onSubmit",function(){return p(d),u(n.searchFromPageOne())}),T("filterChange",function(D){return p(d),P(n.pageData.Filter,D)||(n.pageData.Filter=D),u(D)}),r(1,"actions"),M(2,sl,3,0,"button",2),a(),r(3,"filters"),M(4,dl,13,9,"ng-template",null,0,K),a(),r(6,"content"),M(7,Cl,17,5,"div",3),a()()}o&2&&(c("pageData",n.menuData),w("text",n.pageData.Filter.Number),c("isFilterOnDropdown",!1),w("filter",n.pageData.Filter),l(2),c("ngIf",n.roleService.global.Export),l(5),c("ngIf",n.data&&n.data.Data))},dependencies:[Dn,ye,ct,at,H,tt,ze,pt,Kt,Ge,q,Wt],encapsulation:2})};var $n=class extends wn{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(Gi(()=>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(n=>{n.Counted="",this.products.push(n),this.originalProducts.push(n)})})}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 hl=["stepper"],mr=i=>({"nb-button-override":i}),yl=i=>({custom:i}),cr=()=>["/menu/Products/Catalog/Variants/Info"],Vi=i=>({ID:i}),vl=i=>({"bg-gradient-warning":i}),Sl=i=>({Filter:i}),xl=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function bl(i,e){if(i&1){let t=v();r(0,"button",9),_("click",function(){p(t);let n=m(2);return u(n.validateFilter())}),s(1," Next "),a()}if(i&2){let t=m(2);c("disabled",!t.roleService.adjustment.Create)}}function Il(i,e){if(i&1){let t=v();r(0,"div",6)(1,"button",10),_("click",function(){p(t);let n=m(2);return u(n.stepper.previous())}),s(2," Back "),a(),r(3,"button",11),_("click",function(){p(t);let n=m(2);return u(n.stepper.next())}),s(4," Next "),a()()}if(i&2){let t=m(2);c("ngClass",V(1,mr,t.currentSubStatus!=t.subStatusEnum.PAID))}}function Dl(i,e){if(i&1){let t=v();r(0,"div",6)(1,"button",12),_("click",function(){p(t);let n=m(2);return u(n.stepper.previous())}),s(2," Back "),a(),r(3,"button",11),_("click",function(){p(t);let n=m(2);return u(n.stepper.next())}),s(4," Confirm Adjustment "),a()()}if(i&2){let t=m(2);c("ngClass",V(1,mr,t.currentSubStatus!=t.subStatusEnum.PAID))}}function Pl(i,e){i&1&&(g(0,"i",54),s(1,"Filter"))}function Tl(i,e){i&1&&(r(0,"small",55),s(1,"Outlet option is required."),a())}function wl(i,e){i&1&&(g(0,"i",56),s(1,"Input"))}function Ml(i,e){i&1&&(r(0,"th",43),s(1,"Expected"),a())}function El(i,e){i&1&&(r(0,"th",43),s(1,"Changes"),a())}function Ol(i,e){if(i&1&&(r(0,"td"),s(1),a()),i&2){let t=m().$implicit;l(),I(" ",t.Quantity," ")}}function Al(i,e){if(i&1&&(r(0,"td"),s(1),g(2,"i",63),s(3),x(4,"number"),a()),i&2){let t=m().$implicit;Qt("bg-gradient-danger",t.Counted<t.Quantity)("bg-gradient-success",t.Counted>t.Quantity),l(),I(" ",t.Quantity," "),l(2),Te(" ",t.Counted," (",(t.Counted-t.Quantity>0?"+":"")+E(4,7,t.Counted-t.Quantity),") ")}}function kl(i,e){if(i&1){let t=v();r(0,"i",64),_("click",function(){p(t);let n=m().$implicit,d=m(3);return u(d.clear(n))}),a()}}function Vl(i,e){if(i&1){let t=v();r(0,"tr")(1,"td"),s(2),a(),r(3,"td",57),s(4),a(),r(5,"td",57),s(6),a(),r(7,"td")(8,"a",58),s(9),a()(),r(10,"td"),s(11),a(),C(12,Ol,2,1,"td"),r(13,"td")(14,"input",59,2),T("ngModelChange",function(n){let d=p(t).$implicit;return P(d.Counted,n)||(d.Counted=n),u(n)}),_("ngModelChange",function(){let n=p(t).$implicit,d=it(15),y=m(3);return u(y.onReset(n,d))}),a()(),C(16,Al,5,9,"td",60),r(17,"td",61),C(18,kl,1,0,"i",62),a()()}if(i&2){let t=e.$implicit,o=e.$index,n=m(3);l(2),S(o+1+"."),l(2),I(" ",t.CategoryName," "),l(2),I(" ",t.ProductName," "),l(2),c("routerLink",Y(14,cr))("queryParams",V(15,Vi,t.ID)),l(),S(t.Model),l(2),S(t.Code),l(),f(n.roleService.inventory.View?12:-1),l(2),Pt(V(17,vl,t.Counted!==""&&t.Counted!=t.Quantity&&!n.roleService.inventory.View)),c("modifyValueOnWheel",!1),w("ngModel",t.Counted),l(2),f(t.Counted!==""&&n.roleService.inventory.View?16:-1),l(2),f(t.Counted!==""?18:-1)}}function jl(i,e){if(i&1){let t=v();r(0,"POS-complex-pagination",65),_("jumpToPage",function(){p(t);let n=m(3);return u(n.getProduct(n.filter))})("previousPage",function(){p(t);let n=m(3);return u(n.getProduct(n.filter))})("nextPage",function(){p(t);let n=m(3);return u(n.getProduct(n.filter))}),a()}if(i&2){let t=m(3);c("total",t.products.length)("pageData",V(2,Sl,t.filter))}}function Nl(i,e){i&1&&(g(0,"i",66),s(1,"Review"))}function Fl(i,e){i&1&&(r(0,"th",43),s(1,"Expected"),a())}function Ul(i,e){i&1&&(r(0,"th",43),s(1,"Differences"),a())}function Ll(i,e){if(i&1&&(r(0,"td"),s(1),a()),i&2){let t=m(2).$implicit;l(),I(" ",t.Quantity," ")}}function Rl(i,e){if(i&1&&(r(0,"span"),s(1),x(2,"number"),a()),i&2){let t=m(3).$implicit;l(),I("+",E(2,1,t.Counted-t.Quantity))}}function Ql(i,e){if(i&1&&(r(0,"span"),s(1),x(2,"number"),a()),i&2){let t=m(3).$implicit;l(),S(E(2,1,t.Counted-t.Quantity))}}function Bl(i,e){if(i&1&&(r(0,"td"),C(1,Rl,3,3,"span"),C(2,Ql,3,3,"span"),a()),i&2){let t=m(2).$implicit;l(),f(t.Counted>=t.Quantity?1:-1),l(),f(t.Counted<t.Quantity?2:-1)}}function Hl(i,e){if(i&1&&(r(0,"tr")(1,"td"),s(2),a(),r(3,"td",57),s(4),a(),r(5,"td")(6,"a",58),s(7),a()(),r(8,"td"),s(9),a(),C(10,Ll,2,1,"td"),r(11,"td"),s(12),a(),C(13,Bl,3,2,"td"),a()),i&2){let t=m(),o=t.$implicit,n=t.$index,d=m(3);Qt("soft-yellow",o.Counted<o.Quantity)("soft-green",o.Counted>o.Quantity),l(2),S(n+1+"."),l(2),I(" ",o.ProductName," "),l(2),c("routerLink",Y(13,cr))("queryParams",V(14,Vi,o.ID)),l(),S(o.Model),l(2),S(o.Code),l(),f(d.roleService.inventory.View?10:-1),l(2),I(" ",o.Counted," "),l(),f(d.roleService.inventory.View?13:-1)}}function Wl(i,e){if(i&1&&C(0,Hl,14,16,"tr",67),i&2){let t=e.$implicit;f(t.Counted!==""?0:-1)}}function ql(i,e){i&1&&(g(0,"i",68),s(1,"Finish"))}function Gl(i,e){if(i&1&&(r(0,"div",53),g(1,"i",69),s(2),a()),i&2){let t=m(3);l(2),I("",t.error.error.Message," ")}}function zl(i,e){if(i&1){let t=v();r(0,"mat-stepper",13,0),_("selectionChange",function(n){p(t);let d=m(2);return u(d.onNextStep(n))}),r(2,"mat-step",14),M(3,Pl,2,0,"ng-template",15),r(4,"div",16)(5,"div",17)(6,"div",18)(7,"div",17)(8,"h3",19),s(9,"Outlet"),a()(),r(10,"div",20)(11,"ng-select",21,1),_("change",function(){p(t);let n=m(2);return u(n.toggleIsFilterFilled())}),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.filter.EntityID,n)||(d.filter.EntityID=n),u(n)}),a(),M(13,Tl,2,0,"small",22),a()()(),r(14,"div",23)(15,"div",18)(16,"div",17)(17,"h3",19),s(18," Category "),r(19,"small",24)(20,"em"),s(21,"Optional"),a()()()(),r(22,"div",20)(23,"POS-product-category-select",25),T("selectedCategoryIDChange",function(n){p(t);let d=m(2);return P(d.filter.CategoryID,n)||(d.filter.CategoryID=n),u(n)}),a()()()(),r(24,"div",23)(25,"div",18)(26,"div",17)(27,"h3",19),s(28," Contain Text "),r(29,"small",24)(30,"em"),s(31,"Optional"),a()()()(),r(32,"div",26)(33,"input",27),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.filter.ProductName,n)||(d.filter.ProductName=n),u(n)}),a()()()(),r(34,"div",23)(35,"div",18)(36,"div",17)(37,"div",28)(38,"h3",29),s(39," Tag "),a(),r(40,"small",24)(41,"em"),s(42,"Optional"),a()()()(),r(43,"div",26)(44,"ng-select",30),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.filter.TagID,n)||(d.filter.TagID=n),u(n)}),a()()()(),r(45,"div",23)(46,"div",18)(47,"div",17)(48,"h3",19),s(49,"Storage Location"),a()(),r(50,"div",20)(51,"POS-storage-location-select",31),_("selectedCategoryIDChange",function(n){p(t);let d=m(2);return u(d.onSelectStorageLocation(n))}),a()()()(),r(52,"div",32)(53,"div",18)(54,"div",17)(55,"h3",19),s(56," Note "),r(57,"small",24)(58,"em"),s(59,"Optional"),a()()()(),r(60,"div",20)(61,"textarea",33),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.note,n)||(d.note=n),u(n)}),a()()()()()(),r(62,"mat-step",34),M(63,wl,2,0,"ng-template",15),r(64,"div",35)(65,"table",36),_("matSortChange",function(n){p(t);let d=m(2);return u(d.sortData(n))}),r(66,"thead",37)(67,"tr")(68,"th",38),s(69,"No"),a(),r(70,"th",39),s(71," Category "),a(),r(72,"th",40),s(73," Product "),a(),r(74,"th",41),s(75," Variant "),a(),r(76,"th",42),s(77,"Code"),a(),C(78,Ml,2,0,"th",43),r(79,"th",43),s(80,"Counted"),a(),C(81,El,2,0,"th",43),g(82,"th",38),a()(),r(83,"tbody"),N(84,Vl,19,19,"tr",null,Z),a()(),C(86,jl,1,4,"POS-complex-pagination",44),a()(),r(87,"mat-step",45),M(88,Nl,2,0,"ng-template",15),r(89,"div",46)(90,"div",47)(91,"table",48),_("matSortChange",function(n){p(t);let d=m(2);return u(d.sortData(n))}),r(92,"thead",49)(93,"tr"),g(94,"th",38),r(95,"th",50),s(96," Name "),a(),r(97,"th",51),s(98,"Variant"),a(),r(99,"th",43),s(100,"Code"),a(),C(101,Fl,2,0,"th",43),r(102,"th",43),s(103,"Counted"),a(),C(104,Ul,2,0,"th",43),a()(),r(105,"tbody"),N(106,Wl,1,1,null,null,Z),a()()()()(),r(108,"mat-step",52),M(109,ql,2,0,"ng-template",15),C(110,Gl,3,1,"div",53),a()()}if(i&2){let t=it(12),o=m(2);c("linear",!0),l(2),c("completed",o.isFilterFilled),l(9),Pt(V(26,yl,t.touched&&o.filter.EntityID==null)),c("items",o.loaderData.Entities),w("ngModel",o.filter.EntityID),c("clearable",!1),l(2),c("ngIf",t.touched&&o.filter.EntityID==null),l(10),w("selectedCategoryID",o.filter.CategoryID),c("showClear",!0)("placeholder","Choose Category")("isInitializedCategoryLabel",!0),l(10),w("ngModel",o.filter.ProductName),l(11),c("items",o.loaderData.AdjustmentTagsOptions),w("ngModel",o.filter.TagID),c("clearable",!1),l(7),c("showClear",!0)("placeholder","Choose Storage Location")("isInitializedCategoryLabel",!0),l(10),w("ngModel",o.note),l(17),f(o.roleService.inventory.View?78:-1),l(3),f(o.roleService.inventory.View?81:-1),l(3),F(o.products),l(2),f(o.products.length>0?86:-1),l(15),f(o.roleService.inventory.View?101:-1),l(3),f(o.roleService.inventory.View?104:-1),l(2),F(o.reviewedItems),l(4),f(o.error?110:-1)}}function $l(i,e){i&1&&(r(0,"div",85),s(1,"Difference"),a())}function Kl(i,e){if(i&1&&(r(0,"div",89),s(1),a()),i&2){let t=m().$implicit;Pt(t.Quantity-t.OriginalQuantity<0?"text-danger":"text-success"),l(),I(" ",(t.Quantity-t.OriginalQuantity>0?"+":" ")+(t.Quantity-t.OriginalQuantity)," ")}}function Jl(i,e){if(i&1&&(r(0,"div",86)(1,"div",88),s(2),a(),r(3,"div",89),s(4),a(),C(5,Kl,2,3,"div",90),a()),i&2){let t=e.$implicit,o=m(3);l(2),Te("",t.Name," (",t.Model,")"),l(2),S(t.Quantity),l(),f(o.roleService.inventory.View?5:-1)}}function Zl(i,e){if(i&1&&(r(0,"div",89),x(1,"sum"),x(2,"sum"),s(3),x(4,"sum"),x(5,"sum"),x(6,"sum"),x(7,"sum"),a()),i&2){let t=m(3);Pt(L(1,3,t.displayedItems,"Quantity")-L(2,6,t.displayedItems,"OriginalQuantity")<0?"text-danger":"text-success"),l(3),I(" ",(L(4,9,t.displayedItems,"Quantity")-L(5,12,t.displayedItems,"OriginalQuantity")>0?"+":" ")+(L(6,15,t.displayedItems,"Quantity")-L(7,18,t.displayedItems,"OriginalQuantity"))," ")}}function Xl(i,e){if(i&1){let t=v();r(0,"div",8)(1,"div",70)(2,"div",71)(3,"div",72)(4,"h1",73),g(5,"i",68),s(6,"Inventory Adjustment Completed "),a()(),r(7,"div",74)(8,"div",75)(9,"div",76)(10,"a",77),_("click",function(){p(t);let n=m(2);return u(n.newStockCount())}),s(11,"New Adjustment (F8)"),a()()()()()(),r(12,"div",78)(13,"div",71)(14,"div",79)(15,"h2",80)(16,"a",81),s(17),a()()(),r(18,"div",82)(19,"div",83)(20,"div",84),s(21," Product Name (Variant) "),a(),r(22,"div",85),s(23,"Counted"),a(),C(24,$l,2,0,"div",85),a(),N(25,Jl,6,4,"div",86,Z),r(27,"div",87)(28,"div",88),s(29,"Total"),a(),r(30,"div",89),s(31),x(32,"sum"),a(),C(33,Zl,8,21,"div",90),a()()()()()}if(i&2){let t=m(2);l(16),c("routerLink",Y(9,xl))("queryParams",V(10,Vi,t.adjustmentID)),l(),I("Adjustment #",t.completeInfo.InvoiceNumber),l(7),f(t.roleService.inventory.View?24:-1),l(),F(t.displayedItems),l(6),I(" ",L(32,6,t.displayedItems,"Quantity")," "),l(2),f(t.roleService.inventory.View?33:-1)}}function Yl(i,e){if(i&1){let t=v();r(0,"mainpanel-cmp",4),T("textChange",function(n){p(t);let d=m();return P(d.filter.ProductName,n)||(d.filter.ProductName=n),u(n)}),_("onSubmit",function(){p(t);let n=m();return u(n.filterProduct())}),r(1,"actions"),C(2,bl,2,1,"button",5),C(3,Il,5,3,"div",6),C(4,Dl,5,3,"div",6),a(),r(5,"content"),C(6,zl,111,28,"mat-stepper",7),C(7,Xl,34,12,"div",8),a()()}if(i&2){let t=m();c("pageData",t.menuData),w("text",t.filter.ProductName),c("hideSearchBox",t.currentStep!="input")("hideSearchDropdown",!0),l(2),f(t.currentStep=="filter"?2:-1),l(),f(t.currentStep=="input"?3:-1),l(),f(t.currentStep=="review"?4:-1),l(2),f(t.isCompleted?-1:6),l(),f(t.isCompleted?7:-1)}}var Kn=class i extends $n{constructor(t,o,n,d,y){super(t,o);this.toastr=n;this.ngZone=d;this.roleService=y;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=no;ngOnDestroy(){}initSubscriptionStatus(){this.currentSubStatus=parseInt(localStorage.getItem("SubscriptionStatus"))}onSelectStorageLocation(t){this.filter=R(k({},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(k({},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(n=>{n.Counted!==""&&n.Counted!=n.Quantity&&(n.Status=n.Counted>n.Quantity?"Over":"Under",o++)}),this.reviewedItems=this.products.filter(n=>n.Counted!==""),o&&!this.roleService.inventory.View&&this.toastr.warning("There are some items inventory that does not match! Click next to automatically adjust inventory.",X.Warning)}else if(t.selectedStep.label=="finish"){this.products=this.originalProducts,this.currentStep="finish",this.Items=[],this.products.forEach(d=>{if(d.Counted!==""){let y={Name:d.ProductName,Cost:d.UnitCost,Price:d.UnitPrice,Quantity:d.Counted,OriginalQuantity:d.Quantity,VariantID:d.ID,Model:d.Model};this.Items.push(y)}});let o={Date:new Date,EntityID:this.filter.EntityID,Note:this.note,ID:this.adjustmentID||A.GuidEmpty,TagID:this.filter.TagID},n={Items:this.Items,Order:o,TypeID:2};this.displayedItems=this.Items.filter(d=>d.Quantity-d.OriginalQuantity!=0),this.submitAdjustment(n)}}validateFilter(){if(!this.isFilterFilled){this.toastr.error("Outlet is required",X.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((n,d)=>{let y=t.direction==="asc",D=typeof n[t.active];switch(A.IsEmpty(n.Code)&&(n.Code=""),A.IsEmpty(d.Code)&&(d.Code=""),D){case"string":return A.compare(n[t.active].toLocaleLowerCase(),d[t.active].toLocaleLowerCase(),y);case"number":return A.compare(n[t.active],d[t.active],y);default:return 0}})}filterProduct(){this.filter.PageNumber=1,this.getProduct(this.filter)}static \u0275fac=function(o){return new(o||i)(b(rt),b(U),b(vt),b(xn),b(B))};static \u0275cmp=O({type:i,selectors:[["POS-spreadsheet-stock-take"]],viewQuery:function(o,n){if(o&1&&ge(hl,5),o&2){let d;Ce(d=fe())&&(n.stepper=d.first)}},hostBindings:function(o,n){o&1&&_("keydown.F8",function(){return n.handleF8()},Ht)("keydown.ArrowRight",function(){return n.handleNextButton()},Ht)("keydown.ArrowLeft",function(){return n.handlePreviousButton()},Ht)},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,n){o&1&&C(0,Yl,8,9,"mainpanel-cmp",3),o&2&&f(n.loaderData?0:-1)},dependencies:[kn,Nt,ye,ct,at,St,H,tt,pt,Kt,jn,Vn,Nn,Ut,be,Qe,Be,$t,q,We],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 ts=()=>["/menu/Products/Catalog/Products/Info"],es=i=>({ID:i});function ns(i,e){if(i&1){let t=v();r(0,"button",13),_("click",function(){p(t);let n=m(2);return u(n.confirmAdjust())}),s(1,"Confirm Adjustment"),a()}}function is(i,e){if(i&1){let t=v();r(0,"div")(1,"div",14)(2,"h6"),s(3,"Outlets"),a(),r(4,"ng-select",15),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.EntityID,n)||(d.pageData.Filter.EntityID=n),u(n)}),a()()()}if(i&2){let t=m(2);l(4),c("items",t.pageData.Entities),w("ngModel",t.pageData.Filter.EntityID)}}function os(i,e){if(i&1){let t=v();r(0,"tr",12)(1,"td"),g(2,"a",16),a(),g(3,"td",17)(4,"td",17)(5,"td",17)(6,"td",18)(7,"td",18),r(8,"td",19)(9,"input",20),T("ngModelChange",function(n){let d=p(t).$implicit;return P(d.NewQuantity,n)||(d.NewQuantity=n),u(n)}),a()(),r(10,"td",19),s(11),x(12,"number"),a(),r(13,"td")(14,"a",21),_("click",function(){let n=p(t).$implicit,d=m(2);return u(d.confirmAdjust(n))}),s(15,"Adjust"),a()()()}if(i&2){let t=e.$implicit;l(2),c("routerLink",Y(12,ts))("queryParams",V(13,es,t.ProductID))("innerHTML",t.ProductName,$),l(),c("innerHTML",t.ParentCode,$),l(),c("innerHTML",t.Model,$),l(),c("innerHTML",t.ParentModel,$),l(),c("innerHTML",t.Ratio,$),l(),c("innerHTML",t.Inventory,$),l(2),w("ngModel",t.NewQuantity),l(2),I(" ",E(12,10,t.Inventory-t.NewQuantity*t.Ratio)," ")}}function rs(i,e){if(i&1){let t=v();r(0,"mainpanel-cmp",2),_("onSubmit",function(){p(t);let n=m();return u(n.searchFromPageOne())}),T("filterChange",function(n){p(t);let d=m();return P(d.pageData.Filter,n)||(d.pageData.Filter=n),u(n)}),r(1,"actions"),C(2,ns,2,0,"button",3),a(),r(3,"filters"),M(4,is,5,2,"ng-template",null,0,K),a(),r(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th"),s(13,"Product Name"),a(),r(14,"th",8),s(15,"Code"),a(),r(16,"th",8),s(17,"From"),a(),r(18,"th",8),s(19,"To"),a(),r(20,"th",9),s(21,"Ratio"),a(),r(22,"th",9),s(23,"Inventory"),a(),r(24,"th",10),s(25,"Convert Qty "),a(),r(26,"th",10),s(27,"Remaining"),a(),g(28,"th",11),a()(),r(29,"tbody"),N(30,os,16,15,"tr",12,Z),a()()()()()()}if(i&2){let t=m();c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),w("filter",t.pageData.Filter),l(2),f(t.roleService.adjustment.Create?2:-1),l(28),F(t.Items)}}var Jn=class i extends xt{constructor(t,o,n,d,y){super(t,o,"Adjustment/GetAdjustToParentList","Outlet/GetByUserAccessWrite");this.toastr=n;this.router=d;this.roleService=y}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=[],n=[];if(t?n.push(t):n=this.Items,n.forEach(y=>{let D={VariantID:y.ParentID,Quantity:y.NewQuantity,Cost:y.UnitCost*y.Ratio,Price:y.UnitPrice*y.Ratio};o.push(D),D={VariantID:y.ID,Quantity:y.NewQuantity*y.Ratio*-1,Cost:y.UnitCost,Price:y.UnitPrice},o.push(D)}),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:y=>{y.Success?this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Info"],{queryParams:{ID:y.OrderID}}).then(()=>window.location.reload()):this.toastr.success(y.Message,X.Success)},error:y=>{this.toastr.error(y,X.Error)}})}static \u0275fac=function(o){return new(o||i)(b(rt),b(U),b(vt),b(Ft),b(B))};static \u0275cmp=O({type:i,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,n){o&1&&C(0,rs,32,5,"mainpanel-cmp",1),o&2&&f(n.data?0:-1)},dependencies:[ct,at,St,H,tt,pt,Ut,q],encapsulation:2})};function as(i,e){if(i&1){let t=v();r(0,"button",12),_("click",function(){p(t);let n=m();return u(n.openExportModal())}),g(1,"i",13),s(2," Export "),a()}}function ls(i,e){if(i&1){let t=v();r(0,"td",10)(1,"input",16),T("ngModelChange",function(n){p(t);let d=m().$implicit;return P(d.Quantity,n)||(d.Quantity=n),u(n)}),a()()}if(i&2){let t=m().$implicit;l(),w("ngModel",t.Quantity)}}function ss(i,e){if(i&1&&(r(0,"td",10),s(1),a()),i&2){let t=m().$implicit;l(),I(" ",t==null?null:t.Quantity," ")}}function ds(i,e){if(i&1){let t=v();r(0,"tr",14)(1,"td")(2,"i",15),_("click",function(){let n=p(t).$index,d=m(2);return u(d.products.splice(n,1))}),a()(),r(3,"td"),s(4),a(),r(5,"td",10),s(6),a(),C(7,ls,2,1,"td",10),C(8,ss,2,1,"td",10),a()}if(i&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(),f(o.roleService.adjustment.InventoryProductCount?7:-1),l(),f(o.roleService.adjustment.InventoryProductCount?-1:8)}}function ms(i,e){if(i&1&&N(0,ds,9,4,"tr",14,se),i&2){let t=m();F(t.products)}}function cs(i,e){i&1&&(r(0,"tr")(1,"td",17),g(2,"app-empty-state"),a()())}var Zn=class i extends wn{constructor(t,o,n,d,y){super(t);this.httpService=o;this.csvConverter=n;this.roleService=d;this.matDialog=y;this.products=[],this.menuData$.subscribe()}products;onBarcodeEnter(t){let o=this.products.findIndex(n=>n.Code===t);o!=-1?this.products[o].Quantity++:this.httpService.post("/API/catalog/product/ProductCountByCode",{code:t}).subscribe(n=>{n.Quantity=1,this.products.push(n)})}openExportModal(){var t={Products:this.products,Export:!0};this.matDialog.open(Lt,{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||i)(b(rt),b(U),b(kt),b(B),b(et))};static \u0275cmp=O({type:i,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,n){o&1&&(r(0,"mainpanel-cmp",0),_("barcodeQueryChange",function(y){return n.onBarcodeEnter(y)}),r(1,"actions"),C(2,as,3,0,"button",1),a(),r(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"),g(13,"th",9),r(14,"th"),s(15,"Name"),a(),r(16,"th",10),s(17,"Code"),a(),r(18,"th",11),s(19,"Qty"),a()()(),r(20,"tbody"),C(21,ms,2,0)(22,cs,3,0,"tr"),a()()()()()()()()()()),o&2&&(c("pageData",n.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0)("showBarcodeScanner",!0)("autoFocusBarcodeScanInput",!0),l(2),f(n.roleService.global.Export?2:-1),l(19),f(n.products.length>0?21:22))},dependencies:[at,St,H,tt,Ut,Eo],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 ps(i,e){if(i&1){let t=v();r(0,"button",14),_("click",function(){p(t);let n=m(2);return u(n.openExportModal())}),g(1,"i",15),s(2," Export"),a()}}function us(i,e){if(i&1){let t=v();r(0,"div")(1,"div",16)(2,"h6"),s(3,"Outlets"),a(),r(4,"ng-select",17),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.EntityID,n)||(d.pageData.Filter.EntityID=n),u(n)}),a(),r(5,"h6"),s(6,"Category"),a(),r(7,"POS-product-category-select",18),T("selectedCategoryIDChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.CategoryID,n)||(d.pageData.Filter.CategoryID=n),u(n)}),a(),r(8,"h6"),s(9,"Sort By"),a(),r(10,"ng-select",19),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.SortByid,n)||(d.pageData.Filter.SortByid=n),u(n)}),a()()()}if(i&2){let t=m(2);l(4),c("items",t.pageData.Options.Entities),w("ngModel",t.pageData.Filter.EntityID),l(3),w("selectedCategoryID",t.pageData.Filter.CategoryID),c("showClear",!0),l(3),c("items",t.pageData.Options.SortBy),w("ngModel",t.pageData.Filter.SortByid)}}function _s(i,e){if(i&1&&(r(0,"span"),s(1),a()),i&2){let t=e.$implicit;l(),S(t+" ")}}function gs(i,e){if(i&1&&(r(0,"tr")(1,"td"),s(2),a(),r(3,"td"),s(4),a(),r(5,"td",13),s(6),x(7,"number"),a(),r(8,"td",13),s(9),x(10,"number"),a(),r(11,"td",20),N(12,_s,2,1,"span",null,Z),a()()),i&2){let t=e.$implicit;l(2),S(t.ProductCode),l(2),S(t.ProductName),l(2),S(E(7,4,t.UnitPrice)),l(3),S(E(10,6,t.Qty)),l(3),F(t.Models)}}function Cs(i,e){if(i&1){let t=v();r(0,"mainpanel-cmp",2),_("onSubmit",function(){p(t);let n=m();return u(n.searchFromPageOne())}),T("filterChange",function(n){p(t);let d=m();return P(d.pageData.Filter,n)||(d.pageData.Filter=n),u(n)}),r(1,"actions"),C(2,ps,3,0,"button",3),a(),r(3,"filters"),M(4,us,11,6,"ng-template",null,0,K),a(),r(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),s(12,"Code"),a(),r(13,"th",8),s(14,"Name"),a(),r(15,"th",9),s(16,"UnitPrice"),a(),r(17,"th",10),s(18,"Qty"),a(),r(19,"th"),s(20,"Available Models"),a()()(),r(21,"tbody"),N(22,gs,14,8,"tr",null,Z),a(),r(24,"tfoot")(25,"tr",11),g(26,"td",12),r(27,"td",13),s(28),x(29,"sum"),x(30,"number"),a(),g(31,"td"),a()()()()()()}if(i&2){let t=m();c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),w("filter",t.pageData.Filter),l(2),f(t.roleService.global.Export?2:-1),l(20),F(t.data.Data),l(6),S(E(30,9,L(29,6,t.data.Data,"Qty")))}}var Xn=class i extends xt{constructor(t,o,n,d,y){super(t,o,"catalog/product/GetOutletProductSheet","catalog/ProductLoader/GetOutletProductSheet");this.csvConverter=n;this.roleService=d;this.matDialog=y}openExportModal(){this.matDialog.open(Lt,{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||i)(b(rt),b(U),b(kt),b(B),b(et))};static \u0275cmp=O({type:i,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,n){o&1&&C(0,Cs,32,11,"mainpanel-cmp",1),o&2&&f(n.data?0:-1)},dependencies:[at,H,tt,pt,$t,q,We],encapsulation:2})};var pr=Pi(Po());var G=class i{INITIAL_STATE={loadForm:{},outlet:{ID:A.GuidEmpty,Name:""},isOpenDialog:!0,isComplete:!1,adjustmentState:0,quickeyItems:{},cartItems:[],order:{Date:(0,pr.default)().utcOffset("+07:00").format(),EntityID:"",ID:A.GuidEmpty,StateID:4,TypeID:1,Number:"",PIC:"",Note:"",TagID:0},orderComplete:{},NewOrderID:""};#t=zo(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(k({},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||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var ji=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,n,d,y,D,lt,ot,st,It,jt,Xt,Yt,te,ee,ne,ie,oe,re,ae,le){this.ID=e,this.VariantID=t,this.Quantity=o,this.Cost=n,this.Price=d,this.Expense=y,this.Discount=D,this.DiscountAmount=lt,this.Note=ot,this.Taxable=st,this.LoyaltyPoint=It,this.EntityID=jt,this.UnitQuantity=Xt,this.VariantUnitQuantity=Yt,this.InventoryTypeID=te,this.Variant=ee,this.SalesID=ne,this.UnitCost=ie,this.UnitPrice=oe,this.SplitQuantity=re,this.isMaxInventory=ae,this.PromotionGift=le}},Yn=class i{adapt(e){return new ji(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||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},Ni=class{constructor(e,t,o,n,d,y,D,lt,ot,st,It,jt,Xt,Yt,te,ee,ne,ie,oe,re,ae,le,nn,on,rn,an,ln,sn,dn,mn,cn){this.ID=e,this.Name=t,this.Code=o,this.UnitCost=n,this.UnitPrice=d,this.UnitExpense=y,this.UnitQuantity=D,this.PriceDiscount=lt,this.UnitPriceOriginal=ot,this.Description=st,this.UOM=It,this.UOMName=jt,this.ImageUrl=Xt,this.TypeID=Yt,this.SellPriceType=te,this.OnHand=ee,this.Ordered=ne,this.OrderPrice=ie,this.OrderPriceDiscount=oe,this.Taxable=re,this.LoyaltyPoint=ae,this.CategoryName=le,this.CategoryID=nn,this.CategoryTypeID=on,this.PriceNote=rn,this.PaymentTypeID=an,this.ThumbnailUrl=ln,this.Storage=sn,this.Component=dn,this.PriceBook=mn,this.VariantUnitQuantity=cn}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},ti=class i{adapt(e){return new Ni(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||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var ei=class i{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||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},ni=class i{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||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},ur=class i{adapt(e){return{Number:e.Number,Quantity:e.Quantity,ExpiryDate:e.ExpiryDate}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Rt=class i{destroy$=new ft;#t=h(G);#e=h(U);#n=h(Yn);#i=h(ti);#o=h(ht);#r=h(ei);#a=h(ni);constructor(){}processOrder(){let e=[...this.#t.CartItems()].map(t=>R(k({},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(k({},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(Dt(this.destroy$))}if(this.#t.AdjustmentState()===1){let t=R(k({},this.#t.LoadForm().Data),{Order:R(k({},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(Dt(this.destroy$))}}onUpdateOrderState(e,t){if(Object.keys(this.#t.Order()).includes(e)){let n=R(k({},this.#t.Order()),{[e]:t});this.#t.onChangeAdjustmentOrder(n)}else console.error(`Error updating order state with key ${e}`)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var tn=class i{destroy$=new ft;#t=h(U);#e=h(G);#n=h(ht);orderService=h(Rt);getLoadForm$=this.#t.post("/API/Adjustment/LoadForm",{EntityID:A.GuidEmpty,ID:A.GuidEmpty}).pipe(Le(),Q(e=>{this.#e.onChangeLoadform(e)}));constructor(){}httpRequestLoadForm$(e){return Tt(this.#e.IsComplete,{injector:this.#n}).pipe(Dt(this.destroy$),dt(t=>!t),nt(t=>this.#t.post("/API/Adjustment/LoadForm",k({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||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var ii=class i{destroy$=new ft;#t=h(G);#e=h(U);#n=h(Rt);#i=h(ht);constructor(){this.initialize()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initialize(){qi([Tt(this.#t.Outlet,{injector:this.#i}),Tt(this.#t.AdjustmentState,{injector:this.#i}),Tt(this.#t.IsComplete,{injector:this.#i})]).pipe(Le(),dt(([e,t,o])=>A.IsNotEmpty(e.ID)&&!o),nt(([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(Dt(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(Dt(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||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Fi=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,n,d,y,D,lt,ot,st,It,jt,Xt,Yt,te,ee,ne,ie,oe,re,ae,le,nn,on,rn,an,ln,sn,dn,mn,cn,Di){this._Variant=e,this._QtyRequested=t,this._TotalPrice=o,this._SalesName=n,this._PriceNote=d,this._SalesID=y,this._InventoryTypeID=D,this._ID=lt,this._Code=ot,this._VariantID=st,this._Quantity=It,this._UnitQuantity=jt,this._Expense=Xt,this._Cost=Yt,this._Price=te,this._Discount=ee,this._Note=ne,this._Taxable=ie,this._LoyaltyPoint=oe,this._UnitPriceOriginal=re,this._DiscountAmount=ae,this._Name=le,this._PriceTypeID=nn,this._Storage=on,this._Serial=rn,this._ThumbnailUrl=an,this._UnitPrice=ln,this._TypeID=sn,this._VariantUnitQuantity=dn,this._UOM=mn,this._UOMName=cn,this._SalesCommission=Di}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}}},Ui=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,n,d,y,D,lt,ot,st,It,jt,Xt,Yt,te,ee,ne,ie,oe,re,ae,le,nn,on,rn,an,ln,sn,dn,mn,cn,Di,Sr,xr,br,Ir,Dr,Pr,Tr,wr,Mr,Er,Or,Ar,kr,Vr,jr,Nr,Fr,Ur,Lr,Rr,Qr,Br,Hr){this._OnHand=e,this._CategoryName=t,this._CategoryTypeID=o,this._PriceTypeID=n,this._PriceNote=d,this._UnitPriceOriginal=y,this._Ordered=D,this._BrandName=lt,this._ImageUrl=ot,this._ThumbnailUrl=st,this._Component=It,this._PriceBook=jt,this._UOMName=Xt,this._Storage=Yt,this._CategoryID=te,this._DiscountAmount=ee,this._VariantUnitQuantity=ne,this._ProductCreated=ie,this._ProductID=oe,this._ProductIndex=re,this._Code=ae,this._TypeID=le,this._UnitQuantity=nn,this._SalesCommission=on,this._Description=rn,this._Image=an,this._Discontinued=ln,this._Taxable=sn,this._LoyaltyPoint=dn,this._PackSize=mn,this._CreatorId=cn,this._Created=Di,this._UnitExpense=Sr,this._SellPriceType=xr,this._VariantType=br,this._CostCurrencyID=Ir,this._UnitCost=Dr,this._OrderPrice=Pr,this._OrderPriceDiscount=Tr,this._OrderPriceDiscountDetail=wr,this._PriceCurrencyID=Mr,this._UnitPrice=Er,this._PriceDiscount=Or,this._PaymentTypeID=Ar,this._PaymentTypeString=kr,this._SellPriceTypeString=Vr,this._Weight=jr,this._CostCurrencySymbol=Nr,this._PriceCurrencySymbol=Fr,this._UOM=Ur,this._MeasurementID=Lr,this._UOMQ=Rr,this._Name=Qr,this._Model=Br,this._ID=Hr}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}}},Zt=class i{adapt(e){return new Fi(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||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},en=class i{adapt(e){return new Ui(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||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var fs=i=>({selected:i});function hs(i,e){if(i&1){let t=v();r(0,"button",9),_("click",function(){let n=p(t).$implicit,d=m();return u(d.onTabChange(n.value))}),s(1),a()}if(i&2){let t=e.$implicit;Pt(t.class),c("ngClass",V(4,fs,t.active)),l(),I(" ",t.label," ")}}function ys(i,e){i&1&&(r(0,"div",10)(1,"strong",11),s(2,"PIC"),a(),g(3,"input",12),a(),r(4,"div",10)(5,"strong",13),s(6,"Note"),a(),g(7,"POS-tinymce-editor",14),a())}function vs(i,e){if(i&1){let t=v();r(0,"div",15),g(1,"input",16,0),r(3,"button",17),_("click",function(){p(t);let n=it(2);return u(n.click())}),s(4),a()()}if(i&2){let t=e.$implicit,o=m(2);l(),c("id",de("tag-",t.ID))("value",t.ID),l(2),Qt("active",o.form.get("TagID").value===t.ID),l(),I(" ",t.Name," ")}}function Ss(i,e){if(i&1&&(r(0,"div",7),N(1,vs,5,6,"div",15,se),a()),i&2){let t=m();l(),F(t.storeService.LoadForm().AdjustmentTags)}}var oi=class i{modalConfig;storeService=h(G);#t=h(Ue);#e=h(_t);form;tabs=z([]);activeTab=he(()=>this.tabs().find(e=>e.active));constructor(){this.modalConfig=new gt,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 Se(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(k({},o),{active:o.value===e})))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["POS-modal-cart-note"]],hostBindings:function(t,o){t&1&&_("keydown",function(d){return o.handleKeyDown(d)},Ht)},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&&(r(0,"modal-material",1),_("onOk",function(){return o.onOK()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),r(1,"content")(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),N(6,hs,2,6,"button",5,se),a()()(),r(8,"div",6),C(9,ys,8,0)(10,Ss,3,0,"div",7),a(),g(11,"div",8),a()()()),t&2){let n;c("config",o.modalConfig),l(6),F(o.tabs()),l(2),c("formGroup",o.form),l(),f((n=o.activeTab().value)==="note"?9:n==="tag"?10:-1),l(2),c("formGroup",o.form)}},dependencies:[ut,Ct,qt,St,oo,H,je,xe,Ne,Fe,yt,Nt,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 ri=class i{modalConfig;#t=h(_t);constructor(){this.modalConfig=new gt,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||i)};static \u0275cmp=O({type:i,selectors:[["POS-modal-cart-void"]],decls:5,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"fw-normal"]],template:function(t,o){t&1&&(r(0,"modal-material",0),_("onOk",function(){return o.onOK()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),r(1,"content")(2,"div",1)(3,"h4",2),s(4,"This will erase all current data. Are you sure?"),a()()()()),t&2&&c("config",o.modalConfig)},dependencies:[ut,Ct],encapsulation:2})};var bt=class i{variantSearchCTRL=new Se({});#t=h(G);#e=h(U);#n=h(ht);#i=h(Zt);#o=h(et);#r=h(en);destroy$=new ft;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(Et(n=>this.generateCartItem(n)),Q(n=>{t&&this.onAddCartItem(n)}))}httpRequestVariantByCode(e){let{Digit:t,QuantityDivider:o,Regex:n}=this.#t.LoadForm().AppConfigJSON.ModuleAdjustment.DigitalScale;if(e.length===t){let y=new RegExp(n).exec(e);if(Object.is(y,null))return this.#e.get(`${wt.GetVariantByCode}?Code=${e}&EntityID=${this.#t.Outlet().ID}`).pipe(Et(D=>this.generateCartItem(D)),Q(D=>{this.onAddCartItem(D)}));{console.log(y,"decodedRegex");let D=y[1],lt=parseFloat(y[2]);return lt=lt/o||1,this.#e.get(`${wt.GetVariantByCode}?Code=${D}&EntityID=${this.#t.Outlet().ID}`).pipe(Et(ot=>this.generateCartItem(ot)),Q(ot=>{this.onAddCartItem(ot,!1,lt)}),ue(ot=>(this.toastr.info("Matching Regex Rule to Barcode","Digital Scale"),this.#e.get(`${wt.GetVariantByCode}?Code=${e}&EntityID=${this.#t.Outlet().ID}`).pipe(Et(st=>this.generateCartItem(st)),Q(st=>{this.onAddCartItem(st)})))))}}else return this.#e.get(`${wt.GetVariantByCode}?Code=${e}&EntityID=${this.#t.Outlet().ID}`).pipe(Et(d=>this.generateCartItem(d)),Q(d=>{this.onAddCartItem(d)}))}httpRequestGetInventoryByVariantID(e){return Tt(this.#t.Outlet,{injector:this.#n}).pipe(Dt(this.destroy$),dt(t=>A.IsNotEmpty(t.ID)),Me(),nt(t=>this.#e.get(wt.GetVariantStockByID,[{key:"EntityID",value:t.ID},{key:"ID",value:e}])))}addItemByVariantID(e){this.httpGetVariantByID(e).pipe(Dt(this.destroy$)).subscribe()}onAddCartItem(e,t=!1,o=1){let n=this.#t.CartItems(),d=n.findIndex(D=>D.VariantID===e.VariantID),y=[];d!==-1?t?y=[...n,e]:(n[d].Quantity+=o,y=[...n]):y=[...n,R(k({},e),{Quantity:o})],this.#t.onChangeCartItems(y)}generateCartItem(e){return this.#i.adapt(R(k({},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,n)=>e!==n);this.#t.onChangeCartItems(t)}onOpenCartNoteModal(){return this.#o.open(oi)}onOpenCartVoidModal(){return this.#o.open(ri)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var xs=["unitCost"],bs=i=>({selected:i}),Is=()=>["/menu/Products/Catalog/Variants/Info"],Ds=(i,e)=>e.key;function Ps(i,e){if(i&1){let t=v();r(0,"a",7),_("click",function(){p(t);let n=m().$implicit,d=m();return u(d.onTabChange(n.key))}),s(1),a()}if(i&2){let t=m().$implicit,o=m();c("ngClass",V(2,bs,o.activeTab().key===t.key)),l(),I(" ",t.label," ")}}function Ts(i,e){if(i&1&&C(0,Ps,2,4,"a",6),i&2){let t=e.$implicit;f(t.isVisible?0:-1)}}function ws(i,e){i&1&&(r(0,"div",11)(1,"h5"),s(2,"Cost"),a(),g(3,"input",16),a())}function Ms(i,e){if(i&1&&(r(0,"div")(1,"div",8)(2,"div",9)(3,"h5"),s(4,"Qty"),a(),g(5,"input",10,0),a(),r(7,"div",11)(8,"h5"),s(9,"Price"),a(),g(10,"input",12),a(),C(11,ws,4,0,"div",11),a(),Ot(12),r(13,"div",8)(14,"div",13)(15,"h5",14),s(16,"Note"),a(),g(17,"POS-tinymce-editor",15),a()(),At(),a()),i&2){let t=m();l(11),f(t.roleService.product.Cost?11:-1)}}function Es(i,e){if(i&1&&g(0,"img",29),i&2){let t=m(3);c("ngSrc",t.cartItem.ThumbnailUrl)}}function Os(i,e){i&1&&M(0,Es,1,1,"ng-template")}function As(i,e){i&1&&(Ot(0),g(1,"i",30),r(2,"h6"),s(3,"No Image"),a(),At())}function ks(i,e){if(i&1&&(r(0,"div",13)(1,"table",31)(2,"thead")(3,"tr")(4,"th",32),s(5,"Storage Location"),a()()(),r(6,"tbody")(7,"tr")(8,"td"),s(9),a()()()()()),i&2){let t=m(2);l(9),I(" ",t.cartItem.Variant.Storage," ")}}function Vs(i,e){if(i&1&&(Ot(0),r(1,"div",17)(2,"div",18)(3,"a",19),C(4,Os,1,0)(5,As,4,0,"ng-container"),a()(),r(6,"div",20)(7,"div",21)(8,"div",13)(9,"div",22),g(10,"i",23),r(11,"div",24),s(12," Inventory "),a()(),r(13,"table",25)(14,"thead")(15,"tr")(16,"th",26),s(17," On Hand "),a(),r(18,"th",26),s(19," Allocated "),a(),r(20,"th",27),s(21," Available "),a()()(),r(22,"tbody")(23,"tr")(24,"td",28),s(25),a(),r(26,"td",28),s(27),a(),r(28,"td",28),s(29),a()()()()(),C(30,ks,10,1,"div",13),a()(),g(31,"div",17),a(),At()),i&2){let t=m();l(3),c("routerLink",Y(6,Is)),l(),f(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(),f(!(t.AppConfigJSON==null||t.AppConfigJSON.ModuleSell==null||t.AppConfigJSON.ModuleSell.Grid==null)&&t.AppConfigJSON.ModuleSell.Grid.StorageVisible&&t.cartItem.Variant.Storage?30:-1)}}function js(i,e){if(i&1){let t=v();r(0,"POS-tab-serial",33),T("variantChange",function(n){p(t);let d=m();return P(d.cartItem,n)||(d.cartItem=n),u(n)}),_("variantChange",function(n){p(t);let d=m();return u(d.onSerialChange(n))}),T("serialsChange",function(n){p(t);let d=m();return P(d.serials,n)||(d.serials=n),u(n)})("isFocusOnSerialInputChange",function(n){p(t);let d=m();return P(d.isFocusOnSerialInput,n)||(d.isFocusOnSerialInput=n),u(n)}),a()}if(i&2){let t=m();c("disabledEditQty",t.isAdjustmentEdit())("disabledAddSerial",t.isAdjustmentEdit())("outletID",t.storeService.Outlet().ID),w("variant",t.cartItem)("serials",t.serials)("isFocusOnSerialInput",t.isFocusOnSerialInput)}}var ai=class i{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(),Yi(()=>{this.tabs()&&this.tabs()[1].isActive&&this.tabs()[1].isActive&&setTimeout(()=>{this._costElement?.nativeElement?.click(),this._costElement.nativeElement.focus()},500)})}storeService=h(G);roleService=h(B);AppConfigJSON;modalConfig=new gt;cartItem;form;tabs=z([]);activeTab=he(()=>this.tabs().filter(e=>e.isActive)[0]);isItemSerial=z(!1);inventory=z({ON_HAND:0,ALLOCATED:0,AVAILABLE:0,ROP:0,MAX:0});serials=[];isFocusOnSerialInput=z(!1);_costElement;cdr=h(to);#t=h(Ue);#e=h(_t);#n=h(Zt);#i=h(bt);#o=h(ht);#r=h(vt);isAdjustmentEdit=z(!1);onTabChange(e){let t=this.tabs().map(o=>o.key===e?R(k({},o),{isActive:!0}):R(k({},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(k({},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,n)=>o+n.Quantity,0);if(this.form.get("Quantity")?.value!==e){this.#r.warning("Serial must be equal with the quantity",X.Warning);return}}if(this.cartItem.Quantity<0){let e=this.storeService.CartItems().reduce((t,o,n)=>(this.data.index===n?t.push(k({},this.#n.adapt(R(k({},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,n)=>(this.data.index===n?t.push(k({},this.#n.adapt(R(k({},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,n)=>(this.data.index===n?t.push(k({},this.#n.adapt(R(k({},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...",X.Error);return}return Tt(this.activeTab,{injector:this.#o}).pipe(dt(e=>e.key===1),Me(),nt(e=>this.#i.httpRequestGetInventoryByVariantID(this.cartItem.VariantID)))}onCancel(){this.#e.close()}static \u0275fac=function(t){return new(t||i)(b(Gt))};static \u0275cmp=O({type:i,selectors:[["adjustment-modal-edit-product"]],viewQuery:function(t,o){if(t&1&&ge(xs,5),t&2){let n;Ce(n=fe())&&(o._costElement=n.first)}},decls:11,vars:3,consts:[["qty",""],[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"row","border-bottom"],[1,"container-fluid","mt-5",3,"formGroup"],[3,"disabledEditQty","disabledAddSerial","outletID","variant","serials","isFocusOnSerialInput"],[1,"btn","btn-link",3,"ngClass"],[1,"btn","btn-link",3,"click","ngClass"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["formControlName","Price","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[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&&(r(0,"modal-material",1),_("onOk",function(){return o.onOK()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),r(1,"content")(2,"div",2)(3,"div",3)(4,"div"),N(5,Ts,1,1,null,null,Ds),a()()(),r(7,"div",4),C(8,Ms,18,1,"div")(9,Vs,32,7,"ng-container")(10,js,1,6,"POS-tab-serial",5),a()()()),t&2){let n;c("config",o.modalConfig),l(5),F(o.tabs()),l(2),c("formGroup",o.form),l(),f((n=o.activeTab().key)===0?8:n===1?9:n===2?10:-1)}},dependencies:[ut,Ct,yt,Nt,xe,St,H,je,Ne,Fe,Ie,Ke,un,ct,eo,Un,He,Ut,Re],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 Ns(i,e){if(i&1){let t=v();r(0,"div",27)(1,"button",28),_("click",function(){p(t);let n=m().$index,d=m(2);return u(d.onReturnVariant(n))}),s(2," Return "),a(),r(3,"button",28),_("click",function(){p(t);let n=m().$index,d=m(2);return u(d.onPurchaseVariant(n))}),s(4," Purchase "),a()()}}function Fs(i,e){if(i&1&&(r(0,"td",6),s(1),a()),i&2){let t=m().$index;l(),I("",t+1,".")}}function Us(i,e){if(i&1){let t=v();r(0,"div",9)(1,"img",29),_("error",function(n){p(t);let d=m(3);return u(d.onErrorImage(n))}),a()()}if(i&2){let t=m().$implicit;l(),c("src",t.Variant.ThumbnailUrl,Oe)("alt",t.Variant.Name)}}function Ls(i,e){i&1&&(r(0,"div",10),g(1,"i",30),a())}function Rs(i,e){if(i&1&&(r(0,"span"),s(1),x(2,"number"),a()),i&2){let t=m().$implicit;l(),S(E(2,1,t.Quantity))}}function Qs(i,e){i&1&&(r(0,"span",18),s(1," x "),a())}function Bs(i,e){if(i&1&&(r(0,"span"),s(1),x(2,"number"),a()),i&2){let t=m().$implicit;l(),S(E(2,1,t.UnitQuantity))}}function Hs(i,e){if(i&1&&(r(0,"small",19),s(1),a()),i&2){let t=m().$implicit;l(),S(t.Variant.UOM?t.Variant.UOMName:"")}}function Ws(i,e){if(i&1&&(r(0,"div",20),s(1),x(2,"number"),a()),i&2){let t=m().$implicit;l(),I(" ",L(2,1,t.Price,"1.0-4")," ")}}function qs(i,e){if(i&1){let t=v();r(0,"tr",5),_("click",function(){let n=p(t).$index,d=m(2);return u(d.onOpenModalEditProduct(n))}),M(1,Ns,5,0,"ng-template",null,0,K),C(3,Fs,2,1,"td",6),r(4,"td",7)(5,"div",8),C(6,Us,2,2,"div",9)(7,Ls,2,0,"div",10),r(8,"div",11)(9,"div"),s(10),a(),r(11,"span",12),s(12),a(),r(13,"div"),g(14,"app-serial-note",13),a(),g(15,"small",14),a()()(),r(16,"td",15)(17,"div",16)(18,"div",17)(19,"span"),C(20,Rs,3,3,"span"),C(21,Qs,2,0,"span",18),C(22,Bs,3,3,"span"),a(),C(23,Hs,2,1,"small",19),a()()(),r(24,"td"),C(25,Ws,3,4,"div",20),a(),r(26,"td",21)(27,"div",16)(28,"div",22),s(29),x(30,"number"),a()()(),r(31,"td",23)(32,"div",24)(33,"span",25),_("click",function(){let n=p(t).$index,d=m(2);return u(d.removeCartItem(n))}),g(34,"i",26),a()()()()}if(i&2){let t,o,n=e.$implicit,d=it(2),y=m(2);c("cdkContextMenuTriggerFor",d)("cdkDragDisabled",y.isMobileDevice()),l(3),f((t=y.AppConfigJSON())!=null&&t.ModuleSell.Grid.RowNumberVisible?3:-1),l(3),f(n.Variant.ThumbnailUrl?6:7),l(4),S(n.Variant.Name),l(2),S(n.Variant.Code),l(2),c("serials",n.Serial),l(),c("innerHtml",n.Note,$),l(5),f(n.Quantity!=1||n.UnitQuantity>1?20:-1),l(),f(n.UnitQuantity>1||n.UnitQuantity<-1?21:-1),l(),f(n.UnitQuantity>1||n.UnitQuantity<-1?22:-1),l(),f(n.Variant.UOM&&(!((o=y.AppConfigJSON())==null||o.ModuleSell==null)&&o.ModuleSell.Grid.UOMVisible)?23:-1),l(2),f(n.UnitPrice!==(n==null?null:n.Total)&&n.Quantity>1?25:-1),l(4),I(" ",y.roleService.product!=null&&y.roleService.product.Price?E(30,14,+(n.Quantity*+n.Price)):" - "," ")}}function Gs(i,e){if(i&1){let t=v();r(0,"table",1)(1,"tbody",3),_("cdkDropListDropped",function(n){p(t);let d=m();return u(d.onDrop(n))}),N(2,qs,35,16,"tr",4,Z),a()()}if(i&2){let t=m();l(2),F(t.CartItems())}}function zs(i,e){i&1&&(r(0,"div",2)(1,"div",31)(2,"div",32)(3,"div",33)(4,"div",34),g(5,"i",35),a(),r(6,"div",36)(7,"span"),s(8,"Empty Cart"),a(),g(9,"br"),r(10,"span"),s(11,"Add products to the cart"),a(),g(12,"br"),r(13,"span"),s(14,"or scan barcode"),a()()()()()())}var li=class i{roleService=h(B);storeService=h(G);cartService=h(bt);matDialog=h(et);renderer=h(Ji);#t=h(Zt);route=h(ve);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(ai,{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,n,d)=>(e===d?o.push(k({},this.#t.adapt(R(k({},n),{Quantity:-Math.abs(n.Quantity),TotalPrice:-Math.abs(n.Quantity)*n.Price})))):o.push(n),o),[]);this.storeService.onChangeCartItems(t)}onPurchaseVariant(e){let t=this.storeService.CartItems().reduce((o,n,d)=>(e===d?o.push(k({},this.#t.adapt(R(k({},n),{Quantity:Math.abs(n.Quantity),TotalPrice:Math.abs(n.Quantity)*n.Price})))):o.push(n),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||i)};static \u0275cmp=O({type:i,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,Gs,4,0,"table",1)(1,zs,15,0,"div",2),t&2&&f(o.CartItems().length>0?0:1)},dependencies:[ho,fo,Je,qo,Ho,Bo,Wo,q],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 si=class i{storeService=h(G);cartService=h(bt);orderService=h(Rt);loadFormService=h(tn);roleService=h(B);#t=h(Ft);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"),nt(()=>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||i)};static \u0275cmp=O({type:i,selectors:[["adjustment-cart-action"]],outputs:{onProcess:"onProcess",onOpenModalNote:"onOpenModalNote",onOpenModalVoid:"onOpenModalVoid"},decls:17,vars:5,consts:[[1,"row","g-0","pb-6","px-5"],[1,"col-5","d-flex","justify-content-between","pe-5",2,"column-gap","12px"],["type","button",1,"btn","btn-gray","fs-3","py-6","headings-font-family",2,"flex-grow","1",3,"click"],[1,"fa-regular","fa-note-sticky","fa-xl"],["type","button",1,"btn","btn-gray","fs-3","px-0","py-6","headings-font-family","d-flex","gap-2","justify-content-center","align-items-center",2,"flex-grow","8",3,"click"],[1,"fa-solid"],[1,"col-7"],["type","button",1,"btn","btn-success","w-100","px-6","py-6","d-flex","justify-content-between","align-items-center","headings-font-family",2,"border-left","0.1px solid #fff","font-size","22px",3,"click"],[1,"fs-6"]],template:function(t,o){t&1&&(_e(0,"div",0)(1,"div",1)(2,"button",2),bn("click",function(){return o.onOpenModalNoteHandler()}),Ti(3,"i",3),pn(),_e(4,"button",4),bn("click",function(){return o.onOpenModalVoidHandler()}),Ti(5,"i",5),_e(6,"span"),s(7,"Clear"),pn()()(),_e(8,"div",6)(9,"button",7),bn("click",function(){return o.onProcessHandler()}),_e(10,"div"),s(11," Submit "),_e(12,"small",8),s(13),pn()(),_e(14,"div"),s(15),x(16,"number"),pn()()()()),t&2&&(l(13),Te("(",o.storeService.CartItems().length," items, ",o.storeService.QtyCartItems()," Qty)"),l(2),S(E(16,3,o.storeService.SubTotal())))},dependencies:[q],styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};function $s(i,e){if(i&1&&(r(0,"div",6)(1,"div",7)(2,"div"),s(3),a(),r(4,"small",8),s(5),a()(),r(6,"div",9)(7,"span"),s(8),x(9,"number"),a()()()),i&2){let t=e.data;l(3),S(t==null?null:t.Value),l(2),S(t==null?null:t.Code),l(3),S(E(9,3,t==null?null:t.UnitPrice))}}var di=class i{cartService=h(bt);query=new Se({});#t=h(U);storeService=h(G);skipXHR=!1;spinnerService=h(ir);constructor(){}onBarcodeScan(e){console.log("Scanned barcode:",e),this.cartService.httpRequestVariantByCode(e).pipe().subscribe()}ngOnInit(){this.query.valueChanges.pipe($e("query"),dt(e=>e&&Object.keys(e).length>0),Q(e=>{this.spinnerService.show()}),nt(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(ue(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||i)};static \u0275cmp=O({type:i,selectors:[["adjustment-cart-header"]],decls:7,vars:4,consts:[["itemTemplate",""],[1,"row"],[1,"col"],[1,""],[1,"px-4","py-4"],["inputID","product","requestUrl","/API/AC/GetVariantSuggestionByCodeNNameWithEntityID","prefixIcon","fa fa-barcode","placeholder","Search product by name / code","localStorage","products","notFoundMessageFor","product","data_cy","txt-product",1,"form-control","autocomplete-product",3,"onInputEnter","onSelect","clearOnSelect","useCustomTemplate","itemTemplate","outletId"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"],[1,"ps-4"]],template:function(t,o){if(t&1){let n=v();r(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"autocompleteV2",5),_("onInputEnter",function(y){return p(n),u(o.onBarcodeScan(y))})("onSelect",function(y){return p(n),u(o.onSelectVariant(y))}),a()(),M(5,$s,10,5,"ng-template",null,0,K),a()()()}if(t&2){let n=it(6);l(4),c("clearOnSelect",!0)("useCustomTemplate",!0)("itemTemplate",n)("outletId",o.storeService.Outlet().ID)}},dependencies:[yt,Vo,qt,xe,qe,zt,q],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 Li=class{constructor(e,t,o,n,d,y,D,lt,ot,st,It){this._StateID=e,this._StateLabel=t,this._Success=o,this._Message=n,this._InvoiceID=d,this._OrderID=y,this._InvoiceNumber=D,this._PrintMode=lt,this._DeliveryID=ot,this._PaymentStateID=st,this._PaymentStateLabel=It}_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}}},ci=class i{adapt(e){return new Li(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||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ks=(i,e)=>e.key;function Js(i,e){if(i&1){let t=v();r(0,"div",3),_("click",function(){let n=p(t).$implicit,d=m();return u(d.submit(n.key))}),g(1,"i",4),s(2),a()}if(i&2){let t=e.$implicit;l(),c("ngClass",t.icon),l(),I(" ",t.label," ")}}var pi=class i{constructor(e,t){this.dialogRef=e;this.data=t;this.config=new gt,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0}config;adjustmentState=z([]);onClose(){this.dialogRef.close({role:"close"})}onCancel(){this.dialogRef.close({role:"cancel"})}ngOnInit(){this.adjustmentState.set([{key:1,value:"draft",label:"Draft",icon:"fa-file-pen"},{key:2,value:"submitted",label:"Submit for Review",icon:"fa-user-magnifying-glass"}])}submit(e){this.dialogRef.close({role:"ok",data:e})}static \u0275fac=function(t){return new(t||i)(b(_t),b(Gt))};static \u0275cmp=O({type:i,selectors:[["POS-modal-with-approval"]],decls:5,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid","d-flex","gap-3","justify-content-between",2,"width","500px"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid",3,"ngClass"]],template:function(t,o){t&1&&(r(0,"modal-material",0),_("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),r(1,"content")(2,"div",1),N(3,Js,3,2,"div",2,Ks),a()()()),t&2&&(c("config",o.config),l(3),F(o.adjustmentState()))},dependencies:[yt,Nt,ut,Ct],encapsulation:2})};var ui=class i{destroy$=new ft;#t=h(Rt);#e=h(G);#n=h(ci);injector=h(ht);toastr=h(vt);matDialog=h(et);constructor(){}ngOnInit(){}onProcessOrder(){if(A.IsEmpty(this.#e.Outlet().ID)){this.toastr.error("Please select outlet before proceeding..",X.Error);return}if(this.#e.CartItems().length==0){this.toastr.error("You must have at least one item.",X.Error);return}if(A.IsEmpty(this.#e.Order().Number)){this.toastr.error("Number cannot be empty.",X.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(Dt(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),Tt(this.#e.LoadForm,{injector:this.injector}).pipe(nt(e=>!e.Data||e.Data&&e.Data.Order.StateID&&e.Data.Order.StateID==1?this.matDialog.open(pi).afterClosed().pipe(dt(t=>t!=null&&t.role==="ok"),Q(t=>{let o=t.data;this.#t.onUpdateOrderState("StateID",Number(o))}),nt(()=>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||i)};static \u0275cmp=O({type:i,selectors:[["adjustment-cart"]],decls:9,vars:0,consts:[[1,"h-100","d-flex","flex-column"],[1,"pt-4"],[1,"row"],[1,"col"],["PinScrollingBottom","",1,"",2,"overflow-y","auto","flex","1 1 0%","max-height","calc(100vh - 170px)"],[1,""],[3,"onProcess"]],template:function(t,o){t&1&&(r(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),g(4,"adjustment-cart-header"),a()()(),r(5,"div",4),g(6,"adjustment-cart-display"),a(),r(7,"div",5)(8,"adjustment-cart-action",6),_("onProcess",function(){return o.onProcessOrder()}),a()()())},dependencies:[li,si,di,Zo],encapsulation:2})};function Zs(i,e){if(i&1&&(r(0,"div",22)(1,"div",25),s(2),a(),r(3,"div",25),s(4),a()()),i&2){let t=e.$implicit;l(2),S(t.Variant.Name),l(2),S(t.Quantity)}}var _i=class i{menu$;storeService=h(G);#t=h(Ft);#e=h(rt);#n=h(Tn);cartItems;fullContainerEl=document.getElementById("full-container");constructor(){this.#e.setMenu$(),this.menu$=this.#e.menu$.pipe(Et(e=>R(k({},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 Cn(this,null,function*(){window.open(`/print/Adjustment?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onGotoAdjustmentDetail(){return Cn(this,null,function*(){window.open(`/menu/Adjustment/Adjustment/Archive/Info?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onNewAdjustment(){return Cn(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||i)};static \u0275cmp=O({type:i,selectors:[["adjustment-order-complete"]],hostBindings:function(t,o){t&1&&_("keydown.F8",function(){return o.handleF8()},Ht)},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&&(r(0,"mainpanel-cmp",0),x(1,"async"),r(2,"content")(3,"section",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"h1",7),g(10,"i",8),s(11,"Inventory Adjustment Complete "),a()(),r(12,"div",9)(13,"div",10)(14,"div",11)(15,"a",12),_("click",function(){return o.onNewAdjustment()}),s(16," New Adjustment (F8)"),a()()()(),r(17,"div",13)(18,"div",14)(19,"a",15),_("click",function(){return o.onPrintReceipt()}),g(20,"i",16),s(21,"Print Receipt"),a()()()()(),r(22,"div",17)(23,"div",5)(24,"div",18)(25,"h3",19)(26,"a",20),s(27),a()()(),r(28,"div",21),N(29,Zs,5,2,"div",22,Z),r(31,"div",23)(32,"div",24),s(33,"Total:"),a(),r(34,"div",24),s(35),x(36,"number"),a()()()()()()()()()()),t&2&&(c("pageData",E(1,6,o.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),l(26),c("href","/menu/Adjustment/Adjustment/Archive/Info?ID="+o.storeService.OrderComplete().OrderID,Oe),l(),I("Adjustment #",o.storeService.OrderComplete().InvoiceNumber),l(2),F(o.cartItems),l(6),I(" ",E(36,8,o.storeService.QtyCartItems())," "))},dependencies:[On,at,En,Ve,q],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 Xs=["qty"];function Ys(i,e){if(i&1&&(r(0,"div",16)(1,"div",17)(2,"div"),s(3),a(),r(4,"small",18),s(5),a()()()),i&2){let t=e.data;l(3),S(t==null?null:t.Value),l(2),S(t==null?null:t.Code)}}var gn=class i{modalConfig=new gt;cartService=h(bt);cartItem=z(null);query=new Se(null);form;#t=h(_t);unsubscribe$=new ft;#e=h(Ue);quantityRef;focusTimeoutID;ngZone=h(xn);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(Dt(this.unsubscribe$),nt(e=>this.cartService.httpGetVariantByID(e,!1).pipe()),$e("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||i)};static \u0275cmp=O({type:i,selectors:[["adjustment-modal-cart-add"]],viewQuery:function(t,o){if(t&1&&ge(Xs,5),t&2){let n;Ce(n=fe())&&(o.quantityRef=n.first)}},decls:29,vars:6,consts:[["itemTemplate",""],["qty",""],[3,"onCancel","onClose","onOk","config"],[1,"container","w-100","h-100"],[1,"row"],[1,"col-12"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"keyup.enter","formControl","renderThumbnail","useCustomTemplate","itemTemplate"],[3,"formGroup"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["autoNum","","formControlName","Price","type","text",1,"mt-5","form-control",2,"width","100px"],["autoNum","","formControlName","Cost","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"mb-5"],["formControlName","Note","height","220px"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"]],template:function(t,o){if(t&1){let n=v();r(0,"modal-material",2),_("onCancel",function(){return p(n),u(o.onCancel())})("onClose",function(){return p(n),u(o.onCancel())})("onOk",function(){return p(n),u(o.onOK())}),r(1,"content")(2,"div",3)(3,"div",4)(4,"div",5)(5,"autocompleteV2",6),_("keyup.enter",function(y){return p(n),u(y.stopPropagation())}),a(),M(6,Ys,6,2,"ng-template",null,0,K),a()(),r(8,"div",7)(9,"div",8)(10,"div",9)(11,"h5"),s(12,"Qty"),a(),g(13,"input",10,1),a(),r(15,"div",11)(16,"h5"),s(17,"Price"),a(),g(18,"input",12),a(),r(19,"div",11)(20,"h5"),s(21,"Cost"),a(),g(22,"input",13),a()(),Ot(23),r(24,"div",8)(25,"div",5)(26,"h5",14),s(27,"Note"),a(),g(28,"POS-tinymce-editor",15),a()(),At(),a()()()()}if(t&2){let n=it(7);c("config",o.modalConfig),l(5),c("formControl",o.query)("renderThumbnail",!0)("useCustomTemplate",!0)("itemTemplate",n),l(3),c("formGroup",o.form)}},dependencies:[He,Ut,qe,zt,ut,Ct,wo,xe,St,H,je,ro,Ne,Fe,Ie,Ke],encapsulation:2})};var gr=Pi(Wr());function td(i,e){if(i&1){let t=v();r(0,"POS-uppy",3),_("onParser",function(n){p(t);let d=m(2);return u(d.onParser(n))})("fileUploaded",function(n){p(t);let d=m(2);return u(d.onUploadCsv(n))})("fileRemoved",function(){p(t);let n=m(2);return u(n.onRemovedFile())}),a()}if(i&2){let t=m(2);c("sampleUrl",t.sampleURL)}}function ed(i,e){if(i&1){let t=v();r(0,"POS-uppy",3),_("onParser",function(n){p(t);let d=m(2);return u(d.onParser(n))})("fileUploaded",function(n){p(t);let d=m(2);return u(d.onUploadCsv(n))})("fileRemoved",function(){p(t);let n=m(2);return u(n.onRemovedFile())}),a()}if(i&2){let t=m(2);c("sampleUrl",t.sampleURL)}}function nd(i,e){if(i&1&&(C(0,td,1,1,"POS-uppy",2),C(1,ed,1,1,"POS-uppy",2)),i&2){let t=m();f(t.uploadState()===t.uploadStateEnum.Idle||t.uploadState()===t.uploadStateEnum.Uploading?0:-1),l(),f(t.uploadState()===t.uploadStateEnum.Success||t.uploadState()===t.uploadStateEnum.Error?1:-1)}}var gi=class i{modalConfig;sampleURL;fileInput=z(null);unsubscribe$=new ft;#t=h(_t);#e=h(U);#n=h(G);#i=h(bt);#o=h(ht);cartItem=z([]);skipEmptyLines=!0;rowCount=z(0);rowEmpty=z(0);totalRows=he(()=>this.rowCount()-this.rowEmpty());file=z(null);uploadState=z(0);uploadStateEnum=Fn;constructor(){this.modalConfig=new gt,this.modalConfig.title="Import Items",this.modalConfig.customWidth="500px",this.sampleURL="https://cdn.dealpos.xyz/web-import-template/ImportItem_Adjustment_TemplateV2.csv"}onOK(){this.uploadState.set(1);let e={EntityID:this.#n.Outlet().ID,CartItems:this.cartItem()};return this.#e.post("/API/Adjustment/UploadCsvV2",e).pipe($e("response"),ue(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())}),vn(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),gr.default.parse(t,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:o=>{let n=o.split(/\r?\n/).slice(1);return n[n.length-1]===""&&n.pop(),this.rowCount.set(n.length),n.forEach(d=>{d.split(",").every(D=>D==="")&&this.rowEmpty.update(D=>D+=1)}),o},error(o,n){console.log("ERROR",o,n)},complete:(o,n)=>{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||i)};static \u0275cmp=O({type:i,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 n=v();r(0,"modal-material",1),_("onOk",function(){return p(n),u(o.onOK())})("onCancel",function(){return p(n),u(o.onClose())})("onClose",function(){return p(n),u(o.onClose())}),M(1,nd,2,2,"ng-template",null,0,K),a()}t&2&&c("config",o.modalConfig)},dependencies:[ut,Ct,Ze],encapsulation:2})};function id(i,e){if(i&1){let t=v();r(0,"li",11),_("click",function(){let n=p(t).$implicit,d=m(3);return u(d.onClickMenu(n))}),g(1,"POS-dropdown-item-more-action",12),a()}if(i&2){let t=e.$implicit;l(),c("icon",t.icon)("label",t.title)}}function od(i,e){if(i&1&&N(0,id,2,2,"li",10,Z),i&2){let t=m().$implicit;F(t.children)}}function rd(i,e){if(i&1&&(r(0,"div",7)(1,"div",8),s(2),a(),g(3,"div",9),C(4,od,2,0),a()),i&2){let t=e.$implicit;l(2),S(t.title),l(2),f(t.children.length>0?4:-1)}}var Ci=class i{menu=z([]);#t=h(et);router=h(Ft);handleF8(){this.#t.openDialogs&&this.#t.openDialogs.length>0||this.#t.open(gn)}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(gn);break;case"upload":this.#t.open(gi);break}}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=O({type:i,selectors:[["adjustment-more-actions"]],hostBindings:function(t,o){t&1&&_("keydown.F4",function(d){return o.handleF8(d)},Ht)},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&&(r(0,"span",0)(1,"span",1),g(2,"i",2),a(),r(3,"span",3),s(4,"More Actions"),a()(),r(5,"div",4)(6,"div",5)(7,"div",6),N(8,rd,5,2,"div",7,Z),a()()()),t&2&&(l(8),F(o.menu()))},dependencies:[Go],encapsulation:2})};var Ri=class{constructor(e,t,o,n){this._Order=e,this._Items=t,this._OrderItems=o,this._CountedItems=n}_Order;get Order(){return this._Order}set Order(e){this._Order=e}_Items;get Items(){return this._Items}set Items(e){this._Items=e}_OrderItems;get OrderItems(){return this._OrderItems}set OrderItems(e){this._OrderItems=e}_CountedItems;get CountedItems(){return this._CountedItems}set CountedItems(e){this._CountedItems=e}},fi=class i{adapt(e){return new Ri(e.Order,e.Items,e.OrderItems,e.CountedItems)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},Qi=class{constructor(e,t,o,n,d,y,D,lt,ot,st,It,jt,Xt,Yt,te,ee,ne,ie,oe,re,ae,le){this._EntityID=e,this._Number=t,this._Date=o,this._PIC=n,this._Note=d,this._EntityName=y,this._StateID=D,this._StateLabel=lt,this._ReviewDate=ot,this._ReviewerID=st,this._TypeID=It,this._TypeLabel=jt,this._Quantity=Xt,this._UnitPrice=Yt,this._UnitCost=te,this._TotalPrice=ee,this._AdjustedQuantity=ne,this._CreatorID=ie,this._Created=oe,this._ModifierID=re,this._Modified=ae,this._ID=le}_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}},Cr=class i{adapt(e){return new Qi(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||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},Bi=class{constructor(e,t,o,n,d,y,D,lt,ot,st,It,jt){this._LostNFoundID=e,this._UnitCost=t,this._InventoryTypeID=o,this._UnitPrice=n,this._Discount=d,this._VariantID=y,this._Note=D,this._Quantity=lt,this._UnitQuantity=ot,this._Index=st,this._Serial=It,this._ID=jt}_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}},fr=class i{adapt(e){return new Bi(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||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})},Hi=class{constructor(e,t,o,n,d,y,D,lt,ot,st,It,jt){this._ParentID=e,this._Start=t,this._Finish=o,this._UnitPrice=n,this._UnitCost=d,this._VariantID=y,this._Note=D,this._Quantity=lt,this._UnitQuantity=ot,this._Index=st,this._Serial=It,this._ID=jt}_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}},hr=class i{adapt(e){return new Hi(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||i)};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var yr=Pi(Po());function ad(i,e){if(i&1&&g(0,"adjustment-order-complete",0),i&2){let t=m();c("cartItems",t.storeService.CartItems())}}function ld(i,e){if(i&1){let t=v();r(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"POS-select-outlet-form",6),x(6,"async"),_("ngModelChange",function(n){p(t);let d=m();return u(d.storeService.onChangeOutlet(n))}),a(),r(7,"POS-invoice-number-form",7),x(8,"async"),_("ngModelChange",function(n){p(t);let d=m();return u(d.onInvoiceNumberChange(n))}),a()(),r(9,"POS-invoice-date",8),_("ngModelChange",function(n){p(t);let d=m();return u(d.onChangeOrderDate(n))}),a()()(),r(10,"div",9)(11,"div",10)(12,"div",11),g(13,"adjustment-more-actions"),a(),r(14,"div",12),g(15,"i",13),r(16,"ng-select",14),_("ngModelChange",function(n){p(t);let d=m();return u(d.onChangeAdjustmentType(n))}),a()()()()(),r(17,"div",15)(18,"div",16)(19,"POS-quick-key",17),_("onSelectVariant",function(n){p(t);let d=m();return u(d.onSelectVariant(n))}),a()(),r(20,"div",18),g(21,"adjustment-cart"),a()()()}if(i&2){let t=m();l(5),c("disabled",t.storeService.AdjustmentState()===1)("isOpenAfterLoad",E(6,16,t.isOpenDiaglog$))("outlets",t.storeService.Outlets())("ngModel",t.storeService.Outlet()),l(2),c("ngModel",t.storeService.Order().Number)("transactionType",E(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 hi=class i{isOpenDialog=z(!0);loadFormService=h(tn);intercom=h(ao);storeService=h(G);quickeyService=h(ii);cartService=h(bt);orderService=h(Rt);isOpenDiaglog$;Outlets$;loadForm$;adjustmentEditDataAdapter=h(fi);roleService=h(B);#t=h(Zt);#e=h(en);#n=h(ve);transactionType$=this.#n.queryParamMap.pipe(Et(e=>(e.has("ID"),"Adjustment")));title=h(Tn);injector=h(ht);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(nt(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(n=>{if(n.Data&&Object.keys(n.Data).length>0&&Object.keys(this.storeService.LoadForm().Data).length>0){this.orderService.onUpdateOrderState("Number",n.Data.Order.Number),this.orderService.onUpdateOrderState("Date",new Date(n.Data.Order.Date)),this.orderService.onUpdateOrderState("StateID",n.Data.Order.StateID),this.orderService.onUpdateOrderState("TypeID",n.Data.Order.TypeID),this.orderService.onUpdateOrderState("EntityID",n.Data.Order.EntityID);let d=n.Data.Items.map(y=>this.#t.adapt(R(k({},y),{Variant:this.#e.adapt(y.Variant)})));if(this.storeService.onChangeCartItems(d),this.orderService.onUpdateOrderState("PIC",n.Data.Order.PIC),this.orderService.onUpdateOrderState("Note",n.Data.Order.Note),this.orderService.onUpdateOrderState("TagID",n.Data.Order.TagID),n.Entities.length>0){let y=n.Entities.findIndex(D=>D.ID===n.Data.Order.EntityID);y!==-1&&this.storeService.onChangeOutlet(n.Entities[y])}}}))}return this.storeService.onChangeAdjustmentState(0),this.loadFormService.httpRequestLoadForm$()})).subscribe({}),Tt(this.storeService.IsOpenDialog,{injector:this.injector}).pipe().subscribe(),this.isOpenDiaglog$=Tt(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,yr.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||i)};static \u0275cmp=O({type:i,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,ad,1,1,"adjustment-order-complete",0)(1,ld,22,20,"div",1),t&2&&f(o.storeService.IsComplete()?0:1)},dependencies:[Oo,Ro,Qo,Lo,qt,H,tt,pt,ui,_i,Ci,Ve],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 sd=()=>["/menu/Adjustment/Adjustment/Archive/Info"],dd=i=>({ID:i});function md(i,e){if(i&1){let t=v();r(0,"button",10),_("click",function(){p(t);let n=m(2);return u(n.openExportModal())}),g(1,"i",11),s(2," Export "),a()}}function cd(i,e){if(i&1){let t=v();r(0,"div")(1,"div",12)(2,"h6"),s(3,"Variant"),a(),r(4,"autocompleteV2",13),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.ID,n)||(d.pageData.Filter.ID=n),u(n)}),a(),r(5,"h6"),s(6,"Outlet"),a(),r(7,"ng-select",14),T("ngModelChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.EntityID,n)||(d.pageData.Filter.EntityID=n),u(n)}),a(),r(8,"h6"),s(9,"From"),a(),r(10,"datepicker",15),T("dateChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.From,n)||(d.pageData.Filter.From=n),u(n)}),a(),r(11,"h6"),s(12,"To"),a(),r(13,"datepicker",16),T("dateChange",function(n){p(t);let d=m(2);return P(d.pageData.Filter.To,n)||(d.pageData.Filter.To=n),u(n)}),a()()()}if(i&2){let t=m(2);l(4),w("ngModel",t.pageData.Filter.ID),c("inputTextValue",t.pageData.Filter.VariantName),l(3),c("items",t.pageData.Options.Entities),w("ngModel",t.pageData.Filter.EntityID),l(3),c("isFloatingLabel",!1),w("date",t.pageData.Filter.From),l(3),c("isFloatingLabel",!1),w("date",t.pageData.Filter.To)}}function pd(i,e){i&1&&(r(0,"th"),s(1,"Variant"),a())}function ud(i,e){if(i&1&&(r(0,"td"),s(1),a()),i&2){let t=m().$implicit;l(),S(t.Name)}}function _d(i,e){if(i&1&&(r(0,"tr",8),C(1,ud,2,1,"td"),x(2,"async"),r(3,"td"),s(4),a(),r(5,"td")(6,"a",17),s(7),a()(),r(8,"td"),s(9),x(10,"number"),a(),r(11,"td"),s(12),x(13,"date"),a()()),i&2){let t=e.$implicit,o=m(2);l(),f(E(2,7,o.isRedirect$)?-1:1),l(3),S(t.EntityName),l(2),c("routerLink",Y(14,sd))("queryParams",V(15,dd,t.ID)),l(),S(t.Number),l(2),S(E(10,9,t.Quantity)),l(3),S(L(13,11,t.Date,"dd/MM/yy"))}}function gd(i,e){if(i&1){let t=v();r(0,"mainpanel-cmp",2),T("textChange",function(n){p(t);let d=m();return P(d.pageData.Filter.Number,n)||(d.pageData.Filter.Number=n),u(n)}),_("onSubmit",function(){p(t);let n=m();return u(n.searchFromPageOne())}),T("filterChange",function(n){p(t);let d=m();return P(d.pageData.Filter,n)||(d.pageData.Filter=n),u(n)}),r(1,"actions"),C(2,md,3,0,"button",3),a(),r(3,"filters"),M(4,cd,14,8,"ng-template",null,0,K),a(),r(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr"),C(12,pd,2,0,"th"),x(13,"async"),r(14,"th"),s(15,"Outlet"),a(),r(16,"th"),s(17,"Number"),a(),r(18,"th"),s(19,"Quantity"),a(),r(20,"th"),s(21,"Date"),a()()(),r(22,"tbody"),N(23,_d,14,17,"tr",8,Z),a()()(),r(25,"POS-complex-pagination",9),_("jumpToPage",function(){p(t);let n=m();return u(n.getListData())})("previousPage",function(){p(t);let n=m();return u(n.getListData())})("nextPage",function(){p(t);let n=m();return u(n.getListData())}),a()()()()}if(i&2){let t=m();c("pageData",t.menuData),w("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),w("filter",t.pageData.Filter),l(2),f(t.roleService.global.Export?2:-1),l(10),f(E(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 yi=class i extends xt{constructor(t,o,n,d,y){super(t,o,"catalog/product/GetAdjustmentHistory","catalog/productLoader/GetAdjustmentHistoryLoader",null,n);this.matDialog=d;this.roleService=y;this.isRedirect$=hn(this.route.snapshot.queryParamMap).pipe(Et(D=>D.has("ID")),vn(1))}isRedirect$;openExportModal(){this.matDialog.open(Lt,{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||i)(b(rt),b(U),b(ve),b(et),b(B))};static \u0275cmp=O({type:i,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,n){o&1&&C(0,gd,26,10,"mainpanel-cmp",1),o&2&&f(n.data?0:-1)},dependencies:[ct,at,H,tt,ze,pt,zt,Kt,Ve,q,Wt],encapsulation:2})};function Cd(i,e){if(i&1){let t=v();r(0,"div",3)(1,"h6",1),s(2,"Category"),a(),r(3,"POS-product-category-select",10),T("selectedCategoryIDChange",function(n){p(t);let d=m();return P(d.categoryId,n)||(d.categoryId=n),u(n)}),_("selectedCategoryIDChange",function(){p(t);let n=m();return u(n.toggleTotalRows=!1)}),a()(),r(4,"div",3)(5,"h6",1),s(6,"Supplier"),a(),r(7,"autocompleteV2",11),T("ngModelChange",function(n){p(t);let d=m();return P(d.supplierID,n)||(d.supplierID=n),u(n)}),_("ngModelChange",function(){p(t);let n=m();return u(n.toggleTotalRows=!1)}),a()(),r(8,"div",3)(9,"h6"),s(10,"Brand"),a(),r(11,"ng-select",12),T("ngModelChange",function(n){p(t);let d=m();return P(d.loader.Filter.BrandID,n)||(d.loader.Filter.BrandID=n),u(n)}),_("ngModelChange",function(){p(t);let n=m();return u(n.toggleTotalRows=!1)}),a()()}if(i&2){let t=m();l(3),w("selectedCategoryID",t.categoryId),c("showClear",!0)("continuedCategoriesOnly",!0),l(4),w("ngModel",t.supplierID),l(4),c("items",t.loader.Options==null?null:t.loader.Options.BrandOptions),w("ngModel",t.loader.Filter.BrandID)}}function fd(i,e){if(i&1){let t=v();r(0,"span",13),_("click",function(){p(t);let n=m();return u(n.getTotalRows())}),g(1,"i",14),a()}}function hd(i,e){if(i&1&&(r(0,"span"),s(1),x(2,"number"),a()),i&2){let t=m();l(),I("",E(2,1,t.totalRows)," rows")}}var vi=class i{constructor(e,t,o){this.dialogRef=e;this.http=o;this.configModal=new gt,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||i)(b(_t),b(Gt),b(U))};static \u0275cmp=O({type:i,selectors:[["POS-dialog-download-template"]],standalone:!1,decls:21,vars:9,consts:[[3,"onOk","onCancel","onClose","config"],[1,"mb-4"],["name","onHandInventory",3,"modelChange","model"],[1,"mt-5"],["name","stockCount",3,"modelChange","model","options"],["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&&(r(0,"modal-material",0),_("onOk",function(){return o.confirm()})("onCancel",function(){return o.close()})("onClose",function(){return o.close()}),r(1,"content")(2,"div")(3,"h6",1),s(4,"On Hand Inventory < 1"),a(),r(5,"radio-options",2),T("modelChange",function(d){return P(o.onHandInventory,d)||(o.onHandInventory=d),d}),_("modelChange",function(){return o.toggleTotalRows=!1}),a()(),r(6,"div",3)(7,"h6",1),s(8,"Stock Count"),a(),r(9,"radio-options",4),T("modelChange",function(d){return P(o.stockCount,d)||(o.stockCount=d),d}),_("modelChange",function(){return o.toggleTotalRows=!1}),a()(),C(10,Cd,12,6),r(11,"div",3)(12,"h6",1),s(13,"Format"),a(),r(14,"radio-options",5),T("modelChange",function(d){return P(o.exportFormat,d)||(o.exportFormat=d),d}),_("modelChange",function(){return o.toggleTotalRows=!1}),a()(),r(15,"div",6)(16,"div",7),g(17,"i",8),s(18," Exporting data from "),C(19,fd,2,0,"span",9),C(20,hd,3,3,"span"),a()()()()),t&2&&(c("config",o.configModal),l(5),w("model",o.onHandInventory),l(4),w("model",o.stockCount),c("options",o.stockCountOptions),l(),f(o.stockCount=="1"?10:-1),l(4),w("model",o.exportFormat),c("options",o.exportFormatOptions),l(5),f(o.toggleTotalRows?-1:19),l(),f(o.toggleTotalRows?20:-1))},dependencies:[H,tt,pt,zt,Ct,An,$t,q],encapsulation:2})};var yd=i=>({"text-danger":i}),vd=()=>["/menu/Products/Catalog/Variants/Info"],Sd=i=>({ID:i});function xd(i,e){if(i&1){let t=v();r(0,"button",38),_("click",function(){p(t);let n=m(),d=it(8);return u(n.onPreview(d))}),s(1," Next "),a()}}function bd(i,e){if(i&1){let t=v();r(0,"button",39),_("click",function(){p(t);let n=m(),d=it(8);return d.selected.completed=!0,n.fileImport=null,d.previous(),u(n.uploadState.set(n.uploadStateEnum.Uploading))}),s(1," Back "),a(),r(2,"button",40),_("click",function(){p(t);let n=m(),d=it(8);return u(n.upload(d))}),s(3," Next "),a()}if(i&2){let t=m();l(2),c("disabled",!t.canProceedPreview)}}function Id(i,e){if(i&1){let t=v();r(0,"button",38),_("click",function(){p(t);let n=m(),d=it(8);return u(n.newUpload(d))}),s(1,"New"),a()}}function Dd(i,e){if(i&1&&s(0),i&2){let t=e.index;S(t+1)}}function Pd(i,e){i&1&&(g(0,"i",41),s(1,"Upload"))}function Td(i,e){if(i&1&&(r(0,"div",42),s(1),x(2,"limitText"),a()),i&2){let t=e.item;c("title",(t==null||t.Name==null?null:t.Name.length)>23?t.Name:""),l(),I(" ",L(2,2,t.Name,25)," ")}}function wd(i,e){if(i&1){let t=v();r(0,"div",16)(1,"button",43),_("click",function(){p(t);let n=m();return u(n.openDownloadTemplateDialog())}),g(2,"i",44),s(3," Download Template "),a()()}}function Md(i,e){if(i&1){let t=v();r(0,"POS-uppy",45),_("fileUploaded",function(n){p(t);let d=m();return u(d.onUploadCsv(n))}),a()}if(i&2){let t=m();c("dashboardPropsConfiguration",t.dashboardPropsConfiguration)("subtitle","Accepted file formats: .csv & max file size: 1 MB")}}function Ed(i,e){if(i&1){let t=v();r(0,"POS-uppy",45),_("fileUploaded",function(n){p(t);let d=m();return u(d.onUploadCsv(n))}),a()}if(i&2){let t=m();c("dashboardPropsConfiguration",t.dashboardPropsConfiguration)("subtitle","Accepted file formats: .csv & max file size: 1 MB")}}function Od(i,e){i&1&&(g(0,"i",46),s(1,"Preview"))}function Ad(i,e){i&1&&(r(0,"th",31),s(1," Difference "),a())}function kd(i,e){i&1&&(r(0,"th",32),s(1," Cost "),a())}function Vd(i,e){i&1&&(r(0,"th"),s(1," Message "),a())}function jd(i,e){if(i&1&&(r(0,"a",49),s(1),a()),i&2){let t=m().$implicit;c("routerLink",Y(3,vd))("queryParams",V(4,Sd,t.VariantID)),l(),S(t.VariantName)}}function Nd(i,e){if(i&1&&(r(0,"span",50),s(1),a()),i&2){let t=m().$implicit;l(),S(t.VariantName)}}function Fd(i,e){if(i&1&&(r(0,"td"),s(1),a()),i&2){let t=m().$implicit;Qt("text-danger",t.Differences<0)("text-success",t.Differences>0),l(),I(" ",t.Differences," ")}}function Ud(i,e){if(i&1&&(r(0,"td"),s(1),x(2,"number"),a()),i&2){let t=m().$implicit;Qt("text-danger",t.CostChange<0)("text-success",t.CostChange>0),l(),I(" ",E(2,5,t.CostChange)," ")}}function Ld(i,e){if(i&1&&(r(0,"div"),s(1),a()),i&2){let t=e.$implicit;l(),Te(" ",t.Issue," ",t.Solution," ")}}function Rd(i,e){if(i&1&&(r(0,"td"),N(1,Ld,2,2,"div",null,Z),a()),i&2){let t=m().$implicit;Qt("bg-gradient-danger",t.Issues==null?null:t.Issues.length),l(),F(t.Issues)}}function Qd(i,e){if(i&1&&(r(0,"tr")(1,"td"),s(2),a(),r(3,"td",47),s(4),a(),r(5,"td",48),C(6,jd,2,6,"a",49),C(7,Nd,2,1,"span",50),a(),r(8,"td",48),s(9),a(),r(10,"td",48),s(11),a(),r(12,"td"),s(13),a(),C(14,Fd,2,5,"td",51),C(15,Ud,3,7,"td",51),C(16,Rd,3,2,"td",52),a()),i&2){let t=e.$implicit,o=e.$index,n=m();l(2),S(o+1+"."),l(),c("ngClass",V(11,yd,!t.VariantCode)),l(),I(" ",t.ProductName," "),l(2),f(t.VariantID?6:-1),l(),f(t.VariantID?-1:7),l(2),I(" ",t.VariantCode," "),l(2),I(" ",t.Expected," "),l(2),I(" ",t.Counted," "),l(),f(n.importedDataState!="matched"?14:-1),l(),f(n.role.product.Cost&&n.importedDataState=="unmatched"?15:-1),l(),f(n.importedDataState=="error"||n.importedDataState=="all"?16:-1)}}function Bd(i,e){i&1&&(g(0,"i",53),s(1,"Finish"))}var Si=class i extends xt{constructor(t,o,n,d,y,D,lt,ot){super(t,o,null,"Outlet/GetByUserAccessWrite");this.toastr=n;this.csvConverter=d;this.router=y;this.importService=D;this.roleService=lt;this.matDialog=ot;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://res.cloudinary.com/pos/raw/upload/v1724644913/POS/CSV/Products_DealPOS4.csv";state="upload";dashboardPropsConfiguration={width:600};fileImport;role=h(B);exp=h(Mn);cacheKey="";canProceedPreview=!1;importedData=[];summary=["Category","Product","Variant"];summaryData={};uploaded=!1;importHttpResponse=[];isPreviewState=!1;isSuccessState=!1;msgSuccessImport;isDisabledImportBtn=!1;originalData=[];formData;opNames;outletName;uploadState=z(0);uploadStateEnum=Fn;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(ue(n=>(n instanceof Pn&&(this.uploadState.set(3),this.state="upload",console.error("Error during import preview:",n)),yn(()=>n)))).subscribe(n=>{t.selected.completed=!0,t.next(),this.cacheKey=n.CacheKey,this.canProceedPreview=n.CanProceed,this.importedData=n.DataRow,this.summaryData=n.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,X.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((n,d)=>{let y=t.direction==="asc",D=typeof n[t.active];switch(A.IsEmpty(n.Code)&&(n.Code=""),A.IsEmpty(d.Code)&&(d.Code=""),D){case"string":return A.compare(n[t.active].toLocaleLowerCase(),d[t.active].toLocaleLowerCase(),y);case"number":return A.compare(n[t.active],d[t.active],y);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(vi,{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||i)(b(rt),b(U),b(vt),b(kt),b(Ft),b(Jo),b(B),b(et))};static \u0275cmp=O({type:i,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,n){if(o&1){let d=v();r(0,"mainpanel-cmp",1)(1,"actions"),Ot(2),C(3,xd,2,0,"button",2),At(),C(4,bd,4,1),C(5,Id,2,0,"button",2),a(),r(6,"content")(7,"mat-stepper",3,0),_("selectionChange",function(D){return p(d),u(n.selectionChange(D))}),M(9,Dd,1,1,"ng-template",4),r(10,"mat-step",5),M(11,Pd,2,0,"ng-template",6),r(12,"div",7)(13,"div",8)(14,"h5",9),s(15,"Outlet"),a(),r(16,"small",10),s(17,"Stock take location"),a()(),r(18,"div",11)(19,"div",12)(20,"div",13)(21,"div")(22,"ng-select",14),T("ngModelChange",function(D){return p(d),P(n.formData.EntityID,D)||(n.formData.EntityID=D),u(D)}),_("change",function(D){return p(d),u(n.getEntityName(D))}),M(23,Td,3,5,"ng-template",15),a()(),C(24,wd,4,0,"div",16),a()()()(),r(25,"div",17)(26,"div",8)(27,"h5",9),s(28,"Upload File"),a(),r(29,"small",10),s(30,".csv format"),a()(),r(31,"div",18),C(32,Md,1,2,"POS-uppy",19),C(33,Ed,1,2,"POS-uppy",19),a()()(),r(34,"mat-step",20),M(35,Od,2,0,"ng-template",6),r(36,"div")(37,"mat-tab-group",21),_("selectedIndexChange",function(D){return p(d),u(n.onTabChange(D))}),g(38,"mat-tab",22)(39,"mat-tab",22)(40,"mat-tab",22)(41,"mat-tab",22),a(),r(42,"table",23),_("matSortChange",function(D){return p(d),u(n.sortData(D))}),r(43,"thead",24)(44,"tr")(45,"th",25),s(46,"No"),a(),r(47,"th",26),s(48," Product "),a(),r(49,"th",27),s(50," Variant "),a(),r(51,"th",28),s(52,"Code"),a(),r(53,"th",29),s(54," Expected "),a(),r(55,"th",30),s(56,"Counted"),a(),C(57,Ad,2,0,"th",31),C(58,kd,2,0,"th",32),C(59,Vd,2,0,"th"),a()(),r(60,"tbody"),N(61,Qd,17,13,"tr",null,Z),a()()()(),r(63,"mat-step",33),M(64,Bd,2,0,"ng-template",6),r(65,"div",34),g(66,"i",35),r(67,"h1",36),s(68,"Adjustment Complete!"),a(),r(69,"h6",37),s(70),a()()()()()()}o&2&&(c("pageData",n.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),l(3),f(n.state=="upload"&&n.fileImport?3:-1),l(),f(n.state=="preview"?4:-1),l(),f(n.state=="finish"?5:-1),l(2),c("linear",!0),l(3),c("editable",!n.uploaded)("completed",!1),l(12),c("items",n.pageData.Entities)("clearable",!1),w("ngModel",n.formData.EntityID),l(2),f(n.role.adjustment.Create||n.role.adjustment.Edit?24:-1),l(8),f(n.uploadState()===n.uploadStateEnum.Idle||n.uploadState()===n.uploadStateEnum.Uploading?32:-1),l(),f(n.uploadState()===n.uploadStateEnum.Success||n.uploadState()===n.uploadStateEnum.Error?33:-1),l(),c("editable",!n.uploaded)("completed",!1),l(3),c("selectedIndex",n.selectedTabIndex),l(),c("label",de("Unmatched (",n.summaryData.Updated,")")),l(),c("label",de("Matched (",n.summaryData.NoChanges,")")),l(),c("label",de("All (",n.summaryData.Total,")")),l(),c("label",de("Error (",n.summaryData.Error,")")),l(16),f(n.importedDataState!="matched"?57:-1),l(),f(n.role.product.Cost&&n.importedDataState=="unmatched"?58:-1),l(),f(n.importedDataState=="error"||n.importedDataState=="all"?59:-1),l(2),F(n.filteredData),l(9),Xi(" ",n.summaryData.Total," items with ",n.summaryData.Updated," unmatched & ",n.summaryData.NoChanges," matched quantities imported. "))},dependencies:[Nt,ct,at,H,tt,pt,jn,Vn,Nn,No,Qe,Be,Ze,uo,_o,vo,q,lo],styles:[".sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{top:48px!important}"]})};var Hd=i=>({ID:i});function Wd(i,e){if(i&1){let t=v();r(0,"button",4),_("click",function(){p(t);let n=m();return u(n.openExportModal())}),g(1,"i",5),s(2," Export "),a()}}function qd(i,e){if(i&1){let t=v();r(0,"div",6)(1,"h6"),s(2,"Outlets"),a(),r(3,"outlet-selector",7),T("ngModelChange",function(n){p(t);let d=m();return P(d.pageData.Filter.OutletId,n)||(d.pageData.Filter.OutletId=n),u(n)}),a(),r(4,"h6"),s(5,"Supplier"),a(),r(6,"autocompleteV2",8),T("ngModelChange",function(n){p(t);let d=m();return P(d.pageData.Filter.SupplierId,n)||(d.pageData.Filter.SupplierId=n),u(n)}),a(),r(7,"h6"),s(8,"Category"),a(),r(9,"POS-product-category-select",9),T("selectedCategoryIDChange",function(n){p(t);let d=m();return P(d.pageData.Filter.CategoryId,n)||(d.pageData.Filter.CategoryId=n),u(n)}),a()()}if(i&2){let t=m();l(3),c("accessType",2),w("ngModel",t.pageData.Filter.OutletId),c("multiple",!1)("clearable",!1),l(3),w("ngModel",t.pageData.Filter.SupplierId),l(3),w("selectedCategoryID",t.pageData.Filter.CategoryId),c("showClear",!0)}}function Gd(i,e){i&1&&(r(0,"th",16),s(1," On Hand "),a())}function zd(i,e){if(i&1&&(r(0,"td",19),s(1),a()),i&2){let t=m().$implicit;l(),S(t.OnHand)}}function $d(i,e){if(i&1&&(r(0,"tr")(1,"td")(2,"a",18),s(3),a()(),r(4,"td"),s(5),a(),r(6,"td"),s(7),x(8,"date"),a(),r(9,"td",19),s(10),a(),C(11,zd,2,1,"td",19),a()),i&2){let t=e.$implicit,o=m(2);l(2),c("queryParams",V(9,Hd,t.ID)),l(),S(t.Name),l(2),S(t.Code),l(2),S(L(8,6,t.LastCountDate,"dd MMM yyyy")),l(3),S(t.DaysSinceLastCount),l(),f(o.role.inventory.View?11:-1)}}function Kd(i,e){if(i&1){let t=v();r(0,"div",3)(1,"table",10),_("matSortChange",function(n){p(t);let d=m();return u(d.sortData(n))}),r(2,"thead",11)(3,"tr")(4,"th",12),s(5,"Name"),a(),r(6,"th",13),s(7,"Code"),a(),r(8,"th",14),s(9,"Last Count"),a(),r(10,"th",15),s(11," Days Since Last Count "),a(),C(12,Gd,2,0,"th",16),a()(),r(13,"tbody"),N(14,$d,12,11,"tr",null,Z),a()(),r(16,"POS-complex-pagination",17),_("jumpToPage",function(){p(t);let n=m();return u(n.getListData())})("previousPage",function(){p(t);let n=m();return u(n.getListData())})("nextPage",function(){p(t);let n=m();return u(n.getListData())}),a()()}if(i&2){let t=m();l(12),f(t.role.inventory.View?12:-1),l(2),F(t.data.Data),l(2),c("total",t.data.Data.length)("pageData",t.pageData)}}var xi=class i extends xt{constructor(t,o,n,d,y){super(t,o,"Adjustment/AdjustmentLastCountDate","AdjustmentLoader/AdjustmentLastCountDate",void 0,void 0,!0);this.httpService=o;this.csvConverter=n;this.roleService=d;this.matDialog=y}role=h(B);originalData=[];postInit(t){this.originalData=t.Data,this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(Lt,{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((n,d)=>{let y=t.direction==="asc",D=typeof n[t.active];switch(A.IsEmpty(n.Code)&&(n.Code=""),A.IsEmpty(d.Code)&&(d.Code=""),D){case"string":return A.compare(n[t.active].toLocaleLowerCase(),d[t.active].toLocaleLowerCase(),y);case"number":return A.compare(n[t.active],d[t.active],y);default:return 0}})}static \u0275fac=function(o){return new(o||i)(b(rt),b(U),b(kt),b(B),b(et))};static \u0275cmp=O({type:i,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,n){if(o&1){let d=v();r(0,"mainpanel-cmp",1),T("textChange",function(D){return p(d),P(n.pageData.Filter.Text,D)||(n.pageData.Filter.Text=D),u(D)}),_("onSubmit",function(){return p(d),u(n.searchFromPageOne())}),T("filterChange",function(D){return p(d),P(n.pageData.Filter,D)||(n.pageData.Filter=D),u(D)}),r(1,"actions"),C(2,Wd,3,0,"button",2),a(),r(3,"filters"),M(4,qd,10,7,"ng-template",null,0,K),a(),r(6,"content"),C(7,Kd,17,3,"div",3),a()()}o&2&&(c("pageData",n.menuData),w("text",n.pageData.Filter.Text),c("isFilterOnDropdown",!1),w("filter",n.pageData.Filter),l(2),f(n.roleService.global.Export?2:-1),l(5),f(n.data&&n.data.Data?7:-1))},dependencies:[ct,at,H,tt,zt,Kt,Qe,Be,$t,Ge,Wt],encapsulation:2})};var Jd=[{path:"Adjustment/Archive",component:Wn},{path:"Adjustment/Archive/Info",component:Qn},{path:"Adjustment/Archive/Form",component:hi,canActivate:[nr],data:{roles:[wi.adjustment.Create,wi.adjustment.Edit]}},{path:"Tools/Count_Product_Inventory",component:Zn},{path:"Tools/Convert_Inventory_to_Parent_UOM",component:Jn},{path:"Tools/Product_Sheet",component:Xn},{path:"Report/Last_Count",component:xi},{path:"Report/Adjustment",component:zn},{path:"History/Variant",component:yi},{path:"Adjustment/Stock_Take_by_Web_Spreadsheet",component:Kn},{path:"Adjustment/Stock_Take_by_CSV",component:Si},{path:"",redirectTo:"Adjustment/Archive",pathMatch:"full"}],bi=class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=Ae({type:i});static \u0275inj=Ee({imports:[un.forChild(Jd),un]})};var Wi=class i{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(n=>this.totalData=n)}setPaginationState(e,t,o){this.calcCurrentUntilPage(e,t,o),this.setPageNumber(t),this.setPaginationButtonState(e,t,o)}static \u0275fac=function(t){return new(t||i)($i(U))};static \u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ii=class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=Ae({type:i});static \u0275inj=Ee({imports:[yt]})};var vr=class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=Ae({type:i});static \u0275inj=Ee({imports:[kn,yt,bi,On,qt,En,To,pt,Xo,qe,ut,Ao,yo,Do,ut,Fo,jo,Mi,bo,He,Re,po,Mo,co,er,Mi,so,Yo,tr,Uo,Ie,Io,Ii,Je,$t,Ge,Un,Ln,Ze,go,mo,Co]})};export{vr as AdjustmentModule};