dealpos 25.46.2 → 25.46.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-4ZWIQZYV.js → chunk-22O4O5EJ.js} +2 -2
- package/browser/{chunk-NQ3LNNVL.js → chunk-2KJCF3ZC.js} +1 -1
- package/browser/{chunk-CM7Z6YFA.js → chunk-3IX77UOP.js} +1 -1
- package/browser/{chunk-KP7OGAMJ.js → chunk-3VY4BE7Y.js} +1 -1
- package/browser/{chunk-FY2ZQK3Q.js → chunk-3ZL5OQ6Y.js} +1 -1
- package/browser/{chunk-JVFZL3LP.js → chunk-47TR66HI.js} +1 -1
- package/browser/{chunk-TH6BQXNM.js → chunk-4C5SUQ74.js} +1 -1
- package/browser/{chunk-KPVGNOMG.js → chunk-4TZSBBYC.js} +1 -1
- package/browser/{chunk-GMPJ72LI.js → chunk-5F2NFZPL.js} +1 -1
- package/browser/{chunk-NFFC4KSY.js → chunk-5FIHIYPN.js} +1 -1
- package/browser/{chunk-WOAUMRNS.js → chunk-5M7FY5GG.js} +2 -2
- package/browser/{chunk-HOBU2OAG.js → chunk-64GEFRCT.js} +1 -1
- package/browser/{chunk-U3B2DTPX.js → chunk-6EH2754P.js} +1 -1
- package/browser/{chunk-B3JWFPWO.js → chunk-6HNMTYL2.js} +1 -1
- package/browser/{chunk-ILIZ5NZH.js → chunk-6JCGTOWB.js} +2 -2
- package/browser/{chunk-HIOIFMAE.js → chunk-6XWC4HRW.js} +1 -1
- package/browser/{chunk-KA4G654J.js → chunk-77F7XHWC.js} +1 -1
- package/browser/{chunk-JT3HOWQH.js → chunk-7DTB5U3C.js} +2 -2
- package/browser/{chunk-F53OD5V2.js → chunk-7E6JQNGW.js} +1 -1
- package/browser/{chunk-IRDKCXB2.js → chunk-7N4TQJAF.js} +3 -3
- package/browser/{chunk-TVZ622KQ.js → chunk-7TEVE3FN.js} +1 -1
- package/browser/{chunk-HYCJCA6A.js → chunk-ABC2ZDB2.js} +1 -1
- package/browser/{chunk-CGISR53W.js → chunk-AS4NJOPX.js} +1 -1
- package/browser/{chunk-MJIPNN7A.js → chunk-B4ZMF63W.js} +1 -1
- package/browser/chunk-BCUIYEEN.js +1 -0
- package/browser/{chunk-UDWVWF7E.js → chunk-BD7CNS3O.js} +1 -1
- package/browser/{chunk-OQI66KFN.js → chunk-BEWTAI6L.js} +1 -1
- package/browser/{chunk-7QGORD2Z.js → chunk-BOS35V5T.js} +1 -1
- package/browser/{chunk-O2K56L4P.js → chunk-BZMVZ7BI.js} +1 -1
- package/browser/{chunk-HLNB2PE4.js → chunk-CPBXXCCO.js} +1 -1
- package/browser/{chunk-IMST27WS.js → chunk-CRQNIUO7.js} +1 -1
- package/browser/{chunk-CLJWABT2.js → chunk-DGKIIUIQ.js} +1 -1
- package/browser/{chunk-IGKZJP6R.js → chunk-DZ6Z62ZW.js} +1 -1
- package/browser/{chunk-LBXJVRAT.js → chunk-E7N3FPJF.js} +1 -1
- package/browser/{chunk-L424UWKA.js → chunk-ES25MU2C.js} +1 -1
- package/browser/{chunk-DJAISUEF.js → chunk-ESYBXU5L.js} +1 -1
- package/browser/{chunk-475JSTPA.js → chunk-EVNVUCMO.js} +1 -1
- package/browser/{chunk-L5GSB3ZX.js → chunk-G53YHV2L.js} +1 -1
- package/browser/chunk-GDKTBDK6.js +1 -0
- package/browser/{chunk-MIENCGCQ.js → chunk-GKWHR2MJ.js} +1 -1
- package/browser/{chunk-QPN54ILN.js → chunk-HPXM5XAM.js} +1 -1
- package/browser/{chunk-ZK32OWP6.js → chunk-I2R577A6.js} +1 -1
- package/browser/{chunk-S7N22G4D.js → chunk-IJWE5FIC.js} +1 -1
- package/browser/{chunk-N6ZNENQU.js → chunk-J4JOIFPA.js} +1 -1
- package/browser/{chunk-UPV6MUOR.js → chunk-JPJFLPJG.js} +1 -1
- package/browser/{chunk-P5CBDXUP.js → chunk-K3I6K44J.js} +1 -1
- package/browser/{chunk-ED4WZKA6.js → chunk-K4MWTDCL.js} +1 -1
- package/browser/{chunk-MD6WWBSZ.js → chunk-KT64U5FF.js} +1 -1
- package/browser/{chunk-EMJ7V5XH.js → chunk-KUMJBTY5.js} +2 -2
- package/browser/{chunk-TVWGXKBN.js → chunk-KWRGMAZL.js} +1 -1
- package/browser/{chunk-GM6P3WGI.js → chunk-LEPY5WLJ.js} +1 -1
- package/browser/{chunk-TDZ2L7GX.js → chunk-LV3QO3H3.js} +1 -1
- package/browser/{chunk-BLG3XERH.js → chunk-M2Y56GL5.js} +1 -1
- package/browser/{chunk-L5ZIS7CJ.js → chunk-MCI7JNDO.js} +1 -1
- package/browser/{chunk-3BRM3TED.js → chunk-MQPI5PZA.js} +1 -1
- package/browser/{chunk-374PEHK3.js → chunk-NB3DCG2R.js} +1 -1
- package/browser/{chunk-SFQX5FUP.js → chunk-NBHYM7VE.js} +1 -1
- package/browser/chunk-NBMH5YL2.css +1 -0
- package/browser/{chunk-QAQYVKMI.js → chunk-NLLT5X4R.js} +1 -1
- package/browser/{chunk-PO6OVC5B.js → chunk-NUL5GL3Q.js} +1 -1
- package/browser/{chunk-NMOQIXVY.js → chunk-OAP2TSZ6.js} +1 -1
- package/browser/{chunk-DGXQDOCM.js → chunk-OGB3GW4L.js} +1 -1
- package/browser/{chunk-3JKK7ROI.js → chunk-OHG6W52G.js} +1 -1
- package/browser/{chunk-WRVMZNGD.js → chunk-P2TEAJG3.js} +1 -1
- package/browser/chunk-P3SYBLK4.js +21 -0
- package/browser/{chunk-UWWB4ON7.js → chunk-PR7GIWDS.js} +1 -1
- package/browser/{chunk-FNQCKGUC.js → chunk-Q2FWGC3S.js} +1 -1
- package/browser/{chunk-GSFXKVGZ.js → chunk-QBY2W7QQ.js} +1 -1
- package/browser/{chunk-C56YPV2G.js → chunk-REYKQIQH.js} +1 -1
- package/browser/{chunk-GDS3XQ5F.js → chunk-RRSZSQXZ.js} +1 -1
- package/browser/{chunk-6FM7DAHK.js → chunk-S3H5URIA.js} +1 -1
- package/browser/{chunk-FX72NG5O.js → chunk-SE67GHUX.js} +1 -1
- package/browser/{chunk-OR7B4MQC.js → chunk-SKMY43FK.js} +1 -1
- package/browser/{chunk-IKA5TDNG.js → chunk-SU4Y5X62.js} +1 -1
- package/browser/{chunk-MFBHQLLO.js → chunk-T4QRRRCQ.js} +1 -1
- package/browser/{chunk-SVAXS2TA.js → chunk-TEXHMVYL.js} +1 -1
- package/browser/{chunk-QZK5TM5O.js → chunk-U6Q2FJBU.js} +1 -1
- package/browser/{chunk-VWOX66SZ.js → chunk-V3TK75EE.js} +2 -2
- package/browser/{chunk-ZVBZGOUU.js → chunk-WH6ZELDL.js} +1 -1
- package/browser/{chunk-YEV6AJC2.js → chunk-WM7ROROB.js} +1 -1
- package/browser/{chunk-5TOXPQJI.js → chunk-WOGTFZCA.js} +4 -4
- package/browser/{chunk-O4AM5O5P.js → chunk-WZEBH7P5.js} +2 -2
- package/browser/{chunk-LUWTRLMM.js → chunk-X4JLZJ6G.js} +1 -1
- package/browser/{chunk-HYCSLDMX.js → chunk-XAQQNM46.js} +1 -1
- package/browser/{chunk-BR3Y2C2F.js → chunk-XI3UF2BK.js} +1 -1
- package/browser/{chunk-LK7UQBXO.js → chunk-ZGY4RDNA.js} +1 -1
- package/browser/{chunk-KJLTTTEY.js → chunk-ZS75AJOT.js} +1 -1
- package/browser/{chunk-56D7QEFP.js → chunk-ZXOLWDM7.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-ICSDESMZ.js → main-V7C5NVCN.js} +2 -2
- package/browser/main-WPNH2WGQ.css +1 -0
- package/package.json +1 -1
- package/browser/chunk-5ZFCEP2C.css +0 -1
- package/browser/chunk-G5QWJMKY.js +0 -1
- package/browser/chunk-GI7KMXBX.js +0 -21
- package/browser/chunk-PKIK7U7Z.js +0 -1
- package/browser/main-5IXVIJ7Z.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as $r}from"./chunk-BILYIP7J.js";import{a as ho}from"./chunk-F53OD5V2.js";import{b as va,c as Sa}from"./chunk-ZRYRGDGM.js";import{a as Ma,b as Pa}from"./chunk-Z7IU5JLK.js";import{a as ha,b as ba}from"./chunk-NRF37QSD.js";import{a as ya,b as dn}from"./chunk-27Y3MQJV.js";import{a as At}from"./chunk-MEG3XVPI.js";import{a as _a}from"./chunk-C5AIOCPM.js";import{a as pn}from"./chunk-GDS3XQ5F.js";import"./chunk-2KPICU7I.js";import"./chunk-NQX7EX5A.js";import"./chunk-BYXBJQAS.js";import{a as ei}from"./chunk-WMUZZ5XX.js";import{a as ma}from"./chunk-SEOZWGYI.js";import{b as ua,e as fa,f as ga,g as Ca}from"./chunk-POJQGU7L.js";import{b as xa}from"./chunk-BY57IAJ7.js";import"./chunk-DJTAYVZN.js";import"./chunk-P3KIIKY4.js";import{a as Oa}from"./chunk-HBAQBI6Z.js";import{A as Xr,B as Zr,C as an,D as Xt,E as Zt,F as oa,G as ln,H as ra,I as aa,J as cn,K as pa,L as da,a as Fr,b as ut,c as jr,d as De,e as R,f as A,g as Hr,h as me,i as Gi,j as Ur,k as Wr,l as $,m as Qr,n as qr,o as be,p as Xe,q as Dt,r as we,s as Kt,t as Ki,u as Yi,v as Xi,w as Zi,x as _o,y as en,z as U}from"./chunk-5TOXPQJI.js";import"./chunk-JFLT7NX3.js";import"./chunk-YXCPHYC5.js";import"./chunk-W3VF2RCW.js";import"./chunk-DXBQR3VL.js";import{a as Gr,b as zr,c as Kr,d as nn}from"./chunk-LLEPB2B6.js";import{a as ea,b as ta}from"./chunk-3XKRDZSE.js";import{c as on,d as rn}from"./chunk-QDE5Y76C.js";import"./chunk-ULYBLEXA.js";import"./chunk-7NOKG3UC.js";import"./chunk-GODXDKX5.js";import{a as $e,b as ft}from"./chunk-2E4N3RZU.js";import{a as Br,b as ia,c as na}from"./chunk-UE2HBW5H.js";import{a as zi}from"./chunk-2RERZJD4.js";import{a as ca}from"./chunk-23PKMU5D.js";import{a as Me,c as Ji}from"./chunk-HI65LAJQ.js";import{a as Co}from"./chunk-PF33HK6M.js";import"./chunk-AFBBEIKR.js";import{a as go}from"./chunk-IFOBYW26.js";import{a as Jr,b as tn}from"./chunk-XIXDLSA2.js";import{a as sn,b as la,c as sa}from"./chunk-76RLGANX.js";import"./chunk-KYAKLZR7.js";import"./chunk-GI7KMXBX.js";import"./chunk-5UDUWK67.js";import{a as gt,b as Yt}from"./chunk-J7YNB6YX.js";import{a as Yr}from"./chunk-VP2ZEIJA.js";import"./chunk-3GPGJFQV.js";import{a as Ar}from"./chunk-4USQPLEW.js";import"./chunk-J6U6UYNI.js";import{b as Ae}from"./chunk-7PN2DG6D.js";import"./chunk-Z3E24JZW.js";import"./chunk-BYXBJQAS.js";import{c as bi}from"./chunk-Z6RY34PQ.js";import{a as Wi}from"./chunk-NQKVYQ6V.js";import{b as Qi,c as ot}from"./chunk-NSNUUKNK.js";import{a as qi,b as $i}from"./chunk-6H5P35AP.js";import{a as Lr}from"./chunk-DLNZDHGS.js";import"./chunk-RF5WGONA.js";import"./chunk-BYXBJQAS.js";import{a as Ui}from"./chunk-R4OHTTCT.js";import{a as Nr,b as Vr}from"./chunk-QIJEAKQK.js";import"./chunk-QEOGHVXA.js";import"./chunk-4HCSE44G.js";import{b as Fi,c as Pt,d as Ot,e as Jt}from"./chunk-INHUUGSI.js";import{a as _r}from"./chunk-XA4TVPAS.js";import"./chunk-Q2A4MYK3.js";import{e as Rr}from"./chunk-SO4GMA3Y.js";import"./chunk-PECGNYTX.js";import"./chunk-3RK6DDJD.js";import"./chunk-SARJJ3AZ.js";import"./chunk-DC426G2P.js";import"./chunk-3KSZCJ6T.js";import"./chunk-BYO7FJ4O.js";import"./chunk-CBSYYTXQ.js";import{d as ji,e as Hi}from"./chunk-6WEGHV7F.js";import"./chunk-G4IW5GPY.js";import{b as wr,c as kr,d as Tr,e as Er}from"./chunk-U3B2DTPX.js";import"./chunk-JEL3OND6.js";import"./chunk-IDQUQBKL.js";import{c as mr}from"./chunk-YRGHPSPV.js";import"./chunk-VYQEM4T2.js";import"./chunk-UTAQ3FRE.js";import{a as ur,c as fr,e as gr}from"./chunk-M43HNBJQ.js";import{a as ht,c as mt}from"./chunk-KKLNFVVN.js";import"./chunk-X57HWGVJ.js";import"./chunk-5SFUSWFY.js";import"./chunk-534MIVWD.js";import"./chunk-TGEQUV6Z.js";import{a as Or,c as Ir,d as Dr}from"./chunk-6FM7DAHK.js";import{a as Cr,b as hr}from"./chunk-DGXQDOCM.js";import"./chunk-CS6HBROS.js";import{a as sr}from"./chunk-JUS6LLVX.js";import{C as Pr,D as Ye,F as zt,G as It,u as B,v as j,w as ge}from"./chunk-QZMZBCE7.js";import{b as se,c as Ke}from"./chunk-C4WJKF7R.js";import{F as Mr,N as Gt,O as he,a as br,b as vr,n as Bi,t as Sr,u as yr,x as xr}from"./chunk-NZYZO47Z.js";import{d as _t}from"./chunk-7TBS7SPQ.js";import{a as Zo}from"./chunk-RLQLFW36.js";import"./chunk-EQLHPWVB.js";import{e as F,f as Ve,g as ae}from"./chunk-A45GTZVV.js";import{N as cr,ca as pr,ea as dr}from"./chunk-NWSIPELM.js";import"./chunk-6SGN7MNX.js";import"./chunk-L76WVZW6.js";import{a as Ne}from"./chunk-2FWFPV5I.js";import"./chunk-O5SLP4JK.js";import{A as qt,D as ar,F as fe,G as Qe,a as er,b as Qt,c as G,d as tr,e as Vt,g as ir,h as Q,j as nr,l as pt,m as or,o as ee,r as rr,s as dt}from"./chunk-RNLSEEMX.js";import{a as Wt,c as $t}from"./chunk-JVFZL3LP.js";import{a as lr}from"./chunk-TVZ622KQ.js";import{a as y,d as Mt}from"./chunk-USJ6ILEE.js";import{a as Xo}from"./chunk-CLJWABT2.js";import{$b as fo,$d as Ut,Ab as ie,Bb as ne,Bc as v,Ca as E,Cb as m,Cc as M,Db as r,Dc as Z,E as oe,Eb as a,Ec as ze,Fb as h,Gb as Ct,Ha as Lo,Hb as lt,Hc as yt,I as fi,Ja as Fo,Jb as je,Kb as He,Kc as qo,Lb as Ci,M as Ro,Mb as S,N as Ft,Ob as _,Pb as uo,Pc as Ni,Qa as ki,Qb as c,Qc as $o,Sa as tt,Ub as Se,Ud as Ko,Va as it,Vb as ye,Vc as Jo,Wb as xe,Wd as Yo,Xa as s,Y as Bt,Ya as Be,Yb as Uo,Yd as xt,Zb as Wo,Zd as Ht,_b as nt,aa as Ee,ac as Qo,be as Y,c as ko,cb as Bo,cc as pe,cd as H,d as q,da as w,db as d,dc as p,e as po,ec as k,ed as Vi,ee as qe,fa as Ie,fc as x,fd as jt,gc as Ue,hb as P,ib as St,ic as O,id as Ai,jb as Ti,jc as I,jd as Li,k as To,ka as No,kc as D,kd as Re,la as at,lb as Ei,ma as vt,md as We,nb as z,o as mo,oa as N,oc as _i,od as K,pa as X,pc as Ri,qd as Go,rd as re,sb as jo,sc as st,t as et,ta as u,tb as Ho,tc as ct,u as wi,ua as f,uc as T,ud as zo,vb as g,vc as le,wc as hi,xa as Vo,xb as C,ya as Ao,yb as gi,z as Eo,zb as de}from"./chunk-JYZTRN6N.js";import"./chunk-WFMAM73Y.js";import{k as wo}from"./chunk-SNAKHGZS.js";var mn=class{ID;Code;Name;Title;Field;Address;ContactInfo;Logo;FooterLeft;FooterRight;FooterNote;PrintMode;PrintLX300;DeliveryNote;AppendQR;ItemRenderMode;CssClass;RemoveImage;DisplayName;DisplayNameCode};var ti=class{ParkLabel;Note;NumberOfPerson;ID;Alias;Created;CustomerDisplay;Number;Duration};var un=class n{constructor(t,e,i,o,l,b){this.dialogRef=t;this._orderProcessorService=e;this._posService=i;this.salesOrderService=o;this.parkService=l;this.data=b;this.initModalDialog(),this.initConfig(),this.parkLabel=b.ParkLabel,this.form.ParkLabel=b.ParkLabel,this.form.Note=o.Data.Order.Note}modalConfig=new B;labelPlaceholder;form=new ti;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=y.IsEmpty(this.parkLabel)?e:this.parkLabel:y.IsEmpty(this.parkLabel)?this.form.ParkLabel=e:this.form.ParkLabel=this.parkLabel}static \u0275fac=function(e){return new(e||n)(d(F),d(U),d(A),d(R),d(ke),d(Ve))};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),_("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),D("ngModelChange",function(l){return I(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),D("ngModelChange",function(l){return I(i.form.Note,l)||(i.form.Note=l),l}),a()()()()),e&2&&(m("config",i.modalConfig),s(12),O("ngModel",i.parkLabel),s(4),O("ngModel",i.form.Note))},dependencies:[G,Q,qt,ee,j,se,gt],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 gn=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)(d(F))};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),_("onCancel",function(){return i._dialogRef.close()})("onClose",function(){return i._dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),_("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),_("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&&m("config",i.modalConfig)},dependencies:[j],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 Xa=n=>({"mat-tab-group-height":n});function Za(n,t){if(n&1){let e=S();r(0,"div",2)(1,"div",6)(2,"span",7),h(3,"i",8),a(),r(4,"input",9),D("ngModelChange",function(o){u(e);let l=c();return I(l.filter,o)||(l.filter=o),f(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(),pe(e.Icon),s(2),k(e.Name)}}function tl(n,t){if(n&1){let e=S();r(0,"div",13)(1,"park-card",15),_("onSelect",function(){let o=u(e).$implicit,l=c(2);return f(l.onSelect(o))}),a()()}if(n&2){let e,i=t.$implicit,o=c().$implicit,l=c();s(),m("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),z(1,el,4,3,"ng-template",10),r(2,"div",11)(3,"div",12),ie(4,tl,2,5,"div",13,gi),v(6,"Filter"),a()()()),n&2){let e=t.$implicit,i=c();m("label",e.Name),s(4),ne(ze(6,1,e.Options,i.filter(),"Name"))}}function nl(n,t){if(n&1){let e=S();r(0,"div",5)(1,"POS-tinymce-editor",16),D("ngModelChange",function(o){u(e);let l=c();return I(l.parkNote,o)||(l.parkNote=o),f(o)}),a()()}if(n&2){let e=c();s(),O("ngModel",e.parkNote)}}var ni=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=X(F);posService=X(A);modalConfig=new B;filter=E("");parkLayout=E(null);parkOptionSelected=E(null);replaceWithAlias=E(!1);showInputNote=E(!1);parkNote=E("");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)(d(Ve))};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),_("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),g(3,Za,5,1,"div",2),r(4,"mat-tab-group",3),ie(5,il,7,5,"mat-tab",4,gi),a(),g(7,nl,2,1,"div",5),a()()()),e&2){let o,l,b;m("config",i.modalConfig),s(3),C(((o=i.parkLayout().Layout)==null?null:o.length)>0?3:-1),s(),m("ngClass",T(4,Xa,i.showInputNote()&&((l=i.parkOptionSelected())==null?null:l.Name))),s(),ne(i.parkLayout().Layout),s(2),C(i.showInputNote()&&((b=i.parkOptionSelected())!=null&&b.Name)?7:-1)}},dependencies:[re,H,ge,j,$r,Gt,fe,G,Q,ee,Jt,Fi,Pt,Ot,Yt,gt,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 Cn=class n{constructor(t,e,i,o,l,b,V,J,ve){this.dialogRef=t;this.parkOrderRetrieve=e;this._orderDataService=i;this._posHttpResponseService=o;this._orderProcessorService=l;this._orderHttpService=b;this._dialog=V;this._outletRegisterService=J;this.parkService=ve;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(ni,{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)(d(F),d(Ve),d(R),d(A),d(U),d(De),d(ae),d($),d(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),_("onClose",function(){return i.dialogRef.close()})("onCancel",function(){return i.dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),_("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),_("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&&m("title","Re-Park Order?")("config",i.modalConfig)},dependencies:[j],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 oi=class{Name;Alias;IsOccupied;Note};var _n=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 Si=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 _n,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 bi,this.Title="",this.TypeName="",this.PaymentState=0,this.Number="",this.Created="",this.AfterSell=!0}};var ri=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 oi;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 hn=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 kt=class n{constructor(t,e,i,o,l,b,V,J){this._posService=t;this._orderDataService=e;this._cashierCalculatorService=i;this._outletService=o;this._OrderHttpService=l;this._receiptCalculatorService=b;this._orderProcessorService=V;this._customerHttpService=J;this.subscribeToObservableChanges()}posData;completeData;park=new ri(null);outletInfo=new Ji;datePipe=new We("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 Si;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=y.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:ss")),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=y.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 console.log(t),t}generateQrContent(){let t="";if(this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.TransformTo==3){let i=this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.Content,o=this.posData?.Order?.Number,l=this.completeData.ObjectID,b=window?.location?.host;switch(i){case 2:t=l;break;case 1:t=o;break;case 3:t=`receipt.dealpos.app?Data=${btoa(`${l}_${b}`)}`;break}}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 hn;if(i.ExtraNote=y.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=ot(Ae,this.posData.CartItems);if(e){let o=this.posData.CartItems.filter(l=>y.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(b=>b.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 Si;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=y.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 b=i-o;return(Math.abs(b)<=t||b>=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 y.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(y.IsNotEmpty(this.posData.SplitParkLabel)&&(i=this.posData.SplitParkLabel),e&&y.IsNotEmpty(i)){let o=this.park.GetAlias(i);i=o||i}return i?y.IsEmpty(t)?i:y.StringFormat("{0} # {1}",t,i):""}GetSubmittedNumber(){return y.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 Yi(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 Yi(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 Yi(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(A),N(R),N(be),N($),N(De),N(Xi),N(U),N(ft))};static \u0275prov=at({token:n,factory:n.\u0275fac,providedIn:"root"})};var ke=class n{constructor(t,e,i,o,l,b,V,J,ve,Le){this.httpService=t;this.receiptService=e;this.orderProcessorService=i;this.pageInitialService=o;this.salesOrderService=l;this.toastrService=b;this.promotionEventService=V;this.outletService=J;this.orderHttpService=ve;this.dialog=Le;this._onPrint=new q,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(he.GetPark,[{key:"EntityID",value:t},{key:"RegisterID",value:e}])}removeOrder(t,e){let i={OrderID:t};return e?this.httpService.post(he.VoidPark,i):this.httpService.post(he.RemovePark,i)}mergePark(t){return this.httpService.post(he.MergePark,t)}getOutstanding(t){let e={EntityID:t};return this.httpService.post(he.GetOutStanding,e)}splitOrder(t){return this.httpService.post(he.SplitOrder,t)}park(t){let e=ot(ut,this.salesOrderService.Data);if(this.promotionEventService.selectedPromotion){this.clearPromotionAppliedInPark();return}e.Action.DeliveryEntityID=y.GuidEmpty,e.Action.Type=1,t.ParkLabel!=null&&(e.Order.ParkLabel=t.ParkLabel),e.Order.Note=t.Note,e.Order.InvoicedStateID=1,y.IsNotEmpty(t.ID)&&(e.Order.ID=t.ID),this.salesOrderService.pushNewValue(e);let i=this.orderHttpService.generatePOSDataForSubmission(e);return this.httpService.post(he.ParkOrder,i).pipe(Ie(o=>{this.orderProcessorService.updatePosState(3,o),this.orderProcessorService.createNewTransactionInSameOutletRegister(!0)}))}clearPromotionAppliedInPark(){this.dialog.open(Qr,{id:"modal-promotion-confirm",data:{message:`
|
|
1
|
+
import{a as $r}from"./chunk-BILYIP7J.js";import{a as ho}from"./chunk-7E6JQNGW.js";import{b as va,c as Sa}from"./chunk-ZRYRGDGM.js";import{a as Ma,b as Pa}from"./chunk-Z7IU5JLK.js";import{a as ha,b as ba}from"./chunk-NRF37QSD.js";import{a as ya,b as dn}from"./chunk-27Y3MQJV.js";import{a as At}from"./chunk-MEG3XVPI.js";import{a as _a}from"./chunk-C5AIOCPM.js";import{a as pn}from"./chunk-RRSZSQXZ.js";import"./chunk-2KPICU7I.js";import"./chunk-NQX7EX5A.js";import"./chunk-BYXBJQAS.js";import{a as ei}from"./chunk-WMUZZ5XX.js";import{a as ma}from"./chunk-SEOZWGYI.js";import{b as ua,e as fa,f as ga,g as Ca}from"./chunk-POJQGU7L.js";import{b as xa}from"./chunk-BY57IAJ7.js";import"./chunk-DJTAYVZN.js";import"./chunk-P3KIIKY4.js";import{a as Oa}from"./chunk-HBAQBI6Z.js";import{A as Xr,B as Zr,C as an,D as Xt,E as Zt,F as oa,G as ln,H as ra,I as aa,J as cn,K as pa,L as da,a as Fr,b as ut,c as jr,d as De,e as R,f as A,g as Hr,h as me,i as Gi,j as Ur,k as Wr,l as $,m as Qr,n as qr,o as be,p as Xe,q as Dt,r as we,s as Kt,t as Ki,u as Yi,v as Xi,w as Zi,x as _o,y as en,z as U}from"./chunk-WOGTFZCA.js";import"./chunk-JFLT7NX3.js";import"./chunk-YXCPHYC5.js";import"./chunk-W3VF2RCW.js";import"./chunk-DXBQR3VL.js";import{a as Gr,b as zr,c as Kr,d as nn}from"./chunk-LLEPB2B6.js";import{a as ea,b as ta}from"./chunk-3XKRDZSE.js";import{c as on,d as rn}from"./chunk-QDE5Y76C.js";import"./chunk-ULYBLEXA.js";import"./chunk-7NOKG3UC.js";import"./chunk-GODXDKX5.js";import{a as $e,b as ft}from"./chunk-2E4N3RZU.js";import{a as Br,b as ia,c as na}from"./chunk-UE2HBW5H.js";import{a as zi}from"./chunk-2RERZJD4.js";import{a as ca}from"./chunk-23PKMU5D.js";import{a as Me,c as Ji}from"./chunk-HI65LAJQ.js";import{a as Co}from"./chunk-PF33HK6M.js";import"./chunk-AFBBEIKR.js";import{a as go}from"./chunk-IFOBYW26.js";import{a as Jr,b as tn}from"./chunk-XIXDLSA2.js";import{a as sn,b as la,c as sa}from"./chunk-76RLGANX.js";import"./chunk-KYAKLZR7.js";import"./chunk-P3SYBLK4.js";import"./chunk-5UDUWK67.js";import{a as gt,b as Yt}from"./chunk-J7YNB6YX.js";import{a as Yr}from"./chunk-VP2ZEIJA.js";import"./chunk-3GPGJFQV.js";import{a as Ar}from"./chunk-4USQPLEW.js";import"./chunk-J6U6UYNI.js";import{b as Ae}from"./chunk-7PN2DG6D.js";import"./chunk-Z3E24JZW.js";import"./chunk-BYXBJQAS.js";import{c as bi}from"./chunk-Z6RY34PQ.js";import{a as Wi}from"./chunk-NQKVYQ6V.js";import{b as Qi,c as ot}from"./chunk-NSNUUKNK.js";import{a as qi,b as $i}from"./chunk-6H5P35AP.js";import{a as Lr}from"./chunk-DLNZDHGS.js";import"./chunk-RF5WGONA.js";import"./chunk-BYXBJQAS.js";import{a as Ui}from"./chunk-R4OHTTCT.js";import{a as Nr,b as Vr}from"./chunk-QIJEAKQK.js";import"./chunk-QEOGHVXA.js";import"./chunk-4HCSE44G.js";import{b as Fi,c as Pt,d as Ot,e as Jt}from"./chunk-INHUUGSI.js";import{a as _r}from"./chunk-XA4TVPAS.js";import"./chunk-Q2A4MYK3.js";import{e as Rr}from"./chunk-SO4GMA3Y.js";import"./chunk-PECGNYTX.js";import"./chunk-3RK6DDJD.js";import"./chunk-SARJJ3AZ.js";import"./chunk-DC426G2P.js";import"./chunk-3KSZCJ6T.js";import"./chunk-BYO7FJ4O.js";import"./chunk-CBSYYTXQ.js";import{d as ji,e as Hi}from"./chunk-6WEGHV7F.js";import"./chunk-G4IW5GPY.js";import{b as wr,c as kr,d as Tr,e as Er}from"./chunk-6EH2754P.js";import"./chunk-JEL3OND6.js";import"./chunk-IDQUQBKL.js";import{c as mr}from"./chunk-YRGHPSPV.js";import"./chunk-VYQEM4T2.js";import"./chunk-UTAQ3FRE.js";import{a as ur,c as fr,e as gr}from"./chunk-M43HNBJQ.js";import{a as ht,c as mt}from"./chunk-KKLNFVVN.js";import"./chunk-X57HWGVJ.js";import"./chunk-5SFUSWFY.js";import"./chunk-534MIVWD.js";import"./chunk-TGEQUV6Z.js";import{a as Or,c as Ir,d as Dr}from"./chunk-S3H5URIA.js";import{a as Cr,b as hr}from"./chunk-OGB3GW4L.js";import"./chunk-CS6HBROS.js";import{a as sr}from"./chunk-JUS6LLVX.js";import{C as Pr,D as Ye,F as zt,G as It,u as B,v as j,w as ge}from"./chunk-QZMZBCE7.js";import{b as se,c as Ke}from"./chunk-C4WJKF7R.js";import{F as Mr,N as Gt,O as he,a as br,b as vr,n as Bi,t as Sr,u as yr,x as xr}from"./chunk-NZYZO47Z.js";import{d as _t}from"./chunk-7TBS7SPQ.js";import{a as Zo}from"./chunk-RLQLFW36.js";import"./chunk-EQLHPWVB.js";import{e as F,f as Ve,g as ae}from"./chunk-A45GTZVV.js";import{N as cr,ca as pr,ea as dr}from"./chunk-NWSIPELM.js";import"./chunk-6SGN7MNX.js";import"./chunk-L76WVZW6.js";import{a as Ne}from"./chunk-2FWFPV5I.js";import"./chunk-O5SLP4JK.js";import{A as qt,D as ar,F as fe,G as Qe,a as er,b as Qt,c as G,d as tr,e as Vt,g as ir,h as Q,j as nr,l as pt,m as or,o as ee,r as rr,s as dt}from"./chunk-RNLSEEMX.js";import{a as Wt,c as $t}from"./chunk-47TR66HI.js";import{a as lr}from"./chunk-7TEVE3FN.js";import{a as y,d as Mt}from"./chunk-USJ6ILEE.js";import{a as Xo}from"./chunk-DGKIIUIQ.js";import{$b as fo,$d as Ut,Ab as ie,Bb as ne,Bc as v,Ca as E,Cb as m,Cc as M,Db as r,Dc as Z,E as oe,Eb as a,Ec as ze,Fb as h,Gb as Ct,Ha as Lo,Hb as lt,Hc as yt,I as fi,Ja as Fo,Jb as je,Kb as He,Kc as qo,Lb as Ci,M as Ro,Mb as S,N as Ft,Ob as _,Pb as uo,Pc as Ni,Qa as ki,Qb as c,Qc as $o,Sa as tt,Ub as Se,Ud as Ko,Va as it,Vb as ye,Vc as Jo,Wb as xe,Wd as Yo,Xa as s,Y as Bt,Ya as Be,Yb as Uo,Yd as xt,Zb as Wo,Zd as Ht,_b as nt,aa as Ee,ac as Qo,be as Y,c as ko,cb as Bo,cc as pe,cd as H,d as q,da as w,db as d,dc as p,e as po,ec as k,ed as Vi,ee as qe,fa as Ie,fc as x,fd as jt,gc as Ue,hb as P,ib as St,ic as O,id as Ai,jb as Ti,jc as I,jd as Li,k as To,ka as No,kc as D,kd as Re,la as at,lb as Ei,ma as vt,md as We,nb as z,o as mo,oa as N,oc as _i,od as K,pa as X,pc as Ri,qd as Go,rd as re,sb as jo,sc as st,t as et,ta as u,tb as Ho,tc as ct,u as wi,ua as f,uc as T,ud as zo,vb as g,vc as le,wc as hi,xa as Vo,xb as C,ya as Ao,yb as gi,z as Eo,zb as de}from"./chunk-JYZTRN6N.js";import"./chunk-WFMAM73Y.js";import{k as wo}from"./chunk-SNAKHGZS.js";var mn=class{ID;Code;Name;Title;Field;Address;ContactInfo;Logo;FooterLeft;FooterRight;FooterNote;PrintMode;PrintLX300;DeliveryNote;AppendQR;ItemRenderMode;CssClass;RemoveImage;DisplayName;DisplayNameCode};var ti=class{ParkLabel;Note;NumberOfPerson;ID;Alias;Created;CustomerDisplay;Number;Duration};var un=class n{constructor(t,e,i,o,l,b){this.dialogRef=t;this._orderProcessorService=e;this._posService=i;this.salesOrderService=o;this.parkService=l;this.data=b;this.initModalDialog(),this.initConfig(),this.parkLabel=b.ParkLabel,this.form.ParkLabel=b.ParkLabel,this.form.Note=o.Data.Order.Note}modalConfig=new B;labelPlaceholder;form=new ti;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=y.IsEmpty(this.parkLabel)?e:this.parkLabel:y.IsEmpty(this.parkLabel)?this.form.ParkLabel=e:this.form.ParkLabel=this.parkLabel}static \u0275fac=function(e){return new(e||n)(d(F),d(U),d(A),d(R),d(ke),d(Ve))};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),_("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),D("ngModelChange",function(l){return I(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),D("ngModelChange",function(l){return I(i.form.Note,l)||(i.form.Note=l),l}),a()()()()),e&2&&(m("config",i.modalConfig),s(12),O("ngModel",i.parkLabel),s(4),O("ngModel",i.form.Note))},dependencies:[G,Q,qt,ee,j,se,gt],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 gn=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)(d(F))};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),_("onCancel",function(){return i._dialogRef.close()})("onClose",function(){return i._dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),_("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),_("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&&m("config",i.modalConfig)},dependencies:[j],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 Xa=n=>({"mat-tab-group-height":n});function Za(n,t){if(n&1){let e=S();r(0,"div",2)(1,"div",6)(2,"span",7),h(3,"i",8),a(),r(4,"input",9),D("ngModelChange",function(o){u(e);let l=c();return I(l.filter,o)||(l.filter=o),f(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(),pe(e.Icon),s(2),k(e.Name)}}function tl(n,t){if(n&1){let e=S();r(0,"div",13)(1,"park-card",15),_("onSelect",function(){let o=u(e).$implicit,l=c(2);return f(l.onSelect(o))}),a()()}if(n&2){let e,i=t.$implicit,o=c().$implicit,l=c();s(),m("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),z(1,el,4,3,"ng-template",10),r(2,"div",11)(3,"div",12),ie(4,tl,2,5,"div",13,gi),v(6,"Filter"),a()()()),n&2){let e=t.$implicit,i=c();m("label",e.Name),s(4),ne(ze(6,1,e.Options,i.filter(),"Name"))}}function nl(n,t){if(n&1){let e=S();r(0,"div",5)(1,"POS-tinymce-editor",16),D("ngModelChange",function(o){u(e);let l=c();return I(l.parkNote,o)||(l.parkNote=o),f(o)}),a()()}if(n&2){let e=c();s(),O("ngModel",e.parkNote)}}var ni=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=X(F);posService=X(A);modalConfig=new B;filter=E("");parkLayout=E(null);parkOptionSelected=E(null);replaceWithAlias=E(!1);showInputNote=E(!1);parkNote=E("");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)(d(Ve))};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),_("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),g(3,Za,5,1,"div",2),r(4,"mat-tab-group",3),ie(5,il,7,5,"mat-tab",4,gi),a(),g(7,nl,2,1,"div",5),a()()()),e&2){let o,l,b;m("config",i.modalConfig),s(3),C(((o=i.parkLayout().Layout)==null?null:o.length)>0?3:-1),s(),m("ngClass",T(4,Xa,i.showInputNote()&&((l=i.parkOptionSelected())==null?null:l.Name))),s(),ne(i.parkLayout().Layout),s(2),C(i.showInputNote()&&((b=i.parkOptionSelected())!=null&&b.Name)?7:-1)}},dependencies:[re,H,ge,j,$r,Gt,fe,G,Q,ee,Jt,Fi,Pt,Ot,Yt,gt,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 Cn=class n{constructor(t,e,i,o,l,b,V,J,ve){this.dialogRef=t;this.parkOrderRetrieve=e;this._orderDataService=i;this._posHttpResponseService=o;this._orderProcessorService=l;this._orderHttpService=b;this._dialog=V;this._outletRegisterService=J;this.parkService=ve;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(ni,{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)(d(F),d(Ve),d(R),d(A),d(U),d(De),d(ae),d($),d(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),_("onClose",function(){return i.dialogRef.close()})("onCancel",function(){return i.dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),_("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),_("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&&m("title","Re-Park Order?")("config",i.modalConfig)},dependencies:[j],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 oi=class{Name;Alias;IsOccupied;Note};var _n=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 Si=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 _n,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 bi,this.Title="",this.TypeName="",this.PaymentState=0,this.Number="",this.Created="",this.AfterSell=!0}};var ri=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 oi;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 hn=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 kt=class n{constructor(t,e,i,o,l,b,V,J){this._posService=t;this._orderDataService=e;this._cashierCalculatorService=i;this._outletService=o;this._OrderHttpService=l;this._receiptCalculatorService=b;this._orderProcessorService=V;this._customerHttpService=J;this.subscribeToObservableChanges()}posData;completeData;park=new ri(null);outletInfo=new Ji;datePipe=new We("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 Si;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=y.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:ss")),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=y.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 console.log(t),t}generateQrContent(){let t="";if(this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.TransformTo==3){let i=this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.Content,o=this.posData?.Order?.Number,l=this.completeData.ObjectID,b=window?.location?.host;switch(i){case 2:t=l;break;case 1:t=o;break;case 3:t=`receipt.dealpos.app?Data=${btoa(`${l}_${b}`)}`;break}}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 hn;if(i.ExtraNote=y.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=ot(Ae,this.posData.CartItems);if(e){let o=this.posData.CartItems.filter(l=>y.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(b=>b.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 Si;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=y.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 b=i-o;return(Math.abs(b)<=t||b>=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 y.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(y.IsNotEmpty(this.posData.SplitParkLabel)&&(i=this.posData.SplitParkLabel),e&&y.IsNotEmpty(i)){let o=this.park.GetAlias(i);i=o||i}return i?y.IsEmpty(t)?i:y.StringFormat("{0} # {1}",t,i):""}GetSubmittedNumber(){return y.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 Yi(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 Yi(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 Yi(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(A),N(R),N(be),N($),N(De),N(Xi),N(U),N(ft))};static \u0275prov=at({token:n,factory:n.\u0275fac,providedIn:"root"})};var ke=class n{constructor(t,e,i,o,l,b,V,J,ve,Le){this.httpService=t;this.receiptService=e;this.orderProcessorService=i;this.pageInitialService=o;this.salesOrderService=l;this.toastrService=b;this.promotionEventService=V;this.outletService=J;this.orderHttpService=ve;this.dialog=Le;this._onPrint=new q,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(he.GetPark,[{key:"EntityID",value:t},{key:"RegisterID",value:e}])}removeOrder(t,e){let i={OrderID:t};return e?this.httpService.post(he.VoidPark,i):this.httpService.post(he.RemovePark,i)}mergePark(t){return this.httpService.post(he.MergePark,t)}getOutstanding(t){let e={EntityID:t};return this.httpService.post(he.GetOutStanding,e)}splitOrder(t){return this.httpService.post(he.SplitOrder,t)}park(t){let e=ot(ut,this.salesOrderService.Data);if(this.promotionEventService.selectedPromotion){this.clearPromotionAppliedInPark();return}e.Action.DeliveryEntityID=y.GuidEmpty,e.Action.Type=1,t.ParkLabel!=null&&(e.Order.ParkLabel=t.ParkLabel),e.Order.Note=t.Note,e.Order.InvoicedStateID=1,y.IsNotEmpty(t.ID)&&(e.Order.ID=t.ID),this.salesOrderService.pushNewValue(e);let i=this.orderHttpService.generatePOSDataForSubmission(e);return this.httpService.post(he.ParkOrder,i).pipe(Ie(o=>{this.orderProcessorService.updatePosState(3,o),this.orderProcessorService.createNewTransactionInSameOutletRegister(!0)}))}clearPromotionAppliedInPark(){this.dialog.open(Qr,{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(y.IsEmpty(t.Order.RegisterID)){this.toastrService.warning(Pr.emptyEntity,Ne.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 y.IsNotEmpty(e)||y.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&&y.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 b=t.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkDialogTitle,V=i.posState==5,J=t.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias,ve=V?"Split Order":b;this.dialog.open(ni,{data:{title:ve,parkLayoutPack:this.generateParkLayoutOptions(o,l.Orders),replaceWithAlias:J,orderNote:e.Order?.Note}}).afterClosed().pipe(oe(Le=>y.IsNotEmpty(Le)),Ee(Le=>{let Fe=new ti;return Fe.ParkLabel=Le.Name,Fe.Note=Le.Note,this.park(Fe)})).subscribe()})}showReparkModal(){this.dialog.open(Cn,{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&&y.IsNotEmpty(e)&&y.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(un,{id:"park-form-modal",data:{title:t,labelDisable:i&&y.IsNotEmpty(i?.ID)||this.orderProcessorService.Data.posState==5,ParkLabel:this.salesOrderService.Data.Order.ParkLabel}})}onPrintRetrieve(){this.dialog.open(gn).afterClosed().pipe(oe(t=>y.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 oi;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(qe),N(kt),N(U),N(A),N(R),N(Y),N(Kt),N($),N(De),N(ae))};static \u0275prov=at({token:n,factory:n.\u0275fac,providedIn:"root"})};var vn=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=St({type:n});static \u0275inj=vt({imports:[re,fe,$i,It,Jr,Jt,Ut,Gt,Ke,tn]})};var Da=n=>({"opacity-50":n});function al(n,t){if(n&1){let e=S();r(0,"div",5)(1,"h6",6),p(2,"Verify Via"),a(),r(3,"div",7)(4,"button",8),_("click",function(){u(e);let o=c();return f(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),_("click",function(){u(e);let o=c();return f(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),_("click",function(o){return u(e),c().onChooseVerifyType("pin"),f(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),m("disabled",!e.phone||(e.phone==null?null:e.phone.length)<6),s(4),m("ngClass",T(6,Da,!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),m("disabled",!e.email),s(3),m("ngClass",T(8,Da,!e.email)),s(),x(" ",e.email?e.email:"Email is not registered"," ")}}function ll(n,t){if(n&1){let e=S();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),_("click",function(){u(e);let o=c();return f(o.onRedeem())}),p(15,"Redeem"),a()()()}}var Sn=class n{toastrService=X(Y);onVerify=new Be;pointUsedChange=new Be;redeemEvent=new Be;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 y.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),D("ngModelChange",function(l){return I(i.pointUsed,l)||(i.pointUsed=l),l}),_("ngModelChange",function(){return i.onPointUsedChange()}),a()(),r(3,"div",3)(4,"span",1),p(5,"Of"),a(),r(6,"span",4),p(7),v(8,"number"),a()(),r(9,"div"),p(10,"Points"),a()(),g(11,al,22,10,"div",5)(12,ll,16,0)),e&2&&(s(2),O("ngModel",i.pointUsed),m("max",i.pointBalance),s(5),k(M(8,4,i.pointBalance)),s(4),C(i.isVerifyEnabled?11:12))},dependencies:[re,H,ht,mt,fe,G,Q,ee,Ke,se,K],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=S();je(0),r(1,"input",5,0),_("paste",function(o){u(e);let l=c(2);return f(l.handlePaste(o))})("keyup",function(o){let l=u(e).index,b=c(2);return f(b.onKeyUp(o,l))})("input",function(o){let l=u(e).index,b=c(2);return f(b.onInput(o,l))})("keydown",function(o){let l=u(e).index,b=c(2);return f(b.onKeyDown(o,l))}),a(),z(3,cl,2,1,"span",6),He()}if(n&2){let e=t.$implicit,i=t.index,o=t.last,l=c(2);s(),pe(Ri("otp-input ",l.config.inputClass)),m("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),m("ngIf",l.config.separator&&!o)}}function dl(n,t){if(n&1){let e=S();r(0,"div",2),_("focusin",function(){u(e);let o=c();return f(o.onFocusIn())})("focusout",function(){u(e);let o=c();return f(o.onFocusOut())}),r(1,"div",3),z(2,pl,4,13,"ng-container",4),a()()}if(n&2){let e=c();pe(Ri("ng-otp-input-wrapper wrapper ",e.config.containerClass)),m("id",Ri("c_",e.componentKey))("ngStyle",e.config.containerStyles),s(2),m("ngForOf",e.controlKeys)}}var bt=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)}},yi=class{static keys(t){return t?Object.keys(t):[]}},yo=(()=>{let t=class t{set disabled(i){this.setDisabledState(i)}get inputType(){return this.config?.isPasswordInput?"password":this.config?.allowNumbersOnly?"tel":"text"}get controlKeys(){return yi.keys(this.otpForm?.controls)}get formControl(){return this.formCtrl??this.inj?.get(ir)}constructor(i,o){this.document=i,this.inj=o,this.config={length:4},this.onBlur=new q,this.onInputChange=new q,this.inputControls=new Array(this.config.length),this.componentKey=Math.random().toString(36).substring(2)+new Date().getTime().toString(36),this.destroy$=new q,this.activeFocusCount=0,this.onChange=()=>{},this.onTouched=()=>{},this._isDisabled=!1}ngOnInit(){this.otpForm=new nr({});for(let i=0;i<this.config.length;i++)this.otpForm.addControl(this.getControlName(i),new pt);this.otpForm.valueChanges.pipe(w(this.destroy$)).subscribe(i=>{yi.keys(this.otpForm.controls).forEach(o=>{var l=this.otpForm.controls[o].value;l&&l.length>1&&(l.length>=this.config.length?this.setValue(l):this.rebuildValue())})})}setDisabledState(i){this._isDisabled=i,this.otpForm&&(i?this.otpForm.disable({emitEvent:!1}):this.otpForm.enable({emitEvent:!1}))}writeValue(i){this.currentVal=this.hasVal(i)?i:null,this.setValue(this.currentVal)}registerOnChange(i){this.onChange=i}registerOnTouched(i){this.onTouched=i}onFocusIn(){this.onTouched(),this.activeFocusCount++}onFocusOut(){setTimeout(()=>{this.activeFocusCount--,this.activeFocusCount===0&&(this.onTouched(),this.onBlur.next())},0)}ngAfterViewInit(){if(!this.config.disableAutoFocus){let i=this.document.getElementById(`c_${this.componentKey}`);if(i){let o=i.getElementsByClassName("otp-input")[0];o&&o.focus&&o.focus()}}}getControlName(i){return`ctrl_${i}`}onKeyDown(i,o){let l=this.getBoxId(o-1),b=this.getBoxId(o);if(bt.ifKey(i,"Enter")){let J=this.document.getElementById(b)?.closest("form");if(J){i.preventDefault();let ve=new Event("submit",{bubbles:!0,cancelable:!0});J.dispatchEvent(ve);return}}if(bt.ifSpacebar(i))return i.preventDefault(),!1;if(bt.ifBackspace(i)){i.target.value?this.clearInput(b,o):(this.clearInput(l,o-1),this.setSelected(l)),this.rebuildValue();return}if(bt.ifDelete(i)){i.target.value?this.clearInput(b,o):(this.clearInput(l,o-1),this.setSelected(l)),this.rebuildValue();return}}hasVal(i){return i!=null&&i!=null&&(!i?.trim||i.trim()!="")}onInput(i,o){let l=this.hasVal(this.currentVal)?`${this.currentVal}${i.target.value}`:i.target.value;if(this.config.allowNumbersOnly&&!this.validateNumber(l)){i.target.value=null,i.stopPropagation(),i.preventDefault(),this.clearInput(null,o);return}if(this.ifValidKeyCode(null,i.target.value)){let b=this.getBoxId(o+1);this.setSelected(b),this.rebuildValue()}else{i.target.value=null;let b=this.getControlName(o);this.otpForm.controls[b]?.setValue(null),this.rebuildValue()}}onKeyUp(i,o){bt.ifTab(i)&&(o-=1);let l=this.getBoxId(o+1),b=this.getBoxId(o-1);if(bt.ifRightArrow(i)){i.preventDefault(),this.setSelected(l);return}if(bt.ifLeftArrow(i)){i.preventDefault(),this.setSelected(b);return}}validateNumber(i){return i&&/^[0-9]+$/.test(i)}getBoxId(i){return`otp_${i}_${this.componentKey}`}clearInput(i,o){let l=this.getControlName(o);if(this.otpForm.controls[l]?.setValue(null),i){let b=this.document.getElementById(i);b&&b instanceof HTMLInputElement&&(b.value=null)}}setSelected(i){this.focusTo(i);let o=this.document.getElementById(i);o&&o.setSelectionRange&&setTimeout(()=>{o.setSelectionRange(0,1)},0)}ifValidKeyCode(i,o){let l=o??i.key;return this.config?.allowNumbersOnly?this.validateNumber(l):/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)||/^[a-zA-Z0-9%*_\-@#$!]$/.test(l)&&l.length==1}focusTo(i){let o=this.document.getElementById(i);o&&o.focus()}setValue(i){if(!(this.config.allowNumbersOnly&&isNaN(i))){if(this.otpForm?.reset(),!this.hasVal(i)){this.rebuildValue();return}i=i.toString().replace(/\s/g,""),Array.from(i).forEach((o,l)=>{this.otpForm.get(this.getControlName(l))&&this.otpForm.get(this.getControlName(l)).setValue(o)}),this.config.disableAutoFocus||setTimeout(()=>{let o=this.document.getElementById(`c_${this.componentKey}`);var l=i.length<this.config.length?i.length:this.config.length-1;let b=o.getElementsByClassName("otp-input")[l];b&&b.focus&&setTimeout(()=>{b.focus()},1)},0),this.rebuildValue()}}rebuildValue(){let i=null;yi.keys(this.otpForm.controls).forEach(o=>{let l=this.otpForm.controls[o].value;if(l){let b=l.length>1,V=!this.config.allowNumbersOnly&&this.config.letterCase&&(this.config.letterCase.toLocaleLowerCase()=="upper"||this.config.letterCase.toLocaleLowerCase()=="lower");l=l[0];let J=V?this.config.letterCase.toLocaleLowerCase()=="upper"?l.toUpperCase():l.toLowerCase():l;V&&J==l?V=!1:l=J,i==null?i=l:i+=l,(b||V)&&this.otpForm.controls[o].setValue(l)}}),this.currentVal!=i&&(this.currentVal=i,this.onChange(i),this.formCtrl?.setValue&&this.formCtrl.setValue(i),this.onInputChange.next(i))}handlePaste(i){let o=i.clipboardData||window.clipboardData;if(o)var l=o.getData("Text");i.stopPropagation(),i.preventDefault(),!(!l||this.config.allowNumbersOnly&&!this.validateNumber(l))&&this.setValue(l)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}};t.\u0275fac=function(o){return new(o||t)(d(Ao),d(Vo))},t.\u0275cmp=P({type:t,selectors:[["ng-otp-input"],["ngx-otp-input"]],inputs:{config:"config",formCtrl:"formCtrl",disabled:"disabled"},outputs:{onBlur:"onBlur",onInputChange:"onInputChange"},features:[st([{provide:er,useExisting:No(()=>t),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(o,l){o&1&&z(0,dl,3,7,"div",1),o&2&&m("ngIf",l.otpForm==null?null:l.otpForm.controls)},dependencies:[Qe,G,Q,ar,dt,jt,Vi,Ai,H],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}}"]});let n=t;return n})(),xn=(()=>{let t=class t{};t.\u0275fac=function(o){return new(o||t)},t.\u0275mod=St({type:t}),t.\u0275inj=vt({imports:[yo]});let n=t;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),k(e.contact)}}function fl(n,t){if(n&1&&h(0,"ng-otp-input",3),n&2){let e=c(2);m("formCtrl",e.otpCtrl)("config",e.otpConfig)}}function gl(n,t){if(n&1&&g(0,fl,1,2,"ng-otp-input",3),n&2){let e=c();C(e.showPinInput()?0:-1)}}function Cl(n,t){if(n&1&&h(0,"ng-otp-input",3),n&2){let e=c();m("formCtrl",e.otpCtrl)("config",e.otpConfig)}}function _l(n,t){if(n&1){let e=S();r(0,"div",4)(1,"span"),p(2,"Didn`t get a code? "),a(),r(3,"a",6),_("click",function(){u(e);let o=c();return f(o.onResendCode())}),p(4,"Click to resend"),a()()}}var Mn=class n{type;contact;clearPin=!1;onVerify=new Be;resendCode=new Be;showPinInput=E(!0);otpCtrl=new pt;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(Ro(300),oe(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:[Lo],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(),g(3,ul,4,1,"div"),a(),r(4,"div",2),g(5,gl,1,1)(6,Cl,1,2,"ng-otp-input",3),a(),g(7,_l,5,0,"div",4)),e&2&&(s(2),x(" Confirm Your ",i.type=="pin"?"PIN":"OTP"," "),s(),C(i.type!="pin"?3:-1),s(2),C(i.type=="pin"?5:6),s(2),C(i.type!="pin"?7:-1))},dependencies:[xn,yo,Qe],encapsulation:2})};function hl(n,t){if(n&1){let e=S();Ct(0,"button",7),uo("click",function(){u(e);let o=c();return f(o.onCancel())}),p(1,"Cancel"),lt()}}function bl(n,t){if(n&1){let e=S();Ct(0,"button",8),uo("click",function(){u(e);let o=c();return f(o.onConfirm())}),p(1,"Confirm"),lt()}}var Pn=class n{pointUsed=Ni(0);redeemPointValue=Ni(0);showCancelBtn=Ni(!1);confirmEvent=new Be;cancelEvent=new Be;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&&(Ct(0,"div",0)(1,"div",1),p(2,"Redeem"),lt(),Ct(3,"div",2)(4,"span",3),p(5),v(6,"number"),lt(),Ct(7,"small"),p(8,"Point"),lt()(),Ct(9,"div",1),p(10,"~"),lt(),Ct(11,"div",4)(12,"span",3),p(13),v(14,"number"),lt(),Ct(15,"small"),p(16,"Discount"),lt()(),g(17,hl,2,0,"button",5)(18,bl,2,0,"button",6),lt()),e&2&&(s(5),k(M(6,3,i.pointUsed())),s(8),k(M(14,5,i.pointUsed()*i.redeemPointValue())),s(4),C(i.showCancelBtn()?17:18))},dependencies:[re,K],encapsulation:2})};var li=class n{constructor(t,e,i,o,l,b,V,J,ve,Le){this.customerHttpService=t;this.salesOrderService=e;this.pageInitialService=i;this.shoppingCartService=o;this.invoiceCalculatorService=l;this.orderProcessorService=b;this.toastr=V;this.promotionCouponService=J;this.httpService=ve;this.registerService=Le}customerId;customerData;_isCustomerVerfiedOtp=!1;get isCustomerVerfiedOtp(){return this._isCustomerVerfiedOtp}addCustomerById(t){return new ko(e=>{this.customerId=JSON.parse(JSON.stringify(this.salesOrderService.Data.Order.CustomerID)),this.resetCartOnChangeCustomer(t),y.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(Ee(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(b=>b.ID===o);y.IsNotEmpty(t.SalesID)&&l&&(e.Order.SalesID=t.SalesID)}setCustomerData(t){let e=this.salesOrderService.Data;if(t.EntityID==y.GuidEmpty)this.customerData=t;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}checkResetRedeemPoint(){let t=!1;return y.IsNotEmpty(this.customerId)&&(t=!0),t}applyCustomerPricebook(t){let e=this.salesOrderService.Data;if(y.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.promotionCouponService.coupon,i=this.salesOrderService.Data.Order.Discount;e&&e.Requirement?.Type==1?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&&y.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||y.IsNotEmpty(i.PriceBookID))}onEmptyInputCustomer(){y.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(y.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=y.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,b=i.RedeemableAmount;l>b&&(o>0?(t=Math.ceil(b/o),l=b):(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(Ie(()=>this._isCustomerVerfiedOtp=!0))}verifyPin(t,e){return this.httpService.post("/API/pos/VerifyPin",{PIN:t,CustomerID:e}).pipe(Ie(()=>this._isCustomerVerfiedOtp=!0))}verifyWhatsAppOtp(t,e){return this.httpService.post("/API/otp/verifywhatsapp",{Number:t,OTP:e}).pipe(Ie(()=>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(ft),N(R),N(A),N(we),N(be),N(U),N(Y),N(Xe),N(qe),N($))};static \u0275prov=at({token:n,factory:n.\u0275fac,providedIn:"root"})};var yl=["stepper"];function xl(n,t){n&1&&p(0,"Points")}function Ml(n,t){n&1&&p(0,"Verify")}function Pl(n,t){n&1&&p(0,"Confirm")}var si=class n{dialogRef=X(F);outletRegisterService=X($);pageInitialService=X(A);customerHttpService=X(ft);customerService=X(li);orderService=X(R);toastr=X(Y);modalConfig;enabledLoyaltyPoint=E(!1);stepper;pointUsed=0;pointBalance=E(0);redeemPointValue=E(0);email=E(null);phone=E(null);contactToResend=E(null);verifyType=E(null);clearPin=E(!1);selectedTab=E(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,b=this.pointUsed*l;b>i&&(o=Math.ceil(i/l),b=i),(y.IsNotEmpty(e.Order.PointUsed)?e.Order.PointUsed:0)!=o&&(e.Order.PointUsed=o||0,e.Order.DiscountAmount=b,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&&Se(yl,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=S();r(0,"modal-material",1),_("onClose",function(){return u(o),f(i.onClose())}),r(1,"content")(2,"div",2)(3,"div",3)(4,"mat-stepper",4,0)(6,"mat-step",5),z(7,xl,1,0,"ng-template",6),r(8,"div",7)(9,"point-step",8),_("onVerify",function(b){return u(o),f(i.onVerify(b))}),D("pointUsedChange",function(b){return u(o),I(i.pointUsed,b)||(i.pointUsed=b),f(b)}),_("onRedeem",function(){return u(o),f(i.onRedeem())}),a()()(),r(10,"mat-step",9),z(11,Ml,1,0,"ng-template",6),r(12,"div",7)(13,"verify-step",10),_("resendCode",function(){return u(o),f(i.onResendCode())})("onVerify",function(b){return u(o),f(i.onVerifyCode(b))}),a()()(),r(14,"mat-step",11),z(15,Pl,1,0,"ng-template",6),r(16,"div",7)(17,"confirm-step",12),_("onConfirm",function(){return u(o),f(i.onConfirm())})("onCancel",function(){return u(o),f(i.onCancelRedeem())}),a()()()()()()()()}e&2&&(m("preventEnterEvent",!0)("config",i.modalConfig),s(4),m("linear",!0)("selectedIndex",i.selectedTab()),s(2),m("editable",!0),jo("aria-labelledby",i.selectedTab()==2?"stepDisabled":""),s(3),m("isVerifyEnabled",i.enabledLoyaltyPoint()),O("pointUsed",i.pointUsed),m("pointBalance",i.pointBalance())("email",i.email())("phone",i.phone()),s(),m("editable",!1),s(3),m("type",i.verifyType())("contact",i.contactToResend())("clearPin",i.clearPin()),s(4),m("pointUsed",i.pointUsed)("redeemPointValue",i.redeemPointValue())("showCancelBtn",i.selectedTab()==2))},dependencies:[ge,j,fe,Ca,fa,ua,ga,Sn,Mn,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 Ol(n,t){if(n&1){let e=S();r(0,"div",18),_("click",function(){u(e);let o=c(2);return f(o.onShowModalRedeem())}),r(1,"span"),h(2,"i",19),a(),r(3,"span"),p(4),v(5,"number"),a()()}if(n&2){let e=c(2);s(4),x(" ",M(5,1,e.pointUsed)," Points redeemed ")}}function Il(n,t){if(n&1){let e=S();r(0,"tab",3)(1,"div",6)(2,"div",7)(3,"label",8),p(4,"Discount %"),a()(),r(5,"div",9)(6,"input",10),D("ngModelChange",function(o){u(e);let l=c();return I(l.discount1,o)||(l.discount1=o),f(o)}),a(),r(7,"span",11),p(8,"%"),a(),r(9,"span",12),p(10,"+"),a(),r(11,"input",13),D("ngModelChange",function(o){u(e);let l=c();return I(l.discount2,o)||(l.discount2=o),f(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),D("ngModelChange",function(o){u(e);let l=c();return I(l.discountAmount,o)||(l.discountAmount=o),f(o)}),a(),g(20,Ol,6,3,"div",17),a()()()}if(n&2){let e=c();m("active",e.tabActive=="Discount"),s(6),O("ngModel",e.discount1),s(5),O("ngModel",e.discount2),s(6),x("Discount ",e.currencySymbol),s(2),m("disabled",e.pointUsed&&e.pointUsed>0),O("ngModel",e.discountAmount),s(),C(e.pointUsed&&e.pointUsed>0?20:-1)}}function Dl(n,t){if(n&1){let e=S();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),_("change",function(o){u(e);let l=c();return f(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),D("ngModelChange",function(o){u(e);let l=c();return I(l.surcharge,o)||(l.surcharge=o),f(o)}),a(),r(13,"span",11),p(14,"%"),a()()()()}if(n&2){let e=c();s(6),m("clearable",!1)("ngModel",e.salesOrder.Order.TaxTypeID)("items",e.taxes),s(6),O("ngModel",e.surcharge),m("max",100)("min",-100)}}function wl(n,t){if(n&1){let e=S();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),D("ngModelChange",function(o){u(e);let l=c();return I(l.discountAfterTax,o)||(l.discountAfterTax=o),f(o)}),_("ngModelChange",function(){u(e);let o=c();return f(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),D("ngModelChange",function(o){u(e);let l=c();return I(l.discounts[0],o)||(l.discounts[0]=o),f(o)}),_("ngModelChange",function(){u(e);let o=c();return f(o.calculateDiscountCalculator())}),a(),r(13,"span"),p(14," %"),a(),r(15,"span",12),p(16,"+"),a(),r(17,"input",28),D("ngModelChange",function(o){u(e);let l=c();return I(l.discounts[1],o)||(l.discounts[1]=o),f(o)}),_("ngModelChange",function(){u(e);let o=c();return f(o.calculateDiscountCalculator())}),a(),r(18,"span"),p(19," %"),a(),r(20,"span",12),p(21,"+"),a(),r(22,"input",29),D("ngModelChange",function(o){u(e);let l=c();return I(l.discounts[2],o)||(l.discounts[2]=o),f(o)}),_("ngModelChange",function(){u(e);let o=c();return f(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 ci=class n{constructor(t,e,i,o,l,b,V,J,ve,Le){this.dialogRef=t;this.orderService=e;this.invoiceCalculatorService=i;this.pageInitialService=o;this.roleService=l;this.customerHttpService=b;this.orderProcessorService=V;this.promotionCouponService=J;this.dialog=ve;this.data=Le;let Fe=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=Fe?.ApplicationLoyalty?.PreferedPayment,this.tabActive=this.data?.tabIndexActive,this.isEditOrder=this.orderProcessorService.Data.posState==2,this.customer=b.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=y.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=y.FilterByID(o,i);if(y.IsNotEmpty(l)&&l.CalculationTypeID==0){let b=1+l.Rate/100,V=e*b;this.discountAmount=(V-(V-this.discountAfterTax))/b}}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(si)}static \u0275fac=function(e){return new(e||n)(d(F),d(R),d(be),d(A),d(me),d(ft),d(U),d(Xe),d(ae),d(Ve))};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),_("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),_("onTabChange",function(l){return i.onTabChange(l)}),g(4,Il,21,7,"tab",3),g(5,Dl,15,6,"tab",4),g(6,wl,25,4,"tab",5),a()()()()),e&2&&(m("config",i.modalConfig),s(4),C(i.userRole.Discount?4:-1),s(),C(i.userRole.Tax?5:-1),s(),C(i.userRole.Discount?6:-1))},dependencies:[re,fe,G,Q,ee,sn,sa,la,ge,j,_t,ht,mt,Ke,K],encapsulation:2})};var In=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=St({type:n});static \u0275inj=vt({imports:[re,fe]})};var Dn=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=St({type:n});static \u0275inj=vt({imports:[re,fe,Qe,ge,Gt,_t,ma,ht,sn,Ke,xn,Yt,Rr,Jt,ht,Ut,_a,mr,Ui,In,ba,It,$i,Sa,pn,_t,ci,At,Hi,oa]})};var wn=class n{constructor(t,e,i,o,l,b,V){this.orderProcessorService=t;this.posDataService=e;this.signalBroadCast=i;this.calculatorService=o;this.OrderHttpService=l;this.localDataService=b;this.posService=V;this.newSale=new Be}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)(d(U),d(R),d(Zi),d(be),d(De),d(Ye),d(A))};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),_("click",function(){return i.retrySubmit()}),p(14," Retry Upload "),a()()()(),r(15,"div",11)(16,"div",12)(17,"div",13)(18,"button",14),_("click",function(){return i.saveOffline()}),h(19,"i",15),p(20,"Save Offline "),a()()()()())},dependencies:[Ke,se],encapsulation:2})};var ka=(()=>{let t=class t{constructor(){this.emailRegex=y.emailRegex,this.phoneNumberRegex=y.phoneNumberRegex}validate(i){let o=this.emailRegex,l=this.phoneNumberRegex,b=o.test(i.value),V=l.test(i.value);if(b||V||i.value=="")return null;{let J="Please input a valid email or phone number";return V?J="Please input a valid email":b&&(J="Please input a valid phone number"),{invalidEmailOrPhoneNumber:{value:i.value,errMessage:J}}}}};t.\u0275fac=function(o){return new(o||t)},t.\u0275dir=Ti({type:t,selectors:[["","pOSIsInvalidEmailOrPhoneNumber",""]],features:[st([{provide:tr,useExisting:t,multi:!0}])]});let n=t;return n})();function Tl(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 El(n,t){if(n&1){let e=S();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),_("click",function(){u(e);let o=c();return f(o.onSendViaWhatsApp())}),p(13,"Send via WhatsApp"),a()()()}if(n&2){let e=c();s(4),m("value",e.data.link),s(),m("cdkCopyToClipboard",e.data.link),s(6),m("formControl",e.whatsAppNumberCtrl),s(),m("disabled",e.whatsAppNumberCtrl.invalid)}}var Mi=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 or(null,[Vt.pattern("^[0-9]*$"),Vt.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)(d(F),d(Y),d(Ve))};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),_("onOk",function(){return i.close()})("onCancel",function(){return i.close()})("onClose",function(){return i.close()}),r(1,"content"),g(2,Tl,8,0)(3,El,14,4),a()()),e&2&&(m("config",i.modalConfig),s(2),C(i.data.link==null||i.data.link==""?2:3))},dependencies:[G,Q,dt,j,va],encapsulation:2})};var Vl=n=>({"rounded-0 rounded-start-2":n}),Al=(n,t)=>({"bg-gradient-warning":n,"bg-gradient-danger":t}),Ll=n=>({offline:n}),Fl=n=>({"ms-2":n}),Bl=(n,t)=>({ID:n,Template:t}),jl=(n,t,e)=>({InvoiceID:n,OutID:t,Template:e}),Hl=n=>({ID:n,Print:1,Printer:"Normal"}),Ul=n=>({ID:n}),Wl=(n,t)=>({cursor:n,opacity:t});function Ql(n,t){if(n&1&&(r(0,"a",41),p(1,"Delivery Order"),a()),n&2){let e=c(3);m("queryParams",le(1,Bl,e.completeData.OutDeliveryID,e.outletRegister.PrintTemplate.ID))}}function ql(n,t){if(n&1&&(r(0,"a",42),p(1,"Invoice & Delivery Order"),a()),n&2){let e=c(3);m("queryParams",hi(1,jl,e.completeData.ObjectID,e.completeData.OutDeliveryID,e.outletRegister.PrintTemplate.ID))}}function $l(n,t){if(n&1&&(r(0,"a",43),p(1,"Invoice (No Price)"),a()),n&2){let e=c(3);m("href",e.getInvoicePrintURL(!0),tt)}}function Jl(n,t){if(n&1&&(r(0,"a",44),p(1,"Packing Slip"),a()),n&2){let e=c(3);m("queryParams",T(1,Hl,e.completeData.OutDeliveryID))}}function Gl(n,t){if(n&1&&(r(0,"div",28),h(1,"button",39),r(2,"div",40),g(3,Ql,2,4,"a",41),g(4,ql,2,5,"a",42),g(5,$l,2,1,"a",43),g(6,Jl,2,3,"a",44),a()()),n&2){let e=c(2);s(3),C(e.completeData.OutDeliveryID?3:-1),s(),C(e.completeData.OutDeliveryID?4:-1),s(),C(e.completeData?5:-1),s(),C(e.completeData.OutDeliveryID?6:-1)}}function zl(n,t){n&1&&(r(0,"div",30)(1,"div",34)(2,"p",45),p(3," Transaction saved to your browser's local storage. Please upload when connection is restored! "),a()()())}function Kl(n,t){if(n&1){let e=S();r(0,"div",31)(1,"div",46)(2,"div",47),_("click",function(){u(e);let o=c(2);return f(o.changeReceiptContact())}),h(3,"i"),a(),r(4,"input",48),_("ngModelChange",function(o){u(e);let l=c(2);return f(l.isPhoneOrEmail(o))}),a()(),r(5,"div",49)(6,"button",50),_("click",function(){u(e);let o=c(2);return f(o.sendReceiptToContact())}),p(7," Send Receipt "),a()()()}if(n&2){let e=c(2);s(3),pe(e.receiptIcon+" fs-4"),s(),m("formControl",e.customerContact),s(2),m("disabled",e.customerContact.invalid)}}function Yl(n,t){if(n&1&&(r(0,"small",32),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 Xl(n,t){if(n&1){let e=S();r(0,"button",51),_("click",function(){u(e);let o=c(2);return f(o.onRetry())}),p(1," Retry Upload "),a()}}function Zl(n,t){if(n&1){let e=S();r(0,"div",53)(1,"button",54),_("click",function(){u(e);let o=c(3);return f(o.generateLink())}),h(2,"i",55),p(3,"Generate Payment Link "),a()()}}function es(n,t){if(n&1){let e=S();r(0,"div",53)(1,"button",56),_("click",function(){u(e);let o=c(3);return f(o.verifyPaymentSettlement())}),h(2,"i",57),p(3,"Verify Payment Settlement "),a()()}}function ts(n,t){if(n&1&&(r(0,"div",38)(1,"div",52),g(2,Zl,4,0,"div",53),g(3,es,4,0,"div",53),a()()),n&2){let e=c(2);s(2),C(e.completeData.PaymentStateID==1?2:-1),s(),C(e.isNotEmpty(e.paymentGatewayService.getTransactionId())?3:-1)}}function is(n,t){if(n&1){let e=S();r(0,"div",7)(1,"div",24)(2,"div",25)(3,"h2"),h(4,"i",26),p(5," Sell Complete "),r(6,"small",27),p(7),a()(),r(8,"div"),g(9,Gl,7,4,"div",28),a()()(),r(10,"div",13)(11,"div",29),g(12,zl,4,0,"div",30)(13,Kl,8,4,"div",31),g(14,Yl,2,1,"small",32),r(15,"div",33)(16,"div",34)(17,"div",35),g(18,Xl,2,0,"button",36),r(19,"button",37),_("click",function(){u(e);let o=c();return f(o.newSale())}),p(20," New Sale (F8) "),a()()()()()(),g(21,ts,4,2,"div",38),a()}if(n&2){let e=c();s(),m("ngClass",le(9,Al,(!e.isOrderDateNow||e.completeData.PaymentStateID<3)&&e.completeData.PaymentStateLabel!="Offline",e.completeData.PaymentStateLabel=="Offline")),s(6),x(" (",e.completeData.PaymentStateLabel,")"),s(2),C(e.completeData.PaymentStateLabel=="Offline"?9:-1),s(2),m("ngClass",T(12,Ll,e.completeData.PaymentStateLabel=="Offline")),s(),C(e.completeData.PaymentStateLabel=="Offline"?12:13),s(2),C(e.customerContact!=null&&e.customerContact.invalid&&(e.customerContact!=null&&e.customerContact.dirty||e.customerContact!=null&&e.customerContact.touched)?14:-1),s(4),C(e.completeData.PaymentStateLabel=="Offline"&&!e.isSuccessRetrySubmit()?18:-1),s(),m("ngClass",T(14,Fl,e.completeData.PaymentStateLabel=="Offline")),s(2),C(e.isOnline&&(e.completeData==null?null:e.completeData.PaymentStateID)==1||e.isNotEmpty(e.paymentGatewayService.getTransactionId())?21:-1)}}function ns(n,t){if(n&1){let e=S();r(0,"app-retry",58),_("newSale",function(){u(e);let o=c();return f(o.newSale())}),a()}}function os(n,t){if(n&1&&(r(0,"a",11),p(1),a()),n&2){let e=c();m("queryParams",T(2,Ul,e.completeData.ObjectID)),s(),x(" Invoice #",e.completeData==null?null:e.completeData.InvoiceNumber," ")}}function rs(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 as(n,t){if(n&1&&(p(0),v(1,"number")),n&2){let e=c().$implicit;Ue(" ",e.CurrencySymbol," ",M(1,2,e.Amount)," ")}}function ls(n,t){n&1&&p(0," - ")}function ss(n,t){if(n&1&&(r(0,"div",59)(1,"div",60),p(2),a(),r(3,"div",61),g(4,as,2,4)(5,ls,1,0),a()()),n&2){let e=t.$implicit,i=c(2);s(2),k(e.Label),s(2),C(i.role.PriceVisible?4:5)}}function cs(n,t){if(n&1&&(r(0,"div",13),ie(1,ss,6,2,"div",59,de),a()),n&2){let e=c();s(),ne(e.itemSummary)}}function ps(n,t){if(n&1&&(r(0,"div",62)(1,"div",64),p(2),a(),r(3,"div",65),p(4),v(5,"number"),a()()),n&2){let e=t.$implicit,i=t.$index,o=c(2);s(),m("hidden",!o.role.PriceVisible),s(),Ue(" ",e.Label,": ",e.CurrencySymbol," "),s(),m("hidden",!o.role.PriceVisible)("ngClass",i+1===o.amountSummary.length?"amount":""),s(),x(" ",M(5,6,e.Amount)," ")}}function ds(n,t){if(n&1&&(r(0,"div",62)(1,"div",64),p(2),a(),r(3,"div",66),p(4),v(5,"number"),a()()),n&2){let e=t.$implicit,i=c(3);s(),m("hidden",!i.role.PriceVisible),s(),Ue(" ",e.Label,": ",e.CurrencySymbol," "),s(),m("hidden",!i.role.PriceVisible),s(),x(" ",M(5,5,e.Amount)," ")}}function ms(n,t){if(n&1&&(r(0,"div",63),ie(1,ds,6,7,"div",62,de),a()),n&2){let e=c(2);s(),ne(e.paymentSummary)}}function us(n,t){if(n&1&&(r(0,"div",14),ie(1,ps,6,8,"div",62,de),g(3,ms,3,0,"div",63),a()),n&2){let e=c();s(),ne(e.amountSummary),s(2),C((e.paymentSummary==null?null:e.paymentSummary.length)>0?3:-1)}}function fs(n,t){if(n&1&&(r(0,"div",15)(1,"div",67)(2,"p",68),p(3,"INVALID AMOUNT CHARGE, CORRECT AMOUNT"),a(),r(4,"P",69),p(5),v(6,"number"),a()()()),n&2){let e=c();s(5),x("",M(6,1,e.completeData==null?null:e.completeData.Final)," ")}}function gs(n,t){if(n&1){let e=S();r(0,"a",70),_("click",function(o){u(e);let l=c();return f(l.isGlobalPrintEnabled()?null:o.preventDefault())}),h(1,"i",71),a()}if(n&2){let e=c();m("href",e.getInvoicePrintURL(!1),tt)("matTooltip",e.isGlobalPrintEnabled()?"Print in New Tab":"Required Global Print Role")("ngStyle",le(3,Wl,e.isGlobalPrintEnabled()?"pointer":"default",e.isGlobalPrintEnabled()?"1":"0.5"))}}function Cs(n,t){if(n&1&&(r(0,"div",7)(1,"div",9)(2,"h3",10),p(3,"Point Balance"),a()(),h(4,"div",72),a()),n&2){let e=c();s(4),m("innerHtml",e.completeData.LoyaltyPoint,ki)}}function _s(n,t){if(n&1&&h(0,"pos-receipt",73),n&2){let e=c(2);m("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 hs(n,t){if(n&1&&h(0,"pos-receipt-a4",74),n&2){let e=c(3);m("data",t)("printTemplate",e.outletRegister.PrintTemplate)("config",e.posStorage.AppConfigJSON)("workOrderMode",!1)("stylesheet",e.posStorage.StylesSheet)}}function bs(n,t){if(n&1&&(g(0,hs,1,5,"pos-receipt-a4",74),v(1,"async")),n&2){let e,i=c(2);C((e=M(1,1,i.receiptTemplateA4$))?0:-1,e)}}function vs(n,t){if(n&1&&(g(0,_s,1,8,"pos-receipt",73),g(1,bs,2,3)),n&2){let e=c();C(e.receiptTemplate&&e.printMode==2?0:-1),s(),C(e.printMode==1?1:-1)}}function Ss(n,t){n&1&&(r(0,"div",23)(1,"h1"),p(2," Cannot generate print preview because of client-server amount Mismatch "),a()())}var kn=class n{constructor(t,e,i,o,l,b,V,J,ve,Le,Fe,mi,Ii,Di,Nt,ui,Io,co,Do,Ka,Ya){this._posDataService=t;this._posService=e;this._orderProcessorService=i;this._OrderHttpService=o;this._PaymentHttpService=l;this._receiptService=b;this._outletService=V;this._toastr=J;this._onlineStatusService=ve;this._matDialog=Le;this._signalBroadCast=Fe;this._calculatorService=mi;this._userRoleService=Ii;this._router=Di;this._receiptCalculatorService=Nt;this.datePipe=ui;this.decimalPipe=Io;this.paymentGatewayService=co;this.paymentHttpService=Do;this.shoppingCartService=Ka;this.roleService=Ya;this.isGlobalPrintEnabled.set(this.roleService.global.Print)}whatsappSendReceiptService=X(ho);handleF8(){this.newSale()}salesOrder=new ut;receiptTemplate=null;receiptTemplateA4$;completeData=new jr;printMode=2;outletRegister=new Ji;role;finalAmountDifferent=!1;amountSummary=[];itemSummary=[];paymentSummary=[];isOnline=!1;destroy$=new q;get posStorage(){return this._posService.Data}currentSellState;isOrderDateNow;sellState=Me;receiptIcon="fa-brands fa-whatsapp";customerContact=new pt;printOnPayment=E(!0);isSuccessRetrySubmit=E(!1);isGlobalPrintEnabled=E(!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(oe(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&&y.IsNotEmpty(e)&&this.sendEmail()}resetUrlAfterRedirect(){this._router.events.pipe(w(this.destroy$)).subscribe(t=>{t instanceof Ko&&(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=y.emailRegex,i=y.phoneNumberRegex,o=e,l=i,b=o.test(t),V=l.test(t);if(b)return this.receiptIcon="fa-solid fa-envelope","Email";if(V)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._calculatorService.Data,o=t.ModuleSell.ToleranceAmount,l=e-i;if(l!=o&&l!=0){this.finalAmountDifferent=!0;let b=this.decimalPipe.transform(e);setTimeout(()=>{this._toastr.warning(`Final Amount should be ${b}! Use Print Receipt to print the correct Receipt!`,"Invalid Amount charged",{timeOut:1e4})},500)}else this.finalAmountDifferent=!1}}checkOrderNumber(){let t=this.completeData.InvoiceNumberResult,e=y.IsNotEmpty(t)&&y.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(Mi);let t={InvoiceID:this.completeData.ObjectID};this._PaymentHttpService.generateLink(t).subscribe({next:e=>{this._matDialog.open(Mi,{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"),y.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",Ne.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(){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$),et(t=>(t.Data.AfterSell=!0,t.Data)),fi(t=>{throw this._toastr.error(`Could not print in A4 format!
|
|
@@ -54,4 +54,4 @@ Printing in 8mm format instead!`,"Error!"),this.printReceiptMini(),t}),Ie(()=>{t
|
|
|
54
54
|
Please add the tag <a href="/menu/Setup/Tag/Sales_Order">here</a> to continue.
|
|
55
55
|
</p>
|
|
56
56
|
`,headerType:Ne.Error},width:"28rem"})}initializeRole(){let e=new Fr(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(!y.IsEmpty(e)){let i=JSON.parse(e);this.paymentServiceGateway.onQRPaymentComplete(i,this.posHttpResponse.AppConfigJSON).then(o=>{this.dialog.getDialogById("ModalPayment").close();let V=`IDR ${this.decimalPipe.transform(i.gross_amount)} received. Please verify in customer mobile app!`;this.toastr.success(V," 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(Kn).afterClosed().pipe(oe(o=>!y.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)}ngOnDestroy(){this.intercomService.showLauncher(),this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(i){return new(i||n)(d(Ye),d(A),d($),d(Yo),d(Zo),d(U),d(K),d(en),d(ae),d(Y),d(ke),d(me),d(kt),d(De),d(Mt),d(lr),d(hr),d($t),d(Xt),d(an),d(xt),d($e),d(qe),d(Dt),d(Xe),d(Zt),d(R))};static \u0275cmp=P({type:n,selectors:[["POS-sell-v3"]],features:[st([ke,Rt]),Ei],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),g(2,Cu,1,1)(3,_u,3,0,"div",2),a(),r(4,"div",3),g(5,hu,1,4,"park-order",4),g(6,bu,1,5,"POS-bill-receipt-A4",5),g(7,vu,1,6,"pos-receipt",6),a()),i&2&&(s(),m("ngClass",T(5,fu,o.currentSubsStatus==o.subscriptionStatus.OVERDUE||o.currentSubsStatus==o.subscriptionStatus.SELL_ONLY)),s(),C(o.currentState!=o.sellState.IsComplete&&o.currentState!=o.sellState.UploadOrderFail?2:3),s(3),C(o.isPrintPark&&o.receiptTemplate?5:-1),s(),C(o.receiptTemplate&&o.isPrintBillA4?6:-1),s(),C(o.receiptTemplate&&o.isPrintBillMini?7:-1))},dependencies:[re,H,vn,Zn,da,so,Dn,Qe,It,rn,on,dn,ta,ea,Zr,Xr,kn,Or,Ma],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})},Ny=[{path:"Offline",loadChildren:()=>import("./chunk-
|
|
57
|
+
`],encapsulation:2})},Ny=[{path:"Offline",loadChildren:()=>import("./chunk-OHG6W52G.js").then(n=>n.OfflineModule)},{path:"",loadComponent:()=>Oo}];export{Oo as SellV3Component,Ny as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f}from"./chunk-
|
|
1
|
+
import{c as f}from"./chunk-47TR66HI.js";import{a as m}from"./chunk-DGKIIUIQ.js";import{Bd as l,I as c,be as v,ee as u,k as n,la as s,oa as e,yd as h}from"./chunk-JYZTRN6N.js";var d=class o{constructor(t,r,p,i){this.httpService=t;this.authService=r;this.httpClientService=p;this.toastr=i}port=window.location.href.split("localhost:")[1]?.split("/")[0];hostURL=t=>m.production?t:`https://localhost:${this.port}${t}`;configure2FA(t){return this.httpService.post("/api/Authentication/Setup_2FA",t)}validateCode(t,r){let p=this.authService.loginResponse?.Token,i=new h({"Content-Type":"application/json","Cache-Control":"no-cache"});i=i.append("Authorization","Bearer "+p);let S={ValidationCode:t,UserID:r};return this.httpClientService.post(this.hostURL("/api/Login/Validate_2FA "),S,{headers:i}).pipe(c(a=>(this.toastr.error(a?.error?.Message,"Error - "+a.status),n)))}disableTwoFactorAuthentication(){let t={enabled:!1};return this.httpService.post("/api/Authentication/Setup_2FA",t)}static \u0275fac=function(r){return new(r||o)(e(u),e(f),e(l),e(v))};static \u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"})};export{d as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Q,b as U}from"./chunk-KEAT6AT3.js";import{d as te,e as ie}from"./chunk-SO4GMA3Y.js";import{a as X}from"./chunk-
|
|
1
|
+
import{a as Q,b as U}from"./chunk-KEAT6AT3.js";import{d as te,e as ie}from"./chunk-SO4GMA3Y.js";import{a as X}from"./chunk-ZGY4RDNA.js";import{e as $,f as ee}from"./chunk-AS4NJOPX.js";import{b as Z}from"./chunk-OGB3GW4L.js";import{d as Y}from"./chunk-7TBS7SPQ.js";import{F as A,c as H,h as z,o as q}from"./chunk-RNLSEEMX.js";import{d as K}from"./chunk-USJ6ILEE.js";import{$d as j,Ab as W,Bb as M,Bc as y,Cb as s,Db as i,Dc as v,Eb as o,Hc as P,Mb as h,Ob as D,Qb as m,Xa as l,Zd as R,be as O,cd as J,db as _,dc as p,ee as G,fc as S,hb as w,ic as u,jc as C,kc as b,lb as F,md as V,nb as k,od as B,rd as N,ta as c,tc as T,ua as g,uc as E,vb as f,vc as I,xb as x,zb as L}from"./chunk-JYZTRN6N.js";var ne=()=>["/menu/Developer/Webhook/Job_Logs/Detail"],ae=n=>({ID:n}),re=(n,d)=>({"text-success":n,"text-danger":d});function le(n,d){if(n&1){let e=h();i(0,"div",12)(1,"h6"),p(2,"Status"),o(),i(3,"ng-select",13),b("ngModelChange",function(t){c(e);let r=m(2);return C(r.pageData.Filter.Status,t)||(r.pageData.Filter.Status=t),g(t)}),o(),i(4,"h6"),p(5,"Job ID"),o(),i(6,"input",14),b("ngModelChange",function(t){c(e);let r=m(2);return C(r.pageData.Filter.JobID,t)||(r.pageData.Filter.JobID=t),g(t)}),o(),i(7,"h6"),p(8,"From"),o(),i(9,"datepicker",15),b("dateChange",function(t){c(e);let r=m(2);return C(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),g(t)}),o(),i(10,"h6"),p(11,"To"),o(),i(12,"datepicker",16),b("dateChange",function(t){c(e);let r=m(2);return C(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),g(t)}),o()()}if(n&2){let e=m(2);l(3),s("disabled",!e.role.developer.Edit)("items",e.pageData.Options.Status),u("ngModel",e.pageData.Filter.Status),l(3),u("ngModel",e.pageData.Filter.JobID),l(3),s("isFloatingLabel",!1),u("date",e.pageData.Filter.From),l(3),s("isFloatingLabel",!1),u("date",e.pageData.Filter.To)}}function pe(n,d){if(n&1&&(i(0,"tr",9)(1,"td")(2,"a",17),p(3),y(4,"date"),o()(),i(5,"td"),p(6),y(7,"number"),o(),i(8,"td",18),p(9),o()()),n&2){let e=d.$implicit;l(2),s("routerLink",T(12,ne))("queryParams",E(13,ae,e._id)),l(),S(" ",v(4,6,e._source["@timestamp_received"],"dd MMM yyyy HH:mm")," "),l(3),S("",v(7,9,e.DurationInSecond,"1.1-1")," s"),l(2),s("ngClass",I(15,re,e._source.log.respCode==200,e._source.log.respCode!=200)),l(),S(" ",e._source.log.respCode," ")}}function me(n,d){if(n&1){let e=h();i(0,"mat-paginator",19),D("page",function(t){c(e);let r=m(2);return g(r.onPaginationChange(t))}),o()}if(n&2){let e=m(2);s("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}function se(n,d){if(n&1){let e=h();i(0,"mainpanel-cmp",2),D("onSubmit",function(){c(e);let t=m();return g(t.searchFromPageOne())}),i(1,"filters"),k(2,le,13,8,"ng-template",null,0,P),o(),i(4,"content")(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr",7)(10,"th",8),p(11,"Created"),o(),i(12,"th",8),p(13,"Duration"),o(),i(14,"th",8),p(15,"Status"),o()()(),i(16,"tbody"),W(17,pe,10,18,"tr",9,L),o()()(),i(19,"div",10),f(20,me,1,3,"mat-paginator",11),o()()()()}if(n&2){let e=m();s("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),l(17),M(e.data.hits),l(3),x(e.pagination.listTotal>0?20:-1)}}var oe=class n extends X{constructor(e,a,t,r){super(e,a,"Developer/DeveloperSpace/Webhook/JobLogs","Developer/DeveloperSpace/WebhookLoader/GetLogs",t);this.httpService=a;this.role=r}postInit(e){this.data.hits=this.data?.hits.map(a=>(a.DurationInSecond=parseInt(a._source?.Duration)/1e3,a)),this.data.ListTotal=e?.total?.value}static \u0275fac=function(a){return new(a||n)(_(Z),_(G),_(O),_(K))};static \u0275cmp=w({type:n,selectors:[["app-webhook-job-logs"]],features:[F],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown"],[3,"onSubmit","pageData","hideSearchBox","isFilterOnDropdown"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","50px"],[1,"border-bottom"],[1,"mt-2"],[3,"length","pageSize","pageIndex"],[1,"dialog-filter"],["bindLabel","Value","bindValue","Key","placeholder","Choose a status","appendTo","body",3,"ngModelChange","disabled","items","ngModel"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],[3,"routerLink","queryParams"],[3,"ngClass"],[3,"page","length","pageSize","pageIndex"]],template:function(a,t){a&1&&f(0,se,21,4,"mainpanel-cmp",1),a&2&&x(t.data?0:-1)},dependencies:[N,J,ee,$,ie,te,U,Q,Y,A,H,z,q,j,R,B,V],encapsulation:2})};export{oe as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as s}from"./chunk-
|
|
1
|
+
import{b as s}from"./chunk-47TR66HI.js";import{a as i}from"./chunk-USJ6ILEE.js";import{la as o,oa as l}from"./chunk-JYZTRN6N.js";var p=class r{constructor(t){this.cookieService=t}_reportFilter={from:null,outletIds:[],to:null};_cookiesName="ReportFilter";initOutletFilter(t=[]){let e=this.getReportFilter();return i.IsNotEmpty(e?.outletIds)?t=e.outletIds:this.setOutletFilter(t),t}initDateFromFilter(t){let e=this.getReportFilter();return i.IsNotEmpty(e?.from)?t=e.from:this.setDateFromFilter(t),t}initDateToFilter(t){let e=this.getReportFilter();return i.IsNotEmpty(e?.to)?t=e.to:this.setDateToFilter(t),t}setDateFromFilter(t){let e=this.getReportFilter();i.IsEmpty(e)&&(e=this._reportFilter),e.from=t,this.saveFilterToCookie(e)}setDateToFilter(t){let e=this.getReportFilter();i.IsEmpty(e)&&(e=this._reportFilter),e.to=t,this.saveFilterToCookie(e)}setOutletFilter(t=[]){let e=this.getReportFilter();i.IsEmpty(e)&&(e=this._reportFilter),e.outletIds=t,this.saveFilterToCookie(e)}saveFilterToCookie(t){this.cookieService.set(this._cookiesName,JSON.stringify(t),this.getExpiredDate(),"/")}getReportFilter(){if(this.cookieService.check("ReportFilter")){let t=this.cookieService.get("ReportFilter");this._reportFilter=JSON.parse(t)}return this._reportFilter}getExpiredDate(){let t=new Date,F=1*60*60*1e3;return t.setTime(t.getTime()+F),t}resetFilter(){this._reportFilter={from:null,outletIds:[],to:null},this.cookieService.delete("ReportFilter","/")}static \u0275fac=function(e){return new(e||r)(l(s))};static \u0275prov=o({token:r,factory:r.\u0275fac,providedIn:"root"})};export{p as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as P}from"./chunk-
|
|
1
|
+
import{a as P}from"./chunk-XI3UF2BK.js";import{a as w}from"./chunk-AS4NJOPX.js";import{a as C}from"./chunk-M43HNBJQ.js";import{a as A}from"./chunk-OGB3GW4L.js";import{a as I}from"./chunk-A45GTZVV.js";import{a as l}from"./chunk-2FWFPV5I.js";import{a as c}from"./chunk-USJ6ILEE.js";import{fa as y,pa as f,t as L,z as S}from"./chunk-JYZTRN6N.js";import{a as F}from"./chunk-SNAKHGZS.js";var g=class{enabledDragItem;constructor(){this.enabledDragItem=!1}drop(o,t){C(t.Data,o.previousIndex,o.currentIndex)}toggleEnabledDragItem(){}onSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.postListID(o,t.data.Data)}onPutSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.putListID(o,t.data.Data)}};var u=class{constructor(o){this.httpService=o}exportCSV(o,t,e,i){e.pageData.Filter.Export=!0,e.pageData.Filter.FormatType=0,i=i||"export.csv",this.httpService.post(`/api/${t}`,e.pageData.Filter).subscribe(r=>{o.convertToCSV(r,i),e.pageData.Filter.Export=!1})}convertToCSV(o,t=!1,e){let i=this.ExportDataFromUI2(t);o.convertToCSV(i,e)}ExportDataFromUI2(o=!1){let t=document.getElementById("tableGrid"),e=[];return c.IsNotEmpty(t)&&t.querySelectorAll("tr").forEach(r=>{let a=new Object,s=0;r.querySelectorAll("th, td").forEach(n=>{s++;let b=parseInt(n.getAttribute("colspan"));for(let h=1;h<b;h++)a["column"+s]="",s++;let m=n.innerText,v=m.toString().split("");if(o&&v[0]==="0"&&v.length>1){let h="'"+m.trim();a["column"+s]=h}else a["column"+s]=m.trim()}),e.push(a)}),e}};var d=class{listTotal;pageSize;show;constructor(){this.listTotal=0,this.pageSize=0,this.show=!1}changePaginationData(o){this.pageSize=o.pageData.Filter.RowCount,this.listTotal=o.data?.ListTotal??o.data?.Data?.total?.value,this.show=this.pageSize<=this.listTotal}changePage(o,t,e){t.Filter.PageNumber=o.pageIndex+1,e.getListData()}};var x=class extends A{constructor(t,e,i,r,a,s,p){super(t);this.httpService=e;this.dataAPI=i;this.pageAPI=r;this.toastrService=a;this.route=s;this.initOpenDialog=p;this.exportHandler=new u(e),r?(s&&(this.loaderPayload=F({ListIDs:this.reportFilterService?.initOutletFilter()},s.snapshot.queryParams)),this.preInitLoader(),S([this.menuData$,this.httpService.post("/api/"+this.pageAPI,this.loaderPayload)]).pipe(L(([n,b])=>b)).pipe(I()).subscribe(n=>{this.pageData=n,this.pageData.Filter||(this.pageData.Filter={},this.pageData.Filter.RowCount=20),this.pageData.Filter.PageNumber=1,this.pageData.Filter.ID=this.loaderPayload.ID,this.preInitList(),p?this.openDialogFilter.openDialog():this.getListData()})):(this.pageData.Filter.RowCount=20,this.pageData.Filter.PageNumber=1,this.preInitList(),S({menuData:this.menuData$,listData:this.getListData$()}).pipe(I()).subscribe())}openDialogFilter=f(w);reportFilterService=f(P);pageData={Filter:{},Options:{},Roles:{},Config:{}};data;pagination=new d;dragDrop=new g;exportHandler;comparation=0;loaderPayload={};preInitLoader(){}preInitList(){}getListData(t){this.preGetList(),this.dataAPI&&this.httpService.post("/api/"+this.dataAPI,this.pageData.Filter).subscribe(e=>{this.data=e,this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)})}getListData$(t){return this.preGetList(),this.httpService.post("/api/"+this.dataAPI,this.pageData.Filter).pipe(y(e=>{this.data=e,this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)}))}searchFromPageOne(){this.preSearchFromPageOne(),this.pageData.Filter.PageNumber=1,this.getListData("filterMode")}postInit(t){t.PageTitle!=null&&(this.menuData.H=t.PageTitle)}preGetList(){this.pageData.Filter.From==null&&(this.pageData.Filter.From=c.MinDate),this.pageData.Filter.To==null&&(this.pageData.Filter.To=c.MinDate)}preSearchFromPageOne(){}onPaginationChange(t){this.pagination.changePage(t,this.pageData,this)}onSelectAllData(t){this.data.Data=this.data.Data.map(e=>(e.selected=t,e))}getSelectedData(){let t=[];return this.data&&(t=this.data.Data.filter(e=>e.selected)),t}httpPostListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.postListID(t,r,i)}httpPutListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.putListID(t,r,i)}httpDeleteListID(t,e,i){if(e||(e="Are you sure you want to delete selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.DeleteListID(t,r,i)}onSaveDragAndDrop(t){this.dragDrop.onSaveDragAndDrop(t,this)}onPutSaveDragAndDrop(t){this.dragDrop.onPutSaveDragAndDrop(t,this)}postListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.post(`/api/${t}`,r,1e6,!0).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,l.Success),this.getListData()},a=>{let s=a.status+" "+a.statusText;this.toastrService.error(a.error.Message!=""?a.error.Message:"An unknown error has occured!",s,{enableHtml:!0})})}putListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.put(`/api/${t}`,r).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,l.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.delete(`/api/${t}`,{body:r}).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,l.Success),this.getListData()})}postData(t,e){this.httpService.post("/API/"+t,e).subscribe(i=>{this.getListData(),this.toastrService.success(i.Message?i.Message:i,l.Success)})}compare(t,e,i){return(t<e?-1:1)*(i?1:-1)}exportCSV(t,e,i){this.exportHandler.exportCSV(t,e,this,i)}s2ab(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),r=0;r!=t.length;++r)i[r]=t.charCodeAt(r)&255;return e}exportXlsx(t,e){this.pageData.Filter.FormatType=1,this.pageData.Filter.Export=!0,this.httpService.post(`/api/${t}`,this.pageData.Filter).subscribe(i=>{e=decodeURI(e);let r=window.URL.createObjectURL(new Blob([this.s2ab(atob(i))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),a=document.createElement("a");a.href=r,a.setAttribute("download",e),document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(r),a.remove()})}convertToCSV(t,e=!1,i){let r=this.exportHandler.ExportDataFromUI2(e);t.convertToCSV(r,i)}OnCompare(t){let e=t?this.data[t]:this.data;if(e.length<1)return;let i=Object.assign({},this.pageData.Filter);i.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),i.To=new Date(new Date(this.pageData.Filter.To).getFullYear(),new Date(this.pageData.Filter.To).getMonth(),0).toDateString(),this.httpService.post("/API/"+this.dataAPI,i).subscribe(r=>{let a=t?r[t]:r;this.comparation=0,e.forEach(s=>{s.PrevIndex="-",s.CurrentIndex="-",s.Increase="-";let p=a.filter(n=>n.EntityID==s.EntityID);if(s.CurrentIndex=s.Rank,p.length>0){let n=p[0];s.PrevIndex=n.Rank,n.SalesNet?s.Increase=(s.SalesNet-n.SalesNet)/n.SalesNet*100:n.Sales&&(s.Increase=(s.Sales-n.Sales)/n.Sales*100),s.IsPositive=s.Increase>0,s.IsNegative=s.Increase<0,this.comparation+=s.Increase}})})}};export{x as a};
|