dealpos 12.52.0 → 12.52.1

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 (102) hide show
  1. package/POS/{chunk-OVBH6BOV.js → chunk-2DSMH5BN.js} +1 -1
  2. package/POS/{chunk-ISDZIASW.js → chunk-2RCTJJRA.js} +1 -1
  3. package/POS/{chunk-5XZP2QEV.js → chunk-2XBDKMJE.js} +1 -1
  4. package/POS/{chunk-42MR5OF5.js → chunk-32VSZBGW.js} +1 -1
  5. package/POS/{chunk-ZIQRFX66.js → chunk-36PJYVVR.js} +1 -1
  6. package/POS/{chunk-MWB3AV3P.js → chunk-3D6CTS7X.js} +12 -12
  7. package/POS/{chunk-WNUJRUKB.js → chunk-3GKEFQ24.js} +1 -1
  8. package/POS/{chunk-R2GVFO7M.js → chunk-4ARHGVU5.js} +1 -1
  9. package/POS/{chunk-THCVWQQ2.js → chunk-4FY76ZN7.js} +1 -1
  10. package/POS/chunk-4L23PTCC.js +1 -0
  11. package/POS/{chunk-ODCW3O52.js → chunk-4QVXJ3WU.js} +1 -1
  12. package/POS/{chunk-AHRZQ6UA.js → chunk-5BDSJYKJ.js} +1 -1
  13. package/POS/{chunk-PRZZ3AJW.js → chunk-5D4QQY6V.js} +1 -1
  14. package/POS/{chunk-LDNLMJYA.js → chunk-5HOIGLPJ.js} +1 -1
  15. package/POS/{chunk-CR3DYGF5.js → chunk-5OQZTTSW.js} +1 -1
  16. package/POS/{chunk-QIFWIC5D.js → chunk-6QLFOLMP.js} +1 -1
  17. package/POS/{chunk-B55WMLX3.js → chunk-6TPZ4R5I.js} +1 -1
  18. package/POS/{chunk-OXTNXOH5.js → chunk-7JAEU6VU.js} +1 -1
  19. package/POS/{chunk-KE6KJLWT.js → chunk-7TE4GUAM.js} +1 -1
  20. package/POS/{chunk-5ULENH4L.js → chunk-7YXEVRGT.js} +1 -1
  21. package/POS/{chunk-Q7NAK6G4.js → chunk-A537BNZW.js} +1 -1
  22. package/POS/{chunk-R443G43I.js → chunk-ADKAERSZ.js} +1 -1
  23. package/POS/{chunk-ITRUHUCX.js → chunk-AKVNPJCS.js} +1 -1
  24. package/POS/{chunk-QP4XZPE6.js → chunk-AWU3GK57.js} +1 -1
  25. package/POS/{chunk-IIFUD4VJ.js → chunk-AZWALVHL.js} +1 -1
  26. package/POS/{chunk-UORRXF5J.js → chunk-BKUX2DAM.js} +1 -1
  27. package/POS/{chunk-T6KMXDSR.js → chunk-BWZ77537.js} +1 -1
  28. package/POS/{chunk-FYKFFQYW.js → chunk-C7IA22KK.js} +1 -1
  29. package/POS/{chunk-ZLQQAXFU.js → chunk-CFEEVAP3.js} +1 -1
  30. package/POS/{chunk-6CWCTJVY.js → chunk-CVXJYV2X.js} +1 -1
  31. package/POS/{chunk-WQ6NTLMM.js → chunk-D45O3OVS.js} +1 -1
  32. package/POS/{chunk-52QXQ5MF.js → chunk-DEFH43L3.js} +1 -1
  33. package/POS/{chunk-GLENH33C.js → chunk-DUX4ZG36.js} +1 -1
  34. package/POS/{chunk-4V5JH5C5.js → chunk-EPKCPHFH.js} +1 -1
  35. package/POS/{chunk-5IDMD2TN.js → chunk-F342IX5U.js} +1 -1
  36. package/POS/{chunk-NIZMJYNM.js → chunk-GWXGX5LC.js} +1 -1
  37. package/POS/{chunk-AO2OOE2K.js → chunk-HGZ4LBCW.js} +1 -1
  38. package/POS/{chunk-KFFPB72T.js → chunk-HTETVGPG.js} +1 -1
  39. package/POS/{chunk-LEYBL4JR.js → chunk-HWIAAISN.js} +1 -1
  40. package/POS/{chunk-JA5X3L2K.js → chunk-I4HZM5WC.js} +1 -1
  41. package/POS/{chunk-H54FFX7L.js → chunk-IM7IOXO5.js} +1 -1
  42. package/POS/{chunk-AIGWG7DO.js → chunk-IU6EI7OU.js} +1 -1
  43. package/POS/{chunk-R2CFUHKP.js → chunk-IUCIZR5M.js} +1 -1
  44. package/POS/{chunk-AAJJTCWS.js → chunk-IYICRHHB.js} +1 -1
  45. package/POS/chunk-JQBIJCHX.js +1 -0
  46. package/POS/{chunk-MREOSDN3.js → chunk-JVUALT43.js} +1 -1
  47. package/POS/{chunk-2YZRS3XN.js → chunk-KE6IDDXZ.js} +1 -1
  48. package/POS/{chunk-UEHSZ3M4.js → chunk-KKJHA2JC.js} +1 -1
  49. package/POS/{chunk-5JLR66E6.js → chunk-KSHVJNKC.js} +1 -1
  50. package/POS/{chunk-URLIP64N.js → chunk-KTHB53TU.js} +1 -1
  51. package/POS/{chunk-JIGOKZAX.js → chunk-KTT25ENN.js} +2 -2
  52. package/POS/{chunk-LPS4RIEU.js → chunk-LPG36SB2.js} +1 -1
  53. package/POS/{chunk-DAZPNZ2C.js → chunk-LWUA4MGB.js} +1 -1
  54. package/POS/{chunk-OSQ462QS.js → chunk-LY4YXADZ.js} +1 -1
  55. package/POS/{chunk-UPDOOKO2.js → chunk-MJYAQVTY.js} +1 -1
  56. package/POS/{chunk-WVZZE6HK.js → chunk-MOO5CATC.js} +1 -1
  57. package/POS/{chunk-2YLYX3UV.js → chunk-MXWU5MKT.js} +1 -1
  58. package/POS/chunk-N6IZI3VC.js +1 -0
  59. package/POS/{chunk-6LE6O5YE.js → chunk-NCREVKQX.js} +1 -1
  60. package/POS/{chunk-2QFIMSIL.js → chunk-NGVZIY5X.js} +1 -1
  61. package/POS/{chunk-7NTVE3DK.js → chunk-NODGYDGE.js} +1 -1
  62. package/POS/{chunk-B7NPCY7N.js → chunk-NTOSB6FI.js} +1 -1
  63. package/POS/chunk-OO43TXPZ.js +1 -0
  64. package/POS/{chunk-WRZKRC2A.js → chunk-Q2EXQNQP.js} +1 -1
  65. package/POS/{chunk-IZ6TX3BF.js → chunk-QYQNZWZJ.js} +3 -3
  66. package/POS/{chunk-YRQ5S7QT.js → chunk-QZW6EZ2B.js} +1 -1
  67. package/POS/{chunk-U4UF7S75.js → chunk-R4I5ZHAX.js} +1 -1
  68. package/POS/{chunk-ZAF7OUGN.js → chunk-RK6BNF5A.js} +1 -1
  69. package/POS/{chunk-F4EIM2AS.js → chunk-S57OVLMZ.js} +1 -1
  70. package/POS/{chunk-TVHIXD5S.js → chunk-S6KPXGME.js} +1 -1
  71. package/POS/{chunk-Y7RSZKFY.js → chunk-S76H45V3.js} +1 -1
  72. package/POS/{chunk-G5MMWWPD.js → chunk-T6BQTI5X.js} +1 -1
  73. package/POS/{chunk-UHRVAZUK.js → chunk-T6DVN3HI.js} +1 -1
  74. package/POS/{chunk-UOINO35O.js → chunk-TCJKRAHM.js} +1 -1
  75. package/POS/{chunk-LONYCGO5.js → chunk-TCXI56RD.js} +1 -1
  76. package/POS/{chunk-UNSDVGD6.js → chunk-TGDCKTIM.js} +1 -1
  77. package/POS/chunk-TI5WX2EE.js +1 -0
  78. package/POS/{chunk-CPHINLDP.js → chunk-TVQ7PTOC.js} +1 -1
  79. package/POS/{chunk-OAX7DPKZ.js → chunk-UXETJ7AB.js} +1 -1
  80. package/POS/{chunk-IXTU4QYY.js → chunk-W3PGZJFY.js} +1 -1
  81. package/POS/{chunk-3HM7Q5B6.js → chunk-WHXPRJOL.js} +1 -1
  82. package/POS/{chunk-EIU3ADII.js → chunk-WPH5RZM4.js} +1 -1
  83. package/POS/{chunk-OQSLVAT2.js → chunk-WSTLX7UN.js} +1 -1
  84. package/POS/{chunk-X76DMFHT.js → chunk-WWFQLVW3.js} +1 -1
  85. package/POS/{chunk-NT2JCZHZ.js → chunk-XABBXTA2.js} +1 -1
  86. package/POS/{chunk-U3J6NJI5.js → chunk-XK6ITTTC.js} +1 -1
  87. package/POS/{chunk-SFWW2T6B.js → chunk-XRVM23TQ.js} +1 -1
  88. package/POS/{chunk-WNYR7RCT.js → chunk-XSWJHGXE.js} +1 -1
  89. package/POS/{chunk-XXFUJGYM.js → chunk-XVDCTYR3.js} +1 -1
  90. package/POS/{chunk-LFEL6R2P.js → chunk-XZYRAWBN.js} +1 -1
  91. package/POS/{chunk-5NCVA4ZW.js → chunk-Y2YVENIM.js} +1 -1
  92. package/POS/{chunk-27U2GMKT.js → chunk-YWEUUIJF.js} +1 -1
  93. package/POS/{chunk-FV6JZBA3.js → chunk-ZJVTPPH5.js} +1 -1
  94. package/POS/{chunk-GUAQ46UI.js → chunk-ZQMUOCWD.js} +1 -1
  95. package/POS/index.html +2 -2
  96. package/POS/{main-FDWYRPH4.js → main-TLJSTSGH.js} +2 -2
  97. package/package.json +1 -1
  98. package/POS/chunk-BCNEWREV.js +0 -1
  99. package/POS/chunk-HNYKE4MC.js +0 -1
  100. package/POS/chunk-KW5XQ5IO.js +0 -1
  101. package/POS/chunk-L4LNYNKZ.js +0 -1
  102. package/POS/chunk-NMAJNBIY.js +0 -1
@@ -1 +1 @@
1
- import{a as co,b as Un,c as uo}from"./chunk-UEHSZ3M4.js";import{a as Ni}from"./chunk-2D6AJCCH.js";import{a as Jr,b as Yr,e as Zr,f as Xr,g as to}from"./chunk-EQKSYTBR.js";import{a as Fn}from"./chunk-COVPZF4Z.js";import{a as eo,b as no,c as io,d as ro,e as oo,f as lo,g as mo}from"./chunk-YRQ5S7QT.js";import{a as ao,b as so}from"./chunk-ETKYYEM2.js";import{b as po}from"./chunk-4IZCH5PU.js";import{a as qe}from"./chunk-WQ6NTLMM.js";import{a as Ir}from"./chunk-UHRVAZUK.js";import{d as Or}from"./chunk-QOQ4422I.js";import"./chunk-FA5KQFWN.js";import"./chunk-EUYFJAW4.js";import"./chunk-UFWLNPUY.js";import{a as Ut}from"./chunk-F2CR4KZD.js";import{G as Fr}from"./chunk-IZ6TX3BF.js";import"./chunk-K7ACLCRR.js";import"./chunk-TK5H65DN.js";import"./chunk-B5FODXLM.js";import"./chunk-RRQI7YBE.js";import"./chunk-H3I3GRUR.js";import"./chunk-6L6CIH5M.js";import"./chunk-U4HBO4PN.js";import"./chunk-VPN73SCD.js";import{a as kr,b as Ar,c as Nr,d as Nn,e as Vr}from"./chunk-JS26GJEU.js";import"./chunk-QPKQUNM5.js";import"./chunk-BYXBJQAS.js";import"./chunk-B74H5XQ5.js";import"./chunk-QP4XZPE6.js";import"./chunk-3LKE4M2Q.js";import{a as $e}from"./chunk-Q7NAK6G4.js";import{a as dr}from"./chunk-UDC33BP5.js";import{a as Br,b as Hr,c as Wr,d as qr,e as Gr,f as $r}from"./chunk-ODCW3O52.js";import{a as Qr}from"./chunk-CPHINLDP.js";import{a as zr}from"./chunk-Y6WXQQCF.js";import{a as Rr}from"./chunk-K4MGWXRR.js";import"./chunk-UU2VZEN6.js";import"./chunk-JA5X3L2K.js";import{b as Ai}from"./chunk-PBE32ALY.js";import{a as Vn}from"./chunk-IXTU4QYY.js";import"./chunk-HKZ3AKPN.js";import"./chunk-SE7OFLAL.js";import{e as Ur}from"./chunk-KFFPB72T.js";import"./chunk-JD3LIVDP.js";import"./chunk-IVVVY7GV.js";import"./chunk-ZAF7OUGN.js";import{b as jr}from"./chunk-UPDOOKO2.js";import{a as Ge,b as ze}from"./chunk-WC6HLOBJ.js";import"./chunk-U4UF7S75.js";import"./chunk-MFKUC5BJ.js";import{o as Tr,r as Ce,s as Er}from"./chunk-R2CFUHKP.js";import"./chunk-KSWCXLZI.js";import"./chunk-UOINO35O.js";import{a as ye}from"./chunk-XHXNLFB7.js";import{a as Kr}from"./chunk-CVIX55UC.js";import"./chunk-UJT2GQJV.js";import"./chunk-2VGPHBTP.js";import{a as ve,c as Lr}from"./chunk-AI2WO2YW.js";import"./chunk-BYXBJQAS.js";import{a as pt}from"./chunk-DBT3YELG.js";import{a as _o}from"./chunk-Y2ZKUKT6.js";import"./chunk-WMU7MFFB.js";import{a as ia,b as ur}from"./chunk-SDJWEMMQ.js";import{a as xr}from"./chunk-R443G43I.js";import{g as kn}from"./chunk-T6KMXDSR.js";import"./chunk-KT3HZU73.js";import"./chunk-T2XW5RF3.js";import"./chunk-JF4O25LX.js";import{a as We,b as Mr}from"./chunk-URLIP64N.js";import{d as jn,e as wr}from"./chunk-WYU4GNGH.js";import{a as br,b as Wt}from"./chunk-SFWW2T6B.js";import{a as _r,b as gr,c as fr}from"./chunk-YVIR7KBQ.js";import{a as Ft}from"./chunk-2YLYX3UV.js";import"./chunk-Y7RSZKFY.js";import"./chunk-DNE54I3O.js";import"./chunk-AAHXYSYV.js";import{a as Cr,c as Pn,e as wn,f as yr}from"./chunk-LNARSB7D.js";import"./chunk-LH34DZDB.js";import"./chunk-ZH3LHPKO.js";import{a as Qe,b as Mt}from"./chunk-SIEUNTYO.js";import{a as An}from"./chunk-7NTVE3DK.js";import{b as lt,c as He}from"./chunk-NIZMJYNM.js";import"./chunk-ISDZIASW.js";import{a as _e}from"./chunk-JDA7MLPJ.js";import{h as hr,m as Be,n as En}from"./chunk-6LE6O5YE.js";import"./chunk-VUGL7GL5.js";import{a as it}from"./chunk-LDNLMJYA.js";import{a as Mn,b as st,h as he,l as Dr,n as Pr}from"./chunk-THCVWQQ2.js";import{a as ht,b as Ct,c as jt}from"./chunk-4EC5VQVC.js";import{a as Ht,b as cr}from"./chunk-7ZPEQH6S.js";import{R as Tn,a as gt,b as ge,c as ft,k as fe,r as Sr}from"./chunk-7QOX2YTK.js";import{K as mr,la as pr}from"./chunk-RKUZE4SA.js";import"./chunk-QIFWIC5D.js";import"./chunk-UJBDZYC5.js";import{a as vr,e as wt,f as On}from"./chunk-53ZY7AX4.js";import"./chunk-5ZJO3PQ6.js";import"./chunk-44LJSYN6.js";import"./chunk-66WVYR24.js";import{a as tt}from"./chunk-2FWFPV5I.js";import{B as Re,C as de,D as ue,b as sr,c as at,h as U,i as Ve,l as Fe,n as J,r as Dn,s as Ue,t as Le}from"./chunk-7UM6XERA.js";import{a as ar}from"./chunk-UORRXF5J.js";import{a as lr}from"./chunk-OAX7DPKZ.js";import{a as _n,b as R}from"./chunk-MVWDLLHY.js";import{a as w}from"./chunk-C34GKBAP.js";import{b as j}from"./chunk-OSQ462QS.js";import{$ as rt,$a as ct,$b as S,Aa as Pt,Bb as v,C as W,Ca as et,Da as tr,Dc as xn,Eb as g,G as Oe,Gb as c,H as ae,Hd as ce,Jb as ir,Jd as Nt,Kb as rr,Kd as ut,Lc as Ae,Md as un,N as Te,Na as L,Nc as K,Oa as se,Ob as pn,Oc as F,Od as _t,Pb as cn,Qa as Vt,Qb as dn,S as Zi,Sa as l,Ta as C,Tc as me,U as In,Ub as yt,Vb as m,Vc as pe,Wb as b,Xb as M,Xc as nt,Y as Z,Ya as er,Yb as le,_c as Ne,ac as x,ba as N,bc as D,bd as or,c as ot,ca as Xi,cb as dt,d as yn,dc as z,eb as _,ec as X,fa as k,fc as A,ga as Ee,gc as ke,ia as Rt,ib as p,j as Me,ja as h,jb as nr,kb as ji,mb as It,md as Sn,n as vn,na as P,nc as I,o as bn,oa as je,oc as O,pc as Q,qb as re,r as bt,s as xe,sb as ki,tb as ln,tc as $,ua as d,ub as mn,va as u,vb as o,wb as a,xb as f,yb as q,zb as G}from"./chunk-ZCFRJGRH.js";import{a as V,b as Y,g as Ei,j as Cn}from"./chunk-LHUGHE24.js";var oa=()=>["/menu/Adjustment/Adjustment/Archive/Form/V2"],fn=r=>({ID:r}),go=()=>["/print/Adjustment"],fo=(r,e)=>({"text-success":r,"text-danger":e}),aa=(r,e)=>({"text-danger":r,"text-success":e});function sa(r,e){if(r&1){let t=v();o(0,"div",24)(1,"button",25),g("click",function(){d(t);let i=c(2);return u(i.reject())}),f(2,"i",26),m(3,"Reject"),a(),o(4,"button",25),g("click",function(){d(t);let i=c(2);return u(i.accept())}),f(5,"i",27),m(6,"Accept "),a()()}}function la(r,e){if(r&1&&(o(0,"a",28),f(1,"i",29),m(2,"Edit "),a()),r&2){let t=c(2);p("routerLink",X(2,oa))("queryParams",A(3,fn,t.data.ID))}}function ma(r,e){if(r&1){let t=v();o(0,"button",25),g("click",function(){d(t);let i=c(2);return u(i.delete())}),f(1,"i",30),m(2,"Delete "),a()}}function pa(r,e){if(r&1&&(o(0,"div",31),I(1,"date"),m(2),I(3,"date"),a()),r&2){let t=c(2);ir("title",Q(1,3,t.data.Adjustment.ReviewDate,"dd MMM yyyy HH:mm")),l(2),le("(",t.data.Adjustment.ReviewName," : ",Q(3,6,t.data.Adjustment.ReviewDate,"dd MMM yyyy"),")")}}function ca(r,e){if(r&1&&(o(0,"tr")(1,"th"),m(2,"Journal Link"),a(),o(3,"td"),m(4,":"),a(),o(5,"td")(6,"a",32),m(7,"View Journal"),a()()()),r&2){let t=c(2);l(6),rr("href","https://accounting.dealpos.app/pages/journal-entry;TransID=",t.data.ID,"",se)}}function da(r,e){if(r&1){let t=v();o(0,"a",50),g("click",function(){d(t);let i=c(3);return u(i.exportCSV(i.csvConverter,"Adjustment/AdjustmentInfoExport","Adjustment#"+i.data.Adjustment.Number+".csv"))}),m(1,"Export"),a()}}function ua(r,e){r&1&&(q(0),o(1,"th",51),m(2,"Qty"),a(),G())}function _a(r,e){r&1&&(o(0,"th",51),m(1,"Expected"),a(),o(2,"th",51),m(3,"Counted"),a())}function ga(r,e){r&1&&(o(0,"th",52),m(1," Cost "),a())}function fa(r,e){r&1&&(o(0,"th",52),m(1," Price "),a())}function ha(r,e){if(r&1&&(q(0),f(1,"p",57),G()),r&2){let t=c().$implicit;l(),p("innerHTML",t.Note,L)}}function Ca(r,e){if(r&1&&(q(0),o(1,"td",58),m(2),a(),G()),r&2){let t=c().$implicit;l(),It(ke(3,fo,t.Quantity>0,t.Quantity<0)),l(),M(" ",t.Quantity," ")}}function ya(r,e){if(r&1&&(o(0,"td",58),m(1),a(),o(2,"td",58),m(3),a()),r&2){let t=c().$implicit;l(),M(" ",t.Actual," "),l(),It(ke(4,aa,t.Actual>t.Counted,t.Actual<t.Counted)),l(),M(" ",t.Counted," ")}}function va(r,e){if(r&1&&(f(0,"td",59),I(1,"number")),r&2){let t=c().$implicit;p("innerHTML",O(1,1,t.UnitCost),L)}}function ba(r,e){if(r&1&&(f(0,"td",59),I(1,"number")),r&2){let t=c().$implicit;p("innerHTML",O(1,1,t.UnitPrice),L)}}function Ia(r,e){if(r&1&&(o(0,"tr"),f(1,"td",53),o(2,"td")(3,"a",54),m(4),a(),o(5,"div"),m(6),a(),f(7,"app-serial-note",55),_(8,ha,2,1,"ng-container",20),a(),_(9,Ca,3,6,"ng-container",43)(10,ya,4,7,"ng-template",null,1,$)(12,va,2,3,"td",56)(13,ba,2,3,"td",56),a()),r&2){let t=e.$implicit,n=e.index,i=yt(11),s=c(3);l(),p("innerHTML",n+1+".",L),l(2),p("queryParams",A(10,fn,t.VariantID)),l(),b(t.Name),l(2),b(t.Code),l(),p("serials",t.Serial),l(),p("ngIf",t.Note!=null),l(),p("ngIf",s.data.Adjustment.StateID==4||s.data.Adjustment.StateID==2||s.data.Adjustment.TypeID==1)("ngIfElse",i),l(3),p("ngIf",s.roleService.product.Cost),l(),p("ngIf",s.roleService.sell.PriceVisible)}}function xa(r,e){if(r&1&&(o(0,"td",60)(1,"b"),m(2),I(3,"sum"),I(4,"number"),a()()),r&2){let t=c(3);l(2),b(O(4,4,Q(3,1,t.data.DifferencesArray,"TotalCost")))}}function Sa(r,e){if(r&1&&(o(0,"td",61)(1,"b"),m(2),I(3,"sum"),I(4,"number"),a()()),r&2){let t=c(3);l(2),b(O(4,4,Q(3,1,t.data.DifferencesArray,"TotalPrice")))}}function Da(r,e){if(r&1&&(o(0,"div",11)(1,"div",33)(2,"div")(3,"h2"),m(4),a()(),o(5,"div",34)(6,"a",35),f(7,"i",36),m(8,"Print "),a(),_(9,da,2,0,"a",37),a()(),o(10,"div",14)(11,"div",38)(12,"table",39)(13,"thead",40)(14,"tr")(15,"th",41),m(16,"No"),a(),o(17,"th",42),m(18,"Name"),a(),_(19,ua,3,0,"ng-container",43)(20,_a,4,0,"ng-template",null,0,$)(22,ga,2,0,"th",44)(23,fa,2,0,"th",44),a()(),o(24,"tbody"),_(25,Ia,14,12,"tr",45),a(),o(26,"tfoot")(27,"tr")(28,"td",46)(29,"b"),m(30,"Total :"),a()(),o(31,"td",47)(32,"b"),m(33),I(34,"sum"),I(35,"number"),a()(),_(36,xa,5,6,"td",48)(37,Sa,5,6,"td",49),a()()()()()()),r&2){let t=yt(21),n=c(2);l(4),le(" ",n.data.Adjustment.StateID==2||n.data.Adjustment.TypeID==1||n.data.Adjustment.StateID==4&&n.data.Adjustment.TypeID==2?"Adjusted":"Counted"," Inventory (",n.data.DifferencesArray.length," SKU) "),l(2),p("routerLink",X(19,go))("queryParams",A(20,fn,n.paramId)),l(3),p("ngIf",n.roleService.global.Export&&n.data.Adjustment.StateID==4),l(10),p("ngIf",n.data.Adjustment.StateID==4||n.data.Adjustment.StateID==2||n.data.Adjustment.TypeID==1)("ngIfElse",t),l(3),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.sell.PriceVisible),l(2),p("ngForOf",n.data.DifferencesArray),l(3),p("colSpan",n.data.Adjustment.StateID==4||n.data.Adjustment.StateID==2||n.data.Adjustment.TypeID==1?2:3),l(5),b(O(35,17,Q(34,14,n.data.DifferencesArray,"Counted"))),l(3),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.sell.PriceVisible)}}function Pa(r,e){if(r&1&&(o(0,"h2"),m(1),a()),r&2){let t=c(3);l(),M(" Counted Inventory (",t.data.CountedArray.length," SKU) ")}}function wa(r,e){if(r&1){let t=v();o(0,"a",50),g("click",function(){d(t);let i=c(3);return u(i.exportCSV(i.csvConverter,"Adjustment/AdjustmentCountedExport","Adjustment_Counted#"+i.data.Adjustment.Number+".csv"))}),f(1,"i",63),m(2,"Export"),a()}}function Ma(r,e){if(r&1&&(o(0,"tr"),f(1,"td",53),o(2,"td")(3,"a",54),m(4),a(),o(5,"div"),m(6),a()(),o(7,"td",58),m(8),a(),o(9,"td",58),m(10),a(),o(11,"td",58),m(12),a()()),r&2){let t=e.$implicit,n=e.index;l(),p("innerHTML",n+1+".",L),l(2),p("queryParams",A(9,fn,t.VariantID)),l(),b(t.Name),l(2),b(t.Code),l(2),b(t.Counted),l(2),b(t.Actual),l(),It(ke(11,fo,t.Difference>0,t.Difference<0)),l(),M(" ",t.Difference," ")}}function Oa(r,e){if(r&1&&(o(0,"div",11)(1,"div",33)(2,"div"),_(3,Pa,2,1,"h2",20),a(),o(4,"div",34)(5,"a",35),f(6,"i",36),m(7,"Print "),a(),_(8,wa,3,0,"a",37),a()(),o(9,"div",14)(10,"div",38)(11,"table",39)(12,"thead",40)(13,"tr")(14,"th",41),m(15,"No"),a(),o(16,"th",42),m(17,"Name"),a(),o(18,"th",62),m(19,"Expected"),a(),o(20,"th",62),m(21,"Counted"),a(),o(22,"th",62),m(23,"Difference"),a()()(),o(24,"tbody"),_(25,Ma,13,14,"tr",45),a()()()()()),r&2){let t=c(2);l(3),p("ngIf",t.data.CountedArray.length>0&&t.data.Adjustment.TypeID==2),l(2),p("routerLink",X(5,go))("queryParams",A(6,fn,t.paramId)),l(3),p("ngIf",t.roleService.global.Export&&t.data.Adjustment.StateID==4),l(17),p("ngForOf",t.data.CountedArray)}}function Ta(r,e){if(r&1&&(o(0,"mainpanel-cmp",3)(1,"actions"),_(2,sa,7,0,"div",4),o(3,"div",5),_(4,la,3,5,"a",6)(5,ma,3,0,"button",7),a()(),o(6,"content")(7,"div",8)(8,"div",9)(9,"div",10)(10,"div",11)(11,"div",12)(12,"div"),f(13,"h2",13),a()(),o(14,"div",14)(15,"table",15)(16,"tr")(17,"th"),m(18,"Date"),a(),o(19,"td"),m(20,":"),a(),f(21,"td",13),a(),o(22,"tr")(23,"th"),m(24,"PIC"),a(),o(25,"td"),m(26,":"),a(),f(27,"td",13),a(),o(28,"tr")(29,"th"),m(30,"Type"),a(),o(31,"td"),m(32,":"),a(),f(33,"td",13),a(),o(34,"tr")(35,"th",16),m(36,"State"),a(),o(37,"td",16),m(38,":"),a(),o(39,"td",17),f(40,"span",18),_(41,pa,4,9,"div",19),a()(),o(42,"tr")(43,"th"),m(44,"Note"),a(),o(45,"td"),m(46,":"),a(),f(47,"td",13),a(),_(48,ca,8,2,"tr",20),a()()()(),o(49,"div",21),_(50,Da,38,22,"div",22)(51,Oa,26,8,"div",22),a()(),f(52,"pos-footer-alert",23),a()()()),r&2){let t=c();p("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),p("ngIf",!t.toggleAccRej),l(2),p("ngIf",t.roleService.adjustment.Edit&&t.data.Adjustment.TypeID!=2&&t.data.Adjustment.StateID!=3),l(),p("ngIf",t.roleService.adjustment.Delete),l(8),p("innerHTML",t.data.Adjustment.OutletName,L),l(8),p("innerHTML",t.data.Adjustment.Date,L),l(6),p("innerHTML",t.data.Adjustment.PIC,L),l(6),p("innerHTML",t.data.Adjustment.TypeLabel,L),l(7),p("innerHTML",t.data.Adjustment.StateLabel,L),l(),p("ngIf",t.data.Adjustment.ReviewName),l(6),p("innerHTML",t.data.Adjustment.Note,L),l(),p("ngIf",t.data.AppsAccoutingActive&&t.roleService.accounting.View),l(2),p("ngIf",t.data.DifferencesArray.length>0),l(),p("ngIf",(t.data.CountedArray==null?null:t.data.CountedArray.length)>0&&t.data.Adjustment.TypeID==2),l(),p("created",t.data.CreatedInfo.Created)("modified",t.data.CreatedInfo.Modified)}}var Ln=class r extends Ft{constructor(t,n,i,s,y,E,mt){super(t,n,"Adjustment/AuditInventoryAdjustmentInfo",null,null,s);this.toastr=i;this.csvConverter=y;this.router=E;this.roleService=mt;this.initQueryParam()}paramId;toggleAccRej=!1;isEditable=!1;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.toggleAccRej=!1:this.toggleAccRej=!0,(this.data.Adjustment.StateID==1||this.data.Adjustment.StateID==2)&&(this.isEditable=!0)}exportCSV(t,n,i){this.httpService.get(`/api/${n}`,[{key:"ID",value:this.paramId}]).subscribe(s=>{t.convertToCSV(s,i)})}reject(){if(!confirm("Are you sure you want to reject this?"))return;let t={ID:this.data.Adjustment.ID};this.httpService.post("/API/Adjustment/RejectCountedItem",t).subscribe({next:n=>{this.toastr.success("Success reject adjustment",tt.Success),this.toggleAccRej=!0,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:n=>{this.toastr.success("Success accept adjustment",tt.Success),this.toggleAccRej=!0,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.",tt.Success),this.router.navigate(["/menu/Adjustment/Adjustment/Archive"])})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(_t),C(ce),C(Ut),C(Nt),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-adjustment-info"]],features:[dt],decls:1,vars:1,consts:[["NOTACC",""],["NOTACCDATA",""],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["class","btn-group me-5",4,"ngIf"],[1,"btn-group","ms-5"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-3"],[1,"card"],[1,"card-header"],[3,"innerHTML"],[1,"card-body"],[1,"table-sm","table-borderless"],[2,"padding-bottom","31px !important"],[1,"d-flex","gap-1","flex-column"],[1,"p-0",3,"innerHTML"],["class","ps-0",3,"title",4,"ngIf"],[4,"ngIf"],[1,"col-sm-9"],["class","card",4,"ngIf"],[3,"created","modified"],[1,"btn-group","me-5"],[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-trash","me-3"],[1,"ps-0",3,"title"],[3,"href"],[1,"card-header","d-flex","justify-content-between"],[1,"btn-group"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams"],[1,"fa-solid","fa-print","me-3"],["class","btn btn-outline-secondary btn-sm","role","button",3,"click",4,"ngIf"],[1,"table-responsive"],[1,"table"],[1,"thead-light"],[1,"text-center",2,"width","1px"],[2,"width","300px"],[4,"ngIf","ngIfElse"],["class","text-end","style","width: 120px",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"text-end","empty-column",3,"colSpan"],[1,"text-end","empty-column"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Cost",4,"ngIf"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Price",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"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"],["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"],[1,"fa-solid","fa-upload","me-3"]],template:function(n,i){n&1&&_(0,Ta,53,18,"mainpanel-cmp",2),n&2&&p("ngIf",i.data)},dependencies:[K,F,ut,lt,Ht,ye,Fn,nt,pe,fe]})};var ja=()=>["/menu/Adjustment/Adjustment/Archive/Form/V2"],ka=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Aa=r=>({ID:r}),Na=(r,e)=>({"text-success":r,"text-danger":e}),Va=r=>({"text-success":r}),Fa=r=>({"text-danger":r});function Ua(r,e){if(r&1){let t=v();o(0,"a",18),g("click",function(){d(t);let i=c(2);return u(i.httpPostListID("Adjustment/DeleteInventoryAdjustmentList"))}),f(1,"i",19),m(2,"Delete "),a()}}function La(r,e){if(r&1){let t=v();o(0,"button",20),g("click",function(){d(t);let i=c(2);return u(i.openExportModal())}),f(1,"i",21),m(2," Export "),a()}}function Ra(r,e){r&1&&(o(0,"a",22),m(1,"New"),a()),r&2&&p("routerLink",X(1,ja))}function Qa(r,e){if(r&1){let t=v();o(0,"div")(1,"div",23)(2,"h6"),m(3,"Outlet"),a(),o(4,"ng-select",24),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,i)||(s.pageData.Filter.EntityID=i),u(i)}),a(),o(5,"h6"),m(6,"From"),a(),o(7,"datepicker",25),D("dateChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.From,i)||(s.pageData.Filter.From=i),u(i)}),a(),o(8,"h6"),m(9,"To"),a(),o(10,"datepicker",26),D("dateChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.To,i)||(s.pageData.Filter.To=i),u(i)}),a(),o(11,"h6"),m(12,"Quantity From - To"),a(),o(13,"div",27)(14,"input",28),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.QuantityFrom,i)||(s.pageData.Filter.QuantityFrom=i),u(i)}),a(),m(15," - "),o(16,"input",28),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.QuantityTo,i)||(s.pageData.Filter.QuantityTo=i),u(i)}),a()(),o(17,"h6"),m(18,"State"),a(),o(19,"ng-select",29),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.State,i)||(s.pageData.Filter.State=i),u(i)}),a(),o(20,"h6"),m(21,"Adjustment Type"),a(),o(22,"ng-select",30),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.Type,i)||(s.pageData.Filter.Type=i),u(i)}),a(),o(23,"h6"),m(24,"Rows"),a(),o(25,"input",31),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.RowCount,i)||(s.pageData.Filter.RowCount=i),u(i)}),a(),o(26,"h6"),m(27,"Exclude Zero"),a(),o(28,"radio-options",32),D("modelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.ExcludeZero,i)||(s.pageData.Filter.ExcludeZero=i),u(i)}),a()()()}if(r&2){let t=c(2);l(4),p("items",t.pageData.Options.Entities),S("ngModel",t.pageData.Filter.EntityID),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.From),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.To),l(4),S("ngModel",t.pageData.Filter.QuantityFrom),l(2),S("ngModel",t.pageData.Filter.QuantityTo),l(3),p("items",t.pageData.Options.States),S("ngModel",t.pageData.Filter.State),l(3),p("items",t.pageData.Options.Types),S("ngModel",t.pageData.Filter.Type),l(3),S("ngModel",t.pageData.Filter.RowCount),p("max",1e4),l(3),S("model",t.pageData.Filter.ExcludeZero)}}function Ba(r,e){if(r&1){let t=v();o(0,"th",33)(1,"input",34),g("change",function(i){d(t);let s=c(2);return u(s.onSelectAllData(i.target.checked))}),a()()}}function Ha(r,e){r&1&&(o(0,"th",15),m(1,"Cost"),a())}function Wa(r,e){if(r&1){let t=v();o(0,"td")(1,"input",41),D("ngModelChange",function(i){d(t);let s=c().$implicit;return x(s.selected,i)||(s.selected=i),u(i)}),a()()}if(r&2){let t=c().$implicit;l(),S("ngModel",t.selected)}}function qa(r,e){if(r&1&&(o(0,"td",40),m(1),I(2,"quantityFraction"),a()),r&2){let t=c().$implicit;l(),M(" ",O(2,1,t.Quantity)," ")}}function Ga(r,e){if(r&1&&(o(0,"td",40),m(1),I(2,"quantityFraction"),a()),r&2){let t=c().$implicit;It(A(5,Va,t.Quantity>0)),l(),M(" +",O(2,3,t.Quantity)," ")}}function za(r,e){if(r&1&&(o(0,"td",40),m(1),I(2,"quantityFraction"),a()),r&2){let t=c().$implicit;It(A(5,Fa,t.Quantity<0)),l(),M(" ",O(2,3,t.Quantity)," ")}}function $a(r,e){if(r&1&&(o(0,"td",40),m(1),I(2,"amountFraction"),a()),r&2){let t=c().$implicit;l(),b(O(2,1,t.Cost))}}function Ka(r,e){if(r&1&&(o(0,"tr",35),_(1,Wa,2,1,"td",36),o(2,"td"),m(3),a(),o(4,"td")(5,"a",37),m(6),a()(),o(7,"td"),m(8),I(9,"date"),a(),_(10,qa,3,3,"td",38)(11,Ga,3,7,"td",39)(12,za,3,7,"td",39),o(13,"td"),m(14),a(),_(15,$a,3,3,"td",40),o(16,"td"),m(17),a(),o(18,"td"),m(19),a()()),r&2){let t=e.$implicit,n=c(2);l(),p("ngIf",n.roleService.adjustment.Delete),l(2),b(t.EntityName),l(2),p("routerLink",X(18,ka))("queryParams",A(19,Aa,t.ID)),l(),b(t.Number),l(2),b(Q(9,15,t.Date,"dd MMM yyyy")),l(2),p("ngIf",t.Quantity==0),l(),p("ngIf",t.Quantity>0),l(),p("ngIf",t.Quantity<0),l(2),b(t.TypeLabel),l(),re(!(n.roleService==null||n.roleService.product==null)&&n.roleService.product.Cost?15:-1),l(),It(ke(21,Na,t.StateID==4,t.StateID==3)),l(),M(" ",t.StateLabel," "),l(2),b(t.Note)}}function Ja(r,e){if(r&1){let t=v();o(0,"mainpanel-cmp",2),D("textChange",function(i){d(t);let s=c();return x(s.pageData.Filter.Number,i)||(s.pageData.Filter.Number=i),u(i)}),g("onSubmit",function(){d(t);let i=c();return u(i.searchFromPageOne())}),D("filterChange",function(i){d(t);let s=c();return x(s.pageData.Filter,i)||(s.pageData.Filter=i),u(i)}),o(1,"actions"),_(2,Ua,3,0,"a",3)(3,La,3,0,"button",4)(4,Ra,2,2,"a",5),a(),o(5,"filters"),_(6,Qa,29,15,"ng-template",null,0,$),a(),o(8,"content")(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr"),_(14,Ba,2,0,"th",10),o(15,"th",11),m(16,"Outlet"),a(),o(17,"th",11),m(18,"Number"),a(),o(19,"th",12),m(20,"Date"),a(),o(21,"th",13),m(22," Qty "),a(),o(23,"th",14),m(24,"Type"),a(),_(25,Ha,2,0,"th",15),o(26,"th",12),m(27,"State"),a(),o(28,"th"),m(29,"Note"),a()()(),o(30,"tbody"),_(31,Ka,20,24,"tr",16),a()()(),o(32,"POS-complex-pagination",17),g("jumpToPage",function(){d(t);let i=c();return u(i.getListData())})("previousPage",function(){d(t);let i=c();return u(i.getListData())})("nextPage",function(){d(t);let i=c();return u(i.getListData())}),a()()()()}if(r&2){let t=c();p("pageData",t.menuData),S("text",t.pageData.Filter.Number),p("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.getSelectedData().length>0),l(),p("ngIf",t.roleService.global.Export),l(),p("ngIf",t.roleService.adjustment.Create),l(10),p("ngIf",t.roleService.adjustment.Delete),l(11),re(!(t.roleService==null||t.roleService.product==null)&&t.roleService.product.Cost?25:-1),l(6),p("ngForOf",t.data.Data),l(),p("total",t.data.Data.length)("pageData",t.pageData)}}var Bn=class r extends Ft{constructor(t,n,i,s,y,E){super(t,n,"Adjustment/GetInventoryAdjustmentList","AdjustmentLoader/GetInventoryAdjustmentList",i);this.toastr=i;this.csvConverter=s;this.roleService=y;this.matDialog=E}hideMore=!1;openExportModal(){this.matDialog.open(Wt,{data:{title:"Inventory Adjustment",exportTypes:[{ID:"AdjustmentExport/GetInventoryAdjustmentList",Value:"Default",FileName:"Inventory Adjustment"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/GetInventoryAdjustmentListCount",pagination:!0}})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(_t),C(Ut),C(R),C(ft))};static \u0275cmp=P({type:r,selectors:[["POS-inventory-adjustment"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-5",3,"click",4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","button btn btn-success",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 14px",4,"ngIf"],[2,"width","120px"],[2,"width","100px"],["matTooltipPosition","above","matTooltip","Adjusted Quantity",1,"text-end",2,"width","50px"],[2,"width","130px"],[1,"text-end",2,"width","95px"],["class","border-bottom",4,"ngFor","ngForOf"],["api","Adjustment/GetInventoryAdjustmentListCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fa-solid","fa-trash","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"button","btn","btn-success",3,"routerLink"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModelChange","items","ngModel"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["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"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel","max"],[3,"modelChange","model"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom"],[4,"ngIf"],[3,"routerLink","queryParams"],["class","text-end",4,"ngIf"],["class","text-end",3,"class",4,"ngIf"],[1,"text-end"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(n,i){n&1&&_(0,Ja,33,12,"mainpanel-cmp",1),n&2&&p("ngIf",i.data)},dependencies:[K,F,ut,lt,at,sr,U,J,Ce,wt,We,jn,Mt,Ht,pe,Ir,xr]})};var Fi=(n=>(n[n.INPUT=0]="INPUT",n[n.INVENTORY=1]="INVENTORY",n[n.SERIAL=2]="SERIAL",n))(Fi||{});var Hn=(t=>(t[t.ADJUST_DIFFERENCES=1]="ADJUST_DIFFERENCES",t[t.UPDATE_INVENTORY=2]="UPDATE_INVENTORY",t))(Hn||{});var we=class{CountedItems;Items;Order;OrderItems;constructor(){this.Items=[],this.Order=new Ui}};var Ui=class{AdjustedQuantity;Bin;Created;CreatorID;Date;EntityID;EntityName;ID;Modified;ModifierID;Note;Number;PIC;Quantity;ReviewDate;ReviewerID;StateID;StateLabel;TotalPrice;TypeID;TypeLabel;UnitCost;UnitPrice;constructor(){this.ID=w.GuidEmpty,this.EntityID="",this.StateID=1,this.TypeID=1}};var Ke=class r{_Data=new yn(new we);Data$=this._Data.asObservable();get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var be=class r{constructor(e,t,n,i){this.adjustmentDataService=e;this.backEndService=t;this.factoryService=n;this.toastr=i}_notifyNewItem=new ot;notifyNewItem$=this._notifyNewItem.asObservable();getItemByCode(e,t){let n;return this.backEndService.getVarianByCode(e,t).pipe(bt(i=>{let s=this.patchVariantToItem(i);return n=s.Variant,s.Cost=n.UnitCost,s.UnitCost=n.UnitCost,s}))}getItemById(e,t){let n;return this.backEndService.getVariantById(e,t).pipe(bt(i=>{let s=this.patchVariantToItem(i);return n=s.Variant,s.Cost=n.UnitCost,s.UnitCost=n.UnitCost,s}))}patchVariantToItem(e){let t=new he;return e=this.factoryService.generateVariantObj(e),t.patchByVariantAdjustment(e),t}updateCartItem(e){let t=this.adjustmentDataService.Data;t.Items=e,this.adjustmentDataService.pushNewValue(t)}addNewItem(e,t){let n=this.checkBehaviourRowItem(e,t);this.updateCartItem(n)}addCartItemByCode(e,t){this.backEndService.getVarianByCode(e,t).subscribe(n=>{this.createNewCartItem(n,"scan")})}createNewCartItem(e,t="add"){let n=new he;n.patchByVariantAdjustment(e),t=="scan"&&(n.Cost=e.UnitCost),n.UnitPrice=e.UnitPrice,this.addNewItem(n)}removeItem(e){let t=this.adjustmentDataService.Data;t.Items.splice(e.index,1),this.updateCartItem(t.Items)}updateItem(e){let t=this.adjustmentDataService.Data.Items;t[e.index]=e.item,this.updateCartItem(t)}checkBehaviourRowItem(e,t=!1){let n=[];if(t)n=this.adjustmentDataService.Data.Items,this._notifyNewItem.next("NEW"),n.push(e);else{n=this.adjustmentDataService.Data.Items!=null?this.adjustmentDataService.Data.Items:Array();let i=n.findIndex(y=>y.VariantID===e.VariantID),s=e.Quantity;i===-1?(w.IsNotEmpty(s)?e.Quantity=s:e.Quantity=1,this._notifyNewItem.next("NEW"),n.push(e)):w.IsNotEmpty(s)?n[i].Quantity+=s:n[i].Quantity++}return n}static \u0275fac=function(t){return new(t||r)(Rt(Ke),Rt(qe),Rt(co),Rt(_t))};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var Ri=r=>({selected:r}),Ya=()=>["/menu/Products/Catalog/Variants/Info"],Za=r=>({ID:r});function Xa(r,e){if(r&1){let t=v();o(0,"a",7),g("click",function(){d(t);let i=c();return u(i.onTabChange(i.modalItemState.INVENTORY))}),m(1," Product "),a()}if(r&2){let t=c();p("ngClass",A(1,Ri,t.modalItemState.INVENTORY==t.currentStateTab))}}function ts(r,e){if(r&1&&(o(0,"div",23)(1,"div",24)(2,"div"),m(3),a(),o(4,"small",25),m(5),a()()()),r&2){let t=e.data;l(3),b(t==null?null:t.Value),l(2),b(t==null?null:t.Code)}}function es(r,e){if(r&1){let t=v();o(0,"div",21)(1,"div",18)(2,"autocompleteV2",22,1),g("onSelect",function(i){d(t);let s=c(2);return u(s.addItem(i))})("keyup.enter",function(i){return d(t),u(i.stopPropagation())})("onInputEnter",function(i){d(t);let s=c(2);return u(s.scanCode(i))}),a(),_(4,ts,6,2,"ng-template",null,2,$),a()()}if(r&2){let t=yt(5);l(2),p("renderThumbnail",!0)("useCustomTemplate",!0)("itemTemplate",t)}}function ns(r,e){if(r&1){let t=v();o(0,"div",15)(1,"h5"),m(2,"Cost"),a(),o(3,"input",16),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.item.Cost,i)||(s.item.Cost=i),u(i)}),a()()}if(r&2){let t=c(2);l(3),S("ngModel",t.item.Cost)}}function is(r,e){if(r&1){let t=v();q(0),_(1,es,6,3,"div",11),o(2,"div")(3,"div",12)(4,"div",13)(5,"h5"),m(6,"Qty"),a(),o(7,"input",14,0),D("ngModelChange",function(i){d(t);let s=c();return x(s.item.Quantity,i)||(s.item.Quantity=i),u(i)}),a()(),o(9,"div",15)(10,"h5"),m(11,"Price"),a(),o(12,"input",16),D("ngModelChange",function(i){d(t);let s=c();return x(s.item.Price,i)||(s.item.Price=i),u(i)}),a()(),_(13,ns,4,1,"div",17),a(),o(14,"div",12)(15,"div",18)(16,"h5",19),m(17,"Note"),a(),o(18,"POS-tinymce-editor",20),D("valueChange",function(i){d(t);let s=c();return x(s.item.Note,i)||(s.item.Note=i),u(i)}),a()()()(),G()}if(r&2){let t=c();l(),p("ngIf",!t.isEdit),l(6),S("ngModel",t.item.Quantity),p("decimalPlaces",t.isItemSerial?0:4)("disabled",t.isAdjustmentEdit&&t.isItemSerial&&t.constants.IsNotEmpty(t.item.ID)),l(5),S("ngModel",t.item.Price),l(),p("ngIf",t.roleService.product.Cost),l(5),S("value",t.item.Note)}}function rs(r,e){r&1&&(q(0),f(1,"i",37),o(2,"h6"),m(3,"No Image"),a(),G())}function os(r,e){if(r&1&&f(0,"img",38),r&2){let t=c(2);p("src",t.item.Variant.ThumbnailUrl,se)}}function as(r,e){if(r&1&&(q(0),o(1,"div",21)(2,"div",26)(3,"a",27),_(4,rs,4,0,"ng-container",28)(5,os,1,1,"ng-template",null,3,$),a()(),o(7,"div",29)(8,"div",30),f(9,"i",31),o(10,"div",32),m(11,"Inventory"),a()(),o(12,"table",33)(13,"tbody")(14,"tr")(15,"td",34),m(16," On Hand "),a(),o(17,"td",35),m(18),I(19,"number"),a()(),o(20,"tr")(21,"td",36),m(22," Allocated "),a(),o(23,"td",35),m(24),I(25,"number"),a()(),o(26,"tr")(27,"td",36),m(28,"Available"),a(),o(29,"td",35),m(30),I(31,"number"),a()(),o(32,"tr")(33,"td",36),m(34,"ROP"),a(),o(35,"td",35),m(36),I(37,"number"),a()(),o(38,"tr")(39,"td",36),m(40,"Max"),a(),o(41,"td",35)(42,"span"),m(43),I(44,"number"),a()()()()()()(),G()),r&2){let t=yt(6),n=c();l(3),p("routerLink",X(19,Ya))("queryParams",A(20,Za,n.item==null||n.item.Variant==null?null:n.item.Variant.ID)),l(),p("ngIf",(n.item==null||n.item.Variant==null?null:n.item.Variant.ThumbnailUrl)==null)("ngIfElse",t),l(14),M(" ",O(19,9,n.onHand)," "),l(6),M(" ",O(25,11,n.allocated)," "),l(6),M(" ",O(31,13,n.onHand-n.allocated)," "),l(6),M(" ",O(37,15,n.rop)," "),l(7),b(O(44,17,n.max))}}function ss(r,e){if(r&1){let t=v();q(0),o(1,"POS-tab-serial",39),D("variantChange",function(i){d(t);let s=c();return x(s.item,i)||(s.item=i),u(i)})("serialsChange",function(i){d(t);let s=c();return x(s.serials,i)||(s.serials=i),u(i)}),a(),G()}if(r&2){let t=c();l(),p("isEditBuyForm",!1)("outletID",t.entityID),S("variant",t.item)("serials",t.serials)}}var Wn=class r{constructor(e,t,n,i,s,y){this.httpService=e;this.toastr=t;this.data=n;this.dialogRef=i;this.cartItemService=s;this.roleService=y;this.config=new ht,this.entityID=n.entityID,this.queryInventoryOnOpen=!1,this.currentStateTab=0,this.adjusmentType=n.adjustmentType,this.isAdjustmentEdit=this.data.isAdjustmentEdit,w.IsNotEmpty(n.itemInfo)?(this.isEdit=!0,this.item=Dr(he,this.data.itemInfo.item),this.roleService.inventory.View&&this.requestUnitInStock(),this.config.title=this.item.Variant.Name,this.item.Variant.Ordered!=null&&(this.extraTitle=` Inventory: ${this.item.Variant.OnHand}, Allocated: ${this.item.Variant.Ordered}`,this.toggleInventory=!0)):(this.item=new he,this.config.title="Add Item"),this.config.customWidth="650px",this.config.bodyScrollable=!0}currentStateTab;modalItemState=Fi;onHand;allocated;rop;max;extraTitle;config;item;isEdit=!1;toggleInventory=!1;entityID;separatorKeysCodes=[13,188];constants=w;isFocusSerialInput=!1;isItemSerial=!1;serialOptions;queryInventoryOnOpen;adjusmentType;adjustmentTypeEnum=Hn;isAdjustmentEdit=!1;serials=[];ngOnInit(){this.isItemSerial=this.checkIsSerial()}onOk(e){if(!this.isFocusSerialInput){if(this.generateSerial(),this.item.isSerialType())if(this.item.checkMatchSerialWithQuantity()){if(this.item?.Serial?.length==0){this.toastr.warning("Serial is required","Warning!");return}}else{this.toastr.warning("Serial must be equal with the quantity","Warning!");return}this.isEdit?(this.item.UnitCost=this.item.Cost,this.cartItemService.updateItem({item:this.item,index:this.data.itemInfo.index})):(this.item.UnitCost=this.item.Cost,this.cartItemService.addNewItem(this.item,!0)),this.dialogRef.close()}}generateSerial(){this.isItemSerial&&(!this.item?.Serial||this.item?.Serial?.length==0)&&(this.item.Quantity=this.serials.length,this.item.Serial=this.serials.map(e=>({Quantity:1,Number:e,ExpiryDate:null})))}addItem(e){this.cartItemService.getItemById(e,this.data.entityID).subscribe(t=>{this.item=t,this.isItemSerial=this.checkIsSerial(),this.config.title=this.item.Variant.Name})}onTabChange(e){this.currentStateTab=e,e==1&&!this.queryInventoryOnOpen&&this.requestUnitInStock()}requestUnitInStock(){if(w.IsEmpty(this.entityID)){this.toastr.error("Please select outlet before proceeding..",tt.Error);return}this.httpService.get(pt.GetVariantStockByID,[{key:"ID",value:this.item.Variant.ID},{key:"EntityID",value:this.entityID}]).subscribe(e=>{this.queryInventoryOnOpen=!0,this.onHand=e.OnHand,this.allocated=e.Allocated,this.rop=e.ROP,this.max=e.Max})}scanCode(e){this.cartItemService.getItemByCode(e,this.entityID).subscribe(t=>{this.item=t,this.isItemSerial=this.checkIsSerial(),this.config.title=this.item.Variant.Name,this.toggleInventory=!1})}onFocusAddSerial(){this.isFocusSerialInput=!0}onBlurAddSerial(){this.isFocusSerialInput=!1}checkIsSerial(){return this.item.Variant!=null?this.item.Variant.TypeID==4:!1}static \u0275fac=function(t){return new(t||r)(C(j),C(_t),C(ge),C(gt),C(be),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-modal-item"]],decls:14,vars:11,consts:[["qty",""],["variant",""],["itemTemplate",""],["SHOW_IMAGE",""],[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"row","border-bottom"],[1,"btn","btn-link",3,"click","ngClass"],["class","btn btn-link",3,"ngClass","click",4,"ngIf"],[1,"container-fluid","mt-5"],[4,"ngIf"],["class","row",4,"ngIf"],[1,"row","mt-5"],[1,"col-auto"],["type","text","autoNum","",1,"mt-5","form-control",2,"width","100px",3,"ngModelChange","ngModel","decimalPlaces","disabled"],[1,"col-auto","ps-0"],["type","text","autoNum","",1,"mt-5","form-control",2,"width","100px",3,"ngModelChange","ngModel"],["class","col-auto ps-0",4,"ngIf"],[1,"col-12"],[1,"mb-5"],["height","220px",3,"valueChange","value"],[1,"row"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"onSelect","keyup.enter","onInputEnter","renderThumbnail","useCustomTemplate","itemTemplate"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink","queryParams"],[4,"ngIf","ngIfElse"],[1,"col-sm-6"],[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","border"],[1,"table-light","text-start","border-0",2,"width","100px"],[1,"text-end"],[1,"table-light","text-start","border-0"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"border","rounded",3,"src"],[3,"variantChange","serialsChange","isEditBuyForm","outletID","variant","serials"]],template:function(t,n){t&1&&(o(0,"modal-material",4),g("onOk",function(s){return n.onOk(s)})("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),o(1,"content")(2,"div",5)(3,"div",6)(4,"div")(5,"a",7),g("click",function(){return n.onTabChange(n.modalItemState.INPUT)}),m(6," Cart "),a(),_(7,Xa,2,3,"a",8),o(8,"a",7),g("click",function(){return n.onTabChange(n.modalItemState.SERIAL)}),m(9," Serial "),a()()()(),o(10,"div",9),_(11,is,19,7,"ng-container",10)(12,as,45,22,"ng-container",10)(13,ss,2,4,"ng-container",10),a()()()),t&2&&(p("config",n.config),l(5),p("ngClass",A(7,Ri,n.modalItemState.INPUT==n.currentStateTab)),l(2),p("ngIf",n.roleService.inventory.View&&(n.item==null||n.item.Variant==null?null:n.item.Variant.Name)),l(),p("ngClass",A(9,Ri,n.modalItemState.SERIAL==n.currentStateTab)),l(3),p("ngIf",n.modalItemState.INPUT==n.currentStateTab),l(),p("ngIf",n.modalItemState.INVENTORY==n.currentStateTab),l(),p("ngIf",n.modalItemState.SERIAL==n.currentStateTab))},dependencies:[Ae,F,ut,at,U,J,Be,Ct,Mt,Ge,$e,nt],styles:[".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}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}"]})};var qn=class r{constructor(e,t){this.data=e;this.dialogRef=t;this.config=new ht,this.config.title="Note",this.adjustmentData=this.data}adjustmentData;config;onOk(e){e!="Enter"&&this.dialogRef.close()}static \u0275fac=function(t){return new(t||r)(C(ge),C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-note"]],decls:9,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row"],[1,"col-12"],["type","text","placeholder","PIC",1,"text","w-100",3,"ngModelChange","ngModel"],[1,"row","mt-5"],["placeholder","Notes",2,"width","250px","height","120px",3,"ngModelChange","ngModel"]],template:function(t,n){t&1&&(o(0,"modal-material",0),g("onOk",function(s){return n.onOk(s)})("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"input",4),D("ngModelChange",function(s){return x(n.adjustmentData.Order.PIC,s)||(n.adjustmentData.Order.PIC=s),s}),a()()(),o(6,"div",5)(7,"div",3)(8,"textarea",6),D("ngModelChange",function(s){return x(n.adjustmentData.Order.Note,s)||(n.adjustmentData.Order.Note=s),s}),a()()()()()()),t&2&&(p("config",n.config),l(5),S("ngModel",n.adjustmentData.Order.PIC),l(3),S("ngModel",n.adjustmentData.Order.Note))},dependencies:[at,U,J,Ct]})};var Gn=class r{constructor(e,t,n){this.backEndService=e;this.data=t;this.dialogRef=n;this.config=new ht,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0,this.adjustmentData=this.data}adjustmentData;config;submit(e){this.adjustmentData.Items.forEach(t=>delete t.UnitPriceOriginal),this.adjustmentData.Order.StateID=e,this.backEndService.submitTransaction(this.adjustmentData,pt.SubmitAdjustment).subscribe(t=>{this.dialogRef.close(t)})}static \u0275fac=function(t){return new(t||r)(C(qe),C(ge),C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-submit"]],decls:9,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid",2,"width","500px","display","flex","justify-content","space-around"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-file-pen"],[1,"btn","btn-outline-secondary","ms-5",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-user-magnifying-glass"]],template:function(t,n){t&1&&(o(0,"modal-material",0),g("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"div",2),g("click",function(){return n.submit(1)}),f(4,"i",3),m(5," Save as Draft "),a(),o(6,"div",4),g("click",function(){return n.submit(2)}),f(7,"i",5),m(8," Submit for Review "),a()()()()),t&2&&p("config",n.config)},dependencies:[Ct]})};function ls(r,e){if(r&1){let t=v();o(0,"div",1)(1,"div",2),g("click",function(){d(t);let i=c();return u(i.openOutletModal())}),f(2,"i",3)(3,"input",4),I(4,"limitTo"),a(),o(5,"div",5)(6,"datepicker",6),D("dateChange",function(i){d(t);let s=c();return x(s.adjustmentData.Order.Date,i)||(s.adjustmentData.Order.Date=i),u(i)}),a()(),o(7,"div",7),f(8,"i",8),o(9,"input",9),D("ngModelChange",function(i){d(t);let s=c();return x(s.adjustmentData.Order.Number,i)||(s.adjustmentData.Order.Number=i),u(i)}),a()(),o(10,"div",10)(11,"ng-select",11),D("ngModelChange",function(i){d(t);let s=c();return x(s.adjustmentData.Order.TypeID,i)||(s.adjustmentData.Order.TypeID=i),u(i)}),a()()()}if(r&2){let t=c();l(3),p("value",Q(4,10,t.outletName,20))("placeholder",t.outletName),l(3),S("date",t.adjustmentData.Order.Date),p("matTooltip",t.role!=null&&t.role.Date?"":"Date role is required")("disabled",!(t.role!=null&&t.role.Date)),l(3),S("ngModel",t.adjustmentData.Order.Number),p("disabled",!(t.role!=null&&t.role.Number)),l(2),p("disabled",t.isEdit),S("ngModel",t.adjustmentData.Order.TypeID),p("items",t.adjustmentTypes)}}var zn=class r{adjustmentData;adjustmentTypes;outletName;isEdit;role;onOpenOutletModal=new et;openOutletModal(){this.onOpenOutletModal.emit()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-toolbar"]],inputs:{adjustmentData:"adjustmentData",adjustmentTypes:"adjustmentTypes",outletName:"outletName",isEdit:"isEdit",role:"role"},outputs:{onOpenOutletModal:"onOpenOutletModal"},decls:1,vars:1,consts:[["class","row header g-0 py-4 border-bottom",4,"ngIf"],[1,"row","header","g-0","py-4","border-bottom"],[1,"col-auto",3,"click"],["matTooltipPosition","above","matTooltip","Outlet",1,"fa-solid","fa-house"],["readonly","",1,"outlet","cursor",3,"value","placeholder"],[1,"col-auto","me-5","date"],["appearance","fill","matTooltipPosition","above","name","orderDate",3,"dateChange","date","matTooltip","disabled"],[1,"col-auto","me-5"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Order number",1,"fa-regular","fa-file-lines"],["type","text","placeholder","Adjustment Number",1,"number",2,"width","180px",3,"ngModelChange","ngModel","disabled"],[1,"col-auto","me-5","d-flex"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",2,"width","381px",3,"ngModelChange","disabled","ngModel","items"]],template:function(t,n){t&1&&_(0,ls,12,13,"div",0),t&2&&p("ngIf",n.adjustmentData)},dependencies:[F,at,U,J,Ce,wt,Ht,Sr],styles:[".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}.date[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{top:3px!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-form-field-flex{background-color:#e9ecef!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-form-field-flex input{opacity:1!important;color:#00000061!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field{padding-right:0!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field .mat-mdc-text-field-wrapper{padding-bottom:0;background-color:#fff;padding-left:0}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-flex{width:147px;height:35px;border:1px solid rgb(207,207,207);margin-left:40px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix{border:none!important;top:5px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix input{font-size:14px;color:#000}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-form-field-infix{padding-top:4px;padding-bottom:4px;padding-left:8px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix{position:relative;left:-140px;top:1px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix .mat-mdc-button-persistent-ripple{color:#000}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix button.mat-mdc-icon-button.mat-mdc-button-base{padding:0}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mdc-line-ripple{display:none}.date[_ngcontent-%COMP%] datepicker.date-warnings[_ngcontent-%COMP%] .mat-mdc-form-field-flex{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.small[_ngcontent-%COMP%]{margin-right:5px!important}.small[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:143px}.col-auto[_ngcontent-%COMP%]{font-size:.875rem;height:fit-content}.col-auto[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1.25rem;color:#3b3b3b;margin-right:5px;line-height:unset!important;position:relative;top:2px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .col-auto[_ngcontent-%COMP%] span.outlet[_ngcontent-%COMP%]{padding:4px 8px 3px 5px;border:1px solid #dddddd;font-size:.875rem}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:36px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:disabled{background-color:#e9ecef!important;opacity:1!important;color:#00000061!important}.col-auto[_ngcontent-%COMP%] .outlet[_ngcontent-%COMP%]{width:165px;color:#337ab7;background:#fff}.col-auto[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:150px}.col-auto.supplier[_ngcontent-%COMP%] autocompleteV2[_ngcontent-%COMP%] input{font-size:14px}"]})};var $n=class r{onSubmit=new et;onOpenVoidModal=new et;onOpenNoteModal=new et;submit(){this.onSubmit.emit()}openVoidModal(){this.onOpenVoidModal.emit()}openNoteModal(){this.onOpenNoteModal.emit()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-cart-action"]],outputs:{onSubmit:"onSubmit",onOpenVoidModal:"onOpenVoidModal",onOpenNoteModal:"onOpenNoteModal"},decls:10,vars:0,consts:[[1,"mt-5","d-flex","action-button","justify-content-between",2,"padding-left","120px"],[1,"btn","btn-gray","fw-bold","border","text-dark",2,"height","60px","width","120px",3,"click"],[1,"fa-solid","fa-note-sticky"],[1,"btn","btn-gray","fw-bold","border","text-dark","mx-5",2,"height","60px","width","120px",3,"click"],[1,"fa-solid","fa-rectangle-xmark"],[1,"btn","btn-success","d-flex","justify-content-around","align-items-center",2,"height","60px","width","200px",3,"click"],[1,"fw-bold"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"button",1),g("click",function(){return n.openNoteModal()}),f(2,"i",2),m(3," NOTE "),a(),o(4,"button",3),g("click",function(){return n.openVoidModal()}),f(5,"i",4),m(6," VOID "),a(),o(7,"button",5),g("click",function(){return n.submit()}),o(8,"span",6),m(9,"PROCESS"),a()()())},styles:[".btn-gray[_ngcontent-%COMP%]{background:linear-gradient(to bottom,#fff,#eee)}.action-button[_ngcontent-%COMP%]{width:550px}"]})};var Io=r=>({ID:r}),cs=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function ds(r,e){if(r&1&&(o(0,"div",21)(1,"div",20),m(2),a(),o(3,"div",20),m(4),I(5,"number"),a()()),r&2){let t=e.$implicit;l(2),b(t.Variant.Name),l(2),b(O(5,2,t.Quantity))}}var Kn=class r{total;cartItems;completeInfo;onUndo=new et;onNewForm=new et;undo(){this.onUndo.emit()}newForm(){this.onNewForm.emit()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-complete"]],inputs:{total:"total",cartItems:"cartItems",completeInfo:"completeInfo"},outputs:{onUndo:"onUndo",onNewForm:"onNewForm"},decls:31,vars:16,consts:[[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","bg-light-gray","py-3"],["type","button","routerLink","/print/Adjustment","target","_blank",1,"btn","btn-light-gray",3,"queryParams"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px","border-bottom","1px solid rgba(0, 0, 0, 0.125)"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body"],["class","row justify-content-between mb-5",4,"ngFor","ngForOf"],[1,"row","justify-content-between","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col","text-start"],[1,"row","justify-content-between","mb-5"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h1",4),f(5,"i",5),m(6,"Inventory Adjustment Complete"),a()(),o(7,"div",6)(8,"div",7)(9,"div",8)(10,"a",9),g("click",function(){return n.newForm()}),m(11,"New Adjustment (F8)"),a()()()(),o(12,"div",10)(13,"a",11),f(14,"i",12),m(15,"Print "),a()()()(),o(16,"div",13)(17,"div",2)(18,"div",14)(19,"h2",15)(20,"a",16),m(21),a()()(),o(22,"div",17),_(23,ds,6,4,"div",18),o(24,"div",19)(25,"div",20),m(26,"Total Quantity:"),a(),o(27,"div",20),m(28),I(29,"sum"),I(30,"number"),a()()()()()()),t&2&&(l(13),p("queryParams",A(11,Io,n.completeInfo.OrderID)),l(7),p("routerLink",X(13,cs))("queryParams",A(14,Io,n.completeInfo.OrderID)),l(),M("#",n.completeInfo.InvoiceNumber,""),l(2),p("ngForOf",n.cartItems),l(5),b(O(30,9,Q(29,6,n.cartItems,"Quantity"))))},dependencies:[K,ut,nt,fe]})};var gs=["cartContainer"];function fs(r,e){r&1&&f(0,"th",19)}function hs(r,e){r&1&&f(0,"th",20)}function Cs(r,e){r&1&&(o(0,"th",21),m(1,"Cost"),a())}function ys(r,e){r&1&&(o(0,"th",22),m(1,"Total"),a())}function vs(r,e){if(r&1&&(o(0,"td")(1,"small"),m(2),a()()),r&2){let t=c().index;l(2),M("",t+1,".")}}function bs(r,e){if(r&1&&(o(0,"i",27),m(1),a()),r&2){let t=c().$implicit;l(),M("",t.Variant.CategoryName," ")}}function Is(r,e){if(r&1&&(q(0),f(1,"span",32),G()),r&2){let t=c().$implicit;l(),p("innerHTML",t.Note,L)}}function xs(r,e){if(r&1&&(o(0,"td",30),m(1),a()),r&2){let t=c().$implicit;l(),b(t.Variant.UOM!="null"?t.Variant.UOMName:"")}}function Ss(r,e){if(r&1&&(o(0,"td",30),m(1),I(2,"number"),a()),r&2){let t=c().$implicit;l(),b(O(2,1,t.Cost))}}function Ds(r,e){if(r&1&&(o(0,"td",30),m(1),I(2,"number"),a()),r&2){let t=c().$implicit;l(),b(O(2,1,t.Cost*t.Quantity))}}function Ps(r,e){if(r&1){let t=v();o(0,"tr",23),g("click",function(){let i=d(t),s=i.$implicit,y=i.index,E=c();return u(E.onSelect({item:s,index:y}))})("contextmenu",function(i){let s=d(t),y=s.$implicit,E=s.index,mt=c();return u(mt.onContextMenu(i,y,E))}),o(1,"td",24)(2,"i",25),g("click",function(){let i=d(t),s=i.$implicit,y=i.index,E=c();return u(E.onRemove({item:s,index:y}))}),a()(),_(3,vs,3,1,"td",26),o(4,"td")(5,"span",27),m(6),a(),_(7,bs,2,1,"i",28),f(8,"app-serial-note",29),_(9,Is,2,1,"ng-container",26),a(),o(10,"td"),m(11),a(),o(12,"td",30),m(13),I(14,"number"),o(15,"span"),m(16),a()(),_(17,xs,2,1,"td",31)(18,Ss,3,3,"td",31)(19,Ds,3,3,"td",31),a()}if(r&2){let t=e.$implicit,n=c();p("cdkDragDisabled",!n.enabledDragDrop),l(3),p("ngIf",n.appConfig.ModuleSell.Grid.RowNumberVisible),l(3),b(t.Variant.Name),l(),p("ngIf",n.appConfig.ModuleSell.Grid.CategoryVisible),l(),p("serials",t.Serial),l(),p("ngIf",t.Note),l(2),b(t.Variant.Code),l(2),M(" ",O(14,12,t.Quantity),""),l(3),b(t.UnitQuantity>1?"@"+t.UnitQuantity:""),l(),p("ngIf",n.appConfig.ModuleSell.Grid.UOMVisible),l(),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.product.Cost)}}function ws(r,e){if(r&1){let t=v();o(0,"button",33),g("click",function(){let i=d(t).item,s=c();return u(s.onReverse(i,!0))}),m(1,"Return"),a(),o(2,"button",33),g("click",function(){let i=d(t).item,s=c();return u(s.onReverse(i,!1))}),m(3,"Purchase"),a()}}var Jn=class r{constructor(e,t,n){this.loadService=e;this.cartItemService=t;this.roleService=n;this.cartItems=[],this.destroy$=new ot,this.onSelectItem=new et,this.onReturnItem=new et,this.onPurchaseItem=new et,this.onRemoveItem=new et,this.onDragItem=new et,this.cartItemsChange=new et,this.cartItemService.notifyNewItem$.pipe(W(i=>w.IsNotEmpty(i))).subscribe({next:i=>{setTimeout(()=>{let s=this.cartContainer.nativeElement.scrollHeight;this.cartContainer.nativeElement.scrollTop=s},1)}})}cartItems;cartItemsChange;onSelectItem;onReturnItem;onPurchaseItem;onRemoveItem;onDragItem;entities;cartContainer;contextMenu;contextMenuPosition={x:"0px",y:"0px"};onContextMenu(e,t,n){e.preventDefault(),this.contextMenuPosition.x=e.clientX+"px",this.contextMenuPosition.y=e.clientY+"px",t.Index=n,this.contextMenu.menuData={item:t},this.contextMenu.openMenu()}onDrop(e){Cr(this.cartItems,e.previousIndex,e.currentIndex),this.cartItemService.updateCartItem(this.cartItems),this.onDragItem.emit(this.cartItems),this.cartItemsChange.emit(this.cartItems)}destroy$;appConfig;enabledDragDrop=!0;ngOnInit(){this.initAppConfig(),this.initDragDropEnabled()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}initDragDropEnabled(){w.isMobileDevice&&(this.enabledDragDrop=!1)}initAppConfig(){this.appConfig=this.loadService.Data.AppConfigJSON,this.entities=this.loadService.Data.Entities}onRemove(e){this.onRemoveItem.emit(e)}onSelect(e){this.onSelectItem.emit(e)}onReverse(e,t){t?(e.Quantity>0&&(e.Quantity=e.Quantity*-1),this.onReturnItem.emit(e)):(e.Quantity<0&&(e.Quantity=e.Quantity*-1),this.onPurchaseItem.emit(e))}static \u0275fac=function(t){return new(t||r)(C(Un),C(be),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-cart-display"]],viewQuery:function(t,n){if(t&1&&(pn(gs,5),pn(Nn,7)),t&2){let i;cn(i=dn())&&(n.cartContainer=i.first),cn(i=dn())&&(n.contextMenu=i.first)}},inputs:{cartItems:"cartItems"},outputs:{cartItemsChange:"cartItemsChange",onSelectItem:"onSelectItem",onReturnItem:"onReturnItem",onPurchaseItem:"onPurchaseItem",onRemoveItem:"onRemoveItem",onDragItem:"onDragItem"},decls:24,vars:10,consts:[["cartContainer",""],["contextMenu","matMenu"],[1,"cashier"],[1,"row","g-0","cart-table","border-bottom"],["cdkScrollable","",1,"col"],[1,"table"],[1,"border-start-0"],[2,"width","18px"],["style","width: 36px",4,"ngIf"],[1,"text-start",2,"width","250px"],[2,"cursor","pointer","width","60px"],[1,"text-end",2,"width","50px"],["class","text-end","style","width: 0.75rem",4,"ngIf"],["class","text-end","style","width: 90px;",4,"ngIf"],["class","text-end","style","width: 85px;",4,"ngIf"],["cdkDropList","",1,"itemList",3,"cdkDropListDropped"],["class","item","cdkDrag","",3,"cdkDragDisabled","click","contextmenu",4,"ngFor","ngForOf"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["matMenuContent",""],[2,"width","36px"],[1,"text-end",2,"width","0.75rem"],[1,"text-end",2,"width","90px"],[1,"text-end",2,"width","85px"],["cdkDrag","",1,"item",3,"click","contextmenu","cdkDragDisabled"],[1,"cursor"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Click to Remove",1,"fa","fa-xmark","text-danger",3,"click"],[4,"ngIf"],[1,"d-block"],["class","d-block",4,"ngIf"],[3,"serials"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"innerHTML"],["mat-menu-item","",3,"click"]],template:function(t,n){if(t&1){let i=v();o(0,"div",2)(1,"div",3)(2,"div",4,0)(4,"table",5)(5,"thead")(6,"tr",6),f(7,"th",7),_(8,fs,1,0,"th",8),o(9,"th",9),m(10,"Item"),a(),o(11,"th",10),m(12,"Code"),a(),o(13,"th",11),m(14,"Qty"),a(),_(15,hs,1,0,"th",12)(16,Cs,2,0,"th",13)(17,ys,2,0,"th",14),a()(),o(18,"tbody",15),g("cdkDropListDropped",function(y){return d(i),u(n.onDrop(y))}),_(19,Ps,20,14,"tr",16),a()()()(),f(20,"div",17),o(21,"mat-menu",null,1),_(23,ws,4,0,"ng-template",18),a()()}if(t&2){let i=yt(22);l(8),p("ngIf",n.appConfig.ModuleSell.Grid.RowNumberVisible),l(7),p("ngIf",n.appConfig.ModuleSell.Grid.UOMVisible),l(),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.product.Cost),l(2),p("ngForOf",n.cartItems),l(),nr("left",n.contextMenuPosition.x)("top",n.contextMenuPosition.y),p("matMenuTriggerFor",i)}},dependencies:[K,F,mr,Nr,kr,Ar,Nn,wn,Pn,Ht,ye,nt],styles:[".cashier[_ngcontent-%COMP%]{width:550px;max-width:37rem;min-width:33rem}div.row.cart-table[_ngcontent-%COMP%]{border-left:solid 1px #CFCFCF}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%]{overflow:auto;height:250px}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background:#fbfbf7}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:.75rem;padding:9px 5px!important}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:.75rem;padding:6px 5px;border-bottom:1px solid #CFCFCF}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child{padding-right:0}.cdk-drag-preview[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}.item[_ngcontent-%COMP%]:last-child{border:none}.itemList.cdk-drop-list-dragging[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}"]})};var Os=()=>["/menu/Adjustment/Adjustment/Archive"];function Ts(r,e){r&1&&(o(0,"a",4),m(1,"Cancel"),a()),r&2&&p("routerLink",X(1,Os))}function Es(r,e){if(r&1){let t=v();o(0,"div",11)(1,"POS-cart-header",12),g("onCreateItem",function(){d(t);let i=c(2);return u(i.selectItem())})("onOpenUploadModal",function(){d(t);let i=c(2);return u(i.openUploadModal())})("onAddItem",function(i){d(t);let s=c(2);return u(s.addItem(i))})("onScanCode",function(i){d(t);let s=c(2);return u(s.onScanBarcode(i))}),a(),o(2,"POS-cart-display",13),g("onRemoveItem",function(i){d(t);let s=c(2);return u(s.removeItem(i))})("onSelectItem",function(i){d(t);let s=c(2);return u(s.selectItem(i))})("onDragItem",function(i){d(t);let s=c(2);return u(s.saveItemAfterDrag(i))})("onReturnItem",function(i){d(t);let s=c(2);return u(s.onReturnOrPurchaseItem(i))})("onPurchaseItem",function(i){d(t);let s=c(2);return u(s.onReturnOrPurchaseItem(i))}),a(),o(3,"POS-cart-action",14),g("onSubmit",function(){d(t);let i=c(2);return u(i.submit())})("onOpenVoidModal",function(){d(t);let i=c(2);return u(i.openVoidModal())})("onOpenNoteModal",function(){d(t);let i=c(2);return u(i.openNoteModal())}),a()()}if(r&2){let t=c(2);l(),p("cartItems",t.cartItems)("isUpload",!0),l(),p("cartItems",t.cartItems)}}function js(r,e){if(r&1){let t=v();o(0,"div",5)(1,"POS-toolbar",6),g("onOpenOutletModal",function(){d(t);let i=c();return u(i.openOutletModal())}),a(),o(2,"div",7)(3,"div",8),f(4,"pos-quick-key",9),a(),_(5,Es,4,3,"div",10),a()()}if(r&2){let t=c();l(),p("adjustmentData",t.adjustmentData)("adjustmentTypes",t.adjustmentTypes)("outletName",t.outletName)("isEdit",t.isEdit)("role",t.role.global),l(3),p("quickKeyId",t.quickKeyId)("outletID",t.outletID),l(),p("ngIf",t.adjustmentStorage)}}function ks(r,e){if(r&1){let t=v();o(0,"div",15)(1,"POS-complete",16),g("onUndo",function(){d(t);let i=c();return u(i.undo())})("onNewForm",function(){d(t);let i=c();return u(i.newForm())}),a()()}if(r&2){let t=c();l(),p("total",t.total)("cartItems",t.cartItems)("completeInfo",t.completeInfo)}}var Yn=class r extends _e{constructor(t,n,i,s,y,E,mt,xt,St,Dt,At,Bt){super(t);this.adjustmentDataService=i;this.firstLoadService=s;this.matDialog=y;this.backEndService=E;this.quickKeyService=mt;this.cartItemService=xt;this.toastr=St;this.router=Dt;this.route=At;this.role=Bt;this.destroy$=new ot,this.adjustmentDataService.Data$.pipe(rt(this.destroy$)).subscribe(vt=>{this.adjustmentData=vt,this.fillCartItems()}),this.quickKeyService.onSelectQuickeyItem$.pipe(rt(this.destroy$),W(vt=>w.IsNotEmpty(vt.id)),ae(vt=>this.cartItemService.getItemById(vt.id,vt.entityID))).subscribe(vt=>this.cartItemService.addNewItem(vt))}quickKeyId;adjustmentData;adjustmentStorage;adjustmentTypes;outletID=w.GuidEmpty;outletName="Choose an Outlet";entities;cartItems;completeInfo;isComplete;total=0;destroy$;isEdit;handleF8(){this.isComplete&&this.newForm()}ngOnInit(){this.initLoadForm()}ngOnDestroy(){this.adjustmentDataService.pushNewValue(new we),this.quickKeyService.Data=new eo,this.destroy$.next(!0),this.destroy$.complete()}initLoadForm(){this.menuData$.subscribe(()=>{let t=this.adjustmentData.Order.ID;w.IsEmpty(t)&&w.IsNotEmpty(this.route.snapshot.queryParams.ID)&&(t=this.route.snapshot.queryParams.ID,this.isEdit=!0);let n=this.adjustmentData.Order.EntityID;this.firstLoadService.getStorage(pt.LoadFormAdjustment,t,n).subscribe(i=>{this.fillData(i),w.IsEmpty(t)&&this.entities.length>1?this.openOutletModal():this.entities.length==1&&xe([this.backEndService.generateNumber(this.outletID,pt.AdjustmentGenerateNumber),this.backEndService.getQuickKey(this.outletID,pt.GetQuickKeyByEntityID)]).subscribe(([s,y])=>{this.adjustmentData.Order.Number=s.Number,this.initQuickKey(y)})})})}fillData(t){if(this.adjustmentStorage=t,this.isEdit&&(this.menuData.H=`Edit Adjustment #${t.Data.Order.Number}`),this.firstLoadService.pageState=2,this.entities=this.adjustmentStorage.Entities,this.entities.length==1&&(this.outletID=this.entities[0].ID,this.outletName=this.entities[0].Name,this.adjustmentData.Order.EntityID=this.outletID),this.adjustmentTypes=this.adjustmentStorage.AdjustmentTypes,this.adjustmentData.Order.TypeID=this.adjustmentStorage.AppConfigJSON.ModuleAdjustment.Advance.AdjustmentInputType,w.IsEmpty(this.adjustmentData.Order.Date)&&(this.adjustmentData.Order.Date=this.adjustmentStorage.ServerTime.toString()),w.IsNotEmpty(t.Data)){this.adjustmentDataService.pushNewValue(t.Data),this.outletID=t.Data.Order.EntityID;let n=this.entities.find(i=>i.ID==this.outletID);this.outletName=n.Name,this.quickKeyId=n.QuickKeyTemplateID,this.backEndService.getQuickKey(this.outletID,pt.GetQuickKeyByEntityID).subscribe(i=>this.initQuickKey(i))}}fillCartItems(){this.cartItems=[];let t;this.adjustmentData.Items.forEach(n=>{t=new he,t.ID=n.ID,t.Taxable=n.Taxable,n.Variant.Serial=n.Serial,t.Quantity=n.Quantity,t.Note=n.Note,t.Cost=n.Cost,t.patchByVariantAdjustment(n.Variant),this.cartItems.push(t)})}openOutletModal(){this.isEdit||this.matDialog.open(ao,{data:{Entities:this.entities}}).afterClosed().pipe(W(t=>w.IsNotEmpty(t)),N(t=>{this.outletName=t.outlet.Name,this.outletID=t.outlet.ID,this.quickKeyId=t.outlet.QuickKeyTemplateID,this.adjustmentData.Order.EntityID=this.outletID}),ae(()=>xe([this.backEndService.generateNumber(this.outletID,pt.AdjustmentGenerateNumber),this.backEndService.getQuickKey(this.outletID,pt.GetQuickKeyByEntityID)]))).subscribe(([t,n])=>{this.adjustmentData.Order.Number=t.Number,this.initQuickKey(n)})}initQuickKey(t){this.quickKeyService.Data=t,this.quickKeyService.EntityID=this.outletID}saveItemAfterDrag(t){this.cartItemService.updateCartItem(t)}removeItem(t){this.cartItemService.removeItem(t)}selectItem(t){this.matDialog.open(Wn,{data:{itemInfo:t,entityID:this.outletID,adjustmentType:this.adjustmentData.Order.TypeID,isAdjustmentEdit:this.isEdit}})}addItem(t){this.cartItemService.getItemById(t,this.outletID).subscribe(n=>this.cartItemService.addNewItem(n))}onScanBarcode(t){this.cartItemService.addCartItemByCode(t,this.outletID)}openUploadModal(){this.matDialog.open(Vn,{data:{sampleUrl:"https://cdn.dealpos.xyz/web-import-template/ImportItem_Adjustment_TemplateV2.csv",API:"/API/Adjustment/UploadCsvV2",outletID:this.outletID}}).afterClosed().pipe(W(t=>w.IsNotEmpty(t)&&t.length>0)).subscribe(t=>t.forEach(n=>this.cartItemService.addNewItem(n,!0)))}openNoteModal(){this.matDialog.open(qn,{data:this.adjustmentData})}openVoidModal(){this.matDialog.open(lo).afterClosed().pipe(W(t=>t)).subscribe(()=>{let t=this.adjustmentData.Order.Number;this.adjustmentDataService.pushNewValue(new we),this.adjustmentData.Order.EntityID=this.outletID,this.adjustmentData.Order.Number=t,this.initLoadForm()})}submit(){if(w.IsEmpty(this.adjustmentData.Order.EntityID)){this.toastr.error("Please select outlet before proceeding..",tt.Error),this.openOutletModal();return}if(this.cartItems.length==0){this.toastr.error("You must have at least one item.",tt.Error);return}if(w.IsEmpty(this.adjustmentData.Order.Number)){this.toastr.error("Number cannot be empty.",tt.Error);return}if(this.validateItemSerial()==!1){this.toastr.warning(Pr.serialRequired,tt.Warning);return}this.adjustmentStorage.AppConfigJSON.ModuleAdjustment.Basic.Workflow===1?(this.adjustmentData.Order.StateID=4,this.adjustmentData.Items.forEach(t=>delete t.UnitPriceOriginal),this.backEndService.submitTransaction(this.adjustmentData,pt.SubmitAdjustment).subscribe(t=>{this.completeInfo=t,this.isComplete=!0,this.adjustmentData.Order.ID=t.OrderID,this.calculateTotal()})):this.isEdit?(this.adjustmentData.Items.forEach(t=>delete t.UnitPriceOriginal),this.backEndService.submitTransaction(this.adjustmentData,pt.SubmitAdjustment).subscribe(t=>{this.completeInfo=t,this.isComplete=!0,this.adjustmentData.Order.ID=t.OrderID,this.calculateTotal()})):this.matDialog.open(Gn,{data:this.adjustmentData}).afterClosed().pipe(W(t=>w.IsNotEmpty(t))).subscribe(t=>{this.completeInfo=t,this.isComplete=!0,this.adjustmentData.Order.ID=t.OrderID,this.calculateTotal()})}validateItemSerial(){let t=0;return this.getItemSerial().forEach(i=>{(i.Serial?.length==0||w.IsEmpty(i.Serial))&&(t+=1)}),t==0}getItemSerial(){return this.cartItems.filter(n=>n.Variant.TypeID==4)}calculateTotal(){this.cartItems.forEach(t=>this.total+=t.Cost)}undo(){this.isComplete=!1,this.initLoadForm()}newForm(){this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Form"]).then(()=>window.location.reload())}onReturnOrPurchaseItem(t){this.cartItemService.updateItem({item:t,index:t.Index})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(Ke),C(Un),C(ft),C(qe),C(no),C(be),C(_t),C(Nt),C(ce),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-new-inventory-adjustment"]],hostBindings:function(n,i){n&1&&g("keydown.F8",function(){return i.handleF8()},!1,Vt)},features:[dt],decls:6,vars:6,consts:[[3,"hideSearchDropdown","hideSearchBox","pageData"],["class","btn btn-outline-secondary",3,"routerLink",4,"ngIf"],["class","container-fluid",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid"],[3,"onOpenOutletModal","adjustmentData","adjustmentTypes","outletName","isEdit","role"],[1,"row","row","body","g-0","mt-4","justify-content-start"],[1,"col-auto","quickKey"],[3,"quickKeyId","outletID"],["class","col-auto cart ms-5",4,"ngIf"],[1,"col-auto","cart","ms-5"],[3,"onCreateItem","onOpenUploadModal","onAddItem","onScanCode","cartItems","isUpload"],[3,"onRemoveItem","onSelectItem","onDragItem","onReturnItem","onPurchaseItem","cartItems"],[3,"onSubmit","onOpenVoidModal","onOpenNoteModal"],[1,"container-fluid","mt-5"],[3,"onUndo","onNewForm","total","cartItems","completeInfo"]],template:function(n,i){n&1&&(o(0,"mainpanel-cmp",0)(1,"actions"),_(2,Ts,2,2,"a",1),a(),o(3,"content"),_(4,js,6,8,"div",2)(5,ks,2,3,"div",3),a()()),n&2&&(p("hideSearchDropdown",!0)("hideSearchBox",!0)("pageData",i.menuData),l(2),p("ngIf",!i.isComplete),l(2),p("ngIf",!i.isComplete),l(),p("ngIf",i.isComplete))},dependencies:[F,ut,lt,uo,ro,zn,$n,Kn,Jn]})};var Zn=class r{constructor(e){this.dialogRef=e;this.config=new ht,this.config.title="Export Adjustment Report",this.config.customWidth="382px"}pageNumber=1;pageSize=100;config;onOk(){this.dialogRef.close({pageNumber:this.pageNumber,pageSize:this.pageSize})}static \u0275fac=function(t){return new(t||r)(C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-export-report"]],decls:11,vars:3,consts:[[3,"onCancel","onClose","onOk","config"],[1,"container-fluid"],[1,"form-floating-outline"],["type","text","name","pageNumber","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["for","pageNumber"],["type","text","name","pageSize","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["for","pageSize"]],template:function(t,n){t&1&&(o(0,"modal-material",0),g("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()})("onOk",function(){return n.onOk()}),o(1,"content")(2,"div",1)(3,"div",2)(4,"input",3),D("ngModelChange",function(s){return x(n.pageNumber,s)||(n.pageNumber=s),s}),a(),o(5,"label",4),m(6,"Page Number"),a()(),o(7,"div",2)(8,"input",5),D("ngModelChange",function(s){return x(n.pageSize,s)||(n.pageSize=s),s}),a(),o(9,"label",6),m(10,"Page Size"),a()()()()()),t&2&&(p("config",n.config),l(4),S("ngModel",n.pageNumber),l(4),S("ngModel",n.pageSize))},dependencies:[at,U,J,Ct,Mt]})};var Ie=class r{constructor(e){this.http=e}currentUntilPage;toggleFetchTotalData;totalData;pageNumber;isNextBtnDisabled;isOnLastPage;calcCurrentUntilPage(e,t,n){this.currentUntilPage=e*(t-1)+n}setPageNumber(e){this.pageNumber=e}setPaginationButtonState(e,t,n){n==0?this.isNextBtnDisabled=!0:this.isNextBtnDisabled=!(n<e*t)}setTotalData(e,t,n){this.toggleFetchTotalData=!0,this.http.post(e,t).pipe(N(n)).subscribe(i=>this.totalData=i)}setPaginationState(e,t,n){this.calcCurrentUntilPage(e,t,n),this.setPageNumber(t),this.setPaginationButtonState(e,t,n)}static \u0275fac=function(t){return new(t||r)(Rt(j))};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var Xn=class r{constructor(e,t,n){this.state=n;this.fetchData$=i=>s=>t.post(i,s).pipe(bt(y=>y.Data),N(y=>this.state.setPaginationState(s.RowCount,s.PageNumber,y.length))),this.fetchLoader$=i=>()=>t.post(i)}filter$=new yn(void 0);fetchData$;fetchLoader$;getLoader$(e,t){return e.pipe(ae(this.fetchLoader$(t)),N(n=>this.filter$.next(n.Filter)))}getInfiniteListData$(e){return this.filter$.pipe(W(t=>t!==void 0),ae(this.fetchData$(e)),Xi(this.filter$),N(([t,n])=>this.state.setPaginationState(n.RowCount,n.PageNumber,t.length)),Zi((t,n)=>{let[i,s]=t,[y]=n;return s.PageNumber==1?[y,s]:[i.concat(y),s]}),bt(([t])=>t))}filterFromFirstPage(e){e.PageNumber=1,this.filter$.next(e)}nextPage(e){e.PageNumber+=1,this.filter$.next(e)}fetchTotalData(e,t){this.state.setTotalData(e,t)}fetchAllData(e,t){this.state.setTotalData(e,t,n=>{let i=V({},t);i.PageNumber=1,i.RowCount=n,this.filter$.next(i)})}static \u0275fac=function(t){return new(t||r)(Rt(it),Rt(j),Rt(Ie))};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};function Ns(r,e){if(r&1){let t=v();o(0,"span",8),g("click",function(){d(t);let i=c();return u(i.onFetchTotalData())}),o(1,"i",9),m(2,"?"),a()()}}function Vs(r,e){if(r&1&&(o(0,"span"),m(1),I(2,"number"),a()),r&2){let t=c();l(),b(O(2,1,t.state.totalData))}}function Fs(r,e){if(r&1){let t=v();o(0,"a",10),g("click",function(){d(t);let i=c();return u(i.onNextPage())}),f(1,"i",11),m(2," Next"),a()}}function Us(r,e){if(r&1){let t=v();o(0,"a",12),g("click",function(){d(t);let i=c();return u(i.onConcatAllData())}),f(1,"i",13),m(2," Show All"),a()}}var ti=class r{constructor(e){this.state=e}fetchTotalData=new et;fetchAllData=new et;nextPage=new et;ngOnInit(){}onFetchTotalData(){this.fetchTotalData.emit()}onNextPage(){this.nextPage.emit()}onConcatAllData(){this.fetchAllData.emit()}static \u0275fac=function(t){return new(t||r)(C(Ie))};static \u0275cmp=P({type:r,selectors:[["POS-infinite-list"]],outputs:{fetchTotalData:"fetchTotalData",fetchAllData:"fetchAllData",nextPage:"nextPage"},decls:11,vars:8,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load next page",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2),m(3),I(4,"number"),_(5,Ns,3,0,"span",3)(6,Vs,3,3,"span",4),m(7),a()(),o(8,"div",5),_(9,Fs,3,0,"a",6)(10,Us,3,0,"a",7),a()()),t&2&&(l(3),M(" Showing 1 - ",O(4,6,n.state.currentUntilPage)," of "),l(2),p("ngIf",!n.state.toggleFetchTotalData),l(),p("ngIf",n.state.toggleFetchTotalData),l(),M(" records ~ ",n.state.pageNumber," Page "),l(2),p("ngIf",n.state.isNextBtnDisabled&&!n.state.isOnLastPage),l(),p("ngIf",n.state.isNextBtnDisabled&&!n.state.isOnLastPage))},dependencies:[F,nt]})},ei=class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=je({type:r});static \u0275inj=Ee({imports:[Ne]})};var Rs=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Qs=r=>({ID:r});function Bs(r,e){if(r&1){let t=v();o(0,"button",13),g("click",function(){d(t);let i=c().ngIf,s=c();return u(s.openExportModal(i.Filter))}),f(1,"i",14),m(2," Export"),a()}}function Hs(r,e){if(r&1){let t=v();o(0,"div",15)(1,"h6"),m(2,"Outlets"),a(),o(3,"outlet-selector",16),D("ngModelChange",function(i){d(t);let s=c().ngIf;return x(s.Filter.EntityID,i)||(s.Filter.EntityID=i),u(i)}),a(),o(4,"h6"),m(5,"From"),a(),o(6,"datepicker",17),D("dateChange",function(i){d(t);let s=c().ngIf;return x(s.Filter.From,i)||(s.Filter.From=i),u(i)}),a(),o(7,"h6"),m(8,"To"),a(),o(9,"datepicker",18),D("dateChange",function(i){d(t);let s=c().ngIf;return x(s.Filter.To,i)||(s.Filter.To=i),u(i)}),a()()}if(r&2){let t=c().ngIf;l(3),p("accessType",2),S("ngModel",t.Filter.EntityID),p("multiple",!1),l(3),p("isFloatingLabel",!1),S("date",t.Filter.From),l(3),p("isFloatingLabel",!1),S("date",t.Filter.To)}}function Ws(r,e){r&1&&(o(0,"th",19),m(1,"@ Cost"),a())}function qs(r,e){r&1&&(o(0,"th",19),m(1,"@ Price"),a())}function Gs(r,e){if(r&1&&(o(0,"th",33),m(1),I(2,"number"),a()),r&2){let t=c().$implicit;l(),M(" ",O(2,1,t.UnitCost),"")}}function zs(r,e){if(r&1&&(o(0,"th",33),m(1),I(2,"number"),a()),r&2){let t=c().$implicit;l(),M(" ",O(2,1,t.UnitPrice),"")}}function $s(r,e){if(r&1&&(o(0,"tr")(1,"th",29),m(2),a(),o(3,"th",30),m(4),a(),o(5,"th",31),m(6),I(7,"number"),a(),_(8,Gs,3,3,"th",32)(9,zs,3,3,"th",32),a()),r&2){let t=e.$implicit,n=c(3);l(2),M(" ",t.VariantName,""),l(2),M(" ",t.VariantCode,""),l(2),b(O(7,5,t.Quantity)),l(2),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.sell.UnitPriceEditor)}}function Ks(r,e){if(r&1&&(o(0,"div")(1,"div",20)(2,"div",21)(3,"a",22),f(4,"span",23),I(5,"date"),f(6,"small",24),I(7,"date"),o(8,"small",25),m(9),a()()()(),o(10,"div")(11,"strong",26),m(12),a(),f(13,"div",27),a(),o(14,"table",28)(15,"tbody"),_(16,$s,10,7,"tr",11),a()()()),r&2){let t=e.$implicit;l(3),p("routerLink",X(14,Rs))("queryParams",A(15,Qs,t.ID)),l(),p("innerHTML",t.EntityName+" #"+t.Number+" - "+Q(5,8,t.Created,"dd MMM yyyy"),L),l(2),p("innerHTML","("+Q(7,11,t.Created,"HH:mm")+")",L),l(3),M(" ",t.PIC,""),l(3),M("[Q:",t.Quantity,"]"),l(),p("innerHTML",t.Note,L),l(3),p("ngForOf",t.Items)}}function Js(r,e){if(r&1){let t=v();o(0,"mainpanel-cmp",2),D("textChange",function(i){let s=d(t).ngIf;return x(s.Filter.Number,i)||(s.Filter.Number=i),u(i)}),g("onSubmit",function(){let i=d(t).ngIf,s=c();return u(s.search(i.Filter))}),D("filterChange",function(i){let s=d(t).ngIf;return x(s.Filter,i)||(s.Filter=i),u(i)}),o(1,"actions"),_(2,Bs,3,0,"button",3),a(),o(3,"filters"),_(4,Hs,10,7,"ng-template",null,0,$),a(),o(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),m(12,"Name"),a(),o(13,"th",8),m(14,"Code"),a(),o(15,"th",9),m(16,"Qty"),a(),_(17,Ws,2,0,"th",10)(18,qs,2,0,"th",10),a()()(),_(19,Ks,17,17,"div",11),I(20,"async"),o(21,"POS-infinite-list",12),g("nextPage",function(){let i=d(t).ngIf,s=c();return u(s.nextPage(i.Filter))})("fetchTotalData",function(){let i=d(t).ngIf,s=c();return u(s.fetchTotalData(i.Filter))})("fetchAllData",function(){let i=d(t).ngIf,s=c();return u(s.fetchAllData(i.Filter))}),a()()()()}if(r&2){let t=e.ngIf,n=c();p("pageData",n.menuData),S("text",t.Filter.Number),p("isFilterOnDropdown",!1),S("filter",t.Filter),l(2),p("ngIf",n.roleService.global.Export),l(15),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.sell.UnitPriceEditor),l(),p("ngForOf",O(20,8,n.data$))}}var ni=class r extends _e{constructor(t,n,i,s,y,E,mt){super(t);this.http=n;this.infPagination=i;this.matDialog=y;this.csvConverter=E;this.roleService=mt;this.loader$=i.getLoader$(this.menuData$,this.loaderEndpoint),this.data$=i.getInfiniteListData$(this.dataEndpoint)}dataEndpoint="/api/Adjustment/AuditAdjustmentReport";loaderEndpoint="/api/AdjustmentLoader/AuditAdjustmentReport";countEndpoint="/api/Adjustment/AuditAdjustmentReportCount";data$;loader$;loader;search(t){this.infPagination.filterFromFirstPage(t)}nextPage(t){this.infPagination.nextPage(t)}fetchTotalData(t){this.infPagination.fetchTotalData(this.countEndpoint,t)}fetchAllData(t){this.infPagination.fetchAllData(this.countEndpoint,t)}onOpenExportDialog(t){this.matDialog.open(Zn).afterClosed().pipe(W(n=>w.IsNotEmpty(n))).subscribe(n=>{t.RowCount=n.pageSize,t.PageNumber=n.pageNumber,this.exportCSV("AdjustmentExport/AuditAdjustmentReport","AdjustmentReport.csv",t)})}exportCSV(t,n,i){this.http.post(`/api/${t}`,i).subscribe(s=>{this.csvConverter.convertToCSV(s,n)})}openExportModal(t){this.matDialog.open(Wt,{data:{title:"Adjustment Report",exportTypes:[{ID:"AdjustmentExport/AuditAdjustmentReport",Value:"Default",FileName:"Adjustment Report"}],filterExport:t,getAllDataLengthAPI:"Adjustment/AuditAdjustmentReportCount",pagination:!0}})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(Xn),C(Ie),C(ft),C(Ut),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-adjustment-reports"]],features:[dt],decls:2,vars:3,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],["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"],[3,"nextPage","fetchTotalData","fetchAllData"],[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"],[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(n,i){n&1&&(_(0,Js,22,10,"mainpanel-cmp",1),I(1,"async")),n&2&&p("ngIf",O(1,1,i.loader$))},dependencies:[K,F,ut,lt,U,J,Ce,ti,An,me,nt,pe]})};var Ys=r=>({show:r});function Zs(r,e){if(r&1){let t=v();o(0,"button",25),g("click",function(){d(t);let i=c(2);return u(i.ok())}),m(1,"Upload"),a()}}function Xs(r,e){if(r&1){let t=v();o(0,"button",25),g("click",function(){d(t);let i=c(2);return u(i.confirmAdjustment())}),m(1,"Confirm Adjustment"),a()}}function tl(r,e){if(r&1&&(o(0,"div",26),m(1),I(2,"limitText"),a()),r&2){let t=e.item;p("title",(t==null||t.Name==null?null:t.Name.length)>23?t.Name:""),l(),M(" ",Q(2,2,t.Name,25)," ")}}function el(r,e){if(r&1){let t=v();o(0,"div",27)(1,"button",28),f(2,"i",29),m(3," Download Current Inventory "),a(),o(4,"ul",30)(5,"li")(6,"a",31),g("click",function(){d(t);let i=c(2);return u(i.downloadData(0))}),f(7,"i",32),m(8," Download CSV "),a()(),o(9,"li")(10,"a",33),g("click",function(){d(t);let i=c(2);return u(i.downloadData(1))}),f(11,"i",34),m(12," Download XLSX "),a()()()()}}function nl(r,e){if(r&1&&(o(0,"tr",40),f(1,"td",41)(2,"td",41)(3,"td",42),I(4,"number"),f(5,"td",42),I(6,"number"),f(7,"td",42),I(8,"number"),a()),r&2){let t=e.$implicit;It(t.QuantityDifferences<0?"danger":"success"),l(),p("innerHTML",t.Name,L),l(),p("innerHTML",t.Code,L),l(),p("innerHTML",O(4,9,t.Expected),L),l(2),p("innerHTML",O(6,11,t.Counted),L),l(2),It(t.QuantityDifferences<0?"text-danger":"text-success"),p("innerHTML",O(8,13,t.QuantityDifferences),L)}}function il(r,e){if(r&1&&(o(0,"table",35)(1,"thead",36)(2,"tr")(3,"th"),m(4,"Name"),a(),o(5,"th",37),m(6,"Code"),a(),o(7,"th",38),m(8,"Expected Stock"),a(),o(9,"th",38),m(10,"Counted Stock "),a(),o(11,"th",38),m(12,"Differences "),a()()(),o(13,"tbody"),_(14,nl,9,15,"tr",39),a()()),r&2){let t=c(2);l(14),p("ngForOf",t.opNames)}}function rl(r,e){if(r&1){let t=v();o(0,"mainpanel-cmp",1)(1,"actions"),_(2,Zs,2,0,"button",2)(3,Xs,2,0,"button",2),a(),o(4,"content")(5,"div",3)(6,"div",4)(7,"div",5)(8,"h5",6),m(9,"Outlet"),a(),o(10,"small",7),m(11,"Stock take location"),a()(),o(12,"div",8)(13,"div",9)(14,"div",10)(15,"div")(16,"ng-select",11),D("ngModelChange",function(i){d(t);let s=c();return x(s.formData.EntityID,i)||(s.formData.EntityID=i),u(i)}),g("change",function(i){d(t);let s=c();return u(s.getEntityName(i))}),_(17,tl,3,5,"ng-template",12),a()(),_(18,el,13,0,"div",13),a()()()(),o(19,"div",4)(20,"div",5)(21,"h5",6),m(22,"Counted Inventory"),a(),o(23,"small",7),m(24,".csv format"),a()(),o(25,"div",8)(26,"div",9)(27,"div",14)(28,"input",15),g("change",function(i){d(t);let s=c();return u(s.onSelectFile(i.target))}),a()()()()(),o(29,"div",16)(30,"div",5)(31,"h5",6),m(32,"Advanced"),a(),o(33,"small",7),m(34,"More Options"),a()(),o(35,"div",8)(36,"div",9)(37,"div",17)(38,"label",6),m(39,"Product Without Inventory"),a(),o(40,"small",18),m(41,"Download product Without Inventories"),a(),o(42,"div",19)(43,"radio-options",20),D("modelChange",function(i){d(t);let s=c();return x(s.formData.ProductWithoutInventory,i)||(s.formData.ProductWithoutInventory=i),u(i)}),a()()()()(),_(44,il,15,1,"table",21),a(),o(45,"a",22),m(46,"More Options"),a(),o(47,"div",23)(48,"div",24),m(49,"Tips"),a(),o(50,"ol")(51,"li"),m(52,"Choose your outlet then download the csv spreadsheet"),a(),o(53,"li"),m(54,"Fill the Quantity column beside the Expected column"),a(),o(55,"li"),m(56,"Upload your file using the Green Button on the top right corner"),a(),o(57,"li"),m(58,"Analyze the upload file on your screen and Confirm the Adjustment."),a(),o(59,"li"),m(60,'Inventory Adjustment only works for Product with type "Standard" / product with stock.'),a(),o(61,"li"),m(62,'"Composite" Product is not shown in the CSV you Download.'),a()()()()()()}if(r&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),p("ngIf",t.roleService.adjustment.Create&&!t.uploaded),l(),p("ngIf",t.uploaded),l(13),p("items",t.pageData.Entities),S("ngModel",t.formData.EntityID),l(2),p("ngIf",t.roleService.adjustment.Create||t.roleService.adjustment.Edit),l(11),It(A(13,Ys,t.opNames.length>0)),l(14),p("options",t.productOptions),S("model",t.formData.ProductWithoutInventory),l(),p("ngIf",t.opNames.length>0)}}var ii=class r extends Ft{constructor(t,n,i,s,y,E,mt){super(t,n,null,"Outlet/GetByUserAccessWrite");this.toastr=i;this.csvConverter=s;this.router=y;this.roleService=E;this.exp=mt;this.formData={},this.opNames=[]}formData;outletName;flag;uploaded=!1;opNames;productOptions=[{Key:"0",Value:"No"},{Key:"1",Value:"Yes"},{Key:"-1",Value:"Exclude Zero"}];csvResult;file;preInitList(){this.formData.EntityID=this.pageData.Entities[0].ID,this.outletName=this.pageData.Entities[0].Name,this.formData.ProductWithoutInventory="1"}onSelectFile(t){this.file=t.files[0]}ok(){let t=new FormData;t.append("Data",this.file),t.append("EntityID",this.formData.EntityID),t.append("ProductWithoutInventory",this.formData.ProductWithoutInventory),this.httpService.postFormData("/API/Adjustment/GetPreviewImportCSV",t).subscribe({next:n=>{this.opNames=n,this.uploaded=!0}})}downloadData(t){t==0?this.exp.exportCSV("InventoryExport/GetStockTakeSpreadsheet",this.formData):this.exp.exportXlsx("InventoryExport/GetStockTakeSpreadsheet",this.formData)}getEntityName(t){this.outletName=t.Name}getFormatedDate(){let t=new Date,n=(t.getDate()<10?"0":"")+t.getDate(),i=(t.getMonth()+1<10?"0":"")+(t.getMonth()+1),s=t.getFullYear().toString().substr(-2);return n+i+s}confirmAdjustment(){let t=[];if(this.opNames.forEach(s=>{let y={VariantID:s.ID,Quantity:s.QuantityDifferences,Cost:s.UnitCost,Price:s.UnitPrice};t.push(y)}),t.length<1)return alert("You must atleast have one item to adjust!"),!1;let n=new Date;this.formData.InventoryDate!=null&&(n=new Date(this.formData.InventoryDate));let i={Order:{EntityID:this.formData.EntityID,Date:n},Items:t,TypeID:1};this.httpService.post("/API/Adjustment/SubmitUseDefault",i).subscribe({next:s=>{this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Info"],{queryParams:{ID:s.OrderID}}).then(()=>window.location.reload())},error:s=>{}})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(_t),C(Ut),C(Nt),C(R),C(br))};static \u0275cmp=P({type:r,selectors:[["POS-csv-stock-take"]],features:[dt],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[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","ngModel"],["ng-option-tmp",""],["class","dropdown ms-3",4,"ngIf"],["id","import-section",1,"col-md-6","mb-10"],["accept",".csv","id","csv","type","file","name","myfile",1,"form-control",3,"change"],[1,"row","extra-options","border-bottom","mt-10","ms-2","collapse"],[1,"col-md-5"],[1,"ms-3","h6","fst-italic"],[1,"form-floating-outline","radio","border","rounded",2,"padding-top","14px"],["name","productInventory",3,"modelChange","options","model"],["class","table table-bordered mt-3",4,"ngIf"],["data-bs-toggle","collapse","data-bs-target",".extra-options","aria-expanded","true",1,"more","ms-2"],[1,"border","mt-5","ms-2"],[1,"fst-italic","text-primary","fw-bold","h5","ms-12","mt-3"],[1,"btn","btn-success",3,"click"],[3,"title"],[1,"dropdown","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle","mb-2",2,"height","37px !important","font-size","12px !important"],[1,"fa","fa-download","me-3"],[1,"dropdown-menu","dropdown-menu-start"],["role","button",1,"dropdown-item",3,"click"],[1,"fa-solid","fa-file-csv","me-3","mb-1"],["role","button",1,"dropdown-item","mt-2",3,"click"],[1,"fa-solid","fa-file-excel","me-3","mb-1"],[1,"table","table-bordered","mt-3"],[1,"thead-light","sticky-top-thead"],[2,"width","150px"],[1,"text-end",2,"width","120px"],["class","red",3,"class",4,"ngFor","ngForOf"],[1,"red"],[3,"innerHTML"],[1,"text-end",3,"innerHTML"]],template:function(n,i){n&1&&_(0,rl,63,15,"mainpanel-cmp",0),n&2&&p("ngIf",i.pageData)},dependencies:[K,F,lt,U,J,wt,vr,jn,nt,dr],styles:[".col-md-5[_ngcontent-%COMP%]{font-size:.875rem;height:fit-content}.col-md-5.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix input{font-size:14px;padding-bottom:3px}"]})};var ri=class extends _e{constructor(t,n){super(t);this.httpService=n;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(ae(()=>this.httpService.post(this.loaderApi,this.requestPayload))).subscribe(t=>this.loaderData=t)}getProduct(t){this.products=[],this.httpService.post(this.productsApi,t).subscribe(n=>{n.forEach(i=>{i.Counted="",this.products.push(i),this.originalProducts.push(i)})})}submitAdjustment(t){this.beforeSubmit(),this.httpService.post(this.submitApi,t).subscribe({next:n=>{this.adjustmentID=n.OrderID,this.completeInfo=n,this.error=null,this.onSubmitSuccess()},error:n=>{this.error=n,this.onSubmiterror()}})}onSubmitSuccess(){}beforeSubmit(){}onSubmiterror(){}};var ol=["stepper"],xo=r=>({"nb-button-override":r}),al=r=>({custom:r}),So=()=>["/menu/Products/Catalog/Variants/Info"],Bi=r=>({ID:r}),sl=r=>({"bg-gradient-warning":r}),ll=r=>({Filter:r}),ml=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function pl(r,e){if(r&1){let t=v();o(0,"button",9),g("click",function(){d(t);let i=c(2);return u(i.validateFilter())}),m(1,"Next"),a()}if(r&2){let t=c(2);p("disabled",!t.roleService.adjustment.Create)}}function cl(r,e){if(r&1){let t=v();o(0,"div",10)(1,"button",11),g("click",function(){d(t);let i=c(2);return u(i.stepper.previous())}),m(2," Back "),a(),o(3,"button",12),g("click",function(){d(t);let i=c(2);return u(i.stepper.next())}),m(4," Next "),a()()}if(r&2){let t=c(2);p("ngClass",A(1,xo,t.currentSubStatus!=t.subStatusEnum.PAID))}}function dl(r,e){if(r&1){let t=v();o(0,"div",10)(1,"button",13),g("click",function(){d(t);let i=c(2);return u(i.stepper.previous())}),m(2," Back "),a(),o(3,"button",14),g("click",function(){d(t);let i=c(2);return u(i.stepper.next())}),m(4," Confirm Adjustment "),a()()}if(r&2){let t=c(2);p("ngClass",A(1,xo,t.currentSubStatus!=t.subStatusEnum.PAID))}}function ul(r,e){r&1&&(f(0,"i",54),m(1,"Filter"))}function _l(r,e){r&1&&(o(0,"small",55),m(1,"Outlet option is required."),a())}function gl(r,e){r&1&&(f(0,"i",56),m(1,"Input"))}function fl(r,e){r&1&&(o(0,"th",41),m(1,"Expected"),a())}function hl(r,e){r&1&&(o(0,"th",41),m(1,"Changes"),a())}function Cl(r,e){if(r&1&&(o(0,"td"),m(1),a()),r&2){let t=c().$implicit;l(),b(t.Quantity)}}function yl(r,e){if(r&1&&(o(0,"td"),m(1),f(2,"i",63),m(3),a()),r&2){let t=c().$implicit;ji("bg-gradient-danger",t.Counted<t.Quantity)("bg-gradient-success",t.Counted>t.Quantity),l(),M("",t.Quantity," "),l(2),le(" ",t.Counted," (",(t.Counted-t.Quantity>0?"+":"")+(t.Counted-t.Quantity),")")}}function vl(r,e){if(r&1){let t=v();o(0,"i",64),g("click",function(){d(t);let i=c().$implicit,s=c(3);return u(s.clear(i))}),a()}}function bl(r,e){if(r&1){let t=v();o(0,"tr")(1,"td"),m(2),a(),o(3,"td",57),m(4),a(),o(5,"td",57),m(6),a(),o(7,"td")(8,"a",58),m(9),a()(),o(10,"td"),m(11),a(),_(12,Cl,2,1,"td",44),o(13,"td")(14,"input",59,2),D("ngModelChange",function(i){let s=d(t).$implicit;return x(s.Counted,i)||(s.Counted=i),u(i)}),g("ngModelChange",function(){let i=d(t).$implicit,s=yt(15),y=c(3);return u(y.onReset(i,s))}),a()(),_(16,yl,4,7,"td",60),o(17,"td",61),_(18,vl,1,0,"i",62),a()()}if(r&2){let t=e.$implicit,n=e.index,i=c(3);l(2),b(n+1+"."),l(2),b(t.CategoryName),l(2),b(t.ProductName),l(2),p("routerLink",X(14,So))("queryParams",A(15,Bi,t.ID)),l(),b(t.Model),l(2),b(t.Code),l(),p("ngIf",i.roleService.inventory.View),l(2),It(A(17,sl,t.Counted!==""&&t.Counted!=t.Quantity&&!i.roleService.inventory.View)),p("modifyValueOnWheel",!1),S("ngModel",t.Counted),l(2),p("ngIf",t.Counted!==""&&i.roleService.inventory.View),l(2),p("ngIf",t.Counted!=="")}}function Il(r,e){if(r&1){let t=v();q(0),o(1,"POS-complex-pagination",65),g("jumpToPage",function(){d(t);let i=c(3);return u(i.getProduct(i.filter))})("previousPage",function(){d(t);let i=c(3);return u(i.getProduct(i.filter))})("nextPage",function(){d(t);let i=c(3);return u(i.getProduct(i.filter))}),a(),G()}if(r&2){let t=c(3);l(),p("total",t.products.length)("pageData",A(2,ll,t.filter))}}function xl(r,e){r&1&&(f(0,"i",66),m(1,"Review"))}function Sl(r,e){r&1&&(o(0,"th",41),m(1,"Expected"),a())}function Dl(r,e){r&1&&(o(0,"th",41),m(1,"Differences"),a())}function Pl(r,e){if(r&1&&(o(0,"td"),m(1),a()),r&2){let t=c(2).$implicit;l(),b(t.Quantity)}}function wl(r,e){if(r&1&&(o(0,"span"),m(1),a()),r&2){let t=c(3).$implicit;l(),M("+",t.Counted-t.Quantity,"")}}function Ml(r,e){if(r&1&&(o(0,"span"),m(1),a()),r&2){let t=c(3).$implicit;l(),b(t.Counted-t.Quantity)}}function Ol(r,e){if(r&1&&(o(0,"td"),_(1,wl,2,1,"span",44)(2,Ml,2,1,"span",44),a()),r&2){let t=c(2).$implicit;l(),p("ngIf",t.Counted>=t.Quantity),l(),p("ngIf",t.Counted<t.Quantity)}}function Tl(r,e){if(r&1&&(o(0,"tr")(1,"td"),m(2),a(),o(3,"td",57),m(4),a(),o(5,"td")(6,"a",58),m(7),a()(),o(8,"td"),m(9),a(),_(10,Pl,2,1,"td",44),o(11,"td"),m(12),a(),_(13,Ol,3,2,"td",44),a()),r&2){let t=c(),n=t.$implicit,i=t.index,s=c(3);ji("soft-yellow",n.Counted<n.Quantity)("soft-green",n.Counted>n.Quantity),l(2),b(i+1+"."),l(2),b(n.ProductName),l(2),p("routerLink",X(13,So))("queryParams",A(14,Bi,n.ID)),l(),b(n.Model),l(2),b(n.Code),l(),p("ngIf",s.roleService.inventory.View),l(2),M(" ",n.Counted," "),l(),p("ngIf",s.roleService.inventory.View)}}function El(r,e){if(r&1&&(q(0),_(1,Tl,14,16,"tr",67),G()),r&2){let t=e.$implicit;l(),p("ngIf",t.Counted!=="")}}function jl(r,e){r&1&&(f(0,"i",68),m(1,"Finish"))}function kl(r,e){if(r&1&&(o(0,"div",69),f(1,"i",70),m(2),a()),r&2){let t=c(3);l(2),b(t.error.error.Message)}}function Al(r,e){if(r&1){let t=v();o(0,"mat-stepper",15,0),g("selectionChange",function(i){d(t);let s=c(2);return u(s.onNextStep(i))}),o(2,"mat-step",16),_(3,ul,2,0,"ng-template",17),o(4,"div",18)(5,"div",19)(6,"div",20)(7,"div",19)(8,"h3",21),m(9,"Outlet"),a()(),o(10,"div",22)(11,"ng-select",23,1),g("change",function(){d(t);let i=c(2);return u(i.toggleIsFilterFilled())}),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.filter.EntityID,i)||(s.filter.EntityID=i),u(i)}),a(),_(13,_l,2,0,"small",24),a()()(),o(14,"div",25)(15,"div",20)(16,"div",19)(17,"h3",21),m(18,"Category "),o(19,"small",26)(20,"em"),m(21,"Optional"),a()()()(),o(22,"div",22)(23,"ng-select",27),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.filter.CategoryID,i)||(s.filter.CategoryID=i),u(i)}),a()()()(),o(24,"div",25)(25,"div",20)(26,"div",19)(27,"h3",21),m(28,"Contain Text "),o(29,"small",26)(30,"em"),m(31,"Optional"),a()()()(),o(32,"div",28)(33,"input",29),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.filter.ProductName,i)||(s.filter.ProductName=i),u(i)}),a()()()(),o(34,"div",25)(35,"div",20)(36,"div",19)(37,"h3",21),m(38,"Note "),o(39,"small",26)(40,"em"),m(41,"Optional"),a()()()(),o(42,"div",22)(43,"textarea",30),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.note,i)||(s.note=i),u(i)}),a()()()()()(),o(44,"mat-step",31),_(45,gl,2,0,"ng-template",17),o(46,"div",32)(47,"table",33),g("matSortChange",function(i){d(t);let s=c(2);return u(s.sortData(i))}),o(48,"thead",34)(49,"tr")(50,"th",35),m(51,"No"),a(),o(52,"th",36),m(53,"Category"),a(),o(54,"th",37),m(55,"Product"),a(),o(56,"th",38),m(57,"Variant"),a(),o(58,"th",39),m(59,"Code"),a(),_(60,fl,2,0,"th",40),o(61,"th",41),m(62,"Counted"),a(),_(63,hl,2,0,"th",42),f(64,"th",35),a()(),o(65,"tbody"),_(66,bl,19,19,"tr",43),a()(),_(67,Il,2,4,"ng-container",44),a()(),o(68,"mat-step",45),_(69,xl,2,0,"ng-template",17),o(70,"div",46)(71,"div",47)(72,"table",48),g("matSortChange",function(i){d(t);let s=c(2);return u(s.sortData(i))}),o(73,"thead",49)(74,"tr"),f(75,"th",35),o(76,"th",50),m(77,"Name"),a(),o(78,"th",51),m(79,"Variant"),a(),o(80,"th",41),m(81,"Code"),a(),_(82,Sl,2,0,"th",40),o(83,"th",41),m(84,"Counted"),a(),_(85,Dl,2,0,"th",40),a()(),o(86,"tbody"),_(87,El,2,1,"ng-container",43),a()()()()(),o(88,"mat-step",52),_(89,jl,2,0,"ng-template",17)(90,kl,3,1,"div",53),a()()}if(r&2){let t=yt(12),n=c(2);p("linear",!0),l(2),p("completed",n.isFilterFilled),l(9),It(A(20,al,t.touched&&n.filter.EntityID==null)),p("items",n.loaderData.Entities),S("ngModel",n.filter.EntityID),p("clearable",!1),l(2),p("ngIf",t.touched&&n.filter.EntityID==null),l(10),p("items",n.loaderData.Categories),S("ngModel",n.filter.CategoryID),l(10),S("ngModel",n.filter.ProductName),l(10),S("ngModel",n.note),l(17),p("ngIf",n.roleService.inventory.View),l(3),p("ngIf",n.roleService.inventory.View),l(3),p("ngForOf",n.products),l(),p("ngIf",n.products.length>0),l(15),p("ngIf",n.roleService.inventory.View),l(3),p("ngIf",n.roleService.inventory.View),l(2),p("ngForOf",n.reviewedItems),l(3),p("ngIf",n.error)}}function Nl(r,e){r&1&&(o(0,"div",87),m(1," Difference"),a())}function Vl(r,e){if(r&1&&(o(0,"div",92),m(1),a()),r&2){let t=c().$implicit;It(t.Quantity-t.OriginalQuantity<0?"text-danger":"text-success"),l(),b((t.Quantity-t.OriginalQuantity>0?"+":" ")+(t.Quantity-t.OriginalQuantity))}}function Fl(r,e){if(r&1&&(o(0,"div",94)(1,"div",91),m(2),a(),o(3,"div",92),m(4),a(),_(5,Vl,2,3,"div",93),a()),r&2){let t=e.$implicit,n=c(3);l(2),le("",t.Name," (",t.Model,")"),l(2),b(t.Quantity),l(),p("ngIf",n.roleService.inventory.View)}}function Ul(r,e){if(r&1&&(o(0,"div",92),I(1,"sum"),I(2,"sum"),m(3),I(4,"sum"),I(5,"sum"),I(6,"sum"),I(7,"sum"),a()),r&2){let t=c(3);It(Q(1,3,t.displayedItems,"Quantity")-Q(2,6,t.displayedItems,"OriginalQuantity")<0?"text-danger":"text-success"),l(3),M(" ",(Q(4,9,t.displayedItems,"Quantity")-Q(5,12,t.displayedItems,"OriginalQuantity")>0?"+":" ")+(Q(6,15,t.displayedItems,"Quantity")-Q(7,18,t.displayedItems,"OriginalQuantity"))," ")}}function Ll(r,e){if(r&1){let t=v();o(0,"div",71)(1,"div",72)(2,"div",73)(3,"div",74)(4,"h1",75),f(5,"i",68),m(6,"Inventory Adjustment Completed"),a()(),o(7,"div",76)(8,"div",77)(9,"div",78)(10,"a",79),g("click",function(){d(t);let i=c(2);return u(i.newStockCount())}),m(11,"New Adjustment (F8)"),a()()()()()(),o(12,"div",80)(13,"div",73)(14,"div",81)(15,"h2",82)(16,"a",83),m(17),a()()(),o(18,"div",84)(19,"div",85)(20,"div",86),m(21,"Product Name (Variant)"),a(),o(22,"div",87),m(23,"Counted"),a(),_(24,Nl,2,0,"div",88),a(),_(25,Fl,6,4,"div",89),o(26,"div",90)(27,"div",91),m(28,"Total"),a(),o(29,"div",92),m(30),I(31,"sum"),a(),_(32,Ul,8,21,"div",93),a()()()()()}if(r&2){let t=c(2);l(16),p("routerLink",X(10,ml))("queryParams",A(11,Bi,t.adjustmentID)),l(),M("Adjustment #",t.completeInfo.InvoiceNumber,""),l(7),p("ngIf",t.roleService.inventory.View),l(),p("ngForOf",t.displayedItems),l(5),b(Q(31,7,t.displayedItems,"Quantity")),l(2),p("ngIf",t.roleService.inventory.View)}}function Rl(r,e){if(r&1){let t=v();o(0,"mainpanel-cmp",4),D("textChange",function(i){d(t);let s=c();return x(s.filter.ProductName,i)||(s.filter.ProductName=i),u(i)}),g("onSubmit",function(){d(t);let i=c();return u(i.filterProduct())}),o(1,"actions"),_(2,pl,2,1,"button",5)(3,cl,5,3,"div",6)(4,dl,5,3,"div",6),a(),o(5,"content"),_(6,Al,91,22,"mat-stepper",7)(7,Ll,33,13,"div",8),a()()}if(r&2){let t=c();p("pageData",t.menuData),S("text",t.filter.ProductName),p("hideSearchBox",t.currentStep!="input")("hideSearchDropdown",!0),l(2),p("ngIf",t.currentStep=="filter"),l(),p("ngIf",t.currentStep=="input"),l(),p("ngIf",t.currentStep=="review"),l(2),p("ngIf",!t.isCompleted),l(),p("ngIf",t.isCompleted)}}var oi=class r extends ri{constructor(t,n,i,s,y){super(t,n);this.toastr=i;this.ngZone=s;this.roleService=y;this.isFilterFilled=!1,this.filter={CategoryID:null,EntityID:null,ProductName:"",SupplierID:w.GuidEmpty,RowCount:500,PageNumber:1},this.oldFilter={CategoryID:"dummy",EntityID:"dummy",ProductName:"dummy",SupplierID:"dummy",RowCount:500,PageNumber:1},this.Items=[],this.initSubscriptionStatus()}stepper;isFilterFilled;currentStep="filter";Items;reviewedItems=[];displayedItems=[];note;isCompleted=!1;filter;oldFilter;currentSubStatus;subStatusEnum=ar;ngOnDestroy(){}initSubscriptionStatus(){this.currentSubStatus=parseInt(localStorage.getItem("SubscriptionStatus"))}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,n){n.value==""&&this.clear(t)}handlePreviousButton(){this.stepper&&this.ngZone.run(()=>{this.stepper.previous()})}toggleIsFilterFilled(){this.isFilterFilled=!0}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 n=0;this.products.forEach(i=>{i.Counted!==""&&i.Counted!=i.Quantity&&(i.Status=i.Counted>i.Quantity?"Over":"Under",n++)}),this.reviewedItems=this.products.filter(i=>i.Counted!==""),n&&!this.roleService.inventory.View&&this.toastr.warning("There are some items inventory that does not match! Click next to automatically adjust inventory.",tt.Warning)}else if(t.selectedStep.label=="finish"){this.products=this.originalProducts,this.currentStep="finish",this.Items=[],this.products.forEach(s=>{if(s.Counted!==""){let y={Name:s.ProductName,Cost:s.UnitCost,Price:s.UnitPrice,Quantity:s.Counted,OriginalQuantity:s.Quantity,VariantID:s.ID,Model:s.Model};this.Items.push(y)}});let n={Date:new Date,EntityID:this.filter.EntityID,Note:this.note,ID:this.adjustmentID||w.GuidEmpty},i={Items:this.Items,Order:n,TypeID:2};this.displayedItems=this.Items.filter(s=>s.Quantity-s.OriginalQuantity!=0),this.submitAdjustment(i)}}validateFilter(){if(!this.isFilterFilled){this.toastr.error("Outlet is required",tt.Error);return}this.stepper.next()}clear(t){t.Counted=""}newStockCount(){window.location.reload()}beforeSubmit(){this.isCompleted=!0}onSubmiterror(){this.isCompleted=!1}sortData(t){let n=this.products.slice();if(!t.active||t.direction===""){this.products=this.originalProducts;return}this.products=n.sort((i,s)=>{let y=t.direction==="asc",E=typeof i[t.active];switch(w.IsEmpty(i.Code)&&(i.Code=""),w.IsEmpty(s.Code)&&(s.Code=""),E){case"string":return w.compare(i[t.active].toLocaleLowerCase(),s[t.active].toLocaleLowerCase(),y);case"number":return w.compare(i[t.active],s[t.active],y);default:return 0}})}filterProduct(){this.filter.PageNumber=1,this.getProduct(this.filter)}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(_t),C(tr),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-spreadsheet-stock-take"]],viewQuery:function(n,i){if(n&1&&pn(ol,5),n&2){let s;cn(s=dn())&&(i.stepper=s.first)}},hostBindings:function(n,i){n&1&&g("keydown.F8",function(){return i.handleF8()},!1,Vt)("keydown.ArrowRight",function(){return i.handleNextButton()},!1,Vt)("keydown.ArrowLeft",function(){return i.handlePreviousButton()},!1,Vt)},features:[dt],decls:1,vars:1,consts:[["stepper",""],["outletFilter","ngModel"],["input",""],[3,"pageData","text","hideSearchBox","hideSearchDropdown","textChange","onSubmit",4,"ngIf"],[3,"textChange","onSubmit","pageData","text","hideSearchBox","hideSearchDropdown"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page","class","btn btn-success ms-auto me-0 d-block",3,"disabled","click",4,"ngIf"],["class","mt-5 nb-button",3,"ngClass",4,"ngIf"],[3,"linear","selectionChange",4,"ngIf"],["class","container-fluid row mt-5",4,"ngIf"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success","ms-auto","me-0","d-block",3,"click","disabled"],[1,"mt-5","nb-button",3,"ngClass"],["mat-button","","mat-raised-button","","matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-2",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn","btn-success",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-5",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success",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"],["placeholder","Choose a category","dropdownPosition","bottom","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[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"],["rows","6","type","text","name","note",1,"form-control",3,"ngModelChange","ngModel"],["label","input"],[1,"container-fluid",2,"height","calc(100vh - 180px)","overflow","auto","padding","0 24px","padding-bottom","20px"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","30px"],["mat-sort-header","CategoryName",2,"width","175px"],["mat-sort-header","ProductName",2,"width","200px"],["mat-sort-header","Model",2,"width","100px"],["mat-sort-header","Code",2,"width","75px"],["style","width: 75px;",4,"ngIf"],[2,"width","75px"],["style","width: 75px",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf"],["label","review"],[1,"container-fluid",2,"padding","0 24px"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom","w-100",2,"table-layout","fixed",3,"matSortChange"],[1,"thead-light"],["mat-sort-header","ProductName",2,"width","175px"],[2,"width","150px"],["label","finish"],["class","alert",4,"ngIf"],[1,"fa-solid","fa-filter","me-3"],[2,"color","red"],[1,"fa-solid","fa-calculator","me-3"],[2,"word-break","break-word"],["target","_blank",2,"color","#0976b4 !important",3,"routerLink","queryParams"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","modifyValueOnWheel","ngModel"],[3,"bg-gradient-danger","bg-gradient-success",4,"ngIf"],[1,"text-center"],["class","fa-solid fa-delete-left fa-2x clear align-middle","matTooltipPosition","above","matTooltip","reset counter",3,"click",4,"ngIf"],[1,"fa-solid","fa-right-long"],["matTooltipPosition","above","matTooltip","reset counter",1,"fa-solid","fa-delete-left","fa-2x","clear","align-middle",3,"click"],["api","Adjustment/GetSpreadsheetCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"fa-solid","fa-user-check","me-3"],[3,"soft-yellow","soft-green",4,"ngIf"],[1,"fa-solid","fa-check","me-3"],[1,"alert"],[1,"fa-solid","fa-circle-exclamation","me-3"],[1,"container-fluid","row","mt-5"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px","border-bottom","1px solid rgba(0, 0, 0, 0.125)","background-color","rgba(203, 203, 210, 0.15) !important"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body"],[1,"row","justify-content-between"],[1,"col-6",2,"font-size","14px"],[1,"col-3",2,"font-size","14px"],["class","col-3","style","font-size: 14px;",4,"ngIf"],["class","row justify-content-between my-5",4,"ngFor","ngForOf"],[1,"row","justify-content-between","fw-bold"],[1,"col-6"],[1,"col-3"],["class","col-3",3,"class",4,"ngIf"],[1,"row","justify-content-between","my-5"]],template:function(n,i){n&1&&_(0,Rl,8,9,"mainpanel-cmp",3),n&2&&p("ngIf",i.loaderData)},dependencies:[Ae,K,F,ut,lt,at,U,J,wt,We,Zr,Yr,Xr,Mt,Ht,_r,gr,fe],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 Ql=()=>["/menu/Products/Catalog/Products/Info"],Bl=r=>({ID:r});function Hl(r,e){if(r&1){let t=v();o(0,"button",13),g("click",function(){d(t);let i=c(2);return u(i.confirmAdjust())}),m(1,"Confirm Adjustment"),a()}}function Wl(r,e){if(r&1){let t=v();o(0,"div")(1,"div",14)(2,"h6"),m(3,"Outlets"),a(),o(4,"ng-select",15),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,i)||(s.pageData.Filter.EntityID=i),u(i)}),a()()()}if(r&2){let t=c(2);l(4),p("items",t.pageData.Entities),S("ngModel",t.pageData.Filter.EntityID)}}function ql(r,e){if(r&1){let t=v();o(0,"tr",16)(1,"td"),f(2,"a",17),a(),f(3,"td",18)(4,"td",18)(5,"td",18)(6,"td",19)(7,"td",19),o(8,"td",20)(9,"input",21),D("ngModelChange",function(i){let s=d(t).$implicit;return x(s.NewQuantity,i)||(s.NewQuantity=i),u(i)}),a()(),o(10,"td",20),m(11),I(12,"number"),a(),o(13,"td")(14,"a",22),g("click",function(){let i=d(t).$implicit,s=c(2);return u(s.confirmAdjust(i))}),m(15,"Adjust"),a()()()}if(r&2){let t=e.$implicit;l(2),p("routerLink",X(12,Ql))("queryParams",A(13,Bl,t.ProductID))("innerHTML",t.ProductName,L),l(),p("innerHTML",t.ParentCode,L),l(),p("innerHTML",t.Model,L),l(),p("innerHTML",t.ParentModel,L),l(),p("innerHTML",t.Ratio,L),l(),p("innerHTML",t.Inventory,L),l(2),S("ngModel",t.NewQuantity),l(2),M(" ",O(12,10,t.Inventory-t.NewQuantity*t.Ratio)," ")}}function Gl(r,e){if(r&1){let t=v();o(0,"mainpanel-cmp",2),g("onSubmit",function(){d(t);let i=c();return u(i.searchFromPageOne())}),D("filterChange",function(i){d(t);let s=c();return x(s.pageData.Filter,i)||(s.pageData.Filter=i),u(i)}),o(1,"actions"),_(2,Hl,2,0,"button",3),a(),o(3,"filters"),_(4,Wl,5,2,"ng-template",null,0,$),a(),o(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th"),m(13,"Product Name"),a(),o(14,"th",8),m(15,"Code"),a(),o(16,"th",8),m(17,"From"),a(),o(18,"th",8),m(19,"To"),a(),o(20,"th",9),m(21,"Ratio"),a(),o(22,"th",9),m(23,"Inventory"),a(),o(24,"th",10),m(25,"Convert Qty "),a(),o(26,"th",10),m(27,"Remaining"),a(),f(28,"th",11),a()(),o(29,"tbody"),_(30,ql,16,15,"tr",12),a()()()()()()}if(r&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.roleService.adjustment.Create),l(28),p("ngForOf",t.Items)}}var ai=class r extends Ft{constructor(t,n,i,s,y){super(t,n,"Adjustment/GetAdjustToParentList","Outlet/GetByUserAccessWrite");this.toastr=i;this.router=s;this.roleService=y}Items;preGetList(){w.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=this.pageData.Entities[0].ID)}postInit(t){this.Items=t,this.Items.forEach(n=>n.NewQuantity=Math.floor(n.Inventory/n.Ratio))}confirmAdjust(t){let n=[],i=[];if(t?i.push(t):i=this.Items,i.forEach(y=>{let E={VariantID:y.ParentID,Quantity:y.NewQuantity,Cost:y.UnitCost*y.Ratio,Price:y.UnitPrice*y.Ratio};n.push(E),E={VariantID:y.ID,Quantity:y.NewQuantity*y.Ratio*-1,Cost:y.UnitCost,Price:y.UnitPrice},n.push(E)}),n.length<1)return alert("You must atleast have one item to adjust!"),!1;if(w.IsEmpty(this.pageData.Filter.EntityID))return alert("Outlet is require"),!1;let s={Order:{EntityID:this.pageData.Filter.EntityID},Items:n};this.httpService.post("/API/Adjustment/SubmitUseDefault",s).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,tt.Success)},error:y=>{this.toastr.error(y,tt.Error)}})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(_t),C(Nt),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-convert-inventory"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","125px"],[1,"text-end",2,"width","125px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-success",3,"click"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","appendTo","body",3,"ngModelChange","items","ngModel"],[1,"border-bottom"],[3,"routerLink","queryParams","innerHTML"],[3,"innerHTML"],[1,"text-end",3,"innerHTML"],[1,"text-end"],["type","text","autoNum","",1,"text-end",3,"ngModelChange","ngModel"],[3,"click"]],template:function(n,i){n&1&&_(0,Gl,31,6,"mainpanel-cmp",1),n&2&&p("ngIf",i.data)},dependencies:[K,F,ut,lt,at,U,J,wt,Mt,nt]})};function zl(r,e){if(r&1){let t=v();o(0,"button",16),g("click",function(){d(t);let i=c();return u(i.openExportModal())}),f(1,"i",17),m(2," Export"),a()}}function $l(r,e){if(r&1){let t=v();o(0,"td",14)(1,"input",21),D("ngModelChange",function(i){d(t);let s=c().$implicit;return x(s.Quantity,i)||(s.Quantity=i),u(i)}),a()()}if(r&2){let t=c().$implicit;l(),S("ngModel",t.Quantity)}}function Kl(r,e){if(r&1&&(o(0,"td",14),m(1),a()),r&2){let t=c().$implicit;l(),M(" ",t.Quantity,"")}}function Jl(r,e){if(r&1){let t=v();o(0,"tr",18)(1,"td")(2,"i",19),g("click",function(){let i=d(t).index,s=c();return u(s.products.splice(i,1))}),a()(),o(3,"td"),m(4),a(),o(5,"td",14),m(6),a(),_(7,$l,2,1,"td",20)(8,Kl,2,1,"td",20),a()}if(r&2){let t=e.$implicit,n=c();l(4),b(t.Name),l(2),b(t.Code),l(),p("ngIf",n.roleService.adjustment.InventoryProductCount),l(),p("ngIf",!n.roleService.adjustment.InventoryProductCount)}}var si=class r extends _e{constructor(t,n,i,s,y){super(t);this.httpService=n;this.csvConverter=i;this.roleService=s;this.matDialog=y;this.products=[],this.menuData$.subscribe()}productCode;products;onBarcodeEnter(t){let n=this.products.findIndex(i=>i.Code===t);n!=-1?this.products[n].Quantity++:this.httpService.post("/API/catalog/product/ProductCountByCode",{code:t}).subscribe(i=>{i.Quantity=1,this.products.push(i)}),this.productCode=null}openExportModal(){var t={Products:this.products,Export:!0};this.matDialog.open(Wt,{data:{title:"Count Product Inventory",exportTypes:[{ID:"ProductExport/ProductCountInventory",Value:"Default",FileName:"Count Product Inventory"}],filterExport:t,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(Ut),C(R),C(ft))};static \u0275cmp=P({type:r,selectors:[["POS-count-product-inventory"]],features:[dt],decls:27,vars:6,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"cashier"],[1,"cart","big-cart","scan-cart"],[1,"barcode","barcode_counter","text-end"],[1,"me-5"],["aria-hidden","true",1,"fa-solid","fa-barcode","fa-2x","icon"],["type","text","placeholder","Scan Barcode Here","autofocus","",2,"width","200px",3,"keyup.enter","ngModelChange","ngModel"],[1,"content"],[1,"table"],["id","tableGrid",1,"cart","table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],["width","15px"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"border-bottom"],[1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],["class","text-end",4,"ngIf"],["type","text","autoNum","",1,"text-end",3,"ngModelChange","ngModel"]],template:function(n,i){n&1&&(o(0,"mainpanel-cmp",0)(1,"actions"),_(2,zl,3,0,"button",1),a(),o(3,"content")(4,"div",2)(5,"section",3)(6,"main")(7,"section",4)(8,"div",5)(9,"span",6),m(10,"Barcode"),a(),f(11,"i",7),o(12,"input",8),g("keyup.enter",function(){return i.onBarcodeEnter(i.productCode)}),D("ngModelChange",function(y){return x(i.productCode,y)||(i.productCode=y),y}),a()(),o(13,"div",9)(14,"div",10)(15,"table",11)(16,"thead",12)(17,"tr"),f(18,"th",13),o(19,"th"),m(20,"Name"),a(),o(21,"th",14),m(22,"Code"),a(),o(23,"th",14),m(24,"Qty"),a()()(),o(25,"tbody"),_(26,Jl,9,4,"tr",15),a()()()()()()()()()()),n&2&&(p("pageData",i.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),p("ngIf",i.roleService.global.Export),l(10),S("ngModel",i.productCode),l(14),p("ngForOf",i.products))},dependencies:[K,F,lt,at,U,J,Mt],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 Yl(r,e){if(r&1){let t=v();o(0,"button",15),g("click",function(){d(t);let i=c(2);return u(i.openExportModal())}),f(1,"i",16),m(2," Export"),a()}}function Zl(r,e){if(r&1){let t=v();o(0,"div")(1,"div",17)(2,"h6"),m(3,"Outlets"),a(),o(4,"ng-select",18),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,i)||(s.pageData.Filter.EntityID=i),u(i)}),a(),o(5,"h6"),m(6,"Category"),a(),o(7,"POS-product-category-select",19),D("selectedCategoryIDChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.CategoryID,i)||(s.pageData.Filter.CategoryID=i),u(i)}),a(),o(8,"h6"),m(9,"Sort By"),a(),o(10,"ng-select",20),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.SortByid,i)||(s.pageData.Filter.SortByid=i),u(i)}),a()()()}if(r&2){let t=c(2);l(4),p("items",t.pageData.Options.Entities),S("ngModel",t.pageData.Filter.EntityID),l(3),S("selectedCategoryID",t.pageData.Filter.CategoryID),p("showClear",!0),l(3),p("items",t.pageData.Options.SortBy),S("ngModel",t.pageData.Filter.SortByid)}}function Xl(r,e){if(r&1&&(o(0,"span"),m(1),a()),r&2){let t=e.$implicit;l(),b(t+" ")}}function tm(r,e){if(r&1&&(o(0,"tr")(1,"td"),m(2),a(),o(3,"td"),m(4),a(),o(5,"td",14),m(6),I(7,"number"),a(),o(8,"td",14),m(9),I(10,"number"),a(),o(11,"td",21),_(12,Xl,2,1,"span",11),a()()),r&2){let t=e.$implicit;l(2),b(t.ProductCode),l(2),b(t.ProductName),l(2),b(O(7,5,t.UnitPrice)),l(3),b(O(10,7,t.Qty)),l(3),p("ngForOf",t.Models)}}function em(r,e){if(r&1){let t=v();o(0,"mainpanel-cmp",2),g("onSubmit",function(){d(t);let i=c();return u(i.searchFromPageOne())}),D("filterChange",function(i){d(t);let s=c();return x(s.pageData.Filter,i)||(s.pageData.Filter=i),u(i)}),o(1,"actions"),_(2,Yl,3,0,"button",3),a(),o(3,"filters"),_(4,Zl,11,6,"ng-template",null,0,$),a(),o(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),m(12,"Code"),a(),o(13,"th",8),m(14,"Name"),a(),o(15,"th",9),m(16,"UnitPrice"),a(),o(17,"th",10),m(18,"Qty"),a(),o(19,"th"),m(20,"Available Models"),a()()(),o(21,"tbody"),_(22,tm,13,9,"tr",11),a(),o(23,"tfoot")(24,"tr",12),f(25,"td",13),o(26,"td",14),m(27),I(28,"sum"),I(29,"number"),a(),f(30,"td"),a()()()()()()}if(r&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.roleService.global.Export),l(20),p("ngForOf",t.data.Data),l(5),b(O(29,10,Q(28,7,t.data.Data,"Qty")))}}var li=class r extends Ft{constructor(t,n,i,s,y){super(t,n,"catalog/product/GetOutletProductSheet","catalog/ProductLoader/GetOutletProductSheet");this.csvConverter=i;this.roleService=s;this.matDialog=y}openExportModal(){this.matDialog.open(Wt,{data:{title:"Product Sheet",exportTypes:[{ID:"ProductExport/GetOutletProductSheet",Value:"Default",FileName:"Product Sheet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(Ut),C(R),C(ft))};static \u0275cmp=P({type:r,selectors:[["POS-product-sheet"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","70px"],[2,"width","260px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","100px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","3"],[1,"text-end"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","placeholder","Choose an outlet","bindLabel","Name","bindValue","ID",3,"ngModelChange","items","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[2,"word-spacing","20px"]],template:function(n,i){n&1&&_(0,em,31,12,"mainpanel-cmp",1),n&2&&p("ngIf",i.data)},dependencies:[K,F,lt,U,J,wt,kn,nt,fe]})};var Do=Ei(Tr());var H=class r{INITIAL_STATE={loadForm:{},outlet:{ID:w.GuidEmpty,Name:""},isOpenDialog:!0,isComplete:!1,adjustmentState:0,quickeyItems:{},cartItems:[],order:{Date:(0,Do.default)().utcOffset("+07:00").format(),EntityID:"",ID:w.GuidEmpty,StateID:4,TypeID:1,Number:"",PIC:"",Note:""},orderComplete:{},NewOrderID:""};#t=Kr(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=>Y(V({},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,n)=>t+n.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,n)=>t+n.Variant.UnitPrice*n.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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var Hi=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,n,i,s,y,E,mt,xt,St,Dt,At,Bt,vt,Jt,Yt,Zt,Xt,te,ee,ne,ie){this.ID=e,this.VariantID=t,this.Quantity=n,this.Cost=i,this.Price=s,this.Expense=y,this.Discount=E,this.DiscountAmount=mt,this.Note=xt,this.Taxable=St,this.LoyaltyPoint=Dt,this.EntityID=At,this.UnitQuantity=Bt,this.VariantUnitQuantity=vt,this.InventoryTypeID=Jt,this.Variant=Yt,this.SalesID=Zt,this.UnitCost=Xt,this.UnitPrice=te,this.SplitQuantity=ee,this.isMaxInventory=ne,this.PromotionGift=ie}},mi=class r{adapt(e){return new Hi(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})},Wi=class{constructor(e,t,n,i,s,y,E,mt,xt,St,Dt,At,Bt,vt,Jt,Yt,Zt,Xt,te,ee,ne,ie,Ze,Xe,tn,en,nn,rn,on,an,sn){this.ID=e,this.Name=t,this.Code=n,this.UnitCost=i,this.UnitPrice=s,this.UnitExpense=y,this.UnitQuantity=E,this.PriceDiscount=mt,this.UnitPriceOriginal=xt,this.Description=St,this.UOM=Dt,this.UOMName=At,this.ImageUrl=Bt,this.TypeID=vt,this.SellPriceType=Jt,this.OnHand=Yt,this.Ordered=Zt,this.OrderPrice=Xt,this.OrderPriceDiscount=te,this.Taxable=ee,this.LoyaltyPoint=ne,this.CategoryName=ie,this.CategoryID=Ze,this.CategoryTypeID=Xe,this.PriceNote=tn,this.PaymentTypeID=en,this.ThumbnailUrl=nn,this.Storage=rn,this.Component=on,this.PriceBook=an,this.VariantUnitQuantity=sn}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},pi=class r{adapt(e){return new Wi(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var ci=class r{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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})},di=class r{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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})},Po=class r{adapt(e){return{Number:e.Number,Quantity:e.Quantity,ExpiryDate:e.ExpiryDate}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var Tt=class r{destroy$=new ot;#t=h(H);#e=h(j);#n=h(mi);#i=h(pi);#r=h(Pt);#o=h(ci);#a=h(di);constructor(){}processOrder(){return st(this.#t.AdjustmentState,{injector:this.#r}).pipe(rt(this.destroy$),Z(e=>{let t=[...this.#t.CartItems()].map(n=>Y(V({},this.#o.adapt(n)),{EntityID:w.GuidEmpty,Note:n.Note??"",SalesID:n.SalesID??"",isMaxInventory:!1,PromotionGift:!1,SplitQuantity:0,UnitCost:n.Cost,Cost:n.Cost,Variant:Y(V({},this.#a.adapt(n.Variant)),{Taxable:!!n.Variant.Taxable})}));if(e===0){let n={Items:[...t],Order:{Date:this.#t.Order().Date,EntityID:this.#t.Outlet().ID,ID:w.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},NewOrderID:this.#t.NewOrderID()};return this.#e.post(pt.SubmitAdjustment,n).pipe(rt(this.destroy$))}if(e===1){let n=Y(V({},this.#t.LoadForm().Data),{Order:Y(V({},this.#t.LoadForm().Data.Order),{Note:this.#t.Order().Note,PIC:this.#t.Order().PIC,Number:this.#t.Order().Number||this.#t.LoadForm().Data.Order.Number,Date:this.#t.Order().Date||this.#t.LoadForm().Data.Order.Date}),Items:[...t]});return this.#e.post(pt.SubmitAdjustment,n).pipe(rt(this.destroy$))}return Me}),Oe(e=>bn(()=>new Error(e))))}onUpdateOrderState(e,t){if(Object.keys(this.#t.Order()).includes(e)){let i=Y(V({},this.#t.Order()),{[e]:t});this.#t.onChangeAdjustmentOrder(i)}else console.error(`Error updating order state with key ${e}`)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var Je=class r{destroy$=new ot;#t=h(j);#e=h(H);#n=h(Pt);orderService=h(Tt);getLoadForm$=this.#t.post("/API/Adjustment/LoadForm",{EntityID:w.GuidEmpty,ID:w.GuidEmpty}).pipe(Mn(),N(e=>{this.#e.onChangeLoadform(e)}));constructor(){}httpRequestLoadForm$(e){return st(this.#e.IsComplete,{injector:this.#n}).pipe(rt(this.destroy$),W(t=>!t),Z(t=>this.#t.post("/API/Adjustment/LoadForm",V({EntityID:"00000000-0000-0000-0000-000000000000",ID:"00000000-0000-0000-0000-000000000000"},e))),N(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var ui=class r{destroy$=new ot;#t=h(H);#e=h(j);#n=h(Tt);#i=h(Pt);constructor(){this.initialize()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initialize(){xe([st(this.#t.Outlet,{injector:this.#i}),st(this.#t.AdjustmentState,{injector:this.#i}),st(this.#t.IsComplete,{injector:this.#i})]).pipe(Mn(),W(([e,t,n])=>w.IsNotEmpty(e.ID)&&!n),Z(([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 Me}}handleStateZero(e){return this.#e.get(`/api/AdjustmentLoader/LoadRegister?EntityID=${e.ID}&IsEdit=false`).pipe(rt(this.destroy$),N(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(rt(this.destroy$),N(t=>{this.#t.onChangeQuickeyItems(t)}))}getQuickey(e){return this.#e.get(pt.GetQuickKeyByEntityID,[{key:"ID",value:e}])}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var qi=class{get Variant(){return this._Variant}set Variant(e){this._Variant=e}get QtyRequested(){return this._QtyRequested}set QtyRequested(e){this._QtyRequested=e}get TotalPrice(){return this._TotalPrice}set TotalPrice(e){this._TotalPrice=e}get SalesName(){return this._SalesName}set SalesName(e){this._SalesName=e}get PriceNote(){return this._PriceNote}set PriceNote(e){this._PriceNote=e}get SalesID(){return this._SalesID}set SalesID(e){this._SalesID=e}get InventoryTypeID(){return this._InventoryTypeID}set InventoryTypeID(e){this._InventoryTypeID=e}get ID(){return this._ID}set ID(e){this._ID=e}get Code(){return this._Code}set Code(e){this._Code=e}get VariantID(){return this._VariantID}set VariantID(e){this._VariantID=e}get Quantity(){return this._Quantity}set Quantity(e){this._Quantity=e}get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(e){this._UnitQuantity=e}get Expense(){return this._Expense}set Expense(e){this._Expense=e}get Cost(){return this._Cost}set Cost(e){this._Cost=e}get Price(){return this._Price}set Price(e){this._Price=e}get Discount(){return this._Discount}set Discount(e){this._Discount=e}get Note(){return this._Note}set Note(e){this._Note=e}get Taxable(){return this._Taxable}set Taxable(e){this._Taxable=e}get LoyaltyPoint(){return this._LoyaltyPoint}set LoyaltyPoint(e){this._LoyaltyPoint=e}get UnitPriceOriginal(){return this._UnitPriceOriginal}set UnitPriceOriginal(e){this._UnitPriceOriginal=e}get DiscountAmount(){return this._DiscountAmount}set DiscountAmount(e){this._DiscountAmount=e}get Name(){return this._Name}set Name(e){this._Name=e}get PriceTypeID(){return this._PriceTypeID}set PriceTypeID(e){this._PriceTypeID=e}get Storage(){return this._Storage}set Storage(e){this._Storage=e}get Serial(){return this._Serial}set Serial(e){this._Serial=e}get ThumbnailUrl(){return this._ThumbnailUrl}set ThumbnailUrl(e){this._ThumbnailUrl=e}get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}get TypeID(){return this._TypeID}set TypeID(e){this._TypeID=e}get VariantUnitQuantity(){return this._VariantUnitQuantity}set VariantUnitQuantity(e){this._VariantUnitQuantity=e}get UOM(){return this._UOM}set UOM(e){this._UOM=e}get UOMName(){return this._UOMName}set UOMName(e){this._UOMName=e}_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;constructor(e,t,n,i,s,y,E,mt,xt,St,Dt,At,Bt,vt,Jt,Yt,Zt,Xt,te,ee,ne,ie,Ze,Xe,tn,en,nn,rn,on,an,sn){this._Variant=e,this._QtyRequested=t,this._TotalPrice=n,this._SalesName=i,this._PriceNote=s,this._SalesID=y,this._InventoryTypeID=E,this._ID=mt,this._Code=xt,this._VariantID=St,this._Quantity=Dt,this._UnitQuantity=At,this._Expense=Bt,this._Cost=vt,this._Price=Jt,this._Discount=Yt,this._Note=Zt,this._Taxable=Xt,this._LoyaltyPoint=te,this._UnitPriceOriginal=ee,this._DiscountAmount=ne,this._Name=ie,this._PriceTypeID=Ze,this._Storage=Xe,this._Serial=tn,this._ThumbnailUrl=en,this._UnitPrice=nn,this._TypeID=rn,this._VariantUnitQuantity=on,this._UOM=an,this._UOMName=sn}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}}},Gi=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,n,i,s,y,E,mt,xt,St,Dt,At,Bt,vt,Jt,Yt,Zt,Xt,te,ee,ne,ie,Ze,Xe,tn,en,nn,rn,on,an,sn,ko,Ao,No,Vo,Fo,Uo,Lo,Ro,Qo,Bo,Ho,Wo,qo,Go,zo,$o,Ko,Jo,Yo,Zo,Xo,ta,ea,na){this._OnHand=e,this._CategoryName=t,this._CategoryTypeID=n,this._PriceTypeID=i,this._PriceNote=s,this._UnitPriceOriginal=y,this._Ordered=E,this._BrandName=mt,this._ImageUrl=xt,this._ThumbnailUrl=St,this._Component=Dt,this._PriceBook=At,this._UOMName=Bt,this._Storage=vt,this._CategoryID=Jt,this._DiscountAmount=Yt,this._VariantUnitQuantity=Zt,this._ProductCreated=Xt,this._ProductID=te,this._ProductIndex=ee,this._Code=ne,this._TypeID=ie,this._UnitQuantity=Ze,this._SalesCommission=Xe,this._Description=tn,this._Image=en,this._Discontinued=nn,this._Taxable=rn,this._LoyaltyPoint=on,this._PackSize=an,this._CreatorId=sn,this._Created=ko,this._UnitExpense=Ao,this._SellPriceType=No,this._VariantType=Vo,this._CostCurrencyID=Fo,this._UnitCost=Uo,this._OrderPrice=Lo,this._OrderPriceDiscount=Ro,this._OrderPriceDiscountDetail=Qo,this._PriceCurrencyID=Bo,this._UnitPrice=Ho,this._PriceDiscount=Wo,this._PaymentTypeID=qo,this._PaymentTypeString=Go,this._SellPriceTypeString=zo,this._Weight=$o,this._CostCurrencySymbol=Ko,this._PriceCurrencySymbol=Jo,this._UOM=Yo,this._MeasurementID=Zo,this._UOMQ=Xo,this._Name=ta,this._Model=ea,this._ID=na}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}}},Kt=class r{adapt(e){return new qi(e.Variant??null,e.QtyRequested??null,e.TotalPrice??null,e.SalesName??null,e.PriceNote??null,e.SalesID??null,e.InventoryTypeID??null,e.ID??null,e.Code??null,e.VariantID??null,e.Quantity??null,e.UnitQuantity??null,e.Expense??null,e.Cost??null,e.Price??null,e.Discount??null,e.Note??null,e.Taxable??null,e.LoyaltyPoint??null,e.UnitPriceOriginal??null,e.DiscountAmount??null,e.Name??null,e.PriceTypeID??null,e.Storage??null,e.Serial??null,e.ThumbnailUrl??null,e.UnitPrice??null,e.TypeID??null,e.VariantUnitQuantity??null,e.UOM??null,e.UOMName??null).toJSON()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})},Ye=class r{adapt(e){return new Gi(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var _i=class r{modalConfig;storeService=h(H);#t=h(Re);#e=h(gt);form;constructor(){this.modalConfig=new ht,this.modalConfig.customWidth="400px",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]})}onOK(){let e=this.form.value;this.#e.close(e)}onCancel(){this.#e.close()}ngOnInit(){this.generateForm()}handleKeyDown(e){console.log("event",e),e.code==="F2"&&this.onOK()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-modal-cart-note"]],hostBindings:function(t,n){t&1&&g("keydown",function(s){return n.handleKeyDown(s)},!1,Vt)},standalone:!0,features:[z],decls:11,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100",3,"formGroup"],[1,"w-100"],[1,"mb-3"],["type","text","formControlName","PIC",1,"form-control","w-100","height-input"],[1,"w-100","mt-4"],["formControlName","Note","rows","4",1,"form-control","w-100","ps-2"]],template:function(t,n){t&1&&(o(0,"modal-material",0),g("onOk",function(){return n.onOK()})("onCancel",function(){return n.onCancel()})("onClose",function(){return n.onCancel()}),o(1,"content")(2,"div",1)(3,"div",2)(4,"strong",3),m(5,"PIC"),a(),f(6,"input",4),a(),o(7,"div",5)(8,"strong",3),m(9,"Note"),a(),f(10,"textarea",6),a()()()()),t&2&&(p("config",n.modalConfig),l(2),p("formGroup",n.form))},dependencies:[jt,Ct,de,at,U,Ve,ue,Ue,Le]})};var gi=class r{modalConfig;#t=h(gt);constructor(){this.modalConfig=new ht,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||r)};static \u0275cmp=P({type:r,selectors:[["POS-modal-cart-void"]],standalone:!0,features:[z],decls:5,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"fw-normal"]],template:function(t,n){t&1&&(o(0,"modal-material",0),g("onOk",function(){return n.onOK()})("onCancel",function(){return n.onCancel()})("onClose",function(){return n.onCancel()}),o(1,"content")(2,"div",1)(3,"h4",2),m(4,"This will erase all current data. Are you sure?"),a()()()()),t&2&&p("config",n.modalConfig)},dependencies:[jt,Ct]})};var Et=class r{variantSearchCTRL=new Fe({});#t=h(H);#e=h(j);#n=h(Pt);#i=h(Kt);#r=h(ft);#o=h(Ye);destroy$=new ot;#a=this.variantSearchCTRL.valueChanges.pipe(rt(this.destroy$),W(e=>w.IsNotEmpty(e)),Z(e=>e.type==="ID"?this.httpGetVariantByID(e.str):this.httpRequestVariantByCode(e.str)));constructor(){}httpGetVariantByID(e){let t={entityID:this.#t.Outlet().ID,id:e};return this.#e.post("/API/catalog/variant/GetVariantByID",t).pipe(bt(n=>this.generateCartItem(n)))}httpRequestVariantByCode(e){return this.#e.get(`${pt.GetVariantByCode}?Code=${e}&EntityID=${this.#t.Outlet().ID}`).pipe(bt(t=>this.generateCartItem(t)))}httpRequestGetInventoryByVariantID(e){return st(this.#t.Outlet,{injector:this.#n}).pipe(rt(this.destroy$),W(t=>w.IsNotEmpty(t.ID)),Te(),Z(t=>this.#e.get(pt.GetVariantStockByID,[{key:"EntityID",value:t.ID},{key:"ID",value:e}])))}addItemByVariantID(e){this.httpGetVariantByID(e).pipe(rt(this.destroy$),N(t=>this.onAddCartItem(t))).subscribe()}onAddCartItem(e,t=!1){let n=this.#t.CartItems(),i=n.findIndex(y=>y.VariantID===e.VariantID),s=[];i!==-1?t?s=[...n,e]:(n[i].Quantity+=1,s=[...n]):s=[...n,e],this.#t.onChangeCartItems(s)}generateCartItem(e){return this.#i.adapt(Y(V({},e),{ID:w.GuidEmpty,Cost:e.UnitCost,Expense:e.UnitCost,SplitQuantity:0,UnitCost:e.UnitCost,InventoryTypeID:4,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:w.GuidEmpty,VariantUnitQuantity:e.VariantUnitQuantity,Storage:e.Storage,UOM:e.UOM,UOMName:e.UOMName,VariantID:e.ID,Variant:this.#o.adapt(e)}))}onRemoveCartItem(e){let t=this.#t.CartItems().filter((n,i)=>e!==i);this.#t.onChangeCartItems(t)}onOpenCartNoteModal(){return this.#r.open(_i)}onOpenCartVoidModal(){return this.#r.open(gi)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var nm=(r,e)=>e.key,im=r=>({selected:r}),rm=()=>["/menu/Products/Catalog/Variants/Info"];function om(r,e){if(r&1){let t=v();o(0,"a",8),g("click",function(){d(t);let i=c().$implicit,s=c();return u(s.onTabChange(i.key))}),m(1),a()}if(r&2){let t=c().$implicit,n=c();p("ngClass",A(2,im,n.activeTab().key===t.key)),l(),M(" ",t.label," ")}}function am(r,e){if(r&1&&_(0,om,2,4,"a",7),r&2){let t=e.$implicit;re(t.isVisible?0:-1)}}function sm(r,e){r&1&&(o(0,"div",12)(1,"h5"),m(2,"Cost"),a(),f(3,"input",18),a())}function lm(r,e){if(r&1){let t=v();o(0,"div",5)(1,"div",9)(2,"div",10)(3,"h5"),m(4,"Qty"),a(),f(5,"input",11,0),a(),o(7,"div",12)(8,"h5"),m(9,"Price"),a(),f(10,"input",13),a(),_(11,sm,4,0,"div",14),a(),q(12),o(13,"div",9)(14,"div",15)(15,"h5",16),m(16,"Note"),a(),o(17,"POS-tinymce-editor",17),g("valueChange",function(i){d(t);let s=c();return u(s.onNoteChange(i))}),a()()(),G(),a()}if(r&2){let t,n=c();p("formGroup",n.form),l(11),p("ngIf",n.roleService.product.Cost),l(6),p("value",(t=n.form.get("Note"))==null?null:t.value)}}function mm(r,e){if(r&1&&f(0,"img",30),r&2){let t=c(3);p("ngSrc",t.cartItem.ThumbnailUrl)}}function pm(r,e){r&1&&_(0,mm,1,1,"ng-template")}function cm(r,e){r&1&&(q(0),f(1,"i",31),o(2,"h6"),m(3,"No Image"),a(),G())}function dm(r,e){if(r&1&&(q(0),o(1,"div",19)(2,"div",20)(3,"a",21),_(4,pm,1,0)(5,cm,4,0,"ng-container"),a()(),o(6,"div",22)(7,"div",23),f(8,"i",24),o(9,"div",25),m(10," Inventory "),a()(),o(11,"table",26)(12,"tbody")(13,"tr")(14,"td",27),m(15," On Hand "),a(),o(16,"td",28),m(17),a()(),o(18,"tr")(19,"td",29),m(20,"Allocated"),a(),o(21,"td",28),m(22),a()(),o(23,"tr")(24,"td",29),m(25,"Available"),a(),o(26,"td",28),m(27),a()(),o(28,"tr")(29,"td",29),m(30,"ROP"),a(),o(31,"td",28),m(32),a()(),o(33,"tr")(34,"td",29),m(35,"Max"),a(),o(36,"td",28)(37,"span"),m(38),a()()()()()()(),G()),r&2){let t=c();l(3),p("routerLink",X(7,rm)),l(),re(t.cartItem.ThumbnailUrl?4:5),l(13),M(" ",t.inventory().ON_HAND," "),l(5),M(" ",t.inventory().ALLOCATED," "),l(5),M(" ",t.inventory().AVAILABLE," "),l(5),M(" ",t.inventory().ROP," "),l(6),b(t.inventory().MAX)}}function um(r,e){if(r&1){let t=v();o(0,"POS-tab-serial",32),D("variantChange",function(i){d(t);let s=c();return x(s.cartItem,i)||(s.cartItem=i),u(i)})("serialsChange",function(i){d(t);let s=c();return x(s.serials,i)||(s.serials=i),u(i)}),a()}if(r&2){let t=c();p("isEditBuyForm",!1)("outletID",t.storeService.Outlet().ID),S("variant",t.cartItem)("serials",t.serials)}}var fi=class r{constructor(e){this.data=e;this.cartItem=JSON.parse(JSON.stringify(this.storeService.CartItems()[this.data.index])),this.modalConfig.title=this.cartItem.Variant.Name,this.modalConfig.customWidth="650px",this.modalConfig.bodyScrollable=!0}storeService=h(H);roleService=h(R);modalConfig=new ht;cartItem;form;tabs=ct([]);activeTab=xn(()=>this.tabs().filter(e=>e.isActive)[0]);isItemSerial=ct(!1);inventory=ct({ON_HAND:0,ALLOCATED:0,AVAILABLE:0,ROP:0,MAX:0});serials=[];#t=h(Re);#e=h(gt);#n=h(Kt);#i=h(Et);#r=h(Pt);#o=h(_t);itemQuantity=ct(1);itemPrice=ct("");itemCost=ct("");itemNote=ct("");onTabChange(e){let t=this.tabs().map(n=>n.key===e?Y(V({},n),{isActive:!0}):Y(V({},n),{isActive:!1}));this.tabs.set(t)}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(){st(this.storeService.CartItems,{injector:this.#r}).pipe(N(e=>{this.cartItem=e[this.data.index]})).subscribe(),this.generateForm(),this.isItemSerial.set(this.checkIsSerial()),this.tabs.set([{key:0,value:"cart",label:"Cart",isActive:!0,isVisible:!0},{key:1,value:"product",label:"Product",isActive:!1,isVisible:this.roleService.inventory.View&&this.cartItem.Variant.Name.length>0},{key:2,value:"serial",label:"Serial",isActive:!1,isVisible:!0}]),this.requestUnitInStock().subscribe({next:e=>this.inventory.set(Y(V({},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)}))}),this.form.valueChanges.pipe(N(e=>{let t=this.storeService.CartItems().reduce((n,i,s)=>(this.data.index===s?n.push(V({},this.#n.adapt(Y(V({},i),{Quantity:+e.Quantity,Price:+e.Price,Cost:+e.Cost,Note:e.Note})))):n.push(i),n),[]);this.storeService.onChangeCartItems(t)}),ve("edit")).subscribe()}onNoteChange(e){this.form.get("Note").setValue(e)}onOK(){if(this.checkIsSerial()){if(Array.isArray(this.cartItem.Serial)&&this.cartItem.Serial.length){let e=this.cartItem.Serial.reduce((t,n)=>t+n.Quantity,0);if(this.cartItem.Quantity!==e){this.#o.warning("Serial must be equal with the quantity",tt.Warning);return}}if(this.cartItem.Quantity<0){let e=this.storeService.CartItems().reduce((t,n,i)=>(this.data.index===i?t.push(V({},this.#n.adapt(Y(V({},n),{Quantity:+this.cartItem.Quantity,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):t.push(n),t),[]);this.storeService.onChangeCartItems(e)}if(this.cartItem.Quantity>0){let e=this.storeService.CartItems().reduce((t,n,i)=>(this.data.index===i?t.push(V({},this.#n.adapt(Y(V({},n),{Quantity:+this.cartItem.Quantity,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):t.push(n),t),[]);this.storeService.onChangeCartItems(e)}}else{let e=this.storeService.CartItems().reduce((t,n,i)=>(this.data.index===i?t.push(V({},this.#n.adapt(Y(V({},n),{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(n),t),[]);this.storeService.onChangeCartItems(e)}this.#e.close()}checkIsSerial(){return this.cartItem.Variant!==void 0?this.cartItem.Variant.TypeID===4:!1}requestUnitInStock(){if(w.IsEmpty(this.storeService.Outlet().ID)){this.#o.error("Please select outlet before proceding...",tt.Error);return}return st(this.activeTab,{injector:this.#r}).pipe(W(e=>e.key===1),Te(),Z(e=>this.#i.httpRequestGetInventoryByVariantID(this.cartItem.VariantID)))}onCancel(){this.#e.close()}static \u0275fac=function(t){return new(t||r)(C(ge))};static \u0275cmp=P({type:r,selectors:[["adjustment-modal-edit-product"]],standalone:!0,features:[z],decls:11,vars:2,consts:[["qty",""],[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"row","border-bottom"],[1,"container-fluid","mt-5"],[3,"formGroup"],[3,"isEditBuyForm","outletID","variant","serials"],[1,"btn","btn-link",3,"ngClass"],[1,"btn","btn-link",3,"click","ngClass"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["formControlName","Price","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],["class","col-auto ps-0",4,"ngIf"],[1,"col-12"],[1,"mb-5"],["height","220px",3,"valueChange","value"],["formControlName","Cost","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"row"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink"],[1,"col-sm-6"],[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","text-start",2,"width","100px"],[1,"text-end"],[1,"table-light","text-start"],["width","400","height","400",1,"border","rounded",3,"ngSrc"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[3,"variantChange","serialsChange","isEditBuyForm","outletID","variant","serials"]],template:function(t,n){if(t&1&&(o(0,"modal-material",1),g("onOk",function(){return n.onOK()})("onCancel",function(){return n.onCancel()})("onClose",function(){return n.onCancel()}),o(1,"content")(2,"div",2)(3,"div",3)(4,"div"),ln(5,am,1,1,null,null,nm),a()()(),o(7,"div",4),_(8,lm,18,3,"div",5)(9,dm,39,8,"ng-container")(10,um,1,4,"POS-tab-serial",6),a()()()),t&2){let i;p("config",n.modalConfig),l(5),mn(n.tabs()),l(3),re((i=n.activeTab().key)===0?8:i===1?9:i===2?10:-1)}},dependencies:[jt,Ct,Ne,Ae,F,ue,at,U,Ve,Ue,Le,ze,Ge,un,ut,or,$e,Qe,Mt],styles:[".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}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 _m(r,e){if(r&1){let t=v();o(0,"div",27)(1,"button",28),g("click",function(){d(t);let i=c().index,s=c(2);return u(s.onReturnVariant(i))}),m(2," Return "),a(),o(3,"button",28),g("click",function(){d(t);let i=c().index,s=c(2);return u(s.onPurchaseVariant(i))}),m(4," Purchase "),a()()}}function gm(r,e){if(r&1&&(o(0,"td",29),m(1),a()),r&2){let t=c().index;l(),M(" ",t+1,". ")}}function fm(r,e){if(r&1){let t=v();q(0),o(1,"div",30)(2,"img",31),g("error",function(i){d(t);let s=c(3);return u(s.onErrorImage(i))}),a()(),G()}if(r&2){let t=c().$implicit;l(2),p("src",t.Variant.ThumbnailUrl,se)("alt",t.Variant.Name)}}function hm(r,e){r&1&&(o(0,"div",32),f(1,"i",33),a())}function Cm(r,e){if(r&1&&(o(0,"span"),m(1),I(2,"number"),a()),r&2){let t=c().$implicit;l(),b(O(2,1,t.Quantity))}}function ym(r,e){r&1&&(o(0,"span",34),m(1," x "),a())}function vm(r,e){if(r&1&&(o(0,"span"),m(1),I(2,"number"),a()),r&2){let t=c().$implicit;l(),b(O(2,1,t.UnitQuantity))}}function bm(r,e){if(r&1&&(q(0),o(1,"small",35),m(2),a(),G()),r&2){let t=c().$implicit;l(2),b(t.Variant.UOM?t.Variant.UOMName:"")}}function Im(r,e){if(r&1&&(q(0),o(1,"div",36),m(2),I(3,"number"),a(),G()),r&2){let t=c().$implicit;l(2),M(" ",Q(3,1,t.Price,"1.0-4")," ")}}function xm(r,e){if(r&1){let t=v();q(0),o(1,"tr",7),g("click",function(){let i=d(t).index,s=c(2);return u(s.onOpenModalEditProduct(i))}),_(2,_m,5,0,"ng-template",null,1,$)(4,gm,2,1,"td",8),o(5,"td",9)(6,"div",10),_(7,fm,3,2,"ng-container",3)(8,hm,2,0,"ng-template",null,2,$),o(10,"div",11)(11,"div"),m(12),a(),o(13,"span",12),m(14),a(),o(15,"div"),f(16,"app-serial-note",13),a(),f(17,"small",14),a()()(),o(18,"td",15)(19,"div",16)(20,"div",17)(21,"span"),_(22,Cm,3,3,"span",18)(23,ym,2,0,"span",19)(24,vm,3,3,"span",18),a(),_(25,bm,3,1,"ng-container",18),a()()(),o(26,"td"),_(27,Im,4,4,"ng-container",18),a(),o(28,"td")(29,"div",20),m(30),I(31,"number"),a()(),o(32,"td",21)(33,"div",16)(34,"div",22),m(35),I(36,"number"),a()()(),o(37,"td",23)(38,"div",24)(39,"span",25),g("click",function(){let i=d(t).index,s=c(2);return u(s.removeCartItem(i))}),f(40,"i",26),a()()()(),G()}if(r&2){let t,n,i=e.$implicit,s=yt(3),y=yt(9),E=c(2);l(),p("cdkContextMenuTriggerFor",s),l(3),p("ngIf",(t=E.AppConfigJSON())==null?null:t.ModuleSell.Grid.RowNumberVisible),l(3),p("ngIf",i.Variant.ThumbnailUrl)("ngIfElse",y),l(5),b(i.Variant.Name),l(2),b(i.Variant.Code),l(2),p("serials",i.Serial),l(),p("innerHtml",i.Note,L),l(5),p("ngIf",i.Quantity!=1||i.UnitQuantity>1),l(),p("ngIf",i.UnitQuantity>1||i.UnitQuantity<-1),l(),p("ngIf",i.UnitQuantity>1||i.UnitQuantity<-1),l(),p("ngIf",i.Variant.UOM&&((n=E.AppConfigJSON())==null||n.ModuleSell==null?null:n.ModuleSell.Grid.UOMVisible)),l(2),p("ngIf",i.UnitPrice!==i.Total&&i.Quantity>1),l(3),M(" ",i.Discount?O(31,15,i.Discount*-1)+"%":""," "),l(5),M(" ",E.roleService.product!=null&&E.roleService.product.Price?O(36,17,+i.Quantity*+i.Variant.UnitPrice):" - "," ")}}function Sm(r,e){if(r&1){let t=v();q(0),o(1,"table",4)(2,"tbody",5),g("cdkDropListDropped",function(i){d(t);let s=c();return u(s.onDrop(i))}),_(3,xm,41,19,"ng-container",6),a()(),G()}if(r&2){let t=c();l(3),p("ngForOf",t.CartItems())}}function Dm(r,e){r&1&&(o(0,"div",37)(1,"div",38)(2,"div",39)(3,"div",40)(4,"div",41),f(5,"i",42),a(),o(6,"div",43)(7,"span"),m(8,"Empty Cart"),a(),f(9,"br"),o(10,"span"),m(11,"Add products to the cart"),a(),f(12,"br"),o(13,"span"),m(14,"or scan barcode"),a()()()()()())}var hi=class r{roleService=h(R);storeService=h(H);cartService=h(Et);matDialog=h(ft);renderer=h(er);#t=h(Kt);CartItems=this.storeService.CartItems;AppConfigJSON=this.storeService.AppConfigJSON;onDrop(e){}onOpenModalEditProduct(e){let t=this.matDialog.open(fi,{data:{index:e}})}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((n,i,s)=>(e===s?n.push(V({},this.#t.adapt(Y(V({},i),{Quantity:-Math.abs(i.Quantity),TotalPrice:-Math.abs(i.Quantity)*i.Price})))):n.push(i),n),[]);this.storeService.onChangeCartItems(t)}onPurchaseVariant(e){let t=this.storeService.CartItems().reduce((n,i,s)=>(e===s?n.push(V({},this.#t.adapt(Y(V({},i),{Quantity:Math.abs(i.Quantity),TotalPrice:Math.abs(i.Quantity)*i.Price})))):n.push(i),n),[]);this.storeService.onChangeCartItems(t)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart-display"]],standalone:!0,features:[z],decls:3,vars:2,consts:[["EMPTY_CART",""],["context_menu",""],["NO_IMAGE",""],[4,"ngIf","ngIfElse"],[1,"table","table-borderless"],["cdkDropList","",3,"cdkDropListDropped"],[4,"ngFor","ngForOf"],["cdkDrag","",1,"border-bottom",2,"padding-left","12px",3,"click","cdkContextMenuTriggerFor"],["style","width: 10px; padding-left: 12px",4,"ngIf"],[1,"pe-0",2,"width","50%","padding-left","12px"],[1,"d-flex","align-items-center"],[1,"d-block","ms-6",2,"line-height","18px"],[1,"fw-normal","fs-6","text-muted"],[3,"serials"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",3,"innerHtml"],[1,"px-0","text-end",2,"width","15%"],[1,"d-flex","align-items-center","justify-content-end"],[1,"d-flex","text-end","fw-normal","align-items-center",2,"line-height","20px"],[4,"ngIf"],["class","fs-6",4,"ngIf"],[1,"fw-normal","fs-5","text-danger"],["data-test","total",1,"pe-0"],[1,"fs-5"],[1,"mt-6","ps-0"],[1,"d-flex","justify-content-end","align-items-center"],["role","button","title","Delete Item",1,"fs-3","cursor-pointer",3,"click"],[1,"fa","fa-trash","text-danger","fs-4"],["cdkMenu","",1,"example-menu"],["cdkMenuItem","",1,"example-menu-item",3,"click"],[2,"width","10px","padding-left","12px"],[1,""],[1,"object-fit-contain",2,"height","55px","width","55px",3,"error","src","alt"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6"],["title","UOM",1,"ps-1","fs-5"],[1,"fs-5","text-end"],[1,"row","g-0","h-100"],[1,"col-12"],[1,"d-flex","justify-content-center","align-items-center","h-100"],[1,"row"],[1,"col-12","d-flex","justify-content-center"],[1,"fa-regular","fa-cart-arrow-up","text-secondary",2,"font-size","110px"],[1,"col-12","justify-content-center","text-center","mt-5","empty-cart-description","text-secondary","headings-font-family"]],template:function(t,n){if(t&1&&_(0,Sm,4,1,"ng-container",3)(1,Dm,15,0,"ng-template",null,0,$),t&2){let i=yt(2);p("ngIf",n.CartItems().length>0)("ngIfElse",i)}},dependencies:[F,wn,K,Pn,ye,nt,Gr,Wr,Hr,qr],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 Ci=class r{storeService=h(H);cartService=h(Et);orderService=h(Tt);loadFormService=h(Je);roleService=h(R);#t=h(Nt);onProcess=new et;onOpenModalNote=new et;onOpenModalVoid=new et;constructor(){}onProcessHandler(){this.onProcess.emit()}onOpenModalNoteHandler(){this.onOpenModalNote.emit(),this.cartService.onOpenCartNoteModal().afterClosed().subscribe({next:t=>{Object.keys(t).forEach(n=>{this.orderService.onUpdateOrderState(n,t[n])})}})}onOpenModalVoidHandler(){this.onOpenModalVoid.emit(),this.cartService.onOpenCartVoidModal().afterClosed().pipe(W(t=>t.type==="OK"),Z(()=>this.loadFormService.getLoadForm$),N(()=>{this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeCartItems([]),this.storeService.onChangeIsOpenDialog(!1),this.#t.navigate(["/menu/Adjustment/Adjustment/Archive/Form/V2"])})).subscribe()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart-action"]],outputs:{onProcess:"onProcess",onOpenModalNote:"onOpenModalNote",onOpenModalVoid:"onOpenModalVoid"},standalone:!0,features:[z],decls:13,vars:2,consts:[[1,"row","g-0","pb-6","px-5"],[1,"col-5","d-flex","justify-content-between","pe-5",2,"column-gap","12px"],["type","button",1,"btn","btn-gray","fs-3","py-6","headings-font-family",2,"flex-grow","1",3,"click"],[1,"fa-regular","fa-note-sticky","fa-xl"],["type","button",1,"btn","btn-gray","fs-3","px-0","py-6","headings-font-family","d-flex","gap-2","justify-content-center","align-items-center",2,"flex-grow","8",3,"click"],[1,"fa-solid","fa-rectangle-xmark"],[1,"col-7"],["type","button",1,"btn","btn-success","w-100","fs-3","px-0","py-6",2,"border-left","0.1px solid #fff",3,"click"],[1,"fs-6"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"div",1)(2,"button",2),g("click",function(){return n.onOpenModalNoteHandler()}),f(3,"i",3),a(),o(4,"button",4),g("click",function(){return n.onOpenModalVoidHandler()}),f(5,"i",5),o(6,"span"),m(7,"Void"),a()()(),o(8,"div",6)(9,"button",7),g("click",function(){return n.onProcessHandler()}),m(10," Process "),o(11,"small",8),m(12),a()()()()),t&2&&(l(12),le("(",n.storeService.CartItems().length," items, ",n.storeService.QtyCartItems()," Qty)"))},styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};var yi=class r{cartService=h(Et);query=new Fe({});#t=h(j);#e=h(H);spinnerService=h(_o);constructor(){}onBarcodeScan(e){console.log("barcode",e)}ngOnInit(){this.query.valueChanges.pipe(ve("query"),W(e=>e&&Object.keys(e).length>0),N(e=>{this.spinnerService.show()}),Z(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 Me;return t.pipe(Oe(n=>n.status>=400&&n.status<=451?(console.error("Variant not found:",n.message),vn(null)):bn(()=>n)))}),N(()=>this.spinnerService.hide())).subscribe({next:e=>{e&&this.cartService.onAddCartItem(e)},error:e=>{this.spinnerService.hide(),console.error("An error occurred:",e)}})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart-header"]],standalone:!0,features:[z],decls:4,vars:1,consts:[[1,"row"],[1,"col"],[1,""],[3,"onBarcodeScan","formControl"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"POS-variant-autocomplete",3),g("onBarcodeScan",function(s){return n.onBarcodeScan(s)}),a()()()()),t&2&&(l(3),p("formControl",n.query))},dependencies:[Fr,Qr,de,U,ue,Dn]})};var zi=class{constructor(e,t,n,i,s,y,E,mt,xt,St,Dt){this._StateID=e,this._StateLabel=t,this._Success=n,this._Message=i,this._InvoiceID=s,this._OrderID=y,this._InvoiceNumber=E,this._PrintMode=mt,this._DeliveryID=xt,this._PaymentStateID=St,this._PaymentStateLabel=Dt}_StateID;get StateID(){return this._StateID}set StateID(e){this._StateID=e}_StateLabel;get StateLabel(){return this._StateLabel}set StateLabel(e){this._StateLabel=e}_Success;get Success(){return this._Success}set Success(e){this._Success=e}_Message;get Message(){return this._Message}set Message(e){this._Message=e}_InvoiceID;get InvoiceID(){return this._InvoiceID}set InvoiceID(e){this._InvoiceID=e}_OrderID;get OrderID(){return this._OrderID}set OrderID(e){this._OrderID=e}_InvoiceNumber;get InvoiceNumber(){return this._InvoiceNumber}set InvoiceNumber(e){this._InvoiceNumber=e}_PrintMode;get PrintMode(){return this._PrintMode}set PrintMode(e){this._PrintMode=e}_DeliveryID;get DeliveryID(){return this._DeliveryID}set DeliveryID(e){this._DeliveryID=e}_PaymentStateID;get PaymentStateID(){return this._PaymentStateID}set PaymentStateID(e){this._PaymentStateID=e}_PaymentStateLabel;get PaymentStateLabel(){return this._PaymentStateLabel}set PaymentStateLabel(e){this._PaymentStateLabel=e}toJSON(){return{StateID:this.StateID,StateLabel:this.StateLabel,Success:this.Success,Message:this.Message,InvoiceID:this.InvoiceID,OrderID:this.OrderID,InvoiceNumber:this.InvoiceNumber,PrintMode:this.PrintMode,DeliveryID:this.DeliveryID,PaymentStateID:this.PaymentStateID,PaymentStateLabel:this.PaymentStateLabel}}},vi=class r{adapt(e){return new zi(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var bi=class r{constructor(e){this.dialogRef=e;this.config=new ht,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0}config;onClose(){this.dialogRef.close({role:"close"})}onCancel(){this.dialogRef.close({role:"cancel"})}submit(e){this.dialogRef.close({role:"ok",data:e})}static \u0275fac=function(t){return new(t||r)(C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-with-approval"]],standalone:!0,features:[z],decls:9,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid",2,"width","500px","display","flex","justify-content","space-around"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-file-pen"],[1,"btn","btn-outline-secondary","ms-5",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-user-magnifying-glass"]],template:function(t,n){t&1&&(o(0,"modal-material",0),g("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"div",2),g("click",function(){return n.submit(0)}),f(4,"i",3),m(5," Save as Draft "),a(),o(6,"div",4),g("click",function(){return n.submit(1)}),f(7,"i",5),m(8," Submit for Review "),a()()()()),t&2&&p("config",n.config)},dependencies:[jt,Ct]})};var Ii=class r{destroy$=new ot;#t=h(Tt);#e=h(H);#n=h(vi);toastr=h(_t);matDialog=h(ft);constructor(){}ngOnInit(){}onProcessOrder(){if(w.IsEmpty(this.#e.Outlet().ID)){this.toastr.error("Please select outlet before proceeding..",tt.Error);return}if(this.#e.CartItems().length==0){this.toastr.error("You must have at least one item.",tt.Error);return}if(w.IsEmpty(this.#e.Order().Number)){this.toastr.error("Number cannot be empty.",tt.Error);return}if(this.#e.Order().TypeID==2){let e=[...this.#e.CartItems()].map(n=>n.VariantID),t=new Set(e);if(e.length!=t.size){this.toastr.error("The cart should not have the same product/code in different rows. Please check again!",tt.Info);return}}switch(this.#e.AppConfigJSON().ModuleAdjustment.Basic.Workflow){case 1:this.#t.processOrder().pipe(rt(this.destroy$)).subscribe({next:e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))},error:e=>{console.log("error",e)}});break;case 2:this.#e.AdjustmentState()==0&&this.matDialog.open(bi).afterClosed().pipe(W(e=>e!=null&&e.role==="ok"),N(e=>{let t=e.data+1;this.#t.onUpdateOrderState("StateID",Number(t))}),Z(e=>this.#t.processOrder()),N(e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))})).subscribe(),this.#e.AdjustmentState()==1&&this.#t.processOrder().pipe(rt(this.destroy$)).subscribe({next:e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))},error:e=>{console.log("error",e)}});break}}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart"]],standalone:!0,features:[z],decls:9,vars:0,consts:[[1,"h-100","d-flex","flex-column"],[1,"pt-4"],[1,"row"],[1,"col"],[1,"",2,"overflow-y","auto","flex","1 1 0%","max-height","calc(100vh - 170px)"],[1,""],[3,"onProcess"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),f(4,"adjustment-cart-header"),a()()(),o(5,"div",4),f(6,"adjustment-cart-display"),a(),o(7,"div",5)(8,"adjustment-cart-action",6),g("onProcess",function(){return n.onProcessOrder()}),a()()())},dependencies:[hi,Ci,yi]})};var xi=class r{destroy$=new ot;#t=h(H);#e=h(j);#n=h(Pt);#i=h(Tt);constructor(){}httpGenerateNumber$(){let e=st(this.#t.Outlet,{injector:this.#n}),t=st(this.#t.IsComplete,{injector:this.#n});return xe([e,t]).pipe(rt(this.destroy$),W(([n,i])=>w.IsNotEmpty(n.ID)),Te(),Z(([n,i])=>this.#e.post("/API/Adjustment/GenerateNumber",{ID:n.ID}).pipe(bt(s=>s.Number))),N(n=>{this.#i.onUpdateOrderState("Number",n)}),In(1))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};function Pm(r,e){if(r&1&&(o(0,"div",25)(1,"div",26),m(2),a(),o(3,"div",26),m(4),a()()),r&2){let t=e.$implicit;l(2),b(t.Variant.Name),l(2),b(t.Quantity)}}var Si=class r{#t=h(it);#e=h(Sn);menu$;storeService=h(H);#n=h(Nt);#i=h(xi);#r=h(Tt);cartItems;constructor(){this.#t.setMenu$(),this.menu$=this.#t.menu$.pipe(bt(e=>Y(V({},e),{H:"Inventory Adjustment",T:e.T.replace("undefined","Inventory Adjustment")})),N(e=>this.#e.setTitle(e.T)))}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.#n.navigate(["menu/Adjustment/Adjustment/Archive/Form/V2"],{queryParams:{}}),this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeIsComplete(),this.storeService.onChangeCartItems([])})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-order-complete"]],hostBindings:function(t,n){t&1&&g("keydown.F8",function(){return n.handleF8()},!1,Vt)},inputs:{cartItems:"cartItems"},standalone:!0,features:[z],decls:36,vars:11,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"order-complete"],[1,"container-fluid","pt-8"],[1,"row"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"fa-solid","fa-check","me-3"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"card-footer"],[1,"d-flex","justify-content-between","py-5"],["target","_blank",1,"btn","bg-light-gray","btn-secondary",3,"click"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],["target","_blank",1,"",2,"cursor","pointer",3,"href"],[1,"card-body"],["class","row justify-content-between mb-3",4,"ngFor","ngForOf"],[1,"row","justify-content-end","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col-4","text-end"],[1,"row","justify-content-between","mb-3"],[1,"col","text-end"]],template:function(t,n){t&1&&(o(0,"mainpanel-cmp",0),I(1,"async"),o(2,"content")(3,"section",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"h1",7),f(10,"i",8),m(11,"Inventory Adjustment Complete "),a()(),o(12,"div",9)(13,"div",10)(14,"div",11)(15,"a",12),g("click",function(){return n.onNewAdjustment()}),m(16," New Adjustment (F8)"),a()()()(),o(17,"div",13)(18,"div",14)(19,"a",15),g("click",function(){return n.onPrintReceipt()}),f(20,"i",16),m(21,"Print Receipt"),a()()()()(),o(22,"div",17)(23,"div",5)(24,"div",18)(25,"h3",19)(26,"a",20),m(27),a()()(),o(28,"div",21),_(29,Pm,5,2,"div",22),o(30,"div",23)(31,"div",24),m(32,"Total:"),a(),o(33,"div",24),m(34),I(35,"number"),a()()()()()()()()()()),t&2&&(p("pageData",O(1,7,n.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),l(26),p("href","/menu/Adjustment/Adjustment/Archive/Info?ID="+n.storeService.OrderComplete().OrderID,se),l(),M("Adjustment #",n.storeService.OrderComplete().InvoiceNumber,""),l(2),p("ngForOf",n.cartItems),l(5),M(" ",O(35,9,n.storeService.QtyCartItems())," "))},dependencies:[me,nt,He,lt,K,Tn],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} #full-container{padding-top:60px!important}"]})};function wm(r,e){if(r&1&&(o(0,"div",16)(1,"div",17)(2,"div"),m(3),a(),o(4,"small",18),m(5),a()()()),r&2){let t=e.data;l(3),b(t==null?null:t.Value),l(2),b(t==null?null:t.Code)}}var hn=class r{modalConfig=new ht;cartService=h(Et);cartItem=ct(null);query=new Fe(null);form;#t=h(gt);unsubscribe$=new ot;#e=h(Re);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)}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:[""]})}onSelected(e){}ngOnInit(){this.initForm(),this.query.valueChanges.pipe(rt(this.unsubscribe$),Z(e=>this.cartService.httpGetVariantByID(e).pipe()),ve("get cart item")).subscribe({next:e=>{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()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-modal-cart-add"]],standalone:!0,features:[z],decls:29,vars:7,consts:[["itemTemplate",""],["qty",""],[3,"onCancel","onClose","onOk","config"],[1,"container","w-100","h-100"],[1,"row"],[1,"col-12"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"optionSelected","keyup.enter","formControl","renderThumbnail","useCustomTemplate","itemTemplate"],[3,"formGroup"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["autoNum","","formControlName","Price","type","text",1,"mt-5","form-control",2,"width","100px"],["autoNum","","formControlName","Cost","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"mb-5"],["height","220px",3,"valueChange","value"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"]],template:function(t,n){if(t&1){let i=v();o(0,"modal-material",2),g("onCancel",function(){return d(i),u(n.onCancel())})("onClose",function(){return d(i),u(n.onCancel())})("onOk",function(){return d(i),u(n.onOK())}),o(1,"content")(2,"div",3)(3,"div",4)(4,"div",5)(5,"autocompleteV2",6),g("optionSelected",function(y){return d(i),u(n.onSelected(y))})("keyup.enter",function(y){return d(i),u(y.stopPropagation())}),a(),_(6,wm,6,2,"ng-template",null,0,$),a()(),o(8,"div",7)(9,"div",8)(10,"div",9)(11,"h5"),m(12,"Qty"),a(),f(13,"input",10,1),a(),o(15,"div",11)(16,"h5"),m(17,"Price"),a(),f(18,"input",12),a(),o(19,"div",11)(20,"h5"),m(21,"Cost"),a(),f(22,"input",13),a()(),q(23),o(24,"div",8)(25,"div",5)(26,"h5",14),m(27,"Note"),a(),o(28,"POS-tinymce-editor",15),g("valueChange",function(y){return d(i),u(n.onChangeNote(y))}),a()()(),G(),a()()()()}if(t&2){let i,s=yt(7);p("config",n.modalConfig),l(5),p("formControl",n.query)("renderThumbnail",!0)("useCustomTemplate",!0)("itemTemplate",s),l(3),p("formGroup",n.form),l(20),p("value",(i=n.form.get("Note"))==null?null:i.value)}},dependencies:[Qe,Mt,En,Be,jt,Ct,Or,at,U,Ve,ue,Dn,Ue,Le,ze,Ge]})};var wo=Ei(ia());function Mm(r,e){if(r&1){let t=v();o(0,"POS-uppy",2),g("onParser",function(i){d(t);let s=c();return u(s.onParser(i))})("fileUploaded",function(i){d(t);let s=c();return u(s.onUploadCsv(i))})("fileRemoved",function(){d(t);let i=c();return u(i.onRemovedFile())}),a()}if(r&2){let t=c();p("sampleUrl",t.sampleURL)}}var Di=class r{modalConfig;sampleURL;fileInput=ct(null);unsubscribe$=new ot;#t=h(gt);#e=h(j);#n=h(H);#i=h(Et);#r=h(Pt);cartItem=ct([]);skipEmptyLines=!0;rowCount=ct(0);rowEmpty=ct(0);totalRows=xn(()=>this.rowCount()-this.rowEmpty());file=ct(null);constructor(){this.modalConfig=new ht,this.modalConfig.title="Import Items",this.modalConfig.customWidth="500px",this.sampleURL="https://cdn.dealpos.xyz/web-import-template/ImportItem_Adjustment_TemplateV2.csv"}onOK(){st(this.cartItem,{injector:this.#r}).pipe(Z(e=>{let t={EntityID:this.#n.Outlet().ID,CartItems:e};return this.#e.post("/API/Adjustment/UploadCsvV2",t).pipe(ve("response")).pipe(Oe(n=>[]))}),N(e=>{Array.isArray(e)&&e.length>0&&e.forEach(t=>this.#i.onAddCartItem(t,!0))})).subscribe(),this.#t.close()}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),wo.default.parse(t,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:n=>{let i=n.split(/\r?\n/).slice(1);return i[i.length-1]===""&&i.pop(),this.rowCount.set(i.length),i.forEach(s=>{s.split(",").every(E=>E==="")&&this.rowEmpty.update(E=>E+=1)}),n},error(n,i){console.log("ERROR",n,i)},complete:(n,i)=>{console.log("COMPLETE",n),this.cartItem.set(n.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||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-modal-cart-upload"]],standalone:!0,features:[z],decls:3,vars:1,consts:[["modalContent",""],[3,"onOk","onCancel","onClose","config"],[3,"onParser","fileUploaded","fileRemoved","sampleUrl"]],template:function(t,n){if(t&1){let i=v();o(0,"modal-material",1),g("onOk",function(){return d(i),u(n.onOK())})("onCancel",function(){return d(i),u(n.onClose())})("onClose",function(){return d(i),u(n.onClose())}),_(1,Mm,1,1,"ng-template",null,0,$),a()}t&2&&p("config",n.modalConfig)},dependencies:[jt,Ct,ur]})};function Om(r,e){if(r&1){let t=v();o(0,"li",11),g("click",function(){let i=d(t).$implicit,s=c(3);return u(s.onClickMenu(i))}),f(1,"POS-dropdown-item-more-action",12),a()}if(r&2){let t=e.$implicit;l(),p("icon",t.icon)("label",t.title)}}function Tm(r,e){if(r&1&&ln(0,Om,2,2,"li",10,ki),r&2){let t=c().$implicit;mn(t.children)}}function Em(r,e){if(r&1&&(o(0,"div",7)(1,"div",8),m(2),a(),f(3,"div",9),_(4,Tm,2,0),a()),r&2){let t=e.$implicit;l(2),b(t.title),l(2),re(t.children.length>0?4:-1)}}var Pi=class r{menu=ct([]);#t=h(ft);router=h(Nt);handleF8(){this.#t.openDialogs&&this.#t.openDialogs.length>0||this.#t.open(hn)}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"}]},{title:"Advanced",icon:"",children:[{title:"Adjustment V1",icon:"fa-scanner-gun fas",value:"adjustment v1"}]}];this.menu.set(e)}onClickMenu(e){switch(e.value){case"add":this.#t.open(hn);break;case"upload":this.#t.open(Di);break;case"adjustment v1":this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Form"]);break}}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-more-actions"]],hostBindings:function(t,n){t&1&&g("keydown.F4",function(s){return n.handleF8(s)},!1,Vt)},standalone:!0,features:[z],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","300px"],[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,n){t&1&&(o(0,"span",0)(1,"span",1),f(2,"i",2),a(),o(3,"span",3),m(4,"More Actions"),a()(),o(5,"div",4)(6,"div",5)(7,"div",6),ln(8,Em,5,2,"div",7,ki),a()()()),t&2&&(l(8),mn(n.menu()))},dependencies:[$r]})};var $i=class{constructor(e,t,n,i){this._Order=e,this._Items=t,this._OrderItems=n,this._CountedItems=i}_Order;get Order(){return this._Order}set Order(e){this._Order=e}_Items;get Items(){return this._Items}set Items(e){this._Items=e}_OrderItems;get OrderItems(){return this._OrderItems}set OrderItems(e){this._OrderItems=e}_CountedItems;get CountedItems(){return this._CountedItems}set CountedItems(e){this._CountedItems=e}},wi=class r{adapt(e){return new $i(e.Order,e.Items,e.OrderItems,e.CountedItems)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})},Ki=class{constructor(e,t,n,i,s,y,E,mt,xt,St,Dt,At,Bt,vt,Jt,Yt,Zt,Xt,te,ee,ne,ie){this._EntityID=e,this._Number=t,this._Date=n,this._PIC=i,this._Note=s,this._EntityName=y,this._StateID=E,this._StateLabel=mt,this._ReviewDate=xt,this._ReviewerID=St,this._TypeID=Dt,this._TypeLabel=At,this._Quantity=Bt,this._UnitPrice=vt,this._UnitCost=Jt,this._TotalPrice=Yt,this._AdjustedQuantity=Zt,this._CreatorID=Xt,this._Created=te,this._ModifierID=ee,this._Modified=ne,this._ID=ie}_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}},Mo=class r{adapt(e){return new Ki(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})},Ji=class{constructor(e,t,n,i,s,y,E,mt,xt,St,Dt,At){this._LostNFoundID=e,this._UnitCost=t,this._InventoryTypeID=n,this._UnitPrice=i,this._Discount=s,this._VariantID=y,this._Note=E,this._Quantity=mt,this._UnitQuantity=xt,this._Index=St,this._Serial=Dt,this._ID=At}_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}},Oo=class r{adapt(e){return new Ji(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})},Yi=class{constructor(e,t,n,i,s,y,E,mt,xt,St,Dt,At){this._ParentID=e,this._Start=t,this._Finish=n,this._UnitPrice=i,this._UnitCost=s,this._VariantID=y,this._Note=E,this._Quantity=mt,this._UnitQuantity=xt,this._Index=St,this._Serial=Dt,this._ID=At}_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}},To=class r{adapt(e){return new Yi(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var Eo=Ei(Tr());function jm(r,e){if(r&1&&(q(0),f(1,"adjustment-order-complete",2),G()),r&2){let t=c();l(),p("cartItems",t.storeService.CartItems())}}function km(r,e){if(r&1){let t=v();o(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"POS-select-outlet-form",8),I(6,"async"),g("ngModelChange",function(i){d(t);let s=c();return u(s.storeService.onChangeOutlet(i))}),a(),o(7,"POS-invoice-number-form",9),I(8,"async"),g("ngModelChange",function(i){d(t);let s=c();return u(s.onInvoiceNumberChange(i))}),a()(),o(9,"POS-invoice-date",10),g("ngModelChange",function(i){d(t);let s=c();return u(s.onChangeOrderDate(i))}),a()()(),o(10,"div",11)(11,"div",12)(12,"div",13),f(13,"adjustment-more-actions"),a(),o(14,"div",14),f(15,"i",15),o(16,"ng-select",16),g("ngModelChange",function(i){d(t);let s=c();return u(s.onChangeAdjustmentType(i))}),a()()()()(),o(17,"div",17)(18,"div",18)(19,"POS-quick-key",19),g("onSelectVariant",function(i){d(t);let s=c();return u(s.onSelectVariant(i))}),a()(),o(20,"div",20),f(21,"adjustment-cart"),a()()()}if(r&2){let t=c();l(5),p("disabled",t.storeService.AdjustmentState()===1)("isOpenAfterLoad",O(6,16,t.isOpenDiaglog$))("outlets",t.storeService.Outlets())("ngModel",t.storeService.Outlet()),l(2),p("ngModel",t.storeService.Order().Number)("transactionType",O(8,18,t.transactionType$))("disabled",!(t.roleService.global!=null&&t.roleService.global.Number)),l(2),p("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),p("clearable",!1)("ngModel",t.storeService.Order().TypeID)("disabled",!!t.storeService.Order().TypeID&&t.storeService.AdjustmentState()===1)("items",t.storeService.AdjustmentTypes()),l(3),p("quickKey",t.storeService.QuickeyItems())("outletID",t.storeService.Outlet().ID)}}var Mi=class r{isOpenDialog=ct(!0);loadFormService=h(Je);intercom=h(lr);storeService=h(H);quickeyService=h(ui);cartService=h(Et);orderService=h(Tt);isOpenDiaglog$;Outlets$;loadForm$;adjustmentEditDataAdapter=h(wi);roleService=h(R);#t=h(Kt);#e=h(Ye);#n=h(ce);transactionType$=this.#n.queryParamMap.pipe(bt(e=>(e.has("ID"),"Adjustment")));title=h(Sn);injector=h(Pt);test=[];ngOnInit(){this.intercom.hideLauncher();let e=JSON.parse(localStorage.getItem("AccountInfo"));this.title.setTitle(e.BrandName+" POS | New Inventory Adjustment"),this.test=this.storeService.Outlets()&&this.storeService.Outlets().filter((t,n)=>n===0),this.#n.queryParamMap.pipe(Z(t=>{if(t.has("ID")){this.storeService.onChangeAdjustmentState(1);let n={EntityID:"00000000-0000-0000-0000-000000000000",ID:t.get("ID")};return this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeAdjustmentState(1),this.loadFormService.httpRequestLoadForm$(n).pipe(N(i=>{if(i.Data&&Object.keys(i.Data).length>0&&Object.keys(this.storeService.LoadForm().Data).length>0){this.orderService.onUpdateOrderState("Number",i.Data.Order.Number),this.orderService.onUpdateOrderState("Date",new Date(i.Data.Order.Date)),this.orderService.onUpdateOrderState("StateID",i.Data.Order.StateID),this.orderService.onUpdateOrderState("TypeID",i.Data.Order.TypeID),this.orderService.onUpdateOrderState("EntityID",i.Data.Order.EntityID);let s=i.Data.Items.map(y=>this.#t.adapt(Y(V({},y),{Variant:this.#e.adapt(y.Variant)})));if(this.storeService.onChangeCartItems(s),this.orderService.onUpdateOrderState("PIC",i.Data.Order.PIC),this.orderService.onUpdateOrderState("Note",i.Data.Order.Note),i.Entities.length>0){let y=i.Entities.findIndex(E=>E.ID===i.Data.Order.EntityID);y!==-1&&this.storeService.onChangeOutlet(i.Entities[y])}}}))}return this.storeService.onChangeAdjustmentState(0),this.loadFormService.httpRequestLoadForm$()})).subscribe({}),st(this.storeService.IsOpenDialog,{injector:this.injector}).pipe().subscribe(),st(this.storeService.AppConfigJSON,{injector:this.injector}).pipe(N(t=>this.orderService.onUpdateOrderState("StateID",t?.ModuleAdjustment.Advance.AdjustmentInputType))).subscribe(),this.isOpenDiaglog$=st(this.storeService.IsOpenDialog,{injector:this.injector})}onChangeAdjustmentType(e){let t=this.storeService.AdjustmentTypes().filter(n=>n.Key===e)[0];this.orderService.onUpdateOrderState("TypeID",t.Key)}onInvoiceNumberChange(e){this.orderService.onUpdateOrderState("Number",e)}onChangeOrderDate(e){this.orderService.onUpdateOrderState("Date",(0,Eo.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||r)};static \u0275cmp=P({type:r,selectors:[["POS-adjustment-v2"]],standalone:!0,features:[z],decls:3,vars:2,consts:[["ON_GOING",""],[4,"ngIf","ngIfElse"],[3,"cartItems"],[1,"container-fluid","overflow-x-hidden"],[1,"row","header","border-bottom"],[1,"col-5","border-end"],[1,"left-toolbar-container","h-100","d-flex","align-items-center","justify-content-between"],[1,"d-flex","flex-column"],[3,"ngModelChange","disabled","isOpenAfterLoad","outlets","ngModel"],[3,"ngModelChange","ngModel","transactionType","disabled"],[3,"ngModelChange","ngModel","disabled","tooltip"],[1,"col-7","d-flex","align-items-center"],[1,"row","flex-grow-1"],[1,"col-4","d-flex","align-items-center"],[1,"col","ps-0","d-flex","align-items-center","justify-content-end","gap-1"],[1,"fa-regular","fa-sliders"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",1,"",3,"ngModelChange","clearable","ngModel","disabled","items"],[1,"row","content"],[1,"col-5","border-end",2,"height","inherit"],[3,"onSelectVariant","quickKey","outletID"],[1,"col-7",2,"height","calc(100% - 0)","padding","0"]],template:function(t,n){if(t&1&&_(0,jm,2,1,"ng-container",1)(1,km,22,20,"ng-template",null,0,$),t&2){let i=yt(2);p("ngIf",n.storeService.IsComplete())("ngIfElse",i)}},dependencies:[He,F,me,jr,Rr,Br,Lr,de,U,J,On,wt,Ii,Si,Pi],styles:[".left-toolbar-container[_ngcontent-%COMP%]{position:relative}.left-toolbar-container[_ngcontent-%COMP%] POS-invoice-number-form[_ngcontent-%COMP%]{position:absolute;top:34px;left:28px}.header[_ngcontent-%COMP%]{min-height:60px}.content[_ngcontent-%COMP%]{height:calc(100vh - 60px);overflow:hidden}.supplier-more-menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.cart-display[_ngcontent-%COMP%]{flex-grow:1;height:0px;overflow-y:auto}input[_ngcontent-%COMP%]{width:100%;height:38px!important;border:0;border-bottom:1px solid #ced4da;padding-left:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i[_ngcontent-%COMP%]{font-size:16px;top:10.6px;left:13px}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]{transition:.4s}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(1){-webkit-transform:rotate(-45deg) translate(-8px,4px);transform:rotate(-45deg) translate(-8px,4px)}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(2){opacity:0}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(45deg) translate(-5px,0px);transform:rotate(45deg) translate(-5px)}.mobile-button[_ngcontent-%COMP%]{display:none}@media (max-width: 990px){.mobile-button[_ngcontent-%COMP%]{display:block}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.more-actions[_ngcontent-%COMP%] div.d-flex[_ngcontent-%COMP%]{width:30rem}[_nghost-%COMP%] .ng-select .ng-select-container{border:none}"]})};var Am=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Nm=r=>({ID:r});function Vm(r,e){if(r&1){let t=v();o(0,"button",11),g("click",function(){d(t);let i=c(2);return u(i.openExportModal())}),f(1,"i",12),m(2," Export "),a()}}function Fm(r,e){if(r&1){let t=v();o(0,"div")(1,"div",13)(2,"h6"),m(3,"Variant"),a(),o(4,"autocompleteV2",14),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.ID,i)||(s.pageData.Filter.ID=i),u(i)}),a(),o(5,"h6"),m(6,"Outlet"),a(),o(7,"ng-select",15),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,i)||(s.pageData.Filter.EntityID=i),u(i)}),a(),o(8,"h6"),m(9,"From"),a(),o(10,"datepicker",16),D("dateChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.From,i)||(s.pageData.Filter.From=i),u(i)}),a(),o(11,"h6"),m(12,"To"),a(),o(13,"datepicker",17),D("dateChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.To,i)||(s.pageData.Filter.To=i),u(i)}),a()()()}if(r&2){let t=c(2);l(4),S("ngModel",t.pageData.Filter.ID),p("inputTextValue",t.pageData.Filter.VariantName),l(3),p("items",t.pageData.Options.Entities),S("ngModel",t.pageData.Filter.EntityID),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.From),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.To)}}function Um(r,e){r&1&&(o(0,"th"),m(1,"Variant"),a())}function Lm(r,e){if(r&1&&(o(0,"td"),m(1),a()),r&2){let t=c().$implicit;l(),b(t.Name)}}function Rm(r,e){if(r&1&&(o(0,"tr",18),_(1,Lm,2,1,"td",8),I(2,"async"),o(3,"td"),m(4),a(),o(5,"td")(6,"a",19),m(7),a()(),o(8,"td"),m(9),I(10,"number"),a(),o(11,"td"),m(12),I(13,"date"),a()()),r&2){let t=e.$implicit,n=c(2);l(),p("ngIf",!O(2,7,n.isRedirect$)),l(3),b(t.EntityName),l(2),p("routerLink",X(14,Am))("queryParams",A(15,Nm,t.ID)),l(),b(t.Number),l(2),b(O(10,9,t.Quantity)),l(3),b(Q(13,11,t.Date,"dd/MM/yy"))}}function Qm(r,e){if(r&1){let t=v();o(0,"mainpanel-cmp",2),D("textChange",function(i){d(t);let s=c();return x(s.pageData.Filter.Number,i)||(s.pageData.Filter.Number=i),u(i)}),g("onSubmit",function(){d(t);let i=c();return u(i.searchFromPageOne())}),D("filterChange",function(i){d(t);let s=c();return x(s.pageData.Filter,i)||(s.pageData.Filter=i),u(i)}),o(1,"actions"),_(2,Vm,3,0,"button",3),a(),o(3,"filters"),_(4,Fm,14,8,"ng-template",null,0,$),a(),o(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr"),_(12,Um,2,0,"th",8),I(13,"async"),o(14,"th"),m(15,"Outlet"),a(),o(16,"th"),m(17,"Number"),a(),o(18,"th"),m(19,"Quantity"),a(),o(20,"th"),m(21,"Date"),a()()(),o(22,"tbody"),_(23,Rm,14,17,"tr",9),a()()(),o(24,"POS-complex-pagination",10),g("jumpToPage",function(){d(t);let i=c();return u(i.getListData())})("previousPage",function(){d(t);let i=c();return u(i.getListData())})("nextPage",function(){d(t);let i=c();return u(i.getListData())}),a()()()()}if(r&2){let t=c();p("pageData",t.menuData),S("text",t.pageData.Filter.Number),p("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.roleService.global.Export),l(10),p("ngIf",!O(13,9,t.isRedirect$)),l(11),p("ngForOf",t.data.Data),l(),p("total",t.data.Data==null?null:t.data.Data.length)("pageData",t.pageData)}}var Oi=class r extends Ft{constructor(t,n,i,s,y){super(t,n,"catalog/product/GetAdjustmentHistory","catalog/productLoader/GetAdjustmentHistoryLoader",null,i);this.matDialog=s;this.roleService=y;this.isRedirect$=vn(this.route.snapshot.queryParamMap).pipe(bt(E=>E.has("ID")),In(1))}isRedirect$;openExportModal(){this.matDialog.open(Wt,{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(n){return new(n||r)(C(it),C(j),C(ce),C(ft),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-history-variant"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["api","catalog/product/GetCountAdjustmentHistory",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Variant","inputID","ID","notFoundMessageFor","variant",1,"form-control","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModelChange","items","ngModel"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"border-bottom"],["target","_blank",3,"routerLink","queryParams"]],template:function(n,i){n&1&&_(0,Qm,25,11,"mainpanel-cmp",1),n&2&&p("ngIf",i.data)},dependencies:[K,F,ut,lt,U,J,Ce,wt,Be,We,me,nt,pe]})};var Bm=[{path:"Adjustment/Archive",component:Bn},{path:"Adjustment/Archive/Info",component:Ln},{path:"Adjustment/Archive/Form",component:Yn,canActivate:[Ni],data:{roles:[_n.adjustment.Create,_n.adjustment.Edit]}},{path:"Adjustment/Archive/Form/V2",component:Mi,canActivate:[Ni],data:{roles:[_n.adjustment.Create,_n.adjustment.Edit]}},{path:"Tools/Count_Product_Inventory",component:si},{path:"Tools/Convert_Inventory_to_Parent_UOM",component:ai},{path:"Tools/Product_Sheet",component:li},{path:"Report/Adjustment",component:ni},{path:"History/Variant",component:Oi},{path:"Adjustment/Stock_Take_by_Web_Spreadsheet",component:oi},{path:"Adjustment/Stock_Take_by_CSV",component:ii},{path:"",redirectTo:"Adjustment/Archive",pathMatch:"full"}],Ti=class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=je({type:r});static \u0275inj=Ee({imports:[un.forChild(Bm),un]})};var jo=class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=je({type:r});static \u0275inj=Ee({imports:[Ne,Ti,He,de,Tn,Er,On,io,oo,En,jt,Vr,yr,Mr,jt,to,Jr,Ai,wr,Qe,cr,hr,Ur,pr,po,Ai,fr,so,mo,Vn,ze,zr,ei,ye,kn,An,$e,Fn]})};export{jo as AdjustmentModule};
1
+ import{a as co,b as Un,c as uo}from"./chunk-KKJHA2JC.js";import{a as Ni}from"./chunk-2D6AJCCH.js";import{a as Jr,b as Yr,e as Zr,f as Xr,g as to}from"./chunk-EQKSYTBR.js";import{a as Fn}from"./chunk-COVPZF4Z.js";import{a as eo,b as no,c as io,d as ro,e as oo,f as lo,g as mo}from"./chunk-QZW6EZ2B.js";import{a as ao,b as so}from"./chunk-ETKYYEM2.js";import{b as po}from"./chunk-4IZCH5PU.js";import{a as qe}from"./chunk-D45O3OVS.js";import{a as Ir}from"./chunk-T6DVN3HI.js";import{d as Or}from"./chunk-QOQ4422I.js";import"./chunk-FA5KQFWN.js";import"./chunk-EUYFJAW4.js";import"./chunk-UFWLNPUY.js";import{a as Ut}from"./chunk-F2CR4KZD.js";import{G as Fr}from"./chunk-QYQNZWZJ.js";import"./chunk-K7ACLCRR.js";import"./chunk-TK5H65DN.js";import"./chunk-B5FODXLM.js";import"./chunk-RRQI7YBE.js";import"./chunk-H3I3GRUR.js";import"./chunk-6L6CIH5M.js";import"./chunk-U4HBO4PN.js";import"./chunk-VPN73SCD.js";import{a as kr,b as Ar,c as Nr,d as Nn,e as Vr}from"./chunk-JS26GJEU.js";import"./chunk-QPKQUNM5.js";import"./chunk-BYXBJQAS.js";import"./chunk-B74H5XQ5.js";import"./chunk-AWU3GK57.js";import"./chunk-3LKE4M2Q.js";import{a as $e}from"./chunk-A537BNZW.js";import{a as dr}from"./chunk-UDC33BP5.js";import{a as Br,b as Hr,c as Wr,d as qr,e as Gr,f as $r}from"./chunk-4QVXJ3WU.js";import{a as Qr}from"./chunk-TVQ7PTOC.js";import{a as zr}from"./chunk-Y6WXQQCF.js";import{a as Rr}from"./chunk-K4MGWXRR.js";import"./chunk-UU2VZEN6.js";import"./chunk-I4HZM5WC.js";import{b as Ai}from"./chunk-PBE32ALY.js";import{a as Vn}from"./chunk-W3PGZJFY.js";import"./chunk-HKZ3AKPN.js";import"./chunk-SE7OFLAL.js";import{e as Ur}from"./chunk-HTETVGPG.js";import"./chunk-JD3LIVDP.js";import"./chunk-IVVVY7GV.js";import"./chunk-RK6BNF5A.js";import{b as jr}from"./chunk-MJYAQVTY.js";import{a as Ge,b as ze}from"./chunk-WC6HLOBJ.js";import"./chunk-R4I5ZHAX.js";import"./chunk-MFKUC5BJ.js";import{o as Tr,r as Ce,s as Er}from"./chunk-IUCIZR5M.js";import"./chunk-KSWCXLZI.js";import"./chunk-TCJKRAHM.js";import{a as ye}from"./chunk-XHXNLFB7.js";import{a as Kr}from"./chunk-CVIX55UC.js";import"./chunk-UJT2GQJV.js";import"./chunk-2VGPHBTP.js";import{a as ve,c as Lr}from"./chunk-AI2WO2YW.js";import"./chunk-BYXBJQAS.js";import{a as pt}from"./chunk-DBT3YELG.js";import{a as _o}from"./chunk-Y2ZKUKT6.js";import"./chunk-WMU7MFFB.js";import{a as ia,b as ur}from"./chunk-SDJWEMMQ.js";import{a as xr}from"./chunk-ADKAERSZ.js";import{g as kn}from"./chunk-BWZ77537.js";import"./chunk-KT3HZU73.js";import"./chunk-T2XW5RF3.js";import"./chunk-JF4O25LX.js";import{a as We,b as Mr}from"./chunk-KTHB53TU.js";import{d as jn,e as wr}from"./chunk-WYU4GNGH.js";import{a as br,b as Wt}from"./chunk-XRVM23TQ.js";import{a as _r,b as gr,c as fr}from"./chunk-YVIR7KBQ.js";import{a as Ft}from"./chunk-MXWU5MKT.js";import"./chunk-S76H45V3.js";import"./chunk-DNE54I3O.js";import"./chunk-AAHXYSYV.js";import{a as Cr,c as Pn,e as wn,f as yr}from"./chunk-LNARSB7D.js";import"./chunk-LH34DZDB.js";import"./chunk-ZH3LHPKO.js";import{a as Qe,b as Mt}from"./chunk-SIEUNTYO.js";import{a as An}from"./chunk-NODGYDGE.js";import{b as lt,c as He}from"./chunk-GWXGX5LC.js";import"./chunk-2RCTJJRA.js";import{a as _e}from"./chunk-JDA7MLPJ.js";import{h as hr,m as Be,n as En}from"./chunk-NCREVKQX.js";import"./chunk-VUGL7GL5.js";import{a as it}from"./chunk-5HOIGLPJ.js";import{a as Mn,b as st,h as he,l as Dr,n as Pr}from"./chunk-4FY76ZN7.js";import{a as ht,b as Ct,c as jt}from"./chunk-4EC5VQVC.js";import{a as Ht,b as cr}from"./chunk-7ZPEQH6S.js";import{R as Tn,a as gt,b as ge,c as ft,k as fe,r as Sr}from"./chunk-7QOX2YTK.js";import{K as mr,la as pr}from"./chunk-RKUZE4SA.js";import"./chunk-6QLFOLMP.js";import"./chunk-UJBDZYC5.js";import{a as vr,e as wt,f as On}from"./chunk-53ZY7AX4.js";import"./chunk-5ZJO3PQ6.js";import"./chunk-44LJSYN6.js";import"./chunk-66WVYR24.js";import{a as tt}from"./chunk-2FWFPV5I.js";import{B as Re,C as de,D as ue,b as sr,c as at,h as U,i as Ve,l as Fe,n as J,r as Dn,s as Ue,t as Le}from"./chunk-7UM6XERA.js";import{a as ar}from"./chunk-BKUX2DAM.js";import{a as lr}from"./chunk-UXETJ7AB.js";import{a as _n,b as R}from"./chunk-MVWDLLHY.js";import{a as w}from"./chunk-C34GKBAP.js";import{b as j}from"./chunk-LY4YXADZ.js";import{$ as rt,$a as ct,$b as S,Aa as Pt,Bb as v,C as W,Ca as et,Da as tr,Dc as xn,Eb as g,G as Oe,Gb as c,H as ae,Hd as ce,Jb as ir,Jd as Nt,Kb as rr,Kd as ut,Lc as Ae,Md as un,N as Te,Na as L,Nc as K,Oa as se,Ob as pn,Oc as F,Od as _t,Pb as cn,Qa as Vt,Qb as dn,S as Zi,Sa as l,Ta as C,Tc as me,U as In,Ub as yt,Vb as m,Vc as pe,Wb as b,Xb as M,Xc as nt,Y as Z,Ya as er,Yb as le,_c as Ne,ac as x,ba as N,bc as D,bd as or,c as ot,ca as Xi,cb as dt,d as yn,dc as z,eb as _,ec as X,fa as k,fc as A,ga as Ee,gc as ke,ia as Rt,ib as p,j as Me,ja as h,jb as nr,kb as ji,mb as It,md as Sn,n as vn,na as P,nc as I,o as bn,oa as je,oc as O,pc as Q,qb as re,r as bt,s as xe,sb as ki,tb as ln,tc as $,ua as d,ub as mn,va as u,vb as o,wb as a,xb as f,yb as q,zb as G}from"./chunk-ZCFRJGRH.js";import{a as V,b as Y,g as Ei,j as Cn}from"./chunk-LHUGHE24.js";var oa=()=>["/menu/Adjustment/Adjustment/Archive/Form/V2"],fn=r=>({ID:r}),go=()=>["/print/Adjustment"],fo=(r,e)=>({"text-success":r,"text-danger":e}),aa=(r,e)=>({"text-danger":r,"text-success":e});function sa(r,e){if(r&1){let t=v();o(0,"div",24)(1,"button",25),g("click",function(){d(t);let i=c(2);return u(i.reject())}),f(2,"i",26),m(3,"Reject"),a(),o(4,"button",25),g("click",function(){d(t);let i=c(2);return u(i.accept())}),f(5,"i",27),m(6,"Accept "),a()()}}function la(r,e){if(r&1&&(o(0,"a",28),f(1,"i",29),m(2,"Edit "),a()),r&2){let t=c(2);p("routerLink",X(2,oa))("queryParams",A(3,fn,t.data.ID))}}function ma(r,e){if(r&1){let t=v();o(0,"button",25),g("click",function(){d(t);let i=c(2);return u(i.delete())}),f(1,"i",30),m(2,"Delete "),a()}}function pa(r,e){if(r&1&&(o(0,"div",31),I(1,"date"),m(2),I(3,"date"),a()),r&2){let t=c(2);ir("title",Q(1,3,t.data.Adjustment.ReviewDate,"dd MMM yyyy HH:mm")),l(2),le("(",t.data.Adjustment.ReviewName," : ",Q(3,6,t.data.Adjustment.ReviewDate,"dd MMM yyyy"),")")}}function ca(r,e){if(r&1&&(o(0,"tr")(1,"th"),m(2,"Journal Link"),a(),o(3,"td"),m(4,":"),a(),o(5,"td")(6,"a",32),m(7,"View Journal"),a()()()),r&2){let t=c(2);l(6),rr("href","https://accounting.dealpos.app/pages/journal-entry;TransID=",t.data.ID,"",se)}}function da(r,e){if(r&1){let t=v();o(0,"a",50),g("click",function(){d(t);let i=c(3);return u(i.exportCSV(i.csvConverter,"Adjustment/AdjustmentInfoExport","Adjustment#"+i.data.Adjustment.Number+".csv"))}),m(1,"Export"),a()}}function ua(r,e){r&1&&(q(0),o(1,"th",51),m(2,"Qty"),a(),G())}function _a(r,e){r&1&&(o(0,"th",51),m(1,"Expected"),a(),o(2,"th",51),m(3,"Counted"),a())}function ga(r,e){r&1&&(o(0,"th",52),m(1," Cost "),a())}function fa(r,e){r&1&&(o(0,"th",52),m(1," Price "),a())}function ha(r,e){if(r&1&&(q(0),f(1,"p",57),G()),r&2){let t=c().$implicit;l(),p("innerHTML",t.Note,L)}}function Ca(r,e){if(r&1&&(q(0),o(1,"td",58),m(2),a(),G()),r&2){let t=c().$implicit;l(),It(ke(3,fo,t.Quantity>0,t.Quantity<0)),l(),M(" ",t.Quantity," ")}}function ya(r,e){if(r&1&&(o(0,"td",58),m(1),a(),o(2,"td",58),m(3),a()),r&2){let t=c().$implicit;l(),M(" ",t.Actual," "),l(),It(ke(4,aa,t.Actual>t.Counted,t.Actual<t.Counted)),l(),M(" ",t.Counted," ")}}function va(r,e){if(r&1&&(f(0,"td",59),I(1,"number")),r&2){let t=c().$implicit;p("innerHTML",O(1,1,t.UnitCost),L)}}function ba(r,e){if(r&1&&(f(0,"td",59),I(1,"number")),r&2){let t=c().$implicit;p("innerHTML",O(1,1,t.UnitPrice),L)}}function Ia(r,e){if(r&1&&(o(0,"tr"),f(1,"td",53),o(2,"td")(3,"a",54),m(4),a(),o(5,"div"),m(6),a(),f(7,"app-serial-note",55),_(8,ha,2,1,"ng-container",20),a(),_(9,Ca,3,6,"ng-container",43)(10,ya,4,7,"ng-template",null,1,$)(12,va,2,3,"td",56)(13,ba,2,3,"td",56),a()),r&2){let t=e.$implicit,n=e.index,i=yt(11),s=c(3);l(),p("innerHTML",n+1+".",L),l(2),p("queryParams",A(10,fn,t.VariantID)),l(),b(t.Name),l(2),b(t.Code),l(),p("serials",t.Serial),l(),p("ngIf",t.Note!=null),l(),p("ngIf",s.data.Adjustment.StateID==4||s.data.Adjustment.StateID==2||s.data.Adjustment.TypeID==1)("ngIfElse",i),l(3),p("ngIf",s.roleService.product.Cost),l(),p("ngIf",s.roleService.sell.PriceVisible)}}function xa(r,e){if(r&1&&(o(0,"td",60)(1,"b"),m(2),I(3,"sum"),I(4,"number"),a()()),r&2){let t=c(3);l(2),b(O(4,4,Q(3,1,t.data.DifferencesArray,"TotalCost")))}}function Sa(r,e){if(r&1&&(o(0,"td",61)(1,"b"),m(2),I(3,"sum"),I(4,"number"),a()()),r&2){let t=c(3);l(2),b(O(4,4,Q(3,1,t.data.DifferencesArray,"TotalPrice")))}}function Da(r,e){if(r&1&&(o(0,"div",11)(1,"div",33)(2,"div")(3,"h2"),m(4),a()(),o(5,"div",34)(6,"a",35),f(7,"i",36),m(8,"Print "),a(),_(9,da,2,0,"a",37),a()(),o(10,"div",14)(11,"div",38)(12,"table",39)(13,"thead",40)(14,"tr")(15,"th",41),m(16,"No"),a(),o(17,"th",42),m(18,"Name"),a(),_(19,ua,3,0,"ng-container",43)(20,_a,4,0,"ng-template",null,0,$)(22,ga,2,0,"th",44)(23,fa,2,0,"th",44),a()(),o(24,"tbody"),_(25,Ia,14,12,"tr",45),a(),o(26,"tfoot")(27,"tr")(28,"td",46)(29,"b"),m(30,"Total :"),a()(),o(31,"td",47)(32,"b"),m(33),I(34,"sum"),I(35,"number"),a()(),_(36,xa,5,6,"td",48)(37,Sa,5,6,"td",49),a()()()()()()),r&2){let t=yt(21),n=c(2);l(4),le(" ",n.data.Adjustment.StateID==2||n.data.Adjustment.TypeID==1||n.data.Adjustment.StateID==4&&n.data.Adjustment.TypeID==2?"Adjusted":"Counted"," Inventory (",n.data.DifferencesArray.length," SKU) "),l(2),p("routerLink",X(19,go))("queryParams",A(20,fn,n.paramId)),l(3),p("ngIf",n.roleService.global.Export&&n.data.Adjustment.StateID==4),l(10),p("ngIf",n.data.Adjustment.StateID==4||n.data.Adjustment.StateID==2||n.data.Adjustment.TypeID==1)("ngIfElse",t),l(3),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.sell.PriceVisible),l(2),p("ngForOf",n.data.DifferencesArray),l(3),p("colSpan",n.data.Adjustment.StateID==4||n.data.Adjustment.StateID==2||n.data.Adjustment.TypeID==1?2:3),l(5),b(O(35,17,Q(34,14,n.data.DifferencesArray,"Counted"))),l(3),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.sell.PriceVisible)}}function Pa(r,e){if(r&1&&(o(0,"h2"),m(1),a()),r&2){let t=c(3);l(),M(" Counted Inventory (",t.data.CountedArray.length," SKU) ")}}function wa(r,e){if(r&1){let t=v();o(0,"a",50),g("click",function(){d(t);let i=c(3);return u(i.exportCSV(i.csvConverter,"Adjustment/AdjustmentCountedExport","Adjustment_Counted#"+i.data.Adjustment.Number+".csv"))}),f(1,"i",63),m(2,"Export"),a()}}function Ma(r,e){if(r&1&&(o(0,"tr"),f(1,"td",53),o(2,"td")(3,"a",54),m(4),a(),o(5,"div"),m(6),a()(),o(7,"td",58),m(8),a(),o(9,"td",58),m(10),a(),o(11,"td",58),m(12),a()()),r&2){let t=e.$implicit,n=e.index;l(),p("innerHTML",n+1+".",L),l(2),p("queryParams",A(9,fn,t.VariantID)),l(),b(t.Name),l(2),b(t.Code),l(2),b(t.Counted),l(2),b(t.Actual),l(),It(ke(11,fo,t.Difference>0,t.Difference<0)),l(),M(" ",t.Difference," ")}}function Oa(r,e){if(r&1&&(o(0,"div",11)(1,"div",33)(2,"div"),_(3,Pa,2,1,"h2",20),a(),o(4,"div",34)(5,"a",35),f(6,"i",36),m(7,"Print "),a(),_(8,wa,3,0,"a",37),a()(),o(9,"div",14)(10,"div",38)(11,"table",39)(12,"thead",40)(13,"tr")(14,"th",41),m(15,"No"),a(),o(16,"th",42),m(17,"Name"),a(),o(18,"th",62),m(19,"Expected"),a(),o(20,"th",62),m(21,"Counted"),a(),o(22,"th",62),m(23,"Difference"),a()()(),o(24,"tbody"),_(25,Ma,13,14,"tr",45),a()()()()()),r&2){let t=c(2);l(3),p("ngIf",t.data.CountedArray.length>0&&t.data.Adjustment.TypeID==2),l(2),p("routerLink",X(5,go))("queryParams",A(6,fn,t.paramId)),l(3),p("ngIf",t.roleService.global.Export&&t.data.Adjustment.StateID==4),l(17),p("ngForOf",t.data.CountedArray)}}function Ta(r,e){if(r&1&&(o(0,"mainpanel-cmp",3)(1,"actions"),_(2,sa,7,0,"div",4),o(3,"div",5),_(4,la,3,5,"a",6)(5,ma,3,0,"button",7),a()(),o(6,"content")(7,"div",8)(8,"div",9)(9,"div",10)(10,"div",11)(11,"div",12)(12,"div"),f(13,"h2",13),a()(),o(14,"div",14)(15,"table",15)(16,"tr")(17,"th"),m(18,"Date"),a(),o(19,"td"),m(20,":"),a(),f(21,"td",13),a(),o(22,"tr")(23,"th"),m(24,"PIC"),a(),o(25,"td"),m(26,":"),a(),f(27,"td",13),a(),o(28,"tr")(29,"th"),m(30,"Type"),a(),o(31,"td"),m(32,":"),a(),f(33,"td",13),a(),o(34,"tr")(35,"th",16),m(36,"State"),a(),o(37,"td",16),m(38,":"),a(),o(39,"td",17),f(40,"span",18),_(41,pa,4,9,"div",19),a()(),o(42,"tr")(43,"th"),m(44,"Note"),a(),o(45,"td"),m(46,":"),a(),f(47,"td",13),a(),_(48,ca,8,2,"tr",20),a()()()(),o(49,"div",21),_(50,Da,38,22,"div",22)(51,Oa,26,8,"div",22),a()(),f(52,"pos-footer-alert",23),a()()()),r&2){let t=c();p("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),p("ngIf",!t.toggleAccRej),l(2),p("ngIf",t.roleService.adjustment.Edit&&t.data.Adjustment.TypeID!=2&&t.data.Adjustment.StateID!=3),l(),p("ngIf",t.roleService.adjustment.Delete),l(8),p("innerHTML",t.data.Adjustment.OutletName,L),l(8),p("innerHTML",t.data.Adjustment.Date,L),l(6),p("innerHTML",t.data.Adjustment.PIC,L),l(6),p("innerHTML",t.data.Adjustment.TypeLabel,L),l(7),p("innerHTML",t.data.Adjustment.StateLabel,L),l(),p("ngIf",t.data.Adjustment.ReviewName),l(6),p("innerHTML",t.data.Adjustment.Note,L),l(),p("ngIf",t.data.AppsAccoutingActive&&t.roleService.accounting.View),l(2),p("ngIf",t.data.DifferencesArray.length>0),l(),p("ngIf",(t.data.CountedArray==null?null:t.data.CountedArray.length)>0&&t.data.Adjustment.TypeID==2),l(),p("created",t.data.CreatedInfo.Created)("modified",t.data.CreatedInfo.Modified)}}var Ln=class r extends Ft{constructor(t,n,i,s,y,E,mt){super(t,n,"Adjustment/AuditInventoryAdjustmentInfo",null,null,s);this.toastr=i;this.csvConverter=y;this.router=E;this.roleService=mt;this.initQueryParam()}paramId;toggleAccRej=!1;isEditable=!1;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.toggleAccRej=!1:this.toggleAccRej=!0,(this.data.Adjustment.StateID==1||this.data.Adjustment.StateID==2)&&(this.isEditable=!0)}exportCSV(t,n,i){this.httpService.get(`/api/${n}`,[{key:"ID",value:this.paramId}]).subscribe(s=>{t.convertToCSV(s,i)})}reject(){if(!confirm("Are you sure you want to reject this?"))return;let t={ID:this.data.Adjustment.ID};this.httpService.post("/API/Adjustment/RejectCountedItem",t).subscribe({next:n=>{this.toastr.success("Success reject adjustment",tt.Success),this.toggleAccRej=!0,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:n=>{this.toastr.success("Success accept adjustment",tt.Success),this.toggleAccRej=!0,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.",tt.Success),this.router.navigate(["/menu/Adjustment/Adjustment/Archive"])})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(_t),C(ce),C(Ut),C(Nt),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-adjustment-info"]],features:[dt],decls:1,vars:1,consts:[["NOTACC",""],["NOTACCDATA",""],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["class","btn-group me-5",4,"ngIf"],[1,"btn-group","ms-5"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-3"],[1,"card"],[1,"card-header"],[3,"innerHTML"],[1,"card-body"],[1,"table-sm","table-borderless"],[2,"padding-bottom","31px !important"],[1,"d-flex","gap-1","flex-column"],[1,"p-0",3,"innerHTML"],["class","ps-0",3,"title",4,"ngIf"],[4,"ngIf"],[1,"col-sm-9"],["class","card",4,"ngIf"],[3,"created","modified"],[1,"btn-group","me-5"],[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-trash","me-3"],[1,"ps-0",3,"title"],[3,"href"],[1,"card-header","d-flex","justify-content-between"],[1,"btn-group"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams"],[1,"fa-solid","fa-print","me-3"],["class","btn btn-outline-secondary btn-sm","role","button",3,"click",4,"ngIf"],[1,"table-responsive"],[1,"table"],[1,"thead-light"],[1,"text-center",2,"width","1px"],[2,"width","300px"],[4,"ngIf","ngIfElse"],["class","text-end","style","width: 120px",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"text-end","empty-column",3,"colSpan"],[1,"text-end","empty-column"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Cost",4,"ngIf"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Price",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"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"],["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"],[1,"fa-solid","fa-upload","me-3"]],template:function(n,i){n&1&&_(0,Ta,53,18,"mainpanel-cmp",2),n&2&&p("ngIf",i.data)},dependencies:[K,F,ut,lt,Ht,ye,Fn,nt,pe,fe]})};var ja=()=>["/menu/Adjustment/Adjustment/Archive/Form/V2"],ka=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Aa=r=>({ID:r}),Na=(r,e)=>({"text-success":r,"text-danger":e}),Va=r=>({"text-success":r}),Fa=r=>({"text-danger":r});function Ua(r,e){if(r&1){let t=v();o(0,"a",18),g("click",function(){d(t);let i=c(2);return u(i.httpPostListID("Adjustment/DeleteInventoryAdjustmentList"))}),f(1,"i",19),m(2,"Delete "),a()}}function La(r,e){if(r&1){let t=v();o(0,"button",20),g("click",function(){d(t);let i=c(2);return u(i.openExportModal())}),f(1,"i",21),m(2," Export "),a()}}function Ra(r,e){r&1&&(o(0,"a",22),m(1,"New"),a()),r&2&&p("routerLink",X(1,ja))}function Qa(r,e){if(r&1){let t=v();o(0,"div")(1,"div",23)(2,"h6"),m(3,"Outlet"),a(),o(4,"ng-select",24),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,i)||(s.pageData.Filter.EntityID=i),u(i)}),a(),o(5,"h6"),m(6,"From"),a(),o(7,"datepicker",25),D("dateChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.From,i)||(s.pageData.Filter.From=i),u(i)}),a(),o(8,"h6"),m(9,"To"),a(),o(10,"datepicker",26),D("dateChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.To,i)||(s.pageData.Filter.To=i),u(i)}),a(),o(11,"h6"),m(12,"Quantity From - To"),a(),o(13,"div",27)(14,"input",28),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.QuantityFrom,i)||(s.pageData.Filter.QuantityFrom=i),u(i)}),a(),m(15," - "),o(16,"input",28),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.QuantityTo,i)||(s.pageData.Filter.QuantityTo=i),u(i)}),a()(),o(17,"h6"),m(18,"State"),a(),o(19,"ng-select",29),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.State,i)||(s.pageData.Filter.State=i),u(i)}),a(),o(20,"h6"),m(21,"Adjustment Type"),a(),o(22,"ng-select",30),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.Type,i)||(s.pageData.Filter.Type=i),u(i)}),a(),o(23,"h6"),m(24,"Rows"),a(),o(25,"input",31),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.RowCount,i)||(s.pageData.Filter.RowCount=i),u(i)}),a(),o(26,"h6"),m(27,"Exclude Zero"),a(),o(28,"radio-options",32),D("modelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.ExcludeZero,i)||(s.pageData.Filter.ExcludeZero=i),u(i)}),a()()()}if(r&2){let t=c(2);l(4),p("items",t.pageData.Options.Entities),S("ngModel",t.pageData.Filter.EntityID),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.From),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.To),l(4),S("ngModel",t.pageData.Filter.QuantityFrom),l(2),S("ngModel",t.pageData.Filter.QuantityTo),l(3),p("items",t.pageData.Options.States),S("ngModel",t.pageData.Filter.State),l(3),p("items",t.pageData.Options.Types),S("ngModel",t.pageData.Filter.Type),l(3),S("ngModel",t.pageData.Filter.RowCount),p("max",1e4),l(3),S("model",t.pageData.Filter.ExcludeZero)}}function Ba(r,e){if(r&1){let t=v();o(0,"th",33)(1,"input",34),g("change",function(i){d(t);let s=c(2);return u(s.onSelectAllData(i.target.checked))}),a()()}}function Ha(r,e){r&1&&(o(0,"th",15),m(1,"Cost"),a())}function Wa(r,e){if(r&1){let t=v();o(0,"td")(1,"input",41),D("ngModelChange",function(i){d(t);let s=c().$implicit;return x(s.selected,i)||(s.selected=i),u(i)}),a()()}if(r&2){let t=c().$implicit;l(),S("ngModel",t.selected)}}function qa(r,e){if(r&1&&(o(0,"td",40),m(1),I(2,"quantityFraction"),a()),r&2){let t=c().$implicit;l(),M(" ",O(2,1,t.Quantity)," ")}}function Ga(r,e){if(r&1&&(o(0,"td",40),m(1),I(2,"quantityFraction"),a()),r&2){let t=c().$implicit;It(A(5,Va,t.Quantity>0)),l(),M(" +",O(2,3,t.Quantity)," ")}}function za(r,e){if(r&1&&(o(0,"td",40),m(1),I(2,"quantityFraction"),a()),r&2){let t=c().$implicit;It(A(5,Fa,t.Quantity<0)),l(),M(" ",O(2,3,t.Quantity)," ")}}function $a(r,e){if(r&1&&(o(0,"td",40),m(1),I(2,"amountFraction"),a()),r&2){let t=c().$implicit;l(),b(O(2,1,t.Cost))}}function Ka(r,e){if(r&1&&(o(0,"tr",35),_(1,Wa,2,1,"td",36),o(2,"td"),m(3),a(),o(4,"td")(5,"a",37),m(6),a()(),o(7,"td"),m(8),I(9,"date"),a(),_(10,qa,3,3,"td",38)(11,Ga,3,7,"td",39)(12,za,3,7,"td",39),o(13,"td"),m(14),a(),_(15,$a,3,3,"td",40),o(16,"td"),m(17),a(),o(18,"td"),m(19),a()()),r&2){let t=e.$implicit,n=c(2);l(),p("ngIf",n.roleService.adjustment.Delete),l(2),b(t.EntityName),l(2),p("routerLink",X(18,ka))("queryParams",A(19,Aa,t.ID)),l(),b(t.Number),l(2),b(Q(9,15,t.Date,"dd MMM yyyy")),l(2),p("ngIf",t.Quantity==0),l(),p("ngIf",t.Quantity>0),l(),p("ngIf",t.Quantity<0),l(2),b(t.TypeLabel),l(),re(!(n.roleService==null||n.roleService.product==null)&&n.roleService.product.Cost?15:-1),l(),It(ke(21,Na,t.StateID==4,t.StateID==3)),l(),M(" ",t.StateLabel," "),l(2),b(t.Note)}}function Ja(r,e){if(r&1){let t=v();o(0,"mainpanel-cmp",2),D("textChange",function(i){d(t);let s=c();return x(s.pageData.Filter.Number,i)||(s.pageData.Filter.Number=i),u(i)}),g("onSubmit",function(){d(t);let i=c();return u(i.searchFromPageOne())}),D("filterChange",function(i){d(t);let s=c();return x(s.pageData.Filter,i)||(s.pageData.Filter=i),u(i)}),o(1,"actions"),_(2,Ua,3,0,"a",3)(3,La,3,0,"button",4)(4,Ra,2,2,"a",5),a(),o(5,"filters"),_(6,Qa,29,15,"ng-template",null,0,$),a(),o(8,"content")(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr"),_(14,Ba,2,0,"th",10),o(15,"th",11),m(16,"Outlet"),a(),o(17,"th",11),m(18,"Number"),a(),o(19,"th",12),m(20,"Date"),a(),o(21,"th",13),m(22," Qty "),a(),o(23,"th",14),m(24,"Type"),a(),_(25,Ha,2,0,"th",15),o(26,"th",12),m(27,"State"),a(),o(28,"th"),m(29,"Note"),a()()(),o(30,"tbody"),_(31,Ka,20,24,"tr",16),a()()(),o(32,"POS-complex-pagination",17),g("jumpToPage",function(){d(t);let i=c();return u(i.getListData())})("previousPage",function(){d(t);let i=c();return u(i.getListData())})("nextPage",function(){d(t);let i=c();return u(i.getListData())}),a()()()()}if(r&2){let t=c();p("pageData",t.menuData),S("text",t.pageData.Filter.Number),p("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.getSelectedData().length>0),l(),p("ngIf",t.roleService.global.Export),l(),p("ngIf",t.roleService.adjustment.Create),l(10),p("ngIf",t.roleService.adjustment.Delete),l(11),re(!(t.roleService==null||t.roleService.product==null)&&t.roleService.product.Cost?25:-1),l(6),p("ngForOf",t.data.Data),l(),p("total",t.data.Data.length)("pageData",t.pageData)}}var Bn=class r extends Ft{constructor(t,n,i,s,y,E){super(t,n,"Adjustment/GetInventoryAdjustmentList","AdjustmentLoader/GetInventoryAdjustmentList",i);this.toastr=i;this.csvConverter=s;this.roleService=y;this.matDialog=E}hideMore=!1;openExportModal(){this.matDialog.open(Wt,{data:{title:"Inventory Adjustment",exportTypes:[{ID:"AdjustmentExport/GetInventoryAdjustmentList",Value:"Default",FileName:"Inventory Adjustment"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/GetInventoryAdjustmentListCount",pagination:!0}})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(_t),C(Ut),C(R),C(ft))};static \u0275cmp=P({type:r,selectors:[["POS-inventory-adjustment"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-5",3,"click",4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","button btn btn-success",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 14px",4,"ngIf"],[2,"width","120px"],[2,"width","100px"],["matTooltipPosition","above","matTooltip","Adjusted Quantity",1,"text-end",2,"width","50px"],[2,"width","130px"],[1,"text-end",2,"width","95px"],["class","border-bottom",4,"ngFor","ngForOf"],["api","Adjustment/GetInventoryAdjustmentListCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fa-solid","fa-trash","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"button","btn","btn-success",3,"routerLink"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModelChange","items","ngModel"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["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"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel","max"],[3,"modelChange","model"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom"],[4,"ngIf"],[3,"routerLink","queryParams"],["class","text-end",4,"ngIf"],["class","text-end",3,"class",4,"ngIf"],[1,"text-end"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(n,i){n&1&&_(0,Ja,33,12,"mainpanel-cmp",1),n&2&&p("ngIf",i.data)},dependencies:[K,F,ut,lt,at,sr,U,J,Ce,wt,We,jn,Mt,Ht,pe,Ir,xr]})};var Fi=(n=>(n[n.INPUT=0]="INPUT",n[n.INVENTORY=1]="INVENTORY",n[n.SERIAL=2]="SERIAL",n))(Fi||{});var Hn=(t=>(t[t.ADJUST_DIFFERENCES=1]="ADJUST_DIFFERENCES",t[t.UPDATE_INVENTORY=2]="UPDATE_INVENTORY",t))(Hn||{});var we=class{CountedItems;Items;Order;OrderItems;constructor(){this.Items=[],this.Order=new Ui}};var Ui=class{AdjustedQuantity;Bin;Created;CreatorID;Date;EntityID;EntityName;ID;Modified;ModifierID;Note;Number;PIC;Quantity;ReviewDate;ReviewerID;StateID;StateLabel;TotalPrice;TypeID;TypeLabel;UnitCost;UnitPrice;constructor(){this.ID=w.GuidEmpty,this.EntityID="",this.StateID=1,this.TypeID=1}};var Ke=class r{_Data=new yn(new we);Data$=this._Data.asObservable();get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var be=class r{constructor(e,t,n,i){this.adjustmentDataService=e;this.backEndService=t;this.factoryService=n;this.toastr=i}_notifyNewItem=new ot;notifyNewItem$=this._notifyNewItem.asObservable();getItemByCode(e,t){let n;return this.backEndService.getVarianByCode(e,t).pipe(bt(i=>{let s=this.patchVariantToItem(i);return n=s.Variant,s.Cost=n.UnitCost,s.UnitCost=n.UnitCost,s}))}getItemById(e,t){let n;return this.backEndService.getVariantById(e,t).pipe(bt(i=>{let s=this.patchVariantToItem(i);return n=s.Variant,s.Cost=n.UnitCost,s.UnitCost=n.UnitCost,s}))}patchVariantToItem(e){let t=new he;return e=this.factoryService.generateVariantObj(e),t.patchByVariantAdjustment(e),t}updateCartItem(e){let t=this.adjustmentDataService.Data;t.Items=e,this.adjustmentDataService.pushNewValue(t)}addNewItem(e,t){let n=this.checkBehaviourRowItem(e,t);this.updateCartItem(n)}addCartItemByCode(e,t){this.backEndService.getVarianByCode(e,t).subscribe(n=>{this.createNewCartItem(n,"scan")})}createNewCartItem(e,t="add"){let n=new he;n.patchByVariantAdjustment(e),t=="scan"&&(n.Cost=e.UnitCost),n.UnitPrice=e.UnitPrice,this.addNewItem(n)}removeItem(e){let t=this.adjustmentDataService.Data;t.Items.splice(e.index,1),this.updateCartItem(t.Items)}updateItem(e){let t=this.adjustmentDataService.Data.Items;t[e.index]=e.item,this.updateCartItem(t)}checkBehaviourRowItem(e,t=!1){let n=[];if(t)n=this.adjustmentDataService.Data.Items,this._notifyNewItem.next("NEW"),n.push(e);else{n=this.adjustmentDataService.Data.Items!=null?this.adjustmentDataService.Data.Items:Array();let i=n.findIndex(y=>y.VariantID===e.VariantID),s=e.Quantity;i===-1?(w.IsNotEmpty(s)?e.Quantity=s:e.Quantity=1,this._notifyNewItem.next("NEW"),n.push(e)):w.IsNotEmpty(s)?n[i].Quantity+=s:n[i].Quantity++}return n}static \u0275fac=function(t){return new(t||r)(Rt(Ke),Rt(qe),Rt(co),Rt(_t))};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var Ri=r=>({selected:r}),Ya=()=>["/menu/Products/Catalog/Variants/Info"],Za=r=>({ID:r});function Xa(r,e){if(r&1){let t=v();o(0,"a",7),g("click",function(){d(t);let i=c();return u(i.onTabChange(i.modalItemState.INVENTORY))}),m(1," Product "),a()}if(r&2){let t=c();p("ngClass",A(1,Ri,t.modalItemState.INVENTORY==t.currentStateTab))}}function ts(r,e){if(r&1&&(o(0,"div",23)(1,"div",24)(2,"div"),m(3),a(),o(4,"small",25),m(5),a()()()),r&2){let t=e.data;l(3),b(t==null?null:t.Value),l(2),b(t==null?null:t.Code)}}function es(r,e){if(r&1){let t=v();o(0,"div",21)(1,"div",18)(2,"autocompleteV2",22,1),g("onSelect",function(i){d(t);let s=c(2);return u(s.addItem(i))})("keyup.enter",function(i){return d(t),u(i.stopPropagation())})("onInputEnter",function(i){d(t);let s=c(2);return u(s.scanCode(i))}),a(),_(4,ts,6,2,"ng-template",null,2,$),a()()}if(r&2){let t=yt(5);l(2),p("renderThumbnail",!0)("useCustomTemplate",!0)("itemTemplate",t)}}function ns(r,e){if(r&1){let t=v();o(0,"div",15)(1,"h5"),m(2,"Cost"),a(),o(3,"input",16),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.item.Cost,i)||(s.item.Cost=i),u(i)}),a()()}if(r&2){let t=c(2);l(3),S("ngModel",t.item.Cost)}}function is(r,e){if(r&1){let t=v();q(0),_(1,es,6,3,"div",11),o(2,"div")(3,"div",12)(4,"div",13)(5,"h5"),m(6,"Qty"),a(),o(7,"input",14,0),D("ngModelChange",function(i){d(t);let s=c();return x(s.item.Quantity,i)||(s.item.Quantity=i),u(i)}),a()(),o(9,"div",15)(10,"h5"),m(11,"Price"),a(),o(12,"input",16),D("ngModelChange",function(i){d(t);let s=c();return x(s.item.Price,i)||(s.item.Price=i),u(i)}),a()(),_(13,ns,4,1,"div",17),a(),o(14,"div",12)(15,"div",18)(16,"h5",19),m(17,"Note"),a(),o(18,"POS-tinymce-editor",20),D("valueChange",function(i){d(t);let s=c();return x(s.item.Note,i)||(s.item.Note=i),u(i)}),a()()()(),G()}if(r&2){let t=c();l(),p("ngIf",!t.isEdit),l(6),S("ngModel",t.item.Quantity),p("decimalPlaces",t.isItemSerial?0:4)("disabled",t.isAdjustmentEdit&&t.isItemSerial&&t.constants.IsNotEmpty(t.item.ID)),l(5),S("ngModel",t.item.Price),l(),p("ngIf",t.roleService.product.Cost),l(5),S("value",t.item.Note)}}function rs(r,e){r&1&&(q(0),f(1,"i",37),o(2,"h6"),m(3,"No Image"),a(),G())}function os(r,e){if(r&1&&f(0,"img",38),r&2){let t=c(2);p("src",t.item.Variant.ThumbnailUrl,se)}}function as(r,e){if(r&1&&(q(0),o(1,"div",21)(2,"div",26)(3,"a",27),_(4,rs,4,0,"ng-container",28)(5,os,1,1,"ng-template",null,3,$),a()(),o(7,"div",29)(8,"div",30),f(9,"i",31),o(10,"div",32),m(11,"Inventory"),a()(),o(12,"table",33)(13,"tbody")(14,"tr")(15,"td",34),m(16," On Hand "),a(),o(17,"td",35),m(18),I(19,"number"),a()(),o(20,"tr")(21,"td",36),m(22," Allocated "),a(),o(23,"td",35),m(24),I(25,"number"),a()(),o(26,"tr")(27,"td",36),m(28,"Available"),a(),o(29,"td",35),m(30),I(31,"number"),a()(),o(32,"tr")(33,"td",36),m(34,"ROP"),a(),o(35,"td",35),m(36),I(37,"number"),a()(),o(38,"tr")(39,"td",36),m(40,"Max"),a(),o(41,"td",35)(42,"span"),m(43),I(44,"number"),a()()()()()()(),G()),r&2){let t=yt(6),n=c();l(3),p("routerLink",X(19,Ya))("queryParams",A(20,Za,n.item==null||n.item.Variant==null?null:n.item.Variant.ID)),l(),p("ngIf",(n.item==null||n.item.Variant==null?null:n.item.Variant.ThumbnailUrl)==null)("ngIfElse",t),l(14),M(" ",O(19,9,n.onHand)," "),l(6),M(" ",O(25,11,n.allocated)," "),l(6),M(" ",O(31,13,n.onHand-n.allocated)," "),l(6),M(" ",O(37,15,n.rop)," "),l(7),b(O(44,17,n.max))}}function ss(r,e){if(r&1){let t=v();q(0),o(1,"POS-tab-serial",39),D("variantChange",function(i){d(t);let s=c();return x(s.item,i)||(s.item=i),u(i)})("serialsChange",function(i){d(t);let s=c();return x(s.serials,i)||(s.serials=i),u(i)}),a(),G()}if(r&2){let t=c();l(),p("isEditBuyForm",!1)("outletID",t.entityID),S("variant",t.item)("serials",t.serials)}}var Wn=class r{constructor(e,t,n,i,s,y){this.httpService=e;this.toastr=t;this.data=n;this.dialogRef=i;this.cartItemService=s;this.roleService=y;this.config=new ht,this.entityID=n.entityID,this.queryInventoryOnOpen=!1,this.currentStateTab=0,this.adjusmentType=n.adjustmentType,this.isAdjustmentEdit=this.data.isAdjustmentEdit,w.IsNotEmpty(n.itemInfo)?(this.isEdit=!0,this.item=Dr(he,this.data.itemInfo.item),this.roleService.inventory.View&&this.requestUnitInStock(),this.config.title=this.item.Variant.Name,this.item.Variant.Ordered!=null&&(this.extraTitle=` Inventory: ${this.item.Variant.OnHand}, Allocated: ${this.item.Variant.Ordered}`,this.toggleInventory=!0)):(this.item=new he,this.config.title="Add Item"),this.config.customWidth="650px",this.config.bodyScrollable=!0}currentStateTab;modalItemState=Fi;onHand;allocated;rop;max;extraTitle;config;item;isEdit=!1;toggleInventory=!1;entityID;separatorKeysCodes=[13,188];constants=w;isFocusSerialInput=!1;isItemSerial=!1;serialOptions;queryInventoryOnOpen;adjusmentType;adjustmentTypeEnum=Hn;isAdjustmentEdit=!1;serials=[];ngOnInit(){this.isItemSerial=this.checkIsSerial()}onOk(e){if(!this.isFocusSerialInput){if(this.generateSerial(),this.item.isSerialType())if(this.item.checkMatchSerialWithQuantity()){if(this.item?.Serial?.length==0){this.toastr.warning("Serial is required","Warning!");return}}else{this.toastr.warning("Serial must be equal with the quantity","Warning!");return}this.isEdit?(this.item.UnitCost=this.item.Cost,this.cartItemService.updateItem({item:this.item,index:this.data.itemInfo.index})):(this.item.UnitCost=this.item.Cost,this.cartItemService.addNewItem(this.item,!0)),this.dialogRef.close()}}generateSerial(){this.isItemSerial&&(!this.item?.Serial||this.item?.Serial?.length==0)&&(this.item.Quantity=this.serials.length,this.item.Serial=this.serials.map(e=>({Quantity:1,Number:e,ExpiryDate:null})))}addItem(e){this.cartItemService.getItemById(e,this.data.entityID).subscribe(t=>{this.item=t,this.isItemSerial=this.checkIsSerial(),this.config.title=this.item.Variant.Name})}onTabChange(e){this.currentStateTab=e,e==1&&!this.queryInventoryOnOpen&&this.requestUnitInStock()}requestUnitInStock(){if(w.IsEmpty(this.entityID)){this.toastr.error("Please select outlet before proceeding..",tt.Error);return}this.httpService.get(pt.GetVariantStockByID,[{key:"ID",value:this.item.Variant.ID},{key:"EntityID",value:this.entityID}]).subscribe(e=>{this.queryInventoryOnOpen=!0,this.onHand=e.OnHand,this.allocated=e.Allocated,this.rop=e.ROP,this.max=e.Max})}scanCode(e){this.cartItemService.getItemByCode(e,this.entityID).subscribe(t=>{this.item=t,this.isItemSerial=this.checkIsSerial(),this.config.title=this.item.Variant.Name,this.toggleInventory=!1})}onFocusAddSerial(){this.isFocusSerialInput=!0}onBlurAddSerial(){this.isFocusSerialInput=!1}checkIsSerial(){return this.item.Variant!=null?this.item.Variant.TypeID==4:!1}static \u0275fac=function(t){return new(t||r)(C(j),C(_t),C(ge),C(gt),C(be),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-modal-item"]],decls:14,vars:11,consts:[["qty",""],["variant",""],["itemTemplate",""],["SHOW_IMAGE",""],[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"row","border-bottom"],[1,"btn","btn-link",3,"click","ngClass"],["class","btn btn-link",3,"ngClass","click",4,"ngIf"],[1,"container-fluid","mt-5"],[4,"ngIf"],["class","row",4,"ngIf"],[1,"row","mt-5"],[1,"col-auto"],["type","text","autoNum","",1,"mt-5","form-control",2,"width","100px",3,"ngModelChange","ngModel","decimalPlaces","disabled"],[1,"col-auto","ps-0"],["type","text","autoNum","",1,"mt-5","form-control",2,"width","100px",3,"ngModelChange","ngModel"],["class","col-auto ps-0",4,"ngIf"],[1,"col-12"],[1,"mb-5"],["height","220px",3,"valueChange","value"],[1,"row"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"onSelect","keyup.enter","onInputEnter","renderThumbnail","useCustomTemplate","itemTemplate"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink","queryParams"],[4,"ngIf","ngIfElse"],[1,"col-sm-6"],[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","border"],[1,"table-light","text-start","border-0",2,"width","100px"],[1,"text-end"],[1,"table-light","text-start","border-0"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"border","rounded",3,"src"],[3,"variantChange","serialsChange","isEditBuyForm","outletID","variant","serials"]],template:function(t,n){t&1&&(o(0,"modal-material",4),g("onOk",function(s){return n.onOk(s)})("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),o(1,"content")(2,"div",5)(3,"div",6)(4,"div")(5,"a",7),g("click",function(){return n.onTabChange(n.modalItemState.INPUT)}),m(6," Cart "),a(),_(7,Xa,2,3,"a",8),o(8,"a",7),g("click",function(){return n.onTabChange(n.modalItemState.SERIAL)}),m(9," Serial "),a()()()(),o(10,"div",9),_(11,is,19,7,"ng-container",10)(12,as,45,22,"ng-container",10)(13,ss,2,4,"ng-container",10),a()()()),t&2&&(p("config",n.config),l(5),p("ngClass",A(7,Ri,n.modalItemState.INPUT==n.currentStateTab)),l(2),p("ngIf",n.roleService.inventory.View&&(n.item==null||n.item.Variant==null?null:n.item.Variant.Name)),l(),p("ngClass",A(9,Ri,n.modalItemState.SERIAL==n.currentStateTab)),l(3),p("ngIf",n.modalItemState.INPUT==n.currentStateTab),l(),p("ngIf",n.modalItemState.INVENTORY==n.currentStateTab),l(),p("ngIf",n.modalItemState.SERIAL==n.currentStateTab))},dependencies:[Ae,F,ut,at,U,J,Be,Ct,Mt,Ge,$e,nt],styles:[".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}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}"]})};var qn=class r{constructor(e,t){this.data=e;this.dialogRef=t;this.config=new ht,this.config.title="Note",this.adjustmentData=this.data}adjustmentData;config;onOk(e){e!="Enter"&&this.dialogRef.close()}static \u0275fac=function(t){return new(t||r)(C(ge),C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-note"]],decls:9,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row"],[1,"col-12"],["type","text","placeholder","PIC",1,"text","w-100",3,"ngModelChange","ngModel"],[1,"row","mt-5"],["placeholder","Notes",2,"width","250px","height","120px",3,"ngModelChange","ngModel"]],template:function(t,n){t&1&&(o(0,"modal-material",0),g("onOk",function(s){return n.onOk(s)})("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"input",4),D("ngModelChange",function(s){return x(n.adjustmentData.Order.PIC,s)||(n.adjustmentData.Order.PIC=s),s}),a()()(),o(6,"div",5)(7,"div",3)(8,"textarea",6),D("ngModelChange",function(s){return x(n.adjustmentData.Order.Note,s)||(n.adjustmentData.Order.Note=s),s}),a()()()()()()),t&2&&(p("config",n.config),l(5),S("ngModel",n.adjustmentData.Order.PIC),l(3),S("ngModel",n.adjustmentData.Order.Note))},dependencies:[at,U,J,Ct]})};var Gn=class r{constructor(e,t,n){this.backEndService=e;this.data=t;this.dialogRef=n;this.config=new ht,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0,this.adjustmentData=this.data}adjustmentData;config;submit(e){this.adjustmentData.Items.forEach(t=>delete t.UnitPriceOriginal),this.adjustmentData.Order.StateID=e,this.backEndService.submitTransaction(this.adjustmentData,pt.SubmitAdjustment).subscribe(t=>{this.dialogRef.close(t)})}static \u0275fac=function(t){return new(t||r)(C(qe),C(ge),C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-submit"]],decls:9,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid",2,"width","500px","display","flex","justify-content","space-around"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-file-pen"],[1,"btn","btn-outline-secondary","ms-5",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-user-magnifying-glass"]],template:function(t,n){t&1&&(o(0,"modal-material",0),g("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"div",2),g("click",function(){return n.submit(1)}),f(4,"i",3),m(5," Save as Draft "),a(),o(6,"div",4),g("click",function(){return n.submit(2)}),f(7,"i",5),m(8," Submit for Review "),a()()()()),t&2&&p("config",n.config)},dependencies:[Ct]})};function ls(r,e){if(r&1){let t=v();o(0,"div",1)(1,"div",2),g("click",function(){d(t);let i=c();return u(i.openOutletModal())}),f(2,"i",3)(3,"input",4),I(4,"limitTo"),a(),o(5,"div",5)(6,"datepicker",6),D("dateChange",function(i){d(t);let s=c();return x(s.adjustmentData.Order.Date,i)||(s.adjustmentData.Order.Date=i),u(i)}),a()(),o(7,"div",7),f(8,"i",8),o(9,"input",9),D("ngModelChange",function(i){d(t);let s=c();return x(s.adjustmentData.Order.Number,i)||(s.adjustmentData.Order.Number=i),u(i)}),a()(),o(10,"div",10)(11,"ng-select",11),D("ngModelChange",function(i){d(t);let s=c();return x(s.adjustmentData.Order.TypeID,i)||(s.adjustmentData.Order.TypeID=i),u(i)}),a()()()}if(r&2){let t=c();l(3),p("value",Q(4,10,t.outletName,20))("placeholder",t.outletName),l(3),S("date",t.adjustmentData.Order.Date),p("matTooltip",t.role!=null&&t.role.Date?"":"Date role is required")("disabled",!(t.role!=null&&t.role.Date)),l(3),S("ngModel",t.adjustmentData.Order.Number),p("disabled",!(t.role!=null&&t.role.Number)),l(2),p("disabled",t.isEdit),S("ngModel",t.adjustmentData.Order.TypeID),p("items",t.adjustmentTypes)}}var zn=class r{adjustmentData;adjustmentTypes;outletName;isEdit;role;onOpenOutletModal=new et;openOutletModal(){this.onOpenOutletModal.emit()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-toolbar"]],inputs:{adjustmentData:"adjustmentData",adjustmentTypes:"adjustmentTypes",outletName:"outletName",isEdit:"isEdit",role:"role"},outputs:{onOpenOutletModal:"onOpenOutletModal"},decls:1,vars:1,consts:[["class","row header g-0 py-4 border-bottom",4,"ngIf"],[1,"row","header","g-0","py-4","border-bottom"],[1,"col-auto",3,"click"],["matTooltipPosition","above","matTooltip","Outlet",1,"fa-solid","fa-house"],["readonly","",1,"outlet","cursor",3,"value","placeholder"],[1,"col-auto","me-5","date"],["appearance","fill","matTooltipPosition","above","name","orderDate",3,"dateChange","date","matTooltip","disabled"],[1,"col-auto","me-5"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Order number",1,"fa-regular","fa-file-lines"],["type","text","placeholder","Adjustment Number",1,"number",2,"width","180px",3,"ngModelChange","ngModel","disabled"],[1,"col-auto","me-5","d-flex"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",2,"width","381px",3,"ngModelChange","disabled","ngModel","items"]],template:function(t,n){t&1&&_(0,ls,12,13,"div",0),t&2&&p("ngIf",n.adjustmentData)},dependencies:[F,at,U,J,Ce,wt,Ht,Sr],styles:[".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}.date[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{top:3px!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-form-field-flex{background-color:#e9ecef!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-form-field-flex input{opacity:1!important;color:#00000061!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field{padding-right:0!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field .mat-mdc-text-field-wrapper{padding-bottom:0;background-color:#fff;padding-left:0}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-flex{width:147px;height:35px;border:1px solid rgb(207,207,207);margin-left:40px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix{border:none!important;top:5px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix input{font-size:14px;color:#000}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-form-field-infix{padding-top:4px;padding-bottom:4px;padding-left:8px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix{position:relative;left:-140px;top:1px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix .mat-mdc-button-persistent-ripple{color:#000}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix button.mat-mdc-icon-button.mat-mdc-button-base{padding:0}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mdc-line-ripple{display:none}.date[_ngcontent-%COMP%] datepicker.date-warnings[_ngcontent-%COMP%] .mat-mdc-form-field-flex{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.small[_ngcontent-%COMP%]{margin-right:5px!important}.small[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:143px}.col-auto[_ngcontent-%COMP%]{font-size:.875rem;height:fit-content}.col-auto[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1.25rem;color:#3b3b3b;margin-right:5px;line-height:unset!important;position:relative;top:2px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .col-auto[_ngcontent-%COMP%] span.outlet[_ngcontent-%COMP%]{padding:4px 8px 3px 5px;border:1px solid #dddddd;font-size:.875rem}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:36px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:disabled{background-color:#e9ecef!important;opacity:1!important;color:#00000061!important}.col-auto[_ngcontent-%COMP%] .outlet[_ngcontent-%COMP%]{width:165px;color:#337ab7;background:#fff}.col-auto[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:150px}.col-auto.supplier[_ngcontent-%COMP%] autocompleteV2[_ngcontent-%COMP%] input{font-size:14px}"]})};var $n=class r{onSubmit=new et;onOpenVoidModal=new et;onOpenNoteModal=new et;submit(){this.onSubmit.emit()}openVoidModal(){this.onOpenVoidModal.emit()}openNoteModal(){this.onOpenNoteModal.emit()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-cart-action"]],outputs:{onSubmit:"onSubmit",onOpenVoidModal:"onOpenVoidModal",onOpenNoteModal:"onOpenNoteModal"},decls:10,vars:0,consts:[[1,"mt-5","d-flex","action-button","justify-content-between",2,"padding-left","120px"],[1,"btn","btn-gray","fw-bold","border","text-dark",2,"height","60px","width","120px",3,"click"],[1,"fa-solid","fa-note-sticky"],[1,"btn","btn-gray","fw-bold","border","text-dark","mx-5",2,"height","60px","width","120px",3,"click"],[1,"fa-solid","fa-rectangle-xmark"],[1,"btn","btn-success","d-flex","justify-content-around","align-items-center",2,"height","60px","width","200px",3,"click"],[1,"fw-bold"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"button",1),g("click",function(){return n.openNoteModal()}),f(2,"i",2),m(3," NOTE "),a(),o(4,"button",3),g("click",function(){return n.openVoidModal()}),f(5,"i",4),m(6," VOID "),a(),o(7,"button",5),g("click",function(){return n.submit()}),o(8,"span",6),m(9,"PROCESS"),a()()())},styles:[".btn-gray[_ngcontent-%COMP%]{background:linear-gradient(to bottom,#fff,#eee)}.action-button[_ngcontent-%COMP%]{width:550px}"]})};var Io=r=>({ID:r}),cs=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function ds(r,e){if(r&1&&(o(0,"div",21)(1,"div",20),m(2),a(),o(3,"div",20),m(4),I(5,"number"),a()()),r&2){let t=e.$implicit;l(2),b(t.Variant.Name),l(2),b(O(5,2,t.Quantity))}}var Kn=class r{total;cartItems;completeInfo;onUndo=new et;onNewForm=new et;undo(){this.onUndo.emit()}newForm(){this.onNewForm.emit()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-complete"]],inputs:{total:"total",cartItems:"cartItems",completeInfo:"completeInfo"},outputs:{onUndo:"onUndo",onNewForm:"onNewForm"},decls:31,vars:16,consts:[[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","bg-light-gray","py-3"],["type","button","routerLink","/print/Adjustment","target","_blank",1,"btn","btn-light-gray",3,"queryParams"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px","border-bottom","1px solid rgba(0, 0, 0, 0.125)"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body"],["class","row justify-content-between mb-5",4,"ngFor","ngForOf"],[1,"row","justify-content-between","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col","text-start"],[1,"row","justify-content-between","mb-5"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h1",4),f(5,"i",5),m(6,"Inventory Adjustment Complete"),a()(),o(7,"div",6)(8,"div",7)(9,"div",8)(10,"a",9),g("click",function(){return n.newForm()}),m(11,"New Adjustment (F8)"),a()()()(),o(12,"div",10)(13,"a",11),f(14,"i",12),m(15,"Print "),a()()()(),o(16,"div",13)(17,"div",2)(18,"div",14)(19,"h2",15)(20,"a",16),m(21),a()()(),o(22,"div",17),_(23,ds,6,4,"div",18),o(24,"div",19)(25,"div",20),m(26,"Total Quantity:"),a(),o(27,"div",20),m(28),I(29,"sum"),I(30,"number"),a()()()()()()),t&2&&(l(13),p("queryParams",A(11,Io,n.completeInfo.OrderID)),l(7),p("routerLink",X(13,cs))("queryParams",A(14,Io,n.completeInfo.OrderID)),l(),M("#",n.completeInfo.InvoiceNumber,""),l(2),p("ngForOf",n.cartItems),l(5),b(O(30,9,Q(29,6,n.cartItems,"Quantity"))))},dependencies:[K,ut,nt,fe]})};var gs=["cartContainer"];function fs(r,e){r&1&&f(0,"th",19)}function hs(r,e){r&1&&f(0,"th",20)}function Cs(r,e){r&1&&(o(0,"th",21),m(1,"Cost"),a())}function ys(r,e){r&1&&(o(0,"th",22),m(1,"Total"),a())}function vs(r,e){if(r&1&&(o(0,"td")(1,"small"),m(2),a()()),r&2){let t=c().index;l(2),M("",t+1,".")}}function bs(r,e){if(r&1&&(o(0,"i",27),m(1),a()),r&2){let t=c().$implicit;l(),M("",t.Variant.CategoryName," ")}}function Is(r,e){if(r&1&&(q(0),f(1,"span",32),G()),r&2){let t=c().$implicit;l(),p("innerHTML",t.Note,L)}}function xs(r,e){if(r&1&&(o(0,"td",30),m(1),a()),r&2){let t=c().$implicit;l(),b(t.Variant.UOM!="null"?t.Variant.UOMName:"")}}function Ss(r,e){if(r&1&&(o(0,"td",30),m(1),I(2,"number"),a()),r&2){let t=c().$implicit;l(),b(O(2,1,t.Cost))}}function Ds(r,e){if(r&1&&(o(0,"td",30),m(1),I(2,"number"),a()),r&2){let t=c().$implicit;l(),b(O(2,1,t.Cost*t.Quantity))}}function Ps(r,e){if(r&1){let t=v();o(0,"tr",23),g("click",function(){let i=d(t),s=i.$implicit,y=i.index,E=c();return u(E.onSelect({item:s,index:y}))})("contextmenu",function(i){let s=d(t),y=s.$implicit,E=s.index,mt=c();return u(mt.onContextMenu(i,y,E))}),o(1,"td",24)(2,"i",25),g("click",function(){let i=d(t),s=i.$implicit,y=i.index,E=c();return u(E.onRemove({item:s,index:y}))}),a()(),_(3,vs,3,1,"td",26),o(4,"td")(5,"span",27),m(6),a(),_(7,bs,2,1,"i",28),f(8,"app-serial-note",29),_(9,Is,2,1,"ng-container",26),a(),o(10,"td"),m(11),a(),o(12,"td",30),m(13),I(14,"number"),o(15,"span"),m(16),a()(),_(17,xs,2,1,"td",31)(18,Ss,3,3,"td",31)(19,Ds,3,3,"td",31),a()}if(r&2){let t=e.$implicit,n=c();p("cdkDragDisabled",!n.enabledDragDrop),l(3),p("ngIf",n.appConfig.ModuleSell.Grid.RowNumberVisible),l(3),b(t.Variant.Name),l(),p("ngIf",n.appConfig.ModuleSell.Grid.CategoryVisible),l(),p("serials",t.Serial),l(),p("ngIf",t.Note),l(2),b(t.Variant.Code),l(2),M(" ",O(14,12,t.Quantity),""),l(3),b(t.UnitQuantity>1?"@"+t.UnitQuantity:""),l(),p("ngIf",n.appConfig.ModuleSell.Grid.UOMVisible),l(),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.product.Cost)}}function ws(r,e){if(r&1){let t=v();o(0,"button",33),g("click",function(){let i=d(t).item,s=c();return u(s.onReverse(i,!0))}),m(1,"Return"),a(),o(2,"button",33),g("click",function(){let i=d(t).item,s=c();return u(s.onReverse(i,!1))}),m(3,"Purchase"),a()}}var Jn=class r{constructor(e,t,n){this.loadService=e;this.cartItemService=t;this.roleService=n;this.cartItems=[],this.destroy$=new ot,this.onSelectItem=new et,this.onReturnItem=new et,this.onPurchaseItem=new et,this.onRemoveItem=new et,this.onDragItem=new et,this.cartItemsChange=new et,this.cartItemService.notifyNewItem$.pipe(W(i=>w.IsNotEmpty(i))).subscribe({next:i=>{setTimeout(()=>{let s=this.cartContainer.nativeElement.scrollHeight;this.cartContainer.nativeElement.scrollTop=s},1)}})}cartItems;cartItemsChange;onSelectItem;onReturnItem;onPurchaseItem;onRemoveItem;onDragItem;entities;cartContainer;contextMenu;contextMenuPosition={x:"0px",y:"0px"};onContextMenu(e,t,n){e.preventDefault(),this.contextMenuPosition.x=e.clientX+"px",this.contextMenuPosition.y=e.clientY+"px",t.Index=n,this.contextMenu.menuData={item:t},this.contextMenu.openMenu()}onDrop(e){Cr(this.cartItems,e.previousIndex,e.currentIndex),this.cartItemService.updateCartItem(this.cartItems),this.onDragItem.emit(this.cartItems),this.cartItemsChange.emit(this.cartItems)}destroy$;appConfig;enabledDragDrop=!0;ngOnInit(){this.initAppConfig(),this.initDragDropEnabled()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}initDragDropEnabled(){w.isMobileDevice&&(this.enabledDragDrop=!1)}initAppConfig(){this.appConfig=this.loadService.Data.AppConfigJSON,this.entities=this.loadService.Data.Entities}onRemove(e){this.onRemoveItem.emit(e)}onSelect(e){this.onSelectItem.emit(e)}onReverse(e,t){t?(e.Quantity>0&&(e.Quantity=e.Quantity*-1),this.onReturnItem.emit(e)):(e.Quantity<0&&(e.Quantity=e.Quantity*-1),this.onPurchaseItem.emit(e))}static \u0275fac=function(t){return new(t||r)(C(Un),C(be),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-cart-display"]],viewQuery:function(t,n){if(t&1&&(pn(gs,5),pn(Nn,7)),t&2){let i;cn(i=dn())&&(n.cartContainer=i.first),cn(i=dn())&&(n.contextMenu=i.first)}},inputs:{cartItems:"cartItems"},outputs:{cartItemsChange:"cartItemsChange",onSelectItem:"onSelectItem",onReturnItem:"onReturnItem",onPurchaseItem:"onPurchaseItem",onRemoveItem:"onRemoveItem",onDragItem:"onDragItem"},decls:24,vars:10,consts:[["cartContainer",""],["contextMenu","matMenu"],[1,"cashier"],[1,"row","g-0","cart-table","border-bottom"],["cdkScrollable","",1,"col"],[1,"table"],[1,"border-start-0"],[2,"width","18px"],["style","width: 36px",4,"ngIf"],[1,"text-start",2,"width","250px"],[2,"cursor","pointer","width","60px"],[1,"text-end",2,"width","50px"],["class","text-end","style","width: 0.75rem",4,"ngIf"],["class","text-end","style","width: 90px;",4,"ngIf"],["class","text-end","style","width: 85px;",4,"ngIf"],["cdkDropList","",1,"itemList",3,"cdkDropListDropped"],["class","item","cdkDrag","",3,"cdkDragDisabled","click","contextmenu",4,"ngFor","ngForOf"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["matMenuContent",""],[2,"width","36px"],[1,"text-end",2,"width","0.75rem"],[1,"text-end",2,"width","90px"],[1,"text-end",2,"width","85px"],["cdkDrag","",1,"item",3,"click","contextmenu","cdkDragDisabled"],[1,"cursor"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Click to Remove",1,"fa","fa-xmark","text-danger",3,"click"],[4,"ngIf"],[1,"d-block"],["class","d-block",4,"ngIf"],[3,"serials"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"innerHTML"],["mat-menu-item","",3,"click"]],template:function(t,n){if(t&1){let i=v();o(0,"div",2)(1,"div",3)(2,"div",4,0)(4,"table",5)(5,"thead")(6,"tr",6),f(7,"th",7),_(8,fs,1,0,"th",8),o(9,"th",9),m(10,"Item"),a(),o(11,"th",10),m(12,"Code"),a(),o(13,"th",11),m(14,"Qty"),a(),_(15,hs,1,0,"th",12)(16,Cs,2,0,"th",13)(17,ys,2,0,"th",14),a()(),o(18,"tbody",15),g("cdkDropListDropped",function(y){return d(i),u(n.onDrop(y))}),_(19,Ps,20,14,"tr",16),a()()()(),f(20,"div",17),o(21,"mat-menu",null,1),_(23,ws,4,0,"ng-template",18),a()()}if(t&2){let i=yt(22);l(8),p("ngIf",n.appConfig.ModuleSell.Grid.RowNumberVisible),l(7),p("ngIf",n.appConfig.ModuleSell.Grid.UOMVisible),l(),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.product.Cost),l(2),p("ngForOf",n.cartItems),l(),nr("left",n.contextMenuPosition.x)("top",n.contextMenuPosition.y),p("matMenuTriggerFor",i)}},dependencies:[K,F,mr,Nr,kr,Ar,Nn,wn,Pn,Ht,ye,nt],styles:[".cashier[_ngcontent-%COMP%]{width:550px;max-width:37rem;min-width:33rem}div.row.cart-table[_ngcontent-%COMP%]{border-left:solid 1px #CFCFCF}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%]{overflow:auto;height:250px}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background:#fbfbf7}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:.75rem;padding:9px 5px!important}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:.75rem;padding:6px 5px;border-bottom:1px solid #CFCFCF}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child{padding-right:0}.cdk-drag-preview[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}.item[_ngcontent-%COMP%]:last-child{border:none}.itemList.cdk-drop-list-dragging[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}"]})};var Os=()=>["/menu/Adjustment/Adjustment/Archive"];function Ts(r,e){r&1&&(o(0,"a",4),m(1,"Cancel"),a()),r&2&&p("routerLink",X(1,Os))}function Es(r,e){if(r&1){let t=v();o(0,"div",11)(1,"POS-cart-header",12),g("onCreateItem",function(){d(t);let i=c(2);return u(i.selectItem())})("onOpenUploadModal",function(){d(t);let i=c(2);return u(i.openUploadModal())})("onAddItem",function(i){d(t);let s=c(2);return u(s.addItem(i))})("onScanCode",function(i){d(t);let s=c(2);return u(s.onScanBarcode(i))}),a(),o(2,"POS-cart-display",13),g("onRemoveItem",function(i){d(t);let s=c(2);return u(s.removeItem(i))})("onSelectItem",function(i){d(t);let s=c(2);return u(s.selectItem(i))})("onDragItem",function(i){d(t);let s=c(2);return u(s.saveItemAfterDrag(i))})("onReturnItem",function(i){d(t);let s=c(2);return u(s.onReturnOrPurchaseItem(i))})("onPurchaseItem",function(i){d(t);let s=c(2);return u(s.onReturnOrPurchaseItem(i))}),a(),o(3,"POS-cart-action",14),g("onSubmit",function(){d(t);let i=c(2);return u(i.submit())})("onOpenVoidModal",function(){d(t);let i=c(2);return u(i.openVoidModal())})("onOpenNoteModal",function(){d(t);let i=c(2);return u(i.openNoteModal())}),a()()}if(r&2){let t=c(2);l(),p("cartItems",t.cartItems)("isUpload",!0),l(),p("cartItems",t.cartItems)}}function js(r,e){if(r&1){let t=v();o(0,"div",5)(1,"POS-toolbar",6),g("onOpenOutletModal",function(){d(t);let i=c();return u(i.openOutletModal())}),a(),o(2,"div",7)(3,"div",8),f(4,"pos-quick-key",9),a(),_(5,Es,4,3,"div",10),a()()}if(r&2){let t=c();l(),p("adjustmentData",t.adjustmentData)("adjustmentTypes",t.adjustmentTypes)("outletName",t.outletName)("isEdit",t.isEdit)("role",t.role.global),l(3),p("quickKeyId",t.quickKeyId)("outletID",t.outletID),l(),p("ngIf",t.adjustmentStorage)}}function ks(r,e){if(r&1){let t=v();o(0,"div",15)(1,"POS-complete",16),g("onUndo",function(){d(t);let i=c();return u(i.undo())})("onNewForm",function(){d(t);let i=c();return u(i.newForm())}),a()()}if(r&2){let t=c();l(),p("total",t.total)("cartItems",t.cartItems)("completeInfo",t.completeInfo)}}var Yn=class r extends _e{constructor(t,n,i,s,y,E,mt,xt,St,Dt,At,Bt){super(t);this.adjustmentDataService=i;this.firstLoadService=s;this.matDialog=y;this.backEndService=E;this.quickKeyService=mt;this.cartItemService=xt;this.toastr=St;this.router=Dt;this.route=At;this.role=Bt;this.destroy$=new ot,this.adjustmentDataService.Data$.pipe(rt(this.destroy$)).subscribe(vt=>{this.adjustmentData=vt,this.fillCartItems()}),this.quickKeyService.onSelectQuickeyItem$.pipe(rt(this.destroy$),W(vt=>w.IsNotEmpty(vt.id)),ae(vt=>this.cartItemService.getItemById(vt.id,vt.entityID))).subscribe(vt=>this.cartItemService.addNewItem(vt))}quickKeyId;adjustmentData;adjustmentStorage;adjustmentTypes;outletID=w.GuidEmpty;outletName="Choose an Outlet";entities;cartItems;completeInfo;isComplete;total=0;destroy$;isEdit;handleF8(){this.isComplete&&this.newForm()}ngOnInit(){this.initLoadForm()}ngOnDestroy(){this.adjustmentDataService.pushNewValue(new we),this.quickKeyService.Data=new eo,this.destroy$.next(!0),this.destroy$.complete()}initLoadForm(){this.menuData$.subscribe(()=>{let t=this.adjustmentData.Order.ID;w.IsEmpty(t)&&w.IsNotEmpty(this.route.snapshot.queryParams.ID)&&(t=this.route.snapshot.queryParams.ID,this.isEdit=!0);let n=this.adjustmentData.Order.EntityID;this.firstLoadService.getStorage(pt.LoadFormAdjustment,t,n).subscribe(i=>{this.fillData(i),w.IsEmpty(t)&&this.entities.length>1?this.openOutletModal():this.entities.length==1&&xe([this.backEndService.generateNumber(this.outletID,pt.AdjustmentGenerateNumber),this.backEndService.getQuickKey(this.outletID,pt.GetQuickKeyByEntityID)]).subscribe(([s,y])=>{this.adjustmentData.Order.Number=s.Number,this.initQuickKey(y)})})})}fillData(t){if(this.adjustmentStorage=t,this.isEdit&&(this.menuData.H=`Edit Adjustment #${t.Data.Order.Number}`),this.firstLoadService.pageState=2,this.entities=this.adjustmentStorage.Entities,this.entities.length==1&&(this.outletID=this.entities[0].ID,this.outletName=this.entities[0].Name,this.adjustmentData.Order.EntityID=this.outletID),this.adjustmentTypes=this.adjustmentStorage.AdjustmentTypes,this.adjustmentData.Order.TypeID=this.adjustmentStorage.AppConfigJSON.ModuleAdjustment.Advance.AdjustmentInputType,w.IsEmpty(this.adjustmentData.Order.Date)&&(this.adjustmentData.Order.Date=this.adjustmentStorage.ServerTime.toString()),w.IsNotEmpty(t.Data)){this.adjustmentDataService.pushNewValue(t.Data),this.outletID=t.Data.Order.EntityID;let n=this.entities.find(i=>i.ID==this.outletID);this.outletName=n.Name,this.quickKeyId=n.QuickKeyTemplateID,this.backEndService.getQuickKey(this.outletID,pt.GetQuickKeyByEntityID).subscribe(i=>this.initQuickKey(i))}}fillCartItems(){this.cartItems=[];let t;this.adjustmentData.Items.forEach(n=>{t=new he,t.ID=n.ID,t.Taxable=n.Taxable,n.Variant.Serial=n.Serial,t.Quantity=n.Quantity,t.Note=n.Note,t.Cost=n.Cost,t.patchByVariantAdjustment(n.Variant),this.cartItems.push(t)})}openOutletModal(){this.isEdit||this.matDialog.open(ao,{data:{Entities:this.entities}}).afterClosed().pipe(W(t=>w.IsNotEmpty(t)),N(t=>{this.outletName=t.outlet.Name,this.outletID=t.outlet.ID,this.quickKeyId=t.outlet.QuickKeyTemplateID,this.adjustmentData.Order.EntityID=this.outletID}),ae(()=>xe([this.backEndService.generateNumber(this.outletID,pt.AdjustmentGenerateNumber),this.backEndService.getQuickKey(this.outletID,pt.GetQuickKeyByEntityID)]))).subscribe(([t,n])=>{this.adjustmentData.Order.Number=t.Number,this.initQuickKey(n)})}initQuickKey(t){this.quickKeyService.Data=t,this.quickKeyService.EntityID=this.outletID}saveItemAfterDrag(t){this.cartItemService.updateCartItem(t)}removeItem(t){this.cartItemService.removeItem(t)}selectItem(t){this.matDialog.open(Wn,{data:{itemInfo:t,entityID:this.outletID,adjustmentType:this.adjustmentData.Order.TypeID,isAdjustmentEdit:this.isEdit}})}addItem(t){this.cartItemService.getItemById(t,this.outletID).subscribe(n=>this.cartItemService.addNewItem(n))}onScanBarcode(t){this.cartItemService.addCartItemByCode(t,this.outletID)}openUploadModal(){this.matDialog.open(Vn,{data:{sampleUrl:"https://cdn.dealpos.xyz/web-import-template/ImportItem_Adjustment_TemplateV2.csv",API:"/API/Adjustment/UploadCsvV2",outletID:this.outletID}}).afterClosed().pipe(W(t=>w.IsNotEmpty(t)&&t.length>0)).subscribe(t=>t.forEach(n=>this.cartItemService.addNewItem(n,!0)))}openNoteModal(){this.matDialog.open(qn,{data:this.adjustmentData})}openVoidModal(){this.matDialog.open(lo).afterClosed().pipe(W(t=>t)).subscribe(()=>{let t=this.adjustmentData.Order.Number;this.adjustmentDataService.pushNewValue(new we),this.adjustmentData.Order.EntityID=this.outletID,this.adjustmentData.Order.Number=t,this.initLoadForm()})}submit(){if(w.IsEmpty(this.adjustmentData.Order.EntityID)){this.toastr.error("Please select outlet before proceeding..",tt.Error),this.openOutletModal();return}if(this.cartItems.length==0){this.toastr.error("You must have at least one item.",tt.Error);return}if(w.IsEmpty(this.adjustmentData.Order.Number)){this.toastr.error("Number cannot be empty.",tt.Error);return}if(this.validateItemSerial()==!1){this.toastr.warning(Pr.serialRequired,tt.Warning);return}this.adjustmentStorage.AppConfigJSON.ModuleAdjustment.Basic.Workflow===1?(this.adjustmentData.Order.StateID=4,this.adjustmentData.Items.forEach(t=>delete t.UnitPriceOriginal),this.backEndService.submitTransaction(this.adjustmentData,pt.SubmitAdjustment).subscribe(t=>{this.completeInfo=t,this.isComplete=!0,this.adjustmentData.Order.ID=t.OrderID,this.calculateTotal()})):this.isEdit?(this.adjustmentData.Items.forEach(t=>delete t.UnitPriceOriginal),this.backEndService.submitTransaction(this.adjustmentData,pt.SubmitAdjustment).subscribe(t=>{this.completeInfo=t,this.isComplete=!0,this.adjustmentData.Order.ID=t.OrderID,this.calculateTotal()})):this.matDialog.open(Gn,{data:this.adjustmentData}).afterClosed().pipe(W(t=>w.IsNotEmpty(t))).subscribe(t=>{this.completeInfo=t,this.isComplete=!0,this.adjustmentData.Order.ID=t.OrderID,this.calculateTotal()})}validateItemSerial(){let t=0;return this.getItemSerial().forEach(i=>{(i.Serial?.length==0||w.IsEmpty(i.Serial))&&(t+=1)}),t==0}getItemSerial(){return this.cartItems.filter(n=>n.Variant.TypeID==4)}calculateTotal(){this.cartItems.forEach(t=>this.total+=t.Cost)}undo(){this.isComplete=!1,this.initLoadForm()}newForm(){this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Form"]).then(()=>window.location.reload())}onReturnOrPurchaseItem(t){this.cartItemService.updateItem({item:t,index:t.Index})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(Ke),C(Un),C(ft),C(qe),C(no),C(be),C(_t),C(Nt),C(ce),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-new-inventory-adjustment"]],hostBindings:function(n,i){n&1&&g("keydown.F8",function(){return i.handleF8()},!1,Vt)},features:[dt],decls:6,vars:6,consts:[[3,"hideSearchDropdown","hideSearchBox","pageData"],["class","btn btn-outline-secondary",3,"routerLink",4,"ngIf"],["class","container-fluid",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid"],[3,"onOpenOutletModal","adjustmentData","adjustmentTypes","outletName","isEdit","role"],[1,"row","row","body","g-0","mt-4","justify-content-start"],[1,"col-auto","quickKey"],[3,"quickKeyId","outletID"],["class","col-auto cart ms-5",4,"ngIf"],[1,"col-auto","cart","ms-5"],[3,"onCreateItem","onOpenUploadModal","onAddItem","onScanCode","cartItems","isUpload"],[3,"onRemoveItem","onSelectItem","onDragItem","onReturnItem","onPurchaseItem","cartItems"],[3,"onSubmit","onOpenVoidModal","onOpenNoteModal"],[1,"container-fluid","mt-5"],[3,"onUndo","onNewForm","total","cartItems","completeInfo"]],template:function(n,i){n&1&&(o(0,"mainpanel-cmp",0)(1,"actions"),_(2,Ts,2,2,"a",1),a(),o(3,"content"),_(4,js,6,8,"div",2)(5,ks,2,3,"div",3),a()()),n&2&&(p("hideSearchDropdown",!0)("hideSearchBox",!0)("pageData",i.menuData),l(2),p("ngIf",!i.isComplete),l(2),p("ngIf",!i.isComplete),l(),p("ngIf",i.isComplete))},dependencies:[F,ut,lt,uo,ro,zn,$n,Kn,Jn]})};var Zn=class r{constructor(e){this.dialogRef=e;this.config=new ht,this.config.title="Export Adjustment Report",this.config.customWidth="382px"}pageNumber=1;pageSize=100;config;onOk(){this.dialogRef.close({pageNumber:this.pageNumber,pageSize:this.pageSize})}static \u0275fac=function(t){return new(t||r)(C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-export-report"]],decls:11,vars:3,consts:[[3,"onCancel","onClose","onOk","config"],[1,"container-fluid"],[1,"form-floating-outline"],["type","text","name","pageNumber","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["for","pageNumber"],["type","text","name","pageSize","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["for","pageSize"]],template:function(t,n){t&1&&(o(0,"modal-material",0),g("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()})("onOk",function(){return n.onOk()}),o(1,"content")(2,"div",1)(3,"div",2)(4,"input",3),D("ngModelChange",function(s){return x(n.pageNumber,s)||(n.pageNumber=s),s}),a(),o(5,"label",4),m(6,"Page Number"),a()(),o(7,"div",2)(8,"input",5),D("ngModelChange",function(s){return x(n.pageSize,s)||(n.pageSize=s),s}),a(),o(9,"label",6),m(10,"Page Size"),a()()()()()),t&2&&(p("config",n.config),l(4),S("ngModel",n.pageNumber),l(4),S("ngModel",n.pageSize))},dependencies:[at,U,J,Ct,Mt]})};var Ie=class r{constructor(e){this.http=e}currentUntilPage;toggleFetchTotalData;totalData;pageNumber;isNextBtnDisabled;isOnLastPage;calcCurrentUntilPage(e,t,n){this.currentUntilPage=e*(t-1)+n}setPageNumber(e){this.pageNumber=e}setPaginationButtonState(e,t,n){n==0?this.isNextBtnDisabled=!0:this.isNextBtnDisabled=!(n<e*t)}setTotalData(e,t,n){this.toggleFetchTotalData=!0,this.http.post(e,t).pipe(N(n)).subscribe(i=>this.totalData=i)}setPaginationState(e,t,n){this.calcCurrentUntilPage(e,t,n),this.setPageNumber(t),this.setPaginationButtonState(e,t,n)}static \u0275fac=function(t){return new(t||r)(Rt(j))};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var Xn=class r{constructor(e,t,n){this.state=n;this.fetchData$=i=>s=>t.post(i,s).pipe(bt(y=>y.Data),N(y=>this.state.setPaginationState(s.RowCount,s.PageNumber,y.length))),this.fetchLoader$=i=>()=>t.post(i)}filter$=new yn(void 0);fetchData$;fetchLoader$;getLoader$(e,t){return e.pipe(ae(this.fetchLoader$(t)),N(n=>this.filter$.next(n.Filter)))}getInfiniteListData$(e){return this.filter$.pipe(W(t=>t!==void 0),ae(this.fetchData$(e)),Xi(this.filter$),N(([t,n])=>this.state.setPaginationState(n.RowCount,n.PageNumber,t.length)),Zi((t,n)=>{let[i,s]=t,[y]=n;return s.PageNumber==1?[y,s]:[i.concat(y),s]}),bt(([t])=>t))}filterFromFirstPage(e){e.PageNumber=1,this.filter$.next(e)}nextPage(e){e.PageNumber+=1,this.filter$.next(e)}fetchTotalData(e,t){this.state.setTotalData(e,t)}fetchAllData(e,t){this.state.setTotalData(e,t,n=>{let i=V({},t);i.PageNumber=1,i.RowCount=n,this.filter$.next(i)})}static \u0275fac=function(t){return new(t||r)(Rt(it),Rt(j),Rt(Ie))};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};function Ns(r,e){if(r&1){let t=v();o(0,"span",8),g("click",function(){d(t);let i=c();return u(i.onFetchTotalData())}),o(1,"i",9),m(2,"?"),a()()}}function Vs(r,e){if(r&1&&(o(0,"span"),m(1),I(2,"number"),a()),r&2){let t=c();l(),b(O(2,1,t.state.totalData))}}function Fs(r,e){if(r&1){let t=v();o(0,"a",10),g("click",function(){d(t);let i=c();return u(i.onNextPage())}),f(1,"i",11),m(2," Next"),a()}}function Us(r,e){if(r&1){let t=v();o(0,"a",12),g("click",function(){d(t);let i=c();return u(i.onConcatAllData())}),f(1,"i",13),m(2," Show All"),a()}}var ti=class r{constructor(e){this.state=e}fetchTotalData=new et;fetchAllData=new et;nextPage=new et;ngOnInit(){}onFetchTotalData(){this.fetchTotalData.emit()}onNextPage(){this.nextPage.emit()}onConcatAllData(){this.fetchAllData.emit()}static \u0275fac=function(t){return new(t||r)(C(Ie))};static \u0275cmp=P({type:r,selectors:[["POS-infinite-list"]],outputs:{fetchTotalData:"fetchTotalData",fetchAllData:"fetchAllData",nextPage:"nextPage"},decls:11,vars:8,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load next page",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2),m(3),I(4,"number"),_(5,Ns,3,0,"span",3)(6,Vs,3,3,"span",4),m(7),a()(),o(8,"div",5),_(9,Fs,3,0,"a",6)(10,Us,3,0,"a",7),a()()),t&2&&(l(3),M(" Showing 1 - ",O(4,6,n.state.currentUntilPage)," of "),l(2),p("ngIf",!n.state.toggleFetchTotalData),l(),p("ngIf",n.state.toggleFetchTotalData),l(),M(" records ~ ",n.state.pageNumber," Page "),l(2),p("ngIf",n.state.isNextBtnDisabled&&!n.state.isOnLastPage),l(),p("ngIf",n.state.isNextBtnDisabled&&!n.state.isOnLastPage))},dependencies:[F,nt]})},ei=class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=je({type:r});static \u0275inj=Ee({imports:[Ne]})};var Rs=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Qs=r=>({ID:r});function Bs(r,e){if(r&1){let t=v();o(0,"button",13),g("click",function(){d(t);let i=c().ngIf,s=c();return u(s.openExportModal(i.Filter))}),f(1,"i",14),m(2," Export"),a()}}function Hs(r,e){if(r&1){let t=v();o(0,"div",15)(1,"h6"),m(2,"Outlets"),a(),o(3,"outlet-selector",16),D("ngModelChange",function(i){d(t);let s=c().ngIf;return x(s.Filter.EntityID,i)||(s.Filter.EntityID=i),u(i)}),a(),o(4,"h6"),m(5,"From"),a(),o(6,"datepicker",17),D("dateChange",function(i){d(t);let s=c().ngIf;return x(s.Filter.From,i)||(s.Filter.From=i),u(i)}),a(),o(7,"h6"),m(8,"To"),a(),o(9,"datepicker",18),D("dateChange",function(i){d(t);let s=c().ngIf;return x(s.Filter.To,i)||(s.Filter.To=i),u(i)}),a()()}if(r&2){let t=c().ngIf;l(3),p("accessType",2),S("ngModel",t.Filter.EntityID),p("multiple",!1),l(3),p("isFloatingLabel",!1),S("date",t.Filter.From),l(3),p("isFloatingLabel",!1),S("date",t.Filter.To)}}function Ws(r,e){r&1&&(o(0,"th",19),m(1,"@ Cost"),a())}function qs(r,e){r&1&&(o(0,"th",19),m(1,"@ Price"),a())}function Gs(r,e){if(r&1&&(o(0,"th",33),m(1),I(2,"number"),a()),r&2){let t=c().$implicit;l(),M(" ",O(2,1,t.UnitCost),"")}}function zs(r,e){if(r&1&&(o(0,"th",33),m(1),I(2,"number"),a()),r&2){let t=c().$implicit;l(),M(" ",O(2,1,t.UnitPrice),"")}}function $s(r,e){if(r&1&&(o(0,"tr")(1,"th",29),m(2),a(),o(3,"th",30),m(4),a(),o(5,"th",31),m(6),I(7,"number"),a(),_(8,Gs,3,3,"th",32)(9,zs,3,3,"th",32),a()),r&2){let t=e.$implicit,n=c(3);l(2),M(" ",t.VariantName,""),l(2),M(" ",t.VariantCode,""),l(2),b(O(7,5,t.Quantity)),l(2),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.sell.UnitPriceEditor)}}function Ks(r,e){if(r&1&&(o(0,"div")(1,"div",20)(2,"div",21)(3,"a",22),f(4,"span",23),I(5,"date"),f(6,"small",24),I(7,"date"),o(8,"small",25),m(9),a()()()(),o(10,"div")(11,"strong",26),m(12),a(),f(13,"div",27),a(),o(14,"table",28)(15,"tbody"),_(16,$s,10,7,"tr",11),a()()()),r&2){let t=e.$implicit;l(3),p("routerLink",X(14,Rs))("queryParams",A(15,Qs,t.ID)),l(),p("innerHTML",t.EntityName+" #"+t.Number+" - "+Q(5,8,t.Created,"dd MMM yyyy"),L),l(2),p("innerHTML","("+Q(7,11,t.Created,"HH:mm")+")",L),l(3),M(" ",t.PIC,""),l(3),M("[Q:",t.Quantity,"]"),l(),p("innerHTML",t.Note,L),l(3),p("ngForOf",t.Items)}}function Js(r,e){if(r&1){let t=v();o(0,"mainpanel-cmp",2),D("textChange",function(i){let s=d(t).ngIf;return x(s.Filter.Number,i)||(s.Filter.Number=i),u(i)}),g("onSubmit",function(){let i=d(t).ngIf,s=c();return u(s.search(i.Filter))}),D("filterChange",function(i){let s=d(t).ngIf;return x(s.Filter,i)||(s.Filter=i),u(i)}),o(1,"actions"),_(2,Bs,3,0,"button",3),a(),o(3,"filters"),_(4,Hs,10,7,"ng-template",null,0,$),a(),o(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),m(12,"Name"),a(),o(13,"th",8),m(14,"Code"),a(),o(15,"th",9),m(16,"Qty"),a(),_(17,Ws,2,0,"th",10)(18,qs,2,0,"th",10),a()()(),_(19,Ks,17,17,"div",11),I(20,"async"),o(21,"POS-infinite-list",12),g("nextPage",function(){let i=d(t).ngIf,s=c();return u(s.nextPage(i.Filter))})("fetchTotalData",function(){let i=d(t).ngIf,s=c();return u(s.fetchTotalData(i.Filter))})("fetchAllData",function(){let i=d(t).ngIf,s=c();return u(s.fetchAllData(i.Filter))}),a()()()()}if(r&2){let t=e.ngIf,n=c();p("pageData",n.menuData),S("text",t.Filter.Number),p("isFilterOnDropdown",!1),S("filter",t.Filter),l(2),p("ngIf",n.roleService.global.Export),l(15),p("ngIf",n.roleService.product.Cost),l(),p("ngIf",n.roleService.sell.UnitPriceEditor),l(),p("ngForOf",O(20,8,n.data$))}}var ni=class r extends _e{constructor(t,n,i,s,y,E,mt){super(t);this.http=n;this.infPagination=i;this.matDialog=y;this.csvConverter=E;this.roleService=mt;this.loader$=i.getLoader$(this.menuData$,this.loaderEndpoint),this.data$=i.getInfiniteListData$(this.dataEndpoint)}dataEndpoint="/api/Adjustment/AuditAdjustmentReport";loaderEndpoint="/api/AdjustmentLoader/AuditAdjustmentReport";countEndpoint="/api/Adjustment/AuditAdjustmentReportCount";data$;loader$;loader;search(t){this.infPagination.filterFromFirstPage(t)}nextPage(t){this.infPagination.nextPage(t)}fetchTotalData(t){this.infPagination.fetchTotalData(this.countEndpoint,t)}fetchAllData(t){this.infPagination.fetchAllData(this.countEndpoint,t)}onOpenExportDialog(t){this.matDialog.open(Zn).afterClosed().pipe(W(n=>w.IsNotEmpty(n))).subscribe(n=>{t.RowCount=n.pageSize,t.PageNumber=n.pageNumber,this.exportCSV("AdjustmentExport/AuditAdjustmentReport","AdjustmentReport.csv",t)})}exportCSV(t,n,i){this.http.post(`/api/${t}`,i).subscribe(s=>{this.csvConverter.convertToCSV(s,n)})}openExportModal(t){this.matDialog.open(Wt,{data:{title:"Adjustment Report",exportTypes:[{ID:"AdjustmentExport/AuditAdjustmentReport",Value:"Default",FileName:"Adjustment Report"}],filterExport:t,getAllDataLengthAPI:"Adjustment/AuditAdjustmentReportCount",pagination:!0}})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(Xn),C(Ie),C(ft),C(Ut),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-adjustment-reports"]],features:[dt],decls:2,vars:3,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],["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"],[3,"nextPage","fetchTotalData","fetchAllData"],[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"],[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(n,i){n&1&&(_(0,Js,22,10,"mainpanel-cmp",1),I(1,"async")),n&2&&p("ngIf",O(1,1,i.loader$))},dependencies:[K,F,ut,lt,U,J,Ce,ti,An,me,nt,pe]})};var Ys=r=>({show:r});function Zs(r,e){if(r&1){let t=v();o(0,"button",25),g("click",function(){d(t);let i=c(2);return u(i.ok())}),m(1,"Upload"),a()}}function Xs(r,e){if(r&1){let t=v();o(0,"button",25),g("click",function(){d(t);let i=c(2);return u(i.confirmAdjustment())}),m(1,"Confirm Adjustment"),a()}}function tl(r,e){if(r&1&&(o(0,"div",26),m(1),I(2,"limitText"),a()),r&2){let t=e.item;p("title",(t==null||t.Name==null?null:t.Name.length)>23?t.Name:""),l(),M(" ",Q(2,2,t.Name,25)," ")}}function el(r,e){if(r&1){let t=v();o(0,"div",27)(1,"button",28),f(2,"i",29),m(3," Download Current Inventory "),a(),o(4,"ul",30)(5,"li")(6,"a",31),g("click",function(){d(t);let i=c(2);return u(i.downloadData(0))}),f(7,"i",32),m(8," Download CSV "),a()(),o(9,"li")(10,"a",33),g("click",function(){d(t);let i=c(2);return u(i.downloadData(1))}),f(11,"i",34),m(12," Download XLSX "),a()()()()}}function nl(r,e){if(r&1&&(o(0,"tr",40),f(1,"td",41)(2,"td",41)(3,"td",42),I(4,"number"),f(5,"td",42),I(6,"number"),f(7,"td",42),I(8,"number"),a()),r&2){let t=e.$implicit;It(t.QuantityDifferences<0?"danger":"success"),l(),p("innerHTML",t.Name,L),l(),p("innerHTML",t.Code,L),l(),p("innerHTML",O(4,9,t.Expected),L),l(2),p("innerHTML",O(6,11,t.Counted),L),l(2),It(t.QuantityDifferences<0?"text-danger":"text-success"),p("innerHTML",O(8,13,t.QuantityDifferences),L)}}function il(r,e){if(r&1&&(o(0,"table",35)(1,"thead",36)(2,"tr")(3,"th"),m(4,"Name"),a(),o(5,"th",37),m(6,"Code"),a(),o(7,"th",38),m(8,"Expected Stock"),a(),o(9,"th",38),m(10,"Counted Stock "),a(),o(11,"th",38),m(12,"Differences "),a()()(),o(13,"tbody"),_(14,nl,9,15,"tr",39),a()()),r&2){let t=c(2);l(14),p("ngForOf",t.opNames)}}function rl(r,e){if(r&1){let t=v();o(0,"mainpanel-cmp",1)(1,"actions"),_(2,Zs,2,0,"button",2)(3,Xs,2,0,"button",2),a(),o(4,"content")(5,"div",3)(6,"div",4)(7,"div",5)(8,"h5",6),m(9,"Outlet"),a(),o(10,"small",7),m(11,"Stock take location"),a()(),o(12,"div",8)(13,"div",9)(14,"div",10)(15,"div")(16,"ng-select",11),D("ngModelChange",function(i){d(t);let s=c();return x(s.formData.EntityID,i)||(s.formData.EntityID=i),u(i)}),g("change",function(i){d(t);let s=c();return u(s.getEntityName(i))}),_(17,tl,3,5,"ng-template",12),a()(),_(18,el,13,0,"div",13),a()()()(),o(19,"div",4)(20,"div",5)(21,"h5",6),m(22,"Counted Inventory"),a(),o(23,"small",7),m(24,".csv format"),a()(),o(25,"div",8)(26,"div",9)(27,"div",14)(28,"input",15),g("change",function(i){d(t);let s=c();return u(s.onSelectFile(i.target))}),a()()()()(),o(29,"div",16)(30,"div",5)(31,"h5",6),m(32,"Advanced"),a(),o(33,"small",7),m(34,"More Options"),a()(),o(35,"div",8)(36,"div",9)(37,"div",17)(38,"label",6),m(39,"Product Without Inventory"),a(),o(40,"small",18),m(41,"Download product Without Inventories"),a(),o(42,"div",19)(43,"radio-options",20),D("modelChange",function(i){d(t);let s=c();return x(s.formData.ProductWithoutInventory,i)||(s.formData.ProductWithoutInventory=i),u(i)}),a()()()()(),_(44,il,15,1,"table",21),a(),o(45,"a",22),m(46,"More Options"),a(),o(47,"div",23)(48,"div",24),m(49,"Tips"),a(),o(50,"ol")(51,"li"),m(52,"Choose your outlet then download the csv spreadsheet"),a(),o(53,"li"),m(54,"Fill the Quantity column beside the Expected column"),a(),o(55,"li"),m(56,"Upload your file using the Green Button on the top right corner"),a(),o(57,"li"),m(58,"Analyze the upload file on your screen and Confirm the Adjustment."),a(),o(59,"li"),m(60,'Inventory Adjustment only works for Product with type "Standard" / product with stock.'),a(),o(61,"li"),m(62,'"Composite" Product is not shown in the CSV you Download.'),a()()()()()()}if(r&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),p("ngIf",t.roleService.adjustment.Create&&!t.uploaded),l(),p("ngIf",t.uploaded),l(13),p("items",t.pageData.Entities),S("ngModel",t.formData.EntityID),l(2),p("ngIf",t.roleService.adjustment.Create||t.roleService.adjustment.Edit),l(11),It(A(13,Ys,t.opNames.length>0)),l(14),p("options",t.productOptions),S("model",t.formData.ProductWithoutInventory),l(),p("ngIf",t.opNames.length>0)}}var ii=class r extends Ft{constructor(t,n,i,s,y,E,mt){super(t,n,null,"Outlet/GetByUserAccessWrite");this.toastr=i;this.csvConverter=s;this.router=y;this.roleService=E;this.exp=mt;this.formData={},this.opNames=[]}formData;outletName;flag;uploaded=!1;opNames;productOptions=[{Key:"0",Value:"No"},{Key:"1",Value:"Yes"},{Key:"-1",Value:"Exclude Zero"}];csvResult;file;preInitList(){this.formData.EntityID=this.pageData.Entities[0].ID,this.outletName=this.pageData.Entities[0].Name,this.formData.ProductWithoutInventory="1"}onSelectFile(t){this.file=t.files[0]}ok(){let t=new FormData;t.append("Data",this.file),t.append("EntityID",this.formData.EntityID),t.append("ProductWithoutInventory",this.formData.ProductWithoutInventory),this.httpService.postFormData("/API/Adjustment/GetPreviewImportCSV",t).subscribe({next:n=>{this.opNames=n,this.uploaded=!0}})}downloadData(t){t==0?this.exp.exportCSV("InventoryExport/GetStockTakeSpreadsheet",this.formData):this.exp.exportXlsx("InventoryExport/GetStockTakeSpreadsheet",this.formData)}getEntityName(t){this.outletName=t.Name}getFormatedDate(){let t=new Date,n=(t.getDate()<10?"0":"")+t.getDate(),i=(t.getMonth()+1<10?"0":"")+(t.getMonth()+1),s=t.getFullYear().toString().substr(-2);return n+i+s}confirmAdjustment(){let t=[];if(this.opNames.forEach(s=>{let y={VariantID:s.ID,Quantity:s.QuantityDifferences,Cost:s.UnitCost,Price:s.UnitPrice};t.push(y)}),t.length<1)return alert("You must atleast have one item to adjust!"),!1;let n=new Date;this.formData.InventoryDate!=null&&(n=new Date(this.formData.InventoryDate));let i={Order:{EntityID:this.formData.EntityID,Date:n},Items:t,TypeID:1};this.httpService.post("/API/Adjustment/SubmitUseDefault",i).subscribe({next:s=>{this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Info"],{queryParams:{ID:s.OrderID}}).then(()=>window.location.reload())},error:s=>{}})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(_t),C(Ut),C(Nt),C(R),C(br))};static \u0275cmp=P({type:r,selectors:[["POS-csv-stock-take"]],features:[dt],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[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","ngModel"],["ng-option-tmp",""],["class","dropdown ms-3",4,"ngIf"],["id","import-section",1,"col-md-6","mb-10"],["accept",".csv","id","csv","type","file","name","myfile",1,"form-control",3,"change"],[1,"row","extra-options","border-bottom","mt-10","ms-2","collapse"],[1,"col-md-5"],[1,"ms-3","h6","fst-italic"],[1,"form-floating-outline","radio","border","rounded",2,"padding-top","14px"],["name","productInventory",3,"modelChange","options","model"],["class","table table-bordered mt-3",4,"ngIf"],["data-bs-toggle","collapse","data-bs-target",".extra-options","aria-expanded","true",1,"more","ms-2"],[1,"border","mt-5","ms-2"],[1,"fst-italic","text-primary","fw-bold","h5","ms-12","mt-3"],[1,"btn","btn-success",3,"click"],[3,"title"],[1,"dropdown","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle","mb-2",2,"height","37px !important","font-size","12px !important"],[1,"fa","fa-download","me-3"],[1,"dropdown-menu","dropdown-menu-start"],["role","button",1,"dropdown-item",3,"click"],[1,"fa-solid","fa-file-csv","me-3","mb-1"],["role","button",1,"dropdown-item","mt-2",3,"click"],[1,"fa-solid","fa-file-excel","me-3","mb-1"],[1,"table","table-bordered","mt-3"],[1,"thead-light","sticky-top-thead"],[2,"width","150px"],[1,"text-end",2,"width","120px"],["class","red",3,"class",4,"ngFor","ngForOf"],[1,"red"],[3,"innerHTML"],[1,"text-end",3,"innerHTML"]],template:function(n,i){n&1&&_(0,rl,63,15,"mainpanel-cmp",0),n&2&&p("ngIf",i.pageData)},dependencies:[K,F,lt,U,J,wt,vr,jn,nt,dr],styles:[".col-md-5[_ngcontent-%COMP%]{font-size:.875rem;height:fit-content}.col-md-5.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix input{font-size:14px;padding-bottom:3px}"]})};var ri=class extends _e{constructor(t,n){super(t);this.httpService=n;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(ae(()=>this.httpService.post(this.loaderApi,this.requestPayload))).subscribe(t=>this.loaderData=t)}getProduct(t){this.products=[],this.httpService.post(this.productsApi,t).subscribe(n=>{n.forEach(i=>{i.Counted="",this.products.push(i),this.originalProducts.push(i)})})}submitAdjustment(t){this.beforeSubmit(),this.httpService.post(this.submitApi,t).subscribe({next:n=>{this.adjustmentID=n.OrderID,this.completeInfo=n,this.error=null,this.onSubmitSuccess()},error:n=>{this.error=n,this.onSubmiterror()}})}onSubmitSuccess(){}beforeSubmit(){}onSubmiterror(){}};var ol=["stepper"],xo=r=>({"nb-button-override":r}),al=r=>({custom:r}),So=()=>["/menu/Products/Catalog/Variants/Info"],Bi=r=>({ID:r}),sl=r=>({"bg-gradient-warning":r}),ll=r=>({Filter:r}),ml=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function pl(r,e){if(r&1){let t=v();o(0,"button",9),g("click",function(){d(t);let i=c(2);return u(i.validateFilter())}),m(1,"Next"),a()}if(r&2){let t=c(2);p("disabled",!t.roleService.adjustment.Create)}}function cl(r,e){if(r&1){let t=v();o(0,"div",10)(1,"button",11),g("click",function(){d(t);let i=c(2);return u(i.stepper.previous())}),m(2," Back "),a(),o(3,"button",12),g("click",function(){d(t);let i=c(2);return u(i.stepper.next())}),m(4," Next "),a()()}if(r&2){let t=c(2);p("ngClass",A(1,xo,t.currentSubStatus!=t.subStatusEnum.PAID))}}function dl(r,e){if(r&1){let t=v();o(0,"div",10)(1,"button",13),g("click",function(){d(t);let i=c(2);return u(i.stepper.previous())}),m(2," Back "),a(),o(3,"button",14),g("click",function(){d(t);let i=c(2);return u(i.stepper.next())}),m(4," Confirm Adjustment "),a()()}if(r&2){let t=c(2);p("ngClass",A(1,xo,t.currentSubStatus!=t.subStatusEnum.PAID))}}function ul(r,e){r&1&&(f(0,"i",54),m(1,"Filter"))}function _l(r,e){r&1&&(o(0,"small",55),m(1,"Outlet option is required."),a())}function gl(r,e){r&1&&(f(0,"i",56),m(1,"Input"))}function fl(r,e){r&1&&(o(0,"th",41),m(1,"Expected"),a())}function hl(r,e){r&1&&(o(0,"th",41),m(1,"Changes"),a())}function Cl(r,e){if(r&1&&(o(0,"td"),m(1),a()),r&2){let t=c().$implicit;l(),b(t.Quantity)}}function yl(r,e){if(r&1&&(o(0,"td"),m(1),f(2,"i",63),m(3),a()),r&2){let t=c().$implicit;ji("bg-gradient-danger",t.Counted<t.Quantity)("bg-gradient-success",t.Counted>t.Quantity),l(),M("",t.Quantity," "),l(2),le(" ",t.Counted," (",(t.Counted-t.Quantity>0?"+":"")+(t.Counted-t.Quantity),")")}}function vl(r,e){if(r&1){let t=v();o(0,"i",64),g("click",function(){d(t);let i=c().$implicit,s=c(3);return u(s.clear(i))}),a()}}function bl(r,e){if(r&1){let t=v();o(0,"tr")(1,"td"),m(2),a(),o(3,"td",57),m(4),a(),o(5,"td",57),m(6),a(),o(7,"td")(8,"a",58),m(9),a()(),o(10,"td"),m(11),a(),_(12,Cl,2,1,"td",44),o(13,"td")(14,"input",59,2),D("ngModelChange",function(i){let s=d(t).$implicit;return x(s.Counted,i)||(s.Counted=i),u(i)}),g("ngModelChange",function(){let i=d(t).$implicit,s=yt(15),y=c(3);return u(y.onReset(i,s))}),a()(),_(16,yl,4,7,"td",60),o(17,"td",61),_(18,vl,1,0,"i",62),a()()}if(r&2){let t=e.$implicit,n=e.index,i=c(3);l(2),b(n+1+"."),l(2),b(t.CategoryName),l(2),b(t.ProductName),l(2),p("routerLink",X(14,So))("queryParams",A(15,Bi,t.ID)),l(),b(t.Model),l(2),b(t.Code),l(),p("ngIf",i.roleService.inventory.View),l(2),It(A(17,sl,t.Counted!==""&&t.Counted!=t.Quantity&&!i.roleService.inventory.View)),p("modifyValueOnWheel",!1),S("ngModel",t.Counted),l(2),p("ngIf",t.Counted!==""&&i.roleService.inventory.View),l(2),p("ngIf",t.Counted!=="")}}function Il(r,e){if(r&1){let t=v();q(0),o(1,"POS-complex-pagination",65),g("jumpToPage",function(){d(t);let i=c(3);return u(i.getProduct(i.filter))})("previousPage",function(){d(t);let i=c(3);return u(i.getProduct(i.filter))})("nextPage",function(){d(t);let i=c(3);return u(i.getProduct(i.filter))}),a(),G()}if(r&2){let t=c(3);l(),p("total",t.products.length)("pageData",A(2,ll,t.filter))}}function xl(r,e){r&1&&(f(0,"i",66),m(1,"Review"))}function Sl(r,e){r&1&&(o(0,"th",41),m(1,"Expected"),a())}function Dl(r,e){r&1&&(o(0,"th",41),m(1,"Differences"),a())}function Pl(r,e){if(r&1&&(o(0,"td"),m(1),a()),r&2){let t=c(2).$implicit;l(),b(t.Quantity)}}function wl(r,e){if(r&1&&(o(0,"span"),m(1),a()),r&2){let t=c(3).$implicit;l(),M("+",t.Counted-t.Quantity,"")}}function Ml(r,e){if(r&1&&(o(0,"span"),m(1),a()),r&2){let t=c(3).$implicit;l(),b(t.Counted-t.Quantity)}}function Ol(r,e){if(r&1&&(o(0,"td"),_(1,wl,2,1,"span",44)(2,Ml,2,1,"span",44),a()),r&2){let t=c(2).$implicit;l(),p("ngIf",t.Counted>=t.Quantity),l(),p("ngIf",t.Counted<t.Quantity)}}function Tl(r,e){if(r&1&&(o(0,"tr")(1,"td"),m(2),a(),o(3,"td",57),m(4),a(),o(5,"td")(6,"a",58),m(7),a()(),o(8,"td"),m(9),a(),_(10,Pl,2,1,"td",44),o(11,"td"),m(12),a(),_(13,Ol,3,2,"td",44),a()),r&2){let t=c(),n=t.$implicit,i=t.index,s=c(3);ji("soft-yellow",n.Counted<n.Quantity)("soft-green",n.Counted>n.Quantity),l(2),b(i+1+"."),l(2),b(n.ProductName),l(2),p("routerLink",X(13,So))("queryParams",A(14,Bi,n.ID)),l(),b(n.Model),l(2),b(n.Code),l(),p("ngIf",s.roleService.inventory.View),l(2),M(" ",n.Counted," "),l(),p("ngIf",s.roleService.inventory.View)}}function El(r,e){if(r&1&&(q(0),_(1,Tl,14,16,"tr",67),G()),r&2){let t=e.$implicit;l(),p("ngIf",t.Counted!=="")}}function jl(r,e){r&1&&(f(0,"i",68),m(1,"Finish"))}function kl(r,e){if(r&1&&(o(0,"div",69),f(1,"i",70),m(2),a()),r&2){let t=c(3);l(2),b(t.error.error.Message)}}function Al(r,e){if(r&1){let t=v();o(0,"mat-stepper",15,0),g("selectionChange",function(i){d(t);let s=c(2);return u(s.onNextStep(i))}),o(2,"mat-step",16),_(3,ul,2,0,"ng-template",17),o(4,"div",18)(5,"div",19)(6,"div",20)(7,"div",19)(8,"h3",21),m(9,"Outlet"),a()(),o(10,"div",22)(11,"ng-select",23,1),g("change",function(){d(t);let i=c(2);return u(i.toggleIsFilterFilled())}),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.filter.EntityID,i)||(s.filter.EntityID=i),u(i)}),a(),_(13,_l,2,0,"small",24),a()()(),o(14,"div",25)(15,"div",20)(16,"div",19)(17,"h3",21),m(18,"Category "),o(19,"small",26)(20,"em"),m(21,"Optional"),a()()()(),o(22,"div",22)(23,"ng-select",27),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.filter.CategoryID,i)||(s.filter.CategoryID=i),u(i)}),a()()()(),o(24,"div",25)(25,"div",20)(26,"div",19)(27,"h3",21),m(28,"Contain Text "),o(29,"small",26)(30,"em"),m(31,"Optional"),a()()()(),o(32,"div",28)(33,"input",29),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.filter.ProductName,i)||(s.filter.ProductName=i),u(i)}),a()()()(),o(34,"div",25)(35,"div",20)(36,"div",19)(37,"h3",21),m(38,"Note "),o(39,"small",26)(40,"em"),m(41,"Optional"),a()()()(),o(42,"div",22)(43,"textarea",30),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.note,i)||(s.note=i),u(i)}),a()()()()()(),o(44,"mat-step",31),_(45,gl,2,0,"ng-template",17),o(46,"div",32)(47,"table",33),g("matSortChange",function(i){d(t);let s=c(2);return u(s.sortData(i))}),o(48,"thead",34)(49,"tr")(50,"th",35),m(51,"No"),a(),o(52,"th",36),m(53,"Category"),a(),o(54,"th",37),m(55,"Product"),a(),o(56,"th",38),m(57,"Variant"),a(),o(58,"th",39),m(59,"Code"),a(),_(60,fl,2,0,"th",40),o(61,"th",41),m(62,"Counted"),a(),_(63,hl,2,0,"th",42),f(64,"th",35),a()(),o(65,"tbody"),_(66,bl,19,19,"tr",43),a()(),_(67,Il,2,4,"ng-container",44),a()(),o(68,"mat-step",45),_(69,xl,2,0,"ng-template",17),o(70,"div",46)(71,"div",47)(72,"table",48),g("matSortChange",function(i){d(t);let s=c(2);return u(s.sortData(i))}),o(73,"thead",49)(74,"tr"),f(75,"th",35),o(76,"th",50),m(77,"Name"),a(),o(78,"th",51),m(79,"Variant"),a(),o(80,"th",41),m(81,"Code"),a(),_(82,Sl,2,0,"th",40),o(83,"th",41),m(84,"Counted"),a(),_(85,Dl,2,0,"th",40),a()(),o(86,"tbody"),_(87,El,2,1,"ng-container",43),a()()()()(),o(88,"mat-step",52),_(89,jl,2,0,"ng-template",17)(90,kl,3,1,"div",53),a()()}if(r&2){let t=yt(12),n=c(2);p("linear",!0),l(2),p("completed",n.isFilterFilled),l(9),It(A(20,al,t.touched&&n.filter.EntityID==null)),p("items",n.loaderData.Entities),S("ngModel",n.filter.EntityID),p("clearable",!1),l(2),p("ngIf",t.touched&&n.filter.EntityID==null),l(10),p("items",n.loaderData.Categories),S("ngModel",n.filter.CategoryID),l(10),S("ngModel",n.filter.ProductName),l(10),S("ngModel",n.note),l(17),p("ngIf",n.roleService.inventory.View),l(3),p("ngIf",n.roleService.inventory.View),l(3),p("ngForOf",n.products),l(),p("ngIf",n.products.length>0),l(15),p("ngIf",n.roleService.inventory.View),l(3),p("ngIf",n.roleService.inventory.View),l(2),p("ngForOf",n.reviewedItems),l(3),p("ngIf",n.error)}}function Nl(r,e){r&1&&(o(0,"div",87),m(1," Difference"),a())}function Vl(r,e){if(r&1&&(o(0,"div",92),m(1),a()),r&2){let t=c().$implicit;It(t.Quantity-t.OriginalQuantity<0?"text-danger":"text-success"),l(),b((t.Quantity-t.OriginalQuantity>0?"+":" ")+(t.Quantity-t.OriginalQuantity))}}function Fl(r,e){if(r&1&&(o(0,"div",94)(1,"div",91),m(2),a(),o(3,"div",92),m(4),a(),_(5,Vl,2,3,"div",93),a()),r&2){let t=e.$implicit,n=c(3);l(2),le("",t.Name," (",t.Model,")"),l(2),b(t.Quantity),l(),p("ngIf",n.roleService.inventory.View)}}function Ul(r,e){if(r&1&&(o(0,"div",92),I(1,"sum"),I(2,"sum"),m(3),I(4,"sum"),I(5,"sum"),I(6,"sum"),I(7,"sum"),a()),r&2){let t=c(3);It(Q(1,3,t.displayedItems,"Quantity")-Q(2,6,t.displayedItems,"OriginalQuantity")<0?"text-danger":"text-success"),l(3),M(" ",(Q(4,9,t.displayedItems,"Quantity")-Q(5,12,t.displayedItems,"OriginalQuantity")>0?"+":" ")+(Q(6,15,t.displayedItems,"Quantity")-Q(7,18,t.displayedItems,"OriginalQuantity"))," ")}}function Ll(r,e){if(r&1){let t=v();o(0,"div",71)(1,"div",72)(2,"div",73)(3,"div",74)(4,"h1",75),f(5,"i",68),m(6,"Inventory Adjustment Completed"),a()(),o(7,"div",76)(8,"div",77)(9,"div",78)(10,"a",79),g("click",function(){d(t);let i=c(2);return u(i.newStockCount())}),m(11,"New Adjustment (F8)"),a()()()()()(),o(12,"div",80)(13,"div",73)(14,"div",81)(15,"h2",82)(16,"a",83),m(17),a()()(),o(18,"div",84)(19,"div",85)(20,"div",86),m(21,"Product Name (Variant)"),a(),o(22,"div",87),m(23,"Counted"),a(),_(24,Nl,2,0,"div",88),a(),_(25,Fl,6,4,"div",89),o(26,"div",90)(27,"div",91),m(28,"Total"),a(),o(29,"div",92),m(30),I(31,"sum"),a(),_(32,Ul,8,21,"div",93),a()()()()()}if(r&2){let t=c(2);l(16),p("routerLink",X(10,ml))("queryParams",A(11,Bi,t.adjustmentID)),l(),M("Adjustment #",t.completeInfo.InvoiceNumber,""),l(7),p("ngIf",t.roleService.inventory.View),l(),p("ngForOf",t.displayedItems),l(5),b(Q(31,7,t.displayedItems,"Quantity")),l(2),p("ngIf",t.roleService.inventory.View)}}function Rl(r,e){if(r&1){let t=v();o(0,"mainpanel-cmp",4),D("textChange",function(i){d(t);let s=c();return x(s.filter.ProductName,i)||(s.filter.ProductName=i),u(i)}),g("onSubmit",function(){d(t);let i=c();return u(i.filterProduct())}),o(1,"actions"),_(2,pl,2,1,"button",5)(3,cl,5,3,"div",6)(4,dl,5,3,"div",6),a(),o(5,"content"),_(6,Al,91,22,"mat-stepper",7)(7,Ll,33,13,"div",8),a()()}if(r&2){let t=c();p("pageData",t.menuData),S("text",t.filter.ProductName),p("hideSearchBox",t.currentStep!="input")("hideSearchDropdown",!0),l(2),p("ngIf",t.currentStep=="filter"),l(),p("ngIf",t.currentStep=="input"),l(),p("ngIf",t.currentStep=="review"),l(2),p("ngIf",!t.isCompleted),l(),p("ngIf",t.isCompleted)}}var oi=class r extends ri{constructor(t,n,i,s,y){super(t,n);this.toastr=i;this.ngZone=s;this.roleService=y;this.isFilterFilled=!1,this.filter={CategoryID:null,EntityID:null,ProductName:"",SupplierID:w.GuidEmpty,RowCount:500,PageNumber:1},this.oldFilter={CategoryID:"dummy",EntityID:"dummy",ProductName:"dummy",SupplierID:"dummy",RowCount:500,PageNumber:1},this.Items=[],this.initSubscriptionStatus()}stepper;isFilterFilled;currentStep="filter";Items;reviewedItems=[];displayedItems=[];note;isCompleted=!1;filter;oldFilter;currentSubStatus;subStatusEnum=ar;ngOnDestroy(){}initSubscriptionStatus(){this.currentSubStatus=parseInt(localStorage.getItem("SubscriptionStatus"))}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,n){n.value==""&&this.clear(t)}handlePreviousButton(){this.stepper&&this.ngZone.run(()=>{this.stepper.previous()})}toggleIsFilterFilled(){this.isFilterFilled=!0}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 n=0;this.products.forEach(i=>{i.Counted!==""&&i.Counted!=i.Quantity&&(i.Status=i.Counted>i.Quantity?"Over":"Under",n++)}),this.reviewedItems=this.products.filter(i=>i.Counted!==""),n&&!this.roleService.inventory.View&&this.toastr.warning("There are some items inventory that does not match! Click next to automatically adjust inventory.",tt.Warning)}else if(t.selectedStep.label=="finish"){this.products=this.originalProducts,this.currentStep="finish",this.Items=[],this.products.forEach(s=>{if(s.Counted!==""){let y={Name:s.ProductName,Cost:s.UnitCost,Price:s.UnitPrice,Quantity:s.Counted,OriginalQuantity:s.Quantity,VariantID:s.ID,Model:s.Model};this.Items.push(y)}});let n={Date:new Date,EntityID:this.filter.EntityID,Note:this.note,ID:this.adjustmentID||w.GuidEmpty},i={Items:this.Items,Order:n,TypeID:2};this.displayedItems=this.Items.filter(s=>s.Quantity-s.OriginalQuantity!=0),this.submitAdjustment(i)}}validateFilter(){if(!this.isFilterFilled){this.toastr.error("Outlet is required",tt.Error);return}this.stepper.next()}clear(t){t.Counted=""}newStockCount(){window.location.reload()}beforeSubmit(){this.isCompleted=!0}onSubmiterror(){this.isCompleted=!1}sortData(t){let n=this.products.slice();if(!t.active||t.direction===""){this.products=this.originalProducts;return}this.products=n.sort((i,s)=>{let y=t.direction==="asc",E=typeof i[t.active];switch(w.IsEmpty(i.Code)&&(i.Code=""),w.IsEmpty(s.Code)&&(s.Code=""),E){case"string":return w.compare(i[t.active].toLocaleLowerCase(),s[t.active].toLocaleLowerCase(),y);case"number":return w.compare(i[t.active],s[t.active],y);default:return 0}})}filterProduct(){this.filter.PageNumber=1,this.getProduct(this.filter)}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(_t),C(tr),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-spreadsheet-stock-take"]],viewQuery:function(n,i){if(n&1&&pn(ol,5),n&2){let s;cn(s=dn())&&(i.stepper=s.first)}},hostBindings:function(n,i){n&1&&g("keydown.F8",function(){return i.handleF8()},!1,Vt)("keydown.ArrowRight",function(){return i.handleNextButton()},!1,Vt)("keydown.ArrowLeft",function(){return i.handlePreviousButton()},!1,Vt)},features:[dt],decls:1,vars:1,consts:[["stepper",""],["outletFilter","ngModel"],["input",""],[3,"pageData","text","hideSearchBox","hideSearchDropdown","textChange","onSubmit",4,"ngIf"],[3,"textChange","onSubmit","pageData","text","hideSearchBox","hideSearchDropdown"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page","class","btn btn-success ms-auto me-0 d-block",3,"disabled","click",4,"ngIf"],["class","mt-5 nb-button",3,"ngClass",4,"ngIf"],[3,"linear","selectionChange",4,"ngIf"],["class","container-fluid row mt-5",4,"ngIf"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success","ms-auto","me-0","d-block",3,"click","disabled"],[1,"mt-5","nb-button",3,"ngClass"],["mat-button","","mat-raised-button","","matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-2",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn","btn-success",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-5",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success",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"],["placeholder","Choose a category","dropdownPosition","bottom","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[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"],["rows","6","type","text","name","note",1,"form-control",3,"ngModelChange","ngModel"],["label","input"],[1,"container-fluid",2,"height","calc(100vh - 180px)","overflow","auto","padding","0 24px","padding-bottom","20px"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","30px"],["mat-sort-header","CategoryName",2,"width","175px"],["mat-sort-header","ProductName",2,"width","200px"],["mat-sort-header","Model",2,"width","100px"],["mat-sort-header","Code",2,"width","75px"],["style","width: 75px;",4,"ngIf"],[2,"width","75px"],["style","width: 75px",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf"],["label","review"],[1,"container-fluid",2,"padding","0 24px"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom","w-100",2,"table-layout","fixed",3,"matSortChange"],[1,"thead-light"],["mat-sort-header","ProductName",2,"width","175px"],[2,"width","150px"],["label","finish"],["class","alert",4,"ngIf"],[1,"fa-solid","fa-filter","me-3"],[2,"color","red"],[1,"fa-solid","fa-calculator","me-3"],[2,"word-break","break-word"],["target","_blank",2,"color","#0976b4 !important",3,"routerLink","queryParams"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","modifyValueOnWheel","ngModel"],[3,"bg-gradient-danger","bg-gradient-success",4,"ngIf"],[1,"text-center"],["class","fa-solid fa-delete-left fa-2x clear align-middle","matTooltipPosition","above","matTooltip","reset counter",3,"click",4,"ngIf"],[1,"fa-solid","fa-right-long"],["matTooltipPosition","above","matTooltip","reset counter",1,"fa-solid","fa-delete-left","fa-2x","clear","align-middle",3,"click"],["api","Adjustment/GetSpreadsheetCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"fa-solid","fa-user-check","me-3"],[3,"soft-yellow","soft-green",4,"ngIf"],[1,"fa-solid","fa-check","me-3"],[1,"alert"],[1,"fa-solid","fa-circle-exclamation","me-3"],[1,"container-fluid","row","mt-5"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px","border-bottom","1px solid rgba(0, 0, 0, 0.125)","background-color","rgba(203, 203, 210, 0.15) !important"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body"],[1,"row","justify-content-between"],[1,"col-6",2,"font-size","14px"],[1,"col-3",2,"font-size","14px"],["class","col-3","style","font-size: 14px;",4,"ngIf"],["class","row justify-content-between my-5",4,"ngFor","ngForOf"],[1,"row","justify-content-between","fw-bold"],[1,"col-6"],[1,"col-3"],["class","col-3",3,"class",4,"ngIf"],[1,"row","justify-content-between","my-5"]],template:function(n,i){n&1&&_(0,Rl,8,9,"mainpanel-cmp",3),n&2&&p("ngIf",i.loaderData)},dependencies:[Ae,K,F,ut,lt,at,U,J,wt,We,Zr,Yr,Xr,Mt,Ht,_r,gr,fe],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 Ql=()=>["/menu/Products/Catalog/Products/Info"],Bl=r=>({ID:r});function Hl(r,e){if(r&1){let t=v();o(0,"button",13),g("click",function(){d(t);let i=c(2);return u(i.confirmAdjust())}),m(1,"Confirm Adjustment"),a()}}function Wl(r,e){if(r&1){let t=v();o(0,"div")(1,"div",14)(2,"h6"),m(3,"Outlets"),a(),o(4,"ng-select",15),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,i)||(s.pageData.Filter.EntityID=i),u(i)}),a()()()}if(r&2){let t=c(2);l(4),p("items",t.pageData.Entities),S("ngModel",t.pageData.Filter.EntityID)}}function ql(r,e){if(r&1){let t=v();o(0,"tr",16)(1,"td"),f(2,"a",17),a(),f(3,"td",18)(4,"td",18)(5,"td",18)(6,"td",19)(7,"td",19),o(8,"td",20)(9,"input",21),D("ngModelChange",function(i){let s=d(t).$implicit;return x(s.NewQuantity,i)||(s.NewQuantity=i),u(i)}),a()(),o(10,"td",20),m(11),I(12,"number"),a(),o(13,"td")(14,"a",22),g("click",function(){let i=d(t).$implicit,s=c(2);return u(s.confirmAdjust(i))}),m(15,"Adjust"),a()()()}if(r&2){let t=e.$implicit;l(2),p("routerLink",X(12,Ql))("queryParams",A(13,Bl,t.ProductID))("innerHTML",t.ProductName,L),l(),p("innerHTML",t.ParentCode,L),l(),p("innerHTML",t.Model,L),l(),p("innerHTML",t.ParentModel,L),l(),p("innerHTML",t.Ratio,L),l(),p("innerHTML",t.Inventory,L),l(2),S("ngModel",t.NewQuantity),l(2),M(" ",O(12,10,t.Inventory-t.NewQuantity*t.Ratio)," ")}}function Gl(r,e){if(r&1){let t=v();o(0,"mainpanel-cmp",2),g("onSubmit",function(){d(t);let i=c();return u(i.searchFromPageOne())}),D("filterChange",function(i){d(t);let s=c();return x(s.pageData.Filter,i)||(s.pageData.Filter=i),u(i)}),o(1,"actions"),_(2,Hl,2,0,"button",3),a(),o(3,"filters"),_(4,Wl,5,2,"ng-template",null,0,$),a(),o(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th"),m(13,"Product Name"),a(),o(14,"th",8),m(15,"Code"),a(),o(16,"th",8),m(17,"From"),a(),o(18,"th",8),m(19,"To"),a(),o(20,"th",9),m(21,"Ratio"),a(),o(22,"th",9),m(23,"Inventory"),a(),o(24,"th",10),m(25,"Convert Qty "),a(),o(26,"th",10),m(27,"Remaining"),a(),f(28,"th",11),a()(),o(29,"tbody"),_(30,ql,16,15,"tr",12),a()()()()()()}if(r&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.roleService.adjustment.Create),l(28),p("ngForOf",t.Items)}}var ai=class r extends Ft{constructor(t,n,i,s,y){super(t,n,"Adjustment/GetAdjustToParentList","Outlet/GetByUserAccessWrite");this.toastr=i;this.router=s;this.roleService=y}Items;preGetList(){w.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=this.pageData.Entities[0].ID)}postInit(t){this.Items=t,this.Items.forEach(n=>n.NewQuantity=Math.floor(n.Inventory/n.Ratio))}confirmAdjust(t){let n=[],i=[];if(t?i.push(t):i=this.Items,i.forEach(y=>{let E={VariantID:y.ParentID,Quantity:y.NewQuantity,Cost:y.UnitCost*y.Ratio,Price:y.UnitPrice*y.Ratio};n.push(E),E={VariantID:y.ID,Quantity:y.NewQuantity*y.Ratio*-1,Cost:y.UnitCost,Price:y.UnitPrice},n.push(E)}),n.length<1)return alert("You must atleast have one item to adjust!"),!1;if(w.IsEmpty(this.pageData.Filter.EntityID))return alert("Outlet is require"),!1;let s={Order:{EntityID:this.pageData.Filter.EntityID},Items:n};this.httpService.post("/API/Adjustment/SubmitUseDefault",s).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,tt.Success)},error:y=>{this.toastr.error(y,tt.Error)}})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(_t),C(Nt),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-convert-inventory"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","125px"],[1,"text-end",2,"width","125px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-success",3,"click"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","appendTo","body",3,"ngModelChange","items","ngModel"],[1,"border-bottom"],[3,"routerLink","queryParams","innerHTML"],[3,"innerHTML"],[1,"text-end",3,"innerHTML"],[1,"text-end"],["type","text","autoNum","",1,"text-end",3,"ngModelChange","ngModel"],[3,"click"]],template:function(n,i){n&1&&_(0,Gl,31,6,"mainpanel-cmp",1),n&2&&p("ngIf",i.data)},dependencies:[K,F,ut,lt,at,U,J,wt,Mt,nt]})};function zl(r,e){if(r&1){let t=v();o(0,"button",16),g("click",function(){d(t);let i=c();return u(i.openExportModal())}),f(1,"i",17),m(2," Export"),a()}}function $l(r,e){if(r&1){let t=v();o(0,"td",14)(1,"input",21),D("ngModelChange",function(i){d(t);let s=c().$implicit;return x(s.Quantity,i)||(s.Quantity=i),u(i)}),a()()}if(r&2){let t=c().$implicit;l(),S("ngModel",t.Quantity)}}function Kl(r,e){if(r&1&&(o(0,"td",14),m(1),a()),r&2){let t=c().$implicit;l(),M(" ",t.Quantity,"")}}function Jl(r,e){if(r&1){let t=v();o(0,"tr",18)(1,"td")(2,"i",19),g("click",function(){let i=d(t).index,s=c();return u(s.products.splice(i,1))}),a()(),o(3,"td"),m(4),a(),o(5,"td",14),m(6),a(),_(7,$l,2,1,"td",20)(8,Kl,2,1,"td",20),a()}if(r&2){let t=e.$implicit,n=c();l(4),b(t.Name),l(2),b(t.Code),l(),p("ngIf",n.roleService.adjustment.InventoryProductCount),l(),p("ngIf",!n.roleService.adjustment.InventoryProductCount)}}var si=class r extends _e{constructor(t,n,i,s,y){super(t);this.httpService=n;this.csvConverter=i;this.roleService=s;this.matDialog=y;this.products=[],this.menuData$.subscribe()}productCode;products;onBarcodeEnter(t){let n=this.products.findIndex(i=>i.Code===t);n!=-1?this.products[n].Quantity++:this.httpService.post("/API/catalog/product/ProductCountByCode",{code:t}).subscribe(i=>{i.Quantity=1,this.products.push(i)}),this.productCode=null}openExportModal(){var t={Products:this.products,Export:!0};this.matDialog.open(Wt,{data:{title:"Count Product Inventory",exportTypes:[{ID:"ProductExport/ProductCountInventory",Value:"Default",FileName:"Count Product Inventory"}],filterExport:t,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(Ut),C(R),C(ft))};static \u0275cmp=P({type:r,selectors:[["POS-count-product-inventory"]],features:[dt],decls:27,vars:6,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"cashier"],[1,"cart","big-cart","scan-cart"],[1,"barcode","barcode_counter","text-end"],[1,"me-5"],["aria-hidden","true",1,"fa-solid","fa-barcode","fa-2x","icon"],["type","text","placeholder","Scan Barcode Here","autofocus","",2,"width","200px",3,"keyup.enter","ngModelChange","ngModel"],[1,"content"],[1,"table"],["id","tableGrid",1,"cart","table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],["width","15px"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"border-bottom"],[1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],["class","text-end",4,"ngIf"],["type","text","autoNum","",1,"text-end",3,"ngModelChange","ngModel"]],template:function(n,i){n&1&&(o(0,"mainpanel-cmp",0)(1,"actions"),_(2,zl,3,0,"button",1),a(),o(3,"content")(4,"div",2)(5,"section",3)(6,"main")(7,"section",4)(8,"div",5)(9,"span",6),m(10,"Barcode"),a(),f(11,"i",7),o(12,"input",8),g("keyup.enter",function(){return i.onBarcodeEnter(i.productCode)}),D("ngModelChange",function(y){return x(i.productCode,y)||(i.productCode=y),y}),a()(),o(13,"div",9)(14,"div",10)(15,"table",11)(16,"thead",12)(17,"tr"),f(18,"th",13),o(19,"th"),m(20,"Name"),a(),o(21,"th",14),m(22,"Code"),a(),o(23,"th",14),m(24,"Qty"),a()()(),o(25,"tbody"),_(26,Jl,9,4,"tr",15),a()()()()()()()()()()),n&2&&(p("pageData",i.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),p("ngIf",i.roleService.global.Export),l(10),S("ngModel",i.productCode),l(14),p("ngForOf",i.products))},dependencies:[K,F,lt,at,U,J,Mt],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 Yl(r,e){if(r&1){let t=v();o(0,"button",15),g("click",function(){d(t);let i=c(2);return u(i.openExportModal())}),f(1,"i",16),m(2," Export"),a()}}function Zl(r,e){if(r&1){let t=v();o(0,"div")(1,"div",17)(2,"h6"),m(3,"Outlets"),a(),o(4,"ng-select",18),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,i)||(s.pageData.Filter.EntityID=i),u(i)}),a(),o(5,"h6"),m(6,"Category"),a(),o(7,"POS-product-category-select",19),D("selectedCategoryIDChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.CategoryID,i)||(s.pageData.Filter.CategoryID=i),u(i)}),a(),o(8,"h6"),m(9,"Sort By"),a(),o(10,"ng-select",20),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.SortByid,i)||(s.pageData.Filter.SortByid=i),u(i)}),a()()()}if(r&2){let t=c(2);l(4),p("items",t.pageData.Options.Entities),S("ngModel",t.pageData.Filter.EntityID),l(3),S("selectedCategoryID",t.pageData.Filter.CategoryID),p("showClear",!0),l(3),p("items",t.pageData.Options.SortBy),S("ngModel",t.pageData.Filter.SortByid)}}function Xl(r,e){if(r&1&&(o(0,"span"),m(1),a()),r&2){let t=e.$implicit;l(),b(t+" ")}}function tm(r,e){if(r&1&&(o(0,"tr")(1,"td"),m(2),a(),o(3,"td"),m(4),a(),o(5,"td",14),m(6),I(7,"number"),a(),o(8,"td",14),m(9),I(10,"number"),a(),o(11,"td",21),_(12,Xl,2,1,"span",11),a()()),r&2){let t=e.$implicit;l(2),b(t.ProductCode),l(2),b(t.ProductName),l(2),b(O(7,5,t.UnitPrice)),l(3),b(O(10,7,t.Qty)),l(3),p("ngForOf",t.Models)}}function em(r,e){if(r&1){let t=v();o(0,"mainpanel-cmp",2),g("onSubmit",function(){d(t);let i=c();return u(i.searchFromPageOne())}),D("filterChange",function(i){d(t);let s=c();return x(s.pageData.Filter,i)||(s.pageData.Filter=i),u(i)}),o(1,"actions"),_(2,Yl,3,0,"button",3),a(),o(3,"filters"),_(4,Zl,11,6,"ng-template",null,0,$),a(),o(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),m(12,"Code"),a(),o(13,"th",8),m(14,"Name"),a(),o(15,"th",9),m(16,"UnitPrice"),a(),o(17,"th",10),m(18,"Qty"),a(),o(19,"th"),m(20,"Available Models"),a()()(),o(21,"tbody"),_(22,tm,13,9,"tr",11),a(),o(23,"tfoot")(24,"tr",12),f(25,"td",13),o(26,"td",14),m(27),I(28,"sum"),I(29,"number"),a(),f(30,"td"),a()()()()()()}if(r&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.roleService.global.Export),l(20),p("ngForOf",t.data.Data),l(5),b(O(29,10,Q(28,7,t.data.Data,"Qty")))}}var li=class r extends Ft{constructor(t,n,i,s,y){super(t,n,"catalog/product/GetOutletProductSheet","catalog/ProductLoader/GetOutletProductSheet");this.csvConverter=i;this.roleService=s;this.matDialog=y}openExportModal(){this.matDialog.open(Wt,{data:{title:"Product Sheet",exportTypes:[{ID:"ProductExport/GetOutletProductSheet",Value:"Default",FileName:"Product Sheet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(n){return new(n||r)(C(it),C(j),C(Ut),C(R),C(ft))};static \u0275cmp=P({type:r,selectors:[["POS-product-sheet"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","70px"],[2,"width","260px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","100px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","3"],[1,"text-end"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","placeholder","Choose an outlet","bindLabel","Name","bindValue","ID",3,"ngModelChange","items","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[2,"word-spacing","20px"]],template:function(n,i){n&1&&_(0,em,31,12,"mainpanel-cmp",1),n&2&&p("ngIf",i.data)},dependencies:[K,F,lt,U,J,wt,kn,nt,fe]})};var Do=Ei(Tr());var H=class r{INITIAL_STATE={loadForm:{},outlet:{ID:w.GuidEmpty,Name:""},isOpenDialog:!0,isComplete:!1,adjustmentState:0,quickeyItems:{},cartItems:[],order:{Date:(0,Do.default)().utcOffset("+07:00").format(),EntityID:"",ID:w.GuidEmpty,StateID:4,TypeID:1,Number:"",PIC:"",Note:""},orderComplete:{},NewOrderID:""};#t=Kr(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=>Y(V({},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,n)=>t+n.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,n)=>t+n.Variant.UnitPrice*n.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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var Hi=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,n,i,s,y,E,mt,xt,St,Dt,At,Bt,vt,Jt,Yt,Zt,Xt,te,ee,ne,ie){this.ID=e,this.VariantID=t,this.Quantity=n,this.Cost=i,this.Price=s,this.Expense=y,this.Discount=E,this.DiscountAmount=mt,this.Note=xt,this.Taxable=St,this.LoyaltyPoint=Dt,this.EntityID=At,this.UnitQuantity=Bt,this.VariantUnitQuantity=vt,this.InventoryTypeID=Jt,this.Variant=Yt,this.SalesID=Zt,this.UnitCost=Xt,this.UnitPrice=te,this.SplitQuantity=ee,this.isMaxInventory=ne,this.PromotionGift=ie}},mi=class r{adapt(e){return new Hi(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})},Wi=class{constructor(e,t,n,i,s,y,E,mt,xt,St,Dt,At,Bt,vt,Jt,Yt,Zt,Xt,te,ee,ne,ie,Ze,Xe,tn,en,nn,rn,on,an,sn){this.ID=e,this.Name=t,this.Code=n,this.UnitCost=i,this.UnitPrice=s,this.UnitExpense=y,this.UnitQuantity=E,this.PriceDiscount=mt,this.UnitPriceOriginal=xt,this.Description=St,this.UOM=Dt,this.UOMName=At,this.ImageUrl=Bt,this.TypeID=vt,this.SellPriceType=Jt,this.OnHand=Yt,this.Ordered=Zt,this.OrderPrice=Xt,this.OrderPriceDiscount=te,this.Taxable=ee,this.LoyaltyPoint=ne,this.CategoryName=ie,this.CategoryID=Ze,this.CategoryTypeID=Xe,this.PriceNote=tn,this.PaymentTypeID=en,this.ThumbnailUrl=nn,this.Storage=rn,this.Component=on,this.PriceBook=an,this.VariantUnitQuantity=sn}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},pi=class r{adapt(e){return new Wi(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var ci=class r{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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})},di=class r{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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})},Po=class r{adapt(e){return{Number:e.Number,Quantity:e.Quantity,ExpiryDate:e.ExpiryDate}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var Tt=class r{destroy$=new ot;#t=h(H);#e=h(j);#n=h(mi);#i=h(pi);#r=h(Pt);#o=h(ci);#a=h(di);constructor(){}processOrder(){return st(this.#t.AdjustmentState,{injector:this.#r}).pipe(rt(this.destroy$),Z(e=>{let t=[...this.#t.CartItems()].map(n=>Y(V({},this.#o.adapt(n)),{EntityID:w.GuidEmpty,Note:n.Note??"",SalesID:n.SalesID??"",isMaxInventory:!1,PromotionGift:!1,SplitQuantity:0,UnitCost:n.Cost,Cost:n.Cost,Variant:Y(V({},this.#a.adapt(n.Variant)),{Taxable:!!n.Variant.Taxable})}));if(e===0){let n={Items:[...t],Order:{Date:this.#t.Order().Date,EntityID:this.#t.Outlet().ID,ID:w.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},NewOrderID:this.#t.NewOrderID()};return this.#e.post(pt.SubmitAdjustment,n).pipe(rt(this.destroy$))}if(e===1){let n=Y(V({},this.#t.LoadForm().Data),{Order:Y(V({},this.#t.LoadForm().Data.Order),{Note:this.#t.Order().Note,PIC:this.#t.Order().PIC,Number:this.#t.Order().Number||this.#t.LoadForm().Data.Order.Number,Date:this.#t.Order().Date||this.#t.LoadForm().Data.Order.Date}),Items:[...t]});return this.#e.post(pt.SubmitAdjustment,n).pipe(rt(this.destroy$))}return Me}),Oe(e=>bn(()=>new Error(e))))}onUpdateOrderState(e,t){if(Object.keys(this.#t.Order()).includes(e)){let i=Y(V({},this.#t.Order()),{[e]:t});this.#t.onChangeAdjustmentOrder(i)}else console.error(`Error updating order state with key ${e}`)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var Je=class r{destroy$=new ot;#t=h(j);#e=h(H);#n=h(Pt);orderService=h(Tt);getLoadForm$=this.#t.post("/API/Adjustment/LoadForm",{EntityID:w.GuidEmpty,ID:w.GuidEmpty}).pipe(Mn(),N(e=>{this.#e.onChangeLoadform(e)}));constructor(){}httpRequestLoadForm$(e){return st(this.#e.IsComplete,{injector:this.#n}).pipe(rt(this.destroy$),W(t=>!t),Z(t=>this.#t.post("/API/Adjustment/LoadForm",V({EntityID:"00000000-0000-0000-0000-000000000000",ID:"00000000-0000-0000-0000-000000000000"},e))),N(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var ui=class r{destroy$=new ot;#t=h(H);#e=h(j);#n=h(Tt);#i=h(Pt);constructor(){this.initialize()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initialize(){xe([st(this.#t.Outlet,{injector:this.#i}),st(this.#t.AdjustmentState,{injector:this.#i}),st(this.#t.IsComplete,{injector:this.#i})]).pipe(Mn(),W(([e,t,n])=>w.IsNotEmpty(e.ID)&&!n),Z(([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 Me}}handleStateZero(e){return this.#e.get(`/api/AdjustmentLoader/LoadRegister?EntityID=${e.ID}&IsEdit=false`).pipe(rt(this.destroy$),N(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(rt(this.destroy$),N(t=>{this.#t.onChangeQuickeyItems(t)}))}getQuickey(e){return this.#e.get(pt.GetQuickKeyByEntityID,[{key:"ID",value:e}])}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var qi=class{get Variant(){return this._Variant}set Variant(e){this._Variant=e}get QtyRequested(){return this._QtyRequested}set QtyRequested(e){this._QtyRequested=e}get TotalPrice(){return this._TotalPrice}set TotalPrice(e){this._TotalPrice=e}get SalesName(){return this._SalesName}set SalesName(e){this._SalesName=e}get PriceNote(){return this._PriceNote}set PriceNote(e){this._PriceNote=e}get SalesID(){return this._SalesID}set SalesID(e){this._SalesID=e}get InventoryTypeID(){return this._InventoryTypeID}set InventoryTypeID(e){this._InventoryTypeID=e}get ID(){return this._ID}set ID(e){this._ID=e}get Code(){return this._Code}set Code(e){this._Code=e}get VariantID(){return this._VariantID}set VariantID(e){this._VariantID=e}get Quantity(){return this._Quantity}set Quantity(e){this._Quantity=e}get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(e){this._UnitQuantity=e}get Expense(){return this._Expense}set Expense(e){this._Expense=e}get Cost(){return this._Cost}set Cost(e){this._Cost=e}get Price(){return this._Price}set Price(e){this._Price=e}get Discount(){return this._Discount}set Discount(e){this._Discount=e}get Note(){return this._Note}set Note(e){this._Note=e}get Taxable(){return this._Taxable}set Taxable(e){this._Taxable=e}get LoyaltyPoint(){return this._LoyaltyPoint}set LoyaltyPoint(e){this._LoyaltyPoint=e}get UnitPriceOriginal(){return this._UnitPriceOriginal}set UnitPriceOriginal(e){this._UnitPriceOriginal=e}get DiscountAmount(){return this._DiscountAmount}set DiscountAmount(e){this._DiscountAmount=e}get Name(){return this._Name}set Name(e){this._Name=e}get PriceTypeID(){return this._PriceTypeID}set PriceTypeID(e){this._PriceTypeID=e}get Storage(){return this._Storage}set Storage(e){this._Storage=e}get Serial(){return this._Serial}set Serial(e){this._Serial=e}get ThumbnailUrl(){return this._ThumbnailUrl}set ThumbnailUrl(e){this._ThumbnailUrl=e}get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}get TypeID(){return this._TypeID}set TypeID(e){this._TypeID=e}get VariantUnitQuantity(){return this._VariantUnitQuantity}set VariantUnitQuantity(e){this._VariantUnitQuantity=e}get UOM(){return this._UOM}set UOM(e){this._UOM=e}get UOMName(){return this._UOMName}set UOMName(e){this._UOMName=e}_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;constructor(e,t,n,i,s,y,E,mt,xt,St,Dt,At,Bt,vt,Jt,Yt,Zt,Xt,te,ee,ne,ie,Ze,Xe,tn,en,nn,rn,on,an,sn){this._Variant=e,this._QtyRequested=t,this._TotalPrice=n,this._SalesName=i,this._PriceNote=s,this._SalesID=y,this._InventoryTypeID=E,this._ID=mt,this._Code=xt,this._VariantID=St,this._Quantity=Dt,this._UnitQuantity=At,this._Expense=Bt,this._Cost=vt,this._Price=Jt,this._Discount=Yt,this._Note=Zt,this._Taxable=Xt,this._LoyaltyPoint=te,this._UnitPriceOriginal=ee,this._DiscountAmount=ne,this._Name=ie,this._PriceTypeID=Ze,this._Storage=Xe,this._Serial=tn,this._ThumbnailUrl=en,this._UnitPrice=nn,this._TypeID=rn,this._VariantUnitQuantity=on,this._UOM=an,this._UOMName=sn}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}}},Gi=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,n,i,s,y,E,mt,xt,St,Dt,At,Bt,vt,Jt,Yt,Zt,Xt,te,ee,ne,ie,Ze,Xe,tn,en,nn,rn,on,an,sn,ko,Ao,No,Vo,Fo,Uo,Lo,Ro,Qo,Bo,Ho,Wo,qo,Go,zo,$o,Ko,Jo,Yo,Zo,Xo,ta,ea,na){this._OnHand=e,this._CategoryName=t,this._CategoryTypeID=n,this._PriceTypeID=i,this._PriceNote=s,this._UnitPriceOriginal=y,this._Ordered=E,this._BrandName=mt,this._ImageUrl=xt,this._ThumbnailUrl=St,this._Component=Dt,this._PriceBook=At,this._UOMName=Bt,this._Storage=vt,this._CategoryID=Jt,this._DiscountAmount=Yt,this._VariantUnitQuantity=Zt,this._ProductCreated=Xt,this._ProductID=te,this._ProductIndex=ee,this._Code=ne,this._TypeID=ie,this._UnitQuantity=Ze,this._SalesCommission=Xe,this._Description=tn,this._Image=en,this._Discontinued=nn,this._Taxable=rn,this._LoyaltyPoint=on,this._PackSize=an,this._CreatorId=sn,this._Created=ko,this._UnitExpense=Ao,this._SellPriceType=No,this._VariantType=Vo,this._CostCurrencyID=Fo,this._UnitCost=Uo,this._OrderPrice=Lo,this._OrderPriceDiscount=Ro,this._OrderPriceDiscountDetail=Qo,this._PriceCurrencyID=Bo,this._UnitPrice=Ho,this._PriceDiscount=Wo,this._PaymentTypeID=qo,this._PaymentTypeString=Go,this._SellPriceTypeString=zo,this._Weight=$o,this._CostCurrencySymbol=Ko,this._PriceCurrencySymbol=Jo,this._UOM=Yo,this._MeasurementID=Zo,this._UOMQ=Xo,this._Name=ta,this._Model=ea,this._ID=na}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}}},Kt=class r{adapt(e){return new qi(e.Variant??null,e.QtyRequested??null,e.TotalPrice??null,e.SalesName??null,e.PriceNote??null,e.SalesID??null,e.InventoryTypeID??null,e.ID??null,e.Code??null,e.VariantID??null,e.Quantity??null,e.UnitQuantity??null,e.Expense??null,e.Cost??null,e.Price??null,e.Discount??null,e.Note??null,e.Taxable??null,e.LoyaltyPoint??null,e.UnitPriceOriginal??null,e.DiscountAmount??null,e.Name??null,e.PriceTypeID??null,e.Storage??null,e.Serial??null,e.ThumbnailUrl??null,e.UnitPrice??null,e.TypeID??null,e.VariantUnitQuantity??null,e.UOM??null,e.UOMName??null).toJSON()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})},Ye=class r{adapt(e){return new Gi(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var _i=class r{modalConfig;storeService=h(H);#t=h(Re);#e=h(gt);form;constructor(){this.modalConfig=new ht,this.modalConfig.customWidth="400px",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]})}onOK(){let e=this.form.value;this.#e.close(e)}onCancel(){this.#e.close()}ngOnInit(){this.generateForm()}handleKeyDown(e){console.log("event",e),e.code==="F2"&&this.onOK()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["POS-modal-cart-note"]],hostBindings:function(t,n){t&1&&g("keydown",function(s){return n.handleKeyDown(s)},!1,Vt)},standalone:!0,features:[z],decls:11,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100",3,"formGroup"],[1,"w-100"],[1,"mb-3"],["type","text","formControlName","PIC",1,"form-control","w-100","height-input"],[1,"w-100","mt-4"],["formControlName","Note","rows","4",1,"form-control","w-100","ps-2"]],template:function(t,n){t&1&&(o(0,"modal-material",0),g("onOk",function(){return n.onOK()})("onCancel",function(){return n.onCancel()})("onClose",function(){return n.onCancel()}),o(1,"content")(2,"div",1)(3,"div",2)(4,"strong",3),m(5,"PIC"),a(),f(6,"input",4),a(),o(7,"div",5)(8,"strong",3),m(9,"Note"),a(),f(10,"textarea",6),a()()()()),t&2&&(p("config",n.modalConfig),l(2),p("formGroup",n.form))},dependencies:[jt,Ct,de,at,U,Ve,ue,Ue,Le]})};var gi=class r{modalConfig;#t=h(gt);constructor(){this.modalConfig=new ht,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||r)};static \u0275cmp=P({type:r,selectors:[["POS-modal-cart-void"]],standalone:!0,features:[z],decls:5,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"fw-normal"]],template:function(t,n){t&1&&(o(0,"modal-material",0),g("onOk",function(){return n.onOK()})("onCancel",function(){return n.onCancel()})("onClose",function(){return n.onCancel()}),o(1,"content")(2,"div",1)(3,"h4",2),m(4,"This will erase all current data. Are you sure?"),a()()()()),t&2&&p("config",n.modalConfig)},dependencies:[jt,Ct]})};var Et=class r{variantSearchCTRL=new Fe({});#t=h(H);#e=h(j);#n=h(Pt);#i=h(Kt);#r=h(ft);#o=h(Ye);destroy$=new ot;#a=this.variantSearchCTRL.valueChanges.pipe(rt(this.destroy$),W(e=>w.IsNotEmpty(e)),Z(e=>e.type==="ID"?this.httpGetVariantByID(e.str):this.httpRequestVariantByCode(e.str)));constructor(){}httpGetVariantByID(e){let t={entityID:this.#t.Outlet().ID,id:e};return this.#e.post("/API/catalog/variant/GetVariantByID",t).pipe(bt(n=>this.generateCartItem(n)))}httpRequestVariantByCode(e){return this.#e.get(`${pt.GetVariantByCode}?Code=${e}&EntityID=${this.#t.Outlet().ID}`).pipe(bt(t=>this.generateCartItem(t)))}httpRequestGetInventoryByVariantID(e){return st(this.#t.Outlet,{injector:this.#n}).pipe(rt(this.destroy$),W(t=>w.IsNotEmpty(t.ID)),Te(),Z(t=>this.#e.get(pt.GetVariantStockByID,[{key:"EntityID",value:t.ID},{key:"ID",value:e}])))}addItemByVariantID(e){this.httpGetVariantByID(e).pipe(rt(this.destroy$),N(t=>this.onAddCartItem(t))).subscribe()}onAddCartItem(e,t=!1){let n=this.#t.CartItems(),i=n.findIndex(y=>y.VariantID===e.VariantID),s=[];i!==-1?t?s=[...n,e]:(n[i].Quantity+=1,s=[...n]):s=[...n,e],this.#t.onChangeCartItems(s)}generateCartItem(e){return this.#i.adapt(Y(V({},e),{ID:w.GuidEmpty,Cost:e.UnitCost,Expense:e.UnitCost,SplitQuantity:0,UnitCost:e.UnitCost,InventoryTypeID:4,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:w.GuidEmpty,VariantUnitQuantity:e.VariantUnitQuantity,Storage:e.Storage,UOM:e.UOM,UOMName:e.UOMName,VariantID:e.ID,Variant:this.#o.adapt(e)}))}onRemoveCartItem(e){let t=this.#t.CartItems().filter((n,i)=>e!==i);this.#t.onChangeCartItems(t)}onOpenCartNoteModal(){return this.#r.open(_i)}onOpenCartVoidModal(){return this.#r.open(gi)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var nm=(r,e)=>e.key,im=r=>({selected:r}),rm=()=>["/menu/Products/Catalog/Variants/Info"];function om(r,e){if(r&1){let t=v();o(0,"a",8),g("click",function(){d(t);let i=c().$implicit,s=c();return u(s.onTabChange(i.key))}),m(1),a()}if(r&2){let t=c().$implicit,n=c();p("ngClass",A(2,im,n.activeTab().key===t.key)),l(),M(" ",t.label," ")}}function am(r,e){if(r&1&&_(0,om,2,4,"a",7),r&2){let t=e.$implicit;re(t.isVisible?0:-1)}}function sm(r,e){r&1&&(o(0,"div",12)(1,"h5"),m(2,"Cost"),a(),f(3,"input",18),a())}function lm(r,e){if(r&1){let t=v();o(0,"div",5)(1,"div",9)(2,"div",10)(3,"h5"),m(4,"Qty"),a(),f(5,"input",11,0),a(),o(7,"div",12)(8,"h5"),m(9,"Price"),a(),f(10,"input",13),a(),_(11,sm,4,0,"div",14),a(),q(12),o(13,"div",9)(14,"div",15)(15,"h5",16),m(16,"Note"),a(),o(17,"POS-tinymce-editor",17),g("valueChange",function(i){d(t);let s=c();return u(s.onNoteChange(i))}),a()()(),G(),a()}if(r&2){let t,n=c();p("formGroup",n.form),l(11),p("ngIf",n.roleService.product.Cost),l(6),p("value",(t=n.form.get("Note"))==null?null:t.value)}}function mm(r,e){if(r&1&&f(0,"img",30),r&2){let t=c(3);p("ngSrc",t.cartItem.ThumbnailUrl)}}function pm(r,e){r&1&&_(0,mm,1,1,"ng-template")}function cm(r,e){r&1&&(q(0),f(1,"i",31),o(2,"h6"),m(3,"No Image"),a(),G())}function dm(r,e){if(r&1&&(q(0),o(1,"div",19)(2,"div",20)(3,"a",21),_(4,pm,1,0)(5,cm,4,0,"ng-container"),a()(),o(6,"div",22)(7,"div",23),f(8,"i",24),o(9,"div",25),m(10," Inventory "),a()(),o(11,"table",26)(12,"tbody")(13,"tr")(14,"td",27),m(15," On Hand "),a(),o(16,"td",28),m(17),a()(),o(18,"tr")(19,"td",29),m(20,"Allocated"),a(),o(21,"td",28),m(22),a()(),o(23,"tr")(24,"td",29),m(25,"Available"),a(),o(26,"td",28),m(27),a()(),o(28,"tr")(29,"td",29),m(30,"ROP"),a(),o(31,"td",28),m(32),a()(),o(33,"tr")(34,"td",29),m(35,"Max"),a(),o(36,"td",28)(37,"span"),m(38),a()()()()()()(),G()),r&2){let t=c();l(3),p("routerLink",X(7,rm)),l(),re(t.cartItem.ThumbnailUrl?4:5),l(13),M(" ",t.inventory().ON_HAND," "),l(5),M(" ",t.inventory().ALLOCATED," "),l(5),M(" ",t.inventory().AVAILABLE," "),l(5),M(" ",t.inventory().ROP," "),l(6),b(t.inventory().MAX)}}function um(r,e){if(r&1){let t=v();o(0,"POS-tab-serial",32),D("variantChange",function(i){d(t);let s=c();return x(s.cartItem,i)||(s.cartItem=i),u(i)})("serialsChange",function(i){d(t);let s=c();return x(s.serials,i)||(s.serials=i),u(i)}),a()}if(r&2){let t=c();p("isEditBuyForm",!1)("outletID",t.storeService.Outlet().ID),S("variant",t.cartItem)("serials",t.serials)}}var fi=class r{constructor(e){this.data=e;this.cartItem=JSON.parse(JSON.stringify(this.storeService.CartItems()[this.data.index])),this.modalConfig.title=this.cartItem.Variant.Name,this.modalConfig.customWidth="650px",this.modalConfig.bodyScrollable=!0}storeService=h(H);roleService=h(R);modalConfig=new ht;cartItem;form;tabs=ct([]);activeTab=xn(()=>this.tabs().filter(e=>e.isActive)[0]);isItemSerial=ct(!1);inventory=ct({ON_HAND:0,ALLOCATED:0,AVAILABLE:0,ROP:0,MAX:0});serials=[];#t=h(Re);#e=h(gt);#n=h(Kt);#i=h(Et);#r=h(Pt);#o=h(_t);itemQuantity=ct(1);itemPrice=ct("");itemCost=ct("");itemNote=ct("");onTabChange(e){let t=this.tabs().map(n=>n.key===e?Y(V({},n),{isActive:!0}):Y(V({},n),{isActive:!1}));this.tabs.set(t)}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(){st(this.storeService.CartItems,{injector:this.#r}).pipe(N(e=>{this.cartItem=e[this.data.index]})).subscribe(),this.generateForm(),this.isItemSerial.set(this.checkIsSerial()),this.tabs.set([{key:0,value:"cart",label:"Cart",isActive:!0,isVisible:!0},{key:1,value:"product",label:"Product",isActive:!1,isVisible:this.roleService.inventory.View&&this.cartItem.Variant.Name.length>0},{key:2,value:"serial",label:"Serial",isActive:!1,isVisible:!0}]),this.requestUnitInStock().subscribe({next:e=>this.inventory.set(Y(V({},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)}))}),this.form.valueChanges.pipe(N(e=>{let t=this.storeService.CartItems().reduce((n,i,s)=>(this.data.index===s?n.push(V({},this.#n.adapt(Y(V({},i),{Quantity:+e.Quantity,Price:+e.Price,Cost:+e.Cost,Note:e.Note})))):n.push(i),n),[]);this.storeService.onChangeCartItems(t)}),ve("edit")).subscribe()}onNoteChange(e){this.form.get("Note").setValue(e)}onOK(){if(this.checkIsSerial()){if(Array.isArray(this.cartItem.Serial)&&this.cartItem.Serial.length){let e=this.cartItem.Serial.reduce((t,n)=>t+n.Quantity,0);if(this.cartItem.Quantity!==e){this.#o.warning("Serial must be equal with the quantity",tt.Warning);return}}if(this.cartItem.Quantity<0){let e=this.storeService.CartItems().reduce((t,n,i)=>(this.data.index===i?t.push(V({},this.#n.adapt(Y(V({},n),{Quantity:+this.cartItem.Quantity,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):t.push(n),t),[]);this.storeService.onChangeCartItems(e)}if(this.cartItem.Quantity>0){let e=this.storeService.CartItems().reduce((t,n,i)=>(this.data.index===i?t.push(V({},this.#n.adapt(Y(V({},n),{Quantity:+this.cartItem.Quantity,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):t.push(n),t),[]);this.storeService.onChangeCartItems(e)}}else{let e=this.storeService.CartItems().reduce((t,n,i)=>(this.data.index===i?t.push(V({},this.#n.adapt(Y(V({},n),{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(n),t),[]);this.storeService.onChangeCartItems(e)}this.#e.close()}checkIsSerial(){return this.cartItem.Variant!==void 0?this.cartItem.Variant.TypeID===4:!1}requestUnitInStock(){if(w.IsEmpty(this.storeService.Outlet().ID)){this.#o.error("Please select outlet before proceding...",tt.Error);return}return st(this.activeTab,{injector:this.#r}).pipe(W(e=>e.key===1),Te(),Z(e=>this.#i.httpRequestGetInventoryByVariantID(this.cartItem.VariantID)))}onCancel(){this.#e.close()}static \u0275fac=function(t){return new(t||r)(C(ge))};static \u0275cmp=P({type:r,selectors:[["adjustment-modal-edit-product"]],standalone:!0,features:[z],decls:11,vars:2,consts:[["qty",""],[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"row","border-bottom"],[1,"container-fluid","mt-5"],[3,"formGroup"],[3,"isEditBuyForm","outletID","variant","serials"],[1,"btn","btn-link",3,"ngClass"],[1,"btn","btn-link",3,"click","ngClass"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["formControlName","Price","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],["class","col-auto ps-0",4,"ngIf"],[1,"col-12"],[1,"mb-5"],["height","220px",3,"valueChange","value"],["formControlName","Cost","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"row"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink"],[1,"col-sm-6"],[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","text-start",2,"width","100px"],[1,"text-end"],[1,"table-light","text-start"],["width","400","height","400",1,"border","rounded",3,"ngSrc"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[3,"variantChange","serialsChange","isEditBuyForm","outletID","variant","serials"]],template:function(t,n){if(t&1&&(o(0,"modal-material",1),g("onOk",function(){return n.onOK()})("onCancel",function(){return n.onCancel()})("onClose",function(){return n.onCancel()}),o(1,"content")(2,"div",2)(3,"div",3)(4,"div"),ln(5,am,1,1,null,null,nm),a()()(),o(7,"div",4),_(8,lm,18,3,"div",5)(9,dm,39,8,"ng-container")(10,um,1,4,"POS-tab-serial",6),a()()()),t&2){let i;p("config",n.modalConfig),l(5),mn(n.tabs()),l(3),re((i=n.activeTab().key)===0?8:i===1?9:i===2?10:-1)}},dependencies:[jt,Ct,Ne,Ae,F,ue,at,U,Ve,Ue,Le,ze,Ge,un,ut,or,$e,Qe,Mt],styles:[".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}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 _m(r,e){if(r&1){let t=v();o(0,"div",27)(1,"button",28),g("click",function(){d(t);let i=c().index,s=c(2);return u(s.onReturnVariant(i))}),m(2," Return "),a(),o(3,"button",28),g("click",function(){d(t);let i=c().index,s=c(2);return u(s.onPurchaseVariant(i))}),m(4," Purchase "),a()()}}function gm(r,e){if(r&1&&(o(0,"td",29),m(1),a()),r&2){let t=c().index;l(),M(" ",t+1,". ")}}function fm(r,e){if(r&1){let t=v();q(0),o(1,"div",30)(2,"img",31),g("error",function(i){d(t);let s=c(3);return u(s.onErrorImage(i))}),a()(),G()}if(r&2){let t=c().$implicit;l(2),p("src",t.Variant.ThumbnailUrl,se)("alt",t.Variant.Name)}}function hm(r,e){r&1&&(o(0,"div",32),f(1,"i",33),a())}function Cm(r,e){if(r&1&&(o(0,"span"),m(1),I(2,"number"),a()),r&2){let t=c().$implicit;l(),b(O(2,1,t.Quantity))}}function ym(r,e){r&1&&(o(0,"span",34),m(1," x "),a())}function vm(r,e){if(r&1&&(o(0,"span"),m(1),I(2,"number"),a()),r&2){let t=c().$implicit;l(),b(O(2,1,t.UnitQuantity))}}function bm(r,e){if(r&1&&(q(0),o(1,"small",35),m(2),a(),G()),r&2){let t=c().$implicit;l(2),b(t.Variant.UOM?t.Variant.UOMName:"")}}function Im(r,e){if(r&1&&(q(0),o(1,"div",36),m(2),I(3,"number"),a(),G()),r&2){let t=c().$implicit;l(2),M(" ",Q(3,1,t.Price,"1.0-4")," ")}}function xm(r,e){if(r&1){let t=v();q(0),o(1,"tr",7),g("click",function(){let i=d(t).index,s=c(2);return u(s.onOpenModalEditProduct(i))}),_(2,_m,5,0,"ng-template",null,1,$)(4,gm,2,1,"td",8),o(5,"td",9)(6,"div",10),_(7,fm,3,2,"ng-container",3)(8,hm,2,0,"ng-template",null,2,$),o(10,"div",11)(11,"div"),m(12),a(),o(13,"span",12),m(14),a(),o(15,"div"),f(16,"app-serial-note",13),a(),f(17,"small",14),a()()(),o(18,"td",15)(19,"div",16)(20,"div",17)(21,"span"),_(22,Cm,3,3,"span",18)(23,ym,2,0,"span",19)(24,vm,3,3,"span",18),a(),_(25,bm,3,1,"ng-container",18),a()()(),o(26,"td"),_(27,Im,4,4,"ng-container",18),a(),o(28,"td")(29,"div",20),m(30),I(31,"number"),a()(),o(32,"td",21)(33,"div",16)(34,"div",22),m(35),I(36,"number"),a()()(),o(37,"td",23)(38,"div",24)(39,"span",25),g("click",function(){let i=d(t).index,s=c(2);return u(s.removeCartItem(i))}),f(40,"i",26),a()()()(),G()}if(r&2){let t,n,i=e.$implicit,s=yt(3),y=yt(9),E=c(2);l(),p("cdkContextMenuTriggerFor",s),l(3),p("ngIf",(t=E.AppConfigJSON())==null?null:t.ModuleSell.Grid.RowNumberVisible),l(3),p("ngIf",i.Variant.ThumbnailUrl)("ngIfElse",y),l(5),b(i.Variant.Name),l(2),b(i.Variant.Code),l(2),p("serials",i.Serial),l(),p("innerHtml",i.Note,L),l(5),p("ngIf",i.Quantity!=1||i.UnitQuantity>1),l(),p("ngIf",i.UnitQuantity>1||i.UnitQuantity<-1),l(),p("ngIf",i.UnitQuantity>1||i.UnitQuantity<-1),l(),p("ngIf",i.Variant.UOM&&((n=E.AppConfigJSON())==null||n.ModuleSell==null?null:n.ModuleSell.Grid.UOMVisible)),l(2),p("ngIf",i.UnitPrice!==i.Total&&i.Quantity>1),l(3),M(" ",i.Discount?O(31,15,i.Discount*-1)+"%":""," "),l(5),M(" ",E.roleService.product!=null&&E.roleService.product.Price?O(36,17,+i.Quantity*+i.Variant.UnitPrice):" - "," ")}}function Sm(r,e){if(r&1){let t=v();q(0),o(1,"table",4)(2,"tbody",5),g("cdkDropListDropped",function(i){d(t);let s=c();return u(s.onDrop(i))}),_(3,xm,41,19,"ng-container",6),a()(),G()}if(r&2){let t=c();l(3),p("ngForOf",t.CartItems())}}function Dm(r,e){r&1&&(o(0,"div",37)(1,"div",38)(2,"div",39)(3,"div",40)(4,"div",41),f(5,"i",42),a(),o(6,"div",43)(7,"span"),m(8,"Empty Cart"),a(),f(9,"br"),o(10,"span"),m(11,"Add products to the cart"),a(),f(12,"br"),o(13,"span"),m(14,"or scan barcode"),a()()()()()())}var hi=class r{roleService=h(R);storeService=h(H);cartService=h(Et);matDialog=h(ft);renderer=h(er);#t=h(Kt);CartItems=this.storeService.CartItems;AppConfigJSON=this.storeService.AppConfigJSON;onDrop(e){}onOpenModalEditProduct(e){let t=this.matDialog.open(fi,{data:{index:e}})}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((n,i,s)=>(e===s?n.push(V({},this.#t.adapt(Y(V({},i),{Quantity:-Math.abs(i.Quantity),TotalPrice:-Math.abs(i.Quantity)*i.Price})))):n.push(i),n),[]);this.storeService.onChangeCartItems(t)}onPurchaseVariant(e){let t=this.storeService.CartItems().reduce((n,i,s)=>(e===s?n.push(V({},this.#t.adapt(Y(V({},i),{Quantity:Math.abs(i.Quantity),TotalPrice:Math.abs(i.Quantity)*i.Price})))):n.push(i),n),[]);this.storeService.onChangeCartItems(t)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart-display"]],standalone:!0,features:[z],decls:3,vars:2,consts:[["EMPTY_CART",""],["context_menu",""],["NO_IMAGE",""],[4,"ngIf","ngIfElse"],[1,"table","table-borderless"],["cdkDropList","",3,"cdkDropListDropped"],[4,"ngFor","ngForOf"],["cdkDrag","",1,"border-bottom",2,"padding-left","12px",3,"click","cdkContextMenuTriggerFor"],["style","width: 10px; padding-left: 12px",4,"ngIf"],[1,"pe-0",2,"width","50%","padding-left","12px"],[1,"d-flex","align-items-center"],[1,"d-block","ms-6",2,"line-height","18px"],[1,"fw-normal","fs-6","text-muted"],[3,"serials"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",3,"innerHtml"],[1,"px-0","text-end",2,"width","15%"],[1,"d-flex","align-items-center","justify-content-end"],[1,"d-flex","text-end","fw-normal","align-items-center",2,"line-height","20px"],[4,"ngIf"],["class","fs-6",4,"ngIf"],[1,"fw-normal","fs-5","text-danger"],["data-test","total",1,"pe-0"],[1,"fs-5"],[1,"mt-6","ps-0"],[1,"d-flex","justify-content-end","align-items-center"],["role","button","title","Delete Item",1,"fs-3","cursor-pointer",3,"click"],[1,"fa","fa-trash","text-danger","fs-4"],["cdkMenu","",1,"example-menu"],["cdkMenuItem","",1,"example-menu-item",3,"click"],[2,"width","10px","padding-left","12px"],[1,""],[1,"object-fit-contain",2,"height","55px","width","55px",3,"error","src","alt"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6"],["title","UOM",1,"ps-1","fs-5"],[1,"fs-5","text-end"],[1,"row","g-0","h-100"],[1,"col-12"],[1,"d-flex","justify-content-center","align-items-center","h-100"],[1,"row"],[1,"col-12","d-flex","justify-content-center"],[1,"fa-regular","fa-cart-arrow-up","text-secondary",2,"font-size","110px"],[1,"col-12","justify-content-center","text-center","mt-5","empty-cart-description","text-secondary","headings-font-family"]],template:function(t,n){if(t&1&&_(0,Sm,4,1,"ng-container",3)(1,Dm,15,0,"ng-template",null,0,$),t&2){let i=yt(2);p("ngIf",n.CartItems().length>0)("ngIfElse",i)}},dependencies:[F,wn,K,Pn,ye,nt,Gr,Wr,Hr,qr],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 Ci=class r{storeService=h(H);cartService=h(Et);orderService=h(Tt);loadFormService=h(Je);roleService=h(R);#t=h(Nt);onProcess=new et;onOpenModalNote=new et;onOpenModalVoid=new et;constructor(){}onProcessHandler(){this.onProcess.emit()}onOpenModalNoteHandler(){this.onOpenModalNote.emit(),this.cartService.onOpenCartNoteModal().afterClosed().subscribe({next:t=>{Object.keys(t).forEach(n=>{this.orderService.onUpdateOrderState(n,t[n])})}})}onOpenModalVoidHandler(){this.onOpenModalVoid.emit(),this.cartService.onOpenCartVoidModal().afterClosed().pipe(W(t=>t.type==="OK"),Z(()=>this.loadFormService.getLoadForm$),N(()=>{this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeCartItems([]),this.storeService.onChangeIsOpenDialog(!1),this.#t.navigate(["/menu/Adjustment/Adjustment/Archive/Form/V2"])})).subscribe()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart-action"]],outputs:{onProcess:"onProcess",onOpenModalNote:"onOpenModalNote",onOpenModalVoid:"onOpenModalVoid"},standalone:!0,features:[z],decls:13,vars:2,consts:[[1,"row","g-0","pb-6","px-5"],[1,"col-5","d-flex","justify-content-between","pe-5",2,"column-gap","12px"],["type","button",1,"btn","btn-gray","fs-3","py-6","headings-font-family",2,"flex-grow","1",3,"click"],[1,"fa-regular","fa-note-sticky","fa-xl"],["type","button",1,"btn","btn-gray","fs-3","px-0","py-6","headings-font-family","d-flex","gap-2","justify-content-center","align-items-center",2,"flex-grow","8",3,"click"],[1,"fa-solid","fa-rectangle-xmark"],[1,"col-7"],["type","button",1,"btn","btn-success","w-100","fs-3","px-0","py-6",2,"border-left","0.1px solid #fff",3,"click"],[1,"fs-6"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"div",1)(2,"button",2),g("click",function(){return n.onOpenModalNoteHandler()}),f(3,"i",3),a(),o(4,"button",4),g("click",function(){return n.onOpenModalVoidHandler()}),f(5,"i",5),o(6,"span"),m(7,"Void"),a()()(),o(8,"div",6)(9,"button",7),g("click",function(){return n.onProcessHandler()}),m(10," Process "),o(11,"small",8),m(12),a()()()()),t&2&&(l(12),le("(",n.storeService.CartItems().length," items, ",n.storeService.QtyCartItems()," Qty)"))},styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};var yi=class r{cartService=h(Et);query=new Fe({});#t=h(j);#e=h(H);spinnerService=h(_o);constructor(){}onBarcodeScan(e){console.log("barcode",e)}ngOnInit(){this.query.valueChanges.pipe(ve("query"),W(e=>e&&Object.keys(e).length>0),N(e=>{this.spinnerService.show()}),Z(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 Me;return t.pipe(Oe(n=>n.status>=400&&n.status<=451?(console.error("Variant not found:",n.message),vn(null)):bn(()=>n)))}),N(()=>this.spinnerService.hide())).subscribe({next:e=>{e&&this.cartService.onAddCartItem(e)},error:e=>{this.spinnerService.hide(),console.error("An error occurred:",e)}})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart-header"]],standalone:!0,features:[z],decls:4,vars:1,consts:[[1,"row"],[1,"col"],[1,""],[3,"onBarcodeScan","formControl"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"POS-variant-autocomplete",3),g("onBarcodeScan",function(s){return n.onBarcodeScan(s)}),a()()()()),t&2&&(l(3),p("formControl",n.query))},dependencies:[Fr,Qr,de,U,ue,Dn]})};var zi=class{constructor(e,t,n,i,s,y,E,mt,xt,St,Dt){this._StateID=e,this._StateLabel=t,this._Success=n,this._Message=i,this._InvoiceID=s,this._OrderID=y,this._InvoiceNumber=E,this._PrintMode=mt,this._DeliveryID=xt,this._PaymentStateID=St,this._PaymentStateLabel=Dt}_StateID;get StateID(){return this._StateID}set StateID(e){this._StateID=e}_StateLabel;get StateLabel(){return this._StateLabel}set StateLabel(e){this._StateLabel=e}_Success;get Success(){return this._Success}set Success(e){this._Success=e}_Message;get Message(){return this._Message}set Message(e){this._Message=e}_InvoiceID;get InvoiceID(){return this._InvoiceID}set InvoiceID(e){this._InvoiceID=e}_OrderID;get OrderID(){return this._OrderID}set OrderID(e){this._OrderID=e}_InvoiceNumber;get InvoiceNumber(){return this._InvoiceNumber}set InvoiceNumber(e){this._InvoiceNumber=e}_PrintMode;get PrintMode(){return this._PrintMode}set PrintMode(e){this._PrintMode=e}_DeliveryID;get DeliveryID(){return this._DeliveryID}set DeliveryID(e){this._DeliveryID=e}_PaymentStateID;get PaymentStateID(){return this._PaymentStateID}set PaymentStateID(e){this._PaymentStateID=e}_PaymentStateLabel;get PaymentStateLabel(){return this._PaymentStateLabel}set PaymentStateLabel(e){this._PaymentStateLabel=e}toJSON(){return{StateID:this.StateID,StateLabel:this.StateLabel,Success:this.Success,Message:this.Message,InvoiceID:this.InvoiceID,OrderID:this.OrderID,InvoiceNumber:this.InvoiceNumber,PrintMode:this.PrintMode,DeliveryID:this.DeliveryID,PaymentStateID:this.PaymentStateID,PaymentStateLabel:this.PaymentStateLabel}}},vi=class r{adapt(e){return new zi(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var bi=class r{constructor(e){this.dialogRef=e;this.config=new ht,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0}config;onClose(){this.dialogRef.close({role:"close"})}onCancel(){this.dialogRef.close({role:"cancel"})}submit(e){this.dialogRef.close({role:"ok",data:e})}static \u0275fac=function(t){return new(t||r)(C(gt))};static \u0275cmp=P({type:r,selectors:[["POS-modal-with-approval"]],standalone:!0,features:[z],decls:9,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid",2,"width","500px","display","flex","justify-content","space-around"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-file-pen"],[1,"btn","btn-outline-secondary","ms-5",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-user-magnifying-glass"]],template:function(t,n){t&1&&(o(0,"modal-material",0),g("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"div",2),g("click",function(){return n.submit(0)}),f(4,"i",3),m(5," Save as Draft "),a(),o(6,"div",4),g("click",function(){return n.submit(1)}),f(7,"i",5),m(8," Submit for Review "),a()()()()),t&2&&p("config",n.config)},dependencies:[jt,Ct]})};var Ii=class r{destroy$=new ot;#t=h(Tt);#e=h(H);#n=h(vi);toastr=h(_t);matDialog=h(ft);constructor(){}ngOnInit(){}onProcessOrder(){if(w.IsEmpty(this.#e.Outlet().ID)){this.toastr.error("Please select outlet before proceeding..",tt.Error);return}if(this.#e.CartItems().length==0){this.toastr.error("You must have at least one item.",tt.Error);return}if(w.IsEmpty(this.#e.Order().Number)){this.toastr.error("Number cannot be empty.",tt.Error);return}if(this.#e.Order().TypeID==2){let e=[...this.#e.CartItems()].map(n=>n.VariantID),t=new Set(e);if(e.length!=t.size){this.toastr.error("The cart should not have the same product/code in different rows. Please check again!",tt.Info);return}}switch(this.#e.AppConfigJSON().ModuleAdjustment.Basic.Workflow){case 1:this.#t.processOrder().pipe(rt(this.destroy$)).subscribe({next:e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))},error:e=>{console.log("error",e)}});break;case 2:this.#e.AdjustmentState()==0&&this.matDialog.open(bi).afterClosed().pipe(W(e=>e!=null&&e.role==="ok"),N(e=>{let t=e.data+1;this.#t.onUpdateOrderState("StateID",Number(t))}),Z(e=>this.#t.processOrder()),N(e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))})).subscribe(),this.#e.AdjustmentState()==1&&this.#t.processOrder().pipe(rt(this.destroy$)).subscribe({next:e=>{this.#e.onChangeIsComplete(),this.#e.onChangeOrderComplete(this.#n.adapt(e))},error:e=>{console.log("error",e)}});break}}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-cart"]],standalone:!0,features:[z],decls:9,vars:0,consts:[[1,"h-100","d-flex","flex-column"],[1,"pt-4"],[1,"row"],[1,"col"],[1,"",2,"overflow-y","auto","flex","1 1 0%","max-height","calc(100vh - 170px)"],[1,""],[3,"onProcess"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),f(4,"adjustment-cart-header"),a()()(),o(5,"div",4),f(6,"adjustment-cart-display"),a(),o(7,"div",5)(8,"adjustment-cart-action",6),g("onProcess",function(){return n.onProcessOrder()}),a()()())},dependencies:[hi,Ci,yi]})};var xi=class r{destroy$=new ot;#t=h(H);#e=h(j);#n=h(Pt);#i=h(Tt);constructor(){}httpGenerateNumber$(){let e=st(this.#t.Outlet,{injector:this.#n}),t=st(this.#t.IsComplete,{injector:this.#n});return xe([e,t]).pipe(rt(this.destroy$),W(([n,i])=>w.IsNotEmpty(n.ID)),Te(),Z(([n,i])=>this.#e.post("/API/Adjustment/GenerateNumber",{ID:n.ID}).pipe(bt(s=>s.Number))),N(n=>{this.#i.onUpdateOrderState("Number",n)}),In(1))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};function Pm(r,e){if(r&1&&(o(0,"div",25)(1,"div",26),m(2),a(),o(3,"div",26),m(4),a()()),r&2){let t=e.$implicit;l(2),b(t.Variant.Name),l(2),b(t.Quantity)}}var Si=class r{#t=h(it);#e=h(Sn);menu$;storeService=h(H);#n=h(Nt);#i=h(xi);#r=h(Tt);cartItems;constructor(){this.#t.setMenu$(),this.menu$=this.#t.menu$.pipe(bt(e=>Y(V({},e),{H:"Inventory Adjustment",T:e.T.replace("undefined","Inventory Adjustment")})),N(e=>this.#e.setTitle(e.T)))}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.#n.navigate(["menu/Adjustment/Adjustment/Archive/Form/V2"],{queryParams:{}}),this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeIsComplete(),this.storeService.onChangeCartItems([])})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-order-complete"]],hostBindings:function(t,n){t&1&&g("keydown.F8",function(){return n.handleF8()},!1,Vt)},inputs:{cartItems:"cartItems"},standalone:!0,features:[z],decls:36,vars:11,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"order-complete"],[1,"container-fluid","pt-8"],[1,"row"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"fa-solid","fa-check","me-3"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"card-footer"],[1,"d-flex","justify-content-between","py-5"],["target","_blank",1,"btn","bg-light-gray","btn-secondary",3,"click"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],["target","_blank",1,"",2,"cursor","pointer",3,"href"],[1,"card-body"],["class","row justify-content-between mb-3",4,"ngFor","ngForOf"],[1,"row","justify-content-end","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col-4","text-end"],[1,"row","justify-content-between","mb-3"],[1,"col","text-end"]],template:function(t,n){t&1&&(o(0,"mainpanel-cmp",0),I(1,"async"),o(2,"content")(3,"section",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"h1",7),f(10,"i",8),m(11,"Inventory Adjustment Complete "),a()(),o(12,"div",9)(13,"div",10)(14,"div",11)(15,"a",12),g("click",function(){return n.onNewAdjustment()}),m(16," New Adjustment (F8)"),a()()()(),o(17,"div",13)(18,"div",14)(19,"a",15),g("click",function(){return n.onPrintReceipt()}),f(20,"i",16),m(21,"Print Receipt"),a()()()()(),o(22,"div",17)(23,"div",5)(24,"div",18)(25,"h3",19)(26,"a",20),m(27),a()()(),o(28,"div",21),_(29,Pm,5,2,"div",22),o(30,"div",23)(31,"div",24),m(32,"Total:"),a(),o(33,"div",24),m(34),I(35,"number"),a()()()()()()()()()()),t&2&&(p("pageData",O(1,7,n.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),l(26),p("href","/menu/Adjustment/Adjustment/Archive/Info?ID="+n.storeService.OrderComplete().OrderID,se),l(),M("Adjustment #",n.storeService.OrderComplete().InvoiceNumber,""),l(2),p("ngForOf",n.cartItems),l(5),M(" ",O(35,9,n.storeService.QtyCartItems())," "))},dependencies:[me,nt,He,lt,K,Tn],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} #full-container{padding-top:60px!important}"]})};function wm(r,e){if(r&1&&(o(0,"div",16)(1,"div",17)(2,"div"),m(3),a(),o(4,"small",18),m(5),a()()()),r&2){let t=e.data;l(3),b(t==null?null:t.Value),l(2),b(t==null?null:t.Code)}}var hn=class r{modalConfig=new ht;cartService=h(Et);cartItem=ct(null);query=new Fe(null);form;#t=h(gt);unsubscribe$=new ot;#e=h(Re);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)}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:[""]})}onSelected(e){}ngOnInit(){this.initForm(),this.query.valueChanges.pipe(rt(this.unsubscribe$),Z(e=>this.cartService.httpGetVariantByID(e).pipe()),ve("get cart item")).subscribe({next:e=>{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()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-modal-cart-add"]],standalone:!0,features:[z],decls:29,vars:7,consts:[["itemTemplate",""],["qty",""],[3,"onCancel","onClose","onOk","config"],[1,"container","w-100","h-100"],[1,"row"],[1,"col-12"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"optionSelected","keyup.enter","formControl","renderThumbnail","useCustomTemplate","itemTemplate"],[3,"formGroup"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["autoNum","","formControlName","Price","type","text",1,"mt-5","form-control",2,"width","100px"],["autoNum","","formControlName","Cost","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"mb-5"],["height","220px",3,"valueChange","value"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"]],template:function(t,n){if(t&1){let i=v();o(0,"modal-material",2),g("onCancel",function(){return d(i),u(n.onCancel())})("onClose",function(){return d(i),u(n.onCancel())})("onOk",function(){return d(i),u(n.onOK())}),o(1,"content")(2,"div",3)(3,"div",4)(4,"div",5)(5,"autocompleteV2",6),g("optionSelected",function(y){return d(i),u(n.onSelected(y))})("keyup.enter",function(y){return d(i),u(y.stopPropagation())}),a(),_(6,wm,6,2,"ng-template",null,0,$),a()(),o(8,"div",7)(9,"div",8)(10,"div",9)(11,"h5"),m(12,"Qty"),a(),f(13,"input",10,1),a(),o(15,"div",11)(16,"h5"),m(17,"Price"),a(),f(18,"input",12),a(),o(19,"div",11)(20,"h5"),m(21,"Cost"),a(),f(22,"input",13),a()(),q(23),o(24,"div",8)(25,"div",5)(26,"h5",14),m(27,"Note"),a(),o(28,"POS-tinymce-editor",15),g("valueChange",function(y){return d(i),u(n.onChangeNote(y))}),a()()(),G(),a()()()()}if(t&2){let i,s=yt(7);p("config",n.modalConfig),l(5),p("formControl",n.query)("renderThumbnail",!0)("useCustomTemplate",!0)("itemTemplate",s),l(3),p("formGroup",n.form),l(20),p("value",(i=n.form.get("Note"))==null?null:i.value)}},dependencies:[Qe,Mt,En,Be,jt,Ct,Or,at,U,Ve,ue,Dn,Ue,Le,ze,Ge]})};var wo=Ei(ia());function Mm(r,e){if(r&1){let t=v();o(0,"POS-uppy",2),g("onParser",function(i){d(t);let s=c();return u(s.onParser(i))})("fileUploaded",function(i){d(t);let s=c();return u(s.onUploadCsv(i))})("fileRemoved",function(){d(t);let i=c();return u(i.onRemovedFile())}),a()}if(r&2){let t=c();p("sampleUrl",t.sampleURL)}}var Di=class r{modalConfig;sampleURL;fileInput=ct(null);unsubscribe$=new ot;#t=h(gt);#e=h(j);#n=h(H);#i=h(Et);#r=h(Pt);cartItem=ct([]);skipEmptyLines=!0;rowCount=ct(0);rowEmpty=ct(0);totalRows=xn(()=>this.rowCount()-this.rowEmpty());file=ct(null);constructor(){this.modalConfig=new ht,this.modalConfig.title="Import Items",this.modalConfig.customWidth="500px",this.sampleURL="https://cdn.dealpos.xyz/web-import-template/ImportItem_Adjustment_TemplateV2.csv"}onOK(){st(this.cartItem,{injector:this.#r}).pipe(Z(e=>{let t={EntityID:this.#n.Outlet().ID,CartItems:e};return this.#e.post("/API/Adjustment/UploadCsvV2",t).pipe(ve("response")).pipe(Oe(n=>[]))}),N(e=>{Array.isArray(e)&&e.length>0&&e.forEach(t=>this.#i.onAddCartItem(t,!0))})).subscribe(),this.#t.close()}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),wo.default.parse(t,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:n=>{let i=n.split(/\r?\n/).slice(1);return i[i.length-1]===""&&i.pop(),this.rowCount.set(i.length),i.forEach(s=>{s.split(",").every(E=>E==="")&&this.rowEmpty.update(E=>E+=1)}),n},error(n,i){console.log("ERROR",n,i)},complete:(n,i)=>{console.log("COMPLETE",n),this.cartItem.set(n.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||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-modal-cart-upload"]],standalone:!0,features:[z],decls:3,vars:1,consts:[["modalContent",""],[3,"onOk","onCancel","onClose","config"],[3,"onParser","fileUploaded","fileRemoved","sampleUrl"]],template:function(t,n){if(t&1){let i=v();o(0,"modal-material",1),g("onOk",function(){return d(i),u(n.onOK())})("onCancel",function(){return d(i),u(n.onClose())})("onClose",function(){return d(i),u(n.onClose())}),_(1,Mm,1,1,"ng-template",null,0,$),a()}t&2&&p("config",n.modalConfig)},dependencies:[jt,Ct,ur]})};function Om(r,e){if(r&1){let t=v();o(0,"li",11),g("click",function(){let i=d(t).$implicit,s=c(3);return u(s.onClickMenu(i))}),f(1,"POS-dropdown-item-more-action",12),a()}if(r&2){let t=e.$implicit;l(),p("icon",t.icon)("label",t.title)}}function Tm(r,e){if(r&1&&ln(0,Om,2,2,"li",10,ki),r&2){let t=c().$implicit;mn(t.children)}}function Em(r,e){if(r&1&&(o(0,"div",7)(1,"div",8),m(2),a(),f(3,"div",9),_(4,Tm,2,0),a()),r&2){let t=e.$implicit;l(2),b(t.title),l(2),re(t.children.length>0?4:-1)}}var Pi=class r{menu=ct([]);#t=h(ft);router=h(Nt);handleF8(){this.#t.openDialogs&&this.#t.openDialogs.length>0||this.#t.open(hn)}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"}]},{title:"Advanced",icon:"",children:[{title:"Adjustment V1",icon:"fa-scanner-gun fas",value:"adjustment v1"}]}];this.menu.set(e)}onClickMenu(e){switch(e.value){case"add":this.#t.open(hn);break;case"upload":this.#t.open(Di);break;case"adjustment v1":this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Form"]);break}}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=P({type:r,selectors:[["adjustment-more-actions"]],hostBindings:function(t,n){t&1&&g("keydown.F4",function(s){return n.handleF8(s)},!1,Vt)},standalone:!0,features:[z],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","300px"],[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,n){t&1&&(o(0,"span",0)(1,"span",1),f(2,"i",2),a(),o(3,"span",3),m(4,"More Actions"),a()(),o(5,"div",4)(6,"div",5)(7,"div",6),ln(8,Em,5,2,"div",7,ki),a()()()),t&2&&(l(8),mn(n.menu()))},dependencies:[$r]})};var $i=class{constructor(e,t,n,i){this._Order=e,this._Items=t,this._OrderItems=n,this._CountedItems=i}_Order;get Order(){return this._Order}set Order(e){this._Order=e}_Items;get Items(){return this._Items}set Items(e){this._Items=e}_OrderItems;get OrderItems(){return this._OrderItems}set OrderItems(e){this._OrderItems=e}_CountedItems;get CountedItems(){return this._CountedItems}set CountedItems(e){this._CountedItems=e}},wi=class r{adapt(e){return new $i(e.Order,e.Items,e.OrderItems,e.CountedItems)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})},Ki=class{constructor(e,t,n,i,s,y,E,mt,xt,St,Dt,At,Bt,vt,Jt,Yt,Zt,Xt,te,ee,ne,ie){this._EntityID=e,this._Number=t,this._Date=n,this._PIC=i,this._Note=s,this._EntityName=y,this._StateID=E,this._StateLabel=mt,this._ReviewDate=xt,this._ReviewerID=St,this._TypeID=Dt,this._TypeLabel=At,this._Quantity=Bt,this._UnitPrice=vt,this._UnitCost=Jt,this._TotalPrice=Yt,this._AdjustedQuantity=Zt,this._CreatorID=Xt,this._Created=te,this._ModifierID=ee,this._Modified=ne,this._ID=ie}_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}},Mo=class r{adapt(e){return new Ki(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})},Ji=class{constructor(e,t,n,i,s,y,E,mt,xt,St,Dt,At){this._LostNFoundID=e,this._UnitCost=t,this._InventoryTypeID=n,this._UnitPrice=i,this._Discount=s,this._VariantID=y,this._Note=E,this._Quantity=mt,this._UnitQuantity=xt,this._Index=St,this._Serial=Dt,this._ID=At}_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}},Oo=class r{adapt(e){return new Ji(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})},Yi=class{constructor(e,t,n,i,s,y,E,mt,xt,St,Dt,At){this._ParentID=e,this._Start=t,this._Finish=n,this._UnitPrice=i,this._UnitCost=s,this._VariantID=y,this._Note=E,this._Quantity=mt,this._UnitQuantity=xt,this._Index=St,this._Serial=Dt,this._ID=At}_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}},To=class r{adapt(e){return new Yi(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||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};var Eo=Ei(Tr());function jm(r,e){if(r&1&&(q(0),f(1,"adjustment-order-complete",2),G()),r&2){let t=c();l(),p("cartItems",t.storeService.CartItems())}}function km(r,e){if(r&1){let t=v();o(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"POS-select-outlet-form",8),I(6,"async"),g("ngModelChange",function(i){d(t);let s=c();return u(s.storeService.onChangeOutlet(i))}),a(),o(7,"POS-invoice-number-form",9),I(8,"async"),g("ngModelChange",function(i){d(t);let s=c();return u(s.onInvoiceNumberChange(i))}),a()(),o(9,"POS-invoice-date",10),g("ngModelChange",function(i){d(t);let s=c();return u(s.onChangeOrderDate(i))}),a()()(),o(10,"div",11)(11,"div",12)(12,"div",13),f(13,"adjustment-more-actions"),a(),o(14,"div",14),f(15,"i",15),o(16,"ng-select",16),g("ngModelChange",function(i){d(t);let s=c();return u(s.onChangeAdjustmentType(i))}),a()()()()(),o(17,"div",17)(18,"div",18)(19,"POS-quick-key",19),g("onSelectVariant",function(i){d(t);let s=c();return u(s.onSelectVariant(i))}),a()(),o(20,"div",20),f(21,"adjustment-cart"),a()()()}if(r&2){let t=c();l(5),p("disabled",t.storeService.AdjustmentState()===1)("isOpenAfterLoad",O(6,16,t.isOpenDiaglog$))("outlets",t.storeService.Outlets())("ngModel",t.storeService.Outlet()),l(2),p("ngModel",t.storeService.Order().Number)("transactionType",O(8,18,t.transactionType$))("disabled",!(t.roleService.global!=null&&t.roleService.global.Number)),l(2),p("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),p("clearable",!1)("ngModel",t.storeService.Order().TypeID)("disabled",!!t.storeService.Order().TypeID&&t.storeService.AdjustmentState()===1)("items",t.storeService.AdjustmentTypes()),l(3),p("quickKey",t.storeService.QuickeyItems())("outletID",t.storeService.Outlet().ID)}}var Mi=class r{isOpenDialog=ct(!0);loadFormService=h(Je);intercom=h(lr);storeService=h(H);quickeyService=h(ui);cartService=h(Et);orderService=h(Tt);isOpenDiaglog$;Outlets$;loadForm$;adjustmentEditDataAdapter=h(wi);roleService=h(R);#t=h(Kt);#e=h(Ye);#n=h(ce);transactionType$=this.#n.queryParamMap.pipe(bt(e=>(e.has("ID"),"Adjustment")));title=h(Sn);injector=h(Pt);test=[];ngOnInit(){this.intercom.hideLauncher();let e=JSON.parse(localStorage.getItem("AccountInfo"));this.title.setTitle(e.BrandName+" POS | New Inventory Adjustment"),this.test=this.storeService.Outlets()&&this.storeService.Outlets().filter((t,n)=>n===0),this.#n.queryParamMap.pipe(Z(t=>{if(t.has("ID")){this.storeService.onChangeAdjustmentState(1);let n={EntityID:"00000000-0000-0000-0000-000000000000",ID:t.get("ID")};return this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeAdjustmentState(1),this.loadFormService.httpRequestLoadForm$(n).pipe(N(i=>{if(i.Data&&Object.keys(i.Data).length>0&&Object.keys(this.storeService.LoadForm().Data).length>0){this.orderService.onUpdateOrderState("Number",i.Data.Order.Number),this.orderService.onUpdateOrderState("Date",new Date(i.Data.Order.Date)),this.orderService.onUpdateOrderState("StateID",i.Data.Order.StateID),this.orderService.onUpdateOrderState("TypeID",i.Data.Order.TypeID),this.orderService.onUpdateOrderState("EntityID",i.Data.Order.EntityID);let s=i.Data.Items.map(y=>this.#t.adapt(Y(V({},y),{Variant:this.#e.adapt(y.Variant)})));if(this.storeService.onChangeCartItems(s),this.orderService.onUpdateOrderState("PIC",i.Data.Order.PIC),this.orderService.onUpdateOrderState("Note",i.Data.Order.Note),i.Entities.length>0){let y=i.Entities.findIndex(E=>E.ID===i.Data.Order.EntityID);y!==-1&&this.storeService.onChangeOutlet(i.Entities[y])}}}))}return this.storeService.onChangeAdjustmentState(0),this.loadFormService.httpRequestLoadForm$()})).subscribe({}),st(this.storeService.IsOpenDialog,{injector:this.injector}).pipe().subscribe(),st(this.storeService.AppConfigJSON,{injector:this.injector}).pipe(N(t=>this.orderService.onUpdateOrderState("StateID",t?.ModuleAdjustment.Advance.AdjustmentInputType))).subscribe(),this.isOpenDiaglog$=st(this.storeService.IsOpenDialog,{injector:this.injector})}onChangeAdjustmentType(e){let t=this.storeService.AdjustmentTypes().filter(n=>n.Key===e)[0];this.orderService.onUpdateOrderState("TypeID",t.Key)}onInvoiceNumberChange(e){this.orderService.onUpdateOrderState("Number",e)}onChangeOrderDate(e){this.orderService.onUpdateOrderState("Date",(0,Eo.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||r)};static \u0275cmp=P({type:r,selectors:[["POS-adjustment-v2"]],standalone:!0,features:[z],decls:3,vars:2,consts:[["ON_GOING",""],[4,"ngIf","ngIfElse"],[3,"cartItems"],[1,"container-fluid","overflow-x-hidden"],[1,"row","header","border-bottom"],[1,"col-5","border-end"],[1,"left-toolbar-container","h-100","d-flex","align-items-center","justify-content-between"],[1,"d-flex","flex-column"],[3,"ngModelChange","disabled","isOpenAfterLoad","outlets","ngModel"],[3,"ngModelChange","ngModel","transactionType","disabled"],[3,"ngModelChange","ngModel","disabled","tooltip"],[1,"col-7","d-flex","align-items-center"],[1,"row","flex-grow-1"],[1,"col-4","d-flex","align-items-center"],[1,"col","ps-0","d-flex","align-items-center","justify-content-end","gap-1"],[1,"fa-regular","fa-sliders"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",1,"",3,"ngModelChange","clearable","ngModel","disabled","items"],[1,"row","content"],[1,"col-5","border-end",2,"height","inherit"],[3,"onSelectVariant","quickKey","outletID"],[1,"col-7",2,"height","calc(100% - 0)","padding","0"]],template:function(t,n){if(t&1&&_(0,jm,2,1,"ng-container",1)(1,km,22,20,"ng-template",null,0,$),t&2){let i=yt(2);p("ngIf",n.storeService.IsComplete())("ngIfElse",i)}},dependencies:[He,F,me,jr,Rr,Br,Lr,de,U,J,On,wt,Ii,Si,Pi],styles:[".left-toolbar-container[_ngcontent-%COMP%]{position:relative}.left-toolbar-container[_ngcontent-%COMP%] POS-invoice-number-form[_ngcontent-%COMP%]{position:absolute;top:34px;left:28px}.header[_ngcontent-%COMP%]{min-height:60px}.content[_ngcontent-%COMP%]{height:calc(100vh - 60px);overflow:hidden}.supplier-more-menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.cart-display[_ngcontent-%COMP%]{flex-grow:1;height:0px;overflow-y:auto}input[_ngcontent-%COMP%]{width:100%;height:38px!important;border:0;border-bottom:1px solid #ced4da;padding-left:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i[_ngcontent-%COMP%]{font-size:16px;top:10.6px;left:13px}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]{transition:.4s}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(1){-webkit-transform:rotate(-45deg) translate(-8px,4px);transform:rotate(-45deg) translate(-8px,4px)}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(2){opacity:0}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(45deg) translate(-5px,0px);transform:rotate(45deg) translate(-5px)}.mobile-button[_ngcontent-%COMP%]{display:none}@media (max-width: 990px){.mobile-button[_ngcontent-%COMP%]{display:block}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.more-actions[_ngcontent-%COMP%] div.d-flex[_ngcontent-%COMP%]{width:30rem}[_nghost-%COMP%] .ng-select .ng-select-container{border:none}"]})};var Am=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Nm=r=>({ID:r});function Vm(r,e){if(r&1){let t=v();o(0,"button",11),g("click",function(){d(t);let i=c(2);return u(i.openExportModal())}),f(1,"i",12),m(2," Export "),a()}}function Fm(r,e){if(r&1){let t=v();o(0,"div")(1,"div",13)(2,"h6"),m(3,"Variant"),a(),o(4,"autocompleteV2",14),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.ID,i)||(s.pageData.Filter.ID=i),u(i)}),a(),o(5,"h6"),m(6,"Outlet"),a(),o(7,"ng-select",15),D("ngModelChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.EntityID,i)||(s.pageData.Filter.EntityID=i),u(i)}),a(),o(8,"h6"),m(9,"From"),a(),o(10,"datepicker",16),D("dateChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.From,i)||(s.pageData.Filter.From=i),u(i)}),a(),o(11,"h6"),m(12,"To"),a(),o(13,"datepicker",17),D("dateChange",function(i){d(t);let s=c(2);return x(s.pageData.Filter.To,i)||(s.pageData.Filter.To=i),u(i)}),a()()()}if(r&2){let t=c(2);l(4),S("ngModel",t.pageData.Filter.ID),p("inputTextValue",t.pageData.Filter.VariantName),l(3),p("items",t.pageData.Options.Entities),S("ngModel",t.pageData.Filter.EntityID),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.From),l(3),p("isFloatingLabel",!1),S("date",t.pageData.Filter.To)}}function Um(r,e){r&1&&(o(0,"th"),m(1,"Variant"),a())}function Lm(r,e){if(r&1&&(o(0,"td"),m(1),a()),r&2){let t=c().$implicit;l(),b(t.Name)}}function Rm(r,e){if(r&1&&(o(0,"tr",18),_(1,Lm,2,1,"td",8),I(2,"async"),o(3,"td"),m(4),a(),o(5,"td")(6,"a",19),m(7),a()(),o(8,"td"),m(9),I(10,"number"),a(),o(11,"td"),m(12),I(13,"date"),a()()),r&2){let t=e.$implicit,n=c(2);l(),p("ngIf",!O(2,7,n.isRedirect$)),l(3),b(t.EntityName),l(2),p("routerLink",X(14,Am))("queryParams",A(15,Nm,t.ID)),l(),b(t.Number),l(2),b(O(10,9,t.Quantity)),l(3),b(Q(13,11,t.Date,"dd/MM/yy"))}}function Qm(r,e){if(r&1){let t=v();o(0,"mainpanel-cmp",2),D("textChange",function(i){d(t);let s=c();return x(s.pageData.Filter.Number,i)||(s.pageData.Filter.Number=i),u(i)}),g("onSubmit",function(){d(t);let i=c();return u(i.searchFromPageOne())}),D("filterChange",function(i){d(t);let s=c();return x(s.pageData.Filter,i)||(s.pageData.Filter=i),u(i)}),o(1,"actions"),_(2,Vm,3,0,"button",3),a(),o(3,"filters"),_(4,Fm,14,8,"ng-template",null,0,$),a(),o(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr"),_(12,Um,2,0,"th",8),I(13,"async"),o(14,"th"),m(15,"Outlet"),a(),o(16,"th"),m(17,"Number"),a(),o(18,"th"),m(19,"Quantity"),a(),o(20,"th"),m(21,"Date"),a()()(),o(22,"tbody"),_(23,Rm,14,17,"tr",9),a()()(),o(24,"POS-complex-pagination",10),g("jumpToPage",function(){d(t);let i=c();return u(i.getListData())})("previousPage",function(){d(t);let i=c();return u(i.getListData())})("nextPage",function(){d(t);let i=c();return u(i.getListData())}),a()()()()}if(r&2){let t=c();p("pageData",t.menuData),S("text",t.pageData.Filter.Number),p("isFilterOnDropdown",!1),S("filter",t.pageData.Filter),l(2),p("ngIf",t.roleService.global.Export),l(10),p("ngIf",!O(13,9,t.isRedirect$)),l(11),p("ngForOf",t.data.Data),l(),p("total",t.data.Data==null?null:t.data.Data.length)("pageData",t.pageData)}}var Oi=class r extends Ft{constructor(t,n,i,s,y){super(t,n,"catalog/product/GetAdjustmentHistory","catalog/productLoader/GetAdjustmentHistoryLoader",null,i);this.matDialog=s;this.roleService=y;this.isRedirect$=vn(this.route.snapshot.queryParamMap).pipe(bt(E=>E.has("ID")),In(1))}isRedirect$;openExportModal(){this.matDialog.open(Wt,{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(n){return new(n||r)(C(it),C(j),C(ce),C(ft),C(R))};static \u0275cmp=P({type:r,selectors:[["POS-history-variant"]],features:[dt],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["api","catalog/product/GetCountAdjustmentHistory",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Variant","inputID","ID","notFoundMessageFor","variant",1,"form-control","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModelChange","items","ngModel"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"border-bottom"],["target","_blank",3,"routerLink","queryParams"]],template:function(n,i){n&1&&_(0,Qm,25,11,"mainpanel-cmp",1),n&2&&p("ngIf",i.data)},dependencies:[K,F,ut,lt,U,J,Ce,wt,Be,We,me,nt,pe]})};var Bm=[{path:"Adjustment/Archive",component:Bn},{path:"Adjustment/Archive/Info",component:Ln},{path:"Adjustment/Archive/Form",component:Yn,canActivate:[Ni],data:{roles:[_n.adjustment.Create,_n.adjustment.Edit]}},{path:"Adjustment/Archive/Form/V2",component:Mi,canActivate:[Ni],data:{roles:[_n.adjustment.Create,_n.adjustment.Edit]}},{path:"Tools/Count_Product_Inventory",component:si},{path:"Tools/Convert_Inventory_to_Parent_UOM",component:ai},{path:"Tools/Product_Sheet",component:li},{path:"Report/Adjustment",component:ni},{path:"History/Variant",component:Oi},{path:"Adjustment/Stock_Take_by_Web_Spreadsheet",component:oi},{path:"Adjustment/Stock_Take_by_CSV",component:ii},{path:"",redirectTo:"Adjustment/Archive",pathMatch:"full"}],Ti=class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=je({type:r});static \u0275inj=Ee({imports:[un.forChild(Bm),un]})};var jo=class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=je({type:r});static \u0275inj=Ee({imports:[Ne,Ti,He,de,Tn,Er,On,io,oo,En,jt,Vr,yr,Mr,jt,to,Jr,Ai,wr,Qe,cr,hr,Ur,pr,po,Ai,fr,so,mo,Vn,ze,zr,ei,ye,kn,An,$e,Fn]})};export{jo as AdjustmentModule};