dealpos 26.22.1 → 26.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-2TY2XNR2.js → chunk-26PUECE3.js} +2 -2
- package/browser/{chunk-3EKIVWPF.js → chunk-2FWY2QBX.js} +1 -1
- package/browser/{chunk-5DBEXU4Z.js → chunk-2Y6P3365.js} +1 -1
- package/browser/{chunk-YK4OKCEW.js → chunk-32YP4Y5G.js} +1 -1
- package/browser/{chunk-TLOCNHLN.js → chunk-3RQVSKXN.js} +1 -1
- package/browser/{chunk-DFGQVBIX.js → chunk-45TAADXR.js} +1 -1
- package/browser/{chunk-L6MYZKNY.js → chunk-47ZVBGMF.js} +1 -1
- package/browser/{chunk-HSRGZDVF.js → chunk-4AHX5CQ6.js} +1 -1
- package/browser/{chunk-UWHAXA5I.js → chunk-4T6N2RBV.js} +1 -1
- package/browser/{chunk-OJQ3NMLM.js → chunk-5OUHL5L3.js} +1 -1
- package/browser/{chunk-FBIFKEZ2.js → chunk-5QLOCKDR.js} +1 -1
- package/browser/{chunk-2OQQOSVC.js → chunk-5WPP3IT4.js} +2 -2
- package/browser/{chunk-V6CPUXJC.js → chunk-6TRERSZG.js} +1 -1
- package/browser/{chunk-6J4MVM4Z.js → chunk-7KJRBS6C.js} +1 -1
- package/browser/{chunk-G3CEZCVA.js → chunk-7QPMHQVO.js} +1 -1
- package/browser/{chunk-3TNUYTHF.js → chunk-AJ4LADKS.js} +1 -1
- package/browser/{chunk-XJIDB7OF.js → chunk-ALQ4KLZU.js} +1 -1
- package/browser/{chunk-BCP52T35.js → chunk-B3KMRUC6.js} +1 -1
- package/browser/{chunk-RRWZQOSZ.js → chunk-BDL2Q36Y.js} +1 -1
- package/browser/{chunk-H72NOFMO.js → chunk-BO34ALRJ.js} +1 -1
- package/browser/{chunk-TL43FJ5W.js → chunk-BQJFPAXN.js} +1 -1
- package/browser/{chunk-T5ENVLBD.js → chunk-C2VRENWJ.js} +2 -2
- package/browser/{chunk-AIXIIOX2.js → chunk-C5O4W7DL.js} +1 -1
- package/browser/{chunk-SAACZ6GN.js → chunk-C5WPI7F3.js} +1 -1
- package/browser/{chunk-C4V5HESO.js → chunk-D6VFY3ZB.js} +1 -1
- package/browser/{chunk-4X674VRQ.js → chunk-DBHFY64L.js} +2 -2
- package/browser/{chunk-RAC2MIHP.js → chunk-DQCZSAVL.js} +1 -1
- package/browser/{chunk-CTUK7IKB.js → chunk-DRX34PIT.js} +1 -1
- package/browser/{chunk-QA3YBL6O.js → chunk-E2P7RO3S.js} +1 -1
- package/browser/{chunk-7GFEM34N.js → chunk-E4CSS7AR.js} +1 -1
- package/browser/{chunk-RAFYHLQ7.js → chunk-EQGH53Q5.js} +1 -1
- package/browser/{chunk-L36HHY3N.js → chunk-F2XJ6UYV.js} +1 -1
- package/browser/{chunk-RZB55HRK.js → chunk-F5LPHBZD.js} +1 -1
- package/browser/{chunk-DLASJ2RY.js → chunk-G5X2ZPLV.js} +1 -1
- package/browser/{chunk-ETPMU7ZK.js → chunk-GCVTSEPB.js} +1 -1
- package/browser/{chunk-MXIAUUDI.js → chunk-GPH6COSV.js} +1 -1
- package/browser/{chunk-4PPX4YQS.js → chunk-GZVLAWJC.js} +1 -1
- package/browser/{chunk-J57KOL5W.js → chunk-H4PCAZ3D.js} +1 -1
- package/browser/{chunk-WEXMNFEH.js → chunk-HPFYVLGJ.js} +1 -1
- package/browser/{chunk-ZANW6FEN.js → chunk-IIYPDUKG.js} +1 -1
- package/browser/{chunk-FCRGTT6T.js → chunk-IJEPXGDI.js} +1 -1
- package/browser/{chunk-FIL4PQ75.js → chunk-IJKUAYAK.js} +1 -1
- package/browser/{chunk-WDN4NGX3.js → chunk-IPWGPPVZ.js} +1 -1
- package/browser/{chunk-X4DN4UAD.js → chunk-IQASXKH7.js} +1 -1
- package/browser/{chunk-UZICNW5U.js → chunk-IUNG7YXO.js} +1 -1
- package/browser/{chunk-57XDNRP6.js → chunk-J2M3A2FZ.js} +1 -1
- package/browser/{chunk-VXYZY2UQ.js → chunk-J4C7Y44B.js} +1 -1
- package/browser/{chunk-GKGRZ6CF.js → chunk-J73N62BF.js} +1 -1
- package/browser/{chunk-JTMAK7BQ.js → chunk-JR7YV2DF.js} +1 -1
- package/browser/{chunk-NWIVCEWX.js → chunk-K46O4IIJ.js} +1 -1
- package/browser/{chunk-3RVAIJR7.js → chunk-KFNGAQ72.js} +1 -1
- package/browser/{chunk-IZ7MKBUJ.js → chunk-KJIKGQ5Q.js} +1 -1
- package/browser/{chunk-M54Q4OXT.js → chunk-KMERDAR6.js} +1 -1
- package/browser/{chunk-NGRJNZQI.js → chunk-KNOMXZ3A.js} +1 -1
- package/browser/{chunk-QJRGDB2Q.js → chunk-KSNGFD2U.js} +1 -1
- package/browser/{chunk-IXOT42FV.js → chunk-MB7COAGN.js} +1 -1
- package/browser/{chunk-PJGBMF2W.js → chunk-MJDBWDMS.js} +1 -1
- package/browser/{chunk-SZ7TDG5L.js → chunk-MUPPHGER.js} +1 -1
- package/browser/{chunk-4OHTD35K.js → chunk-N5Z6MPMV.js} +1 -1
- package/browser/{chunk-ACOZMW3R.js → chunk-NEHVZXIT.js} +1 -1
- package/browser/{chunk-EIGWR5UZ.js → chunk-NNXLNGN4.js} +1 -1
- package/browser/{chunk-UBSCYZ7Y.js → chunk-NQE6OV5X.js} +1 -1
- package/browser/{chunk-B62P7UIS.js → chunk-NR2GWW3R.js} +1 -1
- package/browser/{chunk-U7K4AI2F.js → chunk-OA5OH4WZ.js} +1 -1
- package/browser/{chunk-FDD4YU2K.js → chunk-OCLSAB65.js} +1 -1
- package/browser/{chunk-AP33F57M.js → chunk-OJHKOVHN.js} +1 -1
- package/browser/{chunk-YYR635KL.js → chunk-OUJ3BECK.js} +1 -1
- package/browser/{chunk-ZANRZZBU.js → chunk-OVPEADWW.js} +1 -1
- package/browser/{chunk-S5REUTDG.js → chunk-P3YW73WN.js} +1 -1
- package/browser/{chunk-Q3FWDAZL.js → chunk-P6WQDCGV.js} +1 -1
- package/browser/{chunk-YG3BVAML.js → chunk-PCR2DMOC.js} +1 -1
- package/browser/{chunk-VKJOK4UM.js → chunk-PEMVOID7.js} +1 -1
- package/browser/{chunk-3NV7LSQB.js → chunk-PF3R4ZY5.js} +1 -1
- package/browser/{chunk-Q7H4CHAQ.js → chunk-PNLXUMV2.js} +1 -1
- package/browser/{chunk-M252ZDYI.js → chunk-PVAQ2EBK.js} +1 -1
- package/browser/{chunk-OYMJGSJP.js → chunk-QCO7EW4N.js} +1 -1
- package/browser/{chunk-ZAY3QE27.js → chunk-QR2BD7ZY.js} +1 -1
- package/browser/{chunk-XWKJIYIB.js → chunk-QTU3TR3W.js} +1 -1
- package/browser/{chunk-4ST5ALH6.js → chunk-RN5DN2JA.js} +2 -2
- package/browser/{chunk-P7SXWVVV.js → chunk-ROIM5VKQ.js} +1 -1
- package/browser/{chunk-5I5MX5BZ.js → chunk-S4OLNZQB.js} +1 -1
- package/browser/{chunk-77G7OVEC.js → chunk-SAIVLXA3.js} +1 -1
- package/browser/{chunk-LRMXMTAJ.js → chunk-SQDOBWY5.js} +1 -1
- package/browser/{chunk-VOGU4NGP.js → chunk-SUBLTS36.js} +1 -1
- package/browser/{chunk-X55QXZSH.js → chunk-TRD6GSA7.js} +2 -2
- package/browser/{chunk-WOE3INWS.js → chunk-TULCQM7T.js} +1 -1
- package/browser/{chunk-W4R4EH2P.js → chunk-U3QD4CKP.js} +1 -1
- package/browser/{chunk-ORLXSXQP.js → chunk-UD6EOV4V.js} +1 -1
- package/browser/{chunk-JIWIM2P3.js → chunk-UFEO2IWG.js} +1 -1
- package/browser/{chunk-2QFSL6QW.js → chunk-UG4OTKN6.js} +1 -1
- package/browser/{chunk-VGQGJUUA.js → chunk-UTNV2WKT.js} +1 -1
- package/browser/{chunk-XB6S7OYN.js → chunk-UUXNSQLH.js} +1 -1
- package/browser/{chunk-G62MNBWG.js → chunk-VKMCRFQP.js} +1 -1
- package/browser/chunk-W7VB2O3M.js +1 -0
- package/browser/{chunk-CKWH6DQW.js → chunk-WH5SPCU2.js} +2 -2
- package/browser/{chunk-QAIFV2EA.js → chunk-WHKVSXKM.js} +1 -1
- package/browser/{chunk-CNYDVHLK.js → chunk-WHMRDDE2.js} +1 -1
- package/browser/{chunk-PQUKPUGV.js → chunk-WR45ZZJI.js} +1 -1
- package/browser/{chunk-3S2PVEX7.js → chunk-XQXUGHWQ.js} +1 -1
- package/browser/{chunk-2IEPOWJP.js → chunk-Y7V7DPTN.js} +1 -1
- package/browser/{chunk-L3D3L2X5.js → chunk-YYA7RWUF.js} +1 -1
- package/browser/{chunk-VFXAGENQ.js → chunk-Z645WL3Y.js} +1 -1
- package/browser/{chunk-KLGG7SHN.js → chunk-ZCMCZJGQ.js} +1 -1
- package/browser/{chunk-X6L6CRPW.js → chunk-ZDNMAMQF.js} +1 -1
- package/browser/{chunk-AZ2TYM6Q.js → chunk-ZM4ZKNXC.js} +1 -1
- package/browser/{chunk-G2ACLZX2.js → chunk-ZS7CAVEJ.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-XBQ37ZBM.js → main-OEAB5UAA.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-HLGEFFCA.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as dn}from"./chunk-ZM64NIQG.js";import{a as Ca}from"./chunk-MOC2F2UJ.js";import{a as ho}from"./chunk-HSRGZDVF.js";import{b as Sa,c as ya}from"./chunk-BEXSLV5X.js";import{a as Pa}from"./chunk-HBAQBI6Z.js";import{a as Ia}from"./chunk-VCWK6RX5.js";import{a as _a,b as ha}from"./chunk-KQK25QJL.js";import{a as xa,b as un}from"./chunk-RXYT5HJD.js";import{a as mn}from"./chunk-B5AIOOC2.js";import"./chunk-HYDOMSL4.js";import"./chunk-DAGMLKAT.js";import{a as pn}from"./chunk-LFZHNLN4.js";import{a as Di}from"./chunk-76NB5ZWF.js";import{a as va,b as ba}from"./chunk-C4V5HESO.js";import{a as Ft}from"./chunk-SOVLVO4L.js";import{a as Vr}from"./chunk-INDWZUXM.js";import{a as $i}from"./chunk-KVTHO5AJ.js";import{A as ln,B as wt,C as sa,D as li,E as pa,F as da,G as sn,H as ma,I as ua,J as cn,K as fa,L as ga,a as Jr,b as Kr,c as Xr,d as A,e as j,f as Ce,g as Zi,h as ia,i as Xi,j as na,k as oa,l as q,m as ra,n as aa,o as Mt,p as kt,q as me,r as ai,s as en,t as tn,u as nn,v as on,w as _o,x as rn,y as an,z as U}from"./chunk-YYR635KL.js";import{b as Ot,c as ce}from"./chunk-HPT2OI3Y.js";import"./chunk-ZOBPTHDY.js";import"./chunk-VU4DKVXW.js";import"./chunk-GGDW5WFA.js";import{b as Br,e as jr,f as Hr,g as Ur}from"./chunk-GOB3T42H.js";import{a as Yr,b as Zr}from"./chunk-NHDATDCF.js";import{c as Ki,d as Yi}from"./chunk-EC3IVRO5.js";import"./chunk-KMQJA2M5.js";import"./chunk-FCNGKCNJ.js";import"./chunk-DUBSPAA2.js";import"./chunk-I6BZSZXZ.js";import{a as ta}from"./chunk-5UX7NZFM.js";import{a as Wr}from"./chunk-GO3FYZZE.js";import{a as dt}from"./chunk-S5REUTDG.js";import"./chunk-P3KIIKY4.js";import"./chunk-D2UNYCWT.js";import"./chunk-RG65F34V.js";import{a as fo,b as qe,c as Pe,d as ea,e as Oe}from"./chunk-SAACZ6GN.js";import{a as Co}from"./chunk-46FATRR5.js";import{a as zr,b as qr,c as Gr,d as Ji}from"./chunk-IDRQUF52.js";import"./chunk-5UDUWK67.js";import"./chunk-NQX7EX5A.js";import{a as la,b as ca}from"./chunk-LBBDKTVE.js";import{a as Gi}from"./chunk-SZ7TDG5L.js";import{a as Qr,b as qi}from"./chunk-N4S7RUAZ.js";import{a as zi,b as Lr,c as Fr}from"./chunk-2QIQUFIR.js";import"./chunk-DYMB65KX.js";import{a as pt,b as go}from"./chunk-H72NOFMO.js";import{a as tt}from"./chunk-54VUHDZ6.js";import{a as $r}from"./chunk-MQLMXL2E.js";import"./chunk-6KDTVFMW.js";import"./chunk-BYXBJQAS.js";import"./chunk-BYXBJQAS.js";import{c as Pi}from"./chunk-QIU4DALL.js";import{b as Ne}from"./chunk-Z3JTICHN.js";import"./chunk-Z3E24JZW.js";import{b as oi,c as Ie}from"./chunk-NSNUUKNK.js";import{a as Ii}from"./chunk-DDLXGCOB.js";import{a as Dt}from"./chunk-XGIQ7PXS.js";import"./chunk-YTZPBL5O.js";import{b as Wi,c as xt,d as It,e as ei}from"./chunk-DX6RJE57.js";import"./chunk-HT6DSP63.js";import{d as Ar}from"./chunk-OQMWV4LA.js";import{a as ri}from"./chunk-4VRCKWUY.js";import"./chunk-R3DFB5VD.js";import"./chunk-2D4XBF6C.js";import"./chunk-J63OB27M.js";import"./chunk-MPN57TB5.js";import"./chunk-KF3MHC66.js";import"./chunk-KBZZ7PX4.js";import"./chunk-ETGLCIRD.js";import{c as kr,d as wr}from"./chunk-WJGP2CLN.js";import"./chunk-2ZXCNSZZ.js";import{a as Cr}from"./chunk-M2AZOKFB.js";import{d as ni}from"./chunk-LMI6FIPG.js";import{a as _r}from"./chunk-4F45HHZT.js";import"./chunk-3S3T7QLT.js";import{c as dr}from"./chunk-4KO3X4S2.js";import"./chunk-BACG4SJJ.js";import"./chunk-CQTLBAQD.js";import{a as ct}from"./chunk-OFSPPASQ.js";import"./chunk-JFIKQKZJ.js";import"./chunk-N4NZWFKH.js";import{g as Rr,h as Nr}from"./chunk-ACOZMW3R.js";import{a as Tr,b as Er}from"./chunk-XULGDGRO.js";import"./chunk-43NB6BM4.js";import"./chunk-OVEGWW7W.js";import"./chunk-LL4377Z2.js";import"./chunk-GAOYV53E.js";import"./chunk-W6JPMHYE.js";import{a as mr,d as ur,f as fr}from"./chunk-BXA2JYKG.js";import{a as Dr}from"./chunk-WOE3INWS.js";import{a as gr}from"./chunk-HNHLGX7F.js";import{a as hr}from"./chunk-L6MYZKNY.js";import"./chunk-FVUFPTGH.js";import{a as pr}from"./chunk-LXFJ7QGK.js";import{a as Or,b as Mr}from"./chunk-Q7H4CHAQ.js";import{b as Pr,c as et,e as ii,f as Pt}from"./chunk-VGQGJUUA.js";import"./chunk-G7E24J2R.js";import"./chunk-VYA2NFJ5.js";import"./chunk-SH55PTEY.js";import"./chunk-VPS35GPI.js";import"./chunk-UGBMCXS6.js";import{a as se,b as Xe}from"./chunk-5TTXT2K2.js";import"./chunk-YNQPX5G6.js";import{F as Ir,N as ti,O as fe,a as vr,b as br,n as Qi,t as Sr,u as yr,x as xr}from"./chunk-3NJAM5KX.js";import{a as tr}from"./chunk-JFJPOKIM.js";import"./chunk-QYSFCWV7.js";import{d as Ct}from"./chunk-IEJVBN5K.js";import"./chunk-ZANRZZBU.js";import{a as L,b as ge,c as oe}from"./chunk-BQPO535K.js";import"./chunk-HLLBCLO6.js";import"./chunk-4P6SOZDY.js";import"./chunk-XN7T54IM.js";import"./chunk-RULWGB4E.js";import"./chunk-2HIDUY57.js";import{a as Re,b as B,c as V}from"./chunk-U5Y75IZ5.js";import"./chunk-HY3IUHOC.js";import"./chunk-4AEX2WLA.js";import"./chunk-2MELUOYA.js";import"./chunk-WOPE6PPO.js";import{C as sr,E as be,F as Ze,a as ir,b as Yt,c as X,d as nr,e as xi,g as or,h as z,j as rr,l as bt,m as ar,o as ne,r as lr,s as St,z as Zt}from"./chunk-MDIMQ3H3.js";import{a as Kt,c as Xt}from"./chunk-X6L6CRPW.js";import{a as cr}from"./chunk-AZ2TYM6Q.js";import"./chunk-MWDJTJ3O.js";import{b as yt}from"./chunk-7CQSSHSC.js";import{a as S}from"./chunk-3DEA4WWC.js";import{a as er}from"./chunk-OYMJGSJP.js";import{n as K,q as Be}from"./chunk-TKVDP62Z.js";import{A as Ro,Aa as Lo,Ad as Z,Bb as u,Bc as st,Ca as Ue,Cc as Ke,Db as f,Dc as T,Dd as Yo,Eb as Vt,Ec as he,F as ae,Fa as R,Fb as de,Fc as yi,Gb as te,Hb as ie,Ib as d,J as vi,Ja as Fo,Jb as r,Kb as a,Kc as b,Lb as h,Lc as I,Mb as ft,Mc as ee,N as No,Nb as lt,Nc as Le,O as Ht,Pb as We,Qb as Qe,Qc as gt,Qd as Zo,Rb as Lt,Sa as Qt,Sd as Xo,Tc as uo,Ua as rt,Ub as y,Ud as vt,Vd as Gt,Xa as ut,Xb as g,Xd as Jt,Yb as mo,Yc as Fi,Z as Ut,Za as s,Zb as c,Zc as Jo,ba as Te,bc as Ve,c as To,cc as ye,d as $,db as Bo,dc as xe,dd as Ko,e as po,ea as w,eb as m,fc as Wo,ga as _e,gc as Qo,hc as He,ib as P,ic as $o,jb as $t,jc as bi,k as Eo,kb as jo,lc as le,ma as Ao,mc as p,na as Je,nb as Vi,nc as D,nd as J,o as At,oa as Wt,ob as G,oc as x,pc as Ee,pd as Bi,qa as N,qc as zo,qd as qt,ra as H,rc as O,rd as ji,sc as M,sd as Hi,tc as k,td as Ye,u as Ge,uc as Li,v as Ai,va as C,vc as qo,vd as Fe,wa as _,wb as Ho,wc as Go,xb as Uo,xc as Si,xd as Y,yc as zt,za as Vo,zd as Ui}from"./chunk-GJDGQISV.js";import"./chunk-WFMAM73Y.js";import{k as wo}from"./chunk-SNAKHGZS.js";var fn=class{ID;Code;Name;Title;Field;Address;ContactInfo;Logo;FooterLeft;FooterRight;FooterNote;PrintMode;PrintLX300;DeliveryNote;AppendQR;ItemRenderMode;CssClass;RemoveImage;DisplayName;DisplayNameCode};var si=class{ParkLabel;Note;NumberOfPerson;ID;Alias;Created;CustomerDisplay;Number;Duration};var gn=class n{constructor(t,e,i,o,l,v){this.dialogRef=t;this._orderProcessorService=e;this._posService=i;this.salesOrderService=o;this.parkService=l;this.data=v;this.initModalDialog(),this.initConfig(),this.parkLabel=v.ParkLabel,this.form.ParkLabel=v.ParkLabel,this.form.Note=o.Data.Order.Note}modalConfig=new B;labelPlaceholder;form=new si;parkLabel;initConfig(){let t=this._posService.Data.AppConfigJSON;this.labelPlaceholder=t.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkLabelPlaceholder}initModalDialog(){this.modalConfig.title=this.data.title,this.modalConfig.customWidth="600px"}onOk(){this.setParkTitle(),this.parkService.park(this.form).subscribe(t=>{this.dialogRef.close(!0)})}setParkTitle(){let t=this._orderProcessorService.Data.posState,e=this.salesOrderService.Data.Order.Number;t==5?this.salesOrderService.Data.SplitParkLabel=S.IsEmpty(this.parkLabel)?e:this.parkLabel:S.IsEmpty(this.parkLabel)?this.form.ParkLabel=e:this.form.ParkLabel=this.parkLabel}static \u0275fac=function(e){return new(e||n)(m(L),m(U),m(j),m(A),m(ke),m(ge))};static \u0275cmp=P({type:n,selectors:[["POS-modal-park-input"]],standalone:!1,decls:17,vars:3,consts:[[3,"onCancel","onOk","onClose","config"],[1,"ods-info-box"],[1,"fas","fa-info-circle",2,"font-size","1.2rem","margin-top","2px"],["href","https://ods.dealpos.app","target","_blank",2,"color","#0d6efd","font-weight","600","text-decoration","underline"],[1,"w-100","mt-4"],[1,"mb-3"],["type","text","required","","placeholder","E.g. Mr. John Doe","matTooltip","Same as Order Number when blank",1,"form-control","w-100","height-input",3,"ngModelChange","ngModel"],["placeholder","ex: Customer will return tommorow",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(r(0,"modal-material",0),g("onCancel",function(){return i.dialogRef.close()})("onOk",function(){return i.onOk()})("onClose",function(){return i.dialogRef.close()}),r(1,"content")(2,"div",1),h(3,"i",2),r(4,"div"),p(5," Use our "),r(6,"a",3),p(7," Order Display Fulfillment System "),a(),p(8," to view the Parked Orders from your warehouse area. "),a()(),r(9,"div",4)(10,"strong",5),p(11,"Label"),a(),r(12,"input",6),k("ngModelChange",function(l){return M(i.parkLabel,l)||(i.parkLabel=l),l}),a()(),r(13,"div",4)(14,"strong",5),p(15,"Note"),a(),r(16,"POS-tinymce-editor",7),k("ngModelChange",function(l){return M(i.form.Note,l)||(i.form.Note=l),l}),a()()()()),e&2&&(d("config",i.modalConfig),s(12),O("ngModel",i.parkLabel),s(4),O("ngModel",i.form.Note))},dependencies:[X,z,Zt,ne,V,se,tt],styles:[".height-input[_ngcontent-%COMP%]{height:36px} ng-select.park-detail>div.ng-select-container{border-radius:0!important}.deposit[_ngcontent-%COMP%] .ng-select{width:auto!important}.ods-info-box[_ngcontent-%COMP%]{background-color:#e8f4fd;border-left:4px solid #0dcaf0;padding:16px 20px;border-radius:8px;font-family:Roboto Slab,sans-serif;color:#055160;display:flex;align-items:flex-start;gap:10px;font-size:14px;max-width:600px;margin:0 auto}"]})};var Cn=class n{constructor(t){this._dialogRef=t;this.modalConfig=new B,this.modalConfig.title="Select Print Type",this.modalConfig.hideFooter=!0}modalConfig;onPrintOrder(){this._dialogRef.close("ORDER")}onPrintBill(){this._dialogRef.close("BILL")}static \u0275fac=function(e){return new(e||n)(m(L))};static \u0275cmp=P({type:n,selectors:[["POS-modal-print"]],standalone:!1,decls:17,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"d-flex"],[1,"btn","btn-gray","btn-lg","me-1",3,"click"],["src","https://cdn.dealpos.xyz/web-image/order.png"],[1,"mt-1"],[1,"mt-0"],[1,"btn","btn-gray","btn-lg","ms-1",3,"click"],["src","https://cdn.dealpos.xyz/web-image/bill.png",2,"width","23px"]],template:function(e,i){e&1&&(r(0,"modal-material",0),g("onCancel",function(){return i._dialogRef.close()})("onClose",function(){return i._dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),g("click",function(){return i.onPrintOrder()}),h(4,"img",3),r(5,"h4",4),p(6,"Order"),a(),r(7,"div",5),p(8,"For order for the kitchen"),a()(),r(9,"a",6),g("click",function(){return i.onPrintBill()}),h(10,"img",7),r(11,"h4",4),p(12,"Bill"),a(),r(13,"div",5),p(14,"To see amount of the bill"),a(),r(15,"div",5),p(16,"(Pre-settlement bill)"),a()()()()()),e&2&&d("config",i.modalConfig)},dependencies:[V],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #D6D6D6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}.btn[_ngcontent-%COMP%]{padding:8px 0;width:190px;margin-right:10px}.btn[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:700;text-transform:uppercase}.btn[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{font-size:.75rem;font-style:italic;color:#868686;margin-top:10px}"]})};var Za=n=>({"mat-tab-group-height":n});function Xa(n,t){if(n&1){let e=y();r(0,"div",2)(1,"div",6)(2,"span",7),h(3,"i",8),a(),r(4,"input",9),k("ngModelChange",function(o){C(e);let l=c();return M(l.filter,o)||(l.filter=o),_(o)}),a()()()}if(n&2){let e=c();s(4),O("ngModel",e.filter)}}function el(n,t){if(n&1&&(r(0,"h5",14),h(1,"i"),r(2,"span"),p(3),a()()),n&2){let e=c().$implicit;s(),le(e.Icon),s(2),D(e.Name)}}function tl(n,t){if(n&1){let e=y();r(0,"div",13)(1,"park-card",15),g("onSelect",function(){let o=C(e).$implicit,l=c(2);return _(l.onSelect(o))}),a()()}if(n&2){let e,i=t.$implicit,o=c().$implicit,l=c();s(),d("title",l.replaceWithAlias()&&i.Alias?i.Alias:i.Name)("alias",i.Alias)("isOccupied",i.IsOccupied)("icon",o.Icon)("selected",((e=l.parkOptionSelected())==null?null:e.Name)===i.Name)}}function il(n,t){if(n&1&&(r(0,"mat-tab",4),G(1,el,4,3,"ng-template",10),r(2,"div",11)(3,"div",12),te(4,tl,2,5,"div",13,Vt),b(6,"Filter"),a()()()),n&2){let e=t.$implicit,i=c();d("label",e.Name),s(4),ie(Le(6,1,e.Options,i.filter(),"Name"))}}function nl(n,t){if(n&1){let e=y();r(0,"div",5)(1,"POS-tinymce-editor",16),k("ngModelChange",function(o){C(e);let l=c();return M(l.parkNote,o)||(l.parkNote=o),_(o)}),a()()}if(n&2){let e=c();s(),O("ngModel",e.parkNote)}}var pi=class n{constructor(t){this.data=t;this.parkLayout.set(t.parkLayoutPack),this.replaceWithAlias.set(t.replaceWithAlias),this.initModalConfig(),this.showInputNote.set(this.posService.Data?.AppConfigJSON?.ApplicationParkAndRetrieve?.NumberOfPerson),this.parkNote.set(t.orderNote||"")}dialogRef=H(L);posService=H(j);modalConfig=new B;filter=R("");parkLayout=R(null);parkOptionSelected=R(null);replaceWithAlias=R(!1);showInputNote=R(!1);parkNote=R("");initModalConfig(){this.modalConfig.title=this.data.title||"Park Order",this.modalConfig.customWidth="700px",this.modalConfig.bodyScrollable=!0,this.modalConfig.okText=" Park "}onSelect(t){this.parkOptionSelected.set(t)}onOk(){this.showInputNote()&&(this.parkOptionSelected().Note=this.parkNote()),this.dialogRef.close(this.parkOptionSelected())}onCancel(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||n)(m(ge))};static \u0275cmp=P({type:n,selectors:[["app-modal-park"]],decls:8,vars:6,consts:[[3,"keydown.F2","onOk","onCancel","onClose","config"],[1,"container",2,"max-height","395px","min-height","395px"],[1,"search-container"],["mat-stretch-tabs","false",1,"mt-2",3,"ngClass"],[3,"label"],[1,"mt-4"],[1,"input-group","w-100"],[1,"input-group-text","txtFilter","rounded-start-1"],["aria-hidden","true",1,"fa","fa-magnifying-glass"],["type","text","placeholder","Search by number or note","aria-label","Search",1,"txtFilter","form-control","border-start-0","rounded","rounded-start-0",3,"ngModelChange","ngModel"],["mat-tab-label",""],[1,"container","mt-5"],[1,"row"],[1,"col-3","mb-4","px-2"],[1,"d-flex","align-items-center","gap-3"],[3,"onSelect","title","alias","isOccupied","icon","selected"],["height","180px","placeholder","Input the park note (E.g. this is for Mr. John)",3,"ngModelChange","ngModel"]],template:function(e,i){if(e&1&&(r(0,"modal-material",0),g("keydown.F2",function(){return i.onOk()})("onOk",function(){return i.onOk()})("onCancel",function(){return i.onCancel()})("onClose",function(){return i.onCancel()}),r(1,"content")(2,"div",1),u(3,Xa,5,1,"div",2),r(4,"mat-tab-group",3),te(5,il,7,5,"mat-tab",4,Vt),a(),u(7,nl,2,1,"div",5),a()()()),e&2){let o,l,v;d("config",i.modalConfig),s(3),f(((o=i.parkLayout().Layout)==null?null:o.length)>0?3:-1),s(),d("ngClass",T(4,Za,i.showInputNote()&&((l=i.parkOptionSelected())==null?null:l.Name))),s(),ie(i.parkLayout().Layout),s(2),f(i.showInputNote()&&((v=i.parkOptionSelected())!=null&&v.Name)?7:-1)}},dependencies:[Z,J,V,Ca,ti,be,X,z,ne,ei,Wi,xt,It,tt,yr],styles:["[_nghost-%COMP%] .mat-mdc-tab-group[_ngcontent-%COMP%]{--mat-tab-active-indicator-color: #89b03e;--mat-tab-focus-indicator-color: #89b03e;--mat-tab-focus-label-text-color: var(--bs-body-color);--mat-tab-active-label-text-color: var(--bs-body-color);--mat-tab-active-focus-label-text-color: var(--bs-body-color);--mat-tab-active-hover-label-text-color: var(--bs-body-color);--mat-tab-active-focus-indicator-color: #89b03e;--mat-tab-active-hover-indicator-color: #89b03e}[_nghost-%COMP%] .mat-mdc-tab-header{border-bottom:1px solid var(--bs-border-color)}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%]{transition:all .3s ease}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{position:relative;transition:all .3s ease;height:2.3rem}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e4d,0 0 8px 4px #89b03e33;border-radius:4px}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]{transition:all .3s ease;border-left:none!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]:focus{box-shadow:none!important;border-color:#ced4da!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .input-group-text[_ngcontent-%COMP%]{transition:all .3s ease;background-color:#fff;border-right:none!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .input-group-text[_ngcontent-%COMP%], [_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .input-group-text[_ngcontent-%COMP%]{background-color:#89b03e1a;border-color:#84cc16!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .fa-magnifying-glass[_ngcontent-%COMP%]{transition:all .3s ease}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .fa-magnifying-glass[_ngcontent-%COMP%], [_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .fa-magnifying-glass[_ngcontent-%COMP%]{color:#84cc16!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e66,0 0 12px 6px #89b03e40!important}[_nghost-%COMP%] .mat-tab-group-height[_ngcontent-%COMP%]{height:165px}"]})};var _n=class n{constructor(t,e,i,o,l,v,E,Q,Se){this.dialogRef=t;this.parkOrderRetrieve=e;this._orderDataService=i;this._posHttpResponseService=o;this._orderProcessorService=l;this._orderHttpService=v;this._dialog=E;this._outletRegisterService=Q;this.parkService=Se;this.salesOrderData=this._orderDataService.Data,this.appConfig=this._posHttpResponseService.Data.AppConfigJSON,this.parkLayoutPack=this._outletRegisterService.Data.ParkLayoutPack}modalConfig=new B;salesOrderData;appConfig;parkLayoutPack;ngOnInit(){this.modalConfig.title="Re-Park Order?",this.modalConfig.hideFooter=!0}onRepark(){this.parkService.park(this.parkOrderRetrieve).subscribe(t=>{this.dialogRef.close()})}onMove(){this.dialogRef.close(),this.showParkSelectModal()}showParkSelectModal(){this._orderHttpService.getVacant(this.salesOrderData.Order.EntityID).subscribe(t=>{this._dialog.open(pi,{data:{title:this.title,parkLayoutPack:this.parkLayoutPack,replaceWithAlias:this.appConfig.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias,orderNote:this.salesOrderData?.Order?.Note}})})}get title(){return this._orderProcessorService.Data.posState==5?"Split Order":this.appConfig.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkDialogTitle}static \u0275fac=function(e){return new(e||n)(m(L),m(ge),m(A),m(j),m(U),m(Oe),m(oe),m(q),m(ke))};static \u0275cmp=P({type:n,selectors:[["POS-modal-repark"]],standalone:!1,decls:13,vars:2,consts:[[3,"onClose","onCancel","title","config"],[1,"d-flex"],[1,"btn","btn-gray","btn-lg",3,"click"]],template:function(e,i){e&1&&(r(0,"modal-material",0),g("onClose",function(){return i.dialogRef.close()})("onCancel",function(){return i.dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),g("click",function(){return i.onRepark()}),r(4,"h4"),p(5,"Re-Park"),a(),r(6,"span"),p(7,"Store order to same location"),a()(),r(8,"a",2),g("click",function(){return i.onMove()}),r(9,"h4"),p(10,"Move"),a(),r(11,"span"),p(12,"Shift order to Different location"),a()()()()()),e&2&&d("title","Re-Park Order?")("config",i.modalConfig)},dependencies:[V],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #D6D6D6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}.btn[_ngcontent-%COMP%]{padding:25px 0;width:190px;margin-right:10px}.btn[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:700;text-transform:uppercase}.btn[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.75rem;font-style:italic;color:#868686;margin-top:10px}"]})};var hn=class{_point;get point(){return this._point}set point(t){this._point=t}_pricebookID;get pricebookID(){return this._pricebookID}set pricebookID(t){this._pricebookID=t}_discountRate;get discountRate(){return this._discountRate}set discountRate(t){this._discountRate=t}_groups;get groups(){return this._groups}set groups(t){this._groups=t}_salesID;get salesID(){return this._salesID}set salesID(t){this._salesID=t}_dueDays;get dueDays(){return this._dueDays}set dueDays(t){this._dueDays=t}_expiryDate;get expiryDate(){return this._expiryDate}set expiryDate(t){this._expiryDate=t}_debt;get debt(){return this._debt}set debt(t){this._debt=t}_expirtedString;get expirtedString(){return this._expirtedString}set expirtedString(t){this._expirtedString=t}_loyaltyDisabled;get loyaltyDisabled(){return this._loyaltyDisabled}set loyaltyDisabled(t){this._loyaltyDisabled=t}_taxTypeID;get taxTypeID(){return this._taxTypeID}set taxTypeID(t){this._taxTypeID=t}_entityID;get entityID(){return this._entityID}set entityID(t){this._entityID=t}_mobile;get mobile(){return this._mobile}set mobile(t){this._mobile=t}_email;get email(){return this._email}set email(t){this._email=t}_dueMonths;get dueMonths(){return this._dueMonths}set dueMonths(t){this._dueMonths=t}_memberIdentification;get memberIdentification(){return this._memberIdentification}set memberIdentification(t){this._memberIdentification=t}};var Mi=class{OutletName;Status;AmountSummary;Coupon;Creator;CurrencySymbol;Customer;Date;Delivery;ExtraNote;FinalAmount;InvoiceNote;Items;LoyaltyPoint;Payments;PrintDate;RegisterCode;SalesOrderItemCommission;Shipping;Title;TypeName;PaymentState;ToP;Due;Gopay;Number;Created;SalesName;ParkLabel;HeaderTitle;QRContent;Retur;ID;AfterSell;constructor(){this.OutletName="",this.Status=1,this.AmountSummary=[],this.Coupon="",this.Creator="",this.CurrencySymbol="",this.Customer=new hn,this.Date="",this.Delivery={Number:""},this.ExtraNote="",this.FinalAmount=0,this.InvoiceNote="",this.Items=[],this.LoyaltyPoint="",this.Payments=[],this.PrintDate="",this.RegisterCode="",this.SalesOrderItemCommission={SalesName:""},this.Shipping=new Pi,this.Title="",this.TypeName="",this.PaymentState=0,this.Number="",this.Created="",this.AfterSell=!0}};var di=class{LayoutPack;constructor(t){this.LayoutPack=t,this.GenerateLayoutOption()}GenerateLayoutOption(){this.LayoutPack!=null&&this.LayoutPack.Layout&&this.LayoutPack.Layout.forEach(t=>{t.Options=[];for(let e=1;e<=t.Size;e++){let i=new pn;i.Name=t.Name+e,i.Alias=this.GetAlias(i.Name),t.Options.push(i)}})}GetAlias(t){if(this.LayoutPack!=null&&this.LayoutPack.Alias){let e=this.LayoutPack.Alias.filter(i=>i.Name==t);return e.length>0?e[0].Alias:t}return""}};var vn=class{ExtraNote;Title;Customer;SalesName;InvoiceNote;Date;Items;AmountSummary;Creator;NumberOfPerson;CurrencySymbol;constructor(){this.ExtraNote="",this.Title="",this.Customer="",this.SalesName="",this.InvoiceNote="",this.Date="",this.Items=[],this.AmountSummary=[],this.Creator="",this.NumberOfPerson=0,this.CurrencySymbol="Rp"}};var bn=class{AmountSummary;Contact;ContactDisplay;CurrencySymbol;FinalAmount;HeaderTitle;Invoice;IsPrice;Items;LoyaltyPoint;Order;Payments;PriceVisible;PrintPerson;PrintTime;SalesName;Shipping;TotalInWord};var Et=class n{constructor(t,e,i,o,l,v,E,Q){this._posService=t;this._orderDataService=e;this._cashierCalculatorService=i;this._outletService=o;this._OrderHttpService=l;this._receiptCalculatorService=v;this._orderProcessorService=E;this._customerHttpService=Q;this.subscribeToObservableChanges()}posData;completeData;park=new di(null);outletInfo=new Zi;datePipe=new Fe("en-US");ParkTemp=Array();CartItems=[];get posStorage(){return this._posService.Data}get AppConfigJSON(){return this._posService.Data.AppConfigJSON}subscribeToObservableChanges(){this._orderDataService.Data$.subscribe(t=>{this.posData=t}),this._OrderHttpService.Data$.subscribe(t=>{this.completeData=t}),this._outletService.Data$.subscribe(t=>{this.outletInfo=t}),this._orderProcessorService.Data$.subscribe(t=>{this.ParkTemp=t.parkTemporaryItem})}generateReceiptMini(){let t=new Mi;t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.OutletName=this.outletInfo.EntityName,t.ExtraNote=this.getParkLabel(),t.Customer=this.getSubmitedCustomer(),t.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.SalesOrderItemCommission={SalesName:this._outletService.getSalesname(this.posData.Order.SalesID)},t.Number=this.completeData?.InvoiceNumber,t.FinalAmount=this.completeData?.Final,t.InvoiceNote=this.posData.Invoice?.Note,t.RegisterCode=this.outletInfo.RegisterCode==null?"":this.outletInfo.RegisterCode,t.QRContent=this.generateQrContent(),t.ID=this.completeData?.ObjectID,t.Retur=S.IsNotEmpty(this.posData?.Invoice?.ReferenceInvoiceID),t.Date=this.getSubmitedOrderDate(),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoiceCreatedTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy")),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.OrderTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm")),t.PrintDate=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm")||"",this.posData.CartItems.forEach(i=>{i.SalesID&&(i.SalesName=this._outletService.getSalesname(i.SalesID))}),t.Items=this.posData.CartItems,t.Customer!=null&&t.Customer.Display!=null&&t.Customer.Display!=null&&t.Customer.Display!=null&&(t.Customer={ID:this.posData.Order.CustomerID,Display:this.posData.ContactName,Email:t.Customer.Email,CityName:null,Address:t.Customer.Address,Code:t.Customer.Code,Name:t.Customer.Name,Phone:t.Customer.Phone,Mobile:t.Customer.Mobile,NationalIDNumber:t.Customer.NationalIDNumber,Title:t.Customer.Title}),t.Delivery={Number:this.posData.Order.Number};let e=S.FilterByID(this.posStorage.PoTypes,this.posData.Order.TypeID);if(e!==null&&(t.TypeName=e.Name),t.Shipping=this.generateShippingData(),this.AppConfigJSON.PrintConfigInvoice.ItemsTable.ItemWithoutPriceVisible||(t.Items=t.Items.filter(i=>i.Price!=0)),t.Coupon=this.posData.Order.PromotionCoupon,t.LoyaltyPoint=this.completeData?this.completeData.LoyaltyPoint:"",t.FinalAmount=this._cashierCalculatorService.Data,t.CurrencySymbol=this._cashierCalculatorService.currencySymbol,t.PaymentState=this.getPaymentState(),t.Payments=this.posData.Payments,t.Payments.forEach(i=>{i.MethodName=this.findPaymentName(i.MethodID)}),t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t.Creator=this.completeData?.Creator?this.completeData?.Creator:this.posStorage?.UserName,this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoicePaymentTermsVisible&&this.posData.Payments.length==0){let i=this.posData.Invoice.Due?new Date(this.posData.Invoice.Due):null,o=new Date(this.posData.Order.Date);o.setHours(0,0,0,0),t.ToP=this.generateTop(o,i),this.posData.Invoice.Due!==void 0&&(t.Due=this.datePipe.transform(new Date(this.posData.Invoice.Due),"dd MMMM yyyy"))}return t}generateQrContent(){let t="";if(this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.MiniPrintingType==3){let i=this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.Content,o=this.posData?.Order?.Number,l=this.completeData.ObjectID,v=window?.location?.host;switch(i){case 2:t=l;break;case 1:t=o;break;case 3:t=`receipt.dealpos.app?Data=${btoa(`${l}_${v}`)}`;break}}else t=this.posData?.Order?.Number;return t}generateShippingData(){return{City:this.posData.Shipping!==null?this.posData.Shipping.City:null,Description:this.posData.Shipping!==null?this.posData.Shipping.Address:null,ID:null,Phone:this.posData.Shipping!==null?this.posData.Shipping.Phone:null,Recipient:this.posData.Shipping!==null?this.posData.Shipping.Name:null,SalesOrderID:null,Sender:null,SenderAddress:null,SenderCity:null,SenderPhone:null,Street:null}}generateParkReceipt(t=!0,e=!1){let i=new vn;if(i.ExtraNote=S.StringFormat("{0} #{1}",this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.NumberPrefix,this.GetSubmittedNumber()),i.Title=this.getParkLabel(),i.Customer=this.getSubmitedCustomer(),i.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),i.InvoiceNote=this.posData.Invoice?.Note,i.Date=this.getSubmitedOrderDate(),i.CurrencySymbol=this._cashierCalculatorService.currencySymbol,this.getItemsParkReceipt(t,e),i.Items=this.CartItems,i.Creator=this.posStorage.UserName,i.NumberOfPerson=this.posData.Order.NumberOfPerson,this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.AmountVisible){let o=JSON.parse(JSON.stringify(this._receiptCalculatorService.generateAmountSummary()));i.AmountSummary=o}return i}getItemsParkReceipt(t,e){let i=Ie(Ne,this.posData.CartItems);if(e){let o=this.posData.CartItems.filter(l=>S.IsNotEmpty(l.SplitQuantity)&&l.SplitQuantity>0);this.CartItems=o.map(l=>(l.Quantity=l.SplitQuantity,l))}else if(t&&this.AppConfigJSON.ApplicationParkAndRetrieve.PrintBehaviour.PrintAdditionalItemsOnlyOnRePark)if(this.CartItems=Array(),this.ParkTemp.length>0)for(let o of i){let l=this.ParkTemp.find(v=>v.ID==o.ID);l==null?this.CartItems.push(o):o.Quantity!=l.Quantity&&(o.Quantity=o.Quantity-l.Quantity,this.CartItems.push(o))}else this.CartItems=i;else this.CartItems=i}generateBillInvoice(){let t=new bn;return t.ContactDisplay=this.posData.ContactName,t.Invoice=this.posData.Invoice,t.Order=this.posData.Order,t.Payments=this.posData.Payments,t.Shipping=this.posData.Shipping,t.CurrencySymbol=this._cashierCalculatorService.currencySymbol,t.FinalAmount=this._cashierCalculatorService.Data,t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t.Contact=this.getSubmitedCustomer(),t.Items=this.getItemsBillInvoice(),t.PrintTime=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm"),t.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.Invoice.Number=`#${this.posData.Order.Number}`,t.Invoice.Date=new Date,t.Invoice.PaymentStateID=1,t.Invoice.Note=this.posData.Invoice?.Note,t.PrintPerson="",t.IsPrice=!0,t.PriceVisible=!0,t}getItemsBillInvoice(){return this.posData.CartItems.map(e=>({Name:e.Variant.Name,Quantity:e.Quantity,Code:e.Variant.Code,UnitPrice:e.Price,Discount:e.Discount,UOMName:e.Variant.UOMName,Total:e.Total,Note:e.Note}))}generateBillReceipt(){let t=new Mi;t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.ParkLabel=this.posData.Order.ParkLabel,t.OutletName=this.outletInfo.EntityName,t.ExtraNote=this.getParkLabel(),t.Customer=this._customerHttpService.Data,t.SalesOrderItemCommission.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.Number=this.posData.Order.Number,t.FinalAmount=this._cashierCalculatorService.Data,t.InvoiceNote=this.posData.Invoice.Note,t.Date=this.datePipe.transform(this.posData.Order.Date,"dd MMM yyyy"),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoiceCreatedTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy")),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.OrderTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm:ss")),t.Items=this.posData.CartItems,t.Customer.ID=this.posData.Order.CustomerID,t.Customer.Name=this.posData.ContactName,t.Customer.Display=this.posData.ContactName,t.Customer.Mobile&&t.Customer.Mobile.length==1&&(t.Customer.Mobile=null),t.Delivery={Number:this.posData.Order.Number};let e=S.FilterByID(this.posStorage.PoTypes,this.posData.Order.TypeID);return e!==null&&(t.TypeName=e.Name),t.Shipping=this.generateShippingData(),this.AppConfigJSON.PrintConfigInvoice.ItemsTable.ItemWithoutPriceVisible||(t.Items=t.Items.filter(i=>i.Price!=0)),t.Coupon=this.posData.Order.PromotionCoupon,t.PaymentState=this.getPaymentState(),t.Payments=this.posData.Payments,t.Payments=t.Payments.map(i=>(i.MethodName=this.findPaymentName(i.MethodID),i)),t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t}getPaymentState(){let t=this.AppConfigJSON?.ModuleSell?.ToleranceAmount,e=this.posData.Payments,i=this.posData.TotalPaidAmount,o=this._cashierCalculatorService.Data,l=1;e?.length>0&&i<o&&(l=2);let v=i-o;return(Math.abs(v)<=t||v>=0)&&(l=3),l}generateTop(t,e){let i=new Date(e),o=new Date(t),l=i.getTime()-o.getTime();return Math.floor(l/(1e3*3600*24))}getSubmitedOrderDate(){let t=this.posData.Order?.Date,e=this.AppConfigJSON.PrintConfigInvoice?.DocumentVisibility?.OrderTimeVisible,i="",o=new Date;if(e){let l=new Date(t);l.setHours(o.getHours()),l.setMinutes(o.getMinutes()),i=this.datePipe.transform(l,"dd MMM yyyy HH:mm")}else i=this.datePipe.transform(t,"dd MMM yyyy");return i}getSubmitedCustomer(){return S.IsEmpty(this.completeData)?{}:this.completeData.Contact}getParkLabel(){let t=this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.LabelPrefix,e=this.AppConfigJSON.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias,i=this.posData.Order.ParkLabel;if(S.IsNotEmpty(this.posData.SplitParkLabel)&&(i=this.posData.SplitParkLabel),e&&S.IsNotEmpty(i)){let o=this.park.GetAlias(i);i=o||i}return i?S.IsEmpty(t)?i:S.StringFormat("{0} # {1}",t,i):""}GetSubmittedNumber(){return S.IsNotEmpty(this.completeData)?this.completeData.InvoiceNumber:this.posData.Invoice.Number?this.posData.Invoice.Number:this.posData.Order.Number}generateCartItemSummary(){let t=[];for(let e of this.posData.CartItems)t.push(new tn(e.Total,this._cashierCalculatorService.currencySymbol,e.Variant.Name,1));return t}generatePaymentSummary(){let t=[],e;for(let o=0;o<this.posData.Payments.length;o++){let l="Payment"+(o+1);this.AppConfigJSON.PrintConfigInvoice.Footer.PaymentMethodVisible&&(l=this.findPaymentName(Number(this.posData.Payments[o].MethodID))),e=new tn(this.posData.Payments[o].PaidAmount,this._cashierCalculatorService.currencySymbol,l,1),t.push(e)}let i=this.generateChangeSummary();return i!==null&&t.push(i),t}generateChangeSummary(){let t=this._cashierCalculatorService.currencySymbol,e=this._cashierCalculatorService.Data,i=this.posData.TotalPaidAmount,o=0,l=null;return o=i-e,o>0&&(l=new tn(o,t,"Change",1)),l}findPaymentName(t){return this._outletService.Data.Payments.find(e=>e.ID==t).Name}printWindow(){return wo(this,null,function*(){return new Promise(t=>{setTimeout(()=>{window.print(),t()},500)})})}static \u0275fac=function(e){return new(e||n)(N(j),N(A),N(Ce),N(q),N(Oe),N(nn),N(U),N(dt))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};var ke=class n{constructor(t,e,i,o,l,v,E,Q,Se,we){this.httpService=t;this.receiptService=e;this.orderProcessorService=i;this.pageInitialService=o;this.salesOrderService=l;this.toastrService=v;this.promotionEventService=E;this.outletService=Q;this.orderHttpService=Se;this.dialog=we;this._onPrint=new $,this.onPrint$=this._onPrint.asObservable(),this.subscribeToObservable()}_onPrint;onPrint$;parkOrderRetrieve;subscribeToObservable(){this.orderProcessorService.Data$.subscribe(t=>{(t.posState==3||t.posState==5)&&this.emitParkReceipt(!0,t.posState==5)})}getParkedOrder(t,e){return this.httpService.get(fe.GetPark,[{key:"EntityID",value:t},{key:"RegisterID",value:e}])}removeOrder(t,e){let i={OrderID:t};return e?this.httpService.post(fe.VoidPark,i):this.httpService.post(fe.RemovePark,i)}mergePark(t){return this.httpService.post(fe.MergePark,t)}getOutstanding(t){let e={EntityID:t};return this.httpService.post(fe.GetOutStanding,e)}splitOrder(t){return this.httpService.post(fe.SplitOrder,t)}park(t){let e=Ie(qe,this.salesOrderService.Data);if(this.promotionEventService.selectedPromotion){this.clearPromotionAppliedInPark();return}e.Action.Type=1,t.ParkLabel!=null&&(e.Order.ParkLabel=t.ParkLabel),e.Order.Note=t.Note,e.Order.InvoicedStateID=1,S.IsNotEmpty(t.ID)&&(e.Order.ID=t.ID),this.salesOrderService.pushNewValue(e);let i=this.orderHttpService.generatePOSDataForSubmission(e);return this.httpService.post(fe.ParkOrder,i).pipe(_e(o=>{this.orderProcessorService.updatePosState(3,o),this.orderProcessorService.createNewTransactionInSameOutletRegister(!0)}))}clearPromotionAppliedInPark(){this.dialog.open(ra,{id:"modal-promotion-confirm",data:{message:`
|
|
1
|
+
import{a as dn}from"./chunk-ZM64NIQG.js";import{a as Ca}from"./chunk-MOC2F2UJ.js";import{a as ho}from"./chunk-4AHX5CQ6.js";import{b as Sa,c as ya}from"./chunk-BEXSLV5X.js";import{a as Pa}from"./chunk-HBAQBI6Z.js";import{a as Ia}from"./chunk-VCWK6RX5.js";import{a as _a,b as ha}from"./chunk-KQK25QJL.js";import{a as xa,b as un}from"./chunk-RXYT5HJD.js";import{a as mn}from"./chunk-B5AIOOC2.js";import"./chunk-HYDOMSL4.js";import"./chunk-DAGMLKAT.js";import{a as pn}from"./chunk-LFZHNLN4.js";import{a as Di}from"./chunk-76NB5ZWF.js";import{a as va,b as ba}from"./chunk-D6VFY3ZB.js";import{a as Ft}from"./chunk-SOVLVO4L.js";import{a as Vr}from"./chunk-INDWZUXM.js";import{a as $i}from"./chunk-KVTHO5AJ.js";import{A as ln,B as wt,C as sa,D as li,E as pa,F as da,G as sn,H as ma,I as ua,J as cn,K as fa,L as ga,a as Jr,b as Kr,c as Xr,d as A,e as j,f as Ce,g as Zi,h as ia,i as Xi,j as na,k as oa,l as q,m as ra,n as aa,o as Mt,p as kt,q as me,r as ai,s as en,t as tn,u as nn,v as on,w as _o,x as rn,y as an,z as U}from"./chunk-OUJ3BECK.js";import{b as Ot,c as ce}from"./chunk-HPT2OI3Y.js";import"./chunk-ZOBPTHDY.js";import"./chunk-VU4DKVXW.js";import"./chunk-GGDW5WFA.js";import{b as Br,e as jr,f as Hr,g as Ur}from"./chunk-GOB3T42H.js";import{a as Yr,b as Zr}from"./chunk-NHDATDCF.js";import{c as Ki,d as Yi}from"./chunk-EC3IVRO5.js";import"./chunk-KMQJA2M5.js";import"./chunk-FCNGKCNJ.js";import"./chunk-DUBSPAA2.js";import"./chunk-I6BZSZXZ.js";import{a as ta}from"./chunk-5UX7NZFM.js";import{a as Wr}from"./chunk-GO3FYZZE.js";import{a as dt}from"./chunk-P3YW73WN.js";import"./chunk-P3KIIKY4.js";import"./chunk-D2UNYCWT.js";import"./chunk-RG65F34V.js";import{a as fo,b as qe,c as Pe,d as ea,e as Oe}from"./chunk-C5WPI7F3.js";import{a as Co}from"./chunk-46FATRR5.js";import{a as zr,b as qr,c as Gr,d as Ji}from"./chunk-IDRQUF52.js";import"./chunk-5UDUWK67.js";import"./chunk-NQX7EX5A.js";import{a as la,b as ca}from"./chunk-LBBDKTVE.js";import{a as Gi}from"./chunk-MUPPHGER.js";import{a as Qr,b as qi}from"./chunk-N4S7RUAZ.js";import{a as zi,b as Lr,c as Fr}from"./chunk-2QIQUFIR.js";import"./chunk-DYMB65KX.js";import{a as pt,b as go}from"./chunk-BO34ALRJ.js";import{a as tt}from"./chunk-54VUHDZ6.js";import{a as $r}from"./chunk-MQLMXL2E.js";import"./chunk-6KDTVFMW.js";import"./chunk-BYXBJQAS.js";import"./chunk-BYXBJQAS.js";import{c as Pi}from"./chunk-QIU4DALL.js";import{b as Ne}from"./chunk-Z3JTICHN.js";import"./chunk-Z3E24JZW.js";import{b as oi,c as Ie}from"./chunk-NSNUUKNK.js";import{a as Ii}from"./chunk-DDLXGCOB.js";import{a as Dt}from"./chunk-XGIQ7PXS.js";import"./chunk-YTZPBL5O.js";import{b as Wi,c as xt,d as It,e as ei}from"./chunk-DX6RJE57.js";import"./chunk-HT6DSP63.js";import{d as Ar}from"./chunk-OQMWV4LA.js";import{a as ri}from"./chunk-4VRCKWUY.js";import"./chunk-R3DFB5VD.js";import"./chunk-2D4XBF6C.js";import"./chunk-J63OB27M.js";import"./chunk-MPN57TB5.js";import"./chunk-KF3MHC66.js";import"./chunk-KBZZ7PX4.js";import"./chunk-ETGLCIRD.js";import{c as kr,d as wr}from"./chunk-WJGP2CLN.js";import"./chunk-2ZXCNSZZ.js";import{a as Cr}from"./chunk-M2AZOKFB.js";import{d as ni}from"./chunk-LMI6FIPG.js";import{a as _r}from"./chunk-4F45HHZT.js";import"./chunk-3S3T7QLT.js";import{c as dr}from"./chunk-4KO3X4S2.js";import"./chunk-BACG4SJJ.js";import"./chunk-CQTLBAQD.js";import{a as ct}from"./chunk-OFSPPASQ.js";import"./chunk-JFIKQKZJ.js";import"./chunk-N4NZWFKH.js";import{g as Rr,h as Nr}from"./chunk-NEHVZXIT.js";import{a as Tr,b as Er}from"./chunk-XULGDGRO.js";import"./chunk-43NB6BM4.js";import"./chunk-OVEGWW7W.js";import"./chunk-LL4377Z2.js";import"./chunk-GAOYV53E.js";import"./chunk-W6JPMHYE.js";import{a as mr,d as ur,f as fr}from"./chunk-BXA2JYKG.js";import{a as Dr}from"./chunk-TULCQM7T.js";import{a as gr}from"./chunk-HNHLGX7F.js";import{a as hr}from"./chunk-47ZVBGMF.js";import"./chunk-FVUFPTGH.js";import{a as pr}from"./chunk-LXFJ7QGK.js";import{a as Or,b as Mr}from"./chunk-PNLXUMV2.js";import{b as Pr,c as et,e as ii,f as Pt}from"./chunk-UTNV2WKT.js";import"./chunk-G7E24J2R.js";import"./chunk-VYA2NFJ5.js";import"./chunk-SH55PTEY.js";import"./chunk-VPS35GPI.js";import"./chunk-UGBMCXS6.js";import{a as se,b as Xe}from"./chunk-5TTXT2K2.js";import"./chunk-YNQPX5G6.js";import{F as Ir,N as ti,O as fe,a as vr,b as br,n as Qi,t as Sr,u as yr,x as xr}from"./chunk-3NJAM5KX.js";import{a as tr}from"./chunk-JFJPOKIM.js";import"./chunk-QYSFCWV7.js";import{d as Ct}from"./chunk-IEJVBN5K.js";import"./chunk-OVPEADWW.js";import{a as L,b as ge,c as oe}from"./chunk-BQPO535K.js";import"./chunk-HLLBCLO6.js";import"./chunk-4P6SOZDY.js";import"./chunk-XN7T54IM.js";import"./chunk-RULWGB4E.js";import"./chunk-2HIDUY57.js";import{a as Re,b as B,c as V}from"./chunk-U5Y75IZ5.js";import"./chunk-HY3IUHOC.js";import"./chunk-4AEX2WLA.js";import"./chunk-2MELUOYA.js";import"./chunk-WOPE6PPO.js";import{C as sr,E as be,F as Ze,a as ir,b as Yt,c as X,d as nr,e as xi,g as or,h as z,j as rr,l as bt,m as ar,o as ne,r as lr,s as St,z as Zt}from"./chunk-MDIMQ3H3.js";import{a as Kt,c as Xt}from"./chunk-ZDNMAMQF.js";import{a as cr}from"./chunk-ZM4ZKNXC.js";import"./chunk-MWDJTJ3O.js";import{b as yt}from"./chunk-7CQSSHSC.js";import{a as S}from"./chunk-3DEA4WWC.js";import{a as er}from"./chunk-QCO7EW4N.js";import{n as K,q as Be}from"./chunk-TKVDP62Z.js";import{A as Ro,Aa as Lo,Ad as Z,Bb as u,Bc as st,Ca as Ue,Cc as Ke,Db as f,Dc as T,Dd as Yo,Eb as Vt,Ec as he,F as ae,Fa as R,Fb as de,Fc as yi,Gb as te,Hb as ie,Ib as d,J as vi,Ja as Fo,Jb as r,Kb as a,Kc as b,Lb as h,Lc as I,Mb as ft,Mc as ee,N as No,Nb as lt,Nc as Le,O as Ht,Pb as We,Qb as Qe,Qc as gt,Qd as Zo,Rb as Lt,Sa as Qt,Sd as Xo,Tc as uo,Ua as rt,Ub as y,Ud as vt,Vd as Gt,Xa as ut,Xb as g,Xd as Jt,Yb as mo,Yc as Fi,Z as Ut,Za as s,Zb as c,Zc as Jo,ba as Te,bc as Ve,c as To,cc as ye,d as $,db as Bo,dc as xe,dd as Ko,e as po,ea as w,eb as m,fc as Wo,ga as _e,gc as Qo,hc as He,ib as P,ic as $o,jb as $t,jc as bi,k as Eo,kb as jo,lc as le,ma as Ao,mc as p,na as Je,nb as Vi,nc as D,nd as J,o as At,oa as Wt,ob as G,oc as x,pc as Ee,pd as Bi,qa as N,qc as zo,qd as qt,ra as H,rc as O,rd as ji,sc as M,sd as Hi,tc as k,td as Ye,u as Ge,uc as Li,v as Ai,va as C,vc as qo,vd as Fe,wa as _,wb as Ho,wc as Go,xb as Uo,xc as Si,xd as Y,yc as zt,za as Vo,zd as Ui}from"./chunk-GJDGQISV.js";import"./chunk-WFMAM73Y.js";import{k as wo}from"./chunk-SNAKHGZS.js";var fn=class{ID;Code;Name;Title;Field;Address;ContactInfo;Logo;FooterLeft;FooterRight;FooterNote;PrintMode;PrintLX300;DeliveryNote;AppendQR;ItemRenderMode;CssClass;RemoveImage;DisplayName;DisplayNameCode};var si=class{ParkLabel;Note;NumberOfPerson;ID;Alias;Created;CustomerDisplay;Number;Duration};var gn=class n{constructor(t,e,i,o,l,v){this.dialogRef=t;this._orderProcessorService=e;this._posService=i;this.salesOrderService=o;this.parkService=l;this.data=v;this.initModalDialog(),this.initConfig(),this.parkLabel=v.ParkLabel,this.form.ParkLabel=v.ParkLabel,this.form.Note=o.Data.Order.Note}modalConfig=new B;labelPlaceholder;form=new si;parkLabel;initConfig(){let t=this._posService.Data.AppConfigJSON;this.labelPlaceholder=t.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkLabelPlaceholder}initModalDialog(){this.modalConfig.title=this.data.title,this.modalConfig.customWidth="600px"}onOk(){this.setParkTitle(),this.parkService.park(this.form).subscribe(t=>{this.dialogRef.close(!0)})}setParkTitle(){let t=this._orderProcessorService.Data.posState,e=this.salesOrderService.Data.Order.Number;t==5?this.salesOrderService.Data.SplitParkLabel=S.IsEmpty(this.parkLabel)?e:this.parkLabel:S.IsEmpty(this.parkLabel)?this.form.ParkLabel=e:this.form.ParkLabel=this.parkLabel}static \u0275fac=function(e){return new(e||n)(m(L),m(U),m(j),m(A),m(ke),m(ge))};static \u0275cmp=P({type:n,selectors:[["POS-modal-park-input"]],standalone:!1,decls:17,vars:3,consts:[[3,"onCancel","onOk","onClose","config"],[1,"ods-info-box"],[1,"fas","fa-info-circle",2,"font-size","1.2rem","margin-top","2px"],["href","https://ods.dealpos.app","target","_blank",2,"color","#0d6efd","font-weight","600","text-decoration","underline"],[1,"w-100","mt-4"],[1,"mb-3"],["type","text","required","","placeholder","E.g. Mr. John Doe","matTooltip","Same as Order Number when blank",1,"form-control","w-100","height-input",3,"ngModelChange","ngModel"],["placeholder","ex: Customer will return tommorow",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(r(0,"modal-material",0),g("onCancel",function(){return i.dialogRef.close()})("onOk",function(){return i.onOk()})("onClose",function(){return i.dialogRef.close()}),r(1,"content")(2,"div",1),h(3,"i",2),r(4,"div"),p(5," Use our "),r(6,"a",3),p(7," Order Display Fulfillment System "),a(),p(8," to view the Parked Orders from your warehouse area. "),a()(),r(9,"div",4)(10,"strong",5),p(11,"Label"),a(),r(12,"input",6),k("ngModelChange",function(l){return M(i.parkLabel,l)||(i.parkLabel=l),l}),a()(),r(13,"div",4)(14,"strong",5),p(15,"Note"),a(),r(16,"POS-tinymce-editor",7),k("ngModelChange",function(l){return M(i.form.Note,l)||(i.form.Note=l),l}),a()()()()),e&2&&(d("config",i.modalConfig),s(12),O("ngModel",i.parkLabel),s(4),O("ngModel",i.form.Note))},dependencies:[X,z,Zt,ne,V,se,tt],styles:[".height-input[_ngcontent-%COMP%]{height:36px} ng-select.park-detail>div.ng-select-container{border-radius:0!important}.deposit[_ngcontent-%COMP%] .ng-select{width:auto!important}.ods-info-box[_ngcontent-%COMP%]{background-color:#e8f4fd;border-left:4px solid #0dcaf0;padding:16px 20px;border-radius:8px;font-family:Roboto Slab,sans-serif;color:#055160;display:flex;align-items:flex-start;gap:10px;font-size:14px;max-width:600px;margin:0 auto}"]})};var Cn=class n{constructor(t){this._dialogRef=t;this.modalConfig=new B,this.modalConfig.title="Select Print Type",this.modalConfig.hideFooter=!0}modalConfig;onPrintOrder(){this._dialogRef.close("ORDER")}onPrintBill(){this._dialogRef.close("BILL")}static \u0275fac=function(e){return new(e||n)(m(L))};static \u0275cmp=P({type:n,selectors:[["POS-modal-print"]],standalone:!1,decls:17,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"d-flex"],[1,"btn","btn-gray","btn-lg","me-1",3,"click"],["src","https://cdn.dealpos.xyz/web-image/order.png"],[1,"mt-1"],[1,"mt-0"],[1,"btn","btn-gray","btn-lg","ms-1",3,"click"],["src","https://cdn.dealpos.xyz/web-image/bill.png",2,"width","23px"]],template:function(e,i){e&1&&(r(0,"modal-material",0),g("onCancel",function(){return i._dialogRef.close()})("onClose",function(){return i._dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),g("click",function(){return i.onPrintOrder()}),h(4,"img",3),r(5,"h4",4),p(6,"Order"),a(),r(7,"div",5),p(8,"For order for the kitchen"),a()(),r(9,"a",6),g("click",function(){return i.onPrintBill()}),h(10,"img",7),r(11,"h4",4),p(12,"Bill"),a(),r(13,"div",5),p(14,"To see amount of the bill"),a(),r(15,"div",5),p(16,"(Pre-settlement bill)"),a()()()()()),e&2&&d("config",i.modalConfig)},dependencies:[V],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #D6D6D6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}.btn[_ngcontent-%COMP%]{padding:8px 0;width:190px;margin-right:10px}.btn[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:700;text-transform:uppercase}.btn[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{font-size:.75rem;font-style:italic;color:#868686;margin-top:10px}"]})};var Za=n=>({"mat-tab-group-height":n});function Xa(n,t){if(n&1){let e=y();r(0,"div",2)(1,"div",6)(2,"span",7),h(3,"i",8),a(),r(4,"input",9),k("ngModelChange",function(o){C(e);let l=c();return M(l.filter,o)||(l.filter=o),_(o)}),a()()()}if(n&2){let e=c();s(4),O("ngModel",e.filter)}}function el(n,t){if(n&1&&(r(0,"h5",14),h(1,"i"),r(2,"span"),p(3),a()()),n&2){let e=c().$implicit;s(),le(e.Icon),s(2),D(e.Name)}}function tl(n,t){if(n&1){let e=y();r(0,"div",13)(1,"park-card",15),g("onSelect",function(){let o=C(e).$implicit,l=c(2);return _(l.onSelect(o))}),a()()}if(n&2){let e,i=t.$implicit,o=c().$implicit,l=c();s(),d("title",l.replaceWithAlias()&&i.Alias?i.Alias:i.Name)("alias",i.Alias)("isOccupied",i.IsOccupied)("icon",o.Icon)("selected",((e=l.parkOptionSelected())==null?null:e.Name)===i.Name)}}function il(n,t){if(n&1&&(r(0,"mat-tab",4),G(1,el,4,3,"ng-template",10),r(2,"div",11)(3,"div",12),te(4,tl,2,5,"div",13,Vt),b(6,"Filter"),a()()()),n&2){let e=t.$implicit,i=c();d("label",e.Name),s(4),ie(Le(6,1,e.Options,i.filter(),"Name"))}}function nl(n,t){if(n&1){let e=y();r(0,"div",5)(1,"POS-tinymce-editor",16),k("ngModelChange",function(o){C(e);let l=c();return M(l.parkNote,o)||(l.parkNote=o),_(o)}),a()()}if(n&2){let e=c();s(),O("ngModel",e.parkNote)}}var pi=class n{constructor(t){this.data=t;this.parkLayout.set(t.parkLayoutPack),this.replaceWithAlias.set(t.replaceWithAlias),this.initModalConfig(),this.showInputNote.set(this.posService.Data?.AppConfigJSON?.ApplicationParkAndRetrieve?.NumberOfPerson),this.parkNote.set(t.orderNote||"")}dialogRef=H(L);posService=H(j);modalConfig=new B;filter=R("");parkLayout=R(null);parkOptionSelected=R(null);replaceWithAlias=R(!1);showInputNote=R(!1);parkNote=R("");initModalConfig(){this.modalConfig.title=this.data.title||"Park Order",this.modalConfig.customWidth="700px",this.modalConfig.bodyScrollable=!0,this.modalConfig.okText=" Park "}onSelect(t){this.parkOptionSelected.set(t)}onOk(){this.showInputNote()&&(this.parkOptionSelected().Note=this.parkNote()),this.dialogRef.close(this.parkOptionSelected())}onCancel(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||n)(m(ge))};static \u0275cmp=P({type:n,selectors:[["app-modal-park"]],decls:8,vars:6,consts:[[3,"keydown.F2","onOk","onCancel","onClose","config"],[1,"container",2,"max-height","395px","min-height","395px"],[1,"search-container"],["mat-stretch-tabs","false",1,"mt-2",3,"ngClass"],[3,"label"],[1,"mt-4"],[1,"input-group","w-100"],[1,"input-group-text","txtFilter","rounded-start-1"],["aria-hidden","true",1,"fa","fa-magnifying-glass"],["type","text","placeholder","Search by number or note","aria-label","Search",1,"txtFilter","form-control","border-start-0","rounded","rounded-start-0",3,"ngModelChange","ngModel"],["mat-tab-label",""],[1,"container","mt-5"],[1,"row"],[1,"col-3","mb-4","px-2"],[1,"d-flex","align-items-center","gap-3"],[3,"onSelect","title","alias","isOccupied","icon","selected"],["height","180px","placeholder","Input the park note (E.g. this is for Mr. John)",3,"ngModelChange","ngModel"]],template:function(e,i){if(e&1&&(r(0,"modal-material",0),g("keydown.F2",function(){return i.onOk()})("onOk",function(){return i.onOk()})("onCancel",function(){return i.onCancel()})("onClose",function(){return i.onCancel()}),r(1,"content")(2,"div",1),u(3,Xa,5,1,"div",2),r(4,"mat-tab-group",3),te(5,il,7,5,"mat-tab",4,Vt),a(),u(7,nl,2,1,"div",5),a()()()),e&2){let o,l,v;d("config",i.modalConfig),s(3),f(((o=i.parkLayout().Layout)==null?null:o.length)>0?3:-1),s(),d("ngClass",T(4,Za,i.showInputNote()&&((l=i.parkOptionSelected())==null?null:l.Name))),s(),ie(i.parkLayout().Layout),s(2),f(i.showInputNote()&&((v=i.parkOptionSelected())!=null&&v.Name)?7:-1)}},dependencies:[Z,J,V,Ca,ti,be,X,z,ne,ei,Wi,xt,It,tt,yr],styles:["[_nghost-%COMP%] .mat-mdc-tab-group[_ngcontent-%COMP%]{--mat-tab-active-indicator-color: #89b03e;--mat-tab-focus-indicator-color: #89b03e;--mat-tab-focus-label-text-color: var(--bs-body-color);--mat-tab-active-label-text-color: var(--bs-body-color);--mat-tab-active-focus-label-text-color: var(--bs-body-color);--mat-tab-active-hover-label-text-color: var(--bs-body-color);--mat-tab-active-focus-indicator-color: #89b03e;--mat-tab-active-hover-indicator-color: #89b03e}[_nghost-%COMP%] .mat-mdc-tab-header{border-bottom:1px solid var(--bs-border-color)}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%]{transition:all .3s ease}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{position:relative;transition:all .3s ease;height:2.3rem}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e4d,0 0 8px 4px #89b03e33;border-radius:4px}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]{transition:all .3s ease;border-left:none!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]:focus{box-shadow:none!important;border-color:#ced4da!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .input-group-text[_ngcontent-%COMP%]{transition:all .3s ease;background-color:#fff;border-right:none!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .input-group-text[_ngcontent-%COMP%], [_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .input-group-text[_ngcontent-%COMP%]{background-color:#89b03e1a;border-color:#84cc16!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .fa-magnifying-glass[_ngcontent-%COMP%]{transition:all .3s ease}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .fa-magnifying-glass[_ngcontent-%COMP%], [_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .fa-magnifying-glass[_ngcontent-%COMP%]{color:#84cc16!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e66,0 0 12px 6px #89b03e40!important}[_nghost-%COMP%] .mat-tab-group-height[_ngcontent-%COMP%]{height:165px}"]})};var _n=class n{constructor(t,e,i,o,l,v,E,Q,Se){this.dialogRef=t;this.parkOrderRetrieve=e;this._orderDataService=i;this._posHttpResponseService=o;this._orderProcessorService=l;this._orderHttpService=v;this._dialog=E;this._outletRegisterService=Q;this.parkService=Se;this.salesOrderData=this._orderDataService.Data,this.appConfig=this._posHttpResponseService.Data.AppConfigJSON,this.parkLayoutPack=this._outletRegisterService.Data.ParkLayoutPack}modalConfig=new B;salesOrderData;appConfig;parkLayoutPack;ngOnInit(){this.modalConfig.title="Re-Park Order?",this.modalConfig.hideFooter=!0}onRepark(){this.parkService.park(this.parkOrderRetrieve).subscribe(t=>{this.dialogRef.close()})}onMove(){this.dialogRef.close(),this.showParkSelectModal()}showParkSelectModal(){this._orderHttpService.getVacant(this.salesOrderData.Order.EntityID).subscribe(t=>{this._dialog.open(pi,{data:{title:this.title,parkLayoutPack:this.parkLayoutPack,replaceWithAlias:this.appConfig.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias,orderNote:this.salesOrderData?.Order?.Note}})})}get title(){return this._orderProcessorService.Data.posState==5?"Split Order":this.appConfig.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkDialogTitle}static \u0275fac=function(e){return new(e||n)(m(L),m(ge),m(A),m(j),m(U),m(Oe),m(oe),m(q),m(ke))};static \u0275cmp=P({type:n,selectors:[["POS-modal-repark"]],standalone:!1,decls:13,vars:2,consts:[[3,"onClose","onCancel","title","config"],[1,"d-flex"],[1,"btn","btn-gray","btn-lg",3,"click"]],template:function(e,i){e&1&&(r(0,"modal-material",0),g("onClose",function(){return i.dialogRef.close()})("onCancel",function(){return i.dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),g("click",function(){return i.onRepark()}),r(4,"h4"),p(5,"Re-Park"),a(),r(6,"span"),p(7,"Store order to same location"),a()(),r(8,"a",2),g("click",function(){return i.onMove()}),r(9,"h4"),p(10,"Move"),a(),r(11,"span"),p(12,"Shift order to Different location"),a()()()()()),e&2&&d("title","Re-Park Order?")("config",i.modalConfig)},dependencies:[V],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #D6D6D6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}.btn[_ngcontent-%COMP%]{padding:25px 0;width:190px;margin-right:10px}.btn[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:700;text-transform:uppercase}.btn[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.75rem;font-style:italic;color:#868686;margin-top:10px}"]})};var hn=class{_point;get point(){return this._point}set point(t){this._point=t}_pricebookID;get pricebookID(){return this._pricebookID}set pricebookID(t){this._pricebookID=t}_discountRate;get discountRate(){return this._discountRate}set discountRate(t){this._discountRate=t}_groups;get groups(){return this._groups}set groups(t){this._groups=t}_salesID;get salesID(){return this._salesID}set salesID(t){this._salesID=t}_dueDays;get dueDays(){return this._dueDays}set dueDays(t){this._dueDays=t}_expiryDate;get expiryDate(){return this._expiryDate}set expiryDate(t){this._expiryDate=t}_debt;get debt(){return this._debt}set debt(t){this._debt=t}_expirtedString;get expirtedString(){return this._expirtedString}set expirtedString(t){this._expirtedString=t}_loyaltyDisabled;get loyaltyDisabled(){return this._loyaltyDisabled}set loyaltyDisabled(t){this._loyaltyDisabled=t}_taxTypeID;get taxTypeID(){return this._taxTypeID}set taxTypeID(t){this._taxTypeID=t}_entityID;get entityID(){return this._entityID}set entityID(t){this._entityID=t}_mobile;get mobile(){return this._mobile}set mobile(t){this._mobile=t}_email;get email(){return this._email}set email(t){this._email=t}_dueMonths;get dueMonths(){return this._dueMonths}set dueMonths(t){this._dueMonths=t}_memberIdentification;get memberIdentification(){return this._memberIdentification}set memberIdentification(t){this._memberIdentification=t}};var Mi=class{OutletName;Status;AmountSummary;Coupon;Creator;CurrencySymbol;Customer;Date;Delivery;ExtraNote;FinalAmount;InvoiceNote;Items;LoyaltyPoint;Payments;PrintDate;RegisterCode;SalesOrderItemCommission;Shipping;Title;TypeName;PaymentState;ToP;Due;Gopay;Number;Created;SalesName;ParkLabel;HeaderTitle;QRContent;Retur;ID;AfterSell;constructor(){this.OutletName="",this.Status=1,this.AmountSummary=[],this.Coupon="",this.Creator="",this.CurrencySymbol="",this.Customer=new hn,this.Date="",this.Delivery={Number:""},this.ExtraNote="",this.FinalAmount=0,this.InvoiceNote="",this.Items=[],this.LoyaltyPoint="",this.Payments=[],this.PrintDate="",this.RegisterCode="",this.SalesOrderItemCommission={SalesName:""},this.Shipping=new Pi,this.Title="",this.TypeName="",this.PaymentState=0,this.Number="",this.Created="",this.AfterSell=!0}};var di=class{LayoutPack;constructor(t){this.LayoutPack=t,this.GenerateLayoutOption()}GenerateLayoutOption(){this.LayoutPack!=null&&this.LayoutPack.Layout&&this.LayoutPack.Layout.forEach(t=>{t.Options=[];for(let e=1;e<=t.Size;e++){let i=new pn;i.Name=t.Name+e,i.Alias=this.GetAlias(i.Name),t.Options.push(i)}})}GetAlias(t){if(this.LayoutPack!=null&&this.LayoutPack.Alias){let e=this.LayoutPack.Alias.filter(i=>i.Name==t);return e.length>0?e[0].Alias:t}return""}};var vn=class{ExtraNote;Title;Customer;SalesName;InvoiceNote;Date;Items;AmountSummary;Creator;NumberOfPerson;CurrencySymbol;constructor(){this.ExtraNote="",this.Title="",this.Customer="",this.SalesName="",this.InvoiceNote="",this.Date="",this.Items=[],this.AmountSummary=[],this.Creator="",this.NumberOfPerson=0,this.CurrencySymbol="Rp"}};var bn=class{AmountSummary;Contact;ContactDisplay;CurrencySymbol;FinalAmount;HeaderTitle;Invoice;IsPrice;Items;LoyaltyPoint;Order;Payments;PriceVisible;PrintPerson;PrintTime;SalesName;Shipping;TotalInWord};var Et=class n{constructor(t,e,i,o,l,v,E,Q){this._posService=t;this._orderDataService=e;this._cashierCalculatorService=i;this._outletService=o;this._OrderHttpService=l;this._receiptCalculatorService=v;this._orderProcessorService=E;this._customerHttpService=Q;this.subscribeToObservableChanges()}posData;completeData;park=new di(null);outletInfo=new Zi;datePipe=new Fe("en-US");ParkTemp=Array();CartItems=[];get posStorage(){return this._posService.Data}get AppConfigJSON(){return this._posService.Data.AppConfigJSON}subscribeToObservableChanges(){this._orderDataService.Data$.subscribe(t=>{this.posData=t}),this._OrderHttpService.Data$.subscribe(t=>{this.completeData=t}),this._outletService.Data$.subscribe(t=>{this.outletInfo=t}),this._orderProcessorService.Data$.subscribe(t=>{this.ParkTemp=t.parkTemporaryItem})}generateReceiptMini(){let t=new Mi;t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.OutletName=this.outletInfo.EntityName,t.ExtraNote=this.getParkLabel(),t.Customer=this.getSubmitedCustomer(),t.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.SalesOrderItemCommission={SalesName:this._outletService.getSalesname(this.posData.Order.SalesID)},t.Number=this.completeData?.InvoiceNumber,t.FinalAmount=this.completeData?.Final,t.InvoiceNote=this.posData.Invoice?.Note,t.RegisterCode=this.outletInfo.RegisterCode==null?"":this.outletInfo.RegisterCode,t.QRContent=this.generateQrContent(),t.ID=this.completeData?.ObjectID,t.Retur=S.IsNotEmpty(this.posData?.Invoice?.ReferenceInvoiceID),t.Date=this.getSubmitedOrderDate(),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoiceCreatedTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy")),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.OrderTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm")),t.PrintDate=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm")||"",this.posData.CartItems.forEach(i=>{i.SalesID&&(i.SalesName=this._outletService.getSalesname(i.SalesID))}),t.Items=this.posData.CartItems,t.Customer!=null&&t.Customer.Display!=null&&t.Customer.Display!=null&&t.Customer.Display!=null&&(t.Customer={ID:this.posData.Order.CustomerID,Display:this.posData.ContactName,Email:t.Customer.Email,CityName:null,Address:t.Customer.Address,Code:t.Customer.Code,Name:t.Customer.Name,Phone:t.Customer.Phone,Mobile:t.Customer.Mobile,NationalIDNumber:t.Customer.NationalIDNumber,Title:t.Customer.Title}),t.Delivery={Number:this.posData.Order.Number};let e=S.FilterByID(this.posStorage.PoTypes,this.posData.Order.TypeID);if(e!==null&&(t.TypeName=e.Name),t.Shipping=this.generateShippingData(),this.AppConfigJSON.PrintConfigInvoice.ItemsTable.ItemWithoutPriceVisible||(t.Items=t.Items.filter(i=>i.Price!=0)),t.Coupon=this.posData.Order.PromotionCoupon,t.LoyaltyPoint=this.completeData?this.completeData.LoyaltyPoint:"",t.FinalAmount=this._cashierCalculatorService.Data,t.CurrencySymbol=this._cashierCalculatorService.currencySymbol,t.PaymentState=this.getPaymentState(),t.Payments=this.posData.Payments,t.Payments.forEach(i=>{i.MethodName=this.findPaymentName(i.MethodID)}),t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t.Creator=this.completeData?.Creator?this.completeData?.Creator:this.posStorage?.UserName,this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoicePaymentTermsVisible&&this.posData.Payments.length==0){let i=this.posData.Invoice.Due?new Date(this.posData.Invoice.Due):null,o=new Date(this.posData.Order.Date);o.setHours(0,0,0,0),t.ToP=this.generateTop(o,i),this.posData.Invoice.Due!==void 0&&(t.Due=this.datePipe.transform(new Date(this.posData.Invoice.Due),"dd MMMM yyyy"))}return t}generateQrContent(){let t="";if(this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.MiniPrintingType==3){let i=this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.Content,o=this.posData?.Order?.Number,l=this.completeData.ObjectID,v=window?.location?.host;switch(i){case 2:t=l;break;case 1:t=o;break;case 3:t=`receipt.dealpos.app?Data=${btoa(`${l}_${v}`)}`;break}}else t=this.posData?.Order?.Number;return t}generateShippingData(){return{City:this.posData.Shipping!==null?this.posData.Shipping.City:null,Description:this.posData.Shipping!==null?this.posData.Shipping.Address:null,ID:null,Phone:this.posData.Shipping!==null?this.posData.Shipping.Phone:null,Recipient:this.posData.Shipping!==null?this.posData.Shipping.Name:null,SalesOrderID:null,Sender:null,SenderAddress:null,SenderCity:null,SenderPhone:null,Street:null}}generateParkReceipt(t=!0,e=!1){let i=new vn;if(i.ExtraNote=S.StringFormat("{0} #{1}",this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.NumberPrefix,this.GetSubmittedNumber()),i.Title=this.getParkLabel(),i.Customer=this.getSubmitedCustomer(),i.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),i.InvoiceNote=this.posData.Invoice?.Note,i.Date=this.getSubmitedOrderDate(),i.CurrencySymbol=this._cashierCalculatorService.currencySymbol,this.getItemsParkReceipt(t,e),i.Items=this.CartItems,i.Creator=this.posStorage.UserName,i.NumberOfPerson=this.posData.Order.NumberOfPerson,this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.AmountVisible){let o=JSON.parse(JSON.stringify(this._receiptCalculatorService.generateAmountSummary()));i.AmountSummary=o}return i}getItemsParkReceipt(t,e){let i=Ie(Ne,this.posData.CartItems);if(e){let o=this.posData.CartItems.filter(l=>S.IsNotEmpty(l.SplitQuantity)&&l.SplitQuantity>0);this.CartItems=o.map(l=>(l.Quantity=l.SplitQuantity,l))}else if(t&&this.AppConfigJSON.ApplicationParkAndRetrieve.PrintBehaviour.PrintAdditionalItemsOnlyOnRePark)if(this.CartItems=Array(),this.ParkTemp.length>0)for(let o of i){let l=this.ParkTemp.find(v=>v.ID==o.ID);l==null?this.CartItems.push(o):o.Quantity!=l.Quantity&&(o.Quantity=o.Quantity-l.Quantity,this.CartItems.push(o))}else this.CartItems=i;else this.CartItems=i}generateBillInvoice(){let t=new bn;return t.ContactDisplay=this.posData.ContactName,t.Invoice=this.posData.Invoice,t.Order=this.posData.Order,t.Payments=this.posData.Payments,t.Shipping=this.posData.Shipping,t.CurrencySymbol=this._cashierCalculatorService.currencySymbol,t.FinalAmount=this._cashierCalculatorService.Data,t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t.Contact=this.getSubmitedCustomer(),t.Items=this.getItemsBillInvoice(),t.PrintTime=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm"),t.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.Invoice.Number=`#${this.posData.Order.Number}`,t.Invoice.Date=new Date,t.Invoice.PaymentStateID=1,t.Invoice.Note=this.posData.Invoice?.Note,t.PrintPerson="",t.IsPrice=!0,t.PriceVisible=!0,t}getItemsBillInvoice(){return this.posData.CartItems.map(e=>({Name:e.Variant.Name,Quantity:e.Quantity,Code:e.Variant.Code,UnitPrice:e.Price,Discount:e.Discount,UOMName:e.Variant.UOMName,Total:e.Total,Note:e.Note}))}generateBillReceipt(){let t=new Mi;t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.ParkLabel=this.posData.Order.ParkLabel,t.OutletName=this.outletInfo.EntityName,t.ExtraNote=this.getParkLabel(),t.Customer=this._customerHttpService.Data,t.SalesOrderItemCommission.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.Number=this.posData.Order.Number,t.FinalAmount=this._cashierCalculatorService.Data,t.InvoiceNote=this.posData.Invoice.Note,t.Date=this.datePipe.transform(this.posData.Order.Date,"dd MMM yyyy"),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoiceCreatedTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy")),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.OrderTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm:ss")),t.Items=this.posData.CartItems,t.Customer.ID=this.posData.Order.CustomerID,t.Customer.Name=this.posData.ContactName,t.Customer.Display=this.posData.ContactName,t.Customer.Mobile&&t.Customer.Mobile.length==1&&(t.Customer.Mobile=null),t.Delivery={Number:this.posData.Order.Number};let e=S.FilterByID(this.posStorage.PoTypes,this.posData.Order.TypeID);return e!==null&&(t.TypeName=e.Name),t.Shipping=this.generateShippingData(),this.AppConfigJSON.PrintConfigInvoice.ItemsTable.ItemWithoutPriceVisible||(t.Items=t.Items.filter(i=>i.Price!=0)),t.Coupon=this.posData.Order.PromotionCoupon,t.PaymentState=this.getPaymentState(),t.Payments=this.posData.Payments,t.Payments=t.Payments.map(i=>(i.MethodName=this.findPaymentName(i.MethodID),i)),t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t}getPaymentState(){let t=this.AppConfigJSON?.ModuleSell?.ToleranceAmount,e=this.posData.Payments,i=this.posData.TotalPaidAmount,o=this._cashierCalculatorService.Data,l=1;e?.length>0&&i<o&&(l=2);let v=i-o;return(Math.abs(v)<=t||v>=0)&&(l=3),l}generateTop(t,e){let i=new Date(e),o=new Date(t),l=i.getTime()-o.getTime();return Math.floor(l/(1e3*3600*24))}getSubmitedOrderDate(){let t=this.posData.Order?.Date,e=this.AppConfigJSON.PrintConfigInvoice?.DocumentVisibility?.OrderTimeVisible,i="",o=new Date;if(e){let l=new Date(t);l.setHours(o.getHours()),l.setMinutes(o.getMinutes()),i=this.datePipe.transform(l,"dd MMM yyyy HH:mm")}else i=this.datePipe.transform(t,"dd MMM yyyy");return i}getSubmitedCustomer(){return S.IsEmpty(this.completeData)?{}:this.completeData.Contact}getParkLabel(){let t=this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.LabelPrefix,e=this.AppConfigJSON.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias,i=this.posData.Order.ParkLabel;if(S.IsNotEmpty(this.posData.SplitParkLabel)&&(i=this.posData.SplitParkLabel),e&&S.IsNotEmpty(i)){let o=this.park.GetAlias(i);i=o||i}return i?S.IsEmpty(t)?i:S.StringFormat("{0} # {1}",t,i):""}GetSubmittedNumber(){return S.IsNotEmpty(this.completeData)?this.completeData.InvoiceNumber:this.posData.Invoice.Number?this.posData.Invoice.Number:this.posData.Order.Number}generateCartItemSummary(){let t=[];for(let e of this.posData.CartItems)t.push(new tn(e.Total,this._cashierCalculatorService.currencySymbol,e.Variant.Name,1));return t}generatePaymentSummary(){let t=[],e;for(let o=0;o<this.posData.Payments.length;o++){let l="Payment"+(o+1);this.AppConfigJSON.PrintConfigInvoice.Footer.PaymentMethodVisible&&(l=this.findPaymentName(Number(this.posData.Payments[o].MethodID))),e=new tn(this.posData.Payments[o].PaidAmount,this._cashierCalculatorService.currencySymbol,l,1),t.push(e)}let i=this.generateChangeSummary();return i!==null&&t.push(i),t}generateChangeSummary(){let t=this._cashierCalculatorService.currencySymbol,e=this._cashierCalculatorService.Data,i=this.posData.TotalPaidAmount,o=0,l=null;return o=i-e,o>0&&(l=new tn(o,t,"Change",1)),l}findPaymentName(t){return this._outletService.Data.Payments.find(e=>e.ID==t).Name}printWindow(){return wo(this,null,function*(){return new Promise(t=>{setTimeout(()=>{window.print(),t()},500)})})}static \u0275fac=function(e){return new(e||n)(N(j),N(A),N(Ce),N(q),N(Oe),N(nn),N(U),N(dt))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};var ke=class n{constructor(t,e,i,o,l,v,E,Q,Se,we){this.httpService=t;this.receiptService=e;this.orderProcessorService=i;this.pageInitialService=o;this.salesOrderService=l;this.toastrService=v;this.promotionEventService=E;this.outletService=Q;this.orderHttpService=Se;this.dialog=we;this._onPrint=new $,this.onPrint$=this._onPrint.asObservable(),this.subscribeToObservable()}_onPrint;onPrint$;parkOrderRetrieve;subscribeToObservable(){this.orderProcessorService.Data$.subscribe(t=>{(t.posState==3||t.posState==5)&&this.emitParkReceipt(!0,t.posState==5)})}getParkedOrder(t,e){return this.httpService.get(fe.GetPark,[{key:"EntityID",value:t},{key:"RegisterID",value:e}])}removeOrder(t,e){let i={OrderID:t};return e?this.httpService.post(fe.VoidPark,i):this.httpService.post(fe.RemovePark,i)}mergePark(t){return this.httpService.post(fe.MergePark,t)}getOutstanding(t){let e={EntityID:t};return this.httpService.post(fe.GetOutStanding,e)}splitOrder(t){return this.httpService.post(fe.SplitOrder,t)}park(t){let e=Ie(qe,this.salesOrderService.Data);if(this.promotionEventService.selectedPromotion){this.clearPromotionAppliedInPark();return}e.Action.Type=1,t.ParkLabel!=null&&(e.Order.ParkLabel=t.ParkLabel),e.Order.Note=t.Note,e.Order.InvoicedStateID=1,S.IsNotEmpty(t.ID)&&(e.Order.ID=t.ID),this.salesOrderService.pushNewValue(e);let i=this.orderHttpService.generatePOSDataForSubmission(e);return this.httpService.post(fe.ParkOrder,i).pipe(_e(o=>{this.orderProcessorService.updatePosState(3,o),this.orderProcessorService.createNewTransactionInSameOutletRegister(!0)}))}clearPromotionAppliedInPark(){this.dialog.open(ra,{id:"modal-promotion-confirm",data:{message:`
|
|
2
2
|
Promotion cannot be applied when Park,
|
|
3
3
|
Order will be restored to before the promotion is applied
|
|
4
4
|
`},disableClose:!0})}parkOrder(){let t=this.salesOrderService.Data,e=this.pageInitialService.Data.AppConfigJSON;if(t.CartItems.length==0){this.toastrService.warning("You must have at least one item","No Item in Cart!");return}if(!(!this.validateCustomerRequired(e,t)||!this.validateUsedPromotion(t))){if(S.IsEmpty(t.Order.RegisterID)){this.toastrService.warning(Pr.emptyEntity,Re.Warning);return}this.validateShowParkModal()}}validateCustomerRequired(t,e){return t.ModuleSell.Header.CustomerRequired&&e.Order.CustomerID==null?(this.toastrService.warning("Customer is needed before parking orders!","Missing customer!"),!1):!0}validateUsedPromotion(t){let e=this.promotionEventService.selectedPromotion;return S.IsNotEmpty(e)||S.IsNotEmpty(t.Order.PromotionCoupon)?(this.toastrService.warning("Orders with applied promotions or coupons cannot be parked!","Park Not Allowed!"),!1):!0}validateShowParkModal(){let t=this.outletService.Data.ParkLayoutPack,e=this.pageInitialService.Data.AppConfigJSON,i=this.salesOrderService.Data;if(t&&S.IsNotEmpty(t.ID))this.orderProcessorService.Data.posState==4?this.showReparkModal():this.showParkSelectModal(e,i);else{if(!this.validateRetrieveMode(e))return;this.setDefaultParkNote(e),this.showParkInputModal()}}showParkSelectModal(t,e){let i=this.orderProcessorService.Data,o=this.outletService.Data.ParkLayoutPack;this.orderHttpService.getVacant(e.Order.EntityID).subscribe(l=>{let v=t.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkDialogTitle,E=i.posState==5,Q=t.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias,Se=E?"Split Order":v;this.dialog.open(pi,{data:{title:Se,parkLayoutPack:this.generateParkLayoutOptions(o,l.Orders),replaceWithAlias:Q,orderNote:e.Order?.Note}}).afterClosed().pipe(ae(we=>S.IsNotEmpty(we)),Te(we=>{let je=new si;return je.ParkLabel=we.Name,je.Note=we.Note,this.park(je)})).subscribe()})}showReparkModal(){this.dialog.open(_n,{data:this.parkOrderRetrieve})}validateRetrieveMode(t){return t.ApplicationParkAndRetrieve.Advance.retreiveMode==1?(this.toastrService.error("Your retrieve config is in Group mode, to enable park please setting your Park layout at Outlet page","Error!"),!1):!0}setDefaultParkNote(t){let e=t.ApplicationParkAndRetrieve.UserInterfaceLabel.DefaultParkNoteValue,i=this.orderProcessorService.Data.posState==2,o=this.salesOrderService.Data;!i&&S.IsNotEmpty(e)&&S.IsEmpty(o.Order.Note)&&(this.salesOrderService.Data.Order.Note=e)}showParkInputModal(){let t="Park this order?",e=this.orderProcessorService.Data.posState==5,i=this.outletService.Data?.ParkLayoutPack;e&&(t="Split Detail"),this.dialog.open(gn,{id:"park-form-modal",data:{title:t,labelDisable:i&&S.IsNotEmpty(i?.ID)||this.orderProcessorService.Data.posState==5,ParkLabel:this.salesOrderService.Data.Order.ParkLabel}})}onPrintRetrieve(){this.dialog.open(Cn).afterClosed().pipe(ae(t=>S.IsNotEmpty(t))).subscribe(t=>{t=="ORDER"?this.emitParkReceipt(!1,!1,!0):this.emitBillReceipt()})}emitParkReceipt(t,e=!1,i=!1){let o=this.receiptService.generateParkReceipt(t,e);(this.pageInitialService.Data.AppConfigJSON.ApplicationParkAndRetrieve?.PrintBehaviour?.PrintAfterPark||i)&&this._onPrint.next({type:"PARK",template:o})}emitBillReceipt(){let t=this.outletService.Data,e;1==t.PrintTemplate.PrintMode?(e=this.receiptService.generateBillInvoice(),this._onPrint.next({type:"BILL_A4",template:e})):(e=this.receiptService.generateBillReceipt(),this._onPrint.next({type:"BILL_MINI",template:e}))}generateParkLayoutOptions(t,e=[]){return t.Layout=t.Layout.map(i=>{i.Options=[];for(let o=1;o<=i.Size;o++){let l=new pn;l.Name=i.Name+o,l.Alias=this.generateAlias(t,l.Name),l.IsOccupied=this.IsOccupied(l.Name,e),i.Options.push(l)}return i}),t}generateAlias(t,e){let i="";if(t.Alias){let o=t.Alias.filter(l=>l.Name==e);o.length>0&&(i=`${o[0]?.Alias}`)}return i}IsOccupied(t,e){let i=e.filter(l=>l.ParkLabel==t),o=!1;return i.length>0&&(o=!0),o}static \u0275fac=function(e){return new(e||n)(N(Be),N(Et),N(U),N(j),N(A),N(K),N(ai),N(q),N(Oe),N(oe))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};var Sn=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=$t({type:n});static \u0275inj=Wt({imports:[Z,be,Dt,Pt,Qr,ei,Jt,ti,Xe,qi]})};var Ma=n=>({"opacity-50":n});function al(n,t){if(n&1){let e=y();r(0,"div",5)(1,"h6",6),p(2,"Verify Via"),a(),r(3,"div",7)(4,"button",8),g("click",function(){C(e);let o=c();return _(o.onChooseVerifyType("phone"))}),r(5,"div",9)(6,"div"),h(7,"i",10),a(),r(8,"div",11),p(9),a()()()(),r(10,"div",12)(11,"button",8),g("click",function(){C(e);let o=c();return _(o.onChooseVerifyType("email"))}),r(12,"div",9),h(13,"i",13),r(14,"div",11),p(15),a()()()(),r(16,"div",12)(17,"button",14),g("click",function(o){return C(e),c().onChooseVerifyType("pin"),_(o.preventDefault())}),r(18,"div",9),h(19,"i",15),r(20,"div",16),p(21,"Use PIN"),a()()()()()}if(n&2){let e=c();s(4),d("disabled",!e.phone||(e.phone==null?null:e.phone.length)<6),s(4),d("ngClass",T(6,Ma,!e.phone||(e.phone==null?null:e.phone.length)<6)),s(),x(" ",e.phone&&(e.phone==null?null:e.phone.length)>6?e.phone:"Mobile Phone is not registered"," "),s(2),d("disabled",!e.email),s(3),d("ngClass",T(8,Ma,!e.email)),s(),x(" ",e.email?e.email:"Email is not registered"," ")}}function ll(n,t){if(n&1){let e=y();r(0,"div",17)(1,"div",18)(2,"div"),p(3,"OTP Verification is turned "),r(4,"span",19),p(5,"OFF"),a(),p(6,","),a(),r(7,"div"),p(8," Please read this "),r(9,"a",20),p(10,"article"),a(),p(11," to turn on "),a()()(),r(12,"div")(13,"div",21)(14,"button",22),g("click",function(){C(e);let o=c();return _(o.onRedeem())}),p(15,"Redeem"),a()()()}}var yn=class n{toastrService=H(K);onVerify=new Ue;pointUsedChange=new Ue;redeemEvent=new Ue;isVerifyEnabled=!1;phone;email;pointUsed;pointBalance;onPointUsedChange(){this.pointUsedChange.emit(this.pointUsed)}ngAfterViewInit(){this.setFocusInput()}setFocusInput(){setTimeout(()=>{document.getElementById("pointInput")?.focus()},300)}onChooseVerifyType(t){this.checkPointUsed()&&this.onVerify.emit(t)}onRedeem(){this.checkPointUsed()&&this.redeemEvent.emit()}checkPointUsed(){return S.IsEmpty(this.pointUsed)||this.pointUsed<=0?(this.toastrService.warning("Please enter the points before redeeming!","Field Input Required!"),this.setFocusInput(),!1):!0}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=P({type:n,selectors:[["point-step"]],inputs:{isVerifyEnabled:"isVerifyEnabled",phone:"phone",email:"email",pointUsed:"pointUsed",pointBalance:"pointBalance"},outputs:{onVerify:"onVerify",pointUsedChange:"pointUsedChange",redeemEvent:"onRedeem"},decls:13,vars:6,consts:[[1,"d-flex","align-items-center","justify-content-center"],[1,"me-3"],["type","text","autoNum","","id","pointInput",1,"form-control","input-point",3,"ngModelChange","ngModel","max"],[1,"me-3","d-flex","align-items-center","justify-content-center"],[1,"fs-1"],[1,"mt-8"],[1,"mb-6","text-center"],[1,"text-center"],["type","button",1,"btn","btn-light","btn-sm","p-3","w-75",3,"click","disabled"],[1,"d-flex","align-items-center"],[1,"fa-brands","fa-whatsapp","fs-2","ps-2",2,"color","#25d366"],[1,"fs-5","w-100",3,"ngClass"],[1,"mt-4","text-center"],[1,"ps-2","fa-solid","fa-envelope","fs-3",2,"color","#c71610"],["type","button","matTooltip","Inform the customer to download the Brand Loyalty App and setup PIN in Profile Menu to authorize Point Redemption","matTooltipPosition","right","matTooltipClass","primary-tooltip",1,"btn","btn-light","btn-sm","p-3","w-75",3,"click"],[1,"ps-2","fa-solid","fa-key","fs-3"],[1,"fs-5","w-100"],[1,"mt-8","d-flex","justify-content-center"],[1,"text-center","alert","alert-warning","py-4","px-8","mb-0"],[1,"fw-bold","text-danger",2,"font-size","13px"],["href","https://support.dealpos.com/en/articles/9158486-redeem-loyalty-point-authorization-using-otp","target","_blank"],[1,"d-flex","justify-content-center","mt-12"],[1,"btn","btn-success",3,"click"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"div",1)(2,"input",2),k("ngModelChange",function(l){return M(i.pointUsed,l)||(i.pointUsed=l),l}),g("ngModelChange",function(){return i.onPointUsedChange()}),a()(),r(3,"div",3)(4,"span",1),p(5,"Of"),a(),r(6,"span",4),p(7),b(8,"number"),a()(),r(9,"div"),p(10,"Points"),a()(),u(11,al,22,10,"div",5)(12,ll,16,0)),e&2&&(s(2),O("ngModel",i.pointUsed),d("max",i.pointBalance),s(5),D(I(8,4,i.pointBalance)),s(4),f(i.isVerifyEnabled?11:12))},dependencies:[Z,J,ct,be,X,z,ne,Xe,se,Y],styles:[".input-point[_ngcontent-%COMP%]{width:120px;height:44px;font-size:1.375rem;text-align:center}"]})};var sl=n=>({"error-input":n});function cl(n,t){if(n&1&&(r(0,"span"),p(1),a()),n&2){let e=c(3);s(),x(" ",e.config.separator," ")}}function pl(n,t){if(n&1){let e=y();We(0),r(1,"input",5,0),g("paste",function(o){C(e);let l=c(2);return _(l.handlePaste(o))})("keyup",function(o){let l=C(e).index,v=c(2);return _(v.onKeyUp(o,l))})("input",function(o){let l=C(e).index,v=c(2);return _(v.onInput(o,l))})("keydown",function(o){let l=C(e).index,v=c(2);return _(v.onKeyDown(o,l))}),a(),G(3,cl,2,1,"span",6),Qe()}if(n&2){let e=t.$implicit,i=t.index,o=t.last,l=c(2);s(),le(zt("otp-input ",l.config.inputClass)),d("pattern",l.config.allowNumbersOnly?"\\d*":"")("type",l.inputType)("placeholder",(l.config==null?null:l.config.placeholder)||"")("ngStyle",l.config.inputStyles)("formControl",l.otpForm.controls[e])("id",l.getBoxId(i))("ngClass",T(11,sl,(l.config==null?null:l.config.showError)&&(l.formControl==null?null:l.formControl.invalid)&&((l.formControl==null?null:l.formControl.dirty)||(l.formControl==null?null:l.formControl.touched)))),s(2),d("ngIf",l.config.separator&&!o)}}function dl(n,t){if(n&1){let e=y();r(0,"div",2),g("focusin",function(){C(e);let o=c();return _(o.onFocusIn())})("focusout",function(){C(e);let o=c();return _(o.onFocusOut())}),r(1,"div",3),G(2,pl,4,13,"ng-container",4),a()()}if(n&2){let e=c();le(zt("ng-otp-input-wrapper wrapper ",e.config.containerClass)),d("id",zt("c_",e.componentKey))("ngStyle",e.config.containerStyles),s(2),d("ngForOf",e.controlKeys)}}var ht=class{static ifTab(t){return this.ifKey(t,"Tab")}static ifDelete(t){return this.ifKey(t,"Delete;Del")}static ifBackspace(t){return this.ifKey(t,"Backspace")}static ifRightArrow(t){return this.ifKey(t,"ArrowRight;Right")}static ifLeftArrow(t){return this.ifKey(t,"ArrowLeft;Left")}static ifSpacebar(t){return this.ifKey(t,"Spacebar; ")}static ifKey(t,e){return e.split(";").some(o=>o===t.key)}},ki=class{static keys(t){return t?Object.keys(t):[]}},yo=(()=>{class n{set disabled(e){this.setDisabledState(e)}get inputType(){return this.config?.isPasswordInput?"password":this.config?.allowNumbersOnly?"tel":"text"}get controlKeys(){return ki.keys(this.otpForm?.controls)}get formControl(){return this.formCtrl??this.inj?.get(or)}constructor(e,i){this.document=e,this.inj=i,this.config={length:4},this.onBlur=new $,this.onInputChange=new $,this.inputControls=new Array(this.config.length),this.componentKey=Math.random().toString(36).substring(2)+new Date().getTime().toString(36),this.destroy$=new $,this.activeFocusCount=0,this.onChange=()=>{},this.onTouched=()=>{},this._isDisabled=!1}ngOnInit(){this.otpForm=new rr({});for(let e=0;e<this.config.length;e++)this.otpForm.addControl(this.getControlName(e),new bt);this.otpForm.valueChanges.pipe(w(this.destroy$)).subscribe(e=>{ki.keys(this.otpForm.controls).forEach(i=>{var o=this.otpForm.controls[i].value;o&&o.length>1&&(o.length>=this.config.length?this.setValue(o):this.rebuildValue())})})}setDisabledState(e){this._isDisabled=e,this.otpForm&&(e?this.otpForm.disable({emitEvent:!1}):this.otpForm.enable({emitEvent:!1}))}writeValue(e){this.currentVal=this.hasVal(e)?e:null,this.setValue(this.currentVal)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}onFocusIn(){this.onTouched(),this.activeFocusCount++}onFocusOut(){setTimeout(()=>{this.activeFocusCount--,this.activeFocusCount===0&&(this.onTouched(),this.onBlur.next())},0)}ngAfterViewInit(){if(!this.config.disableAutoFocus){let e=this.document.getElementById(`c_${this.componentKey}`);if(e){let i=e.getElementsByClassName("otp-input")[0];i&&i.focus&&i.focus()}}}getControlName(e){return`ctrl_${e}`}onKeyDown(e,i){let o=this.getBoxId(i-1),l=this.getBoxId(i);if(ht.ifKey(e,"Enter")){let E=this.document.getElementById(l)?.closest("form");if(E){e.preventDefault();let Q=new Event("submit",{bubbles:!0,cancelable:!0});E.dispatchEvent(Q);return}}if(ht.ifSpacebar(e))return e.preventDefault(),!1;if(ht.ifBackspace(e)){e.target.value?this.clearInput(l,i):(this.clearInput(o,i-1),this.setSelected(o)),this.rebuildValue();return}if(ht.ifDelete(e)){e.target.value?this.clearInput(l,i):(this.clearInput(o,i-1),this.setSelected(o)),this.rebuildValue();return}}hasVal(e){return e!=null&&e!=null&&(!e?.trim||e.trim()!="")}onInput(e,i){let o=this.hasVal(this.currentVal)?`${this.currentVal}${e.target.value}`:e.target.value;if(this.config.allowNumbersOnly&&!this.validateNumber(o)){e.target.value=null,e.stopPropagation(),e.preventDefault(),this.clearInput(null,i);return}if(this.ifValidKeyCode(null,e.target.value)){let l=this.getBoxId(i+1);this.setSelected(l),this.rebuildValue()}else{e.target.value=null;let l=this.getControlName(i);this.otpForm.controls[l]?.setValue(null),this.rebuildValue()}}onKeyUp(e,i){ht.ifTab(e)&&(i-=1);let o=this.getBoxId(i+1),l=this.getBoxId(i-1);if(ht.ifRightArrow(e)){e.preventDefault(),this.setSelected(o);return}if(ht.ifLeftArrow(e)){e.preventDefault(),this.setSelected(l);return}}validateNumber(e){return e&&/^[0-9]+$/.test(e)}getBoxId(e){return`otp_${e}_${this.componentKey}`}clearInput(e,i){let o=this.getControlName(i);if(this.otpForm.controls[o]?.setValue(null),e){let l=this.document.getElementById(e);l&&l instanceof HTMLInputElement&&(l.value=null)}}setSelected(e){this.focusTo(e);let i=this.document.getElementById(e);i&&i.setSelectionRange&&setTimeout(()=>{i.setSelectionRange(0,1)},0)}ifValidKeyCode(e,i){let o=i??e.key;return this.config?.allowNumbersOnly?this.validateNumber(o):/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)||/^[a-zA-Z0-9%*_\-@#$!]$/.test(o)&&o.length==1}focusTo(e){let i=this.document.getElementById(e);i&&i.focus()}setValue(e){if(!(this.config.allowNumbersOnly&&isNaN(e))){if(this.otpForm?.reset(),!this.hasVal(e)){this.rebuildValue();return}e=e.toString().replace(/\s/g,""),Array.from(e).forEach((i,o)=>{this.otpForm.get(this.getControlName(o))&&this.otpForm.get(this.getControlName(o)).setValue(i)}),this.config.disableAutoFocus||setTimeout(()=>{let i=this.document.getElementById(`c_${this.componentKey}`);var o=e.length<this.config.length?e.length:this.config.length-1;let l=i.getElementsByClassName("otp-input")[o];l&&l.focus&&setTimeout(()=>{l.focus()},1)},0),this.rebuildValue()}}rebuildValue(){let e=null;ki.keys(this.otpForm.controls).forEach(i=>{let o=this.otpForm.controls[i].value;if(o){let l=o.length>1,v=!this.config.allowNumbersOnly&&this.config.letterCase&&(this.config.letterCase.toLocaleLowerCase()=="upper"||this.config.letterCase.toLocaleLowerCase()=="lower");o=o[0];let E=v?this.config.letterCase.toLocaleLowerCase()=="upper"?o.toUpperCase():o.toLowerCase():o;v&&E==o?v=!1:o=E,e==null?e=o:e+=o,(l||v)&&this.otpForm.controls[i].setValue(o)}}),this.currentVal!=e&&(this.currentVal=e,this.onChange(e),this.formCtrl?.setValue&&this.formCtrl.setValue(e),this.onInputChange.next(e))}handlePaste(e){let i=e.clipboardData||window.clipboardData;if(i)var o=i.getData("Text");e.stopPropagation(),e.preventDefault(),!(!o||this.config.allowNumbersOnly&&!this.validateNumber(o))&&this.setValue(o)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||n)(m(Lo),m(Vo))}}static{this.\u0275cmp=P({type:n,selectors:[["ng-otp-input"],["ngx-otp-input"]],inputs:{config:"config",formCtrl:"formCtrl",disabled:"disabled"},outputs:{onBlur:"onBlur",onInputChange:"onInputChange"},features:[st([{provide:ir,useExisting:Ao(()=>n),multi:!0}])],decls:1,vars:1,consts:[["inp",""],["tabindex","0",3,"class","id","ngStyle","focusin","focusout",4,"ngIf"],["tabindex","0",3,"focusin","focusout","id","ngStyle"],[1,"n-o-c"],[4,"ngFor","ngForOf"],["autocomplete","one-time-code",3,"paste","keyup","input","keydown","pattern","type","placeholder","ngStyle","formControl","id","ngClass"],[4,"ngIf"]],template:function(i,o){i&1&&G(0,dl,3,7,"div",1),i&2&&d("ngIf",o.otpForm==null?null:o.otpForm.controls)},dependencies:[Ze,X,z,sr,St,qt,Bi,ji,J],styles:[".otp-input[_ngcontent-%COMP%]{width:50px;height:50px;border-radius:4px;border:solid 1px #c5c5c5;text-align:center;font-size:32px}.ng-otp-input-wrapper[_ngcontent-%COMP%] .otp-input[_ngcontent-%COMP%]{margin:0 .51rem}.ng-otp-input-wrapper[_ngcontent-%COMP%] .otp-input[_ngcontent-%COMP%]:first-child{margin-left:0}.ng-otp-input-wrapper[_ngcontent-%COMP%] .otp-input[_ngcontent-%COMP%]:last-child{margin-right:0}.n-o-c[_ngcontent-%COMP%]{display:flex;align-items:center}.error-input[_ngcontent-%COMP%]{border-color:red}@media screen and (max-width: 767px){.otp-input[_ngcontent-%COMP%]{width:40px;font-size:24px;height:40px}}@media screen and (max-width: 420px){.otp-input[_ngcontent-%COMP%]{width:30px;font-size:18px;height:30px}}"]})}}return n})(),xn=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=$t({type:n})}static{this.\u0275inj=Wt({imports:[yo]})}}return n})();function ul(n,t){if(n&1&&(r(0,"div"),p(1," OTP has been sent to "),r(2,"span",5),p(3),a()()),n&2){let e=c();s(3),D(e.contact)}}function fl(n,t){if(n&1&&h(0,"ng-otp-input",3),n&2){let e=c(2);d("formCtrl",e.otpCtrl)("config",e.otpConfig)}}function gl(n,t){if(n&1&&u(0,fl,1,2,"ng-otp-input",3),n&2){let e=c();f(e.showPinInput()?0:-1)}}function Cl(n,t){if(n&1&&h(0,"ng-otp-input",3),n&2){let e=c();d("formCtrl",e.otpCtrl)("config",e.otpConfig)}}function _l(n,t){if(n&1){let e=y();r(0,"div",4)(1,"span"),p(2,"Didn`t get a code? "),a(),r(3,"a",6),g("click",function(){C(e);let o=c();return _(o.onResendCode())}),p(4,"Click to resend"),a()()}}var In=class n{type;contact;clearPin=!1;onVerify=new Ue;resendCode=new Ue;showPinInput=R(!0);otpCtrl=new bt;otpConfig={length:6,inputStyles:{width:"3rem",height:"3rem"},isPasswordInput:!1,placeholder:"-"};constructor(){this.listenOtpChange()}ngOnChanges(t){let{clearPin:e}=t;e?.currentValue&&(this.showPinInput.set(!1),setTimeout(()=>{this.showPinInput.set(!0)},0)),this.type&&(this.otpConfig.isPasswordInput=this.type==="pin")}onResendCode(){this.resendCode.emit()}listenOtpChange(){this.otpCtrl.valueChanges.pipe(No(300),ae(t=>t.length===6)).subscribe(t=>{this.onVerify.emit(t)})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=P({type:n,selectors:[["verify-step"]],inputs:{type:"type",contact:"contact",clearPin:"clearPin"},outputs:{onVerify:"onVerify",resendCode:"resendCode"},features:[Fo],decls:8,vars:4,consts:[[1,"text-center","mb-10"],[1,"mb-3","fw-normal"],[1,"d-flex","justify-content-center"],[3,"formCtrl","config"],[1,"mt-4","text-start"],[1,"fw-bold"],[1,"link-primary","cursor-pointer",3,"click"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"h4",1),p(2),a(),u(3,ul,4,1,"div"),a(),r(4,"div",2),u(5,gl,1,1)(6,Cl,1,2,"ng-otp-input",3),a(),u(7,_l,5,0,"div",4)),e&2&&(s(2),x(" Confirm Your ",i.type=="pin"?"PIN":"OTP"," "),s(),f(i.type!="pin"?3:-1),s(2),f(i.type=="pin"?5:6),s(2),f(i.type!="pin"?7:-1))},dependencies:[xn,yo,Ze],encapsulation:2})};function hl(n,t){if(n&1){let e=y();ft(0,"button",7),mo("click",function(){C(e);let o=c();return _(o.onCancel())}),p(1,"Cancel"),lt()}}function vl(n,t){if(n&1){let e=y();ft(0,"button",8),mo("click",function(){C(e);let o=c();return _(o.onConfirm())}),p(1,"Confirm"),lt()}}var Pn=class n{pointUsed=Fi(0);redeemPointValue=Fi(0);showCancelBtn=Fi(!1);confirmEvent=new Ue;cancelEvent=new Ue;onConfirm(){this.confirmEvent.emit()}onCancel(){this.cancelEvent.emit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=P({type:n,selectors:[["confirm-step"]],inputs:{pointUsed:[1,"pointUsed"],redeemPointValue:[1,"redeemPointValue"],showCancelBtn:[1,"showCancelBtn"]},outputs:{confirmEvent:"onConfirm",cancelEvent:"onCancel"},decls:19,vars:7,consts:[[1,"text-center"],[1,"fs-5"],[1,"d-flex","justify-content-center","text-success","align-items-center"],[1,"me-3",2,"font-size","1.5rem"],[1,"d-flex","justify-content-center","text-danger","align-items-center"],[1,"btn","btn-danger","mt-12"],[1,"btn","btn-success","mt-12"],[1,"btn","btn-danger","mt-12",3,"click"],[1,"btn","btn-success","mt-12",3,"click"]],template:function(e,i){e&1&&(ft(0,"div",0)(1,"div",1),p(2,"Redeem"),lt(),ft(3,"div",2)(4,"span",3),p(5),b(6,"number"),lt(),ft(7,"small"),p(8,"Point"),lt()(),ft(9,"div",1),p(10,"~"),lt(),ft(11,"div",4)(12,"span",3),p(13),b(14,"number"),lt(),ft(15,"small"),p(16,"Discount"),lt()(),u(17,hl,2,0,"button",5)(18,vl,2,0,"button",6),lt()),e&2&&(s(5),D(I(6,3,i.pointUsed())),s(8),D(I(14,5,i.pointUsed()*i.redeemPointValue())),s(4),f(i.showCancelBtn()?17:18))},dependencies:[Z,Y],encapsulation:2})};function bl(n,t){if(n&1&&(r(0,"span",5),p(1),b(2,"number"),a()),n&2){let e=c(3);s(),x("-",I(2,1,e.coupon.Amount),"%")}}function Sl(n,t){if(n&1&&(r(0,"span",5),p(1),b(2,"number"),a()),n&2){let e=c(3);s(),x(" -",I(2,1,e.coupon.Amount)," ")}}function yl(n,t){if(n&1){let e=y();r(0,"button",9),g("click",function(){C(e);let o=c().$implicit,l=c(2);return _(l.onRemoveCouponDiscount(o))}),p(1," Remove "),a()}}function xl(n,t){if(n&1){let e=y();r(0,"button",10),g("click",function(){C(e);let o=c().$implicit,l=c(2);return _(l.onApplyCouponDiscount(o))}),p(1," Apply "),a()}if(n&2){let e=c(3);d("disabled",e.hasAppliedCouponDiscount())}}function Il(n,t){if(n&1&&(r(0,"tr")(1,"td"),p(2),a(),r(3,"td"),p(4),a(),r(5,"td",4),p(6),b(7,"number"),a(),r(8,"td",4),u(9,bl,3,3,"span",5)(10,Sl,3,3,"span",5),a(),r(11,"td",6),u(12,yl,2,0,"button",7)(13,xl,2,1,"button",8),a()()),n&2){let e=t.$implicit,i=c(2);s(2),D(e==null||e.Variant==null?null:e.Variant.Name),s(2),D(e==null||e.Variant==null?null:e.Variant.Code),s(2),D(I(7,5,e.UnitPrice)),s(3),f((i.coupon==null||i.coupon.Requirement==null?null:i.coupon.Requirement.Type)==i.couponType.DiscountPercentage?9:10),s(3),f((e==null?null:e.CouponDiscount)>0?12:13)}}function Pl(n,t){if(n&1&&te(0,Il,14,7,"tr",null,Vt),n&2){let e=c();ie(e.eligibleItems())}}function Dl(n,t){n&1&&(r(0,"tr")(1,"td",11),h(2,"app-empty-state",12),a()())}var Dn=class n{constructor(t){this.data=t;this.coupon=this.data.coupon,this.initModalConfig(),this.initEligibleItems()}dialogRef=H(L);config;eligibleItems=R([]);coupon;couponType=dn;hasAppliedCouponDiscount=R(!1);initModalConfig(){this.config=new B,this.config.title="Choose Item to Apply Discount",this.config.hideFooter=!0}initEligibleItems(){let t=this.data.coupon?.ApplyToProduct.map(e=>e.ID);t&&(this.eligibleItems.update(()=>this.data.cartItems.filter(i=>t.includes(i.VariantID))),this.hasAppliedCouponDiscount.update(()=>this.eligibleItems().some(e=>e.CouponDiscount>0)))}onApplyCouponDiscount(t){let e=[t];this.hasAppliedCouponDiscount.update(()=>!0),this.dialogRef.close(e)}onRemoveCouponDiscount(t){this.eligibleItems.update(e=>{let i=e.findIndex(o=>o.VariantID===t.VariantID);return i>-1&&(e[i].Discount=0,e[i].CouponDiscount=0),e}),this.hasAppliedCouponDiscount.update(()=>!1)}onClose(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||n)(m(ge))};static \u0275cmp=P({type:n,selectors:[["app-modal-coupon-selected-item"]],decls:17,vars:2,consts:[[3,"onCancel","onClose","config"],[1,"table","table-bordered"],[1,"thead-light"],["scope","col"],[1,"text-end"],[1,"text-danger"],[1,"text-center"],[1,"btn","btn-sm","btn-danger"],[1,"btn","btn-sm","btn-success",3,"disabled"],[1,"btn","btn-sm","btn-danger",3,"click"],[1,"btn","btn-sm","btn-success",3,"click","disabled"],["colspan","5"],["title","No eligible products","message","No products in the cart qualify for coupon use"]],template:function(e,i){e&1&&(r(0,"modal-material",0),g("onCancel",function(){return i.onClose()})("onClose",function(){return i.onClose()}),r(1,"content")(2,"table",1)(3,"thead",2)(4,"tr")(5,"th",3),p(6,"Name"),a(),r(7,"th",3),p(8,"Code"),a(),r(9,"th",3),p(10,"Price"),a(),r(11,"th",3),p(12,"Discount"),a(),h(13,"th",3),a()(),r(14,"tbody"),u(15,Pl,2,0)(16,Dl,3,0,"tr"),a()()()()),e&2&&(d("config",i.config),s(15),f(i.eligibleItems().length!==0?15:16))},dependencies:[Z,V,ri,Y],encapsulation:2})};var mt=class n{constructor(t,e,i,o,l,v){this._httpService=t;this._orderDataService=e;this._userRoleService=i;this.toastr=o;this._invoiceCalculatorService=l;this.promotionCouponFactoryService=v;this.subscribeToObservable()}dialog=H(oe);role;originalRoleData;_coupon=R(null);salesOrderBeforePromotion=R(null);isShowToastrInApplyCoupon=R(!1);get coupon(){return this._coupon()}subscribeToObservable(){this._userRoleService.Data$.subscribe(t=>{this.role=t,S.IsEmpty(this.originalRoleData)&&(this.originalRoleData=Ie(Ot,t))})}RedeemCoupon(t,e,i=!1){if(!i){this.isShowToastrInApplyCoupon.set(!0);let l=this.copyOriginalSalesOrder();this.salesOrderBeforePromotion.set(l)}let o=this.promotionCouponFactoryService.generateRedeemCouponDto(t,"Internal");this._httpService.post(fe.ValidateInternalCoupon,o).subscribe({next:l=>{switch(this._orderDataService.Data.Order.PromotionCoupon=t,this._orderDataService.Data.Order.PromotionNote=e,this._orderDataService.Data.Order.CouponType=1,l.Requirement?.Type){case 1:this.HandleDiscountPercentage(l);break;case 2:this.HandleDiscountAmount(l);break;case 3:this.handleCouponReturnAccess(l);break;case 4:this.handleCouponParkedDeletionAccess();break;case 5:this.handleFullAccessCoupon();break;case 6:this.handleDeleteItemCoupon();break}this._coupon.set(l),this.isShowToastrInApplyCoupon.set(!1)},error:l=>{this.removeAppliedCoupon(!1),this.isShowToastrInApplyCoupon.set(!1)}})}setCouponOnEdit(t){t&&S.IsNotEmpty(t?.Type)&&(this._coupon.set(t),this.generateOriginalSalesOrderOnEdit())}generateOriginalSalesOrderOnEdit(){let t=Ie(qe,this._orderDataService.Data);t.Order.PromotionCoupon=null,t.Order.PromotionNote=null,t.Order.Discount=0,t.Order.DiscountAmount=0,this.salesOrderBeforePromotion.set(t)}copyOriginalSalesOrder(){return Ie(qe,this._orderDataService.Data)}HandleDiscountPercentage(t,e=!1){t.Amount>0?t.Requirement?.MaximumDiscount>0?this.applyConfigMaxDiscount(t,e):t.Requirement?.FullPriceProductOnly?this.applyFullPriceDisc(t,e):this.applyDiscountPercentage(t,e):(this.role.Discount=e?this.originalRoleData.Discount:!0,this._userRoleService.pushNewValue(this.role))}applyFullPriceDisc(t,e=!1){let i=this._orderDataService.Data;if(e)this.filterItemWithCouponDisc(i.CartItems).length>0?(i.CartItems=this.resetItemsDisc(i.CartItems),this._orderDataService.pushNewValue()):this.applyDiscountPercentage(t,e);else if(this.filterItemWithDisc(i.CartItems).length>0){let l=this.filterItemWithoutDisc(i.CartItems);l.length>0?this.applyConfigItemsScope(t,l).subscribe(v=>{let E=this.applyItemsDisc(v,t);i.CartItems=this.updateCartItems(E,t),this._orderDataService.pushNewValue(i),this.showToastr(t)}):(this.removeAppliedCoupon(!1),this._orderDataService.pushNewValue(),this.toastr.error("No products in the cart qualify for coupon use","Coupon Not Applied"))}else this.applyDiscountPercentage(t,e)}updateCartItems(t,e){let o=this._orderDataService.Data.CartItems.map((l,v)=>{let E=t.find(Q=>this.isSameCartItem(Q,l));return E||l});return o=this.applyOneOfFirstQuantity(o,e),o}applyOneOfFirstQuantity(t,e){if(e?.Requirement?.RequirementDiscountType==2){let i=t.findIndex(o=>o.CouponDiscount>0);if(t[i]?.Quantity>1){let o=oi(Ne,t[i]);o.Quantity=1,o.ID=S.GuidEmpty,t[i].Quantity=t[i].Quantity-1,t[i].CouponDiscount=0,t[i].Discount=0,t[i].DiscountAmount=0,t.push(o)}}return t}filterItemWithDisc(t){return t.filter(i=>i.Discount>0||i.DiscountAmount>0||i.Price!=i?.Variant?.UnitPrice||S.IsNotEmpty(i.PriceBookID)||i.PriceTypeID==2)}filterItemWithoutDisc(t){return t.filter(i=>this.itemConditionFullPriceOnly(i))}filterItemWithCouponDisc(t){return t.filter(i=>i.CouponDiscount>0)}applyDiscountPercentage(t,e=!1){let i=this._orderDataService.Data.Order.CustomerDiscountRate,o=t.Amount;if(e){let l=this._orderDataService.Data;this._orderDataService.Data.Order.Discount=0,l.CartItems=this.resetItemsDisc(l.CartItems),this._orderDataService.pushNewValue(l)}else o>=i?t.ApplyToProduct?.length>0?this.applyDiscountRequiredItems(t):(this._orderDataService.Data.Order.Discount=t.Amount,this._orderDataService.pushNewValue(),this.showToastr(t)):(this.toastr.warning("Member discount is applied because member discount is greater than Coupon Discount","Warning"),this.removeAppliedDiscountOnCustomerChange())}applyDiscountRequiredItems(t){let i=this._orderDataService.Data.CartItems.filter(o=>t.ApplyToProduct.map(l=>l.ID)?.includes(o.VariantID));this.applyConfigItemsScope(t,i).subscribe(o=>{let l=o.map(E=>(E.Discount=t.Amount,E.CouponDiscount=t.Amount,E)),v=this.updateCartItems(l,t);this._orderDataService.Data.CartItems=v,this._orderDataService.pushNewValue(),this.showToastr(t)})}showToastr(t){let e=t?.Requirement?.Notify;S.IsNotEmpty(e)&&this.isShowToastrInApplyCoupon()&&this.toastr.success(e,"Coupon Applied")}applyConfigMaxDiscount(t,e=!1){let i=this._orderDataService.Data.CartItems;t.Requirement?.FullPriceProductOnly&&(i=i.filter(o=>this.itemConditionFullPriceOnly(o))),this.applyConfigItemsScope(t,i,e).subscribe(o=>{this.applyMaxDiscount(t,o,e)})}applyConfigItemsScope(t,e,i=!1){let o=t.Requirement?.RequirementDiscountType;return(o==1||o==2)&&i==!1?this.dialog.open(Dn,{data:{coupon:t,cartItems:e},id:"modal-coupon-selected-item"}).afterClosed().pipe(_e(v=>{let Se=this._orderDataService.Data.CartItems.some(we=>we.CouponDiscount>0);!v&&!Se&&this.removeAppliedDiscountOnCustomerChange()}),ae(v=>!!v)):At(e)}applyMaxDiscount(t,e,i=!1){let o=this._invoiceCalculatorService.calculateGrossTotal(e),l=this._orderDataService.Data,v=o*t.Amount/100,E=t.Requirement?.MaximumDiscount,Q=e;v>=E?(l.Order.DiscountAmount=i?0:E,Q=this.resetItemsDisc(e)):(l.Order.DiscountAmount=0,Q=i?this.resetItemsDisc(e):this.applyItemsDisc(e,t)),l.CartItems=this.updateCartItems(Q,t),this._orderDataService.pushNewValue(l),i||this.showToastr(t)}resetItemsDisc(t){return this.coupon?.Requirement?.RequirementDiscountType==2?t=this.resetConfigOneOfFirstQuantity(t):t=t.map(e=>(e.CouponDiscount>0&&(e.Discount=0,e.DiscountAmount=0,e.CouponDiscount=0),e)),t}resetConfigOneOfFirstQuantity(t){let e=t.findIndex(i=>i.CouponDiscount>0);if(e!==-1){let i=t.findIndex(o=>o.CouponDiscount==0&&t[e]?.VariantID==o?.VariantID);i!==-1?(t.splice(e,1),t[i].Quantity+=1):(t[e].CouponDiscount=0,t[e].Discount=0,t[e].DiscountAmount=0)}return t}applyItemsDisc(t,e){return e.ApplyToProduct?.length>0?t=this.applyDiscByVariant(t,e):t=t.map(i=>(i.Discount=e.Amount,i.CouponDiscount=e.Amount,i)),t}applyDiscByVariant(t,e){return t=t.map(i=>(e.ApplyToProduct.find(l=>l.ID==i.VariantID)&&this.itemConditionFullPriceOnly(i)&&(i.Discount=e.Amount,i.CouponDiscount=e.Amount),i)),t}itemConditionFullPriceOnly(t){return(t.Discount==0||t.CouponDiscount>0)&&t.DiscountAmount==0&&t.Price==t?.Variant?.UnitPrice&&S.IsEmpty(t.PriceBookID)}HandleDiscountAmount(t,e=!1){t.Amount>0?(t.ApplyToProduct?.length>0?this.applyDiscountInItem(t,e):(e?this._orderDataService.Data.Order.DiscountAmount=0:(this._orderDataService.Data.Order.DiscountAmount=t.Amount,this.showToastr(t)),this._orderDataService.pushNewValue()),this.resetCustomerPoint(e)):(this.role.Discount=e?this.originalRoleData.Discount:!0,this._userRoleService.pushNewValue(this.role))}applyDiscountInItem(t,e=!1){let i=this._orderDataService.Data;if(e)i.CartItems=this.resetItemsDisc(i.CartItems);else{let l=i.CartItems.filter(v=>t.ApplyToProduct.map(E=>E.ID)?.includes(v.VariantID));this.applyConfigItemsScope(t,l,e).subscribe(v=>{let E=v.map(Q=>(Q.DiscountAmount=t.Amount,Q.CouponDiscount=t.Amount,Q));i.CartItems=this.updateCartItems(E,t),this._orderDataService.pushNewValue(i),this.showToastr(t)})}}resetCustomerPoint(t){if(!t){let e=this._orderDataService.Data;e.Order.PointUsed=0}}handleCouponReturnAccess(t){let e=Ie(Ot,this.role);e.Return=!0,this._userRoleService.pushNewValue(e),this.isShowToastrInApplyCoupon()&&this.toastr.success("You got access to return a sales transaction!","Coupon Applied")}handleCouponParkedDeletionAccess(){let t=Ie(Ot,this.role);t.ParkedDeletionAuthorized=!0,this._userRoleService.pushNewValue(t),this.isShowToastrInApplyCoupon()&&this.toastr.success("You Have Access to delete park and delete item when retrieve!","Coupon Applied")}handleFullAccessCoupon(){let t=Ie(Ot,this.role);t.UnitPriceEditor=!0,t.Discount=!0,t.Return=!0,t.Tax=!0,t.NumberEditor=!0,t.DateEditor=!0,t.PricebookSelector=!0,t.DeleteItem=!0,t.ParkedDeletionAuthorized=!0,this._userRoleService.pushNewValue(t),this.isShowToastrInApplyCoupon()&&this.toastr.success("You now have Full Access for this Order!","Coupon Applied")}handleDeleteItemCoupon(){let t=Ie(Ot,this.role);t.DeleteItem=!0,this._userRoleService.pushNewValue(t),this.isShowToastrInApplyCoupon()&&this.toastr.success("You Have Access to delete item","Coupon Applied")}removeAppliedCoupon(t=!0){this._userRoleService.pushNewValue(this.originalRoleData),this._orderDataService.pushNewValue(this.salesOrderBeforePromotion()),this.salesOrderBeforePromotion.set(null),this._coupon.set(null),t&&this.toastr.warning("Coupon Cancelled","Warning")}resetCouponOnNewTransaction(){this._userRoleService.pushNewValue(this.originalRoleData),this._coupon.set(null)}removeAppliedDiscountOnCustomerChange(){if(this.coupon)switch(this.coupon.Requirement?.Type){case 1:this.HandleDiscountPercentage(this._coupon(),!0),this.removeAppliedCouponOnCustomerChange();break;case 2:this.HandleDiscountAmount(this._coupon(),!0),this.removeAppliedCouponOnCustomerChange();break}}removeAppliedCouponOnCustomerChange(){if(this.coupon){let t=this._orderDataService.Data;t.Order.PromotionCoupon=null,t.Order.PromotionNote=null,this._coupon.set(null),this._userRoleService.pushNewValue(this.originalRoleData),this._orderDataService.pushNewValue(t)}}isSameCartItem(t,e){return t.VariantID===e.VariantID&&t.Quantity===e.Quantity&&t.Price===e.Price&&t.Discount===e.Discount&&t.PriceBookID===e.PriceBookID}static \u0275fac=function(e){return new(e||n)(N(Be),N(A),N(ce),N(K),N(Ce),N(aa))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};var mi=class n{constructor(t,e,i,o,l,v,E,Q,Se,we,je){this.customerHttpService=t;this.salesOrderService=e;this.pageInitialService=i;this.shoppingCartService=o;this.invoiceCalculatorService=l;this.orderProcessorService=v;this.toastr=E;this.promotionCouponService=Q;this.promotionCouponV2Service=Se;this.httpService=we;this.registerService=je}customerId;customerData;_isCustomerVerfiedOtp=!1;get isCustomerVerfiedOtp(){return this._isCustomerVerfiedOtp}addCustomerById(t){return new To(e=>{this.customerId=JSON.parse(JSON.stringify(this.salesOrderService.Data.Order.CustomerID)),this.resetCartOnChangeCustomer(t),S.IsNotEmpty(t)&&this.salesOrderService.updateCustomerID(t).then(i=>{this.applyCustomerPricebook(i),this.updateTaxCustomer(i.TaxTypeId),this.setSalesOrderCustomerId(i),this.setCustomerData(i),this.customerData.DiscountRate==null&&(this.customerData.DiscountRate=0),this._isCustomerVerfiedOtp=!1,this.applyConfigFullPriceOnly(),this.salesOrderService.pushNewValue();let o=this.checkResetRedeemPoint();this.orderProcessorService.reedemPointToDiscount(o),e.next(i)})})}addCustomerByCode(t){return this.salesOrderService.Data.ContactName=null,this.customerHttpService.findCustomerByCode(t).pipe(Te(e=>(this.salesOrderService.Data.ContactName=e.Display,this.addCustomerById(e.ID))))}setSalesOrderCustomerId(t){let e=this.salesOrderService.Data,i=this.registerService.Data.ListSales,o=t.SalesID,l=i.find(v=>v.ID===o);S.IsNotEmpty(t.SalesID)&&l&&(e.Order.SalesID=t.SalesID)}setCustomerData(t){let e=this.salesOrderService.Data;if(t.EntityID==S.GuidEmpty)this.customerData=t,this.customerData.DebtCalculated=t.Debt;else if(t.EntityID!=e.Order.EntityID){e.Order.CustomerID=null,e.ContactName=null;let i=`${t?.Name} is exclusive to ${t?.EntityName} Outlet and cannot be used in other outlets!`;alert(i)}else this.customerData=t,this.customerData.DebtCalculated=t.Debt}checkResetRedeemPoint(){let t=!1;return S.IsNotEmpty(this.customerId)&&(t=!0),t}applyCustomerPricebook(t){let e=this.salesOrderService.Data;if(S.IsNotEmpty(t.PricebookID)){let i=e.CartItems.map(o=>(o.Variant.PriceBook&&o.Variant.PriceBook.length!==0&&o.Variant.PriceBook.forEach(l=>{l.ID===t.PricebookID&&o.Quantity>=l.MinimumQuantity&&(o=this.shoppingCartService.applyPricebookToItem(o,l))}),o));e.CartItems=i}}updateTaxCustomer(t){let i=this.pageInitialService.Data.Taxes.find(o=>o.ID==t);i&&(this.salesOrderService.Data.Order.TaxTypeID=i.ID,this.invoiceCalculatorService.tax=i)}resetCartOnChangeCustomer(t){let e=this.pageInitialService.Data.AppConfigJSON;this.customerId!=t&&e.ModuleSell.Customer.ClearCartOnChange&&(this.salesOrderService.Data.CartItems=[]),this.customerId=t}updateDiscountRate(t=0){if(t>0){let e=this.promotionCouponV2Service.appliedCoupon(),i=this.salesOrderService.Data.Order.Discount;e&&e?.Type=="Percentage"?i==e.Amount?t>e.Amount&&(this.toastr.warning("Member discount is applied because member discount is greater than Coupon Discount","Warning"),this.promotionCouponService.removeAppliedDiscountOnCustomerChange(),this.salesOrderService.Data.Order.Discount=t):(this.salesOrderService.Data.Order.Discount=t,this.salesOrderService.Data.Order.CustomerDiscountRate=t):(this.salesOrderService.Data.Order.Discount=t,this.salesOrderService.Data.Order.CustomerDiscountRate=t)}}applyConfigFullPriceOnly(){let t=this.filterGroupByDiscountRate(),e=this.salesOrderService.Data.CartItems;t?.OrderDiscountFullPriceProductOnly?this.filterItemWithDisc(e).length>0?e=this.applyItemsDisc(e,this.customerData.DiscountRate):this.updateDiscountRate(this.customerData.DiscountRate):this.updateDiscountRate(this.customerData.DiscountRate)}filterGroupByDiscountRate(){let e=(this.customerData?.Groups?this.customerData?.Groups:[]).filter(o=>o.OrderDiscountPercentage==this.customerData.DiscountRate),i;return e.length>1?(i=e.find(o=>o.OrderDiscountFullPriceProductOnly==!0),i||(i=e[0])):i=e[0],i}applyItemsDisc(t,e){return t=t.map(i=>(i.Discount==0&&i.DiscountAmount==0&&i.PriceTypeID!=3&&i.Price==i.UnitPrice&&S.IsEmpty(i.PriceBookID)&&(i.Discount=e,i.HasCustomerDiscount=!0),i)),t}filterItemWithDisc(t){return t.filter(i=>i.Discount>0||i.DiscountAmount>0||i.PriceTypeID==3||i.Price!=i.UnitPrice||S.IsNotEmpty(i.PriceBookID))}onEmptyInputCustomer(){S.IsNotEmpty(this.customerId)&&(this.promotionCouponService.removeAppliedDiscountOnCustomerChange(),this.resetAppliedPoint(),this.resetCustomerPricebook(),this.removeCustomerDiscountRate()),this.orderProcessorService.Data.InputTextValue="",this.customerId=JSON.parse(JSON.stringify(this.salesOrderService.Data.Order.CustomerID)),this._isCustomerVerfiedOtp=!1,this.customerData=null,this.salesOrderService.Data.ContactName=null,this.salesOrderService.Data.Order.CustomerID=null,this.customerHttpService.Data=new go,this.customerData=new go,this.salesOrderService.pushNewValue()}removeCustomerDiscountRate(){let t=this.filterGroupByDiscountRate(),e=this.salesOrderService.Data.CartItems;t?.OrderDiscountFullPriceProductOnly?this.filterItemWithDisc(e).length>0?this.salesOrderService.Data.CartItems=e.map(o=>(o.HasCustomerDiscount&&(o.Discount=0,o.HasCustomerDiscount=!1),o)):(this.salesOrderService.Data.Order.Discount=0,this.salesOrderService.Data.Order.CustomerDiscountRate=0):(this.salesOrderService.Data.Order.Discount=0,this.salesOrderService.Data.Order.CustomerDiscountRate=0)}resetCustomerPricebook(){if(this.customerData){let t=this.customerData.PricebookID;if(S.IsNotEmpty(t)){let e=this.salesOrderService.Data.CartItems;this.salesOrderService.Data.CartItems=e.map(i=>(i.PriceBookID==t&&(i.Discount=i.Variant.PriceDiscount,i.Note=i.Variant.PriceNote,i.PriceNote=i.Variant.PriceNote,i.PriceBookID=S.GuidEmpty,i.Price=i.Variant.UnitPrice,i.UnitPrice=i.Variant.UnitPrice),i))}}}resetAppliedPoint(){let t=this.salesOrderService.Data;t.Order.PointUsed>0&&(t.Order.PointUsed=0,t.Order.DiscountAmount=0)}redeemPoint(t){let e=this.pageInitialService.Data.AppConfigJSON,i=this.salesOrderService.Data,o=e.ApplicationLoyalty.LoyaltyPoint.RedeemPointValue,l=t*o,v=i.RedeemableAmount;l>v&&(o>0?(t=Math.ceil(v/o),l=v):(t=0,l=0),this.toastr.warning("You enter the number of points more than the total amount","Points Adjusted")),i.Order.PointUsed=t||0,i.Order.DiscountAmount=l,this.salesOrderService.pushNewValue(i)}sendOtpViaEmail(t){return this.httpService.post("/API/otp/email",{Email:t})}sendOtpViaWhatsApp(t){return this.httpService.post("/API/otp/WhatsApp",{Number:t})}verifyEmailOtp(t,e){return this.httpService.post("/API/otp/verifyemail",{Email:t,OTP:e}).pipe(_e(()=>this._isCustomerVerfiedOtp=!0))}verifyPin(t,e){return this.httpService.post("/API/pos/VerifyPin",{PIN:t,CustomerID:e}).pipe(_e(()=>this._isCustomerVerfiedOtp=!0))}verifyWhatsAppOtp(t,e){return this.httpService.post("/API/otp/verifywhatsapp",{Number:t,OTP:e}).pipe(_e(()=>this._isCustomerVerfiedOtp=!0))}get pointBalanced(){let t=this.customerHttpService.Data.Point,e=this.customerHttpService.Data.PointUsed;return(t||0)-(e||0)}static \u0275fac=function(e){return new(e||n)(N(dt),N(A),N(j),N(me),N(Ce),N(U),N(K),N(mt),N(Mt),N(Be),N(q))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ml=["stepper"];function kl(n,t){n&1&&p(0,"Points")}function wl(n,t){n&1&&p(0,"Verify")}function Tl(n,t){n&1&&p(0,"Confirm")}var ui=class n{dialogRef=H(L);outletRegisterService=H(q);pageInitialService=H(j);customerHttpService=H(dt);customerService=H(mi);orderService=H(A);toastr=H(K);modalConfig;enabledLoyaltyPoint=R(!1);stepper;pointUsed=0;pointBalance=R(0);redeemPointValue=R(0);email=R(null);phone=R(null);contactToResend=R(null);verifyType=R(null);clearPin=R(!1);selectedTab=R(0);constructor(){this.initModalConfig();let t=this.pageInitialService.Data.AppConfigJSON;this.redeemPointValue.set(t?.ApplicationLoyalty?.LoyaltyPoint?.RedeemPointValue),this.email.set(this.customerHttpService.Data?.Email),this.phone.set(this.customerHttpService.Data?.Mobile),this.initAvailablePoint(),this.initConfigEnabledVerify(),this.initPointUsed()}initModalConfig(){this.modalConfig=new B,this.modalConfig.title="Redeem Point",this.modalConfig.customWidth="500px",this.modalConfig.hideFooter=!0}initConfigEnabledVerify(){let t=this.pageInitialService.Data.AppConfigJSON,e=t?.ApplicationLoyalty?.VerifyRedemption,i=t?.ApplicationLoyalty?.Enabled,o=this.outletRegisterService.Data?.MemberPoint;this.enabledLoyaltyPoint.set(e&&i&&o)}initPointUsed(){let t=this.orderService.Data?.Order?.PointUsed;this.pointUsed=t||0,this.pointUsed>0&&this.selectedTab.set(2)}initAvailablePoint(){let t=this.customerHttpService.Data.Point,e=this.customerHttpService.Data.PointUsed,i=(t||0)-(e||0);this.pointBalance.set(i)}onClose(){this.dialogRef.close()}onCancelRedeem(){let t=this.orderService.Data;t.Order.PointUsed=0,t.Order.DiscountAmount=0,this.orderService.pushNewValue(t),this.toastr.info("Redeem point has been canceled","Canceled"),this.onClose()}onRedeem(){this.stepper.next(),this.stepper.next()}onVerify(t){switch(t){case"phone":this.contactToResend.set(this.phone()),this.handlingSentOtpViaPhone();break;case"email":this.contactToResend.set(this.email()),this.handlingSentOtpViaEmail();break;case"pin":this.stepper.next();break}this.verifyType.set(t)}handlingSentOtpViaPhone(){this.customerService.sendOtpViaWhatsApp(this.phone()).subscribe(t=>{this.stepper.selectedIndex==0&&this.stepper.next(),this.toastr.success(`OTP has been sent to ${this.phone()}`,"OTP Sent")})}handlingSentOtpViaEmail(){this.customerService.sendOtpViaEmail(this.email()).subscribe(t=>{this.stepper.selectedIndex==0&&this.stepper.next(),this.toastr.success(`OTP has been sent to ${this.email()}`,"Email Sent")})}onVerifyCode(t){switch(this.verifyType()){case"phone":this.verifyPhoneOtp(t);break;case"email":this.verifyEmailOtp(t);break;case"pin":this.verifyCustomerPin(t);break}}verifyEmailOtp(t){this.customerService.verifyEmailOtp(this.email(),t).subscribe(e=>{this.toastr.success(e.Message,"Successfully verified"),this.stepper.next()})}verifyPhoneOtp(t){this.customerService.verifyWhatsAppOtp(this.phone(),t).subscribe(e=>{this.toastr.success(e.Message,"Successfully verified"),this.stepper.next()})}verifyCustomerPin(t){let e=this.orderService.Data?.Order?.CustomerID;this.clearPin.set(!1),this.customerService.verifyPin(t,e).subscribe({next:i=>{this.toastr.success(i.Message,"Successfully verified"),this.stepper.next()},error:i=>{this.clearPin.set(!0)}})}onResendCode(){this.onVerify(this.verifyType())}onConfirm(){this.calculatePointToDiscount()}calculatePointToDiscount(){let t=this.pageInitialService.Data.AppConfigJSON,e=this.orderService.Data,i=e.RedeemableAmount,o=this.pointUsed,l=t.ApplicationLoyalty.LoyaltyPoint.RedeemPointValue,v=this.pointUsed*l;v>i&&(o=Math.ceil(i/l),v=i),(S.IsNotEmpty(e.Order.PointUsed)?e.Order.PointUsed:0)!=o&&(e.Order.PointUsed=o||0,e.Order.DiscountAmount=v,this.orderService.pushNewValue(e),this.toastr.success("Point has been redeemed","Success")),this.dialogRef.close()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=P({type:n,selectors:[["modal-redeem-point"]],viewQuery:function(e,i){if(e&1&&Ve(Ml,5),e&2){let o;ye(o=xe())&&(i.stepper=o.first)}},decls:18,vars:18,consts:[["stepper",""],[3,"onClose","preventEnterEvent","config"],[1,"container"],[1,"d-flex","justify-content-center"],[1,"sell-stepper-redeem",3,"linear","selectedIndex"],[3,"editable","aria-labelledby"],["matStepLabel",""],[1,"mt-10"],[3,"onVerify","pointUsedChange","onRedeem","isVerifyEnabled","pointUsed","pointBalance","email","phone"],["aria-labelledby","stepDisabled",3,"editable"],[3,"resendCode","onVerify","type","contact","clearPin"],["aria-labelledby","stepDisabled"],[3,"onConfirm","onCancel","pointUsed","redeemPointValue","showCancelBtn"]],template:function(e,i){if(e&1){let o=y();r(0,"modal-material",1),g("onClose",function(){return i.onClose()}),r(1,"content")(2,"div",2)(3,"div",3)(4,"mat-stepper",4,0)(6,"mat-step",5),G(7,kl,1,0,"ng-template",6),r(8,"div",7)(9,"point-step",8),g("onVerify",function(v){return i.onVerify(v)}),k("pointUsedChange",function(v){return C(o),M(i.pointUsed,v)||(i.pointUsed=v),_(v)}),g("onRedeem",function(){return i.onRedeem()}),a()()(),r(10,"mat-step",9),G(11,wl,1,0,"ng-template",6),r(12,"div",7)(13,"verify-step",10),g("resendCode",function(){return i.onResendCode()})("onVerify",function(v){return i.onVerifyCode(v)}),a()()(),r(14,"mat-step",11),G(15,Tl,1,0,"ng-template",6),r(16,"div",7)(17,"confirm-step",12),g("onConfirm",function(){return i.onConfirm()})("onCancel",function(){return i.onCancelRedeem()}),a()()()()()()()()}e&2&&(d("preventEnterEvent",!0)("config",i.modalConfig),s(4),d("linear",!0)("selectedIndex",i.selectedTab()),s(2),d("editable",!0),Ho("aria-labelledby",i.selectedTab()==2?"stepDisabled":""),s(3),d("isVerifyEnabled",i.enabledLoyaltyPoint()),O("pointUsed",i.pointUsed),d("pointBalance",i.pointBalance())("email",i.email())("phone",i.phone()),s(),d("editable",!1),s(3),d("type",i.verifyType())("contact",i.contactToResend())("clearPin",i.clearPin()),s(4),d("pointUsed",i.pointUsed)("redeemPointValue",i.redeemPointValue())("showCancelBtn",i.selectedTab()==2))},dependencies:[Z,be,V,Ur,jr,Br,Hr,yn,In,Pn],styles:['@import"https://fonts.googleapis.com/icon?family=Material+Icons"; mat-stepper.sell-stepper-redeem .mat-horizontal-stepper-header{height:50px!important} mat-stepper.sell-stepper-redeem .mat-horizontal-stepper-header .mat-step-label{min-width:0px!important} mat-stepper.sell-stepper-redeem .mat-horizontal-stepper-header[aria-labelledby=stepDisabled]{pointer-events:none!important}']})};function El(n,t){if(n&1){let e=y();r(0,"div",18),g("click",function(){C(e);let o=c(2);return _(o.onShowModalRedeem())}),r(1,"span"),h(2,"i",19),a(),r(3,"span"),p(4),b(5,"number"),a()()}if(n&2){let e=c(2);s(4),x(" ",I(5,1,e.pointUsed)," Points redeemed ")}}function Rl(n,t){if(n&1){let e=y();r(0,"tab",3)(1,"div",6)(2,"div",7)(3,"label",8),p(4,"Discount %"),a()(),r(5,"div",9)(6,"input",10),k("ngModelChange",function(o){C(e);let l=c();return M(l.discount1,o)||(l.discount1=o),_(o)}),a(),r(7,"span",11),p(8,"%"),a(),r(9,"span",12),p(10,"+"),a(),r(11,"input",13),k("ngModelChange",function(o){C(e);let l=c();return M(l.discount2,o)||(l.discount2=o),_(o)}),a(),r(12,"span",11),p(13,"%"),a()()(),r(14,"div",14)(15,"div",7)(16,"label",8),p(17),a()(),r(18,"div",15)(19,"input",16),k("ngModelChange",function(o){C(e);let l=c();return M(l.discountAmount,o)||(l.discountAmount=o),_(o)}),a(),u(20,El,6,3,"div",17),a()()()}if(n&2){let e=c();d("active",e.tabActive=="Discount"),s(6),O("ngModel",e.discount1),s(5),O("ngModel",e.discount2),s(6),x("Discount ",e.currencySymbol),s(2),d("disabled",e.pointUsed&&e.pointUsed>0),O("ngModel",e.discountAmount),s(),f(e.pointUsed&&e.pointUsed>0?20:-1)}}function Nl(n,t){if(n&1){let e=y();r(0,"tab",4)(1,"div",6)(2,"div",7)(3,"label",8),p(4,"Tax"),a()(),r(5,"div",9)(6,"ng-select",20),g("change",function(o){C(e);let l=c();return _(l.updateTax(o))}),a()()(),r(7,"div",14)(8,"div",7)(9,"label",8),p(10,"Surcharge"),a()(),r(11,"div",9)(12,"input",21),k("ngModelChange",function(o){C(e);let l=c();return M(l.surcharge,o)||(l.surcharge=o),_(o)}),a(),r(13,"span",11),p(14,"%"),a()()()()}if(n&2){let e=c();s(6),d("clearable",!1)("ngModel",e.salesOrder.Order.TaxTypeID)("items",e.taxes),s(6),O("ngModel",e.surcharge),d("max",100)("min",-100)}}function Al(n,t){if(n&1){let e=y();r(0,"tab",5)(1,"div",6)(2,"div",22)(3,"strong"),p(4,"Discount After Tax"),a()(),r(5,"div",23)(6,"input",24),k("ngModelChange",function(o){C(e);let l=c();return M(l.discountAfterTax,o)||(l.discountAfterTax=o),_(o)}),g("ngModelChange",function(){C(e);let o=c();return _(o.onDiscountAfterTaxChange())}),a()()(),r(7,"div",25)(8,"div",22)(9,"label",8),p(10,"Discount Calculator"),a()(),r(11,"div",26)(12,"input",27),k("ngModelChange",function(o){C(e);let l=c();return M(l.discounts[0],o)||(l.discounts[0]=o),_(o)}),g("ngModelChange",function(){C(e);let o=c();return _(o.calculateDiscountCalculator())}),a(),r(13,"span"),p(14," %"),a(),r(15,"span",12),p(16,"+"),a(),r(17,"input",28),k("ngModelChange",function(o){C(e);let l=c();return M(l.discounts[1],o)||(l.discounts[1]=o),_(o)}),g("ngModelChange",function(){C(e);let o=c();return _(o.calculateDiscountCalculator())}),a(),r(18,"span"),p(19," %"),a(),r(20,"span",12),p(21,"+"),a(),r(22,"input",29),k("ngModelChange",function(o){C(e);let l=c();return M(l.discounts[2],o)||(l.discounts[2]=o),_(o)}),g("ngModelChange",function(){C(e);let o=c();return _(o.calculateDiscountCalculator())}),a(),r(23,"span"),p(24," %"),a()()()()}if(n&2){let e=c();s(6),O("ngModel",e.discountAfterTax),s(6),O("ngModel",e.discounts[0]),s(5),O("ngModel",e.discounts[1]),s(5),O("ngModel",e.discounts[2])}}var fi=class n{constructor(t,e,i,o,l,v,E,Q,Se,we){this.dialogRef=t;this.orderService=e;this.invoiceCalculatorService=i;this.pageInitialService=o;this.roleService=l;this.customerHttpService=v;this.orderProcessorService=E;this.promotionCouponService=Q;this.dialog=Se;this.data=we;let je=this.pageInitialService?.Data?.AppConfigJSON;this.modalConfig.title="Discount and Tax",this.modalConfig.customWidth="480px",this.salesOrder=this.orderService.Data,this.userRole=this.roleService.Data,this.isPreferedPayment=je?.ApplicationLoyalty?.PreferedPayment,this.tabActive=this.data?.tabIndexActive,this.isEditOrder=this.orderProcessorService.Data.posState==2,this.customer=v.Data,this.initDiscountAndTax(),this.initAvailablePoint(),this.initTabLoyaltyTitle()}modalConfig=new B;discount1;discount2;discountAmount;surcharge;discountAfterTax;currencySymbol;salesOrder;discounts=[];taxes;selectedTax;userRole;tabActive;isEditOrder;isPreferedPayment;customerPoint;customer;tabLoyaltyTitle;pointUsed;availablePoint;initAvailablePoint(){let t=this.customerHttpService.Data.Point,e=this.customerHttpService.Data.PointUsed;this.customerPoint=t,this.availablePoint=(t||0)-(e||0)}initTabLoyaltyTitle(){let e=this.pageInitialService?.Data?.AppConfigJSON?.ApplicationLoyalty?.Label;this.tabLoyaltyTitle=S.IsNotEmpty(e)?e:"Loyalty"}initDiscountAndTax(){this.discount1=this.salesOrder.Order.Discount,this.discount2=this.salesOrder.Order.Discount2,this.discountAmount=this.salesOrder.Order.DiscountAmount,this.surcharge=this.salesOrder.Invoice.SurchargePcg,this.discountAfterTax=this.invoiceCalculatorService.discountAfterTax,this.currencySymbol=this.invoiceCalculatorService.currencySymbol,this.taxes=this.pageInitialService.Data.Taxes,this.selectedTax=this.invoiceCalculatorService.tax,this.pointUsed=this.salesOrder.Order.PointUsed}updateTax(t){this.selectedTax=t}onOk(){this.resetAppliedCoupon(),this.applyChangesDiscountAmount(),this.salesOrder.Order.Discount=this.discount1,this.salesOrder.Order.Discount2=this.discount2,this.salesOrder.Invoice.SurchargePcg=this.surcharge,this.salesOrder.Invoice.TempSurchargePcg=this.surcharge,this.invoiceCalculatorService.discountAfterTax=this.discountAfterTax,this.salesOrder.Order.TaxTypeID=this.selectedTax.ID,this.invoiceCalculatorService.tax=this.selectedTax,this.orderService.pushNewValue(this.salesOrder),this.onClose()}onClose(){this.dialogRef.close()}calculateDiscountCalculator(){var t=100;this.discounts.forEach(e=>{t=t*(100-e)/100}),this.discount1=100-t}onDiscountAfterTaxChange(){this.discountAmount=this.discountAfterTax;let e=this.invoiceCalculatorService.TotalBeforeTax-this.discountAmount,i=this.orderService.Data.Order.TaxTypeID,o=this.pageInitialService.Data.Taxes,l=S.FilterByID(o,i);if(S.IsNotEmpty(l)&&l.CalculationTypeID==0){let v=1+l.Rate/100,E=e*v;this.discountAmount=(E-(E-this.discountAfterTax))/v}}applyChangesDiscountAmount(){let t=this.salesOrder.Order.DiscountAmount;this.discountAmount!=t&&(this.salesOrder.Order.DiscountAmount=this.discountAmount)}onTabChange(t){this.tabActive=t}resetAppliedCoupon(){let t=this.promotionCouponService.coupon,e=this.salesOrder.Order.DiscountAmount;t&&t.Requirement?.Type==2&&e!=this.discountAmount&&(this.salesOrder.Order.PromotionCoupon=null,this.salesOrder.Order.PromotionNote=null)}onShowModalRedeem(){this.onClose(),this.dialog.open(ui)}static \u0275fac=function(e){return new(e||n)(m(L),m(A),m(Ce),m(j),m(ce),m(dt),m(U),m(mt),m(oe),m(ge))};static \u0275cmp=P({type:n,selectors:[["POS-modal-discount"]],decls:7,vars:4,consts:[[3,"keydown.F2","onOk","onCancel","onClose","config"],[1,"container"],[3,"onTabChange"],["tabTitle","Discount",3,"active"],["matTooltipPosition","above","tabTitle","Tax"],["tabTitle","Calculator"],[1,"row","d-flex","align-items-center","justify-content-start"],[1,"col-3"],[1,"fw-bold","d-block"],[1,"col-9"],["type","text","data-cy","discount1","autoNum","","percentage","","decimalPlaces","2","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],[1,"ms-1"],[1,"mx-2"],["type","text","data-cy","discount2","autoNum","","percentage","","decimalPlaces","2","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],[1,"row","d-flex","align-items-center","justify-content-start","mt-6"],[1,"col-9","d-flex","align-items-center"],["type","text","data-cy","discountamount","autoNum","","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","100px",3,"ngModelChange","disabled","ngModel"],["role","button"],["role","button",3,"click"],[1,"fa-solid","fa-info-circle","ms-2"],["bindLabel","Label","appendTo","body","bindValue","ID","placeholder","Tax","data-cy","select-tax",2,"width","150px",3,"change","clearable","ngModel","items"],["type","text","data-cy","surcharge","autoNum","","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","85px",3,"ngModelChange","ngModel","max","min"],[1,"col-4"],[1,"col-8","ps-6"],["type","text","num-neg","false","autoNum","","emptyInputBehavior","zero",1,"txtPrice","form-control",2,"width","100px",3,"ngModelChange","ngModel"],[1,"row","mt-6","g-0","d-flex","align-items-center","justify-content-start"],[1,"col-8","ps-4"],["type","text","data-cy","discountCal1","autoNum","","percentage","","decimalPlaces","2","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],["type","text","data-cy","discountCal2","autoNum","","decimalPlaces","2","percentage","","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],["type","text","data-cy","discountCal3","autoNum","","percentage","","decimalPlaces","2","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(r(0,"modal-material",0),g("keydown.F2",function(){return i.onOk()})("onOk",function(){return i.onOk()})("onCancel",function(){return i.onClose()})("onClose",function(){return i.onClose()}),r(1,"content")(2,"div",1)(3,"custom-tabs",2),g("onTabChange",function(l){return i.onTabChange(l)}),u(4,Rl,21,7,"tab",3),u(5,Nl,15,6,"tab",4),u(6,Al,25,4,"tab",5),a()()()()),e&2&&(d("config",i.modalConfig),s(4),f(i.userRole.Discount?4:-1),s(),f(i.userRole.Tax?5:-1),s(),f(i.userRole.Discount?6:-1))},dependencies:[Z,be,X,z,ne,zi,Fr,Lr,V,Ct,ct,Xe,Y],encapsulation:2})};var Mn=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=$t({type:n});static \u0275inj=Wt({imports:[Z,be,Ze,V,ti,Ct,_a,zi,Xe,xn,tt,Ar,ei,Jt,dr,$i,ba,Pt,Dt,ya,mn,Ct,fi,Ft,ni,ri,pa,da]})};var kn=class n{constructor(t,e,i,o,l,v,E){this.orderProcessorService=t;this.posDataService=e;this.signalBroadCast=i;this.calculatorService=o;this.OrderHttpService=l;this.localDataService=v;this.posService=E;this.newSale=new Ue}newSale;retrySubmit(){let t=this.posService.Data.AppConfigJSON,e=this.posDataService.Data;this.posDataService.submitOrder(t).then(i=>{i.Success?(this.broadcastToCustomerDisplay(i),this.posDataService.pushNewValue(e),this.orderProcessorService.updatePosState(1,i)):(this.posDataService.pushNewValue(e),this.orderProcessorService.updatePosState(1,i))}).catch(i=>{console.log(i)})}broadcastToCustomerDisplay(t){let i=this.posDataService.Data.TotalPaidAmount-this.calculatorService.Data;this.signalBroadCast.BroadcastStateToCustomerDisplay(1,t.ObjectID,t.LoyaltyPoint,i).subscribe()}saveOffline(){let t=this.posDataService.Data,e=this.OrderHttpService.generatePOSDataForSubmission(t,!1);this.localDataService.syncOrder(e).subscribe(()=>{this.newSale.next()})}static \u0275fac=function(e){return new(e||n)(m(U),m(A),m(on),m(Ce),m(Oe),m(et),m(j))};static \u0275cmp=P({type:n,selectors:[["app-retry"]],outputs:{newSale:"newSale"},decls:21,vars:0,consts:[[1,"card"],[1,"card-header","bg-gradient-danger"],[1,"d-flex","justify-content-between"],[1,"fa-solid","fa-times-circle","me-1","text-danger"],[1,"card-body"],[1,"row","justify-content-center","g-0","mt-8"],[1,"col-8","text-center"],[1,"text-danger","fs-5"],[1,"row","mt-4","justify-content-center","g-0","mb-9"],[1,"col-5","text-center"],["type","button","matTooltipPosition","above","matTooltip","Upload your local / offline order to the cloud",1,"btn","btn-success","btn-lg","fs-3",3,"click"],[1,"card-footer","bg-light-gray"],[1,"row","justify-content-between","py-6"],[1,"col-auto"],["type","button","matTooltipPosition","above","matTooltip","Temporarily save data locally until connection to the server is restored",1,"btn","btn-light-gray",3,"click"],[1,"fa-solid","fa-save","me-2",2,"font-size","14px"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),h(4,"i",3),p(5," Order Upload Fail! "),a()()(),r(6,"div",4)(7,"div",5)(8,"div",6)(9,"p",7),p(10," Slow Connection Detected, Check the customer invoice list first. If the transaction isn't there, click the 'Retry' button. "),a()()(),r(11,"div",8)(12,"div",9)(13,"button",10),g("click",function(){return i.retrySubmit()}),p(14," Retry Upload "),a()()()(),r(15,"div",11)(16,"div",12)(17,"div",13)(18,"button",14),g("click",function(){return i.saveOffline()}),h(19,"i",15),p(20,"Save Offline "),a()()()()())},dependencies:[Xe,se],encapsulation:2})};var Ta=(()=>{class n{constructor(){this.emailRegex=S.emailRegex,this.phoneNumberRegex=S.phoneNumberRegex}validate(e){let i=this.emailRegex,o=this.phoneNumberRegex,l=i.test(e.value),v=o.test(e.value);if(l||v||e.value=="")return null;{let E="Please input a valid email or phone number";return v?E="Please input a valid email":l&&(E="Please input a valid phone number"),{invalidEmailOrPhoneNumber:{value:e.value,errMessage:E}}}}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275dir=jo({type:n,selectors:[["","pOSIsInvalidEmailOrPhoneNumber",""]],features:[st([{provide:nr,useExisting:n,multi:!0}])]})}}return n})();function Ll(n,t){n&1&&(r(0,"div",1)(1,"h4",2),p(2," For use this feature you must register first!"),h(3,"br"),p(4," Click the link below "),a()(),r(5,"a",3),p(6,"more information"),a(),p(7," > "))}function Fl(n,t){if(n&1){let e=y();r(0,"div",4)(1,"div",5)(2,"span",6),h(3,"i",7),a(),h(4,"input",8),r(5,"button",9),p(6,"Copy to Clipboard"),a()()(),r(7,"div",10)(8,"div",11)(9,"span",12),h(10,"i",13),a(),h(11,"input",14),r(12,"button",15),g("click",function(){C(e);let o=c();return _(o.onSendViaWhatsApp())}),p(13,"Send via WhatsApp"),a()()()}if(n&2){let e=c();s(4),d("value",e.data.link),s(),d("cdkCopyToClipboard",e.data.link),s(6),d("formControl",e.whatsAppNumberCtrl),s(),d("disabled",e.whatsAppNumberCtrl.invalid)}}var Ti=class n{constructor(t,e,i){this._dialogRef=t;this._toast=e;this.data=i}modalConfig=new B;whatsAppNumberCtrl;ngOnInit(){this.modalConfig.title="Midtrans Payment Link",this.modalConfig.hideFooter=!0,this.modalConfig.customWidth="500px",this.initWaNumberCtrl()}initWaNumberCtrl(){this.whatsAppNumberCtrl=new ar(null,[xi.pattern("^[0-9]*$"),xi.required])}close(){this._dialogRef.close()}onSendViaWhatsApp(){let t=this.whatsAppNumberCtrl.value;if(t){let e="https://wa.me/"+t+"?text="+this.data.link;window.open(e,"_blank")}else this._toast.error("Phone Number must be insert")}static \u0275fac=function(e){return new(e||n)(m(L),m(K),m(ge))};static \u0275cmp=P({type:n,selectors:[["POS-modal-generate-link"]],standalone:!1,decls:4,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"input-group","mb-2",2,"width","350px"],[1,"fw-normal","d-block"],["href","https://midtrans.com/id/product/payment-link","target","_blank"],[1,"col-sm-12"],[1,"input-group"],["id","inputGroup-sizing-lg p-6",1,"input-group-text"],[1,"fa-solid","fa-link","fs-5"],["readonly","","type","text","aria-label","Link href",1,"form-control",3,"value"],["id","btnCopyLink","type","button",1,"btn","btn-outline-secondary",2,"width","150px",3,"cdkCopyToClipboard"],[1,"col-sm-12","mt-6"],[1,"input-group",2,"width","29.4rem"],["id","inputGroup-sizing-lg",1,"input-group-text","p-7"],[1,"fa-solid","fa-mobile-screen-button","fs-3"],["type","text","placeholder","Mobile Number (e.g. 6281500000000)","aria-label","Mobile Number (e.g. 6281500000000)",1,"form-control",3,"formControl"],["id","btnSend","type","button",1,"btn","btn-outline-secondary",3,"click","disabled"]],template:function(e,i){e&1&&(r(0,"modal-material",0),g("onOk",function(){return i.close()})("onCancel",function(){return i.close()})("onClose",function(){return i.close()}),r(1,"content"),u(2,Ll,8,0)(3,Fl,14,4),a()()),e&2&&(d("config",i.modalConfig),s(2),f(i.data.link==null||i.data.link==""?2:3))},dependencies:[X,z,St,V,Sa],encapsulation:2})};var Ei=(e=>(e[e.Size8CM=2]="Size8CM",e[e.A4=1]="A4",e))(Ei||{});function Bl(n,t){n&1&&(r(0,"div",8),h(1,"i",12),a())}function jl(n,t){n&1&&(r(0,"div",8),h(1,"i",12),a())}var wn=class n{constructor(t){this.data=t;this.modalConfig.title="Invoice Paper Size",this.modalConfig.customWidth="460px",this.modalConfig.okText="<i class='fas fa-print'></i> Print",this.data?.invoicePaperSize!==void 0&&this.selectedPaperSize.set(this.data.invoicePaperSize)}dialogRef=H(L);modalConfig=new B;paperSizeType=Ei;selectedPaperSize=R(2);selectSize(t){this.selectedPaperSize.set(t)}print(){this.dialogRef.close(this.selectedPaperSize())}close(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||n)(m(ge))};static \u0275cmp=P({type:n,selectors:[["POS-modal-print-options"]],decls:22,vars:7,consts:[[3,"onCancel","onClose","onOk","config"],[1,"print-subtitle"],["role","button",1,"option-card",3,"click"],[1,"option-icon","option-icon--green"],[1,"fas","fa-receipt"],[1,"option-body"],[1,"option-title"],[1,"option-desc"],[1,"option-check"],["role","button",1,"option-card","mt-3",3,"click"],[1,"option-icon","option-icon--blue"],[1,"fas","fa-file-lines"],[1,"fas","fa-check"]],template:function(e,i){e&1&&(r(0,"modal-material",0),g("onCancel",function(){return i.close()})("onClose",function(){return i.close()})("onOk",function(){return i.print()}),r(1,"content")(2,"p",1),p(3,"Choose the paper format for your printout:"),a(),r(4,"div",2),g("click",function(){return i.selectSize(i.paperSizeType.Size8CM)}),r(5,"div",3),h(6,"i",4),a(),r(7,"div",5)(8,"div",6),p(9,"8cm \u2014 Thermal Receipt"),a(),r(10,"div",7),p(11,"Standard POS thermal printer roll"),a()(),u(12,Bl,2,0,"div",8),a(),r(13,"div",9),g("click",function(){return i.selectSize(i.paperSizeType.A4)}),r(14,"div",10),h(15,"i",11),a(),r(16,"div",5)(17,"div",6),p(18,"A4 \u2014 Standard Document"),a(),r(19,"div",7),p(20,"Standard invoice size (210 \xD7 297mm)"),a()(),u(21,jl,2,0,"div",8),a()()()),e&2&&(d("config",i.modalConfig),s(4),bi("option-card--selected",i.selectedPaperSize()===i.paperSizeType.Size8CM),s(8),f(i.selectedPaperSize()===i.paperSizeType.Size8CM?12:-1),s(),bi("option-card--selected",i.selectedPaperSize()===i.paperSizeType.A4),s(8),f(i.selectedPaperSize()===i.paperSizeType.A4?21:-1))},dependencies:[V],styles:[".print-subtitle[_ngcontent-%COMP%]{color:#6c757d;font-size:13px;margin-bottom:16px}.option-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px;border:1.5px solid #e6e9eb;border-radius:12px;cursor:pointer;background:#fff;transition:border-color .15s,background .15s;-webkit-user-select:none;user-select:none}.option-card[_ngcontent-%COMP%]:hover{border-color:#cfd8dc;background:#fbfbfb}.option-card--selected[_ngcontent-%COMP%]{border:2px solid #22c55e!important;background:#f0fdf4!important}.option-icon[_ngcontent-%COMP%]{width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0}.option-icon--green[_ngcontent-%COMP%]{background:#ecfdf5;color:#16a34a}.option-icon--blue[_ngcontent-%COMP%]{background:#eef2ff;color:#2563eb}.option-body[_ngcontent-%COMP%]{flex:1}.option-title[_ngcontent-%COMP%]{font-weight:600;font-size:14px;color:#1a1a1a}.option-desc[_ngcontent-%COMP%]{font-size:12px;color:#6c757d;margin-top:2px}.option-check[_ngcontent-%COMP%]{width:28px;height:28px;border-radius:50%;background:#22c55e;color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;flex-shrink:0}.btn-cancel[_ngcontent-%COMP%]{background:none;border:none;color:#6c757d;font-size:14px;font-weight:500;padding:8px 16px;cursor:pointer;border-radius:8px}.btn-cancel[_ngcontent-%COMP%]:hover{color:#495057;background:#f8f9fa}.btn-print[_ngcontent-%COMP%]{background:#4a90d9;border:none;color:#fff;font-size:14px;font-weight:500;padding:10px 22px;cursor:pointer;border-radius:10px;display:flex;align-items:center;gap:8px}.btn-print[_ngcontent-%COMP%]:hover{background:#3a7fc1}"],changeDetection:0})};var Wl=n=>({"rounded-0 rounded-start-2":n}),Ql=(n,t)=>({"bg-gradient-warning":n,"bg-gradient-danger":t}),$l=n=>({"text-danger":n}),zl=n=>({offline:n}),ql=n=>({"ms-2":n}),Gl=(n,t)=>({ID:n,Template:t}),Jl=(n,t,e)=>({InvoiceID:n,OutID:t,Template:e}),Kl=n=>({ID:n,Print:1,Printer:"Normal"}),Yl=n=>({ID:n}),Zl=(n,t)=>({cursor:n,opacity:t});function Xl(n,t){if(n&1&&(r(0,"a",42),p(1,"Delivery Order"),a()),n&2){let e=c(3);d("queryParams",he(1,Gl,e.completeData.OutDeliveryID,e.outletRegister.PrintTemplate.ID))}}function es(n,t){if(n&1&&(r(0,"a",43),p(1,"Invoice & Delivery Order"),a()),n&2){let e=c(3);d("queryParams",yi(1,Jl,e.completeData.ObjectID,e.completeData.OutDeliveryID,e.outletRegister.PrintTemplate.ID))}}function ts(n,t){if(n&1&&(r(0,"a",44),p(1,"Invoice (No Price)"),a()),n&2){let e=c(3);d("href",e.getInvoicePrintURL(!0),rt)}}function is(n,t){if(n&1&&(r(0,"a",45),p(1,"Packing Slip"),a()),n&2){let e=c(3);d("queryParams",T(1,Kl,e.completeData.OutDeliveryID))}}function ns(n,t){if(n&1&&(r(0,"div",29),h(1,"button",40),r(2,"div",41),u(3,Xl,2,4,"a",42),u(4,es,2,5,"a",43),u(5,ts,2,1,"a",44),u(6,is,2,3,"a",45),a()()),n&2){let e=c(2);s(3),f(e.completeData.OutDeliveryID?3:-1),s(),f(e.completeData.OutDeliveryID?4:-1),s(),f(e.completeData?5:-1),s(),f(e.completeData.OutDeliveryID?6:-1)}}function os(n,t){n&1&&(r(0,"div",31)(1,"div",35)(2,"p",46),p(3," Transaction saved to your browser's local storage. Please upload when connection is restored! "),a()()())}function rs(n,t){if(n&1){let e=y();r(0,"div",32)(1,"div",47)(2,"div",48),g("click",function(){C(e);let o=c(2);return _(o.changeReceiptContact())}),h(3,"i"),a(),r(4,"input",49),g("ngModelChange",function(o){C(e);let l=c(2);return _(l.isPhoneOrEmail(o))}),a()(),r(5,"div",50)(6,"button",51),g("click",function(){C(e);let o=c(2);return _(o.sendReceiptToContact())}),p(7," Send Receipt "),a()()()}if(n&2){let e=c(2);s(3),le(e.receiptIcon+" fs-4"),s(),d("formControl",e.customerContact),s(2),d("disabled",e.customerContact.invalid)}}function as(n,t){if(n&1&&(r(0,"small",33),p(1),a()),n&2){let e=c(2);s(),x(" ",e.customerContact.errors==null||e.customerContact.errors.invalidEmailOrPhoneNumber==null?null:e.customerContact.errors.invalidEmailOrPhoneNumber.errMessage," ")}}function ls(n,t){if(n&1){let e=y();r(0,"button",52),g("click",function(){C(e);let o=c(2);return _(o.onRetry())}),p(1," Retry Upload "),a()}}function ss(n,t){if(n&1){let e=y();r(0,"div",54)(1,"button",55),g("click",function(){C(e);let o=c(3);return _(o.generateLink())}),h(2,"i",56),p(3,"Generate Payment Link "),a()()}}function cs(n,t){if(n&1){let e=y();r(0,"div",54)(1,"button",57),g("click",function(){C(e);let o=c(3);return _(o.verifyPaymentSettlement())}),h(2,"i",58),p(3,"Verify Payment Settlement "),a()()}}function ps(n,t){if(n&1&&(r(0,"div",39)(1,"div",53),u(2,ss,4,0,"div",54),u(3,cs,4,0,"div",54),a()()),n&2){let e=c(2);s(2),f(e.completeData.PaymentStateID==1?2:-1),s(),f(e.isNotEmpty(e.paymentGatewayService.getTransactionId())?3:-1)}}function ds(n,t){if(n&1){let e=y();r(0,"div",7)(1,"div",24)(2,"div",25)(3,"h2",26),h(4,"i",27),p(5," Sell Complete "),r(6,"small",28),p(7),a()(),r(8,"div"),u(9,ns,7,4,"div",29),a()()(),r(10,"div",13)(11,"div",30),u(12,os,4,0,"div",31)(13,rs,8,4,"div",32),u(14,as,2,1,"small",33),r(15,"div",34)(16,"div",35)(17,"div",36),u(18,ls,2,0,"button",37),r(19,"button",38),g("click",function(){C(e);let o=c();return _(o.newSale())}),p(20," New Sale (F8) "),a()()()()()(),u(21,ps,4,2,"div",39),a()}if(n&2){let e=c();s(),d("ngClass",he(10,Ql,(!e.isOrderDateNow||e.completeData.PaymentStateID<3)&&e.completeData.PaymentStateLabel!="Offline",e.completeData.PaymentStateLabel=="Offline")),s(2),d("ngClass",T(13,$l,(!e.isOrderDateNow||e.completeData.PaymentStateID===1)&&e.completeData.PaymentStateLabel!="Offline")),s(4),x(" (",e.completeData.PaymentStateLabel,") "),s(2),f(e.completeData.PaymentStateLabel=="Offline"?9:-1),s(2),d("ngClass",T(15,zl,e.completeData.PaymentStateLabel=="Offline")),s(),f(e.completeData.PaymentStateLabel=="Offline"?12:13),s(2),f(e.customerContact!=null&&e.customerContact.invalid&&(e.customerContact!=null&&e.customerContact.dirty||e.customerContact!=null&&e.customerContact.touched)?14:-1),s(4),f(e.completeData.PaymentStateLabel=="Offline"&&!e.isSuccessRetrySubmit()?18:-1),s(),d("ngClass",T(17,ql,e.completeData.PaymentStateLabel=="Offline")),s(2),f(e.isOnline&&(e.completeData==null?null:e.completeData.PaymentStateID)==1||e.isNotEmpty(e.paymentGatewayService.getTransactionId())?21:-1)}}function ms(n,t){if(n&1){let e=y();r(0,"app-retry",59),g("newSale",function(){C(e);let o=c();return _(o.newSale())}),a()}}function us(n,t){if(n&1&&(r(0,"a",11),p(1),a()),n&2){let e=c();d("queryParams",T(2,Yl,e.completeData.ObjectID)),s(),x(" Invoice #",e.completeData==null?null:e.completeData.InvoiceNumber," ")}}function fs(n,t){if(n&1&&(r(0,"span",12),p(1),a()),n&2){let e=c();s(),x(" Invoice #",e.completeData==null?null:e.completeData.InvoiceNumber," ")}}function gs(n,t){if(n&1&&(p(0),b(1,"number")),n&2){let e=c().$implicit;Ee(" ",e.CurrencySymbol," ",I(1,2,e.Amount)," ")}}function Cs(n,t){n&1&&p(0," - ")}function _s(n,t){if(n&1&&(r(0,"div",60)(1,"div",61),p(2),a(),r(3,"div",62),u(4,gs,2,4)(5,Cs,1,0),a()()),n&2){let e=t.$implicit,i=c(2);s(2),D(e.Label),s(2),f(i.role.PriceVisible?4:5)}}function hs(n,t){if(n&1&&(r(0,"div",13),te(1,_s,6,2,"div",60,de),a()),n&2){let e=c();s(),ie(e.itemSummary)}}function vs(n,t){if(n&1&&(r(0,"div",63)(1,"div",65),p(2),a(),r(3,"div",66),p(4),b(5,"number"),a()()),n&2){let e=t.$implicit,i=t.$index,o=c(2);s(),d("hidden",!o.role.PriceVisible),s(),Ee(" ",e.Label,": ",e.CurrencySymbol," "),s(),d("hidden",!o.role.PriceVisible)("ngClass",i+1===o.amountSummary.length?"amount":""),s(),x(" ",I(5,6,e.Amount)," ")}}function bs(n,t){if(n&1&&(r(0,"div",63)(1,"div",65),p(2),a(),r(3,"div",67),p(4),b(5,"number"),a()()),n&2){let e=t.$implicit,i=c(3);s(),d("hidden",!i.role.PriceVisible),s(),Ee(" ",e.Label,": ",e.CurrencySymbol," "),s(),d("hidden",!i.role.PriceVisible),s(),x(" ",I(5,5,e.Amount)," ")}}function Ss(n,t){if(n&1&&(r(0,"div",64),te(1,bs,6,7,"div",63,de),a()),n&2){let e=c(2);s(),ie(e.paymentSummary)}}function ys(n,t){if(n&1&&(r(0,"div",14),te(1,vs,6,8,"div",63,de),u(3,Ss,3,0,"div",64),a()),n&2){let e=c();s(),ie(e.amountSummary),s(2),f((e.paymentSummary==null?null:e.paymentSummary.length)>0?3:-1)}}function xs(n,t){if(n&1&&(r(0,"div",15)(1,"div",68)(2,"p",69),p(3,"INVALID AMOUNT CHARGE, CORRECT AMOUNT"),a(),r(4,"P",70),p(5),b(6,"number"),a()()()),n&2){let e=c();s(5),x("",I(6,1,e.completeData==null?null:e.completeData.Final)," ")}}function Is(n,t){if(n&1){let e=y();r(0,"a",71),g("click",function(o){C(e);let l=c();return _(l.isGlobalPrintEnabled()?null:o.preventDefault())}),h(1,"i",72),a()}if(n&2){let e=c();d("href",e.getInvoicePrintURL(!1),rt)("matTooltip",e.isGlobalPrintEnabled()?"Print in New Tab":"Required Global Print Role")("ngStyle",he(3,Zl,e.isGlobalPrintEnabled()?"pointer":"default",e.isGlobalPrintEnabled()?"1":"0.5"))}}function Ps(n,t){if(n&1&&(r(0,"div",7)(1,"div",9)(2,"h3",10),p(3,"Point Balance"),a()(),h(4,"div",73),a()),n&2){let e=c();s(4),d("innerHtml",e.completeData.LoyaltyPoint,Qt)}}function Ds(n,t){if(n&1&&h(0,"pos-receipt",74),n&2){let e=c(2);d("data",e.receiptTemplate)("printTemplate",e.outletRegister.PrintTemplate)("config",e.posStorage.AppConfigJSON)("priceVisibleRestriction",!e.role.PriceVisible)("outletInfo",e.outletRegister)("isUnknownError",e.currentSellState==e.sellState.UploadOrderFail)("isOffline",e.isOnline==!1)("stylesheet",e.posStorage.StylesSheet)}}function Os(n,t){if(n&1&&h(0,"pos-receipt-a4",75),n&2){let e=c(3);d("data",t)("printTemplate",e.outletRegister.PrintTemplate)("config",e.posStorage.AppConfigJSON)("workOrderMode",!1)("stylesheet",e.posStorage.StylesSheet)}}function Ms(n,t){if(n&1&&(u(0,Os,1,5,"pos-receipt-a4",75),b(1,"async")),n&2){let e,i=c(2);f((e=I(1,1,i.receiptTemplateA4$))?0:-1,e)}}function ks(n,t){if(n&1&&(u(0,Ds,1,8,"pos-receipt",74),u(1,Ms,2,3)),n&2){let e=c();f(e.receiptTemplate&&e.printMode==2?0:-1),s(),f(e.printMode==1?1:-1)}}function ws(n,t){n&1&&(r(0,"div",23)(1,"h1"),p(2," Cannot generate print preview because of client-server amount Mismatch "),a()())}var Tn=class n{constructor(t,e,i,o,l,v,E,Q,Se,we,je,Ci,_i,Nt,so,hi,Mo,co,ko,Ka,Ya){this._posDataService=t;this._posService=e;this._orderProcessorService=i;this._OrderHttpService=o;this._PaymentHttpService=l;this._receiptService=v;this._outletService=E;this._toastr=Q;this._onlineStatusService=Se;this._matDialog=we;this._signalBroadCast=je;this._calculatorService=Ci;this._userRoleService=_i;this._router=Nt;this._receiptCalculatorService=so;this.datePipe=hi;this.decimalPipe=Mo;this.paymentGatewayService=co;this.paymentHttpService=ko;this.shoppingCartService=Ka;this.roleService=Ya;this.isGlobalPrintEnabled.set(this.roleService.global.Print)}whatsappSendReceiptService=H(ho);handleF8(){this.newSale()}salesOrder=new qe;receiptTemplate=null;receiptTemplateA4$;completeData=new ea;printMode=2;paperSizeType=Ei;outletRegister=new Zi;role;finalAmountDifferent=!1;amountSummary=[];itemSummary=[];paymentSummary=[];isOnline=!1;destroy$=new $;get posStorage(){return this._posService.Data}currentSellState;isOrderDateNow;sellState=Pe;receiptIcon="fa-brands fa-whatsapp";customerContact=new bt;printOnPayment=R(!0);isSuccessRetrySubmit=R(!1);isGlobalPrintEnabled=R(!0);ngOnInit(){this.resetUrlAfterRedirect(),this.subscribeToObservableChanges()}subscribeToObservableChanges(){this._onlineStatusService.getOnlineStatus$().pipe(w(this.destroy$)).subscribe(t=>{this.isOnline=t}),this._userRoleService.Data$.pipe(w(this.destroy$)).subscribe(t=>{this.role=t}),this._posDataService.Data$.pipe(w(this.destroy$)).subscribe(t=>{this.salesOrder=t}),this._outletService.Data$.pipe(w(this.destroy$)).subscribe(t=>{this.outletRegister=t;let e=this.outletRegister?.PrintTemplate?.PrintMode;this.initPrintMode(e)}),this._orderProcessorService.Data$.pipe(ae(t=>t.posState===1||t.posState===9),w(this.destroy$)).subscribe(t=>{if(this.currentSellState=t.posState,this.generateCompleteSummary(),this._OrderHttpService.Data){let e=this.posStorage?.AppConfigJSON?.ModuleSell?.OrderComplete?.PrintOnPayment;this.printOnPayment.set(e),this.completeData=this._OrderHttpService.Data,this.checkFinalAmountDifferent(),this.setLoyaltyLabelConfig(),this.InitPrintInvoice(),this.initCustomerContact(),this.sendEmailOnComplete(),this.checkOrderDateIsNow(),this.clearShoppingCartInLocalStorage()}})}clearShoppingCartInLocalStorage(){this.shoppingCartService.clearCartItemsInLocalStorage()}generateCompleteSummary(){this.itemSummary=this._receiptService.generateCartItemSummary(),this.amountSummary=this._receiptCalculatorService.generateAmountSummary(),this.paymentSummary=this._receiptService.generatePaymentSummary()}initPrintMode(t){this.isOnline?this.printMode=t:this.printMode=2}sendEmailOnComplete(){let t=this.posStorage?.AppConfigJSON?.ModuleSell?.OrderComplete?.EmailReceipt,e=this.completeData?.Contact?.Email;t&&S.IsNotEmpty(e)&&this.sendEmail()}resetUrlAfterRedirect(){this._router.events.pipe(w(this.destroy$)).subscribe(t=>{t instanceof Zo&&(t?.url?.includes("Sell")||(this._orderProcessorService.createNewTransactionInSameOutletRegister(),this._signalBroadCast.BroadcastStateToCustomerDisplay(0).subscribe()))})}InitPrintInvoice(){this.currentSellState==1&&(this.checkOrderNumber(),this.print())}initCustomerContact(){if(this.posStorage?.AppConfigJSON.ModuleSell.OrderComplete.DefaultReceiptChannel==0){this.receiptIcon="fa-solid fa-envelope";let t=this.completeData?.Contact?.Email;this.customerContact.setValue(t)}else if(this.posStorage?.AppConfigJSON.ModuleSell.OrderComplete.DefaultReceiptChannel==1){this.receiptIcon="fa-brands fa-whatsapp";let t=this.completeData?.Contact?.Mobile;this.customerContact.setValue(t)}}isPhoneOrEmail(t){let e=S.emailRegex,i=S.phoneNumberRegex,o=e,l=i,v=o.test(t),E=l.test(t);if(v)return this.receiptIcon="fa-solid fa-envelope","Email";if(E)return this.receiptIcon="fa-brands fa-whatsapp","Mobile"}changeReceiptContact(){this.receiptIcon=="fa-solid fa-envelope"?(this.receiptIcon="fa-brands fa-whatsapp",this.customerContact.setValue(this.completeData?.Contact?.Mobile)):(this.receiptIcon="fa-solid fa-envelope",this.customerContact.setValue(this.completeData?.Contact?.Email))}checkOrderDateIsNow(){let t=this.completeData.OrderTimeString,e=this.datePipe.transform(this.salesOrder.Order.Date,"dd MMM yyyy");this.isOrderDateNow=t.includes(e)}checkFinalAmountDifferent(){if(this.currentSellState==1){let t=this.posStorage.AppConfigJSON,e=this.completeData.Final,i=this.forceToMax4DigitAfterDecimal(this._calculatorService.Data),o=t.ModuleSell.ToleranceAmount,l=e-i;if(l!=o&&l!=0){this.finalAmountDifferent=!0;let v=this.decimalPipe.transform(e);setTimeout(()=>{this._toastr.warning(`Final Amount should be ${v}! Use Print Receipt to print the correct Receipt!`,"Invalid Amount charged",{timeOut:1e4})},500)}else this.finalAmountDifferent=!1}}forceToMax4DigitAfterDecimal(t){let e=t;return this.isDecimalMoreThan4Digits(t)&&(e=parseFloat(t.toFixed(4))),e}isDecimalMoreThan4Digits(t){let e=t.toString(),i=e.indexOf(".");return i!==-1?e.substring(i+1).length>4:!1}checkOrderNumber(){let t=this.completeData.InvoiceNumberResult,e=S.IsNotEmpty(t)&&S.IsNotEmpty(t?.ProposedInvoiceNumber)&&t.ActualInvoiceNumber!=t.ProposedInvoiceNumber;this.completeData.InvoiceNumber!=this.salesOrder.Order.Number&&(this._toastr.warning(`Your ${e?"Order":"Transaction"} number is changed to ${this.completeData.InvoiceNumber}`,"Transaction Number Changed!"),this.salesOrder.Order.Number=this.completeData.InvoiceNumber),e&&this._toastr.warning("Your invoice number is changed to "+t.ActualInvoiceNumber,"Transaction Number Changed!")}generateLink(){this.posStorage.AppConfigJSON.PaymentConfigLink==!0&&this._matDialog.open(Ti);let t={InvoiceID:this.completeData.ObjectID};this._PaymentHttpService.generateLink(t).subscribe({next:e=>{this._matDialog.open(Ti,{data:{link:e.token.redirect_url}})},error:e=>{this._toastr.error(e.Message,"Couldn't generate link!")}})}newSale(){try{this._orderProcessorService.createNewTransactionInSameOutletRegister(!0),this._signalBroadCast.BroadcastStateToCustomerDisplay(0).subscribe(),this.paymentGatewayService.resetPaymentMethod(),this._router.navigate([],{queryParams:{ID:null}})}catch(t){console.error(t),this._toastr.error(t,"Error redirecting to NEW mode")}}onRetry(){this._onlineStatusService.isOnline?this._posDataService.uploadOfflineOrder().subscribe(e=>{e.Success?(this.isSuccessRetrySubmit.set(!0),this.broadcastToCustomerDisplay(e),this._orderProcessorService.updatePosState(1,e)):this._orderProcessorService.updatePosState(1,e)}):this._toastr.error("Please check your internet connection and try again.","Connection Required")}broadcastToCustomerDisplay(t){let i=this._posDataService.Data.TotalPaidAmount-this._calculatorService.Data;this._signalBroadCast.BroadcastStateToCustomerDisplay(1,t.ObjectID,t.LoyaltyPoint,i).subscribe()}getInvoicePrintURL(t){let e="/print/Invoice"+(this.outletRegister.PrintTemplate.PrintMode===2?"Mini":""),i="";return t&&(i="&Print=1&Price=0"),S.StringFormat("{0}?ID={1}&Template={2}{3}",e,this.completeData.ObjectID,this.outletRegister?.PrintTemplate?.ID?.toString(),i)}sendEmail(){if(!this.role.Email){this._toastr.info("You do not have required Role",Re.Info);return}this._OrderHttpService.sendEmail(this.customerContact.value,this.completeData.ObjectID).then(t=>{this._toastr.success(t.Message,"Email sent!")})}sendReceiptByWhatsaap(){let t=this.customerContact.value;this.whatsappSendReceiptService.createCustomerFromNewNumberAndSendReceipt(t,this._calculatorService.currencySymbol,this.posStorage?.AppConfigJSON.ModuleSell.OrderComplete.WhatsappReceipt,{Final:this.completeData.Final,InvoiceNumber:this.completeData.InvoiceNumber,ObjectID:this.completeData.ObjectID},this._posService.Data?.WhatsAppConfigJSON?.TextReceipt)}print(t=!0){let i=this.posStorage?.AppConfigJSON?.ModuleSell?.OrderComplete?.DisplayPaperSizeSelection,o=this._outletService.Data.PrintTemplate?.PrintMode;!t&&i?this._matDialog.open(wn,{data:{invoicePaperSize:o}}).afterClosed().pipe(_e(l=>{l!=null&&(this.printMode=l===this.paperSizeType.A4?1:2,this.triggerPrint())})).subscribe():this.triggerPrint()}triggerPrint(){this.printMode==2?(this.printReceiptMini(),this.printOnPayment()&&this.printWindow()):this.printMode==1&&this.printReceiptA4()}printReceiptMini(){this.receiptTemplate=this._receiptService.generateReceiptMini()}setLoyaltyLabelConfig(){let t=this.posStorage?.AppConfigJSON;t.LoyaltyLabel=t.ApplicationLoyalty.Label,this.posStorage.AppConfigJSON=t}printReceiptA4(){this.receiptTemplateA4$==null?this.receiptTemplateA4$=this._OrderHttpService.generateReceiptA4(this.completeData.ObjectID).pipe(w(this.destroy$),Ge(t=>(t.Data.AfterSell=!0,t.Data)),vi(t=>{throw this._toastr.error(`Could not print in A4 format!
|
|
@@ -54,4 +54,4 @@ Printing in 8mm format instead!`,"Error!"),this.printReceiptMini(),t}),_e(()=>{t
|
|
|
54
54
|
Please add the tag <a href="/menu/Setup/Tag/Sales_Order">here</a> to continue.
|
|
55
55
|
</p>
|
|
56
56
|
`,headerType:Re.Error},width:"28rem"})}initializeRole(){let e=new Ot(this.roleService);this.userRoleService.pushNewValue(e)}subscribeToObservable(){this.orderProcessorService.Data$.pipe(w(this.destroy$)).subscribe(e=>{this.currentState=e.posState}),this.signalRClientService.OnPaymentReceived.pipe(w(this.destroy$)).subscribe(e=>{this.onQRPaymentComplete(e)}),this.outletService.Data$.pipe(w(this.destroy$)).subscribe(e=>{this.outletRegister=e,this.onOpenDialogOfflineOrder()}),this.userRoleService.Data$.pipe(w(this.destroy$)).subscribe(e=>{this.userRole=e}),this.parkOrderService.onPrint$.pipe(w(this.destroy$)).subscribe(e=>{switch(this.isPrintBillA4=!1,this.isPrintBillMini=!1,this.isPrintPark=!1,this.receiptTemplate=e.template,e.type){case"BILL_A4":this.isPrintBillA4=!0;break;case"BILL_MINI":this.isPrintBillMini=!0;break;case"PARK":this.isPrintPark=!0;break}this.receiptService.printWindow().finally(()=>{this.receiptTemplate=null})})}onQRPaymentComplete(e){if(!S.IsEmpty(e)){let i=JSON.parse(e);this.paymentServiceGateway.onQRPaymentComplete(i,this.posHttpResponse.AppConfigJSON).then(o=>{this.dialog.getDialogById("ModalPayment").close();let E=`IDR ${this.decimalPipe.transform(i.gross_amount)} received. Please verify in customer mobile app!`;this.toastr.success(E," QR Settlement"),this.paymentServiceGateway.clearTransactionID(),this.orderProcessorService.updatePosState(1,o)}).catch(o=>{this.toastr.error(o.message,o.header?o.header:"Error")})}}editInvoice(e){this.orderProcessorService.updatePosState(2),this.orderHttpService.GetInvoiceBySoID(e).pipe(w(this.destroy$)).subscribe(i=>{this.invoiceNumberEdit=i.Invoice.Number,i.Invoice.Number=null,this.orderProcessorService.plainToClass(i)})}openModalConfirmContinueEdit(e,i){this.currentState==2?this.dialog.open(Gn).afterClosed().pipe(ae(o=>!S.IsEmpty(o))).subscribe(o=>{if(o==="CONTINUE_EDITING"){let l=this.salesOrderService.Data?.Order?.ID;this.router.navigate(["/menu/Sell"],{queryParams:{ID:l},queryParamsHandling:"merge"})}else o==="CREATE_NEW_ORDER"&&(this.orderProcessorService.createNewTransactionInSameOutletRegister(!0),this.orderProcessorService.emitClearOrder())}):this.outletService.setActiveRegisterFromOptions(e,i)}showDialogServerClientTimeDiff(e){return this.serverClientTimeService.getDaysDifference(e)===0?At(null):this.dialog.open(Jn,{disableClose:!0,data:{serverTime:e}}).afterClosed()}ngOnDestroy(){this.intercomService.showLauncher(),this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(i){return new(i||n)(m(et),m(j),m(q),m(Xo),m(tr),m(U),m(Y),m(rn),m(oe),m(K),m(ke),m(ce),m(Et),m(Oe),m(yt),m(cr),m(hr),m(Xt),m(wt),m(ln),m(vt),m(pt),m(Be),m(kt),m(mt),m(li),m(A),m(an))};static \u0275cmp=P({type:n,selectors:[["POS-sell-v3"]],features:[st([ke,Rt]),Vi],decls:8,vars:7,consts:[[1,"d-block","d-print-none"],[1,"container-fluid","sell-container",3,"ngClass"],[1,"row"],[1,"print_containers"],[3,"data","printTemplate","config","stylesheet"],[3,"data","printTemplate","config","outletInfo","stylesheet"],[3,"data","printTemplate","config","priceVisibleRestriction","outletInfo","stylesheet"],[1,"row","d-print-none"],[1,"col-5","pe-6"],[1,"border-start","ps-6","col-7"],[1,"col-12","px-0"]],template:function(i,o){i&1&&(h(0,"subscription-alert",0),r(1,"div",1),u(2,wu,1,1)(3,Tu,3,0,"div",2),a(),r(4,"div",3),u(5,Eu,1,4,"park-order",4),u(6,Ru,1,5,"POS-bill-receipt-A4",5),u(7,Nu,1,6,"pos-receipt",6),a()),i&2&&(s(),d("ngClass",T(5,Mu,o.currentSubsStatus==o.subscriptionStatus.OVERDUE||o.currentSubsStatus==o.subscriptionStatus.SELL_ONLY)),s(),f(o.currentState!=o.sellState.IsComplete&&o.currentState!=o.sellState.UploadOrderFail?2:3),s(3),f(o.isPrintPark&&o.receiptTemplate?5:-1),s(),f(o.receiptTemplate&&o.isPrintBillA4?6:-1),s(),f(o.receiptTemplate&&o.isPrintBillMini?7:-1))},dependencies:[Z,J,Sn,Zn,ga,lo,Mn,Ze,Pt,Yi,Ki,un,Zr,Yr,Kr,Jr,Tn,Dr],styles:[`.cart-background{background-color:#fcfdff}.sell-container{margin:0 auto!important;height:100%}.sell-container>.row{height:100%}.sell-container>.row>[class*=col-]{height:100%}.sell-container .quicky{overflow:hidden}.sell-subscription-overdue{height:calc(100vh - 3rem)!important;overflow-y:auto}.print_containers{display:none}@media print{.print_containers{display:block;text-align:left}.sell-subscription-overdue{height:auto!important;overflow-y:visible!important}}
|
|
57
|
-
`],encapsulation:2})},zx=[{path:"Offline",loadChildren:()=>import("./chunk-
|
|
57
|
+
`],encapsulation:2})},zx=[{path:"Offline",loadChildren:()=>import("./chunk-5OUHL5L3.js").then(n=>n.OfflineModule)},{path:"",loadComponent:()=>Oo}];export{Oo as SellV3Component,zx as routes};
|