dealpos 12.75.3 → 12.75.5
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/POS/{chunk-CZ3E6QYZ.js → chunk-24RVYYWI.js} +1 -1
- package/POS/{chunk-53TX3GTY.js → chunk-2HYHDBFK.js} +1 -1
- package/POS/{chunk-PTMLF7B4.js → chunk-2L5MKPBF.js} +1 -1
- package/POS/{chunk-POGDBNMW.js → chunk-2QHS4AFT.js} +1 -1
- package/POS/{chunk-32Y2N3LA.js → chunk-2TLCQ5YM.js} +1 -1
- package/POS/{chunk-PHDWHEWX.js → chunk-34QGPIKM.js} +1 -1
- package/POS/{chunk-PVH6F5E3.js → chunk-43UTTGIN.js} +1 -1
- package/POS/{chunk-HCGEQFDX.js → chunk-6I644SGJ.js} +1 -1
- package/POS/{chunk-IXPP2CGB.js → chunk-6MQXLEAU.js} +1 -1
- package/POS/{chunk-BGMVOWGU.js → chunk-6TGBTSKD.js} +1 -1
- package/POS/{chunk-U4XQ6SIG.js → chunk-7H2GUIRZ.js} +1 -1
- package/POS/{chunk-6LQOKIZG.js → chunk-7RCPAQOT.js} +1 -1
- package/POS/{chunk-BTD46GBC.js → chunk-ATSEGUNC.js} +1 -1
- package/POS/{chunk-S5574DON.js → chunk-AVJ2RER7.js} +1 -1
- package/POS/{chunk-IF77XOHG.js → chunk-BVAMO5ZJ.js} +1 -1
- package/POS/{chunk-7ED3NT2I.js → chunk-CSQAB6L6.js} +1 -1
- package/POS/{chunk-MCS3YHTO.js → chunk-DLLKLASI.js} +1 -1
- package/POS/{chunk-ORSWVLLV.js → chunk-DQLQWPTX.js} +1 -1
- package/POS/{chunk-7GQOWNVT.js → chunk-DR5AAQRU.js} +1 -1
- package/POS/{chunk-ARQ7MSIM.js → chunk-ELPFTCQJ.js} +1 -1
- package/POS/{chunk-FJG2KFST.js → chunk-ETFAZZ4K.js} +1 -1
- package/POS/{chunk-MBJRPPKV.js → chunk-EXGFD7NE.js} +1 -1
- package/POS/{chunk-HKSYYYNN.js → chunk-FFKDWS7A.js} +1 -1
- package/POS/{chunk-NUQXG7PJ.js → chunk-FH4FYBOK.js} +1 -1
- package/POS/{chunk-RJXXNUXC.js → chunk-FHHIXDBW.js} +1 -1
- package/POS/{chunk-GXA6S5MX.js → chunk-G43IZOIK.js} +1 -1
- package/POS/{chunk-AB66KFK3.js → chunk-GWZIO33Z.js} +1 -1
- package/POS/{chunk-BUYCPKFR.js → chunk-H6GPWFWI.js} +1 -1
- package/POS/{chunk-EWSDAM2J.js → chunk-HMMVF5DN.js} +1 -1
- package/POS/{chunk-YWEZTD2X.js → chunk-HRN2PPB4.js} +1 -1
- package/POS/{chunk-7VANBRKQ.js → chunk-IBZ7YKZU.js} +1 -1
- package/POS/{chunk-L4WNLSD3.js → chunk-IMNHVP5P.js} +1 -1
- package/POS/{chunk-N4CPCNX7.js → chunk-IYCP3LSQ.js} +2 -2
- package/POS/{chunk-A3YGHBPS.js → chunk-JE2APX2W.js} +1 -1
- package/POS/{chunk-VO2KMEOE.js → chunk-KF5BOONI.js} +1 -1
- package/POS/{chunk-O7OYUAC6.js → chunk-KFFEVEC6.js} +1 -1
- package/POS/{chunk-PBKVPRMR.js → chunk-KSR6XRTK.js} +1 -1
- package/POS/{chunk-JDKMTV2M.js → chunk-L4W6M4U5.js} +1 -1
- package/POS/{chunk-TFTUER7Z.js → chunk-LETA7VLN.js} +1 -1
- package/POS/{chunk-7RPYJTSB.js → chunk-LEW6RNVA.js} +1 -1
- package/POS/{chunk-MXHULEI6.js → chunk-M3OPWYEH.js} +1 -1
- package/POS/{chunk-M6RGMJL6.js → chunk-MHOSRHNN.js} +1 -1
- package/POS/{chunk-OYVGMAGF.js → chunk-MSZBPFVC.js} +1 -1
- package/POS/{chunk-ZCX3TTQ2.js → chunk-NGJVL6SF.js} +1 -1
- package/POS/{chunk-GAGMCDSM.js → chunk-NGR5QZSH.js} +1 -1
- package/POS/{chunk-UC532DT2.js → chunk-OGVUN66S.js} +2 -2
- package/POS/{chunk-ZDHAJ6DN.js → chunk-PRU3OCLW.js} +1 -1
- package/POS/{chunk-E5DTMYYU.js → chunk-RNLRTQJE.js} +1 -1
- package/POS/{chunk-MH2WG4S3.js → chunk-S47MI6HT.js} +1 -1
- package/POS/{chunk-VMJW36P7.js → chunk-SAFNGJXB.js} +1 -1
- package/POS/{chunk-COFBARMC.js → chunk-T6OORKBF.js} +1 -1
- package/POS/{chunk-BCNB77CL.js → chunk-TNJR4OSQ.js} +1 -1
- package/POS/{chunk-SUXPF525.js → chunk-UGNCTQ6B.js} +1 -1
- package/POS/{chunk-X2IDXSR4.js → chunk-UH5ZVOR3.js} +1 -1
- package/POS/{chunk-MKMIVH5J.js → chunk-UQL2DIGB.js} +2 -2
- package/POS/{chunk-2G4Q526Y.js → chunk-VC3WHSRJ.js} +1 -1
- package/POS/{chunk-ADPFG2PM.js → chunk-VYPHSWW4.js} +1 -1
- package/POS/{chunk-ORMCVN4N.js → chunk-WA2UHCKX.js} +2 -2
- package/POS/{chunk-UIO7M3UX.js → chunk-WBGJQ5OS.js} +1 -1
- package/POS/{chunk-NRQOSKWJ.js → chunk-WYPYMZJD.js} +1 -1
- package/POS/{chunk-O4JPGXEQ.js → chunk-X3FYBKB7.js} +2 -2
- package/POS/{chunk-SD7K65NL.js → chunk-Y5OLUUY7.js} +1 -1
- package/POS/{chunk-ZEMWKZPJ.js → chunk-YC6TLV33.js} +2 -2
- package/POS/{chunk-VQY3GCO7.js → chunk-YI4FUMHY.js} +1 -1
- package/POS/{chunk-3YHEHDYC.js → chunk-ZAOPJJ3U.js} +1 -1
- package/POS/{chunk-5QR6P7PD.js → chunk-ZH4LWIUF.js} +1 -1
- package/POS/{chunk-MAS7XXX4.js → chunk-ZUHJTFCU.js} +1 -1
- package/POS/index.html +2 -2
- package/POS/{main-CONXK4M3.js → main-EHMMIZ7A.js} +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as z,h as S}from"./chunk-
|
|
1
|
+
import{g as z,h as S}from"./chunk-GWZIO33Z.js";import"./chunk-FFKDWS7A.js";import"./chunk-ZEDNFDBV.js";import"./chunk-OAD7UPCT.js";import"./chunk-UQ4MNKKG.js";import"./chunk-ZQXQP23N.js";import"./chunk-ZBAXEP6H.js";import"./chunk-R4FCSZEY.js";import"./chunk-ITY3WD5X.js";import"./chunk-2FWFPV5I.js";import"./chunk-A3JBDL46.js";import"./chunk-IBZ7YKZU.js";import"./chunk-NGR5QZSH.js";import"./chunk-DLYUFTZV.js";import"./chunk-H6GPWFWI.js";import"./chunk-ZISQUX7W.js";import{$b as v,Ab as o,Bb as i,Cb as g,Od as x,Rd as c,Wa as d,Xa as h,_b as r,dd as M,ia as a,nb as f,pa as p,qa as s}from"./chunk-RXPVPXFJ.js";import"./chunk-KW4B7WMB.js";var m=class e{constructor(n){this.router=n;console.log(this.router.getCurrentNavigation()),console.log(this.router.lastSuccessfulNavigation),this.previousPage=this.router.lastSuccessfulNavigation?.finalUrl?.root?.children?.primary?.segments?.join("/"),this.role=this.router.getCurrentNavigation()?.extras?.state.role??localStorage.getItem("role"),localStorage.setItem("role",this.role),console.log(this.previousPage)}previousPage="";role="";menuData={H:"Unauthorized"};static \u0275fac=function(t){return new(t||e)(h(x))};static \u0275cmp=p({type:e,selectors:[["POS-unauthorized"]],decls:13,vars:4,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"d-flex","align-items-center","justify-content-center","mt-8",2,"height","350px"],[1,"text-center"],["src","https://res.cloudinary.com/pos/image/upload/v1702547639/POS/Images/Dashboard/locked.svg",2,"width","200px"],[1,"mt-2","mb-6"],[1,"fw-bold"]],template:function(t,l){t&1&&(o(0,"mainpanel-cmp",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div"),g(5,"img",3),i(),o(6,"h1",4),r(7,"You are not authorized"),i(),o(8,"p"),r(9," This page require "),o(10,"span",5),r(11),i(),r(12," role. Please contact your Administrator to gain access! "),i()()()()()),t&2&&(f("pageData",l.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),d(11),v(l.role))},dependencies:[z]})};var D=[{path:"Main/Unauthorized",component:m},{path:"",redirectTo:"Main/Unauthorized",pathMatch:"full"}],u=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=s({type:e});static \u0275inj=a({imports:[c.forChild(D),c]})};var y=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=s({type:e});static \u0275inj=a({imports:[M,u,S]})};export{y as UnauthorizedModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V,b as W}from"./chunk-GJCZH6AH.js";import{a as F}from"./chunk-
|
|
1
|
+
import{a as V,b as W}from"./chunk-GJCZH6AH.js";import{a as F}from"./chunk-KF5BOONI.js";import{g as B,h as q}from"./chunk-GWZIO33Z.js";import"./chunk-FFKDWS7A.js";import{b as J}from"./chunk-MSZBPFVC.js";import"./chunk-ZEDNFDBV.js";import"./chunk-OAD7UPCT.js";import"./chunk-UQ4MNKKG.js";import{Aa as E,Ba as P}from"./chunk-ZQXQP23N.js";import"./chunk-ZBAXEP6H.js";import"./chunk-R4FCSZEY.js";import"./chunk-ITY3WD5X.js";import"./chunk-2FWFPV5I.js";import"./chunk-A3JBDL46.js";import"./chunk-IBZ7YKZU.js";import"./chunk-NGR5QZSH.js";import"./chunk-DLYUFTZV.js";import"./chunk-H6GPWFWI.js";import{a as I}from"./chunk-ZISQUX7W.js";import{$b as j,$c as w,Ab as o,Bb as t,Cb as c,Gb as S,Jb as v,Lb as b,Md as T,Tc as _,Wa as l,Xa as m,_b as p,_c as k,ac as L,ad as R,dd as M,gb as C,hc as x,jb as y,nb as a,pa as h,rc as d,sc as D,tc as f,wa as u,xa as g}from"./chunk-RXPVPXFJ.js";import"./chunk-KW4B7WMB.js";function A(r,i){if(r&1){let e=S();o(0,"mainpanel-cmp",1)(1,"content")(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6)(7,"h3"),p(8,"General"),t()(),o(9,"div",7)(10,"div",3)(11,"div",8),c(12,"floatinglabel",9),d(13,"date"),t(),o(14,"div",8),c(15,"floatinglabel",10),d(16,"number"),t()(),o(17,"div",3)(18,"div",8),c(19,"floatinglabel",11),t()()()()()(),o(20,"div",3)(21,"div",8)(22,"div",5)(23,"div",12)(24,"div",13)(25,"h3"),p(26,"Request"),t()(),o(27,"div",14)(28,"button",15),v("click",function(){u(e);let n=b();return g(n.copyClipboard(n.jobLogsDetail==null?null:n.jobLogsDetail.log.req,"Request"))}),p(29,"Copy Request to Clipboard"),t()()(),o(30,"div",7)(31,"pre",16),p(32),d(33,"json"),t()()()(),o(34,"div",8)(35,"div",5)(36,"div",12)(37,"div",13)(38,"h3"),p(39,"Response"),t()(),o(40,"div",14)(41,"button",17),v("click",function(){u(e);let n=b();return g(n.copyClipboard(n.jobLogsDetail==null||n.jobLogsDetail.log==null?null:n.jobLogsDetail.log.res,"Response"))}),p(42,"Copy Response to Clipboard"),t()()(),o(43,"div",7)(44,"pre",18),p(45),d(46,"json"),t()()()()()()()()}if(r&2){let e=b();a("pageData",e.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(12),a("model",f(13,10,e.jobLogsDetail["@timestamp_received"],"dd MMM yyyy")),l(3),a("model",f(16,13,e.jobLogsDetail==null?null:e.jobLogsDetail.DurationInSecond,"1.1-1")+" s"),l(4),a("model",e.jobLogsDetail==null||e.jobLogsDetail.log==null?null:e.jobLogsDetail.log.respCode),l(9),a("matTooltip",e.copyStatus?e.msgCopyClipboard:"Copy to clipboard"),l(4),j(D(33,16,e.jobLogsDetail==null||e.jobLogsDetail.log==null?null:e.jobLogsDetail.log.req)),l(9),a("matTooltip",e.copyStatus?e.msgCopyClipboard:"Copy to clipboard"),l(4),L('"',D(46,18,e.jobLogsDetail==null?null:e.jobLogsDetail.log.res),'"')}}var N=class r extends F{jobLogsDetail;copyStatus;msgCopyClipboard;constructor(i,e,s){super(i,e,"Developer/DeveloperSpace/Webhook/JobLogDetail",s)}postBindForm(i){this.jobLogsDetail=i?.hits[0]?._source,this.jobLogsDetail&&(this.jobLogsDetail.DurationInSecond=parseInt(this.jobLogsDetail?.Duration)/1e3)}copyClipboard(i,e){this.copyStatus=!0,this.msgCopyClipboard=e+" has been coppied to clipboard!",navigator.clipboard.writeText(JSON.stringify(i)),setTimeout(()=>{this.copyStatus=!1},3e3)}static \u0275fac=function(e){return new(e||r)(m(J),m(I),m(T))};static \u0275cmp=h({type:r,selectors:[["app-webhook-job-logs-detail"]],standalone:!0,features:[C,x],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["id","webhook-logs",1,"container-fluid","pt-5"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-6"],["label","Created",3,"model"],["label","Duration",3,"model"],["label","Response Code",3,"model"],[1,"card-header","d-lg-flex"],[1,"me-auto","mt-5"],[1,"d-sm-block","mt-2"],["id","btnCopyRequest","matTooltipPosition","above",1,"btn","btn-secondary","btn-sm",3,"click","matTooltip"],["id","requestValue",2,"font-size","13px"],["id","btnCopyResponse","matTooltipPosition","above",1,"btn","btn-secondary","btn-sm",3,"click","matTooltip"],["id","responseValue",2,"font-size","13px"]],template:function(e,s){e&1&&y(0,A,47,20,"mainpanel-cmp",0),e&2&&a("ngIf",s.jobLogsDetail)},dependencies:[M,_,w,R,k,q,B,W,V,P,E]})};export{N as WebhookJobLogsDetailComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-MSZBPFVC.js";import{J as a}from"./chunk-RXPVPXFJ.js";var s=class extends r{constructor(t,e,o,n){super(t);this.httpService=e;let p=this.getInfoID(n);this.menuData$.pipe(a(()=>this.getBindDataObservable(o,p))).subscribe({next:i=>{this.bindData(i),this.postBindData(i)}})}data;getInfoID(t){return t.snapshot.queryParams.ID}getBindDataObservable(t,e){return this.httpService.post(`/API/${t}`,{ID:e})}bindData(t){this.data=t}postBindData(t){}};export{s as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Pn}from"./chunk-HFD6HDYV.js";import"./chunk-BYXBJQAS.js";import{a as yn}from"./chunk-FCLSBUHC.js";import{b as fn,c as Cn}from"./chunk-5QZGN6BI.js";import"./chunk-B5FODXLM.js";import"./chunk-6365PJN3.js";import{a as pn,b as dn,c as mn}from"./chunk-7HUYBZSU.js";import{a as sn}from"./chunk-I4MJUIXL.js";import{a as un,b as gn}from"./chunk-YNT3RB5I.js";import{a as xn,b as Sn}from"./chunk-XFXRYZW3.js";import{a as Se,b as tt,c as nt}from"./chunk-TPGBIBRN.js";import{a as We}from"./chunk-QTSZF7OY.js";import{a as et}from"./chunk-QIOXCK45.js";import{b as vn}from"./chunk-63LOGNWC.js";import{a as _n,b as bn}from"./chunk-UOCD4MCT.js";import"./chunk-XRIBGWG2.js";import"./chunk-CBZQAOHT.js";import"./chunk-I42DEA65.js";import{b as Zt,c as He,d as ze,e as Ge}from"./chunk-PWFVWXRN.js";import{a as hn}from"./chunk-DDNHEK57.js";import{c as en,e as tn,g as nn}from"./chunk-4M3W3MWK.js";import{a as xe,b as Ye}from"./chunk-DSTB7NGU.js";import{D as Xe,E as Ze,i as U,k as le,m as ye,r as on,s as se,t as pe,u as Z,y as ln}from"./chunk-UQ4MNKKG.js";import{Aa as qe,Ba as Ke}from"./chunk-ZQXQP23N.js";import{O as cn,P as fe,a as rn,b as an}from"./chunk-ZBAXEP6H.js";import{e as $e,f as Je}from"./chunk-X5LJZH3R.js";import"./chunk-R4FCSZEY.js";import"./chunk-2FWFPV5I.js";import{D as W,E as Jt,c as he,h as ae,o as ce,r as $t}from"./chunk-A3JBDL46.js";import{a as Gt,c as Xt}from"./chunk-
|
|
1
|
+
import{a as Pn}from"./chunk-HFD6HDYV.js";import"./chunk-BYXBJQAS.js";import{a as yn}from"./chunk-FCLSBUHC.js";import{b as fn,c as Cn}from"./chunk-5QZGN6BI.js";import"./chunk-B5FODXLM.js";import"./chunk-6365PJN3.js";import{a as pn,b as dn,c as mn}from"./chunk-7HUYBZSU.js";import{a as sn}from"./chunk-I4MJUIXL.js";import{a as un,b as gn}from"./chunk-YNT3RB5I.js";import{a as xn,b as Sn}from"./chunk-XFXRYZW3.js";import{a as Se,b as tt,c as nt}from"./chunk-TPGBIBRN.js";import{a as We}from"./chunk-QTSZF7OY.js";import{a as et}from"./chunk-QIOXCK45.js";import{b as vn}from"./chunk-63LOGNWC.js";import{a as _n,b as bn}from"./chunk-UOCD4MCT.js";import"./chunk-XRIBGWG2.js";import"./chunk-CBZQAOHT.js";import"./chunk-I42DEA65.js";import{b as Zt,c as He,d as ze,e as Ge}from"./chunk-PWFVWXRN.js";import{a as hn}from"./chunk-DDNHEK57.js";import{c as en,e as tn,g as nn}from"./chunk-4M3W3MWK.js";import{a as xe,b as Ye}from"./chunk-DSTB7NGU.js";import{D as Xe,E as Ze,i as U,k as le,m as ye,r as on,s as se,t as pe,u as Z,y as ln}from"./chunk-UQ4MNKKG.js";import{Aa as qe,Ba as Ke}from"./chunk-ZQXQP23N.js";import{O as cn,P as fe,a as rn,b as an}from"./chunk-ZBAXEP6H.js";import{e as $e,f as Je}from"./chunk-X5LJZH3R.js";import"./chunk-R4FCSZEY.js";import"./chunk-2FWFPV5I.js";import{D as W,E as Jt,c as he,h as ae,o as ce,r as $t}from"./chunk-A3JBDL46.js";import{a as Gt,c as Xt}from"./chunk-IBZ7YKZU.js";import{a as Yt}from"./chunk-NGR5QZSH.js";import{a as F,d as Q}from"./chunk-DLYUFTZV.js";import"./chunk-H6GPWFWI.js";import{a as H}from"./chunk-ZISQUX7W.js";import{$b as V,Ab as r,Bb as a,Cb as f,D as G,Db as At,E as Ee,Ea as oe,Eb as Vt,Gb as E,I as Mt,Ia as re,Ic as m,Jb as g,Kc as Fe,Lb as p,Ob as kt,Od as zt,Pd as Le,Qa as Re,Qc as X,Ra as Ne,Rd as Qe,Sc as Ue,Tc as ve,Td as je,Ua as Nt,Uc as jt,Vc as qt,Wa as l,Xa as Bt,Yc as Kt,Zb as Ft,_ as be,_b as d,ac as M,ad as K,bb as Be,bc as Ve,cd as Wt,d as Rt,da as D,db as w,dc as N,dd as O,ec as B,fc as A,gc as Ut,gd as Ht,ha as T,hc as P,ic as It,jb as C,jc as j,k as Ot,kc as Lt,la as s,nb as u,pa as S,rb as Ae,rc as b,sc as R,t as ie,tc as q,uc as Oe,vb as _,wa as h,wb as $,xa as y,xc as Qt,yb as J,zb as Y}from"./chunk-RXPVPXFJ.js";import{a as z,b as Et}from"./chunk-KW4B7WMB.js";var it=class{UserName;UserID;SalesID;CustomerOptions;ServerTime;AppConfigJSON;Denomination;Entities;Registers;Payments;PaymentTypes;Currencies;PoTypes;Taxes;BINS;ServerDateString;ServicesLogistics;WhatsAppConfigJSON;StylesSheet};var ot=class{DeliveryEntityID;NewOrderID;Type};var v=class i{store=Pn({cartItems:[],loadForm:new it,order:new fn,invoice:new dn,payments:[],register:new Cn,shipping:new mn,promotions:[],state:0,customer:new et,action:new ot});loadForm=this.store.select(t=>Object.freeze(t.loadForm()));register=this.store.select(t=>Object.freeze(t.register()));order=this.store.select(t=>Object.freeze(t.order()));cartItems=this.store.select(t=>Object.freeze(t.cartItems()));payments=this.store.select(t=>Object.freeze(t.payments()));shipping=this.store.select(t=>Object.freeze(t.shipping()));invoice=this.store.select(t=>Object.freeze(t.invoice()));promotions=this.store.select(t=>Object.freeze(t.promotions()));state=this.store.select(t=>Object.freeze(t.state()));customer=this.store.select(t=>Object.freeze(t.customer()));currency=m(()=>{let t=this.loadForm()?.Currencies,e=this.order()?.CurrencyID,n=t?.find(o=>o.ID===e);return n||t[0]});tax=m(()=>{let t=this.loadForm()?.Taxes,e=this.order()?.TaxTypeID,n=t?.find(o=>o.ID===e);return n||t[0]});customerPOType=m(()=>{let t=this.loadForm()?.PoTypes,e=this.order()?.TypeID,n=t?.find(o=>o.ID===e);return n||t[0]});action=this.store.select(t=>Object.freeze(t.action()));updateLoadForm(t){this.store.update("loadForm",t)}updateRegister(t){this.store.update("register",t)}updateOrder(t){this.store.update("order",t)}updateCustomer(t){this.store.update("customer",t)}updateCartItems(t){this.store.update("cartItems",t)}updateInvoice(t){this.store.update("invoice",t)}updatePayments(t){this.store.update("payments",t)}updateShipping(t){this.store.update("shipping",t)}updatePromotions(t){this.store.update("promotions",t)}updateState(t){this.store.update("state",t)}updateAction(t){this.store.update("action",t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=T({token:i,factory:i.\u0275fac,providedIn:"root"})};var ee=class{static GetCustomerPrivilegeByID="/API/Contact/GetPrivilegeByCustomerID";static GetPOSStorage="/API/POS/LoadPOS";static GetRegisterInfo="/API/POS/GetRegisterInfoByID";static GetCustomerByCode="/API/Contact/GetByCode";static GetSalesOrderPrint="/API/POS/GetSalesOrderPrint"};var x=class i{eventBus=new Rt;emit(t){this.eventBus.next(t)}on(t){return this.eventBus.pipe(Ee(e=>e.type===t))}ngOnDestroy(){this.eventBus.complete()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=T({token:i,factory:i.\u0275fac})};var Me=class i{eventBusService=s(x);storeService=s(v);httpService=s(H);constructor(){this.initLoadForm()}initLoadForm(){this.httpService.post(ee.GetPOSStorage,{}).pipe(U()).subscribe(t=>{this.storeService.updateLoadForm(t),this.eventBusService.emit({type:"[Sell] Load Form",payload:{form:t}})})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=T({token:i,factory:i.\u0275fac})};var ke=class i{storeService=s(v);toastrService=s(je);httpService=s(H);eventService=s(x);selectedRegister=m(()=>this.storeService.register());isOpenDialog$=this.eventService.on("[Sell] Load Form").pipe(ie(()=>this.checkOpenDialogRegisters()));constructor(){G(this.eventService.on("[Register] Update Register").pipe(D(t=>{let e=t.payload?.id;this.updateRegisterById(e)})),this.eventService.on("[Order] Update Customer PO Type").pipe(D(t=>{let e=t.payload?.poType;this.updatePrintTemplateByPoType(e)}))).pipe(U()).subscribe()}updatePrintTemplateByPoType(t){let e=this.storeService.register();t.PrintTemplateID==0?this.updateRegisterStore({PrintTemplate:e.DefaultPrintTemplate}):this.getSalesOrderPrint(t.PrintTemplateID).subscribe(n=>{this.updateRegisterStore({PrintTemplate:n.Template})})}updateRegisterById(t){this.getRegisterById(t).subscribe(e=>{this.updateRegisterStore(e),this.eventService.emit({type:"[Order] Generate Number",payload:{element:e.NumberElement}})})}updateRegisterStore(t){let e=this.storeService.register();this.storeService.updateRegister(z(z({},e),t)),this.eventService.emit({type:"[Register] Updated",payload:{register:this.storeService.register()}})}getRegisterById(t){return this.httpService.get(ee.GetRegisterInfo,[{key:"RegisterID",value:t}])}getSalesOrderPrint(t){return this.httpService.post(ee.GetSalesOrderPrint,{TemplateID:t})}checkOpenDialogRegisters(){let t=this.storeService.loadForm(),e=t.Registers,n=t.AppConfigJSON?.ModuleShift?.Closure?.Enabled,o=t.UserName;if(e.length>1){let c=e.find(k=>k.LoginID==o);if(c)return this.updateRegisterById(c.ID),!1;{let k=this.selectedRegister()?this.selectedRegister().RegisterID:null;if(F.IsEmpty(k))return!0;if(n)return!0}}else{if(e.length==1)return this.updateRegisterById(e[0].ID),!1;this.toastrService.warning("You do not have access to any OUTLET","Warning")}return!1}static \u0275fac=function(e){return new(e||i)};static \u0275prov=T({token:i,factory:i.\u0275fac})};var Dn=i=>({active:i}),Tn=i=>({gray:i});function wn(i,t){if(i&1){let e=E();r(0,"span",17),g("click",function(o){h(e);let c=p().$implicit;return p().onCloseRegister(c),y(o.stopPropagation())}),a()}}function En(i,t){i&1&&(r(0,"div")(1,"span",18),d(2,"VACANT"),a()())}function Rn(i,t){if(i&1&&(r(0,"div")(1,"span",19),f(2,"i",20),r(3,"font"),d(4),a()(),r(5,"span",21),f(6,"i",22),r(7,"font"),d(8),a()()()),i&2){let e=p().$implicit;l(4),V(e.LoginID),l(4),M("",e.StartDisplay.split(" ")[3]," - Now")}}function Nn(i,t){if(i&1){let e=E();r(0,"div",9)(1,"div",10)(2,"div",11)(3,"h5",12),g("click",function(){let o=h(e).$implicit,c=p();return y(c.onSelectRegister(o))}),r(4,"span"),f(5,"i",13),d(6),b(7,"limitText"),a(),C(8,wn,1,0,"span",14),a(),r(9,"div",15),g("click",function(){let o=h(e).$implicit,c=p();return y(c.onSelectRegister(o))}),C(10,En,3,0,"div",16)(11,Rn,9,2,"div",16),a()()()()}if(i&2){let e,n=t.$implicit,o=p();l(),u("ngClass",n.Active?"active":""),l(),u("ngClass",j(11,Dn,(n==null?null:n.ID)==((e=o.selectedRegister())==null?null:e.ID))),l(),u("ngClass",j(13,Tn,n!=o.selectedRegister)),l(3),V(q(7,8,n.Name,15)),l(2),u("ngIf",n.State!="Close"),l(),u("ngSwitch",n.State),l(),u("ngSwitchCase","Close"),l(),u("ngSwitchCase","Open")}}var rt=class i{dialogRef=s(le);storeService=s(v);router=s(zt);roleService=s(Q);eventService=s(x);modalConfig=new se;registers=m(()=>this.storeService.loadForm().Registers);appConfig=m(()=>this.storeService.loadForm().AppConfigJSON);selectedRegister=w(null);searchInput="";constructor(){this.initModalConfig(),this.initSelectedRegister()}initModalConfig(){this.modalConfig.hideClose=!1,this.modalConfig.hideCancel=!1,this.modalConfig.bodyScrollable=!0,this.modalConfig.title="Choose an outlet"}initSelectedRegister(){let t=this.storeService.register(),e=this.registers().find(n=>n.ID==t.RegisterID);this.selectedRegister.set(e)}onSelectRegister(t){if(this.appConfig().ModuleShift?.Closure?.Enabled)if(this.selectedRegister().ID!==null&&this.selectedRegister().Open)this.changeCurrentShift(t);else if(!t.Open||this.selectedRegister().ID==t.ID)this.selectedRegister.set(t);else{if(this.roleService.sell.Edit==!1){alert("You cannot end shift for Register "+t.Name+" - Unauthorized Access");return}alert("This Register has already active register, Are you sure you want to end this register?"),this.onClose(),this.router.navigate(["/menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:t.ID}})}else this.selectedRegister.set(t)}changeCurrentShift(t){confirm("You already have an active register with "+this.selectedRegister().Name+`!
|
|
2
2
|
Do you want to end your session?`)&&(this.onClose(),this.router.navigate(["menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:t.ID}}))}onCloseRegister(t){let e=this.selectedRegister().ID;if(this.roleService?.sell?.Edit==!1){alert("You cannot end shift for Register "+t.Name+" - Unauthorized Access");return}e==t.ID?this.router.navigate(["/menu/Shift/Main/My_Shift"]):this.router.navigate(["/menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:t.ID}}),this.onClose()}onOk(){if(this.selectedRegister().ID==null){alert("Please select a register first!");return}this.eventService.emit({type:"[Register] Update Register",payload:{id:this.selectedRegister().ID}}),this.dialogRef.close(!0)}onClose(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["app-dialog-select-register"]],standalone:!0,features:[P],decls:11,vars:7,consts:[[3,"onOk","onCancel","onClose","config"],[1,"ms-0","mb-8",2,"width","200px",3,"hidden"],[1,"input-group","mb-3"],[1,"input-group-text","txtFilter"],["aria-hidden","true",1,"fa","fa-magnifying-glass"],["data-cy","SearchOutlet","type","text","placeholder","Filter by Name","aria-label","Search",1,"txtFilter","form-control","border-start-0",3,"ngModelChange","ngModel"],[1,"container"],[1,"row",2,"width","600px"],["class","col-4","data-cy","registers",4,"ngFor","ngForOf"],["data-cy","registers",1,"col-4"],[1,"card","border-0",3,"ngClass"],[1,"card-body","p-0",3,"ngClass"],[1,"card-title","mb-0",3,"click","ngClass"],[1,"fa-solid","fa-house","pe-1","fs-6"],["class","fa fa-xmark-circle fa-lg position-absolute","style","text-shadow: 0 1px 0 #afafaf; right: 5px; top: 16px",3,"click",4,"ngIf"],[1,"card-text","px-0","py-2",3,"click","ngSwitch"],[4,"ngSwitchCase"],[1,"fa","fa-xmark-circle","fa-lg","position-absolute",2,"text-shadow","0 1px 0 #afafaf","right","5px","top","16px",3,"click"],[1,"idle"],[1,"cashier"],["aria-hidden","true",1,"fa","fa-user","pe-2"],[1,"open"],["aria-hidden","true",1,"fa-regular","fa-clock","pe-2"]],template:function(e,n){e&1&&(r(0,"modal-material",0),g("onOk",function(){return n.onOk()})("onCancel",function(){return n.onClose()})("onClose",function(){return n.onClose()}),r(1,"content")(2,"div",1)(3,"div",2)(4,"span",3),f(5,"i",4),a(),r(6,"input",5),A("ngModelChange",function(c){return B(n.searchInput,c)||(n.searchInput=c),c}),a()()(),r(7,"div",6)(8,"div",7),C(9,Nn,12,15,"div",8),b(10,"filterByName"),a()()()()),e&2&&(u("config",n.modalConfig),l(2),u("hidden",n.registers.length<=6),l(4),N("ngModel",n.searchInput),l(3),u("ngForOf",q(10,4,n.registers(),n.searchInput)))},dependencies:[O,X,Ue,ve,jt,qt,Z,pe,W,he,ae,ce,xn,We],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}.col-4[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%]{width:180px;min-height:95px;margin-right:17px;margin-bottom:17px;position:relative}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]{display:block;outline:0;border:1px solid #B1AAAA;border-radius:5px;cursor:pointer}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{height:30px;border-radius:4px;padding:5px 10px;color:#fff;background:#b1aaaa;overflow:hidden}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] h5[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]:hover, .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.active[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.vacant[_ngcontent-%COMP%]{background:#ffffe1;border:1px solid #89b03e}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]:hover > h5[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.active[_ngcontent-%COMP%] > h5[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.vacant[_ngcontent-%COMP%] > h5[_ngcontent-%COMP%]{background:#89b03e}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover{border:1px solid #c9302c}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover > h6[_ngcontent-%COMP%]{background:#c9302c!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{background:#c9302c}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover{background:#fff}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]{border:1px solid #f6a828}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%]{background:#f6a828!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]:hover{border:1px solid #f6a828;background:#fff}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]:hover > strong[_ngcontent-%COMP%]{background:#f6a828!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{background:#f6a828}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] div[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.75rem!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{height:80px;padding:15px 10px;position:relative}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-weight:400;font-size:.875rem;width:100%;margin-bottom:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{margin-top:-10px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:last-child{margin-bottom:0}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{text-align:center;position:absolute;bottom:0;right:0;width:auto;background-color:#b1aaaa;border-radius:3px;padding:2px 5px;color:#fff;display:none!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span.idle[_ngcontent-%COMP%]{display:block;font-size:1.25rem;text-align:center}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{position:absolute;width:27px;height:28px;cursor:pointer;top:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#000}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:last-of-type{right:-5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:nth-last-of-type(2){right:15px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{bottom:20px;right:5px;position:absolute}.col-4[_ngcontent-%COMP%] .duration[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{border:1px solid!important;position:absolute;bottom:-3px;left:58px;background:#fff;border-radius:5px}"]})};var at=class i{constructor(t){this.viewContainerRef=t;Fe(()=>{this.isOpenModalSelectRegister()&&this.openModalSelectRegister()})}register=re();isOpenModalSelectRegister=re();dialog=s(ye);openModalSelectRegister(){this.dialog.open(rt,{viewContainerRef:this.viewContainerRef})}static \u0275fac=function(e){return new(e||i)(Bt(Be))};static \u0275cmp=S({type:i,selectors:[["pos-select-register"]],inputs:{register:[1,"register"],isOpenModalSelectRegister:[1,"isOpenModalSelectRegister"]},standalone:!0,features:[P],decls:4,vars:2,consts:[["matTooltipPosition","above",1,"outlet-container","d-flex","pointer",3,"click","matTooltip"],[1,"fa-solid","fa-location-dot"],[1,"ms-2","mb-0"]],template:function(e,n){e&1&&(r(0,"div",0),g("click",function(){return n.openModalSelectRegister()}),f(1,"i",1),r(2,"h3",2),d(3),a()()),e&2&&(u("matTooltip",n.register().EntityName),l(3),M(" ",n.register().EntityName?n.register().EntityName:"Choose an Outlet"," "))},dependencies:[O,Ke,qe],styles:[".outlet-container[_ngcontent-%COMP%] .fa-location-dot[_ngcontent-%COMP%]{color:#fb404b!important;font-size:32px}"]})};var Ie=class i{eventService=s(x);storeService=s(v);constructor(){this.initializeEventHandlers()}initializeEventHandlers(){G(this.eventService.on("[Order] Generate Number").pipe(D(t=>{let e=t.payload?.element,n=pn.Generate(e);this.updateOrder({Number:n})})),this.eventService.on("[Customer] Added").pipe(D(t=>{let e=t.payload?.customer.ID;this.updateOrder({CustomerID:e})})),this.eventService.on("[Customer] Removed").pipe(D(t=>{this.updateOrder({CustomerID:null})})),this.eventService.on("[Order] Update Date").pipe(D(t=>{let e=t.payload?.date;this.updateOrder({Date:e})})),this.eventService.on("[Order] Update Sales Person").pipe(D(t=>{let e=t.payload?.id;this.updateOrder({SalesID:e})})),this.eventService.on("[Order] Update Note").pipe(D(t=>{let e=t.payload?.note;this.updateOrder({Note:e})})),this.eventService.on("[Order] Update Reference Number").pipe(D(t=>{let e=t.payload?.number;this.updateOrder({ReferenceNumber:e})})),this.eventService.on("[Order] Update Currency").pipe(D(t=>{let e=t.payload?.currency;this.updateOrder({CurrencyID:e.ID})})),this.eventService.on("[Order] Update Customer PO Type").pipe(D(t=>{let e=t.payload?.poType;this.updateOrder({TypeID:e.ID})})),this.eventService.on("[Order] Update Logistic Service").pipe(D(t=>{let e=t.payload?.id;this.updateOrder({LogisticsServiceID:e})})),this.eventService.on("[Order] Update Number Person").pipe(D(t=>{let e=t.payload?.total;this.updateOrder({NumberOfPerson:e})})),this.eventService.on("[Order] Update Discount Percentage 1").pipe(D(t=>{let e=t.payload?.discount;this.updateOrder({Discount:e})})),this.eventService.on("[Order] Update Discount Percentage 2").pipe(D(t=>{let e=t.payload?.discount;this.updateOrder({Discount2:e})})),this.eventService.on("[Order] Update Discount Amount").pipe(D(t=>{let e=t.payload?.discountAmount;this.updateOrder({DiscountAmount:e})})),this.eventService.on("[Order] Update Tax").pipe(D(t=>{let e=t.payload?.tax;this.updateOrder({TaxTypeID:e.ID})})),this.eventService.on("[Register] Updated").pipe(D(t=>{let e=t.payload?.register;this.initOrderRegister(e),this.initOrderTax(e)}))).pipe(U()).subscribe()}initOrderRegister(t){this.updateOrder({RegisterID:t.RegisterID,EntityID:t.EntityID})}initOrderTax(t){let e=t.DefaultTaxType,n=this.storeService.loadForm().Taxes;if(F.IsNotEmpty(e)){let o=this.getTaxById(e);F.IsNotEmpty(e)?this.updateOrder({TaxTypeID:o.ID}):(o=n[0],this.updateOrder({TaxTypeID:o.ID}))}else{let o=n[0];this.updateOrder({TaxTypeID:o.ID})}}getTaxById(t){return(this.storeService.loadForm()?.Taxes).find(o=>o.ID===t)}updateOrder(t){let e=this.storeService.order();this.storeService.updateOrder(z(z({},e),t))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=T({token:i,factory:i.\u0275fac})};var Ce=class i{eventService=s(x);httpService=s(H);storeService=s(v);role=s(Q);isEnabledLoyaltyPoint=m(()=>{let e=this.storeService.loadForm().AppConfigJSON?.ApplicationLoyalty?.Enabled,n=this.storeService.register()?.MemberPoint,o=this.storeService.customer();return!!(e&&n&&o?.Point>0)});isShowDebt=m(()=>{let t=this.storeService.customer(),e=this.role.debt?.View;return t?.Debt>0&&e});constructor(){this.initEventHandlers()}initEventHandlers(){G(this.eventService.on("[Customer] Add By Id").pipe(be(t=>this.addCustomerById$(t.payload))),this.eventService.on("[Customer] Add By Code").pipe(be(t=>this.addCustomerByCode$(t.payload.code))),this.eventService.on("[Customer] Remove").pipe(D(()=>{this.deleteCustomer()}))).pipe(U()).subscribe()}addCustomerById$(t){let e=this.storeService.register()?.EntityID;return this.httpService.get(ee.GetCustomerPrivilegeByID,[{key:"ID",value:t.id},{key:"EntityID",value:e}]).pipe(D(n=>{n.ID=t.id,n.Name=t.name,this.storeService.updateCustomer(n),this.eventService.emit({type:"[Customer] Added",payload:{customer:n}})}),Mt(n=>Ot))}addCustomerByCode$(t){return this.httpService.post(ee.GetCustomerByCode,{Code:t}).pipe(be(e=>this.addCustomerById$({id:e.ID,name:e.Name})),Mt(e=>Ot))}deleteCustomer(){let t=new et;this.storeService.updateCustomer(t),this.eventService.emit({type:"[Customer] Removed",payload:null})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=T({token:i,factory:i.\u0275fac})};var Mn=i=>({"quickkey-subscription-overdue":i}),kn=()=>["/menu/Outlets/Master/Quick_Key_Templates/Form"],Fn=i=>({ID:i}),Un=i=>({OutletID:i});function Ln(i,t){if(i&1&&(r(0,"div",14)(1,"div",15),f(2,"img",16),a()()),i&2){let e=p().$implicit;l(2),u("ngSrc",e.ImageURLClient)}}function Qn(i,t){if(i&1&&(r(0,"div",15)(1,"p",17)(2,"span"),d(3),b(4,"slice"),a()()()),i&2){let e=p().$implicit;l(3),V(Oe(4,1,e.Display,0,3))}}function jn(i,t){if(i&1&&(r(0,"small",18),d(1),b(2,"number"),a()),i&2){let e=p(2).$implicit;l(),V(R(2,1,e.Children[0]==null?null:e.Children[0].UnitPrice))}}function qn(i,t){if(i&1&&(r(0,"small",19),d(1),b(2,"lowestPrice"),b(3,"number"),b(4,"highestPrice"),b(5,"number"),a()),i&2){let e=p(2).$implicit;l(),Ve("",R(3,4,R(2,2,e==null?null:e.Children))," - ",R(5,8,R(4,6,e==null?null:e.Children)),"")}}function Kn(i,t){if(i&1&&C(0,jn,3,3,"small",18)(1,qn,6,10,"small",19),i&2){let e=p().$implicit;_(e.Children.length==1?0:1)}}function Wn(i,t){if(i&1){let e=E();r(0,"div",12)(1,"a",13),g("click",function(){let o=h(e).$implicit,c=p(4);return y(c.onSelectProduct(o))}),C(2,Ln,3,1,"div",14)(3,Qn,5,5,"div",15),r(4,"small"),d(5),b(6,"slice"),a(),C(7,Kn,2,1),a()()}if(i&2){let e=t.$implicit,n=p(4);Ae(n.column()),l(2),_(e.ImageURLClient?2:3),l(3),V(Oe(6,5,e.Display,0,36)),l(2),_(n.priceVisible()?7:-1)}}function Hn(i,t){if(i&1&&(r(0,"mat-tab",5)(1,"div",6)(2,"div",7),J(3,Wn,8,9,"div",8,$),r(5,"div",9)(6,"a",10),f(7,"i",11),a()()()()()),i&2){let e,n=t.$implicit,o=p(3);u("label",n.Name),l(3),Y(n.Items),l(2),Ae(o.column()),l(),u("routerLink",It(5,kn))("queryParams",j(6,Fn,(e=o.quickKey())==null?null:e.ID))}}function zn(i,t){if(i&1&&(r(0,"mat-tab-group",4),J(1,Hn,8,8,"mat-tab",5,$),a()),i&2){let e,n=p(2);u("disableRipple",!0),l(),Y((e=n.quickKey())==null?null:e.Groups)}}function Gn(i,t){if(i&1&&(r(0,"div",14)(1,"div",15),f(2,"img",26),a()()),i&2){let e=p().$implicit;l(2),u("src",e.ImageURLClient,Ne)}}function $n(i,t){if(i&1&&(r(0,"div",15)(1,"p",17)(2,"span"),d(3),b(4,"slice"),a()()()),i&2){let e=p().$implicit;l(3),V(Oe(4,1,e.Model,0,3))}}function Jn(i,t){if(i&1&&(r(0,"small",18),d(1),b(2,"number"),a()),i&2){let e=p().$implicit;l(),V(R(2,1,e.UnitPrice))}}function Yn(i,t){if(i&1){let e=E();r(0,"div",12)(1,"a",13),g("click",function(){let o=h(e).$implicit,c=p(3);return y(c.emitSelectedVariant(o.ID))}),C(2,Gn,3,1,"div",14)(3,$n,5,5,"div",15),r(4,"small"),d(5),b(6,"slice"),a(),C(7,Jn,3,3,"small",18),a()()}if(i&2){let e=t.$implicit,n=p(3);Ae(n.column()),l(2),_(e.ImageURLClient?2:3),l(3),V(Oe(6,5,e.Model,0,30)),l(2),_(n.priceVisible()?7:-1)}}function Xn(i,t){if(i&1){let e=E();r(0,"div",20)(1,"div",21),g("click",function(){h(e);let o=p(2);return y(o.onChangeQuickeyState("QUICKEY"))}),f(2,"i",22),a(),r(3,"div",23)(4,"b"),d(5),a()()(),r(6,"div",6)(7,"div",24),C(8,Yn,8,9,"div",25),a()()}if(i&2){let e,n=p(2);l(5),M(" ",n.subQuickKey().Display,""),l(3),u("ngForOf",(e=n.subQuickKey())==null?null:e.Children)}}function Zn(i,t){if(i&1&&C(0,zn,3,1,"mat-tab-group",4)(1,Xn,9,2),i&2){let e=p();_(e.quickeyState()=="QUICKEY"?0:1)}}function ei(i,t){if(i&1&&(r(0,"div",3)(1,"a",27)(2,"strong"),d(3,"QUICK KEYS UNCONFIGURED"),a(),f(4,"i",28),r(5,"span"),d(6,"Click here to setup your Quick keys"),a()()()),i&2){let e=p();u("ngClass",j(3,Mn,e.currentSubsStatus()==e.subscriptionStatus.OVERDUE||e.currentSubsStatus()==e.subscriptionStatus.SELL_ONLY)),l(),u("routerLink",It(5,kn))("queryParams",j(6,Un,e.outletId()))}}var ct=class i{authService=s(Xt);quickKey=re();quickKeyTotalRow=re();priceVisible=re();outletId=re();quickeyState=w("QUICKEY");column=w("col-3");subQuickKey=w({Display:null,Children:[]});subscriptionStatus=Gt;currentSubsStatus=w(0);onSelectVariant=new oe;constructor(){Fe(()=>{let t=`col-${12/(this.quickKeyTotalRow()?this.quickKeyTotalRow():3)}`;this.column.set(t)},{allowSignalWrites:!0}),this.currentSubsStatus.set(this.authService.getSubscriptionStatus())}onSelectProduct(t){t.Children?t.Children.length==0?this.emitSelectedVariant(t.ItemID):t.Children.length==1?this.emitSelectedVariant(t.Children[0]?.ID):(this.onChangeQuickeyState("SUBQUICKEY"),this.subQuickKey.update(()=>({Display:t.Display,Children:t.Children}))):(this.onChangeQuickeyState("SUBQUICKEY"),this.subQuickKey.update(()=>({Display:t.Display,Children:t.Children})))}emitSelectedVariant(t){this.onSelectVariant.emit(t)}onChangeQuickeyState(t){this.quickeyState.set(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["quick-keys"]],inputs:{quickKey:[1,"quickKey"],quickKeyTotalRow:[1,"quickKeyTotalRow"],priceVisible:[1,"priceVisible"],outletId:[1,"outletId"]},outputs:{onSelectVariant:"onSelectVariant"},standalone:!0,features:[P],decls:5,vars:4,consts:[[1,"row","mt-5"],[1,"col-12"],[1,"quick-key-tab",3,"ngClass"],[1,"no-quick-key","d-flex","align-items-center","justify-content-center",3,"ngClass"],[1,"h-100","bgQuickkeyIllustration","landscape",3,"disableRipple"],[3,"label"],[1,"container","tabItems"],[1,"row","g-0"],[1,"column","px-6",3,"class"],[1,"column","d-flex","align-items-center","pb-6"],[1,"w-100",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa","fa-plus-circle","fa-5x","d-flex","align-items-center","justify-content-center","bg-white","h-100","text-primary"],[1,"column","px-6"],[3,"click"],[1,"img-box","d-flex","align-items-center"],[1,"ratio","ratio-1x1"],["priority","","fill","",1,"full-screen-image",3,"ngSrc"],[1,"fw-normal","fs-1","d-flex","align-items-center","justify-content-center"],[1,"text-muted"],[1,"text-muted",2,"word-break","auto-phrase"],[1,"row","g-0","border","align-items-center","subquicKey"],[1,"col-auto","border-end","py-5","px-7","cursor-pointer",3,"click"],["aria-hidden","true",1,"fa","fa-arrow-left"],[1,"col","text-center","fw-bold","text-uppercase","fs-5"],[1,"row","g-0","rowSubQuickey"],["class","column px-6",3,"class",4,"ngFor","ngForOf"],[1,"full-screen-image",3,"src"],["id","LinkConfigureQuickkey","target","_blank",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-regular","fa-hand-pointer"]],template:function(e,n){if(e&1&&(r(0,"div",0)(1,"div",1)(2,"section",2),C(3,Zn,2,1)(4,ei,7,8,"div",3),a()()()),e&2){let o;l(2),u("ngClass",j(2,Mn,n.currentSubsStatus()==n.subscriptionStatus.OVERDUE||n.currentSubsStatus()==n.subscriptionStatus.SELL_ONLY)),l(),_((o=n.quickKey())!=null&&o.Groups&&((o=n.quickKey())==null||o.Groups==null?null:o.Groups.length)>0?3:4)}},dependencies:[O,X,Ue,Wt,K,Qe,Le,Ge,He,ze,Ht,cn,rn,an],styles:[".quick-key-tab{width:100%;position:relative;height:100%;max-height:calc(100vh - 70px)} .quick-key-tab .mat-mdc-tab-header-pagination{display:none!important} .quick-key-tab .mat-mdc-tab-header{border:none} .quick-key-tab .mdc-tab-indicator{display:none!important} .quick-key-tab .mat-mdc-tab-body-wrapper{width:102%} .quick-key-tab .mat-mdc-tab-labels{border-bottom:0px;display:flex;flex-wrap:wrap;border-radius:6px} .quick-key-tab .mat-mdc-tab-labels .mat-mdc-tab{color:#151515;opacity:1;height:38px;max-height:40px;white-space:normal!important;overflow:hidden;padding:0!important;min-width:25%!important;flex-basis:0;font-size:12px;font-weight:700;outline:none;text-transform:uppercase;background:#fff;display:flex} .quick-key-tab .mat-mdc-tab-labels .mat-mdc-tab .mdc-tab__content{white-space:normal!important;align-self:center;font-size:.875rem!important} .quick-key-tab .mat-mdc-tab-labels .mdc-tab--active{background:linear-gradient(to bottom,#fff,#eee);border-radius:6px;border:.5px solid #dadada} .quick-key-tab .mat-mdc-tab-labels .mdc-tab--active .mdc-tab__text-label{color:gray!important;font-weight:700} .quick-key-tab .mat-mdc-tab-labels .mat-mdc-tab:nth-child(n+5){flex-grow:0!important} .quick-key-tab .tabItems{padding:0} .quick-key-tab .tabItems .column{margin-top:15px;margin-bottom:10px;word-break:break-all} .quick-key-tab .tabItems .column>div{border:solid 1px #cfcfcf} .quick-key-tab .tabItems .column>a{text-align:center;display:block;cursor:pointer} .quick-key-tab .tabItems .column>a div.img-box{display:block;margin:0 auto;border-top-left-radius:5px;border-bottom-right-radius:5px;border:solid 1px #dddddd} .quick-key-tab .tabItems .column>a .full-screen-image{position:absolute;object-fit:scale-down} .quick-key-tab .tabItems .column>a p{display:block;margin:0 auto;background-color:#a6a6a6;border:solid 1px #999999;border-top-left-radius:5px;border-bottom-right-radius:5px;color:#fff} .quick-key-tab .tabItems .column>a small{font-size:11px;display:block;margin:5px 0 0} .quick-key-tab .tabItems .column .ion-icon{font-size:75px;margin:10px} .quick-key-tab .col-md-3.column.add{cursor:pointer} .quick-key-tab .col-md-3.column.add i{margin-top:10px} .quick-key-tab ::-webkit-scrollbar{width:3px} .quick-key-tab ::-webkit-scrollbar-track{box-shadow:inset 0 0 5px #bfd2da} .quick-key-tab ::-webkit-scrollbar-thumb{background:#c4c4c4;border-radius:10px} .quick-key-tab .subquicKey{background:linear-gradient(to bottom,#fff,#eee);color:gray;border-radius:6px} .quick-key-tab .no-quick-key{background-image:url(//res.cloudinary.com/pos/image/upload/w_500/POS/Images/Cashier/no-quick-key.png)!important;background-repeat:no-repeat;height:calc(100vh - 70px);background-size:contain}a#LinkConfigureQuickkey[_ngcontent-%COMP%]{background-color:#479ccf;padding:15px 25px;color:#fff;text-decoration:none;width:240px;display:block;opacity:.85;border-radius:6px}a#LinkConfigureQuickkey[_ngcontent-%COMP%]{position:absolute;top:200px;left:calc(50% - 120px)}a#LinkConfigureQuickkey[_ngcontent-%COMP%]:hover{opacity:.95}a#LinkConfigureQuickkey[_ngcontent-%COMP%] Strong[_ngcontent-%COMP%]{border-bottom:1px solid white;font-size:14px;margin:0 0 10px;padding:0 0 3px;display:block}a#LinkConfigureQuickkey[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:inline-block;height:35px;margin:0 10px 0 0;font-size:28px}a#LinkConfigureQuickkey[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-block;font-size:14px;width:135px;vertical-align:top}"]})};var lt=class{ID;VariantID;Quantity;Cost;Price;Expense;UnitPriceOriginal;Discount;DiscountAmount;CouponDiscount;Note;Taxable;LoyaltyPoint;EntityID;UnitQuantity;VariantUnitQuantity;UnitQuantityPrice;PriceTypeID;PriceNote;Index;Splited;InventoryTypeID;TypeID;Variant;EntityName;SalesID;SalesName;PriceBookID;Serial;UnitExpense;UnitCost;UnitPrice;Checked;SplitQuantity;PurchaseOrderID;isMaxInventory;SerialSource;AvailableInventory;PromotionGift;get Total(){let t=this.GrossTotal-this.DiscountPercentAmount;this.validateDiscountAmount(t);let e=this.DiscountAmount*this.Quantity;return t-e}validateDiscountAmount(t){let e=this.Quantity%1===0;t>0&&this.DiscountAmount>t&&e&&(this.DiscountAmount=t)}get GrossTotal(){let t=this.Price*(this.Quantity*this.UnitQuantity);return t||0}get DiscountPercentAmount(){return this.Discount?this.GrossTotal*this.Discount/100:0}get getItemAfterDiscount(){let t=this.getDiscPercentagePerItem();return this.DiscountAmount<t?t-this.DiscountAmount:0}getDiscPercentagePerItem(){let t=this.Price;return this.Discount>0&&(t=(100-this.Discount)/100*this.Price),t}};var de=class i{constructor(){}createCartItemByVariant(t){let e=new lt;return e.VariantID=t.ID,e.PriceTypeID=t.PriceTypeID,e.Variant=t,e.UnitQuantity=t.UnitQuantity,e.Quantity=1,t.UnitQuantity>1&&(e.UnitQuantityPrice=t.UnitPrice/t.UnitQuantity),e.Price=t.UnitPrice,e.UnitPrice=t.UnitPrice,e.Cost=t.UnitCost,e.UnitCost=t.UnitCost,e.Expense=t.UnitCost,e.Discount=t.PriceDiscount,e.UnitPriceOriginal=t.UnitPriceOriginal,e.DiscountAmount=0,e.CouponDiscount=0,e.Taxable=t.Taxable,e.InventoryTypeID=t.TypeID,e.LoyaltyPoint=t.LoyaltyPoint,e.VariantUnitQuantity=t.VariantUnitQuantity,e}static \u0275fac=function(e){return new(e||i)};static \u0275prov=T({token:i,factory:i.\u0275fac})};var _e=class i{eventBusService=s(x);httpService=s(H);storeService=s(v);factoryService=s(de);entityID=m(()=>this.storeService.register()?.EntityID);constructor(){this.initializeEventHandlers()}initializeEventHandlers(){G(this.eventBusService.on("[Cart] Add Item By Id").pipe(D(t=>{this.addItemById(t.payload.variantId)})),this.eventBusService.on("[Cart] Remove Item").pipe(D(t=>{this.removeItem(t.payload.index)}))).pipe(U()).subscribe()}addItemById(t){this.httpService.get(fe.GetVariantByID,[{key:"ID",value:t},{key:"EntityID",value:this.entityID()}]).pipe(ie(e=>this.factoryService.createCartItemByVariant(e))).subscribe(e=>{this.onAddItem(e)})}removeItem(t){let n=this.storeService.cartItems().filter((o,c)=>c!==t);this.storeService.updateCartItems(n)}onAddItem(t,e=!1){let n=this.storeService.cartItems();if(!n.find(c=>c.VariantID===t.VariantID)||e||n.length===0)this.storeService.updateCartItems([...n,t]);else{let c=n.map(k=>(k.VariantID==t.VariantID&&(k.Quantity+=t.Quantity),k));this.storeService.updateCartItems(c)}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=T({token:i,factory:i.\u0275fac})};var De=class i{storeService=s(v);httpService=s(H);factoryService=s(de);eventService=s(x);shoppingCartService=s(_e);toastr=s(je);config=m(()=>this.storeService.loadForm().AppConfigJSON);entityID=m(()=>this.storeService.register()?.EntityID);constructor(){this.initEventHandlers()}initEventHandlers(){this.eventService.on("[Cart] Add Item By Code").pipe(U()).subscribe(t=>{this.AddItemByCode(t.payload.code)})}AddItemByCode(t){let e=this.config()?.ModuleSell?.DigitalScale;e.Digit>0&&F.IsNotEmpty(e.Regex)&&t.length==e.Digit?this.findByDigitalScale(t):this.findVariantByCode(t)}findByDigitalScale(t){let e=this.readDigitalScale(t);F.IsNotEmpty(e.code)?this.findVariantByCode(e.code,e.quantity):(this.toastr.info("Matching Regex Rule to Barcode","Digital Scale"),this.findVariantByCode(t))}readDigitalScale(t){let e={code:null,quantity:1},n=this.config()?.ModuleSell?.DigitalScale,o=new RegExp(n.Regex),c=t.match(o);if(c[1]){let k=c[1],ne=parseFloat(c[2]);ne=ne/n.QuantityDivider,e.code=k,e.quantity=ne}return e}findVariantByCode(t,e=1){this.httpService.get(fe.GetVariantByCode,[{key:"Code",value:t},{key:"EntityID",value:this.entityID()}]).pipe(ie(n=>{let o=this.factoryService.createCartItemByVariant(n);return o.Quantity=e,o})).subscribe(n=>{this.shoppingCartService.onAddItem(n)})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=T({token:i,factory:i.\u0275fac})};var st=class i{constructor(){}static \u0275fac=function(e){return new(e||i)};static \u0275prov=T({token:i,factory:i.\u0275fac})};var ti=i=>({"ps-0":i});function ni(i,t){if(i&1&&(r(0,"td",4)(1,"small"),d(2),a()()),i&2){let e=p().$index;l(2),M("",e+1,".")}}function ii(i,t){if(i&1&&(r(0,"div",33),f(1,"img",35),a()),i&2){let e=p(2).$implicit;l(),u("src",e.Variant==null?null:e.Variant.ThumbnailUrl,Ne)}}function oi(i,t){i&1&&(r(0,"div",34),f(1,"i",36),a())}function ri(i,t){if(i&1&&(r(0,"span",7),C(1,ii,2,1,"div",33)(2,oi,2,0,"div",34),a()),i&2){let e=p().$implicit;l(),_(e.Variant!=null&&e.Variant.ThumbnailUrl?1:2)}}function ai(i,t){i&1&&f(0,"i",37)}function ci(i,t){i&1&&f(0,"i",38)}function li(i,t){if(i&1&&(r(0,"span",11),C(1,ai,1,0,"i",37)(2,ci,1,0,"i",38),a()),i&2){let e=p().$implicit;l(),_(e.Taxable?1:2)}}function si(i,t){i&1&&f(0,"i",12)}function pi(i,t){if(i&1&&(r(0,"small",14),d(1),a()),i&2){let e=p().$implicit;l(),M(" ",e.Variant==null?null:e.Variant.CategoryName," ")}}function di(i,t){if(i&1&&(r(0,"small",15),d(1),a()),i&2){let e=p().$implicit;l(),M(" ",e.Variant==null?null:e.Variant.BrandName," ")}}function mi(i,t){if(i&1&&(r(0,"small",16),d(1),a()),i&2){let e=p().$implicit;l(),M(" ",e.Variant.Storage," ")}}function ui(i,t){if(i&1&&f(0,"small",18),i&2){let e=p().$implicit;u("innerHtml",e.Note,Re)}}function gi(i,t){if(i&1&&(r(0,"small",19),d(1," Sold by "),r(2,"i"),d(3),a()()),i&2){let e=p().$implicit;l(3),V(e.SalesName)}}function fi(i,t){if(i&1&&(r(0,"small")(1,"i",39),d(2),a()()),i&2){let e=p().$implicit;l(2),M("Fulfillment from: ",e.EntityName,"")}}function Ci(i,t){if(i&1&&(r(0,"div",22),f(1,"i",40),a()),i&2){let e=p().$implicit;u("matTooltip",e.AvailableInventory<e.Quantity?e.AvailableInventory+" Available Stock":"")}}function _i(i,t){if(i&1){let e=E();r(0,"span",41),g("click",function(){h(e);let o=p().$index,c=p(2);return y(c.onEditItem(o,"quantity"))}),d(1),b(2,"number"),a()}if(i&2){let e=p().$implicit;l(),M(" ",q(2,1,e.Quantity,"1.0-4"),"")}}function bi(i,t){if(i&1){let e=E();r(0,"span",42),d(1,"x"),a(),r(2,"div",43),g("click",function(){h(e);let o=p().$index,c=p(2);return y(c.onEditItem(o,"quantity"))}),r(3,"span",44),d(4),b(5,"number"),a()()}if(i&2){let e=p().$implicit;l(4),V(R(5,1,e.UnitQuantity))}}function vi(i,t){if(i&1&&(r(0,"span",25),d(1),b(2,"number"),a()),i&2){let e=p().$implicit;l(),M("@",R(2,1,e.VariantUnitQuantity),"")}}function hi(i,t){if(i&1&&(r(0,"small",26),d(1),a()),i&2){let e=p().$implicit;l(),V(e.Variant!=null&&e.Variant.UOM?e.Variant==null?null:e.Variant.UOMName:"")}}function yi(i,t){if(i&1&&(r(0,"div",48),d(1),b(2,"number"),a()),i&2){let e=p(4).$implicit;l(),M(" ",q(2,1,e.UnitPriceOriginal,"1.0-4")," ")}}function xi(i,t){if(i&1){let e=E();r(0,"div",46),g("click",function(){h(e);let o=p(3).$index,c=p(2);return y(c.onEditItem(o,"price"))}),C(1,yi,3,4,"div",47),r(2,"div",24),d(3),b(4,"number"),a()()}if(i&2){let e=p(3).$implicit;l(),u("ngIf",e.UnitPriceOriginal>e.Price),l(2),M(" ",q(4,2,e.Price,"1.0-4")," ")}}function Si(i,t){if(i&1){let e=E();r(0,"div",41),g("click",function(){h(e);let o=p(3).$index,c=p(2);return y(c.onEditItem(o,"price"))}),d(1),b(2,"number"),a()}if(i&2){let e=p(3).$implicit;l(),M(" ",q(2,1,e.Price,"1.0-4")," ")}}function Pi(i,t){if(i&1&&C(0,xi,5,5,"div",45)(1,Si,3,4,"div",24),i&2){let e=p(4);_(e.strikethroughOriginalPrice()?0:1)}}function Oi(i,t){if(i&1&&(r(0,"div",21),C(1,Pi,2,1),a()),i&2){let e=p().$implicit;l(),_(e.Price!==e.Total?1:-1)}}function Mi(i,t){if(i&1&&(r(0,"div"),d(1),b(2,"number"),a()),i&2){let e=p().$implicit;l(),M(" ",e.Discount==0?"":R(2,1,e.Discount*-1)+"%"," ")}}function ki(i,t){if(i&1&&(r(0,"div"),d(1),b(2,"number"),a()),i&2){let e=p().$implicit;l(),M(" ",e.DiscountAmount==0?"":R(2,1,e.DiscountAmount*-1)," ")}}function Ii(i,t){if(i&1&&(r(0,"div",50),d(1),b(2,"number"),a()),i&2){let e=p(2).$implicit;l(),M(" ",q(2,1,e.UnitPriceOriginal,"1.0-4")," ")}}function Di(i,t){if(i&1&&(r(0,"div",24),C(1,Ii,3,4,"div",49),r(2,"div",21),d(3),b(4,"number"),a()()),i&2){let e=p().$implicit;l(),u("ngIf",e.UnitPriceOriginal>e.Price),l(2),M(" ",R(4,2,e.Total)," ")}}function Ti(i,t){if(i&1&&(r(0,"div",21)(1,"div",24),d(2),b(3,"number"),a()()),i&2){let e=p().$implicit,n=p(2);l(2),M(" ",n.priceVisible?R(3,1,e.Total):" - "," ")}}function wi(i,t){if(i&1){let e=E();r(0,"span",51),g("click",function(){h(e);let o=p().$index,c=p(2);return y(c.onRemoveItem(o))}),f(1,"i",52),a()}}function Ei(i,t){if(i&1){let e=E();r(0,"tr",3),C(1,ni,3,1,"td",4),r(2,"td",5),g("click",function(){let o=h(e).$index,c=p(2);return y(c.onEditItem(o,"quantity"))}),r(3,"div",6),C(4,ri,3,1,"span",7),r(5,"div",8)(6,"div",9)(7,"span",10),d(8),a(),C(9,li,3,1,"span",11)(10,si,1,0,"i",12),a(),r(11,"div",13),d(12),a(),C(13,pi,2,1,"small",14)(14,di,2,1,"small",15)(15,mi,2,1,"small",16),r(16,"div"),f(17,"app-serial-note",17),a(),C(18,ui,1,1,"small",18)(19,gi,4,1,"small",19)(20,fi,3,1,"small"),a()()(),r(21,"td",20)(22,"div",21),C(23,Ci,2,1,"div",22),r(24,"div",23),C(25,_i,3,4,"span",24)(26,bi,6,3)(27,vi,3,3,"span",25)(28,hi,2,1,"small",26),a()()(),r(29,"td"),C(30,Oi,2,1,"div",21),a(),r(31,"td",27),g("click",function(){let o=h(e).$index,c=p(2);return y(c.onEditItem(o,"discount"))}),r(32,"div",28),C(33,Mi,3,3,"div")(34,ki,3,3,"div"),a()(),r(35,"td",29),g("click",function(){let o=h(e).$index,c=p(2);return y(c.onEditItem(o,"price"))}),C(36,Di,5,4,"div",24)(37,Ti,4,3,"div",21),a(),r(38,"td",30)(39,"div",31),C(40,wi,2,0,"span",32),a()()()}if(i&2){let e=t.$implicit,n=p(2);l(),_(n.rowNumberVisible()?1:-1),l(),u("ngClass",j(24,ti,n.rowNumberVisible())),l(2),_(n.productImageVisible()?4:-1),l(4),M(" ",e.Variant.Name," "),l(),_(n.taxVisible()?9:-1),l(),_(e.PromotionGift?10:-1),l(2),M(" ",e==null||e.Variant==null?null:e.Variant.Code," "),l(),_(n.categoryVisible()?13:-1),l(),_(n.brandVisible()?14:-1),l(),_(n.storageVisible()?15:-1),l(2),u("serials",e.Serial),l(),_(e.Note?18:-1),l(),_(e.SalesName?19:-1),l(),_(e.EntityName?20:-1),l(3),_(e.AvailableInventory<e.Quantity&&((e==null||e.Variant==null?null:e.Variant.TypeID)<9||(e==null||e.Variant==null?null:e.Variant.TypeID)==n.inventoryType.Composite)?23:-1),l(2),_(e.Quantity!==1&&e.Quantity!==0||e.UnitQuantity>1||e.VariantUnitQuantity>1?25:-1),l(),_(e.UnitQuantity>1?26:-1),l(),_(e.VariantUnitQuantity>1?27:-1),l(),_(e.Variant.UOM&&n.uomVisible()?28:-1),l(2),_((e.Price!==e.Total||e.DiscountAmount>0||e.Discount>0||e.UnitPriceOriginal>e.Price)&&n.priceVisible?30:-1),l(3),_(e.Discount>0?33:-1),l(),_(e.DiscountAmount>0?34:-1),l(2),_(n.strikethroughOriginalPrice()&&e.Quantity==1&&n.priceVisible?36:37),l(4),_(n.hasItemDeletion()?40:-1)}}function Ri(i,t){if(i&1){let e=E();r(0,"table",0)(1,"tbody",2),g("cdkDropListDropped",function(o){h(e);let c=p();return y(c.drop(o))}),J(2,Ei,41,26,"tr",3,$),a()()}if(i&2){let e=p();l(2),Y(e.cartItems())}}function Ni(i,t){i&1&&(r(0,"div",1)(1,"div",53)(2,"div",54)(3,"div",55)(4,"div",56),f(5,"i",57),a(),r(6,"div",58)(7,"span"),d(8,"Empty Cart"),a(),f(9,"br"),r(10,"span"),d(11,"Add products to the cart"),a(),f(12,"br"),r(13,"span"),d(14,"or scan barcode"),a()()()()()())}var pt=class i{storeService=s(v);eventService=s(x);roleService=s(Q);cartItems=m(()=>this.storeService.cartItems());appConfig=m(()=>this.storeService.loadForm().AppConfigJSON);inventoryType=sn;priceVisible=this.roleService.product.Price;rowNumberVisible=m(()=>this.appConfig().ModuleSell?.Grid.RowNumberVisible);productImageVisible=m(()=>this.appConfig().ModuleSell?.Grid.ProductImageVisible);taxVisible=m(()=>this.appConfig().ModuleSell?.Grid.TaxVisible);categoryVisible=m(()=>this.appConfig().ModuleSell?.Grid.CategoryVisible);brandVisible=m(()=>this.appConfig().ModuleSell?.Grid.ShowBrandItemCart);storageVisible=m(()=>this.appConfig().ModuleSell?.Grid.StorageVisible);uomVisible=m(()=>this.appConfig().ModuleSell?.Grid.UOMVisible);strikethroughOriginalPrice=m(()=>this.appConfig().ModuleSell?.Promotion.StrikethroughOriginalPrice);hasItemDeletion=m(()=>!0);drop(t){}onEditItem(t,e){}onRemoveItem(t){this.eventService.emit({type:"[Cart] Remove Item",payload:{index:t}})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["cart-body"]],standalone:!0,features:[P],decls:2,vars:1,consts:[[1,"table","table-borderless"],[1,"row","g-0","h-100"],["cdkDropList","",3,"cdkDropListDropped"],["cdkDrag","",2,"border-bottom","0.5px solid #dee2e6"],[2,"width","10px"],[1,"pe-0",2,"width","50%",3,"click","ngClass"],[1,"d-flex","align-items-center"],[1,"me-4"],[1,"d-block",2,"line-height","18px"],[1,"fs-5","d-flex","align-items-center"],[1,"me-1"],[1,"fst-italic","m-0","me-3"],["title","Product Promotion",1,"fa-solid","fa-gift"],["title","Product Code",1,"fw-normal","fs-6","text-muted"],["title","Product Category",1,"fst-italic","text-muted","d-block"],["title","Brand Name",1,"text-muted","d-block"],["title","Storage",1,"text-muted","d-block"],[3,"serials"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",3,"innerHtml"],["title","Sales Name",1,"text-success","fst-italic","d-block"],[1,"px-0","text-end",2,"width","15%"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltipPosition","above",1,"me-2",3,"matTooltip"],[1,"d-flex","text-end","fw-normal","align-items-center",2,"line-height","20px"],[1,"fs-5"],["title","Variant Unit Quantity",1,"fs-5"],["title","UOM",1,"ps-1","fs-5"],[3,"click"],[1,"d-block","fw-normal","fs-5","text-danger","ps-3"],[1,"pe-0",3,"click"],[1,"mt-6","ps-0"],[1,"d-flex","justify-content-end","align-items-center"],["title","Delete Item",1,"fs-3","cursor-pointer"],[1,"ratio","ratio-1x1",2,"width","55px"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"item-image",3,"src"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],["title","Taxable",1,"fa-regular","fa-droplet-percent","fs-4","text-success"],["title","Non Taxable",1,"fa-regular","fa-droplet-percent","fs-4","text-danger"],[1,"text-warning","d-block"],[1,"fa-solid","fa-triangle-exclamation","not-enough-inventory"],[1,"fs-5",3,"click"],[1,"fs-6","me-1","ms-1"],[1,"d-flex","algin-items-center",3,"click"],["title","Unit Quantity",1,"fs-5","me-1"],[1,"d-inline-block","fs-5"],[1,"d-inline-block","fs-5",3,"click"],["class","text-decoration-line-through text-danger fs-5",4,"ngIf"],[1,"text-decoration-line-through","text-danger","fs-5"],["class","text-decoration-line-through text-danger d-flex align-items-center justify-content-end",4,"ngIf"],[1,"text-decoration-line-through","text-danger","d-flex","align-items-center","justify-content-end"],["title","Delete Item",1,"fs-3","cursor-pointer",3,"click"],[1,"fa","fa-trash","text-danger","fs-4"],[1,"col-12"],[1,"d-flex","justify-content-center","align-items-center","h-100"],[1,"row"],[1,"col-12","d-flex","justify-content-center"],[1,"fa-regular","fa-cart-arrow-up","text-secondary",2,"font-size","110px"],[1,"col-12","justify-content-center","text-center","mt-5","empty-cart-description","text-secondary","headings-font-family"]],template:function(e,n){e&1&&C(0,Ri,4,0,"table",0)(1,Ni,15,0,"div",1),e&2&&_(n.cartItems().length>0?0:1)},dependencies:[O,X,ve,K,xe,nn,tn,en,W,hn,Ke,qe],styles:["span[_ngcontent-%COMP%] > .item-image[_ngcontent-%COMP%]{height:50px;width:56px;display:block;margin:0 auto;border:solid 1px #dddddd;border-radius:5px}img.item-image[_ngcontent-%COMP%]{object-fit:contain}.empty-cart-description[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:#c7c7c7}.not-enough-inventory[_ngcontent-%COMP%]{font-size:.875rem;opacity:60%;color:red}"]})};function Ai(i,t){if(i&1&&(r(0,"span",5),f(1,"i",6),r(2,"span",7),d(3),b(4,"number"),a()()),i&2){let e,n=p(2);l(3),V((e=n.currentCustomer())!=null&&e.Point?R(4,1,(e=n.currentCustomer())==null?null:e.Point):0)}}function Vi(i,t){if(i&1){let e=E();r(0,"div",2)(1,"div",3)(2,"div",4),g("click",function(){h(e);let o=p();return y(o.showPointModal())}),C(3,Ai,5,3,"span",5),a()()()}if(i&2){let e=p();l(3),_(e.isEnabledLoyaltyPoint?3:-1)}}var dt=class i{role=s(Q);storeService=s(v);eventService=s(x);customerService=s(Ce);dialog=s(ye);currentCustomer=m(()=>this.storeService.customer());isGetCustomerById=w(!1);isEnabledLoyaltyPoint=this.customerService.isEnabledLoyaltyPoint();isShowDebt=this.customerService.isShowDebt();onOptionSelected(t){if(this.isGetCustomerById()){let e=t?JSON.parse(t):null;this.eventService.emit({type:"[Customer] Add By Id",payload:{id:e?.Key,name:e?.Value}})}this.isGetCustomerById.set(!1)}onSearchByCode(t){this.eventService.emit({type:"[Customer] Add By Code",payload:{code:t}})}onSelectCustomer(){this.isGetCustomerById.set(!0)}onDeleteCustomer(){this.currentCustomer().Name&&this.dialog.open(yn,{data:{title:"Re-assign customer",message:"Are you sure to re-assign the customer?"}}).afterClosed().pipe(Ee(t=>t)).subscribe(()=>{this.eventService.emit({type:"[Customer] Remove",payload:{id:this.currentCustomer()?.ID}})})}openCustomerModal(){}showPointModal(){}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["customer-autocomplete"]],standalone:!0,features:[P],decls:3,vars:7,consts:[[1,"px-4","py-4","position-relative"],["requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Assign Customer","inputID","ContactID","notFoundMessageFor","customer","prefixIcon","fa-light fa-user-plus","prefixIconTitle","New Customer Form","suffixIconTitle","Customer Input by typing is locked","data_cy","txt-customer","icon_data_cy","dialog-add-customer",1,"form-control","autocomplete-customer",3,"optionSelected","onInputEnter","onSelect","clickInputValue","clickPrefixIcon","useTooltip","inputTextValue","readonly","inputLock","suffixIcon","clearOnSelect"],[1,"customerPoint-tooltip","arrow-top"],[1,"d-block"],[1,"ms-1","cursor-pointer",2,"font-size","10px",3,"click"],["matTooltip","Point"],["aria-hidden","true",1,"fa","fa-star","text-primary"],[1,"ms-1"]],template:function(e,n){if(e&1&&(r(0,"div",0)(1,"autocompleteV2",1),g("optionSelected",function(c){return n.onOptionSelected(c)})("onInputEnter",function(c){return n.onSearchByCode(c)})("onSelect",function(){return n.onSelectCustomer()})("clickInputValue",function(){return n.onDeleteCustomer()})("clickPrefixIcon",function(){return n.openCustomerModal()}),a()(),C(2,Vi,4,1,"div",2)),e&2){let o,c;l(),u("useTooltip",!0)("inputTextValue",(o=n.currentCustomer())==null?null:o.Name)("readonly",(c=n.currentCustomer())==null?null:c.Name)("inputLock",n.role==null||n.role.sell==null?null:n.role.sell.CustomerInputLock)("suffixIcon",!(n.role==null||n.role.sell==null)&&n.role.sell.CustomerInputLock?"fa-solid fa-text-slash":"")("clearOnSelect",!1),l(),_(n.isEnabledLoyaltyPoint||n.isShowDebt?2:-1)}},dependencies:[O,K,ln,Ze,Xe],styles:[`autocompleteV2.autocomplete-customer>mat-form-field>input{height:38px!important;border-radius:.375rem}autocompleteV2.autocomplete-customer>mat-form-field>div.position-relative>span.prefix-icon{top:10px}.customerPoint-tooltip{height:20px;background-color:#dededea8;color:#787c7c;float:left;border-radius:3px;padding:3px 8px;position:absolute;top:54px}.customerPoint-tooltip.arrow-top:after{content:" ";position:absolute;left:14px;top:-6px;border-top:none;border-right:6px solid transparent;border-left:6px solid transparent;border-bottom:7px solid rgba(222,222,222,.66)}
|
|
3
3
|
`],encapsulation:2})};function Fi(i,t){if(i&1&&(r(0,"div",6)(1,"span"),d(2),b(3,"number"),a()()),i&2){let e=p().data;l(2),V(R(3,1,e==null?null:e.UnitPrice))}}function Ui(i,t){if(i&1&&(r(0,"div",3)(1,"div",4)(2,"div"),d(3),a(),r(4,"small",5),d(5),a()(),C(6,Fi,4,3,"div",6),a()),i&2){let e=t.data,n=p();l(3),V(e==null?null:e.Value),l(2),V(e==null?null:e.Code),l(),_(n.role.product.Price?6:-1)}}var mt=class i{role=s(Q);storeService=s(v);eventService=s(x);register=m(()=>this.storeService.register());config=m(()=>this.storeService.loadForm().AppConfigJSON);renderThumbnail=m(()=>this.config()?.ModuleSell?.Grid.ProductImageVisible);focusProductInput(){let t=document.getElementById("product");t&&t.focus()}ngAfterViewInit(){this.focusProductInput()}onScanBarcode(t){this.eventService.emit({type:"[Cart] Add Item By Code",payload:{code:t}})}onSelectProduct(t){this.eventService.emit({type:"[Cart] Add Item By Id",payload:{variantId:t}})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["product-autocomplete"]],hostBindings:function(e,n){e&1&&g("keydown.control.F3",function(c){return n.focusProductInput(c)},!1,Nt)},standalone:!0,features:[P],decls:4,vars:5,consts:[["itemTemplate",""],[1,"px-4","py-4"],["inputID","product","requestUrl","/API/AC/GetVariantSuggestionByCodeNNameWithEntityID","prefixIcon","fa fa-barcode","placeholder","Search product by name / code","localStorage","products","notFoundMessageFor","product","data_cy","txt-product",1,"form-control","autocomplete-product",3,"onSelect","onInputEnter","clearOnSelect","renderThumbnail","useCustomTemplate","itemTemplate","outletId"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"],[1,"ps-4"]],template:function(e,n){if(e&1){let o=E();r(0,"div",1)(1,"autocompleteV2",2),g("onSelect",function(k){return h(o),y(n.onSelectProduct(k))})("onInputEnter",function(k){return h(o),y(n.onScanBarcode(k))}),a()(),C(2,Ui,7,3,"ng-template",null,0,Qt)}if(e&2){let o=Ft(3);l(),u("clearOnSelect",!0)("renderThumbnail",n.renderThumbnail())("useCustomTemplate",!0)("itemTemplate",o)("outletId",n.register().EntityID)}},dependencies:[O,K,Ze,Xe],styles:[`autocompleteV2.autocomplete-product>mat-form-field>input{height:38px!important;border-radius:.375rem}autocompleteV2.autocomplete-product>mat-form-field>div.position-relative>span.prefix-icon{top:10px}
|
|
4
4
|
`],encapsulation:2})};var ut=class i{constructor(){}ngOnInit(){}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["cart-header"]],standalone:!0,features:[P],decls:5,vars:0,consts:[[1,"row","w-100","ms-0"],[1,"col-7","px-0"],[1,"col-5","px-0"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"div",1),f(2,"product-autocomplete"),a(),r(3,"div",2),f(4,"customer-autocomplete"),a()())},dependencies:[O,dt,mt]})};var gt=class i{Round(t,e,n){let o=t,c=this.ChooiceDecimalPlaceValue(e);return e==4||(n==0?o=this.RoundToDecimalPlaceValue(t,c):n==2?o=this.CeilingWithDecimalPlaceValue(t,c):o=this.FloorWithDecimalPlaceValue(t,c)),o}CeilingWithDecimalPlaceValue(t,e){if(e<0){let n=e*-1;return Math.ceil(t*n)/n}else{let n=Math.ceil(t)/e;return Math.ceil(n)*e}}FloorWithDecimalPlaceValue(t,e){if(e<0){let n=e*-1;return Math.floor(t*n)/n}else{let n=Math.floor(t)/e;return Math.floor(n)*e}}RoundToDecimalPlaceValue(t,e){if(e<0){let n=e*-1;return Math.round(t*n)/n}else{let n=Math.round(t)/e;return Math.round(n)*e}}ChooiceDecimalPlaceValue(t){let e=0;return t==0?e=1e3:t==1?e=100:t==2?e=10:t==3?e=1:t==4?e=0:t==5?e=-10:t==6&&(e=-100),e}static \u0275fac=function(e){return new(e||i)};static \u0275prov=T({token:i,factory:i.\u0275fac,providedIn:"root"})};var me=class i{storeService=s(v);roundingService=s(gt);totalItems=m(()=>this.storeService.cartItems().length);totalQuantity=m(()=>this.storeService.cartItems().reduce((e,n)=>e+n.Quantity,0));grossTotal=m(()=>{let t=this.storeService.cartItems();return this.sum(t,"Total")});surchargeAmount=m(()=>{let t=this.storeService.invoice().SurchargePcg;return this.totalAfterTax()*t/100});discount1Amount=m(()=>{let t=this.storeService.order().Discount;return this.grossTotal()*t/100});afterDiscount1Amount=m(()=>this.grossTotal()-this.discount1Amount());discount2Amount=m(()=>{let t=this.storeService.order().Discount2;return this.afterDiscount1Amount()*t/100});afterDiscount2Amount=m(()=>this.afterDiscount1Amount()-this.discount2Amount());totalOrderDiscount=m(()=>{let t=this.storeService.order().DiscountAmount;return this.afterDiscount2Amount()-t});grandTotal=m(()=>this.totalAfterSurcharge());totalAfterSurcharge=m(()=>{let t=this.totalAfterTax(),e=this.surchargeAmount(),n=this.storeService.loadForm().AppConfigJSON,o=t+e,c=n.ApplicationMath?.RoundingDigit?.DecimalPlaceValue,k=n.ApplicationMath?.RoundingDigit?.RoundAlgorithm;return o=this.roundingService.Round(o,c,k),o});totalAfterTax=m(()=>{let t=this.taxAmount(),e=this.storeService.loadForm().AppConfigJSON,n=this.totalBeforeTax()+t,o=e.ApplicationMath?.RoundingDigit?.DecimalPlaceValue,c=e.ApplicationMath?.RoundingDigit?.RoundAlgorithm;return n=this.roundingService.Round(n,o,c),n});totalBeforeTax=m(()=>{let e=this.storeService.tax()?.CalculationTypeID===1,n=0;return e?n=this.totalOrderDiscount()-this.taxAmount():n=this.totalOrderDiscount(),n});totalAfterDiscTaxable=m(()=>this.grossTotalTaxable()-this.totalOrderDiscount());taxAmount=m(()=>{let t=this.storeService.tax();if(t){let e=this.storeService.loadForm().AppConfigJSON,n=0,o=e.ApplicationMath?.RoundingTaxDigit?.DecimalPlaceValue,c=e.ApplicationMath?.RoundingTaxDigit?.RoundAlgorithm,k=this.grossTotalTaxable();return t?.CalculationTypeID==1?n=t.Rate/(100+t.Rate)*k:n=t.Rate/100*k,n=this.roundingService.Round(n,o,c),n}else return 0});grossTotalTaxable=m(()=>{let e=this.storeService.cartItems().filter(o=>o.Taxable),n=this.sum(e,"Total");if(e.length!==0){let o=this.calculateDiscTaxableItem();n=n*(100-this.storeService.order().Discount)/100,n=n*(100-this.storeService.order().Discount2)/100,n=n-o}return n});grossTotalNonTaxable=m(()=>{let e=this.storeService.cartItems().filter(o=>!o.Taxable),n=this.sum(e,"Total");return n=n*(100-this.storeService.order().Discount)/100,n=n*(100-this.storeService.order().Discount2)/100,n=n-this.storeService.order().DiscountAmount,n});calculateDiscTaxableItem=m(()=>{let t=this.grossTotal(),e=this.storeService.order().DiscountAmount,n=this.storeService.cartItems(),o=0,c=0,k=0,ne=0,Pe=n.filter(ge=>ge.Taxable);for(let ge of Pe)o=ge.getItemAfterDiscount/t,c=o*e,ne=c*ge.Quantity,k+=ne;return k});sum=(t,e)=>t.reduce((n,o)=>n+o[e],0);calculateDiscount(t){let e=100,n=0;return t.forEach(o=>{e=e*(100-o)/100}),n=100-e,n}getPointOnlyAmount=m(()=>{let e=this.storeService.cartItems().filter(n=>n.Variant.PaymentTypeID==2);return this.getAmountByCart(e)});getCashOnlyAmount=m(()=>{let e=this.storeService.cartItems().filter(n=>n.Variant.PaymentTypeID==1);return this.getAmountByCart(e)});getCashAndPointAmount=m(()=>{let e=this.storeService.cartItems().filter(n=>n.Variant.PaymentTypeID==0);return this.getAmountByCart(e)});getAmountByCart(t){let e=this.sum(t,"Total");return e=e*(100-this.storeService.order().Discount)/100,e=e*(100-this.storeService.order().Discount2)/100,e}discountAfterTax(t=0){let e=t,n=this.storeService.order(),o=this.storeService.loadForm().Taxes,k=this.totalBeforeTax()-t,ne=n.TaxTypeID,Pe=F.FilterByID(o,ne);if(F.IsNotEmpty(Pe)&&Pe.CalculationTypeID==0){let ge=1+Pe.Rate/100,wt=k*ge;e=(wt-(wt-t))/ge}return e}static \u0275fac=function(e){return new(e||i)};static \u0275prov=T({token:i,factory:i.\u0275fac})};function Li(i,t){if(i&1&&(r(0,"div"),d(1),b(2,"number"),a()),i&2){let e=p();l(),M(" ",R(2,1,e.totalAmount())," ")}}function Qi(i,t){i&1&&(r(0,"div"),d(1,"-"),a())}var ft=class i{calculationService=s(me);role=s(Q);totalAmount=m(()=>0);totalItems=m(()=>this.calculationService.totalItems());totalQuantity=m(()=>this.calculationService.totalQuantity());constructor(){}ngOnInit(){}onPay(){}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["pay-button"]],standalone:!0,features:[P],decls:11,vars:7,consts:[["type","button",1,"btn","btn-success","fs-1","py-4","w-100",3,"click"],[1,"d-flex","align-items-center","justify-content-between"],[1,"fs-6"]],template:function(e,n){e&1&&(r(0,"button",0),g("click",function(){return n.onPay()}),r(1,"div",1)(2,"div")(3,"span"),d(4,"Submit"),a(),r(5,"small",2),d(6),b(7,"number"),b(8,"number"),a()(),C(9,Li,3,3,"div")(10,Qi,2,0,"div"),a()()),e&2&&(l(6),Ve(" (",R(7,3,n.totalItems())," Items & ",R(8,5,n.totalQuantity())," Qty) "),l(3),_(n.role.product.Price?9:10))},dependencies:[O,K],styles:["button[_ngcontent-%COMP%]{border-right:.1px solid #fff;margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0;position:relative;flex:1 1 auto;border-left:.1px solid #fff}"]})};var Ct=class i{onClickParkBtn=new oe;onPark(){this.onClickParkBtn.emit()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["park-button"]],outputs:{onClickParkBtn:"onClickParkBtn"},standalone:!0,features:[P],decls:4,vars:0,consts:[["type","button",1,"btn","btn-gray","w-100","fs-3","px-0","py-6","headings-font-family",3,"click"],[1,"fa-solid","fa-floppy-disk","me-3"]],template:function(e,n){e&1&&(r(0,"button",0),g("click",function(){return n.onPark()}),f(1,"i",1),r(2,"span"),d(3,"Park"),a()())},dependencies:[O],styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};var _t=class i{onClickDiscBtn=new oe;onDiscount(){this.onClickDiscBtn.emit()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["discount-button"]],outputs:{onClickDiscBtn:"onClickDiscBtn"},standalone:!0,features:[P],decls:2,vars:0,consts:[["type","button","matTooltip","Discount / Tax","matTooltipPosition","above",1,"btn","btn-success","fs-5",3,"click"],[1,"fa-light","fa-percent"]],template:function(e,n){e&1&&(r(0,"button",0),g("click",function(){return n.onDiscount()}),f(1,"i",1),a())},dependencies:[O],styles:["button[_ngcontent-%COMP%]{border-right:.1px solid #fff;border-top-right-radius:0;border-bottom-right-radius:0;position:relative;flex:1 1 auto}"]})};var bt=class i{onClickNoteBtn=new oe;onAddNote(){this.onClickNoteBtn.emit()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["note-button"]],outputs:{onClickNoteBtn:"onClickNoteBtn"},standalone:!0,features:[P],decls:2,vars:0,consts:[["type","button",1,"btn","btn-gray","w-100","fs-3","px-0","py-6","headings-font-family",3,"click"],[1,"fa-regular","fa-note-sticky","fa-xl"]],template:function(e,n){e&1&&(r(0,"button",0),g("click",function(){return n.onAddNote()}),f(1,"i",1),a())},dependencies:[O,Se],styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};var Hi=i=>({selected:i});function zi(i,t){if(i&1){let e=E();r(0,"div",4)(1,"label",20)(2,"input",21),A("ngModelChange",function(o){h(e);let c=p();return B(c.selectedPoTypeId,o)||(c.selectedPoTypeId=o),y(o)}),g("click",function(){let o=h(e).$implicit,c=p();return y(c.onSelectCustomerPoType(o))}),a(),d(3),a()()}if(i&2){let e=t.$implicit,n=t.$index,o=p();l(),kt("for","potype-"+n),u("ngClass",j(6,Hi,o.selectedPoTypeId()==e.ID)),l(),kt("id","potype-"+n),N("ngModel",o.selectedPoTypeId),u("value",e.ID),l(),M(" ",e.Name," ")}}function Gi(i,t){if(i&1){let e=E();r(0,"div",19)(1,"span",22),d(2,"@"),a(),r(3,"input",23),A("ngModelChange",function(o){h(e);let c=p();return B(c.exchangeRate,o)||(c.exchangeRate=o),y(o)}),a()()}if(i&2){let e=p();l(3),N("ngModel",e.exchangeRate)}}var vt=class i{dialogRef=s(le);storeService=s(v);eventService=s(x);role=s(Q);config=new se;poTypes=m(()=>this.storeService.loadForm().PoTypes);logisticsService=m(()=>this.storeService.loadForm().ServicesLogistics);currencies=m(()=>this.storeService.loadForm().Currencies);defaultCurrencyId=m(()=>this.storeService.loadForm().AppConfigJSON.CoreDefaults?.CurrencyID);order=m(()=>this.storeService.order());invoice=m(()=>this.storeService.invoice());note=w(this.order().Note);selectedPoTypeId=w(this.order().TypeID);selectedPoType=w(this.storeService.customerPOType());selectedLogistics=w(this.order().LogisticsServiceID);numberOfPerson=w(this.order().NumberOfPerson);referenceNumber=w(this.order().ReferenceNumber);invoiceNumber=w(this.invoice().Number);selectedCurrencyId=w(this.order().CurrencyID);selectedCurrency=w(this.storeService.currency());exchangeRate=w(this.order().CurrencyRate);ngOnInit(){this.config.title="Note",this.config.customWidth="600px"}onSelectCustomerPoType(t){this.selectedPoType.set(t)}onUpdateCurrency(t){this.selectedCurrency.set(t)}onOk(){let t=[{type:"[Order] Update Customer PO Type",payload:{poType:this.selectedPoType()}},{type:"[Order] Update Note",payload:{note:this.note()}},{type:"[Order] Update Logistic Service",payload:{id:this.selectedLogistics()}},{type:"[Order] Update Reference Number",payload:{number:this.referenceNumber()}},{type:"[Invoice] Update Number",payload:{number:this.invoiceNumber()}},{type:"[Order] Update Number Person",payload:{total:this.numberOfPerson()}}];this.updateCurrency(),t.forEach(e=>{this.eventService.emit(e)}),this.dialogRef.close()}updateCurrency(){this.selectedCurrency.update(t=>(t&&(t.ExchangeRate=this.exchangeRate()),t)),this.eventService.emit({type:"[Order] Update Currency",payload:{currency:this.selectedCurrency()}})}onClose(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["app-dialog-note"]],standalone:!0,features:[P],decls:33,vars:12,consts:[[3,"onOk","onCancel","onClose","config"],["tabTitle","Note"],[3,"valueChange","value"],["tabTitle","Tag"],[1,"rad-btn"],["tabTitle","Logistic Service"],[1,"ps-0","w-50"],[1,"mb-2"],["bindLabel","Name","bindValue","ID","placeholder","Choose a Logistics Service","appendTo","body",3,"ngModelChange","items","ngModel"],["tabTitle","Number"],[1,"w-50"],["placeholder","Preorder Number","matTooltip","PO number if the product must be pre-ordered",1,"form-control","height-input",3,"ngModelChange","ngModel"],[1,"w-50","mt-6"],["type","text","placeholder","Same as Order Number when blank","matTooltip","Same as Order Number when blank",1,"form-control","height-input",3,"ngModelChange","ngModel","disabled"],["tabTitle","Other"],["autoNum","",1,"form-control","height-input",3,"ngModelChange","ngModel"],[1,"w-100","mt-6"],[1,"ps-0","d-flex","align-items-center"],["bindLabel","Name","bindValue","ID","placeholder","Outlet","appendTo","body",1,"currency-option",3,"ngModelChange","change","items","ngModel","clearable"],[1,"ms-6","d-flex"],[3,"for","ngClass"],["type","radio",3,"ngModelChange","click","ngModel","value","id"],[1,"pt-4"],["type","text","autoNum","",1,"border","border-light","ms-2","form-control",2,"width","100px",3,"ngModelChange","ngModel"]],template:function(e,n){e&1&&(r(0,"modal-material",0),g("onOk",function(){return n.onOk()})("onCancel",function(){return n.onClose()})("onClose",function(){return n.onClose()}),r(1,"content")(2,"custom-tabs")(3,"tab",1)(4,"POS-tinymce-editor",2),A("valueChange",function(c){return B(n.note,c)||(n.note=c),c}),a()(),r(5,"tab",3),J(6,zi,4,8,"div",4,$),a(),r(8,"tab",5)(9,"div",6)(10,"strong",7),d(11,"Logistics Option"),a(),r(12,"ng-select",8),A("ngModelChange",function(c){return B(n.selectedLogistics,c)||(n.selectedLogistics=c),c}),a()()(),r(13,"tab",9)(14,"div",10)(15,"strong",7),d(16,"Reference Number"),a(),r(17,"input",11),A("ngModelChange",function(c){return B(n.referenceNumber,c)||(n.referenceNumber=c),c}),a()(),r(18,"div",12)(19,"strong",7),d(20,"Invoice Number"),a(),r(21,"input",13),A("ngModelChange",function(c){return B(n.invoiceNumber,c)||(n.invoiceNumber=c),c}),a()()(),r(22,"tab",14)(23,"div",10)(24,"strong",7),d(25,"Number of Person"),a(),r(26,"input",15),A("ngModelChange",function(c){return B(n.numberOfPerson,c)||(n.numberOfPerson=c),c}),a()(),r(27,"div",16)(28,"strong",7),d(29,"Currency"),a(),r(30,"div",17)(31,"ng-select",18),A("ngModelChange",function(c){return B(n.selectedCurrencyId,c)||(n.selectedCurrencyId=c),c}),g("change",function(c){return n.onUpdateCurrency(c)}),a(),C(32,Gi,4,1,"div",19),a()()()()()()),e&2&&(u("config",n.config),l(4),N("value",n.note),l(2),Y(n.poTypes()),l(6),u("items",n.logisticsService()),N("ngModel",n.selectedLogistics),l(5),N("ngModel",n.referenceNumber),l(4),N("ngModel",n.invoiceNumber),u("disabled",!(n.role.sell!=null&&n.role.sell.Number)),l(5),N("ngModel",n.numberOfPerson),l(5),u("items",n.currencies()),N("ngModel",n.selectedCurrencyId),u("clearable",!1),l(),_(n.selectedCurrencyId()!=n.defaultCurrencyId()?32:-1))},dependencies:[O,X,Z,pe,W,he,$t,ae,ce,bn,_n,Je,$e,xe,Ye,Se,nt,tt],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}content[_ngcontent-%COMP%] > div.container-fluid[_ngcontent-%COMP%]{min-height:200px}.tinymce[_ngcontent-%COMP%] a[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{z-index:2;position:absolute;right:15px;bottom:19px}.tinymce[_ngcontent-%COMP%] editor[_ngcontent-%COMP%]{height:max-content;z-index:1}.rad-btn[_ngcontent-%COMP%]{position:relative;display:inline-block}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #dddddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label.selected[_ngcontent-%COMP%]{background:#dcdcdc;border:1px solid #dcdcdc}.btn-link.note-tab[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.note-tab.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}a.btn.btn-link.note-tab[_ngcontent-%COMP%]{color:inherit}.ng-select.currency-option[_ngcontent-%COMP%]{width:50%!important}"]})};function $i(i,t){if(i&1){let e=E();At(0),r(1,"div",27),g("click",function(){h(e);let o=p();return y(o.onShowModalRedeem())}),r(2,"span"),f(3,"i",28),a(),r(4,"span"),d(5),b(6,"number"),a()(),Vt()}if(i&2){let e=p();l(5),M(" ",R(6,1,e.orderPointUsed())," Points redeemed ")}}var ht=class i{dialogRef=s(le);storeService=s(v);eventService=s(x);calculationService=s(me);config=new se;order=m(()=>this.storeService.order());invoice=m(()=>this.storeService.invoice());customer=m(()=>this.storeService.customer());currency=m(()=>this.storeService.currency());orderPointUsed=m(()=>this.storeService.order().PointUsed);taxes=m(()=>this.storeService.loadForm().Taxes);discount1=w(this.order().Discount);discount2=w(this.order().Discount2);discountAmount=w(this.order().DiscountAmount);surcharge=w(this.invoice().SurchargePcg);taxId=w(this.order().TaxTypeID);discounts=w([]);discAfterTax=w(0);ngOnInit(){this.config.title="Discount",this.config.customWidth="500px"}onShowModalRedeem(){}onOk(){[{type:"[Order] Update Discount Percentage 1",payload:{discount:this.discount1()}},{type:"[Order] Update Discount Percentage 2",payload:{discount:this.discount2()}},{type:"[Order] Update Discount Amount",payload:{discountAmount:this.discountAmount()}},{type:"[Order] Update Tax",payload:{tax:this.getTax()}},{type:"[Invoice] Update Surcharge",payload:{surcharge:this.surcharge()}}].forEach(e=>this.eventService.emit(e)),this.dialogRef.close()}getTax(){return this.taxes().find(t=>t.ID===this.taxId())}calculateDiscount1(){let t=this.discounts(),e=this.calculationService.calculateDiscount(t);this.discount1.set(e)}onDiscAfterTaxChange(){let t=this.calculationService.discountAfterTax(this.discAfterTax());this.discountAmount.set(t)}onClose(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["app-dialog-discount"]],standalone:!0,features:[P],decls:66,vars:17,consts:[[3,"keydown.F2","onOk","onCancel","onClose","config"],[1,"container"],["tabTitle","Discount"],[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"],[4,"ngIf"],["tabTitle","Tax"],["bindLabel","Label","appendTo","body","bindValue","ID","placeholder","Tax","data-cy","select-tax",2,"width","150px",3,"ngModelChange","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"],["tabTitle","Calculator"],[1,"col-4"],[1,"col-8","ps-6"],["type","text","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","","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],["type","text","data-cy","discountCal2","autoNum","","percentage","","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],["type","text","data-cy","discountCal3","autoNum","","percentage","","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],["role","button",3,"click"],[1,"fa-solid","fa-info-circle","ms-2"]],template:function(e,n){if(e&1&&(r(0,"modal-material",0),g("keydown.F2",function(){return n.onOk()})("onOk",function(){return n.onOk()})("onCancel",function(){return n.onClose()})("onClose",function(){return n.onClose()}),d(1," > "),r(2,"content")(3,"div",1)(4,"custom-tabs")(5,"tab",2)(6,"div",3)(7,"div",4)(8,"label",5),d(9,"Discount %"),a()(),r(10,"div",6)(11,"input",7),A("ngModelChange",function(c){return B(n.discount1,c)||(n.discount1=c),c}),a(),r(12,"span",8),d(13,"%"),a(),r(14,"span",9),d(15,"+"),a(),r(16,"input",10),A("ngModelChange",function(c){return B(n.discount2,c)||(n.discount2=c),c}),a(),r(17,"span",8),d(18,"%"),a()()(),r(19,"div",11)(20,"div",4)(21,"label",5),d(22),a()(),r(23,"div",12)(24,"input",13),A("ngModelChange",function(c){return B(n.discountAmount,c)||(n.discountAmount=c),c}),a(),C(25,$i,7,3,"ng-container",14),a()()(),r(26,"tab",15)(27,"div",3)(28,"div",4)(29,"label",5),d(30,"Tax"),a()(),r(31,"div",6)(32,"ng-select",16),A("ngModelChange",function(c){return B(n.taxId,c)||(n.taxId=c),c}),a()()(),r(33,"div",11)(34,"div",4)(35,"label",5),d(36,"Surcharge"),a()(),r(37,"div",6)(38,"input",17),A("ngModelChange",function(c){return B(n.surcharge,c)||(n.surcharge=c),c}),a(),r(39,"span",8),d(40,"%"),a()()()(),r(41,"tab",18)(42,"div",3)(43,"div",19)(44,"strong"),d(45,"Discount After Tax"),a()(),r(46,"div",20)(47,"input",21),A("ngModelChange",function(c){return B(n.discAfterTax,c)||(n.discAfterTax=c),c}),g("ngModelChange",function(){return n.onDiscAfterTaxChange()}),a()()(),r(48,"div",22)(49,"div",19)(50,"label",5),d(51,"Discount Calculator"),a()(),r(52,"div",23)(53,"input",24),A("ngModelChange",function(c){return B(n.discounts()[0],c)||(n.discounts()[0]=c),c}),g("ngModelChange",function(){return n.calculateDiscount1()}),a(),r(54,"span"),d(55," %"),a(),r(56,"span",9),d(57,"+"),a(),r(58,"input",25),A("ngModelChange",function(c){return B(n.discounts()[1],c)||(n.discounts()[1]=c),c}),g("ngModelChange",function(){return n.calculateDiscount1()}),a(),r(59,"span"),d(60," %"),a(),r(61,"span",9),d(62,"+"),a(),r(63,"input",26),A("ngModelChange",function(c){return B(n.discounts()[2],c)||(n.discounts()[2]=c),c}),g("ngModelChange",function(){return n.calculateDiscount1()}),a(),r(64,"span"),d(65," %"),a()()()()()()()()),e&2){let o;u("config",n.config),l(11),N("ngModel",n.discount1),l(5),N("ngModel",n.discount2),l(6),M("Discount ",(o=n.currency())==null?null:o.Symbol,""),l(2),u("disabled",n.orderPointUsed()&&n.orderPointUsed()>0),N("ngModel",n.discountAmount),l(),u("ngIf",n.orderPointUsed()&&n.orderPointUsed()>0),l(7),u("clearable",!1),N("ngModel",n.taxId),u("items",n.taxes()),l(6),N("ngModel",n.surcharge),u("max",100)("min",-100),l(9),N("ngModel",n.discAfterTax),l(6),N("ngModel",n.discounts()[0]),l(5),N("ngModel",n.discounts()[1]),l(5),N("ngModel",n.discounts()[2])}},dependencies:[O,ve,K,Z,pe,W,he,ae,ce,Je,$e,xe,Ye,Se,nt,tt]})};var ue=class i{httpService=s(H);storeService=s(v);eventService=s(x);getParkedOrder(t,e){return this.httpService.get(fe.GetPark,[{key:"EntityID",value:t},{key:"RegisterID",value:e}])}onPark(){!this.validateCartItems()||!this.validateCustomerRequired()||!this.validateRegister()||this.showParkDialog()}showParkDialog(){let t=this.storeService.register()?.ParkLayoutPack,e=this.storeService.state();if(t&&t.ID)e==4?this.eventService.emit({type:"[Park] Open Dialog",payload:{type:"REPARK"}}):this.eventService.emit({type:"[Park] Open Dialog",payload:{type:"PARK_SELECT"}});else{if(!this.validateRetrieveMode())return;this.setDefaultParkNote(),this.eventService.emit({type:"[Park] Open Dialog",payload:{type:"PARK_INPUT"}})}}setDefaultParkNote(){let e=this.storeService.loadForm().AppConfigJSON.ApplicationParkAndRetrieve.UserInterfaceLabel.DefaultParkNoteValue,o=this.storeService.state()==2,c=this.storeService.order();!o&&F.IsNotEmpty(e)&&F.IsEmpty(c.Note)&&this.eventService.emit({type:"[Order] Update Note",payload:{note:e}})}validateRetrieveMode(){return this.storeService.loadForm().AppConfigJSON.ApplicationParkAndRetrieve.Advance.retreiveMode!=1}validateCustomerRequired(){let t=this.storeService.loadForm().AppConfigJSON,e=this.storeService.order().CustomerID,n=t.ModuleSell.Header?.CustomerRequired;return!(!e&&n)}validateCartItems(){return this.storeService.cartItems().length!=0}validateRegister(){let t=this.storeService.register();return!(!t||!t.RegisterID)}getOccupiedPark(t){return this.httpService.get(fe.GetVacant,[{key:"EntityID",value:t}]).pipe(ie(e=>e.Orders))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=T({token:i,factory:i.\u0275fac})};var yt=class i{constructor(){}ngOnInit(){}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["app-dialog-repark"]],standalone:!0,features:[P],decls:2,vars:0,template:function(e,n){e&1&&(r(0,"p"),d(1,` dialog-repark works!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as ie}from"./chunk-
|
|
1
|
+
import{g as ie}from"./chunk-G43IZOIK.js";import"./chunk-TN6LUSUY.js";import"./chunk-DQKCHSJX.js";import"./chunk-AK7EZZXT.js";import{a as ne,b as ae}from"./chunk-QZ7PERU7.js";import{b as z}from"./chunk-NVBHDOJ5.js";import{a as G,b as A,c as q}from"./chunk-U66MTF3H.js";import{a as J}from"./chunk-NGJVL6SF.js";import"./chunk-CSQAB6L6.js";import{d as ee,e as te}from"./chunk-C5CZDSLJ.js";import"./chunk-MVX7AVT5.js";import"./chunk-OV3FNQCC.js";import"./chunk-NM5QZ5VX.js";import{a as K}from"./chunk-4CMGEPIB.js";import"./chunk-4M3W3MWK.js";import"./chunk-DSTB7NGU.js";import{a as oe}from"./chunk-OBZF23KN.js";import{g as Z,h as $}from"./chunk-GWZIO33Z.js";import"./chunk-FFKDWS7A.js";import{b as U}from"./chunk-MSZBPFVC.js";import"./chunk-ZEDNFDBV.js";import"./chunk-OAD7UPCT.js";import{m as Q}from"./chunk-UQ4MNKKG.js";import"./chunk-ZQXQP23N.js";import{O as Y,g as X}from"./chunk-ZBAXEP6H.js";import"./chunk-2YZVWRFN.js";import"./chunk-HZYB2HUT.js";import"./chunk-X5LJZH3R.js";import"./chunk-R4FCSZEY.js";import"./chunk-ITY3WD5X.js";import"./chunk-2FWFPV5I.js";import{D as j,h as R,o as W}from"./chunk-A3JBDL46.js";import"./chunk-IBZ7YKZU.js";import"./chunk-NGR5QZSH.js";import{d as H}from"./chunk-DLYUFTZV.js";import"./chunk-H6GPWFWI.js";import{a as k}from"./chunk-ZISQUX7W.js";import{$b as v,Ab as i,Bb as o,Cb as h,Gb as _,Jb as S,Lb as m,Tc as N,Wa as p,Xa as u,_b as l,ac as w,dc as x,dd as B,ec as C,fc as y,gb as L,hc as T,jb as f,nb as s,pa as E,rc as D,sc as P,tc as O,wa as c,wb as I,xa as d,xc as V,yb as M,zb as F}from"./chunk-RXPVPXFJ.js";import"./chunk-KW4B7WMB.js";function le(r,g){if(r&1){let e=_();i(0,"button",5),S("click",function(){c(e);let t=m();return d(t.openExportModal())}),h(1,"i",6),l(2," Export "),o()}}function pe(r,g){if(r&1){let e=_();i(0,"h6"),l(1,"Outlet"),o(),i(2,"outlet-selector",7),y("ngModelChange",function(t){c(e);let a=m();return C(a.pageData.Filter.Outlet,t)||(a.pageData.Filter.Outlet=t),d(t)}),o(),i(3,"h6"),l(4,"Category"),o(),i(5,"POS-product-category-select",8),y("selectedCategoryIDChange",function(t){c(e);let a=m();return C(a.pageData.Filter.Category,t)||(a.pageData.Filter.Category=t),d(t)}),o(),i(6,"h6"),l(7,"Discontinued"),o(),i(8,"radio-options",9),y("modelChange",function(t){c(e);let a=m();return C(a.pageData.Filter.Discontinued,t)||(a.pageData.Filter.Discontinued=t),d(t)}),o()}if(r&2){let e=m();p(2),s("accessType",2),x("ngModel",e.pageData.Filter.Outlet),p(3),x("selectedCategoryID",e.pageData.Filter.Category),s("showClear",!0),p(3),x("model",e.pageData.Filter.Discontinued)}}function me(r,g){if(r&1&&(i(0,"tr")(1,"td"),l(2),o(),i(3,"td"),l(4),o(),i(5,"td",20),l(6),D(7,"quantityFraction"),o()()),r&2){let e=g.$implicit;p(2),v(e.EntityName),p(2),v(e.Name),p(2),w(" ",P(7,3,e.Inventory)," ")}}function ce(r,g){if(r&1){let e=_();i(0,"div",10)(1,"div",11)(2,"table",12),S("matSortChange",function(t){c(e);let a=m();return d(a.onSortData(t))}),i(3,"thead",13)(4,"tr",14)(5,"th",15),l(6,"Outlet"),o(),i(7,"th",16),l(8,"Storage Location"),o(),i(9,"th",17),l(10," On Hand "),o()()(),i(11,"tbody"),M(12,me,8,5,"tr",null,I),o(),i(14,"tfoot")(15,"tr",18),h(16,"td",19),i(17,"td",19),l(18,"Total :"),o(),i(19,"td",20),l(20),D(21,"sum"),D(22,"quantityFraction"),o()()()(),i(23,"POS-complex-pagination",21),S("jumpToPage",function(){c(e);let t=m();return d(t.getListData())})("previousPage",function(){c(e);let t=m();return d(t.getListData())})("nextPage",function(){c(e);let t=m();return d(t.getListData())}),o()()()}if(r&2){let e=m();p(12),F(e.data.Data),p(8),w(" ",P(22,6,O(21,3,e.data.Data,"Inventory"))," "),p(3),s("total",e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var re=class r extends J{constructor(e,n,t,a){super(e,n,"Inventory/GetProductStorageLocation",null);this.httpService=n;this.dialog=t;this.roleService=a}pageData={Filter:{Category:null,Discontinued:!1,Outlet:null,RowCount:20,PageNumber:1}};datasource;postInit(e){this.datasource=JSON.parse(JSON.stringify(e.Data))}openExportModal(){this.dialog.open(z,{data:{title:"Storage Location",exportTypes:[{ID:"Inventory/GetProductStorageLocation",Value:"Default",FileName:"Storage Location"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"inventory/GetCountProductStorageLocation",pagination:!0}})}onSortData(e){let n=this.data.Data?.slice();if(!e.active||e.direction===""){this.data.Data=this.datasource;return}let t=e.direction==="asc";this.data.Data=n.sort((a,b)=>this.compare(a[e.active],b[e.active],t))}static \u0275fac=function(n){return new(n||r)(u(U),u(k),u(Q),u(H))};static \u0275cmp=E({type:r,selectors:[["app-storage-location"]],standalone:!0,features:[L,T],decls:9,vars:5,consts:[["pageFilterTemplate",""],[3,"onSubmit","pageData","hideSearchBox","isFilterOnDropdown"],[1,"d-flex"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","container-fluid mt-3",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["placeholder","Choose an outlet","appendTo","body",3,"ngModelChange","accessType","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","Discontinued",3,"modelChange","model"],[1,"container-fluid","mt-3"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","EntityName",2,"width","450px"],["mat-sort-header","Brand"],["mat-sort-header","Inventory","arrowPosition","before",1,"text-end",2,"padding-right","100px","width","190px"],[1,"table-footer","fw-bold"],[1,"empty-column"],[1,"text-end",2,"padding-right","100px"],["api","inventory/GetCountProductStorageLocation",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(n,t){if(n&1){let a=_();i(0,"mainpanel-cmp",1),S("onSubmit",function(){return c(a),d(t.searchFromPageOne())}),i(1,"actions")(2,"div",2),f(3,le,3,0,"button",3),o()(),i(4,"filters"),f(5,pe,9,5,"ng-template",null,0,V),o(),i(7,"content"),f(8,ce,24,8,"div",4),o()()}n&2&&(s("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),p(3),s("ngIf",t.roleService.global.Export),p(5),s("ngIf",t.data))},dependencies:[B,N,$,Z,K,Y,X,te,ee,ie,oe,j,R,W,ae,ne,q,G,A]})};export{re as StorageLocationComponent};
|