dealpos 26.31.2 → 26.31.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-E5RIJTAA.js → chunk-24XCABH5.js} +1 -1
- package/browser/{chunk-UKOCBRO7.js → chunk-27QLO2XQ.js} +1 -1
- package/browser/{chunk-JV3OBBBH.js → chunk-2D2XT3PV.js} +1 -1
- package/browser/{chunk-VAREGQEI.js → chunk-2VP7E3PQ.js} +1 -1
- package/browser/{chunk-76YPQ4UU.js → chunk-3HBGMKXO.js} +1 -1
- package/browser/{chunk-5IDDQT6Q.js → chunk-3HTKYIYM.js} +1 -1
- package/browser/{chunk-QPSVLU4G.js → chunk-3MUQZ2C2.js} +1 -1
- package/browser/{chunk-QRXCSHBN.js → chunk-3MXEGWDO.js} +1 -1
- package/browser/{chunk-UZCDTXEN.js → chunk-3S6ST4TH.js} +1 -1
- package/browser/{chunk-SFY3SQOM.js → chunk-4D6UHJW3.js} +1 -1
- package/browser/{chunk-R2SZJX7H.js → chunk-4H4WWZOW.js} +1 -1
- package/browser/{chunk-4QOTBAUH.js → chunk-4LUT5RR3.js} +1 -1
- package/browser/{chunk-SANXT2J4.js → chunk-4LYKKZIZ.js} +2 -2
- package/browser/{chunk-CCEVRRR3.js → chunk-4WUOGIHA.js} +1 -1
- package/browser/{chunk-K3UZFSFE.js → chunk-55ZHPBW5.js} +1 -1
- package/browser/{chunk-ZUXKS7OU.js → chunk-5J5HDA5S.js} +1 -1
- package/browser/{chunk-SCCAPYCC.js → chunk-5O5ADSGP.js} +1 -1
- package/browser/{chunk-FJURCASJ.js → chunk-5XUEZEH6.js} +1 -1
- package/browser/{chunk-CRC2J4QR.js → chunk-65MKWPEA.js} +1 -1
- package/browser/{chunk-5I54KU3Z.js → chunk-6DIR4WTK.js} +1 -1
- package/browser/{chunk-MHV2DDPD.js → chunk-6ENTUOMR.js} +1 -1
- package/browser/{chunk-LN5GPX2G.js → chunk-6IHVAHOJ.js} +1 -1
- package/browser/{chunk-5GRWGDKS.js → chunk-6JH43KCA.js} +1 -1
- package/browser/{chunk-MMFIIPL3.js → chunk-6QRBXUKD.js} +1 -1
- package/browser/{chunk-NJISQHEN.js → chunk-AQHO3XEN.js} +1 -1
- package/browser/{chunk-V26NSTVU.js → chunk-ASU62PRM.js} +1 -1
- package/browser/{chunk-CAZIYF2Z.js → chunk-AZV3ZL2L.js} +1 -1
- package/browser/{chunk-Y6LQZATD.js → chunk-B5Q6R7YL.js} +1 -1
- package/browser/{chunk-M43DOPB3.js → chunk-B6IUKLRE.js} +1 -1
- package/browser/{chunk-OBYMB3OY.js → chunk-B7O2JFQP.js} +1 -1
- package/browser/{chunk-TK5UX4Z7.js → chunk-BSABRZAK.js} +1 -1
- package/browser/{chunk-DV2JKE7A.js → chunk-C72Q7NCM.js} +1 -1
- package/browser/{chunk-CPWNEOZT.js → chunk-CPIA7ICW.js} +1 -1
- package/browser/{chunk-3KWW6NCH.js → chunk-CYX3JHLD.js} +2 -2
- package/browser/{chunk-63ZAXFQX.js → chunk-D77N5YJQ.js} +1 -1
- package/browser/{chunk-2YYLJWM3.js → chunk-DDEHMIIR.js} +1 -1
- package/browser/{chunk-XZAU3X45.js → chunk-DL3J6TUH.js} +1 -1
- package/browser/{chunk-EJVYQZZQ.js → chunk-DTO7DBGO.js} +1 -1
- package/browser/{chunk-YTV37PR3.js → chunk-FEXXIGNP.js} +1 -1
- package/browser/{chunk-RKLZUX6N.js → chunk-FSGAXCGT.js} +1 -1
- package/browser/{chunk-IAQWAJGU.js → chunk-GAOTQC6C.js} +1 -1
- package/browser/{chunk-S3JVKA4R.js → chunk-GDDO4QGR.js} +1 -1
- package/browser/{chunk-ESKDMCP7.js → chunk-GOH6GZO3.js} +3 -3
- package/browser/{chunk-PWW6WJXY.js → chunk-HFAZEEFU.js} +1 -1
- package/browser/{chunk-2D2XTHX5.js → chunk-HHAX6NA5.js} +1 -1
- package/browser/{chunk-ZZY6QZJS.js → chunk-HILPNQLH.js} +1 -1
- package/browser/{chunk-T2BTYG4O.js → chunk-HZCMDR2D.js} +1 -1
- package/browser/{chunk-QUHRGAHV.js → chunk-I4RKPGHZ.js} +1 -1
- package/browser/{chunk-SJCVCLEI.js → chunk-IRZBTSQJ.js} +1 -1
- package/browser/{chunk-KGSVHK3Y.js → chunk-IT5F6HTZ.js} +1 -1
- package/browser/{chunk-J2YSVKFZ.js → chunk-IWSBWOPP.js} +1 -1
- package/browser/{chunk-C5CVS3GK.js → chunk-J5D3DS2D.js} +1 -1
- package/browser/{chunk-ZTXLGZTV.js → chunk-JCTBSD5B.js} +1 -1
- package/browser/{chunk-DLXQDMIM.js → chunk-JN4YCBPR.js} +1 -1
- package/browser/{chunk-TKFYBJHP.js → chunk-JWUXQB5C.js} +1 -1
- package/browser/{chunk-UKH23FAA.js → chunk-KJJIT3V3.js} +1 -1
- package/browser/{chunk-3KNBMMHW.js → chunk-L4N5WCFL.js} +1 -1
- package/browser/{chunk-VQIUTLMW.js → chunk-LR4TBLOG.js} +1 -1
- package/browser/{chunk-WI7FIDPI.js → chunk-M35WAKEX.js} +2 -2
- package/browser/{chunk-EESLPH7M.js → chunk-MHX42PHY.js} +1 -1
- package/browser/{chunk-WHXE6ADU.js → chunk-NOSOEHLA.js} +1 -1
- package/browser/{chunk-VZI23TLG.js → chunk-ODQZ5YYW.js} +1 -1
- package/browser/{chunk-IBYZW56U.js → chunk-OIXMLOND.js} +1 -1
- package/browser/{chunk-DNETJ3VB.js → chunk-OMDURLSU.js} +1 -1
- package/browser/{chunk-YVSIU6ID.js → chunk-OTUP7FF4.js} +1 -1
- package/browser/{chunk-UEYUGNPL.js → chunk-P5DIG66U.js} +1 -1
- package/browser/{chunk-XKEUQRAW.js → chunk-PGFGNYEC.js} +1 -1
- package/browser/{chunk-FHX3FOWJ.js → chunk-PSN4UBIG.js} +1 -1
- package/browser/{chunk-TY23MB5Q.js → chunk-PUYFPYAH.js} +1 -1
- package/browser/{chunk-CPS3GH6A.js → chunk-PZ55WJCF.js} +1 -1
- package/browser/{chunk-MBTM4VZP.js → chunk-PZNBXMLM.js} +1 -1
- package/browser/{chunk-MN3ZDFC6.js → chunk-Q6MXTRRK.js} +1 -1
- package/browser/{chunk-BWWJIUH6.js → chunk-QAWCTGI7.js} +1 -1
- package/browser/{chunk-2RW4GYO7.js → chunk-QBYORWNR.js} +1 -1
- package/browser/{chunk-APP64NKL.js → chunk-QWQ7KY5S.js} +1 -1
- package/browser/{chunk-ZTBEPFPB.js → chunk-R7SF7HVM.js} +1 -1
- package/browser/{chunk-6HHTVTMK.js → chunk-RCMS5R2P.js} +1 -1
- package/browser/{chunk-6EHRM4I3.js → chunk-RRDCRQWC.js} +1 -1
- package/browser/{chunk-2KMZR2FQ.js → chunk-RSCYVQVF.js} +1 -1
- package/browser/{chunk-NUVDVWF6.js → chunk-S7P5A2ZL.js} +1 -1
- package/browser/{chunk-XFCSKGHI.js → chunk-SC6KNXWF.js} +1 -1
- package/browser/{chunk-PAD5WWIX.js → chunk-SVD425RQ.js} +2 -2
- package/browser/{chunk-C2TKFZPS.js → chunk-T73HTA4F.js} +1 -1
- package/browser/{chunk-6VDBR2VF.js → chunk-TBHBGEON.js} +1 -1
- package/browser/{chunk-BJX2SA4C.js → chunk-TEYWMGCB.js} +1 -1
- package/browser/{chunk-MPBAL72O.js → chunk-TNRIU3NK.js} +1 -1
- package/browser/{chunk-PC6KMKB6.js → chunk-TOLMSCLC.js} +3 -3
- package/browser/{chunk-6ZCY42RQ.js → chunk-U7Z6GSQ2.js} +1 -1
- package/browser/{chunk-LPPRCRLR.js → chunk-V7BGNQTG.js} +1 -1
- package/browser/{chunk-IXS7JCOU.js → chunk-VPK6L2NH.js} +1 -1
- package/browser/{chunk-L7MNXV4J.js → chunk-VTM5KL3Y.js} +1 -1
- package/browser/{chunk-ZDITRPNK.js → chunk-VY3BX3QS.js} +1 -1
- package/browser/{chunk-V7TPRT7B.js → chunk-VYIRDGB7.js} +1 -1
- package/browser/{chunk-75QDHX34.js → chunk-W2K27MND.js} +1 -1
- package/browser/{chunk-JAPORYEE.js → chunk-WDG3LESE.js} +1 -1
- package/browser/{chunk-VEC6WZRR.js → chunk-XCPZOGRM.js} +1 -1
- package/browser/{chunk-4QFVTPWB.js → chunk-XRFOIMKL.js} +1 -1
- package/browser/{chunk-T27WXEVA.js → chunk-Y2FKBSMD.js} +2 -2
- package/browser/{chunk-HXEIOQQJ.js → chunk-Y3G56H7R.js} +1 -1
- package/browser/{chunk-6CVWPBUM.js → chunk-YLGNXQKM.js} +1 -1
- package/browser/{chunk-JXRB4UXW.js → chunk-YMMBFR7W.js} +2 -2
- package/browser/{chunk-AHWFDIKW.js → chunk-ZKDI2LXQ.js} +1 -1
- package/browser/{chunk-XRLUES2P.js → chunk-ZMXHAQAD.js} +1 -1
- package/browser/{chunk-XSEJ2JC4.js → chunk-ZQ3EDS26.js} +1 -1
- package/browser/{chunk-5J7J3ST2.js → chunk-ZQDUSY2O.js} +1 -1
- package/browser/{chunk-CZPTOUVZ.js → chunk-ZTMEX5W4.js} +1 -1
- package/browser/{chunk-BAWPJVRQ.js → chunk-ZXHNUISD.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-PSBEISMC.js → main-NPQSSREJ.js} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as mi}from"./chunk-CDMUNCIC.js";import{a as zr}from"./chunk-D6LCK4WD.js";import{a as qr}from"./chunk-JXLQVHA4.js";import{b as br,c as hr,d as jr,e as di}from"./chunk-76H4AHQ3.js";import{a as pi}from"./chunk-JTK4GASS.js";import{a as Wr}from"./chunk-Z4JMRDJD.js";import{A as Tr,C as Er,D as Nr,F as Rr,G as Ar,H as Vr,a as tt,n as Cr,o as oi,p as vr,x as Mr,y as Or,z as kr}from"./chunk-ZUXKS7OU.js";import{b as ii}from"./chunk-RHOCFCH3.js";import"./chunk-ZOBPTHDY.js";import"./chunk-BYXBJQAS.js";import"./chunk-GGDW5WFA.js";import{a as Fr,b as Br}from"./chunk-XRLUES2P.js";import{a as _r,c as Sr,d as Pr,e as xr}from"./chunk-WRS2LSMD.js";import{a as Qr,b as ci}from"./chunk-SOWALOYP.js";import{a as Ir,b as wr}from"./chunk-D2FPJJV3.js";import{c as ri,d as ai}from"./chunk-ET4GSDIH.js";import"./chunk-H3HSBSA5.js";import"./chunk-U2JF2UMO.js";import"./chunk-DUBSPAA2.js";import"./chunk-K33O52MA.js";import{a as Ur}from"./chunk-BQQFM2OB.js";import{a as Lr}from"./chunk-ZJVV5KOM.js";import"./chunk-VZI4G22D.js";import"./chunk-NQX7EX5A.js";import{b as li,c as si}from"./chunk-L6NZPVBV.js";import"./chunk-ZTBEPFPB.js";import{b as yr}from"./chunk-Z4ZHT2DE.js";import{a as bt,b as Ht,c as Gt}from"./chunk-BUP3F3S5.js";import{a as Jn}from"./chunk-LW4YXLL2.js";import"./chunk-B3EQHX7N.js";import"./chunk-P3KIIKY4.js";import"./chunk-FEJLGG7W.js";import{a as nt}from"./chunk-N4KD7EQC.js";import{a as Dr}from"./chunk-7FQSGPHL.js";import"./chunk-BYXBJQAS.js";import{a as vo}from"./chunk-I3WLM5Y4.js";import{a as pr,f as mr,j as ei,m as gr}from"./chunk-JV3OBBBH.js";import{a as yo}from"./chunk-S77FVPQM.js";import"./chunk-ZZ2RLD3G.js";import"./chunk-Z3E24JZW.js";import"./chunk-5UDUWK67.js";import{c as ho}from"./chunk-I3WUTJXX.js";import"./chunk-SKME2EES.js";import{a as ti,b as ur}from"./chunk-ZDITRPNK.js";import{a as St}from"./chunk-DDLXGCOB.js";import{a as ni}from"./chunk-7QWL5TKZ.js";import"./chunk-TSKVGMIC.js";import{a as dr}from"./chunk-N24DKJZX.js";import{b as Yn,c as Qt,d as jt,e as Wt}from"./chunk-E7AVQYKT.js";import{a as fr}from"./chunk-UXF6X367.js";import"./chunk-63VYORHV.js";import"./chunk-ME5A6DKC.js";import"./chunk-5VZWXSVF.js";import"./chunk-B65CLZ4K.js";import"./chunk-EWIZNGPY.js";import"./chunk-CPOQEU6C.js";import"./chunk-S7HPA5O7.js";import"./chunk-G3RF7GBQ.js";import{b as Go}from"./chunk-Z3EH6NKY.js";import"./chunk-RMPCUE2N.js";import{d as ir}from"./chunk-K2BCWJSV.js";import"./chunk-TDI2ZUL6.js";import{c as or,d as rr}from"./chunk-JTZLL5AS.js";import"./chunk-CKHJNQTW.js";import{a as He}from"./chunk-ESWYZY2G.js";import"./chunk-MF3BDWCO.js";import"./chunk-BF42EMHQ.js";import{b as sr,c as cr}from"./chunk-VU5DCR4V.js";import{a as ar,b as lr}from"./chunk-WURU2W3C.js";import"./chunk-UEFG7JV5.js";import"./chunk-ZSK2V6PP.js";import"./chunk-2KEPYDRB.js";import"./chunk-EUIKMR24.js";import"./chunk-7VXCKSAE.js";import{a as Wo,d as qo,f as zo,h as Ho}from"./chunk-3GAEZ6NJ.js";import"./chunk-MOV2FQBP.js";import"./chunk-W4DKC5G3.js";import{a as tr,b as nr}from"./chunk-KIONH5BK.js";import{b as zt,c as ft,d as er}from"./chunk-4QOTBAUH.js";import{r as Zo}from"./chunk-W7I2IWJP.js";import"./chunk-HPCTP4FD.js";import"./chunk-KFWGALIF.js";import{a as Xe,b as Ze}from"./chunk-Z7UCI72M.js";import"./chunk-PPMQE2JW.js";import{F as Xo,N as gt,a as $o,b as Ko,u as Jo,x as Yo}from"./chunk-7OCVKGLK.js";import{a as Lt}from"./chunk-SCCAPYCC.js";import"./chunk-OKQYRKDJ.js";import"./chunk-VEC6WZRR.js";import{d as et,e as Zn}from"./chunk-ULWLSYED.js";import"./chunk-DU6XSMWH.js";import{b as De}from"./chunk-6CVWPBUM.js";import{a as ie,b as qt,c as Te,h as Xn}from"./chunk-LCBHD53Y.js";import"./chunk-IKV23X6H.js";import"./chunk-C6TJ57ES.js";import"./chunk-RJDDPGUV.js";import{a as B,b as _t}from"./chunk-VUC4E73K.js";import"./chunk-OTSIIVCA.js";import{a as Z}from"./chunk-DUAKLYOO.js";import"./chunk-QSBTT5BF.js";import"./chunk-IX2NXO5F.js";import"./chunk-ZRB4EZI3.js";import{a as Be,b as se,c as oe}from"./chunk-KXQJYBG5.js";import"./chunk-3MLD6BQG.js";import"./chunk-LUUIBDJG.js";import"./chunk-R7VXUOCU.js";import"./chunk-NYN3E7NN.js";import{E as z,F as Ut,b as Hn,c as ne,e as Gn,h as ee,l as lt,o as te,r as $n,s as Kn,z as Uo}from"./chunk-R36OIJC7.js";import{a as Lo,c as jo}from"./chunk-LN5GPX2G.js";import{a as Qo}from"./chunk-75QDHX34.js";import"./chunk-AGPZGAMV.js";import{b as ke}from"./chunk-K74WZXBF.js";import{a as P}from"./chunk-PPTZHIIZ.js";import{a as zn}from"./chunk-APP64NKL.js";import{n as W,q as J}from"./chunk-ETYXTCKV.js";import{$ as kt,$a as Vn,Ab as Ve,Ac as pn,B as le,Ba as y,Bb as Y,Cb as X,D as Se,Da as ct,Db as f,Eb as a,Fb as l,Fc as O,Gb as h,Gc as R,H as Ue,Hb as ge,Hc as Pe,Ib as be,Ic as we,Jb as dt,Kb as Nt,Lb as Rt,Lc as Vt,M as yt,Mb as Fn,Na as Et,Oc as u,Pa as Oe,Pb as E,Pd as Bo,Qd as qn,Sa as An,Sb as v,Sc as Ro,Sd as Bt,Tb as pt,Tc as Fe,Ua as s,Ub as p,X as wo,Yb as Bn,Zb as Ln,_ as ko,_b as Un,bb as qe,cc as at,d as Mo,da as M,db as N,dc as To,ec as ze,gc as de,gd as Ao,hc as d,i as Ge,ic as F,id as pe,ja as w,jb as Qe,jc as k,kc as xe,l as wt,lc as Eo,m as Oo,mc as U,md as jn,na as c,nc as Q,nd as Vo,oc as j,od as Ft,pc as dn,qc as Qn,qd as ut,r as _e,ra as _,rc as At,s as Io,sa as S,sb as bo,sc as Co,sd as K,tc as No,ud as Wn,vd as q,wb as b,wc as mt,xa as Tt,xc as Je,ya as st,yb as C,yc as $,yd as Fo,zb as Ee,zc as Ye}from"./chunk-DUSKF5IQ.js";import{a as V,b as ue,j as Do}from"./chunk-NF7PG5F2.js";var ui=class{UserName;UserID;SalesID;CustomerOptions;ServerTime;AppConfigJSON;Denomination;Entities;Registers;Payments;PaymentTypes;Currencies;PoTypes;Taxes;BINS;ServerDateString;ServicesLogistics;WhatsAppConfigJSON;StylesSheet;UserGroupConfig};var it=class{ID;EntityID;RegisterID;TypeID;Date;Number;CustomerID;SalesID;Discount=0;Discount2=0;DiscountAmount=0;CustomerDiscountRate=0;Note="";DeliveryOutletID;TaxTypeID;CurrencyID;CurrencyRate;PointUsed;InvoicedStateID;ReferenceNumber="";LogisticsServiceID;ParkLabel="";NumberOfPerson;ClientTimestamp;Created;PromotionCoupon="";CouponType=1;PromotionNote="";DeliveryStateID;CouponProvider="Internal";CurrencySymbol;constructor(){this.ID=P.GuidEmpty,this.EntityID=P.GuidEmpty,this.RegisterID=P.GuidEmpty,this.Number="",this.CustomerID=null,this.SalesID=null,this.Discount=0,this.Discount2=0,this.DiscountAmount=0,this.Note="",this.TaxTypeID=P.GuidEmpty,this.CurrencyID=1,this.CurrencyRate=1,this.DeliveryStateID=3,this.PointUsed=0,this.NumberOfPerson=1,this.Date=new Date}removeEnterNote(){this.Note&&(this.Note=this.Note.replace(/\n/g,""))}};var je=class{ID;Number;Due;Date;CustomDateField;TimeCustom;SurchargePcg;TempSurchargePcg;ToP;Note;ReferenceInvoiceID;PaymentStateID;Sales;DateCustom;constructor(){this.ID=P.GuidEmpty,this.SurchargePcg=0,this.TempSurchargePcg=0,this.Due=null}};var Pt=class{Prefix;Seed;Digit;constructor(){this.Prefix=null,this.Seed=null,this.Digit=null}static Generate(e){let t="";if(e.Seed){let n=e.Seed+"";for(;n.length<e.Digit;)n="0"+n;t=P.StringFormat(e.Prefix,n)}return t}};var fi=class{RegisterID;RegisterCode;EntityID;EntityName;NumberElement;InvoiceNumberElement;ListSales;QuickKeyPack;PrintTemplate;DefaultSalesOrderTag;DefaultTaxType;DefaultWarehouse;MemberPoint;ParkLayoutPack;Promotion;DefaultPrintTemplate;NewOrderID;Payments;SplitPaymentEnabled;constructor(){this.RegisterID=null,this.RegisterCode=null,this.EntityID=null,this.EntityName=null,this.NumberElement=new Pt,this.InvoiceNumberElement=new Pt,this.Promotion=[],this.SplitPaymentEnabled=!0}};var ot=class{Name;Phone;Address;City;constructor(){this.Name="",this.Phone="",this.Address="",this.City=""}};var $t=class{DeliveryEntityID;NewOrderID;Type};var x=class i{store=mi({cartItems:[],parkTemporaryItem:[],loadForm:new ui,order:new it,invoice:new je,payments:[],register:new fi,shipping:new ot,promotions:[],state:0,customer:new ti,action:new $t,completeOrder:null});loadForm=this.store.select(e=>Object.freeze(e.loadForm()));register=this.store.select(e=>Object.freeze(e.register()));order=this.store.select(e=>Object.freeze(e.order()));cartItems=this.store.select(e=>Object.freeze(e.cartItems()));parkTemporaryItem=this.store.select(e=>Object.freeze(e.parkTemporaryItem()));payments=this.store.select(e=>Object.freeze(e.payments()));shipping=this.store.select(e=>Object.freeze(e.shipping()));invoice=this.store.select(e=>Object.freeze(e.invoice()));promotions=this.store.select(e=>Object.freeze(e.promotions()));state=this.store.select(e=>Object.freeze(e.state()));customer=this.store.select(e=>Object.freeze(e.customer()));completeOrder=this.store.select(e=>Object.freeze(e.completeOrder()));currency=u(()=>{let e=this.loadForm()?.Currencies,t=this.order()?.CurrencyID,n=e?.find(o=>o.ID===t);return n||e[0]});tax=u(()=>{let e=this.loadForm()?.Taxes,t=this.order()?.TaxTypeID,n=e?.find(o=>o.ID===t);return n||(e&&e.length>0?e[0]:void 0)});SalesOrderTag=u(()=>{let e=this.loadForm()?.PoTypes,t=this.order()?.TypeID,n=e?.find(o=>o.ID===t);return n||(e&&e.length>0?e[0]:void 0)});prepaidPackageItems=u(()=>this.cartItems().filter(t=>t.Variant.TypeID===10));action=this.store.select(e=>Object.freeze(e.action()));updateLoadForm(e){this.store.update("loadForm",e)}updateRegister(e){this.store.update("register",e)}updateOrder(e){this.store.update("order",e)}updateCustomer(e){this.store.update("customer",e)}updateCartItems(e){this.store.update("cartItems",e)}updateParkTemporaryItem(e){this.store.update("parkTemporaryItem",e)}updateInvoice(e){this.store.update("invoice",e)}updatePayments(e){this.store.update("payments",e)}updateShipping(e){this.store.update("shipping",e)}updatePromotions(e){this.store.update("promotions",e)}updateState(e){this.store.update("state",e)}updateAction(e){this.store.update("action",e)}updateCompleteOrder(e){this.store.update("completeOrder",e)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ne=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";static GenerateGopayQrCode="/API/Gopay/GenerateQR";static GopayVerifyPayment="/API/Gopay/VerifyQR";static GenerateBcaQrCode="/API/BCA/GenerateQR";static BcaVerifyPayment="/API/BCA/VerifyQR";static SubmitOrder="/API/POS/SubmitInvoice"};var I=class i{eventBus=new Mo;emit(e){this.eventBus.next(e)}on(e){return this.eventBus.pipe(Se(t=>t.type===e))}ngOnDestroy(){this.eventBus.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac,providedIn:"root"})};var mn=class i{eventBusService=c(I);storeService=c(x);httpService=c(J);constructor(){this.initLoadForm()}initLoadForm(){this.httpService.post(Ne.GetPOSStorage,{}).pipe(B()).subscribe(e=>{this.storeService.updateLoadForm(e),this.eventBusService.emit({type:"[Order] Load Form",payload:{form:e}}),this.initCurrency(e)})}initCurrency(e){let t=e?.AppConfigJSON?.CoreDefaults?.CurrencyID,n=e.Currencies.find(o=>o.ID===t);this.eventBusService.emit({type:"[Order] Update Currency",payload:{currency:n}})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac})};var Ct=class i{odsConfigType=y(0);setODSConfig(e){this.odsConfigType.set(e)}isEnabled(){return this.odsConfigType()>0}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac,providedIn:"root"})};var un=class i{storeService=c(x);toastrService=c(W);httpService=c(J);eventService=c(I);signalRClient=c(Lt);orderDisplayService=c(Ct);selectedRegister=u(()=>this.storeService.register());isOpenDialog$=this.eventService.on("[Order] Load Form").pipe(_e(()=>this.checkOpenDialogRegisters()));constructor(){let e;le(this.eventService.on("[Register] Updated").pipe(Se(t=>!!t.payload?.register),M(t=>{let o=t?.payload?.register?.RegisterID;this.signalRClient.SubscribeGroup(o,e),e=o})),this.eventService.on("[Register] Update Register By ID").pipe(M(t=>{let n=t.payload?.id;this.updateRegisterById(n)})),this.eventService.on("[Order] Update Customer PO Type").pipe(M(t=>{let n=t.payload?.poType;this.updatePrintTemplateByPoType(n)})),this.eventService.on("[Register] Update Register Number").pipe(M(t=>{let n=t.payload?.numberElement;this.updateRegisterStore({NewOrderID:n?.NewOrderID,NumberElement:n?.OrderNumberElement,InvoiceNumberElement:n?.InvoiceNumberElement})})),this.eventService.on("[Register] Update Print Template").pipe(M(t=>{let n=t.payload?.printTemplate;this.updateRegisterStore({PrintTemplate:n})}))).pipe(B()).subscribe()}updatePrintTemplateByPoType(e){let t=this.storeService.register();e.PrintTemplateID==0?this.updateRegisterStore({PrintTemplate:t.DefaultPrintTemplate}):this.getSalesOrderPrint(e.PrintTemplateID).subscribe(n=>{this.updateRegisterStore({PrintTemplate:n.Template})})}updateRegisterById(e){this.getRegisterById(e).subscribe(t=>{this.updateRegisterStore(t),this.loadOdsConfig(t.EntityID),this.eventService.emit({type:"[Order] Generate Number",payload:{element:t.NumberElement}})})}updateRegisterStore(e){let t=this.storeService.register();this.storeService.updateRegister(V(V({},t),e)),this.eventService.emit({type:"[Register] Updated",payload:{register:this.storeService.register()}})}getRegisterById(e){return this.httpService.get(Ne.GetRegisterInfo,[{key:"RegisterID",value:e}])}getSalesOrderPrint(e){return this.httpService.post(Ne.GetSalesOrderPrint,{TemplateID:e})}checkOpenDialogRegisters(){let e=this.storeService.loadForm(),t=e.Registers,n=e.AppConfigJSON?.ModuleShift?.Closure?.Enabled,o=e.UserName;if(t.length>1){let r=t.find(m=>m.LoginID==o);if(r)return this.updateRegisterById(r.ID),!1;{let m=this.selectedRegister()?this.selectedRegister().RegisterID:null;if(P.IsEmpty(m))return!0;if(n)return!0}}else{if(t.length==1)return this.updateRegisterById(t[0].ID),!1;this.toastrService.warning("You do not have access to any OUTLET","Warning")}return!1}loadOdsConfig(e){this.httpService.get(`/api/outlet/GetOrderDisplayBroadcastMode?EntityID=${e}`).pipe(M(t=>{this.orderDisplayService.setODSConfig(t.form?.OrderDisplayBroadcastMode??0)})).subscribe()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac})};var ba=i=>({active:i}),Ca=i=>({gray:i});function va(i,e){if(i&1){let t=E();a(0,"span",16),v("click",function(o){_(t);let r=p().$implicit;return p().onCloseRegister(r),S(o.stopPropagation())}),l()}}function ha(i,e){i&1&&(a(0,"div")(1,"span",17),d(2,"VACANT"),l()())}function ya(i,e){if(i&1&&(a(0,"div")(1,"span",18),h(2,"i",19),a(3,"font"),d(4),l()(),a(5,"span",20),h(6,"i",21),a(7,"font"),d(8),l()()()),i&2){let t=p().$implicit;s(4),F(t.LoginID),s(4),k("",t.StartDisplay.split(" ")[3]," - Now")}}function _a(i,e){if(i&1){let t=E();a(0,"div",9)(1,"div",10)(2,"div",11)(3,"h5",12),v("click",function(){let o=_(t).$implicit,r=p();return S(r.onSelectRegister(o))}),a(4,"span"),h(5,"i",13),d(6),O(7,"limitText"),l(),b(8,va,1,0,"span",14),l(),a(9,"div",15),v("click",function(){let o=_(t).$implicit,r=p();return S(r.onSelectRegister(o))}),b(10,ha,3,0,"div")(11,ya,9,2,"div"),l()()()()}if(i&2){let t,n,o=e.$implicit,r=p();s(),f("ngClass",o.Active?"active":""),s(),f("ngClass",$(9,ba,(o==null?null:o.ID)==((t=r.selectedRegister())==null?null:t.ID))),s(),f("ngClass",$(11,Ca,o!=r.selectedRegister)),s(3),F(Pe(7,6,o.Name,15)),s(2),C(o.State!="Close"?8:-1),s(2),C((n=o.State)==="Close"?10:n==="Open"?11:-1)}}var bi=class i{dialogRef=c(ie);storeService=c(x);router=c(Bo);roleService=c(ke);eventService=c(I);modalConfig=new se;registers=u(()=>this.storeService.loadForm().Registers);appConfig=u(()=>this.storeService.loadForm().AppConfigJSON);selectedRegister=y(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 e=this.storeService.register(),t=this.registers().find(n=>n.ID==e.RegisterID);this.selectedRegister.set(t)}onSelectRegister(e){if(this.appConfig().ModuleShift?.Closure?.Enabled)if(this.selectedRegister().ID!==null&&this.selectedRegister().Open)this.changeCurrentShift(e);else if(!e.Open||this.selectedRegister().ID==e.ID)this.selectedRegister.set(e);else{if(this.roleService.sell.Edit==!1){alert("You cannot end shift for Register "+e.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:e.ID}})}else this.selectedRegister.set(e)}changeCurrentShift(e){confirm("You already have an active register with "+this.selectedRegister().Name+`!
|
|
1
|
+
import{a as mi}from"./chunk-CDMUNCIC.js";import{a as zr}from"./chunk-D6LCK4WD.js";import{a as qr}from"./chunk-JXLQVHA4.js";import{b as br,c as hr,d as jr,e as di}from"./chunk-76H4AHQ3.js";import{a as pi}from"./chunk-JTK4GASS.js";import{a as Wr}from"./chunk-Z4JMRDJD.js";import{A as Tr,C as Er,D as Nr,F as Rr,G as Ar,H as Vr,a as tt,n as Cr,o as oi,p as vr,x as Mr,y as Or,z as kr}from"./chunk-5J5HDA5S.js";import{b as ii}from"./chunk-RHOCFCH3.js";import"./chunk-ZOBPTHDY.js";import"./chunk-BYXBJQAS.js";import"./chunk-GGDW5WFA.js";import{a as Fr,b as Br}from"./chunk-ZMXHAQAD.js";import{a as _r,c as Sr,d as Pr,e as xr}from"./chunk-WRS2LSMD.js";import{a as Qr,b as ci}from"./chunk-SOWALOYP.js";import{a as Ir,b as wr}from"./chunk-D2FPJJV3.js";import{c as ri,d as ai}from"./chunk-ET4GSDIH.js";import"./chunk-H3HSBSA5.js";import"./chunk-U2JF2UMO.js";import"./chunk-DUBSPAA2.js";import"./chunk-K33O52MA.js";import{a as Ur}from"./chunk-BQQFM2OB.js";import{a as Lr}from"./chunk-ZJVV5KOM.js";import"./chunk-VZI4G22D.js";import"./chunk-NQX7EX5A.js";import{b as li,c as si}from"./chunk-L6NZPVBV.js";import"./chunk-R7SF7HVM.js";import{b as yr}from"./chunk-Z4ZHT2DE.js";import{a as bt,b as Ht,c as Gt}from"./chunk-BUP3F3S5.js";import{a as Jn}from"./chunk-LW4YXLL2.js";import"./chunk-B3EQHX7N.js";import"./chunk-P3KIIKY4.js";import"./chunk-FEJLGG7W.js";import{a as nt}from"./chunk-N4KD7EQC.js";import{a as Dr}from"./chunk-7FQSGPHL.js";import"./chunk-BYXBJQAS.js";import{a as vo}from"./chunk-I3WLM5Y4.js";import{a as pr,f as mr,j as ei,m as gr}from"./chunk-2D2XT3PV.js";import{a as yo}from"./chunk-S77FVPQM.js";import"./chunk-ZZ2RLD3G.js";import"./chunk-Z3E24JZW.js";import"./chunk-5UDUWK67.js";import{c as ho}from"./chunk-I3WUTJXX.js";import"./chunk-SKME2EES.js";import{a as ti,b as ur}from"./chunk-VY3BX3QS.js";import{a as St}from"./chunk-DDLXGCOB.js";import{a as ni}from"./chunk-7QWL5TKZ.js";import"./chunk-TSKVGMIC.js";import{a as dr}from"./chunk-N24DKJZX.js";import{b as Yn,c as Qt,d as jt,e as Wt}from"./chunk-E7AVQYKT.js";import{a as fr}from"./chunk-UXF6X367.js";import"./chunk-63VYORHV.js";import"./chunk-ME5A6DKC.js";import"./chunk-5VZWXSVF.js";import"./chunk-B65CLZ4K.js";import"./chunk-EWIZNGPY.js";import"./chunk-CPOQEU6C.js";import"./chunk-S7HPA5O7.js";import"./chunk-G3RF7GBQ.js";import{b as Go}from"./chunk-Z3EH6NKY.js";import"./chunk-RMPCUE2N.js";import{d as ir}from"./chunk-K2BCWJSV.js";import"./chunk-TDI2ZUL6.js";import{c as or,d as rr}from"./chunk-JTZLL5AS.js";import"./chunk-CKHJNQTW.js";import{a as He}from"./chunk-ESWYZY2G.js";import"./chunk-MF3BDWCO.js";import"./chunk-BF42EMHQ.js";import{b as sr,c as cr}from"./chunk-VU5DCR4V.js";import{a as ar,b as lr}from"./chunk-WURU2W3C.js";import"./chunk-UEFG7JV5.js";import"./chunk-ZSK2V6PP.js";import"./chunk-2KEPYDRB.js";import"./chunk-EUIKMR24.js";import"./chunk-7VXCKSAE.js";import{a as Wo,d as qo,f as zo,h as Ho}from"./chunk-3GAEZ6NJ.js";import"./chunk-MOV2FQBP.js";import"./chunk-W4DKC5G3.js";import{a as tr,b as nr}from"./chunk-KIONH5BK.js";import{b as zt,c as ft,d as er}from"./chunk-4LUT5RR3.js";import{r as Zo}from"./chunk-W7I2IWJP.js";import"./chunk-HPCTP4FD.js";import"./chunk-KFWGALIF.js";import{a as Xe,b as Ze}from"./chunk-Z7UCI72M.js";import"./chunk-PPMQE2JW.js";import{F as Xo,N as gt,a as $o,b as Ko,u as Jo,x as Yo}from"./chunk-7OCVKGLK.js";import{a as Lt}from"./chunk-5O5ADSGP.js";import"./chunk-OKQYRKDJ.js";import"./chunk-XCPZOGRM.js";import{d as et,e as Zn}from"./chunk-ULWLSYED.js";import"./chunk-DU6XSMWH.js";import{b as De}from"./chunk-YLGNXQKM.js";import{a as ie,b as qt,c as Te,h as Xn}from"./chunk-LCBHD53Y.js";import"./chunk-IKV23X6H.js";import"./chunk-C6TJ57ES.js";import"./chunk-RJDDPGUV.js";import{a as B,b as _t}from"./chunk-VUC4E73K.js";import"./chunk-OTSIIVCA.js";import{a as Z}from"./chunk-DUAKLYOO.js";import"./chunk-QSBTT5BF.js";import"./chunk-IX2NXO5F.js";import"./chunk-ZRB4EZI3.js";import{a as Be,b as se,c as oe}from"./chunk-KXQJYBG5.js";import"./chunk-3MLD6BQG.js";import"./chunk-LUUIBDJG.js";import"./chunk-R7VXUOCU.js";import"./chunk-NYN3E7NN.js";import{E as z,F as Ut,b as Hn,c as ne,e as Gn,h as ee,l as lt,o as te,r as $n,s as Kn,z as Uo}from"./chunk-R36OIJC7.js";import{a as Lo,c as jo}from"./chunk-6IHVAHOJ.js";import{a as Qo}from"./chunk-W2K27MND.js";import"./chunk-AGPZGAMV.js";import{b as ke}from"./chunk-K74WZXBF.js";import{a as P}from"./chunk-PPTZHIIZ.js";import{a as zn}from"./chunk-QWQ7KY5S.js";import{n as W,q as J}from"./chunk-ETYXTCKV.js";import{$ as kt,$a as Vn,Ab as Ve,Ac as pn,B as le,Ba as y,Bb as Y,Cb as X,D as Se,Da as ct,Db as f,Eb as a,Fb as l,Fc as O,Gb as h,Gc as R,H as Ue,Hb as ge,Hc as Pe,Ib as be,Ic as we,Jb as dt,Kb as Nt,Lb as Rt,Lc as Vt,M as yt,Mb as Fn,Na as Et,Oc as u,Pa as Oe,Pb as E,Pd as Bo,Qd as qn,Sa as An,Sb as v,Sc as Ro,Sd as Bt,Tb as pt,Tc as Fe,Ua as s,Ub as p,X as wo,Yb as Bn,Zb as Ln,_ as ko,_b as Un,bb as qe,cc as at,d as Mo,da as M,db as N,dc as To,ec as ze,gc as de,gd as Ao,hc as d,i as Ge,ic as F,id as pe,ja as w,jb as Qe,jc as k,kc as xe,l as wt,lc as Eo,m as Oo,mc as U,md as jn,na as c,nc as Q,nd as Vo,oc as j,od as Ft,pc as dn,qc as Qn,qd as ut,r as _e,ra as _,rc as At,s as Io,sa as S,sb as bo,sc as Co,sd as K,tc as No,ud as Wn,vd as q,wb as b,wc as mt,xa as Tt,xc as Je,ya as st,yb as C,yc as $,yd as Fo,zb as Ee,zc as Ye}from"./chunk-DUSKF5IQ.js";import{a as V,b as ue,j as Do}from"./chunk-NF7PG5F2.js";var ui=class{UserName;UserID;SalesID;CustomerOptions;ServerTime;AppConfigJSON;Denomination;Entities;Registers;Payments;PaymentTypes;Currencies;PoTypes;Taxes;BINS;ServerDateString;ServicesLogistics;WhatsAppConfigJSON;StylesSheet;UserGroupConfig};var it=class{ID;EntityID;RegisterID;TypeID;Date;Number;CustomerID;SalesID;Discount=0;Discount2=0;DiscountAmount=0;CustomerDiscountRate=0;Note="";DeliveryOutletID;TaxTypeID;CurrencyID;CurrencyRate;PointUsed;InvoicedStateID;ReferenceNumber="";LogisticsServiceID;ParkLabel="";NumberOfPerson;ClientTimestamp;Created;PromotionCoupon="";CouponType=1;PromotionNote="";DeliveryStateID;CouponProvider="Internal";CurrencySymbol;constructor(){this.ID=P.GuidEmpty,this.EntityID=P.GuidEmpty,this.RegisterID=P.GuidEmpty,this.Number="",this.CustomerID=null,this.SalesID=null,this.Discount=0,this.Discount2=0,this.DiscountAmount=0,this.Note="",this.TaxTypeID=P.GuidEmpty,this.CurrencyID=1,this.CurrencyRate=1,this.DeliveryStateID=3,this.PointUsed=0,this.NumberOfPerson=1,this.Date=new Date}removeEnterNote(){this.Note&&(this.Note=this.Note.replace(/\n/g,""))}};var je=class{ID;Number;Due;Date;CustomDateField;TimeCustom;SurchargePcg;TempSurchargePcg;ToP;Note;ReferenceInvoiceID;PaymentStateID;Sales;DateCustom;constructor(){this.ID=P.GuidEmpty,this.SurchargePcg=0,this.TempSurchargePcg=0,this.Due=null}};var Pt=class{Prefix;Seed;Digit;constructor(){this.Prefix=null,this.Seed=null,this.Digit=null}static Generate(e){let t="";if(e.Seed){let n=e.Seed+"";for(;n.length<e.Digit;)n="0"+n;t=P.StringFormat(e.Prefix,n)}return t}};var fi=class{RegisterID;RegisterCode;EntityID;EntityName;NumberElement;InvoiceNumberElement;ListSales;QuickKeyPack;PrintTemplate;DefaultSalesOrderTag;DefaultTaxType;DefaultWarehouse;MemberPoint;ParkLayoutPack;Promotion;DefaultPrintTemplate;NewOrderID;Payments;SplitPaymentEnabled;constructor(){this.RegisterID=null,this.RegisterCode=null,this.EntityID=null,this.EntityName=null,this.NumberElement=new Pt,this.InvoiceNumberElement=new Pt,this.Promotion=[],this.SplitPaymentEnabled=!0}};var ot=class{Name;Phone;Address;City;constructor(){this.Name="",this.Phone="",this.Address="",this.City=""}};var $t=class{DeliveryEntityID;NewOrderID;Type};var x=class i{store=mi({cartItems:[],parkTemporaryItem:[],loadForm:new ui,order:new it,invoice:new je,payments:[],register:new fi,shipping:new ot,promotions:[],state:0,customer:new ti,action:new $t,completeOrder:null});loadForm=this.store.select(e=>Object.freeze(e.loadForm()));register=this.store.select(e=>Object.freeze(e.register()));order=this.store.select(e=>Object.freeze(e.order()));cartItems=this.store.select(e=>Object.freeze(e.cartItems()));parkTemporaryItem=this.store.select(e=>Object.freeze(e.parkTemporaryItem()));payments=this.store.select(e=>Object.freeze(e.payments()));shipping=this.store.select(e=>Object.freeze(e.shipping()));invoice=this.store.select(e=>Object.freeze(e.invoice()));promotions=this.store.select(e=>Object.freeze(e.promotions()));state=this.store.select(e=>Object.freeze(e.state()));customer=this.store.select(e=>Object.freeze(e.customer()));completeOrder=this.store.select(e=>Object.freeze(e.completeOrder()));currency=u(()=>{let e=this.loadForm()?.Currencies,t=this.order()?.CurrencyID,n=e?.find(o=>o.ID===t);return n||e[0]});tax=u(()=>{let e=this.loadForm()?.Taxes,t=this.order()?.TaxTypeID,n=e?.find(o=>o.ID===t);return n||(e&&e.length>0?e[0]:void 0)});SalesOrderTag=u(()=>{let e=this.loadForm()?.PoTypes,t=this.order()?.TypeID,n=e?.find(o=>o.ID===t);return n||(e&&e.length>0?e[0]:void 0)});prepaidPackageItems=u(()=>this.cartItems().filter(t=>t.Variant.TypeID===10));action=this.store.select(e=>Object.freeze(e.action()));updateLoadForm(e){this.store.update("loadForm",e)}updateRegister(e){this.store.update("register",e)}updateOrder(e){this.store.update("order",e)}updateCustomer(e){this.store.update("customer",e)}updateCartItems(e){this.store.update("cartItems",e)}updateParkTemporaryItem(e){this.store.update("parkTemporaryItem",e)}updateInvoice(e){this.store.update("invoice",e)}updatePayments(e){this.store.update("payments",e)}updateShipping(e){this.store.update("shipping",e)}updatePromotions(e){this.store.update("promotions",e)}updateState(e){this.store.update("state",e)}updateAction(e){this.store.update("action",e)}updateCompleteOrder(e){this.store.update("completeOrder",e)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ne=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";static GenerateGopayQrCode="/API/Gopay/GenerateQR";static GopayVerifyPayment="/API/Gopay/VerifyQR";static GenerateBcaQrCode="/API/BCA/GenerateQR";static BcaVerifyPayment="/API/BCA/VerifyQR";static SubmitOrder="/API/POS/SubmitInvoice"};var I=class i{eventBus=new Mo;emit(e){this.eventBus.next(e)}on(e){return this.eventBus.pipe(Se(t=>t.type===e))}ngOnDestroy(){this.eventBus.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac,providedIn:"root"})};var mn=class i{eventBusService=c(I);storeService=c(x);httpService=c(J);constructor(){this.initLoadForm()}initLoadForm(){this.httpService.post(Ne.GetPOSStorage,{}).pipe(B()).subscribe(e=>{this.storeService.updateLoadForm(e),this.eventBusService.emit({type:"[Order] Load Form",payload:{form:e}}),this.initCurrency(e)})}initCurrency(e){let t=e?.AppConfigJSON?.CoreDefaults?.CurrencyID,n=e.Currencies.find(o=>o.ID===t);this.eventBusService.emit({type:"[Order] Update Currency",payload:{currency:n}})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac})};var Ct=class i{odsConfigType=y(0);setODSConfig(e){this.odsConfigType.set(e)}isEnabled(){return this.odsConfigType()>0}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac,providedIn:"root"})};var un=class i{storeService=c(x);toastrService=c(W);httpService=c(J);eventService=c(I);signalRClient=c(Lt);orderDisplayService=c(Ct);selectedRegister=u(()=>this.storeService.register());isOpenDialog$=this.eventService.on("[Order] Load Form").pipe(_e(()=>this.checkOpenDialogRegisters()));constructor(){let e;le(this.eventService.on("[Register] Updated").pipe(Se(t=>!!t.payload?.register),M(t=>{let o=t?.payload?.register?.RegisterID;this.signalRClient.SubscribeGroup(o,e),e=o})),this.eventService.on("[Register] Update Register By ID").pipe(M(t=>{let n=t.payload?.id;this.updateRegisterById(n)})),this.eventService.on("[Order] Update Customer PO Type").pipe(M(t=>{let n=t.payload?.poType;this.updatePrintTemplateByPoType(n)})),this.eventService.on("[Register] Update Register Number").pipe(M(t=>{let n=t.payload?.numberElement;this.updateRegisterStore({NewOrderID:n?.NewOrderID,NumberElement:n?.OrderNumberElement,InvoiceNumberElement:n?.InvoiceNumberElement})})),this.eventService.on("[Register] Update Print Template").pipe(M(t=>{let n=t.payload?.printTemplate;this.updateRegisterStore({PrintTemplate:n})}))).pipe(B()).subscribe()}updatePrintTemplateByPoType(e){let t=this.storeService.register();e.PrintTemplateID==0?this.updateRegisterStore({PrintTemplate:t.DefaultPrintTemplate}):this.getSalesOrderPrint(e.PrintTemplateID).subscribe(n=>{this.updateRegisterStore({PrintTemplate:n.Template})})}updateRegisterById(e){this.getRegisterById(e).subscribe(t=>{this.updateRegisterStore(t),this.loadOdsConfig(t.EntityID),this.eventService.emit({type:"[Order] Generate Number",payload:{element:t.NumberElement}})})}updateRegisterStore(e){let t=this.storeService.register();this.storeService.updateRegister(V(V({},t),e)),this.eventService.emit({type:"[Register] Updated",payload:{register:this.storeService.register()}})}getRegisterById(e){return this.httpService.get(Ne.GetRegisterInfo,[{key:"RegisterID",value:e}])}getSalesOrderPrint(e){return this.httpService.post(Ne.GetSalesOrderPrint,{TemplateID:e})}checkOpenDialogRegisters(){let e=this.storeService.loadForm(),t=e.Registers,n=e.AppConfigJSON?.ModuleShift?.Closure?.Enabled,o=e.UserName;if(t.length>1){let r=t.find(m=>m.LoginID==o);if(r)return this.updateRegisterById(r.ID),!1;{let m=this.selectedRegister()?this.selectedRegister().RegisterID:null;if(P.IsEmpty(m))return!0;if(n)return!0}}else{if(t.length==1)return this.updateRegisterById(t[0].ID),!1;this.toastrService.warning("You do not have access to any OUTLET","Warning")}return!1}loadOdsConfig(e){this.httpService.get(`/api/outlet/GetOrderDisplayBroadcastMode?EntityID=${e}`).pipe(M(t=>{this.orderDisplayService.setODSConfig(t.form?.OrderDisplayBroadcastMode??0)})).subscribe()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac})};var ba=i=>({active:i}),Ca=i=>({gray:i});function va(i,e){if(i&1){let t=E();a(0,"span",16),v("click",function(o){_(t);let r=p().$implicit;return p().onCloseRegister(r),S(o.stopPropagation())}),l()}}function ha(i,e){i&1&&(a(0,"div")(1,"span",17),d(2,"VACANT"),l()())}function ya(i,e){if(i&1&&(a(0,"div")(1,"span",18),h(2,"i",19),a(3,"font"),d(4),l()(),a(5,"span",20),h(6,"i",21),a(7,"font"),d(8),l()()()),i&2){let t=p().$implicit;s(4),F(t.LoginID),s(4),k("",t.StartDisplay.split(" ")[3]," - Now")}}function _a(i,e){if(i&1){let t=E();a(0,"div",9)(1,"div",10)(2,"div",11)(3,"h5",12),v("click",function(){let o=_(t).$implicit,r=p();return S(r.onSelectRegister(o))}),a(4,"span"),h(5,"i",13),d(6),O(7,"limitText"),l(),b(8,va,1,0,"span",14),l(),a(9,"div",15),v("click",function(){let o=_(t).$implicit,r=p();return S(r.onSelectRegister(o))}),b(10,ha,3,0,"div")(11,ya,9,2,"div"),l()()()()}if(i&2){let t,n,o=e.$implicit,r=p();s(),f("ngClass",o.Active?"active":""),s(),f("ngClass",$(9,ba,(o==null?null:o.ID)==((t=r.selectedRegister())==null?null:t.ID))),s(),f("ngClass",$(11,Ca,o!=r.selectedRegister)),s(3),F(Pe(7,6,o.Name,15)),s(2),C(o.State!="Close"?8:-1),s(2),C((n=o.State)==="Close"?10:n==="Open"?11:-1)}}var bi=class i{dialogRef=c(ie);storeService=c(x);router=c(Bo);roleService=c(ke);eventService=c(I);modalConfig=new se;registers=u(()=>this.storeService.loadForm().Registers);appConfig=u(()=>this.storeService.loadForm().AppConfigJSON);selectedRegister=y(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 e=this.storeService.register(),t=this.registers().find(n=>n.ID==e.RegisterID);this.selectedRegister.set(t)}onSelectRegister(e){if(this.appConfig().ModuleShift?.Closure?.Enabled)if(this.selectedRegister().ID!==null&&this.selectedRegister().Open)this.changeCurrentShift(e);else if(!e.Open||this.selectedRegister().ID==e.ID)this.selectedRegister.set(e);else{if(this.roleService.sell.Edit==!1){alert("You cannot end shift for Register "+e.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:e.ID}})}else this.selectedRegister.set(e)}changeCurrentShift(e){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:e.ID}}))}onCloseRegister(e){let t=this.selectedRegister().ID;if(this.roleService?.sell?.Edit==!1){alert("You cannot end shift for Register "+e.Name+" - Unauthorized Access");return}t==e.ID?this.router.navigate(["/menu/Shift/Main/My_Shift"]):this.router.navigate(["/menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:e.ID}}),this.onClose()}onOk(){if(this.selectedRegister().ID==null){alert("Please select a register first!");return}this.eventService.emit({type:"[Register] Update Register By ID",payload:{id:this.selectedRegister().ID}}),this.dialogRef.close(!0)}onClose(){this.dialogRef.close(!1)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=N({type:i,selectors:[["app-dialog-select-register"]],decls:13,vars:6,consts:[["searchInputRef",""],[3,"onOk","onCancel","onClose","config"],[1,"ms-0","mb-8","search-container",3,"hidden"],[1,"input-group","mb-3","rounded-start-1"],[1,"input-group-text","txtFilter","rounded-end-0"],["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","rounded-1","rounded-start-0",3,"ngModelChange","ngModel"],[1,"container","custom-scroll"],[1,"row",2,"width","600px"],["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"],[1,"fa","fa-xmark-circle","fa-lg","position-absolute",2,"text-shadow","0 1px 0 #afafaf","right","5px","top","16px"],[1,"card-text","px-0","py-2",3,"click"],[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(t,n){if(t&1){let o=E();a(0,"modal-material",1),v("onOk",function(){return n.onOk()})("onCancel",function(){return n.onClose()})("onClose",function(){return n.onClose()}),a(1,"content")(2,"div",2)(3,"div",3)(4,"span",4),h(5,"i",5),l(),a(6,"input",6,0),j("ngModelChange",function(m){return _(o),Q(n.searchInput,m)||(n.searchInput=m),S(m)}),l()()(),a(8,"div",7)(9,"div",8),Y(10,_a,12,13,"div",9,Ve),O(12,"filterByName"),l()()()()}if(t&2){let o;f("config",n.modalConfig),s(2),f("hidden",((o=n.registers())==null?null:o.length)<=6),s(4),U("ngModel",n.searchInput),s(4),X(Pe(12,3,n.registers(),n.searchInput))}},dependencies:[q,pe,oe,z,ne,ee,te,qr,Jn],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}.search-container[_ngcontent-%COMP%]{transition:all .3s ease;width:97%}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{position:relative;transition:all .3s ease;height:2.3rem}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover, .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e4d,0 0 8px 4px #89b03e33;border-radius:4px}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]{transition:all .3s ease;border-left:none!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]:focus{box-shadow:none!important;border-color:#ced4da!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .input-group-text[_ngcontent-%COMP%]{transition:all .3s ease;background-color:#fff;border-right:none!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .input-group-text[_ngcontent-%COMP%], .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .input-group-text[_ngcontent-%COMP%]{background-color:#89b03e1a;border-color:#84cc16!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .fa-magnifying-glass[_ngcontent-%COMP%]{transition:all .3s ease}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .fa-magnifying-glass[_ngcontent-%COMP%], .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .fa-magnifying-glass[_ngcontent-%COMP%]{color:#84cc16!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e66,0 0 12px 6px #89b03e40!important}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#f1f1f1;border-radius:3px}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#89b03e;border-radius:3px}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#7a9e37}.container[_ngcontent-%COMP%]{overflow-y:auto;overflow-x:hidden;max-height:260px;min-height:150px}.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 Ci=class i{constructor(e){this.viewContainerRef=e;ct(()=>{this.isOpenModalSelectRegister()&&this.openModalSelectRegister()})}viewContainerRef;register=Fe();isOpenModalSelectRegister=Fe();dialog=c(Te);openModalSelectRegister(){this.dialog.open(bi,{id:"registerModal",viewContainerRef:this.viewContainerRef})}static \u0275fac=function(t){return new(t||i)(Vn(qe))};static \u0275cmp=N({type:i,selectors:[["pos-select-register"]],inputs:{register:[1,"register"],isOpenModalSelectRegister:[1,"isOpenModalSelectRegister"]},decls:5,vars:5,consts:[["matTooltipPosition","above",1,"outlet-container","d-flex","pointer",3,"click","matTooltip"],[1,"fa-solid","fa-location-dot"],[1,"mb-0"]],template:function(t,n){if(t&1&&(a(0,"div",0),v("click",function(){return n.openModalSelectRegister()}),h(1,"i",1),a(2,"h3",2),d(3),O(4,"limitText"),l()()),t&2){let o,r;f("matTooltip",(o=n.register())==null?null:o.EntityName),s(3),k(" ",(r=n.register())!=null&&r.EntityName?Pe(4,2,(r=n.register())==null?null:r.EntityName,25):"Choose an Outlet"," ")}},dependencies:[Ze,Xe,Jn],styles:[".outlet-container[_ngcontent-%COMP%] .fa-location-dot[_ngcontent-%COMP%]{color:#fb404b!important;font-size:32px}"]})};var rt=(L=>(L[L.IsNew=0]="IsNew",L[L.IsComplete=1]="IsComplete",L[L.IsEdit=2]="IsEdit",L[L.isPark=3]="isPark",L[L.IsRetrieve=4]="IsRetrieve",L[L.IsSplit=5]="IsSplit",L[L.IsBill=6]="IsBill",L[L.IsReturn=7]="IsReturn",L[L.IsUndo=8]="IsUndo",L[L.UploadOrderFail=9]="UploadOrderFail",L))(rt||{});var gn=class i{httpService=c(J);eventService=c(I);storeService=c(x);constructor(){this.initializeEventHandlers()}initializeEventHandlers(){le(this.eventService.on("[Order] Generate Number").pipe(M(e=>{let t=e.payload?.element,n=pr.Generate(t);this.updateOrder({Number:n})})),this.eventService.on("[Customer] Added").pipe(M(e=>{let t=e.payload?.customer.ID;this.updateOrder({CustomerID:t})})),this.eventService.on("[Customer] Removed").pipe(M(e=>{this.updateOrder({CustomerID:null})})),this.eventService.on("[Order] Update Date").pipe(M(e=>{let t=e.payload?.date;this.updateOrder({Date:t})})),this.eventService.on("[Order] Update Sales Person").pipe(M(e=>{let t=e.payload?.id;this.updateOrder({SalesID:t})})),this.eventService.on("[Order] Update Note").pipe(M(e=>{let t=e.payload?.note;this.updateOrder({Note:t})})),this.eventService.on("[Order] Update Reference Number").pipe(M(e=>{let t=e.payload?.number;this.updateOrder({ReferenceNumber:t})})),this.eventService.on("[Order] Update Currency").pipe(M(e=>{let t=e.payload?.currency;this.updateOrder({CurrencyID:t?.ID,CurrencySymbol:t?.Symbol,CurrencyRate:t?.ExchangeRate})})),this.eventService.on("[Order] Update Customer PO Type").pipe(M(e=>{let t=e.payload?.poType;this.updateOrder({TypeID:t?.ID})})),this.eventService.on("[Order] Update Logistic Service").pipe(M(e=>{let t=e.payload?.id;this.updateOrder({LogisticsServiceID:t})})),this.eventService.on("[Order] Update Number Person").pipe(M(e=>{let t=e.payload?.total;this.updateOrder({NumberOfPerson:t})})),this.eventService.on("[Order] Update Discount Percentage 1").pipe(M(e=>{let t=e.payload?.discount;this.updateOrder({Discount:t})})),this.eventService.on("[Order] Update Discount Percentage 2").pipe(M(e=>{let t=e.payload?.discount;this.updateOrder({Discount2:t})})),this.eventService.on("[Order] Update Discount Amount").pipe(M(e=>{let t=e.payload?.discountAmount;this.updateOrder({DiscountAmount:t})})),this.eventService.on("[Order] Update Tax").pipe(M(e=>{let t=e.payload?.tax;this.updateOrder({TaxTypeID:t?.ID})})),this.eventService.on("[Order] Update Delivery State ID").pipe(M(e=>{let t=e.payload?.deliveryOutletId,n=e.payload?.deliveryState;this.updateOrder({DeliveryOutletID:t,DeliveryStateID:n})})),this.eventService.on("[Register] Updated").pipe(Se(e=>!!e.payload?.register),M(e=>{let t=e.payload?.register;this.initOrderRegister(t),this.initOrderTax(t)})),this.eventService.on("[Order] Complete Order").pipe(M(e=>{this.storeService.updateState(1),this.storeService.updateCompleteOrder(e.payload?.submitOrderHttpResponse||null)}))).pipe(B()).subscribe()}initOrderRegister(e){this.updateOrder({RegisterID:e?.RegisterID,EntityID:e?.EntityID})}initOrderTax(e){let t=e?.DefaultTaxType,n=this.storeService.loadForm().Taxes;if(P.IsNotEmpty(t)){let o=this.getTaxById(t);P.IsNotEmpty(o)?this.updateOrder({TaxTypeID:o?.ID}):(o=n[0],this.updateOrder({TaxTypeID:o.ID}))}else{let o=n[0];this.updateOrder({TaxTypeID:o.ID})}}getTaxById(e){return(this.storeService.loadForm()?.Taxes).find(o=>o.ID===e)}updateOrder(e){let t=this.storeService.order();this.storeService.updateOrder(V(V({},t),e))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac,providedIn:"root"})};var xt=class i{eventService=c(I);httpService=c(J);storeService=c(x);role=c(ke);isEnabledLoyaltyPoint=u(()=>{let t=this.storeService.loadForm().AppConfigJSON?.ApplicationLoyalty?.Enabled,n=this.storeService.register()?.MemberPoint,o=this.storeService.customer();return!!(t&&n&&o?.Point>0)});isShowDebt=u(()=>{let e=this.storeService.customer(),t=this.role.debt?.View;return e?.Debt>0&&t});constructor(){this.initEventHandlers()}initEventHandlers(){le(this.eventService.on("[Customer] Add By Id").pipe(kt(e=>this.addCustomerById$(e.payload))),this.eventService.on("[Customer] Add By Code").pipe(kt(e=>this.addCustomerByCode$(e.payload.code))),this.eventService.on("[Customer] Remove").pipe(M(()=>{this.deleteCustomer()}))).pipe(B()).subscribe()}addCustomerById$(e){let t=this.storeService.register()?.EntityID;return this.httpService.get(Ne.GetCustomerPrivilegeByID,[{key:"ID",value:e.id},{key:"EntityID",value:t}]).pipe(M(n=>{n.ID=e.id,n.Name=e.name;let o=this.storeService.loadForm()?.AppConfigJSON;n.Label=o?.ApplicationLoyalty?.Label,n.DebtCalculated=n.Debt,this.storeService.updateCustomer(n),this.eventService.emit({type:"[Customer] Added",payload:{customer:n}})}),Ue(n=>Ge))}addCustomerByCode$(e){return this.httpService.post(Ne.GetCustomerByCode,{Code:e}).pipe(kt(t=>this.addCustomerById$({id:t.ID,name:t.Name})),Ue(t=>Ge))}deleteCustomer(){let e=new ti;this.storeService.updateCustomer(e),this.eventService.emit({type:"[Customer] Removed",payload:null})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac})};var Kr=i=>({"quickkey-subscription-overdue":i}),Jr=()=>["/menu/Outlets/Master/Quick_Key_Templates/Form"],Pa=i=>({ID:i}),xa=i=>({OutletID:i});function Da(i,e){if(i&1&&(a(0,"div",14)(1,"div",15),h(2,"img",16),l()()),i&2){let t=p().$implicit;s(2),f("ngSrc",t.ImageURLClient)}}function Ma(i,e){if(i&1&&(a(0,"div",15)(1,"p",17)(2,"span"),d(3),O(4,"slice"),l()()()),i&2){let t=p().$implicit;s(3),F(we(4,1,t.Display,0,3))}}function Oa(i,e){if(i&1&&(a(0,"small",18),d(1),O(2,"number"),l()),i&2){let t=p(2).$implicit;s(),F(R(2,1,t.Children[0]==null?null:t.Children[0].UnitPrice))}}function Ia(i,e){if(i&1&&(a(0,"small",19),d(1),O(2,"lowestPrice"),O(3,"number"),O(4,"highestPrice"),O(5,"number"),l()),i&2){let t=p(2).$implicit;s(),xe("",R(3,4,R(2,2,t==null?null:t.Children))," - ",R(5,8,R(4,6,t==null?null:t.Children)))}}function wa(i,e){if(i&1&&b(0,Oa,3,3,"small",18)(1,Ia,6,10,"small",19),i&2){let t=p().$implicit;C(t.Children.length==1?0:1)}}function ka(i,e){if(i&1){let t=E();a(0,"div",12)(1,"a",13),v("click",function(){let o=_(t).$implicit,r=p(4);return S(r.onSelectProduct(o))}),b(2,Da,3,1,"div",14)(3,Ma,5,5,"div",15),a(4,"small"),d(5),O(6,"slice"),l(),b(7,wa,2,1),l()()}if(i&2){let t=e.$implicit,n=p(4);de(n.column()),s(2),C(t.ImageURLClient?2:3),s(3),F(we(6,5,t.Display,0,36)),s(2),C(n.priceVisible()?7:-1)}}function Ta(i,e){if(i&1&&(a(0,"mat-tab",5)(1,"div",6)(2,"div",7),Y(3,ka,8,9,"div",8,Ee),a(5,"div",9)(6,"a",10),h(7,"i",11),l()()()()()),i&2){let t,n=e.$implicit,o=p(3);f("label",n.Name),s(3),X(n.Items),s(2),de(o.column()),s(),f("routerLink",Je(5,Jr))("queryParams",$(6,Pa,(t=o.quickKey())==null?null:t.ID))}}function Ea(i,e){if(i&1&&(a(0,"mat-tab-group",4),Y(1,Ta,8,8,"mat-tab",5,Ee),l()),i&2){let t,n=p(2);f("disableRipple",!0),s(),X((t=n.quickKey())==null?null:t.Groups)}}function Na(i,e){if(i&1&&(a(0,"div",14)(1,"div",15),h(2,"img",25),l()()),i&2){let t=p().$implicit;s(2),f("src",t.ImageURLClient,Oe)}}function Ra(i,e){if(i&1&&(a(0,"div",15)(1,"p",17)(2,"span"),d(3),O(4,"slice"),l()()()),i&2){let t=p().$implicit;s(3),F(we(4,1,t.Model,0,3))}}function Aa(i,e){if(i&1&&(a(0,"small",18),d(1),O(2,"number"),l()),i&2){let t=p().$implicit;s(),F(R(2,1,t.UnitPrice))}}function Va(i,e){if(i&1){let t=E();a(0,"div",12)(1,"a",13),v("click",function(){let o=_(t).$implicit,r=p(3);return S(r.emitSelectedVariant(o.ID))}),b(2,Na,3,1,"div",14)(3,Ra,5,5,"div",15),a(4,"small"),d(5),O(6,"slice"),l(),b(7,Aa,3,3,"small",18),l()()}if(i&2){let t=e.$implicit,n=p(3);de(n.column()),s(2),C(t.ImageURLClient?2:3),s(3),F(we(6,5,t.Model,0,30)),s(2),C(n.priceVisible()?7:-1)}}function Fa(i,e){if(i&1){let t=E();a(0,"div",20)(1,"div",21),v("click",function(){_(t);let o=p(2);return S(o.onChangeQuickeyState("QUICKEY"))}),h(2,"i",22),l(),a(3,"div",23)(4,"b"),d(5),l()()(),a(6,"div",6)(7,"div",24),Y(8,Va,8,9,"div",8,Ve),l()()}if(i&2){let t,n=p(2);s(5),k(" ",n.subQuickKey().Display),s(3),X((t=n.subQuickKey())==null?null:t.Children)}}function Ba(i,e){if(i&1&&b(0,Ea,3,1,"mat-tab-group",4)(1,Fa,10,1),i&2){let t=p();C(t.quickeyState()=="QUICKEY"?0:1)}}function La(i,e){if(i&1&&(a(0,"div",3)(1,"a",26)(2,"strong"),d(3,"QUICK KEYS UNCONFIGURED"),l(),h(4,"i",27),a(5,"span"),d(6,"Click here to setup your Quick keys"),l()()()),i&2){let t=p();f("ngClass",$(3,Kr,t.currentSubsStatus()==t.subscriptionStatus.OVERDUE||t.currentSubsStatus()==t.subscriptionStatus.SELL_ONLY)),s(),f("routerLink",Je(5,Jr))("queryParams",$(6,xa,t.outletId()))}}var hi=class i{authService=c(jo);quickKey=Fe();quickKeyTotalRow=Fe();priceVisible=Fe();outletId=Fe();quickeyState=y("QUICKEY");column=y("col-3");subQuickKey=y({Display:null,Children:[]});subscriptionStatus=Lo;currentSubsStatus=y(0);onSelectVariant=new st;constructor(){ct(()=>{let e=`col-${12/(this.quickKeyTotalRow()?this.quickKeyTotalRow():3)}`;this.column.set(e)},{allowSignalWrites:!0}),this.currentSubsStatus.set(this.authService.getSubscriptionStatus())}onSelectProduct(e){e.Children?e.Children.length==0?this.emitSelectedVariant(e.ItemID):e.Children.length==1?this.emitSelectedVariant(e.Children[0]?.ID):(this.onChangeQuickeyState("SUBQUICKEY"),this.subQuickKey.update(()=>({Display:e.Display,Children:e.Children}))):(this.onChangeQuickeyState("SUBQUICKEY"),this.subQuickKey.update(()=>({Display:e.Display,Children:e.Children})))}emitSelectedVariant(e){this.onSelectVariant.emit(e)}onChangeQuickeyState(e){this.quickeyState.set(e)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=N({type:i,selectors:[["quick-keys"]],inputs:{quickKey:[1,"quickKey"],quickKeyTotalRow:[1,"quickKeyTotalRow"],priceVisible:[1,"priceVisible"],outletId:[1,"outletId"]},outputs:{onSelectVariant:"onSelectVariant"},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"],[1,"full-screen-image",3,"src"],["id","LinkConfigureQuickkey","target","_blank",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-regular","fa-hand-pointer"]],template:function(t,n){if(t&1&&(a(0,"div",0)(1,"div",1)(2,"section",2),b(3,Ba,2,1)(4,La,7,8,"div",3),l()()()),t&2){let o;s(2),f("ngClass",$(2,Kr,n.currentSubsStatus()==n.subscriptionStatus.OVERDUE||n.currentSubsStatus()==n.subscriptionStatus.SELL_ONLY)),s(),C((o=n.quickKey())!=null&&o.Groups&&((o=n.quickKey())==null||o.Groups==null?null:o.Groups.length)>0?3:4)}},dependencies:[q,pe,Bt,qn,Wt,Qt,jt,Fo,gt,Wn,K,$o,Ko],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-body-content{overflow-x:hidden} .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(https://cdn.dealpos.xyz/web-image/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 he=class{ID;VariantID;Quantity;Cost;Price;Expense;UnitPriceOriginal;Discount;DiscountAmount;Index;CouponDiscount;Note;Taxable;LoyaltyPoint;EntityID;UnitQuantity;VariantUnitQuantity;UnitQuantityPrice;PriceTypeID;PriceNote;Splited;InventoryTypeID;TypeID;Variant=new vo;EntityName;SalesID;SalesName;PriceBookID;Serial;UnitExpense;UnitCost;UnitPrice;Checked;SplitQuantity;PurchaseOrderID;isMaxInventory;SerialSource;AvailableInventory;PromotionGift;CopyPromotionName;SalesCommission;constructor(e){e&&(this.ID=e.ID||"",this.VariantID=e.VariantID||"",this.AvailableInventory=e.AvailableInventory||0,this.Cost=e.Cost||0,this.Price=e.Price||0,this.Expense=e.Expense||0,this.UnitPriceOriginal=e.UnitPriceOriginal||0,this.Discount=e.Discount||0,this.DiscountAmount=e.DiscountAmount||0,this.Quantity=e.Quantity||0,this.UnitQuantity=e.UnitQuantity||0,this.VariantUnitQuantity=e.VariantUnitQuantity||0,this.UnitQuantityPrice=e.UnitQuantityPrice||0,this.PriceTypeID=e.PriceTypeID||0,this.Note=e.Note||"",this.PriceNote=e.PriceNote||"",this.Taxable=e.Taxable||!1,this.LoyaltyPoint=e.LoyaltyPoint||!1,this.InventoryTypeID=e.InventoryTypeID||1,this.TypeID=e.TypeID||0,this.Variant=e.Variant||new vo,this.EntityID=e.EntityID||"",this.EntityName=e.EntityName||"",this.SalesID=e.SalesID||"",this.SalesName=e.SalesName||"",this.PriceBookID=e.PriceBookID||"",this.Serial=e.Serial||[],this.UnitExpense=e.UnitExpense||0,this.UnitCost=e.Variant?.UnitCost||0,this.UnitPrice=e.Variant?.UnitPrice||0,this.PurchaseOrderID=e.PurchaseOrderID||"",this.SerialSource=e.SerialSource||[],this.PromotionGift=e.PromotionGift||!1,this.CopyPromotionName=e.CopyPromotionName||!1,this.SalesCommission=e.SalesCommission||0)}get Total(){let e=this.GrossTotal-this.DiscountPercentAmount;this.validateDiscountAmount(e);let t=this.DiscountAmount*this.Quantity;return e-t}validateDiscountAmount(e){let t=this.Quantity%1===0;e>0&&this.DiscountAmount>e&&t&&(this.DiscountAmount=e)}get GrossTotal(){let e=this.Price*(this.Quantity*this.UnitQuantity);return e||0}get DiscountPercentAmount(){return this.Discount?this.GrossTotal*this.Discount/100:0}get getItemAfterDiscount(){let e=this.getDiscPercentagePerItem();return this.DiscountAmount<e?e-this.DiscountAmount:0}getDiscPercentagePerItem(){let e=this.Price;return this.Discount>0&&(e=(100-this.Discount)/100*this.Price),e}getSelectedPricebook(e){if(this.Variant.PriceBook){let t=this.Variant.PriceBook.filter(n=>n.ID==e);if(t.length)return t[0]}return null}get TotalAfterDiscountPerQuantity(){let e=this.DiscountPercentAmount/(this.Quantity*this.UnitQuantity),t=this.DiscountAmount,n=this.Price-e-t;return n||0}};var yi=class{Order;Invoice;Shipping;Action;Payments=[];Items=[]};var fe=class i{storeService=c(x);createCartItemByVariant(e){let t=new he;return t.VariantID=e.ID,t.PriceTypeID=e.PriceTypeID,t.Variant=e,t.UnitQuantity=e.UnitQuantity,t.Quantity=1,e.UnitQuantity>1&&(t.UnitQuantityPrice=e.UnitPrice/e.UnitQuantity),t.Price=e.UnitPrice,t.UnitPrice=e.UnitPrice,t.Cost=e.UnitCost,t.UnitCost=e.UnitCost,t.Expense=e.UnitCost,t.Discount=e.PriceDiscount,t.UnitPriceOriginal=e.UnitPriceOriginal,t.DiscountAmount=0,t.CouponDiscount=0,t.Taxable=e.Taxable,t.InventoryTypeID=e.TypeID,t.LoyaltyPoint=e.LoyaltyPoint,t.VariantUnitQuantity=e.VariantUnitQuantity,t}createSalesOrderSubmission(){let e=new yi;return e.Items=[...this.generateItemsForSubmission()],e.Payments=[...this.storeService.payments()],e.Order=V({},this.storeService.order()),e.Shipping=V({},this.storeService.shipping()),e.Action=V({},this.storeService.action()),e.Invoice=V({},this.storeService.invoice()),e.Order.CustomerID==null&&(e.Order.CustomerID=P.GuidEmpty),e.Order.SalesID==null&&(e.Order.SalesID=P.GuidEmpty),e}generateItemsForSubmission(){let e=JSON.parse(JSON.stringify(this.storeService.cartItems()));return e=e.map(t=>(t.Taxable=t.Variant.Taxable,t.Splited=t.SplitQuantity>0,t.InventoryTypeID=t.Variant.TypeID,t.Variant&&delete t?.Variant,t)),e}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac,providedIn:"root"})};var We=class i{eventBusService=c(I);httpService=c(J);storeService=c(x);factoryService=c(fe);entityID=u(()=>this.storeService.register()?.EntityID);toastrService=c(W);constructor(){this.initializeEventHandlers()}initializeEventHandlers(){le(this.eventBusService.on("[Cart] Add Item By Id").pipe(M(e=>{this.addItemById(e.payload.variantId)})),this.eventBusService.on("[Cart] Remove Item").pipe(M(e=>{this.removeItem(e.payload.index)})),this.eventBusService.on("[Cart] Update Item").pipe(M(e=>{this.onUpdateItem(e.payload.index,e.payload.item)})),this.eventBusService.on("[Cart] Reverse Item").pipe(M(e=>{this.reverseItem(e.payload.index,e.payload.isReturn)})),this.eventBusService.on("[Cart] Clear Items").pipe(M(()=>{this.clearCartItems()})),this.eventBusService.on("[Cart] Check Items Inventory").pipe(M(()=>{this.checkItemsInventory()}))).pipe(B()).subscribe()}checkItemsInventory(){let e=this.storeService.cartItems(),t=this.storeService.register()?.EntityID,n=e.map(r=>r.VariantID),o={Outlet:t,Cart:n};this.httpService.post(Z.ValidateInventory,o).subscribe(r=>{this.setAvailableInventory(r)})}setAvailableInventory(e){let t=[...this.storeService.cartItems()],n=0;t=t.map(o=>{let r=e.findIndex(m=>m.VariantID==o.VariantID);return r!==-1&&(o.AvailableInventory=e[r].OnHand,(o.Variant?.TypeID<9||o.Variant?.TypeID==12)&&(n+=o.Quantity>o.AvailableInventory?1:0)),o}),this.showToastrValidateInventory(n),this.storeService.updateCartItems([...t])}showToastrValidateInventory(e){e>0?this.toastrService.error(`There are ${e} products in the cart dont have sufficient stock available`,"Validate Inventory"):this.toastrService.info("All products in the cart have sufficient stock available","Validate Inventory")}clearCartItems(){this.storeService.updateCartItems([])}addItemById(e){this.httpService.get(Z.GetVariantByID,[{key:"ID",value:e},{key:"EntityID",value:this.entityID()}]).pipe(_e(t=>this.factoryService.createCartItemByVariant(t))).subscribe(t=>{this.onAddItem(t)})}removeItem(e){let n=this.storeService.cartItems().filter((o,r)=>r!==e);this.storeService.updateCartItems(n)}reverseItem(e,t){let n=[...this.storeService.cartItems()],o=n[e];o&&((t&&o.Quantity>0||!t&&o.Quantity<0)&&(o.Quantity=o.Quantity*-1),this.storeService.updateCartItems(n))}onAddItem(e,t=!1){let n=this.storeService.cartItems();if(!n.find(r=>r.VariantID===e.VariantID)||t||n.length===0)this.storeService.updateCartItems([...n,e]);else{let r=n.map(m=>(m.VariantID==e.VariantID&&(m.Quantity+=e.Quantity),m));this.storeService.updateCartItems(r)}}onUpdateItem(e,t){let n=[...this.storeService.cartItems()];n[e]=t,this.storeService.updateCartItems([...n])}applyPriceBook(e){let t=e.Variant.PriceBook!=null?e.Variant.PriceBook:[],n=this.findCustomerPricebook(t);if(t&&t.length!==0){let o=t.sort(function(r,m){return m.MinimumQuantity-r.MinimumQuantity}).filter(r=>e.Quantity>=r.MinimumQuantity&&r.MinimumQuantity!=0);o.length>0||P.IsNotEmpty(n)?P.IsNotEmpty(n)?e=this.applyPricebookToItem(e,n):e=this.applyPricebookToItem(e,o[0]):e=this.resetAppliedPricebook(e)}return e}resetAppliedPricebook(e){let n=(e?.Variant?.PriceBook).find(o=>o.ID==e.PriceBookID);return P.IsNotEmpty(n)&&(e.Discount=e.Variant.PriceDiscount,e.PriceBookID=P.GuidEmpty,e.Price=e.Variant.UnitPrice,e.UnitPrice=e.Variant.UnitPrice,e.PriceTypeID=0,e=this.applyPromotionProduct(e),e=this.removePromotionNote(e)),e}applyPromotionProduct(e){let t=e.Variant.DiscountAmount;return t&&(e.Price=e.UnitPriceOriginal-t),e}removePromotionNote(e){let t=this.storeService.loadForm().AppConfigJSON;if(t?.ModuleSell?.Pricebook?.PricebookVisible&&(e.Note=e.Note?.replace(e.PriceNote,""),e.PriceNote=""),t?.ModuleSell?.ProductNotes?.CopyPromotionName){let o=e.Variant?.PriceNote;e.Note=`${o||""} ${e.Note?e.Note:""}`,e.PriceNote=o}return e}applyPricebookToItem(e,t){return e.Discount=t.PriceDiscount,e.UnitPrice=t.UnitPrice,e.PriceBookID=t.ID,e.Price=t.UnitPrice,e.PriceTypeID=2,e=this.assignItemNote(e,t),e}assignItemNote(e,t){return this.storeService.loadForm().AppConfigJSON?.ModuleSell?.Pricebook?.PricebookVisible?(e.Note?.includes(e.PriceNote)?e.Note=e.Note?.replace(e.PriceNote,t.Name):e.Note=`${t.Name} ${e.Note?e.Note:""}`,e.PriceNote=t.Name):(e.Note="",e.PriceNote=""),e}findCustomerPricebook(e=[]){let t=this.storeService.customer(),n=null;return t&&(n=e.find(o=>o.ID==t.PricebookID)??null),n}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac})};var fn=class i{storeService=c(x);httpService=c(J);factoryService=c(fe);eventService=c(I);shoppingCartService=c(We);toastr=c(W);config=u(()=>this.storeService.loadForm().AppConfigJSON);entityID=u(()=>this.storeService.register()?.EntityID);constructor(){this.initEventHandlers()}initEventHandlers(){this.eventService.on("[Cart] Add Item By Code").pipe(B()).subscribe(e=>{this.AddItemByCode(e.payload.code)})}AddItemByCode(e){let t=this.config()?.ModuleSell?.DigitalScale;t.Digit>0&&P.IsNotEmpty(t.Regex)&&e.length==t.Digit?this.findByDigitalScale(e):this.findVariantByCode(e)}findByDigitalScale(e){let t=this.readDigitalScale(e);P.IsNotEmpty(t.code)?this.findVariantByCode(t.code,t.quantity):(this.toastr.info("Matching Regex Rule to Barcode","Digital Scale"),this.findVariantByCode(e))}readDigitalScale(e){let t={code:null,quantity:1},n=this.config()?.ModuleSell?.DigitalScale,o=new RegExp(n.Regex),r=e.match(o);if(r[1]){let m=r[1],g=parseFloat(r[2]);g=g/n.QuantityDivider,t.code=m,t.quantity=g}return t}findVariantByCode(e,t=1){this.httpService.get(Z.GetVariantByCode,[{key:"Code",value:e},{key:"EntityID",value:this.entityID()}]).pipe(_e(n=>{let o=this.factoryService.createCartItemByVariant(n);return o.Quantity=t,o})).subscribe(n=>{this.shoppingCartService.onAddItem(n)})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac})};var bn=class i{httpService=c(J);storeService=c(x);factoryService=c(fe);shoppingCartService=c(We);eventBusService=c(I);entityID=u(()=>this.storeService.register()?.EntityID);constructor(){this.eventBusService.on("[Cart] Add Item By Serial").pipe(B()).subscribe(e=>this.addItemBySerial(e.payload.serial))}addItemBySerial(e){this.httpService.get(Z.GetVariantBySerial,[{key:"Serial",value:e},{key:"EntityID",value:this.entityID()}]).subscribe(t=>{let n=this.storeService.cartItems();if(n.length>0){let o=n.findIndex(r=>r.VariantID===t.ID);if(o!==-1){let r=n[o].Serial?[...n[o].Serial]:[],m=r.findIndex(D=>D.Number===e);m===-1?r.push({Number:e,Quantity:1,ExpiryDate:""}):r[m].Quantity+=1;let g=Object.assign(new he,n[o]);g.Serial=[...r],g.Quantity=r.reduce((D,A)=>D+A.Quantity,0),this.shoppingCartService.onUpdateItem(o,g)}else this.addNewSerials(t,e)}else this.addNewSerials(t,e)})}addNewSerials(e,t){let n=this.factoryService.createCartItemByVariant(e);n.Serial=[{Number:t,Quantity:1,ExpiryDate:""}],n.Quantity=1,this.shoppingCartService.onAddItem(n)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac})};var re=class i{role=c(ke);_return=y(this.role.sell?.Return);_priceMinimum=y(this.role.sell?.PriceMinimum);_unitPriceEditor=y(this.role.sell?.UnitPriceEditor);_salesPerson=y(this.role.sell?.SalesPerson);_discount=y(this.role.sell?.Discount);_costVisible=y(this.role.product?.Cost);_commission=y(this.role.sell?.Commission);_sellEditor=y(this.role.sell?.Edit);_pricebookSelector=y(this.role.sell?.PricebookSelector);_priceVisible=y(this.role.sell?.PriceVisible);_shipping=y(this.role.sell?.Shipping);_retrieve=y(this.role.sell?.RetrieveR);_creditSalesLock=y(this.role.sell?.CreditSalesLock);_print=y(this.role.global?.Print);_date=y(this.role.global?.Date);_numberEditor=y(this.role.sell?.Number);_payment=y(this.role.sell?.Payment);_customerInputLock=y(this.role.sell?.CustomerInputLock);_paymentCodeLock=y(this.role.sell?.PaymentCodeLock);_tax=y(this.role.sell?.Tax);_deleteItem=y(this.role.sell?.DeleteItem);_bundlingPrice=y(this.role.sell?.BundlingPrice);_email=y(this.role.sell?.Email);_parkedDeletion=y(!1);_park=y(this.role.sell?.Park);_couponInputLock=y(this.role.sell?.CouponInputLock);_orderView=y(this.role.order?.View);_reprint=y(this.role.order?.Print);_contactCreate=y(this.role.contact?.Create);_contacts=y(this.role.contact?.View);_inventoryView=y(this.role.inventory?.View);_debtView=y(this.role.debt?.View);_sellDelete=y(this.role.sell?.Delete);_deliveryEditor=y(this.role.logistic?.Edit);_prepaidPackageCreate=y(this.role.prepaidPackage?.Create);return=u(()=>this._return());priceVisible=u(()=>this._priceVisible());unitPriceEditor=u(()=>this._unitPriceEditor());salesPerson=u(()=>this._salesPerson());discount=u(()=>this._discount());costVisible=u(()=>this._costVisible());commission=u(()=>this._commission());sellEditor=u(()=>this._sellEditor());pricebookSelector=u(()=>this._pricebookSelector());priceMinimum=u(()=>this._priceMinimum());shipping=u(()=>this._shipping());retrieve=u(()=>this._retrieve());creditSalesLock=u(()=>this._creditSalesLock());print=u(()=>this._print());date=u(()=>this._date());numberEditor=u(()=>this._numberEditor());payment=u(()=>this._payment());customerInputLock=u(()=>this._customerInputLock());paymentCodeLock=u(()=>this._paymentCodeLock());tax=u(()=>this._tax());deleteItem=u(()=>this._deleteItem());bundlingPrice=u(()=>this._bundlingPrice());email=u(()=>this._email());parkedDeletion=u(()=>this._parkedDeletion());park=u(()=>this._park());couponInputLock=u(()=>this._couponInputLock());orderView=u(()=>this._orderView());reprint=u(()=>this._reprint());contactCreate=u(()=>this._contactCreate());contacts=u(()=>this._contacts());inventoryView=u(()=>this._inventoryView());debtView=u(()=>this._debtView());sellDelete=u(()=>this._sellDelete());deliveryEditor=u(()=>this._deliveryEditor());prepaidPackageCreate=u(()=>this._prepaidPackageCreate());updateReturn(e){this._return.set(e)}updatePriceVisible(e){this._priceVisible.set(e)}updateUnitPriceEditor(e){this._unitPriceEditor.set(e)}updateSalesPerson(e){this._salesPerson.set(e)}updateDiscount(e){this._discount.set(e)}updateCostVisible(e){this._costVisible.set(e)}updateCommission(e){this._commission.set(e)}updateSellEditor(e){this._sellEditor.set(e)}updatePricebookSelector(e){this._pricebookSelector.set(e)}updatePriceMinimum(e){this._priceMinimum.set(e)}updateShipping(e){this._shipping.set(e)}updateRetrieve(e){this._retrieve.set(e)}updateCreditSalesLock(e){this._creditSalesLock.set(e)}updatePrint(e){this._print.set(e)}updateDate(e){this._date.set(e)}updateNumberEditor(e){this._numberEditor.set(e)}updatePayment(e){this._payment.set(e)}updateCustomerInputLock(e){this._customerInputLock.set(e)}updatePaymentCodeLock(e){this._paymentCodeLock.set(e)}updateTax(e){this._tax.set(e)}updateDeleteItem(e){this._deleteItem.set(e)}updateBundlingPrice(e){this._bundlingPrice.set(e)}updateEmail(e){this._email.set(e)}updateParkedDeletion(e){this._parkedDeletion.set(e)}updatePark(e){this._park.set(e)}updateCouponInputLock(e){this._couponInputLock.set(e)}updateOrderView(e){this._orderView.set(e)}updateReprint(e){this._reprint.set(e)}updateContactCreate(e){this._contactCreate.set(e)}updateContacts(e){this._contacts.set(e)}updateInventoryView(e){this._inventoryView.set(e)}updateDebtView(e){this._debtView.set(e)}updateSellDelete(e){this._sellDelete.set(e)}updateDeliveryEditor(e){this._deliveryEditor.set(e)}updatePrepaidPackageCreate(e){this._prepaidPackageCreate.set(e)}updateFullAccess(e){this._return.set(e),this._priceMinimum.set(e),this._unitPriceEditor.set(e),this._salesPerson.set(e),this._discount.set(e),this._costVisible.set(e),this._commission.set(e),this._sellEditor.set(e),this._pricebookSelector.set(e),this._priceVisible.set(e),this._shipping.set(e),this._retrieve.set(e),this._creditSalesLock.set(e),this._print.set(e),this._date.set(e),this._numberEditor.set(e),this._payment.set(e),this._customerInputLock.set(e),this._paymentCodeLock.set(e),this._tax.set(e),this._deleteItem.set(e),this._bundlingPrice.set(e),this._email.set(e),this._parkedDeletion.set(e),this._park.set(e),this._couponInputLock.set(e),this._orderView.set(e),this._reprint.set(e),this._contactCreate.set(e),this._contacts.set(e),this._inventoryView.set(e),this._debtView.set(e),this._sellDelete.set(e),this._deliveryEditor.set(e),this._prepaidPackageCreate.set(e)}resetToOriginal(){this._return.set(this.role.sell?.Return),this._priceVisible.set(this.role.sell?.PriceVisible),this._unitPriceEditor.set(this.role.sell?.UnitPriceEditor),this._salesPerson.set(this.role.sell?.SalesPerson),this._discount.set(this.role.sell?.Discount),this._costVisible.set(this.role.product?.Cost),this._commission.set(this.role.sell?.Commission),this._sellEditor.set(this.role.sell?.Edit),this._pricebookSelector.set(this.role.sell?.PricebookSelector),this._priceMinimum.set(this.role.sell?.PriceMinimum),this._shipping.set(this.role.sell?.Shipping),this._retrieve.set(this.role.sell?.RetrieveR),this._creditSalesLock.set(this.role.sell?.CreditSalesLock),this._print.set(this.role.global?.Print),this._date.set(this.role.global?.Date),this._numberEditor.set(this.role.sell?.Number),this._payment.set(this.role.sell?.Payment),this._customerInputLock.set(this.role.sell?.CustomerInputLock),this._paymentCodeLock.set(this.role.sell?.PaymentCodeLock),this._tax.set(this.role.sell?.Tax),this._deleteItem.set(this.role.sell?.DeleteItem),this._bundlingPrice.set(this.role.sell?.BundlingPrice),this._email.set(this.role.sell?.Email),this._parkedDeletion.set(!1),this._park.set(this.role.sell?.Park),this._couponInputLock.set(this.role.sell?.CouponInputLock),this._orderView.set(this.role.order?.View),this._reprint.set(this.role.order?.Print),this._contactCreate.set(this.role.contact?.Create),this._contacts.set(this.role.contact?.View),this._inventoryView.set(this.role.inventory?.View),this._debtView.set(this.role.debt?.View),this._sellDelete.set(this.role.sell?.Delete),this._deliveryEditor.set(this.role.logistic?.Edit),this._prepaidPackageCreate.set(this.role.prepaidPackage?.Create)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac,providedIn:"root"})};var Kt=class i{httpService=c(J);getVariantByCode(e,t,n=!1){this.httpService.get(Z.GetVariantByCode,[{key:"Code",value:e},{key:"EntityID",value:t},{key:"BarcodeSerial",value:n},{key:"Promotion",value:!0}])}getVariantByID(e,t,n=!0){this.httpService.get(Z.GetVariantByID,[{key:"ID",value:e},{key:"EntityID",value:t},{key:"Promotion",value:n}])}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac})};var Re=class i{eventService=c(I);role=c(re);storeService=c(x);shoppingCartService=c(We);variantService=c(Kt);decimalPipe=c(K);cartItem=y(null);itemIndex=y(null);toastr=c(W);factoryService=c(fe);isEdit=y(!1);initCartItem(e,t){if(e){let n=ho(he,e);this.itemIndex.set(t),this.cartItem.set(n),this.initSelectedPricebook(),this.isEdit.set(!0)}else this.cartItem.set(new he),this.itemIndex.set(null),this.isEdit.set(!1)}getCartItem=u(()=>this.cartItem());httpService=c(J);salesList=u(()=>this.storeService.register()?.ListSales||[]);selectedPricebook=y(null);pricebookDisabled=u(()=>!this.role.pricebookSelector()||this.salesList().length===0);outletList=u(()=>this.storeService.loadForm()?.Entities||[]);isEmptySalesID=u(()=>!this.cartItem()?.SalesID);isSerialized=u(()=>this.cartItem().InventoryTypeID==9);salesPersonName=u(()=>this.cartItem()?.SalesName||"");deliveryEntityId=u(()=>this.storeService.order().DeliveryOutletID||null);outletID=u(()=>this.storeService.register()?.EntityID);currentSellState=u(()=>this.storeService.state());isValidPriceMinimum=y(!0);deliveryStateID=mr;appConfig=u(()=>this.storeService.loadForm().AppConfigJSON);disableAddQuantity=u(()=>this.cartItem()?.PromotionGift&&!this.editingItemPromotionVisible()||this.checkQtyInputDisabled());decimalPlace=u(()=>0);unitQtyLabel=u(()=>this.appConfig().ModuleSell.ProductDialog.UnitQtyLabel||null);editingItemPromotionVisible=u(()=>this.appConfig().ModuleSell.Promotion?.EditingItemPromotionVisible||!1);deliveryEnabled=u(()=>this.appConfig().ModuleSell?.ProductDialog?.SplitDeliveryOutletEnabled||!1);costVisible=u(()=>this.appConfig().ModuleSell?.Cost?.Visible||!1);costEnabled=u(()=>this.appConfig().ModuleSell?.Cost?.Enabled||!1);storageVisible=u(()=>this.appConfig().ModuleSell?.Grid?.StorageVisible||!1);enabledCalculatorNote=u(()=>this.appConfig().ModuleSell?.ProductDialog?.CalculatorNote||!1);qtyToOneDialog=u(()=>this.appConfig().ModuleSell.ProductDialog?.QuantityToOneInDialog);isSentDelivery=u(()=>!1);isSellEdit=u(()=>!1);isDisabledDiscInput=u(()=>!this.role.discount()||this.cartItem()?.PromotionGift&&!this.editingItemPromotionVisible());inputedDiscountAmount=y(this.cartItem()?.DiscountAmount||0);isDiscMultipliciedQty=y(!0);updateSales(e){this.cartItem.update(t=>{let n=this.salesList().find(o=>o.ID==e)?.Name;return t.SalesName=n,t.SalesID=e,t})}onDeliveryEntityChange(e){this.cartItem.update(t=>{let n=this.outletList().find(o=>o.ID==e);return n?(t.EntityName=n?.Name,t.EntityID=e):(t.EntityName="",t.EntityID=null),t})}updateQuantity(e){this.cartItem.update(t=>(t.Quantity=e,t)),this.isValidPriceMinimum.set(this.validatePriceMinimum())}updateUnitQuantity(e){this.cartItem.update(t=>(t.UnitQuantity=e,t)),this.isValidPriceMinimum.set(this.validatePriceMinimum())}updatePrice(e){this.cartItem.update(t=>(t.Price=e,t)),this.isValidPriceMinimum.set(this.validatePriceMinimum())}updateCost(e){this.cartItem.update(t=>(t.Cost=e,t))}onUpdateNote(e){this.cartItem.update(t=>(t.Note=e,t))}updateDiscountPercentage(e){this.cartItem.update(t=>(t.Discount=e,t)),this.isValidPriceMinimum.set(this.validatePriceMinimum())}onDiscountAmountChange(e){this.cartItem.update(t=>(t.DiscountAmount=e,t)),this.isValidPriceMinimum.set(this.validatePriceMinimum())}onPricebookChange(e){P.IsNotEmpty(e)&&this.cartItem.update(t=>{let n=t.getSelectedPricebook(e);return t=this.shoppingCartService.applyPricebookToItem(this.cartItem(),n),this.selectedPricebook.set(n),t}),this.isValidPriceMinimum.set(this.validatePriceMinimum())}onClearPricebook(){this.cartItem.update(e=>(e=this.shoppingCartService.resetAppliedPricebook(this.cartItem()),this.selectedPricebook.set(null),e)),this.isValidPriceMinimum.set(this.validatePriceMinimum())}onSerialChange(e){this.cartItem.update(t=>(t.Serial=e.Serial,t.Quantity=e.Quantity,t))}onSwitchToggleDiscount(){this.isDiscMultipliciedQty()?this.cartItem.update(e=>(e.DiscountAmount=e.DiscountAmount*e.Quantity,e)):this.cartItem.update(e=>(e.DiscountAmount=e.DiscountAmount/e.Quantity,e))}getInventoryById(){let e=this.storeService.register()?.EntityID,t=this.cartItem()?.VariantID;return this.httpService.get(Z.GetVariantStockByID,[{key:"ID",value:t},{key:"EntityID",value:e}])}initSelectedPricebook(){let e=this.cartItem()?.PriceBookID;if(P.IsNotEmpty(e)){let t=this.cartItem()?.getSelectedPricebook(e);this.selectedPricebook.set(t)}else this.selectedPricebook.set(null)}checkQtyInputDisabled(){let e=this.appConfig()?.ApplicationParkAndRetrieve.AccessControl.AuthorizeParkedOrdersItemDeletion,t=P.IsNotEmpty(this.cartItem()?.ID);return!!(e&&!this.role.sellEditor()&&this.storeService.state()==4&&t||t&&this.cartItem()?.Serial?.length>0)}updateCartItem(e){return!this.validateItemQuantity()||!this.validateConfigDefaultQuantity(e)||!this.isValidPriceMinimum()?!1:(this.handleConfigDoNotRequireAuthorizationNSyncCost(),this.itemIndex()!=null&&this.itemIndex()>=0?this.eventService.emit({type:"[Cart] Update Item",payload:{index:this.itemIndex(),item:this.cartItem()}}):this.shoppingCartService.onAddItem(this.cartItem(),!0),!0)}handleConfigDoNotRequireAuthorizationNSyncCost(){this.cartItem()?.Variant?.SellPriceType==2&&this.cartItem.update(t=>(t.Cost=t.Price,t))}validateConfigDefaultQuantity(e){let t=this.cartItem()?.Quantity;if(e=="Enter"){if(this.isSerialized())return!1;if(!this.qtyToOneDialog())return t>0}return!0}validateItemQuantity(){return P.IsEmpty(this.cartItem()?.VariantID)?(this.toastr.error("Enter item data before clicking OK!","No item is entered!"),!1):(P.IsEmpty(this.cartItem()?.Quantity)&&this.updateQuantity(1),!!this.validateSerialItem())}validateSerialItem(){let e=!0;if(this.isSerialized()&&this.cartItem()?.Serial?.length>0&&this.cartItem()?.Variant?.TypeID==4&&this.cartItem()?.Quantity>0){let t=0;this.cartItem()?.Serial?.forEach(n=>{t+=n.Quantity}),t!=this.cartItem()?.Quantity&&(this.toastr.error("Serial must be equal with the quantity","Error"),e=!1)}return e}priceMinimumRestrictionWarning=y("");validatePriceMinimum(){let e=this.checkPriceMinimumRestriction(this.cartItem());if(e)this.priceMinimumRestrictionWarning.set("");else{let t=this.appConfig().ModuleSell?.ProductDialog?.MinimumPriceIncludeDiscount,n=this.getPriceMinimum(this.cartItem()),o=this.generateMinimumPriceWarningMessage(t,n,this.cartItem());this.priceMinimumRestrictionWarning.set(o)}return e}checkPriceMinimumRestriction(e){let t=!0,n=this.role.priceMinimum,r=this.appConfig().ModuleSell?.ProductDialog?.MinimumPriceIncludeDiscount?e.TotalAfterDiscountPerQuantity:e.Price;if(n){let m=this.getPriceMinimum(e);r<m?t=!1:t=!0}return t}getPriceMinimum(e){let t=this.appConfig().ModuleSell.ProductDialog?.PriceMinimumTypeID,n=0;switch(t){case 1:n=e.Variant?.UnitPrice;break;case 2:n=e.Variant?.UnitCost;break;case 3:n=e.Variant?.UnitPriceMinimum;break}return n}generateMinimumPriceWarningMessage(e,t,n){let o="",r=n.Discount,m=n.DiscountAmount;return e&&(r>0||m>0)?o=P.StringFormat(`<span><i class='fa-solid fa-triangle-exclamation me-2 d-inline'></i>Item net price is <h5 class='d-inline m-0'>{0}</h5></span>
|
|
3
3
|
after item discount, you cannot sell lower than <h5 class='d-inline m-0'>{1}</h5></span>`,this.decimalPipe.transform(n.TotalAfterDiscountPerQuantity),this.decimalPipe.transform(t)):o=P.StringFormat("<span><i class='fa-solid fa-triangle-exclamation me-2 d-inline'></i>Cannot sell lower than <h5 class='d-inline m-0'>{0}</h5></span>",this.decimalPipe.transform(t)),o}onScanBarcode(e){}onAddNewItemById(e){this.httpService.get(Z.GetVariantByID,[{key:"ID",value:e},{key:"EntityID",value:this.outletID()}]).pipe(_e(t=>this.factoryService.createCartItemByVariant(t))).subscribe(t=>{let n=ho(he,t);this.cartItem.set(n)})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=w({token:i,factory:i.\u0275fac})};var Ua=i=>({"mt-8":i}),Xr=i=>({"qtyBtn-disabled":i});function Qa(i,e){if(i&1&&(a(0,"div",23)(1,"div",24)(2,"div"),d(3),l(),a(4,"small",25),d(5),l()()()),i&2){let t=e.data;s(3),F(t==null?null:t.Value),s(2),F(t==null?null:t.Code)}}function ja(i,e){if(i&1){let t=E();a(0,"div",4)(1,"div",21)(2,"autocompleteV2",22,1),v("onSelect",function(o){_(t);let r=p();return S(r.dialogService.onAddNewItemById(o))})("onInputEnter",function(o){_(t);let r=p();return S(r.dialogService.onScanBarcode(o))}),l(),Qe(4,Qa,6,2,"ng-template",null,2,Vt),l()()}if(i&2){let t,n=at(5),o=p();s(2),f("localStorage","products")("renderThumbnail",!0)("inputTextValue",(t=o.cartItem())==null||t.Variant==null?null:t.Variant.Name)("clearOnSelect",!1)("useCustomTemplate",!0)("itemTemplate",n)("outletId",o.outletID())}}function Wa(i,e){if(i&1&&(a(0,"span"),d(1),l()),i&2){let t,n=p();s(),k("(",(t=n.cartItem())==null||t.Variant==null?null:t.Variant.UOMName,")")}}function qa(i,e){if(i&1){let t=E();a(0,"div",11)(1,"strong")(2,"span"),d(3),l()(),a(4,"input",26),v("ngModelChange",function(o){_(t);let r=p();return S(r.dialogService.updateUnitQuantity(o))}),l()()}if(i&2){let t,n=p();s(3),F(n.unitQtyLabel()),s(),f("preventNegative",!0)("readOnly",((t=n.cartItem())==null?null:t.PromotionGift)&&!n.editingItemPromotionVisible())("decimalPlaces",n.decimalPlace())("ngModel",n.cartItem().UnitQuantity)}}function za(i,e){if(i&1&&(h(0,"input",13,3),O(2,"number")),i&2){let t=p();f("value",R(2,1,t.cartItem().Price))}}function Ha(i,e){if(i&1){let t=E();a(0,"input",27,3),v("ngModelChange",function(o){_(t);let r=p();return r.dialogService.updatePrice(o),S(r.dialogService.validatePriceMinimum())}),l()}if(i&2){let t,n=p();f("simpleKeyboard",n.keyboard)("readonly",!n.role.unitPriceEditor()||((t=n.cartItem())==null?null:t.PromotionGift)&&!n.editingItemPromotionVisible())("ngModel",n.cartItem().Price)}}function Ga(i,e){if(i&1&&(a(0,"div",15)(1,"span",28),d(2),l()()),i&2){let t,n=p();s(2),k("Pricebook ",(t=n.selectedPriceBook())==null?null:t.Name," is applied")}}function $a(i,e){if(i&1){let t=E();a(0,"div",17)(1,"strong"),d(2,"Sales Person"),l(),a(3,"ng-select-infinite",29),v("selectedChange",function(o){_(t);let r=p();return S(r.dialogService.updateSales(o))}),l()()}if(i&2){let t,n=p();s(3),f("items",n.salesList())("selected",(t=n.cartItem())==null?null:t.SalesID)}}function Ka(i,e){if(i&1){let t=E();a(0,"div",17)(1,"strong"),d(2,"Fulfillment From"),l(),a(3,"ng-select",30),v("ngModelChange",function(o){_(t);let r=p();return S(r.dialogService.onDeliveryEntityChange(o))}),l()()}if(i&2){let t=p();s(3),f("disabled",t.isSellEdit())("items",t.outletList())("ngModel",t.cartItem().EntityID)}}var _i=class i{dialogService=c(Re);cartItem=this.dialogService.getCartItem;role=c(re);numpadService=c(li);disableAddQuantity=this.dialogService.disableAddQuantity;decimalPlace=this.dialogService.decimalPlace;unitQtyLabel=this.dialogService.unitQtyLabel;isDeliveryEnabled=this.dialogService.deliveryEnabled;isSentDelivery=this.dialogService.isSentDelivery;isDisabledDiscInput=this.dialogService.isDisabledDiscInput;editingItemPromotionVisible=this.dialogService.editingItemPromotionVisible;selectedPriceBook=this.dialogService.selectedPricebook;isEmptySalesID=this.dialogService.isEmptySalesID;salesList=this.dialogService.salesList;outletList=this.dialogService.outletList;salesPersonName=this.dialogService.salesPersonName;isSellEdit=this.dialogService.isSellEdit;keyboard=this.numpadService.keyboard;isEdit=this.dialogService.isEdit;outletID=this.dialogService.outletID;static \u0275fac=function(t){return new(t||i)};static \u0275cmp=N({type:i,selectors:[["product-dialog-cart"]],decls:26,vars:24,consts:[["quantity",""],["variant",""],["itemTemplate",""],["price",""],[1,"row"],[1,"row",3,"ngClass"],[1,"col-auto","mb-4","pe-0",2,"width","145px"],[1,"input-group"],["type","button","id","button-addon1",1,"btn","btn-outline-secondary","fw-bold","rounded-0","fs-2","border-end-0","py-4","cart-input","d-flex","align-items-center","qty_btn","justify-content-center",3,"click","ngClass","disabled"],["id","txtCartQuantity","keyboardType","number","type","text","autoNum","","emptyInputBehavior","zero",1,"form-control","input-numpad","cart-input","text-center",3,"ngModelChange","preventNegative","decimalPlaces","ngModel","disabled"],["type","button","id","button-addon2",1,"btn","btn-outline-secondary","fw-bold","rounded-0","fs-5","border-start-0","py-4","cart-input","d-flex","align-items-center","qty_btn","justify-content-center",3,"click","ngClass","disabled"],[1,"col-auto","pe-0",2,"width","82px"],[1,"col-auto","pe-0",2,"width","112px",3,"hidden"],["disabled","",1,"form-control","cart-input",3,"value"],["id","inputPrice","keyboardType","number","type","text","autoNum","","emptyInputBehavior","zero",1,"form-control","cart-input",3,"simpleKeyboard","readonly","ngModel"],[1,"col-auto","d-flex","align-items-center","pt-5"],[1,"row","mt-6"],[1,"col-auto","pe-0"],[1,"row","mt-6","mb-5"],[1,"col","tinymce"],["height","210px",3,"ngModelChange","ngModel"],[1,"col"],["inputID","product","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Input product name / code",1,"form-control",3,"onSelect","onInputEnter","localStorage","renderThumbnail","inputTextValue","clearOnSelect","useCustomTemplate","itemTemplate","outletId"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"],["type","text","autoNum","","emptyInputBehavior","zero",1,"form-control","cart-input","input-numpad",3,"ngModelChange","preventNegative","readOnly","decimalPlaces","ngModel"],["id","inputPrice","keyboardType","number","type","text","autoNum","","emptyInputBehavior","zero",1,"form-control","cart-input",3,"ngModelChange","simpleKeyboard","readonly","ngModel"],[1,"bg-gradient-warning","py-4","px-2"],["position","top","parent","body","bindValue","ID","bindLabel","Name","placeholder","Sales Person",3,"selectedChange","items","selected"],["bindLabel","Name","bindValue","ID","placeholder","Delivery Outlet","appendTo","body",2,"width","200px",3,"ngModelChange","disabled","items","ngModel"]],template:function(t,n){if(t&1&&(b(0,ja,6,7,"div",4),a(1,"div",5)(2,"div",6)(3,"strong"),d(4," Qty "),b(5,Wa,2,1,"span"),l(),a(6,"div",7)(7,"button",8),v("click",function(){return n.dialogService.updateQuantity(n.cartItem().Quantity-1)}),d(8," - "),l(),a(9,"input",9,0),v("ngModelChange",function(r){return n.dialogService.updateQuantity(r)}),l(),a(11,"button",10),v("click",function(){return n.dialogService.updateQuantity(n.cartItem().Quantity+1)}),d(12," + "),l()()(),b(13,qa,5,5,"div",11),a(14,"div",12)(15,"strong"),d(16,"Price"),l(),b(17,za,3,3,"input",13)(18,Ha,2,3,"input",14),l(),b(19,Ga,3,1,"div",15),l(),a(20,"div",16),b(21,$a,4,2,"div",17),b(22,Ka,4,3,"div",17),l(),a(23,"div",18)(24,"div",19)(25,"POS-tinymce-editor",20),v("ngModelChange",function(r){return n.dialogService.onUpdateNote(r)}),l()()()),t&2){let o,r,m;C(n.isEdit()===!1?0:-1),s(),f("ngClass",$(18,Ua,!n.isEdit())),s(4),C(!((o=n.cartItem())==null||o.Variant==null)&&o.Variant.UOM&&(!((o=n.cartItem())==null||o.Variant==null)&&o.Variant.UOMName)?5:-1),s(2),f("ngClass",$(20,Xr,n.disableAddQuantity()))("disabled",n.disableAddQuantity()),s(2),f("preventNegative",!n.role.return())("decimalPlaces",n.decimalPlace())("ngModel",n.cartItem().Quantity)("disabled",n.disableAddQuantity()),s(2),f("ngClass",$(22,Xr,n.disableAddQuantity()))("disabled",n.disableAddQuantity()),s(2),C(n.unitQtyLabel()?13:-1),s(),f("hidden",!n.role.priceVisible()),s(3),C(!n.role.unitPriceEditor()||(r=n.cartItem())!=null&&r.PromotionGift&&!n.editingItemPromotionVisible()?17:18),s(2),C(n.selectedPriceBook()?19:-1),s(2),C(n.isEmptySalesID()&&((m=n.salesList())==null?null:m.length)>0&&n.role.salesPerson()?21:-1),s(),C(n.isDeliveryEnabled()&&n.isSentDelivery()?22:-1),s(3),f("ngModel",n.cartItem().Note)}},dependencies:[et,He,q,pe,z,ne,ee,te,si,ni,nt,ft,zt,K],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}.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}.more[_ngcontent-%COMP%]{position:absolute;top:0;left:30px}.unit-qty[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100px}p-chips[_ngcontent-%COMP%]{width:100%}p-chips[_ngcontent-%COMP%] ul.ui-inputtext{width:100%}p-chips[_ngcontent-%COMP%] ul.ui-inputtext li input.undefined{border:none}.inventory-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .inventory-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:6px!important}.cart-input[_ngcontent-%COMP%]{height:36px!important}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle;line-height:15px}ng-select-infinite[_ngcontent-%COMP%] div.ng-select-container{width:200px!important}.form-check-input[_ngcontent-%COMP%]{clear:left}.form-switch.form-switch-lg[_ngcontent-%COMP%] .form-check-input[_ngcontent-%COMP%]{height:1.5rem;width:2.75rem;border-radius:3rem}.form-check-input[_ngcontent-%COMP%]:focus{border-color:#89b03e!important}.form-check-input[_ngcontent-%COMP%]:checked{border-color:#89b03e!important;background-color:#89b03e!important}.qtyBtn-disabled[_ngcontent-%COMP%]{background-color:#e9ecef;color:#000!important}button.qty_btn[_ngcontent-%COMP%]{background:#eee;border:1px solid #ddd;width:36px}.section-header[_ngcontent-%COMP%]{padding-bottom:6px;margin-bottom:6px;padding-left:0}.info-box[_ngcontent-%COMP%]{background:#f8f9fa;border:1px solid #e5e5e5;border-radius:6px;padding:16px;text-align:center;position:relative;transition:all .3s ease;height:100%}.info-label[_ngcontent-%COMP%]{font-size:12px;color:#666;text-transform:uppercase;letter-spacing:.5px}.info-value[_ngcontent-%COMP%]{font-weight:600;color:#333}.info-value-sm[_ngcontent-%COMP%]{font-size:16px}.info-value-md[_ngcontent-%COMP%]{font-size:20px}.info-box.available[_ngcontent-%COMP%]{background:#f0f8f0;border-color:#d0e8d0}.info-box.available[_ngcontent-%COMP%] .info-value[_ngcontent-%COMP%]{color:#2d5f2d}.info-box.price-highlight[_ngcontent-%COMP%] .info-value[_ngcontent-%COMP%]{color:#0b5ed7}.info-box.editable-box.editing[_ngcontent-%COMP%]{background:#fffef0;border-color:#ffc107;box-shadow:0 0 0 3px #ffc1071a}.info-value-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:10px}.lock-toggle-btn[_ngcontent-%COMP%]{background:#0000000d;border:none;padding:6px;cursor:pointer;color:#666;transition:all .2s ease;display:flex;align-items:center;justify-content:center;border-radius:6px;width:32px;height:32px;flex-shrink:0}.lock-toggle-btn[_ngcontent-%COMP%]:hover{color:#0b5ed7;background:#0b5ed726;transform:scale(1.05)}.lock-toggle-btn.unlocked[_ngcontent-%COMP%]{color:#ff6b00;background:#ff6b0026}.lock-toggle-btn.unlocked[_ngcontent-%COMP%]:hover{color:#c50;background:#ff6b0040;transform:scale(1.05)}.info-input-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:10px;width:100%}.info-value-input[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#333;border:2px solid #0b5ed7;border-radius:6px;text-align:center;background:#fff;width:100%;outline:none;transition:border-color .2s}.info-value-input[_ngcontent-%COMP%]:focus{border-color:#0056b3;box-shadow:0 0 0 3px #0b5ed71a}.editable-box[_ngcontent-%COMP%]{background:#fffef0;border-color:#ffc107;box-shadow:0 0 0 3px #ffc1071a}.section[_ngcontent-%COMP%]{margin-bottom:32px}.section-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#333;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid #e5e5e5}.info-list[_ngcontent-%COMP%]{display:flex;flex-direction:column}.list-item[_ngcontent-%COMP%]{background:#fafafa;border:1px solid #e5e5e5;border-radius:6px;padding:14px 16px;font-size:14px;color:#333}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-transform:none;background:#f8f9fa}"]})};function Ja(i,e){if(i&1&&(h(0,"input",8),O(1,"number")),i&2){let t=p();f("value",R(1,1,t.cartItem().Discount))}}function Ya(i,e){if(i&1){let t=E();a(0,"input",30,0),v("ngModelChange",function(o){_(t);let r=p();return r.dialogService.updateDiscountPercentage(o),S(r.dialogService.validatePriceMinimum())}),l()}if(i&2){let t=p();f("simpleKeyboard",t.keyboard)("ngModel",t.cartItem().Discount)("preventNegative",!0)}}function Xa(i,e){if(i&1&&(h(0,"input",8),O(1,"number")),i&2){let t=p();f("value",R(1,1,t.inputedDiscountAmount()))}}function Za(i,e){if(i&1){let t=E();a(0,"input",31,1),v("ngModelChange",function(o){_(t);let r=p();return r.dialogService.onDiscountAmountChange(o),S(r.dialogService.validatePriceMinimum())}),l()}if(i&2){let t,n=p();f("max",(t=n.cartItem())==null?null:t.GrossTotal)("simpleKeyboard",n.keyboard)("ngModel",n.dialogService.inputedDiscountAmount())("preventNegative",!0)("readonly",n.isDisabledDiscInput())}}function el(i,e){if(i&1&&(a(0,"div",10)(1,"div",5)(2,"strong"),d(3,"Discount Amount / Qty"),l()(),a(4,"div",6)(5,"div",32)(6,"p"),d(7),O(8,"number"),l()()()()),i&2){let t=p();s(7),F(R(8,1,t.cartItem().DiscountAmount))}}function tl(i,e){if(i&1){let t=E();a(0,"div",10)(1,"div",5)(2,"strong"),d(3,"Pricebook"),l()(),a(4,"div",6)(5,"ng-select",33),v("ngModelChange",function(o){_(t);let r=p();return r.dialogService.onPricebookChange(o),S(r.dialogService.validatePriceMinimum())})("clear",function(){_(t);let o=p();return S(o.dialogService.onClearPricebook())}),l()()()}if(i&2){let t,n,o=p();s(5),f("items",(t=o.cartItem())==null||t.Variant==null?null:t.Variant.PriceBook)("ngModel",(n=o.dialogService.selectedPricebook())==null?null:n.ID)("disabled",o.dialogService.pricebookDisabled())}}function nl(i,e){if(i&1&&(a(0,"div",24)(1,"h5",34),d(2),O(3,"number"),l()()),i&2){let t,n=p();s(2),k(" ",R(3,1,(t=n.cartItem())==null?null:t.Discount),"% ")}}function il(i,e){if(i&1&&(a(0,"div",25)(1,"h5"),d(2),O(3,"number"),l(),a(4,"span",23),d(5,"x"),l(),a(6,"h5"),d(7),O(8,"number"),l()()),i&2){let t,n,o=p();s(2),F(R(3,2,(t=o.cartItem())==null?null:t.Quantity)),s(5),F(R(8,4,(n=o.cartItem())==null?null:n.DiscountAmount))}}function ol(i,e){if(i&1&&(a(0,"h5",28),d(1),O(2,"number"),l()),i&2){let t,n=p();s(),k(" -",R(2,1,((t=n.cartItem())==null?null:t.GrossTotal)*(((t=n.cartItem())==null?null:t.Discount)/100))," ")}}function rl(i,e){if(i&1&&(a(0,"div",27)(1,"h5",28),d(2),O(3,"number"),l()()),i&2){let t,n=p();s(2),k(" -",R(3,1,((t=n.cartItem())==null?null:t.Quantity)*((t=n.cartItem())==null?null:t.DiscountAmount))," ")}}function al(i,e){if(i&1&&(a(0,"div",29)(1,"div",35)(2,"h5"),d(3,"Grand Total"),l()(),a(4,"div",35)(5,"h5"),d(6),O(7,"number"),l()()()),i&2){let t,n=p();s(6),F(R(7,1,(t=n.cartItem())==null?null:t.Total))}}var Si=class i{dialogService=c(Re);cartItem=this.dialogService.getCartItem;numpadService=c(li);isDisabledDiscInput=this.dialogService.isDisabledDiscInput;editingItemPromotionVisible=this.dialogService.editingItemPromotionVisible;keyboard=this.numpadService.keyboard;inputedDiscountAmount=this.dialogService.inputedDiscountAmount;static \u0275fac=function(t){return new(t||i)};static \u0275cmp=N({type:i,selectors:[["product-dialog-discount"]],decls:56,vars:20,consts:[["discount",""],["AMOUNT",""],[1,"row"],[1,"col-6","border-end","py-8"],[1,"row","d-flex","align-items-center","justify-content-start"],[1,"col-6"],[1,"col-5"],[2,"width","112px"],["disabled","",1,"form-control","cart-input",3,"value"],["id","inputDiscount","keyboardType","number","type","text","autoNum","","percentage","","decimalPlaces","2","emptyInputBehavior","zero",1,"form-control","cart-input",3,"simpleKeyboard","ngModel","preventNegative"],[1,"row","d-flex","align-items-center","justify-content-start","mt-4"],["id","inputDiscAmount","keyboardType","number","type","text","autoNum","","emptyInputBehavior","zero",1,"form-control","cart-input",3,"max","simpleKeyboard","ngModel","preventNegative","readonly"],[1,"d-flex","align-items-center","mt-4"],[1,"form-check","form-switch","form-switch-lg","ms-1","mt-1"],["type","checkbox","id","flexSwitchCheckDefault",1,"form-check-input",3,"ngModelChange","ngModel"],[1,"ms-4"],["matTooltipPosition","above","matTooltip",`Use the final discount amount if you want to discount the price of the total
|
|
4
4
|
quantity of the product. The nominal will be calculated automatically and filled in the discount amount box.`,1,"pointer"],[1,"fa-solid","fa-info-circle","ms-2"],[1,"col-6","py-8"],[1,"w-100","text-center"],[1,"text-start","mt-12"],[1,"row","mt-12"],[1,"w-100","d-flex","align-items-center","justify-content-end"],[1,"mx-1","fw-bold"],[1,"d-flex","align-items-center","justify-content-end","mt-2"],[1,"d-flex","align-items-center","justify-content-end","mt-2","text-danger"],[1,"w-100","d-flex","justify-content-end"],[1,"w-100","d-flex","justify-content-end","mt-2"],[1,"text-danger"],[1,"row","border-top","mx-0","px-0","mt-4"],["id","inputDiscount","keyboardType","number","type","text","autoNum","","percentage","","decimalPlaces","2","emptyInputBehavior","zero",1,"form-control","cart-input",3,"ngModelChange","simpleKeyboard","ngModel","preventNegative"],["id","inputDiscAmount","keyboardType","number","type","text","autoNum","","emptyInputBehavior","zero",1,"form-control","cart-input",3,"ngModelChange","max","simpleKeyboard","ngModel","preventNegative","readonly"],[1,"border","ps-6",2,"height","38px","padding-top","10px","width","112px","background-color","#e9ecef"],["bindLabel","Name","bindValue","ID","placeholder","Pricebook","appendTo","body",2,"width","140px",3,"ngModelChange","clear","items","ngModel","disabled"],[1,"fw-bold","text-danger"],[1,"col-6","d-flex","justify-content-end","mt-4"]],template:function(t,n){if(t&1&&(a(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"strong"),d(5,"Discount %"),l()(),a(6,"div",6)(7,"div",7),b(8,Ja,2,3,"input",8)(9,Ya,2,3,"input",9),l()()(),a(10,"div",10)(11,"div",5)(12,"strong"),d(13,"Discount Amount"),l()(),a(14,"div",6)(15,"div",7),b(16,Xa,2,3,"input",8)(17,Za,2,5,"input",11),l()()(),a(18,"div",12)(19,"div",13)(20,"input",14),j("ngModelChange",function(r){return Q(n.dialogService.isDiscMultipliciedQty,r)||(n.dialogService.isDiscMultipliciedQty=r),r}),v("ngModelChange",function(){return n.dialogService.onSwitchToggleDiscount()}),l()(),a(21,"div",15)(22,"strong"),d(23,"*Quantity"),l(),a(24,"span",16),h(25,"i",17),l()()(),b(26,el,9,3,"div",10),b(27,tl,6,3,"div",10),l(),a(28,"div",18)(29,"div",19)(30,"h4"),d(31,"Discount Simulation"),l(),a(32,"h4",20),d(33),l()(),a(34,"div",21)(35,"div",5)(36,"div",22)(37,"h5"),d(38),O(39,"number"),l(),a(40,"span",23),d(41,"x"),l(),a(42,"h5"),d(43),O(44,"number"),l()(),b(45,nl,4,3,"div",24),b(46,il,9,6,"div",25),l(),a(47,"div",5)(48,"div",26)(49,"h5"),d(50),O(51,"number"),l()(),a(52,"div",27),b(53,ol,3,3,"h5",28),l(),b(54,rl,4,3,"div",27),l(),b(55,al,8,3,"div",29),l()()()),t&2){let o,r,m,g,D,A,L,ye,ve,ce;s(8),C(n.isDisabledDiscInput()?8:9),s(8),C(n.isDisabledDiscInput()?16:17),s(4),U("ngModel",n.dialogService.isDiscMultipliciedQty),s(6),C(n.dialogService.isDiscMultipliciedQty()?-1:26),s(),C(((o=n.cartItem())==null||o.Variant==null||o.Variant.PriceBook==null?null:o.Variant.PriceBook.length)>0?27:-1),s(6),k(" ",(r=n.cartItem())==null||r.Variant==null?null:r.Variant.Name," "),s(5),F(R(39,14,(m=n.cartItem())==null?null:m.Quantity)),s(5),F(R(44,16,(g=n.cartItem())==null?null:g.Price)),s(2),C((D=n.cartItem())!=null&&D.Discount?45:-1),s(),C(((A=n.cartItem())==null?null:A.DiscountAmount)>0?46:-1),s(4),F(R(51,18,(L=n.cartItem())==null?null:L.GrossTotal)),s(3),C((ye=n.cartItem())!=null&&ye.Discount?53:-1),s(),C(((ve=n.cartItem())==null?null:ve.DiscountAmount)>0?54:-1),s(),C(((ce=n.cartItem())==null?null:ce.DiscountAmount)>0||((ce=n.cartItem())==null?null:ce.Discount)>0?55:-1)}},dependencies:[q,z,ne,Hn,ee,te,He,si,et,K],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}.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}.more[_ngcontent-%COMP%]{position:absolute;top:0;left:30px}.unit-qty[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100px}p-chips[_ngcontent-%COMP%]{width:100%}p-chips[_ngcontent-%COMP%] ul.ui-inputtext{width:100%}p-chips[_ngcontent-%COMP%] ul.ui-inputtext li input.undefined{border:none}.inventory-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .inventory-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:6px!important}.cart-input[_ngcontent-%COMP%]{height:36px!important}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle;line-height:15px}ng-select-infinite[_ngcontent-%COMP%] div.ng-select-container{width:200px!important}.form-check-input[_ngcontent-%COMP%]{clear:left}.form-switch.form-switch-lg[_ngcontent-%COMP%] .form-check-input[_ngcontent-%COMP%]{height:1.5rem;width:2.75rem;border-radius:3rem}.form-check-input[_ngcontent-%COMP%]:focus{border-color:#89b03e!important}.form-check-input[_ngcontent-%COMP%]:checked{border-color:#89b03e!important;background-color:#89b03e!important}.qtyBtn-disabled[_ngcontent-%COMP%]{background-color:#e9ecef;color:#000!important}button.qty_btn[_ngcontent-%COMP%]{background:#eee;border:1px solid #ddd;width:36px}.section-header[_ngcontent-%COMP%]{padding-bottom:6px;margin-bottom:6px;padding-left:0}.info-box[_ngcontent-%COMP%]{background:#f8f9fa;border:1px solid #e5e5e5;border-radius:6px;padding:16px;text-align:center;position:relative;transition:all .3s ease;height:100%}.info-label[_ngcontent-%COMP%]{font-size:12px;color:#666;text-transform:uppercase;letter-spacing:.5px}.info-value[_ngcontent-%COMP%]{font-weight:600;color:#333}.info-value-sm[_ngcontent-%COMP%]{font-size:16px}.info-value-md[_ngcontent-%COMP%]{font-size:20px}.info-box.available[_ngcontent-%COMP%]{background:#f0f8f0;border-color:#d0e8d0}.info-box.available[_ngcontent-%COMP%] .info-value[_ngcontent-%COMP%]{color:#2d5f2d}.info-box.price-highlight[_ngcontent-%COMP%] .info-value[_ngcontent-%COMP%]{color:#0b5ed7}.info-box.editable-box.editing[_ngcontent-%COMP%]{background:#fffef0;border-color:#ffc107;box-shadow:0 0 0 3px #ffc1071a}.info-value-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:10px}.lock-toggle-btn[_ngcontent-%COMP%]{background:#0000000d;border:none;padding:6px;cursor:pointer;color:#666;transition:all .2s ease;display:flex;align-items:center;justify-content:center;border-radius:6px;width:32px;height:32px;flex-shrink:0}.lock-toggle-btn[_ngcontent-%COMP%]:hover{color:#0b5ed7;background:#0b5ed726;transform:scale(1.05)}.lock-toggle-btn.unlocked[_ngcontent-%COMP%]{color:#ff6b00;background:#ff6b0026}.lock-toggle-btn.unlocked[_ngcontent-%COMP%]:hover{color:#c50;background:#ff6b0040;transform:scale(1.05)}.info-input-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:10px;width:100%}.info-value-input[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#333;border:2px solid #0b5ed7;border-radius:6px;text-align:center;background:#fff;width:100%;outline:none;transition:border-color .2s}.info-value-input[_ngcontent-%COMP%]:focus{border-color:#0056b3;box-shadow:0 0 0 3px #0b5ed71a}.editable-box[_ngcontent-%COMP%]{background:#fffef0;border-color:#ffc107;box-shadow:0 0 0 3px #ffc1071a}.section[_ngcontent-%COMP%]{margin-bottom:32px}.section-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#333;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid #e5e5e5}.info-list[_ngcontent-%COMP%]{display:flex;flex-direction:column}.list-item[_ngcontent-%COMP%]{background:#fafafa;border:1px solid #e5e5e5;border-radius:6px;padding:14px 16px;font-size:14px;color:#333}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-transform:none;background:#f8f9fa}"]})};var ll=()=>["/menu/Products/Catalog/Variants/Info"],sl=i=>({ID:i}),cl=i=>({"col-12":i}),dl=i=>({"editable-box":i});function pl(i,e){i&1&&(a(0,"div",3),h(1,"i",19),a(2,"h6"),d(3,"No Image"),l()())}function ml(i,e){if(i&1&&h(0,"img",4),i&2){let t=p();f("src",t.cartItem().Variant.ThumbnailUrl,Oe)}}function ul(i,e){if(i&1){let t=E();a(0,"button",24),v("click",function(){_(t);let o=p(3);return S(o.toggleEditCost())}),h(1,"i",25),l()}}function gl(i,e){if(i&1&&(a(0,"div",21)(1,"div",18),d(2),O(3,"number"),l(),b(4,ul,2,0,"button",23),l()),i&2){let t=p(2);s(2),xe(" ",t.currencySymbol()," ",Pe(3,3,t.cartItem().Cost,"1.0-4")," "),s(2),C(t.costEnabled()?4:-1)}}function fl(i,e){if(i&1){let t=E();a(0,"button",29),v("click",function(){_(t);let o=p(3);return S(o.toggleEditCost())}),h(1,"i",30),l()}}function bl(i,e){if(i&1){let t=E();a(0,"div",22)(1,"div",26)(2,"input",27),v("ngModelChange",function(o){_(t);let r=p(2);return S(r.dialogService.updateCost(o))}),l(),b(3,fl,2,0,"button",28),l()()}if(i&2){let t=p(2);s(2),f("ngModel",t.cartItem().Cost),s(),C(t.costEnabled()?3:-1)}}function Cl(i,e){if(i&1&&(a(0,"div",13)(1,"div",20)(2,"div",9),d(3,"Cost"),l(),b(4,gl,5,6,"div",21),b(5,bl,4,2,"div",22),l()()),i&2){let t=p();f("ngClass",t.priceCol()),s(),f("ngClass",$(4,dl,t.enableEditCost())),s(3),C(t.enableEditCost()?-1:4),s(),C(t.enableEditCost()?5:-1)}}function vl(i,e){if(i&1&&(a(0,"div",17)(1,"div",8)(2,"div",9),d(3,"Storage Location"),l(),a(4,"div",18),d(5),l()()()),i&2){let t,n=p();s(5),k(" ",(t=n.cartItem())==null||t.Variant==null?null:t.Variant.Storage," ")}}function hl(i,e){if(i&1&&(a(0,"tr")(1,"td",34),d(2),l(),a(3,"td",35),d(4),O(5,"number"),l(),a(6,"td",35),d(7),O(8,"number"),l()()),i&2){let t=e.$implicit,n=p(2);s(2),k(" ",t.Name," "),s(2),k(" ",R(5,4,t.MinimumQuantity)," "),s(3),xe(" ",n.currencySymbol()," ",R(8,6,t.UnitPrice)," ")}}function yl(i,e){if(i&1&&(a(0,"div",12)(1,"h5",6),d(2,"Pricebook"),l(),a(3,"div",16)(4,"table",31)(5,"thead")(6,"tr")(7,"th",32),d(8,"Name"),l(),a(9,"th",33),d(10,"Min Qty"),l(),a(11,"th",33),d(12,"Price"),l()()(),a(13,"tbody"),Y(14,hl,9,8,"tr",null,Ve),O(16,"sortBy"),l()()()()),i&2){let t,n=p();s(14),X(we(16,0,(t=n.cartItem())==null||t.Variant==null?null:t.Variant.PriceBook,"asc","MinimumQuantity"))}}var Pi=class i{storeService=c(x);dialogService=c(Re);cartItem=this.dialogService.getCartItem;inventory$=this.dialogService.getInventoryById();costVisible=this.dialogService.costVisible;costEnabled=this.dialogService.costEnabled;storageVisible=this.dialogService.storageVisible;role=c(re);enableEditCost=y(!1);priceCol=y("col-12");currencySymbol=u(()=>this.storeService.order()?.CurrencySymbol||"");constructor(){this.generatePriceCol()}toggleEditCost(){this.enableEditCost.update(e=>!e)}generatePriceCol(){this.priceCol.set(this.role.commission&&this.cartItem()?.SalesCommission&&this.costVisible()&&this.role.costVisible()?"col-4":this.role.commission&&this.cartItem()?.SalesCommission||this.costVisible()&&this.role.costVisible()?"col-6":"col-12")}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=N({type:i,selectors:[["product-dialog-detail"]],decls:57,vars:34,consts:[[1,"row"],[1,"col-12","mt-4",2,"padding","10px"],["target","_blank",1,"d-flex","justify-content-center","align-items-center",2,"color","inherit",3,"routerLink","queryParams"],[1,"text-center"],[1,"border","rounded",3,"src"],[1,"col-12",2,"padding","10px"],[1,"border-bottom","section-header"],[1,"col-4","m-0","p-3"],[1,"info-box"],[1,"info-label","mb-2"],[1,"info-value","info-value-md"],[1,"info-box","available"],[1,"row","mt-6"],[1,"m-0","p-3",3,"ngClass"],[1,"info-box","price-highlight"],[1,"info-value","info-value-sm","mt-3"],[1,"col-12","m-0","p-3"],[1,"col-6","m-0","p-3"],[1,"info-value","info-value-sm"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"info-box",3,"ngClass"],[1,"info-value-wrapper"],[1,"info-input"],["aria-label","Toggle edit mode",1,"lock-toggle-btn"],["aria-label","Toggle edit mode",1,"lock-toggle-btn",3,"click"],[1,"fa","fa-lock"],[1,"info-input-wrapper"],["type","text","autoNum","",1,"info-value-input","form-control",3,"ngModelChange","ngModel"],["aria-label","Save and lock",1,"lock-toggle-btn","unlocked"],["aria-label","Save and lock",1,"lock-toggle-btn","unlocked",3,"click"],[1,"fa","fa-unlock"],[1,"table","table-bordered","inventory-table"],[1,"py-6","border-end"],[1,"py-6","border-end","text-end"],[1,"py-6"],[1,"py-6","text-end"]],template:function(t,n){if(t&1&&(dn(0),O(1,"async"),a(2,"div",0)(3,"div",1)(4,"a",2),b(5,pl,4,0,"div",3)(6,ml,1,1,"img",4),l()(),a(7,"div",5)(8,"div",0)(9,"h5",6),d(10,"Inventory"),l(),a(11,"div",7)(12,"div",8)(13,"div",9),d(14,"On Hand"),l(),a(15,"div",10),d(16),O(17,"quantityFraction"),l()()(),a(18,"div",7)(19,"div",8)(20,"div",9),d(21,"Allocated"),l(),a(22,"div",10),d(23),O(24,"quantityFraction"),l()()(),a(25,"div",7)(26,"div",11)(27,"div",9),d(28,"Available"),l(),a(29,"div",10),d(30),O(31,"quantityFraction"),l()()()(),a(32,"div",12)(33,"h5",6),d(34,"General Price"),l(),b(35,Cl,6,6,"div",13),a(36,"div",13)(37,"div",14)(38,"div",9),d(39,"Price"),l(),a(40,"div",15),d(41),O(42,"number"),l()()()(),a(43,"div",12)(44,"div",16)(45,"div",0)(46,"h5",6),d(47,"Advanced"),l(),a(48,"div",17)(49,"div",8)(50,"div",9),d(51,"Content"),l(),a(52,"div",18),d(53),O(54,"number"),l()()(),b(55,vl,6,1,"div",17),l()()(),b(56,yl,17,4,"div",12),l()()),t&2){let o,r,m,g,D,A,L=R(1,17,n.inventory$),ye=(L==null?null:L.OnHand)??0,ve=(L==null?null:L.Allocated)??0;s(4),f("routerLink",Je(29,ll))("queryParams",$(30,sl,(o=n.cartItem())==null||o.Variant==null?null:o.Variant.ID)),s(),C(((r=n.cartItem())==null||r.Variant==null?null:r.Variant.ThumbnailUrl)==null?5:6),s(11),k(" ",R(17,19,ye)," "),s(7),k(" ",R(24,21,ve)," "),s(7),k(" ",R(31,23,ye-ve)," "),s(5),C(n.costVisible()&&n.role.costVisible()?35:-1),s(),f("ngClass",n.priceCol()),s(5),xe(" ",n.currencySymbol()," ",R(42,25,n.cartItem().Variant.UnitPrice)," "),s(7),de($(32,cl,!n.storageVisible()||!(!((m=n.cartItem())==null||m.Variant==null)&&m.Variant.Storage))),s(5),Eo(" ",(g=n.cartItem())==null?null:g.VariantUnitQuantity," (@",n.currencySymbol()," ",R(54,27,((g=n.cartItem())==null?null:g.Price)/((g=n.cartItem())==null?null:g.VariantUnitQuantity))," ) "),s(2),C(n.storageVisible()&&(!((D=n.cartItem())==null||D.Variant==null)&&D.Variant.Storage)?55:-1),s(),C(((A=n.cartItem())==null||A.Variant==null||A.Variant.PriceBook==null?null:A.Variant.PriceBook.length)>0?56:-1)}},dependencies:[q,pe,Bt,qn,z,ne,ee,te,gt,Ft,K,Go,Xo],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}.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}.more[_ngcontent-%COMP%]{position:absolute;top:0;left:30px}.unit-qty[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100px}p-chips[_ngcontent-%COMP%]{width:100%}p-chips[_ngcontent-%COMP%] ul.ui-inputtext{width:100%}p-chips[_ngcontent-%COMP%] ul.ui-inputtext li input.undefined{border:none}.inventory-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .inventory-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:6px!important}.cart-input[_ngcontent-%COMP%]{height:36px!important}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle;line-height:15px}ng-select-infinite[_ngcontent-%COMP%] div.ng-select-container{width:200px!important}.form-check-input[_ngcontent-%COMP%]{clear:left}.form-switch.form-switch-lg[_ngcontent-%COMP%] .form-check-input[_ngcontent-%COMP%]{height:1.5rem;width:2.75rem;border-radius:3rem}.form-check-input[_ngcontent-%COMP%]:focus{border-color:#89b03e!important}.form-check-input[_ngcontent-%COMP%]:checked{border-color:#89b03e!important;background-color:#89b03e!important}.qtyBtn-disabled[_ngcontent-%COMP%]{background-color:#e9ecef;color:#000!important}button.qty_btn[_ngcontent-%COMP%]{background:#eee;border:1px solid #ddd;width:36px}.section-header[_ngcontent-%COMP%]{padding-bottom:6px;margin-bottom:6px;padding-left:0}.info-box[_ngcontent-%COMP%]{background:#f8f9fa;border:1px solid #e5e5e5;border-radius:6px;padding:16px;text-align:center;position:relative;transition:all .3s ease;height:100%}.info-label[_ngcontent-%COMP%]{font-size:12px;color:#666;text-transform:uppercase;letter-spacing:.5px}.info-value[_ngcontent-%COMP%]{font-weight:600;color:#333}.info-value-sm[_ngcontent-%COMP%]{font-size:16px}.info-value-md[_ngcontent-%COMP%]{font-size:20px}.info-box.available[_ngcontent-%COMP%]{background:#f0f8f0;border-color:#d0e8d0}.info-box.available[_ngcontent-%COMP%] .info-value[_ngcontent-%COMP%]{color:#2d5f2d}.info-box.price-highlight[_ngcontent-%COMP%] .info-value[_ngcontent-%COMP%]{color:#0b5ed7}.info-box.editable-box.editing[_ngcontent-%COMP%]{background:#fffef0;border-color:#ffc107;box-shadow:0 0 0 3px #ffc1071a}.info-value-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:10px}.lock-toggle-btn[_ngcontent-%COMP%]{background:#0000000d;border:none;padding:6px;cursor:pointer;color:#666;transition:all .2s ease;display:flex;align-items:center;justify-content:center;border-radius:6px;width:32px;height:32px;flex-shrink:0}.lock-toggle-btn[_ngcontent-%COMP%]:hover{color:#0b5ed7;background:#0b5ed726;transform:scale(1.05)}.lock-toggle-btn.unlocked[_ngcontent-%COMP%]{color:#ff6b00;background:#ff6b0026}.lock-toggle-btn.unlocked[_ngcontent-%COMP%]:hover{color:#c50;background:#ff6b0040;transform:scale(1.05)}.info-input-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:10px;width:100%}.info-value-input[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#333;border:2px solid #0b5ed7;border-radius:6px;text-align:center;background:#fff;width:100%;outline:none;transition:border-color .2s}.info-value-input[_ngcontent-%COMP%]:focus{border-color:#0056b3;box-shadow:0 0 0 3px #0b5ed71a}.editable-box[_ngcontent-%COMP%]{background:#fffef0;border-color:#ffc107;box-shadow:0 0 0 3px #ffc1071a}.section[_ngcontent-%COMP%]{margin-bottom:32px}.section-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#333;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid #e5e5e5}.info-list[_ngcontent-%COMP%]{display:flex;flex-direction:column}.list-item[_ngcontent-%COMP%]{background:#fafafa;border:1px solid #e5e5e5;border-radius:6px;padding:14px 16px;font-size:14px;color:#333}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-transform:none;background:#f8f9fa}"]})};var xi=class i{dialogService=c(Re);cartItem=this.dialogService.getCartItem;deliveryEntityId=this.dialogService.deliveryEntityId;state=this.dialogService.currentSellState;serials=y([]);static \u0275fac=function(t){return new(t||i)};static \u0275cmp=N({type:i,selectors:[["product-dialog-serial"]],decls:1,vars:4,consts:[[3,"cartItemChange","serialsChange","entityId","cartItem","disabled","serials"]],template:function(t,n){t&1&&(a(0,"app-item-serial",0),v("cartItemChange",function(r){return n.dialogService.onSerialChange(r)}),j("serialsChange",function(r){return Q(n.serials,r)||(n.serials=r),r}),l()),t&2&&(f("entityId",n.deliveryEntityId())("cartItem",n.cartItem())("disabled",n.state()==2&&n.cartItem().ID),U("serials",n.serials))},dependencies:[Br,Fr],encapsulation:2})};var Di=class i{dialogService=c(Re);cartItem=this.dialogService.getCartItem;editingItemPromotionVisible=this.dialogService.editingItemPromotionVisible;enabledCalculatorNote=this.dialogService.enabledCalculatorNote;static \u0275fac=function(t){return new(t||i)};static \u0275cmp=N({type:i,selectors:[["product-dialog-calculator"]],decls:1,vars:6,consts:[[3,"discountTotal","priceTotal","qtyTotal","noteChanges","notes","price","discount","quantity","variantName","disabledQty"]],template:function(t,n){if(t&1&&(a(0,"item-calculator-tab",0),v("discountTotal",function(r){return n.dialogService.updateDiscountPercentage(r)})("priceTotal",function(r){return n.dialogService.updatePrice(r)})("qtyTotal",function(r){return n.dialogService.updateQuantity(r)})("noteChanges",function(r){return n.enabledCalculatorNote()?n.dialogService.onUpdateNote(r):null}),l()),t&2){let o,r;f("notes",n.cartItem().Note)("price",n.cartItem().Price)("discount",n.cartItem().Discount)("quantity",n.cartItem().Quantity)("variantName",(o=n.cartItem())==null||o.Variant==null?null:o.Variant.Name)("disabledQty",((r=n.cartItem())==null?null:r.PromotionGift)&&!n.editingItemPromotionVisible())}},dependencies:[Ur],encapsulation:2})};function _l(i,e){i&1&&Fn(0)}function Sl(i,e){i&1&&Fn(0)}function Pl(i,e){i&1&&h(0,"product-dialog-detail")}function xl(i,e){i&1&&(Nt(0),a(1,"tab",11),h(2,"product-dialog-serial"),l(),Rt())}function Dl(i,e){i&1&&Fn(0)}function Ml(i,e){if(i&1&&(a(0,"div",13),h(1,"div",14),l()),i&2){let t=p().extraClass,n=p();de(No("bg-gradient-warning p-4 justify-content-center align-items-center d-flex gap-2 ",t)),s(),f("innerHTML",n.priceMinimumWarning(),Et)}}function Ol(i,e){if(i&1&&b(0,Ml,2,4,"div",12),i&2){let t=p();C(t.isValidPriceMinimum()?-1:0)}}var Jt=class i{dialogRef=c(ie);storeService=c(x);dialogService=c(Re);dialogData=c(qt);cartItem=y(this.storeService.cartItems()[this.dialogData.index]);modalConfig=new se;isSerialized=this.dialogService.isSerialized;isValidPriceMinimum=this.dialogService.isValidPriceMinimum;priceMinimumWarning=this.dialogService.priceMinimumRestrictionWarning;activeTab=y("Cart");constructor(){this.initModalConfig(),this.dialogService.initCartItem(this.cartItem(),this.dialogData.index)}initModalConfig(){this.modalConfig.title="Adding new items to order",this.modalConfig.bodyScrollable=!0,this.modalConfig.customWidth="700px",this.modalConfig.noPadding=!0}onTabChange(e){this.activeTab.set(e)}onOk(e){this.dialogService.updateCartItem(e)&&this.dialogRef.close()}onCancel(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=N({type:i,selectors:[["app-product-dialog"]],features:[mt([Re,Kt])],decls:24,vars:6,consts:[["priceMinWarning",""],[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"row","mt-6","mx-1"],[1,"col-12"],[3,"onTabChange"],["matTooltipPosition","above","matTooltip","Cart","tabTitle","Cart"],[4,"ngTemplateOutlet"],["matTooltipPosition","above","matTooltip","Discount","tabTitle","Discount"],["matTooltipPosition","above","matTooltip","Product","tabTitle","Product"],["matTooltipPosition","above","matTooltip","Calculator","tabTitle","Calculator"],["matTooltipPosition","above","matTooltip","Serial","tabTitle","Serial"],[2,"margin-bottom","12px","border-radius","8px",3,"class"],[2,"margin-bottom","12px","border-radius","8px"],[3,"innerHTML"]],template:function(t,n){if(t&1&&(a(0,"modal-material",1),v("onOk",function(r){return n.onOk(r)})("onCancel",function(){return n.onCancel()})("onClose",function(){return n.onCancel()}),a(1,"content")(2,"div",2)(3,"div",3)(4,"div",4)(5,"custom-tabs",5),v("onTabChange",function(r){return n.onTabChange(r)}),Nt(6),a(7,"tab",6),Qe(8,_l,1,0,"ng-container",7),h(9,"product-dialog-cart"),l(),Rt(),Nt(10),a(11,"tab",8),Qe(12,Sl,1,0,"ng-container",7),h(13,"product-dialog-discount"),l(),Rt(),Nt(14),a(15,"tab",9),b(16,Pl,1,0,"product-dialog-detail"),l(),Rt(),b(17,xl,3,0,"ng-container"),Nt(18),a(19,"tab",10),Qe(20,Dl,1,0,"ng-container",7),h(21,"product-dialog-calculator"),l(),Rt(),l()()()()()(),Qe(22,Ol,1,1,"ng-template",null,0,Vt)),t&2){let o=at(23);f("config",n.modalConfig),s(8),f("ngTemplateOutlet",o),s(4),f("ngTemplateOutlet",o),s(4),C(n.activeTab()==="Product"?16:-1),s(),C(n.isSerialized()?17:-1),s(3),f("ngTemplateOutlet",o)}},dependencies:[q,Vo,z,oe,bt,Gt,Ht,ft,Zn,_i,Si,Pi,xi,Di],encapsulation:2})};var Il=i=>({"ps-0":i});function wl(i,e){if(i&1&&(a(0,"td",8)(1,"small"),d(2),l()()),i&2){let t=p().$index;s(2),k("",t+1,".")}}function kl(i,e){if(i&1&&(a(0,"div",37),h(1,"img",39),l()),i&2){let t=p(2).$implicit;s(),f("src",t.Variant==null?null:t.Variant.ThumbnailUrl,Oe)}}function Tl(i,e){i&1&&(a(0,"div",38),h(1,"i",40),l())}function El(i,e){if(i&1&&(a(0,"span",11),b(1,kl,2,1,"div",37)(2,Tl,2,0,"div",38),l()),i&2){let t=p().$implicit;s(),C(t.Variant!=null&&t.Variant.ThumbnailUrl?1:2)}}function Nl(i,e){i&1&&h(0,"i",41)}function Rl(i,e){i&1&&h(0,"i",42)}function Al(i,e){if(i&1&&(a(0,"span",15),b(1,Nl,1,0,"i",41)(2,Rl,1,0,"i",42),l()),i&2){let t=p().$implicit;s(),C(t.Taxable?1:2)}}function Vl(i,e){i&1&&h(0,"i",16)}function Fl(i,e){if(i&1&&(a(0,"small",18),d(1),l()),i&2){let t=p().$implicit;s(),k(" ",t.Variant==null?null:t.Variant.CategoryName," ")}}function Bl(i,e){if(i&1&&(a(0,"small",19),d(1),l()),i&2){let t=p().$implicit;s(),k(" ",t.Variant==null?null:t.Variant.BrandName," ")}}function Ll(i,e){if(i&1&&(a(0,"small",20),d(1),l()),i&2){let t=p().$implicit;s(),k(" ",t.Variant.Storage," ")}}function Ul(i,e){if(i&1&&h(0,"small",22),i&2){let t=p().$implicit;f("innerHtml",t.Note,Et)}}function Ql(i,e){if(i&1&&(a(0,"small",23),d(1," Sold by "),a(2,"i"),d(3),l()()),i&2){let t=p().$implicit;s(3),F(t.SalesName)}}function jl(i,e){if(i&1&&(a(0,"small")(1,"i",43),d(2),l()()),i&2){let t=p().$implicit;s(2),k("Fulfillment from: ",t.EntityName)}}function Wl(i,e){if(i&1&&(a(0,"div",26),h(1,"i",44),l()),i&2){let t=p().$implicit;f("matTooltip",t.AvailableInventory<t.Quantity?t.AvailableInventory+" Available Stock":"")}}function ql(i,e){if(i&1){let t=E();a(0,"span",45),v("click",function(){_(t);let o=p().$index,r=p(2);return S(r.onEditItem(o,"quantity"))}),d(1),O(2,"number"),l()}if(i&2){let t=p().$implicit;s(),k(" ",Pe(2,1,t.Quantity,"1.0-4"))}}function zl(i,e){if(i&1){let t=E();a(0,"span",46),d(1,"x"),l(),a(2,"div",47),v("click",function(){_(t);let o=p().$index,r=p(2);return S(r.onEditItem(o,"quantity"))}),a(3,"span",48),d(4),O(5,"number"),l()()}if(i&2){let t=p().$implicit;s(4),F(R(5,1,t.UnitQuantity))}}function Hl(i,e){if(i&1&&(a(0,"span",29),d(1),O(2,"number"),l()),i&2){let t=p().$implicit;s(),k("@",R(2,1,t.VariantUnitQuantity))}}function Gl(i,e){if(i&1&&(a(0,"small",30),d(1),l()),i&2){let t=p().$implicit;s(),F(t.Variant!=null&&t.Variant.UOM?t.Variant==null?null:t.Variant.UOMName:"")}}function $l(i,e){if(i&1&&(a(0,"div",51),d(1),O(2,"number"),l()),i&2){let t=p(4).$implicit;s(),k(" ",Pe(2,1,t.UnitPriceOriginal,"1.0-4")," ")}}function Kl(i,e){if(i&1){let t=E();a(0,"div",50),v("click",function(){_(t);let o=p(3).$index,r=p(2);return S(r.onEditItem(o,"price"))}),b(1,$l,3,4,"div",51),a(2,"div",28),d(3),O(4,"number"),l()()}if(i&2){let t=p(3).$implicit;s(),C(t.UnitPriceOriginal>t.Price?1:-1),s(2),k(" ",Pe(4,2,t.Price,"1.0-4")," ")}}function Jl(i,e){if(i&1){let t=E();a(0,"div",45),v("click",function(){_(t);let o=p(3).$index,r=p(2);return S(r.onEditItem(o,"price"))}),d(1),O(2,"number"),l()}if(i&2){let t=p(3).$implicit;s(),k(" ",Pe(2,1,t.Price,"1.0-4")," ")}}function Yl(i,e){if(i&1&&b(0,Kl,5,5,"div",49)(1,Jl,3,4,"div",28),i&2){let t=p(4);C(t.strikethroughOriginalPrice()?0:1)}}function Xl(i,e){if(i&1&&(a(0,"div",25),b(1,Yl,2,1),l()),i&2){let t=p().$implicit;s(),C(t.Price!==t.Total?1:-1)}}function Zl(i,e){if(i&1&&(a(0,"div"),d(1),O(2,"number"),l()),i&2){let t=p().$implicit;s(),k(" ",t.Discount==0?"":R(2,1,t.Discount*-1)+"%"," ")}}function es(i,e){if(i&1&&(a(0,"div"),d(1),O(2,"number"),l()),i&2){let t=p().$implicit;s(),k(" ",t.DiscountAmount==0?"":R(2,1,t.DiscountAmount*-1)," ")}}function ts(i,e){if(i&1&&(a(0,"div",52),d(1),O(2,"number"),l()),i&2){let t=p(2).$implicit;s(),k(" ",Pe(2,1,t.UnitPriceOriginal,"1.0-4")," ")}}function ns(i,e){if(i&1&&(a(0,"div",28),b(1,ts,3,4,"div",52),a(2,"div",25),d(3),O(4,"number"),l()()),i&2){let t=p().$implicit;s(),C(t.UnitPriceOriginal>t.Price?1:-1),s(2),k(" ",R(4,2,t.Total)," ")}}function is(i,e){if(i&1&&(a(0,"div",25)(1,"div",28),d(2),O(3,"number"),l()()),i&2){let t=p().$implicit,n=p(2);s(2),k(" ",n.priceVisible?R(3,1,t.Total):" - "," ")}}function os(i,e){if(i&1){let t=E();a(0,"span",53),v("click",function(){_(t);let o=p().$index,r=p(2);return S(r.onRemoveItem(o))}),h(1,"i",54),l()}}function rs(i,e){if(i&1){let t=E();a(0,"tr",7),O(1,"async"),v("contextmenu",function(o){let r=_(t),m=r.$implicit,g=r.$index;p();let D=at(5);return p().onContextMenu(o,m,g),S(D.openMenu())}),b(2,wl,3,1,"td",8),a(3,"td",9),v("click",function(){let o=_(t).$index,r=p(2);return S(r.onEditItem(o,"quantity"))}),a(4,"div",10),b(5,El,3,1,"span",11),a(6,"div",12)(7,"div",13)(8,"span",14),d(9),l(),b(10,Al,3,1,"span",15),b(11,Vl,1,0,"i",16),l(),a(12,"div",17),d(13),l(),b(14,Fl,2,1,"small",18),b(15,Bl,2,1,"small",19),b(16,Ll,2,1,"small",20),a(17,"div"),h(18,"app-serial-note",21),l(),b(19,Ul,1,1,"small",22),b(20,Ql,4,1,"small",23),b(21,jl,3,1,"small"),l()()(),a(22,"td",24)(23,"div",25),b(24,Wl,2,1,"div",26),a(25,"div",27),b(26,ql,3,4,"span",28),b(27,zl,6,3),b(28,Hl,3,3,"span",29),b(29,Gl,2,1,"small",30),l()()(),a(30,"td"),b(31,Xl,2,1,"div",25),l(),a(32,"td",31),v("click",function(){let o=_(t).$index,r=p(2);return S(r.onEditItem(o,"discount"))}),a(33,"div",32),b(34,Zl,3,3,"div"),b(35,es,3,3,"div"),l()(),a(36,"td",33),v("click",function(){let o=_(t).$index,r=p(2);return S(r.onEditItem(o,"price"))}),b(37,ns,5,4,"div",28)(38,is,4,3,"div",25),l(),a(39,"td",34)(40,"div",35),b(41,os,2,0,"span",36),l()()()}if(i&2){let t=e.$implicit,n=p(2);f("cdkDragDisabled",!R(1,25,n.enableDragDrop$)),s(2),C(n.rowNumberVisible()?2:-1),s(),f("ngClass",$(27,Il,n.rowNumberVisible())),s(2),C(n.productImageVisible()?5:-1),s(4),k(" ",t.Variant.Name," "),s(),C(n.taxVisible()?10:-1),s(),C(t.PromotionGift?11:-1),s(2),k(" ",t==null||t.Variant==null?null:t.Variant.Code," "),s(),C(n.categoryVisible()?14:-1),s(),C(n.brandVisible()?15:-1),s(),C(n.storageVisible()?16:-1),s(2),f("serials",t.Serial),s(),C(t.Note?19:-1),s(),C(t.SalesName?20:-1),s(),C(t.EntityName?21:-1),s(3),C(t.AvailableInventory<t.Quantity&&((t==null||t.Variant==null?null:t.Variant.TypeID)<9||(t==null||t.Variant==null?null:t.Variant.TypeID)==n.inventoryType.Composite)?24:-1),s(2),C(t.Quantity!==1&&t.Quantity!==0||t.UnitQuantity>1||t.VariantUnitQuantity>1?26:-1),s(),C(t.UnitQuantity>1?27:-1),s(),C(t.VariantUnitQuantity>1?28:-1),s(),C(t.Variant.UOM&&n.uomVisible()?29:-1),s(2),C((t.Price!==t.Total||t.DiscountAmount>0||t.Discount>0||t.UnitPriceOriginal>t.Price)&&n.priceVisible?31:-1),s(3),C(t.Discount>0?34:-1),s(),C(t.DiscountAmount>0?35:-1),s(2),C(n.strikethroughOriginalPrice()&&t.Quantity==1&&n.priceVisible?37:38),s(4),C(n.hasItemDeletion()?41:-1)}}function as(i,e){if(i&1){let t=E();a(0,"button",55),v("click",function(){_(t);let o=p(2);return S(o.onReverseItem(o.contextMenuItem.index,!0))}),a(1,"div",56),h(2,"i",57),a(3,"span"),d(4,"Return"),l()()(),a(5,"button",58),v("click",function(){_(t);let o=p(2);return S(o.onReverseItem(o.contextMenuItem.index,!1))}),a(6,"div",56),h(7,"i",59),a(8,"span"),d(9,"Sales"),l()()()}if(i&2){let t=p(2);f("disabled",!t.sellRoleService.return()||t.contextMenuItem.item.Quantity<0),s(5),f("disabled",t.contextMenuItem.item.Quantity>0)}}function ls(i,e){if(i&1){let t=E();a(0,"table",3)(1,"tbody",4),v("cdkDropListDropped",function(o){_(t);let r=p();return S(r.drop(o))}),Y(2,rs,42,29,"tr",5,Ee),l()(),h(4,"div",6,0),a(6,"mat-menu",null,1),b(8,as,10,2),l()}if(i&2){let t=at(7),n=p();s(2),X(n.cartItems()),s(2),To("left",n.contextMenuPosition.x)("top",n.contextMenuPosition.y),f("matMenuTriggerFor",t),s(4),C(n.contextMenuItem?8:-1)}}function ss(i,e){i&1&&(a(0,"div",2)(1,"div",60)(2,"div",61)(3,"div",62)(4,"div",63),h(5,"i",64),l(),a(6,"div",65)(7,"span"),d(8,"Empty Cart"),l(),h(9,"br"),a(10,"span"),d(11,"Add products to the cart"),l(),h(12,"br"),a(13,"span"),d(14,"or scan barcode"),l()()()()()())}var Mi=class i{storeService=c(x);eventService=c(I);roleService=c(ke);sellRoleService=c(re);dialog=c(Te);viewContainerRef=c(qe);contextMenuPosition={x:"0px",y:"0px"};contextMenuItem=null;cartItems=u(()=>this.storeService.cartItems());appConfig=u(()=>this.storeService.loadForm().AppConfigJSON);inventoryType=St;priceVisible=this.roleService?.product?.Price;rowNumberVisible=u(()=>this.appConfig().ModuleSell?.Grid.RowNumberVisible);productImageVisible=u(()=>this.appConfig().ModuleSell?.Grid.ProductImageVisible);taxVisible=u(()=>this.appConfig().ModuleSell?.Grid.TaxVisible);categoryVisible=u(()=>this.appConfig().ModuleSell?.Grid.CategoryVisible);brandVisible=u(()=>this.appConfig().ModuleSell?.Grid.ShowBrandItemCart);storageVisible=u(()=>this.appConfig().ModuleSell?.Grid.StorageVisible);uomVisible=u(()=>this.appConfig().ModuleSell?.Grid.UOMVisible);strikethroughOriginalPrice=u(()=>this.appConfig().ModuleSell?.Promotion.StrikethroughOriginalPrice);hasItemDeletion=u(()=>!0);enableDragDrop$=this.eventService.on("[Cart] Enable Drag Drop").pipe(ko({payload:!0}),_e(e=>e?.payload));drop(e){let t=[...this.cartItems()];Wo(t,e.previousIndex,e.currentIndex),this.storeService.updateCartItems([...t])}onEditItem(e,t){this.dialog.open(Jt,{data:{index:e,fieldFocus:t},viewContainerRef:this.viewContainerRef})}onRemoveItem(e){this.eventService.emit({type:"[Cart] Remove Item",payload:{index:e}})}onContextMenu(e,t,n){e.preventDefault(),this.contextMenuPosition.x=e.clientX+"px",this.contextMenuPosition.y=e.clientY+"px",this.contextMenuItem={item:t,index:n}}onReverseItem(e,t){this.eventService.emit({type:"[Cart] Reverse Item",payload:{index:e,isReturn:t}})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=N({type:i,selectors:[["cart-body"]],decls:2,vars:1,consts:[["contextMenuTrigger","matMenuTrigger"],["rowContextMenu","matMenu"],[1,"row","g-0","h-100"],[1,"table","table-borderless"],["cdkDropList","",3,"cdkDropListDropped"],["cdkDrag","",2,"border-bottom","0.5px solid #dee2e6",3,"cdkDragDisabled"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["cdkDrag","",2,"border-bottom","0.5px solid #dee2e6",3,"contextmenu","cdkDragDisabled"],[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"],[1,"text-decoration-line-through","text-danger","fs-5"],[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"],["mat-menu-item","","matTooltip","Set item quantity to negative (return transaction)","matTooltipPosition","right",3,"click","disabled"],[1,"d-flex","gap-2"],[1,"fa-solid","fa-minus"],["mat-menu-item","","matTooltip","Revert quantity to positive (remove return status)","matTooltipPosition","right",3,"click","disabled"],[1,"fa-solid","fa-plus"],[1,"col-12"],[1,"d-flex","justify-content-center","align-items-center","h-100"],[1,"row"],[1,"col-12","d-flex","justify-content-center"],[1,"fa-regular","fa-cart-arrow-up","text-secondary",2,"font-size","110px"],[1,"col-12","justify-content-center","text-center","mt-5","empty-cart-description","text-secondary","headings-font-family"]],template:function(t,n){t&1&&b(0,ls,9,6)(1,ss,15,0,"div",2),t&2&&C(n.cartItems().length>0?0:1)},dependencies:[q,pe,Ho,zo,qo,z,Dr,Ze,Xe,xr,Sr,_r,Pr,Ft,K],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 cs(i,e){if(i&1&&(a(0,"span",5),h(1,"i",6),a(2,"span",7),d(3),O(4,"number"),l()()),i&2){let t,n=p(2);s(3),F((t=n.currentCustomer())!=null&&t.Point?R(4,1,(t=n.currentCustomer())==null?null:t.Point):0)}}function ds(i,e){if(i&1){let t=E();a(0,"div",2)(1,"div",3)(2,"div",4),v("click",function(){_(t);let o=p();return S(o.showPointModal())}),b(3,cs,5,3,"span",5),l()()()}if(i&2){let t=p();s(3),C(t.isEnabledLoyaltyPoint?3:-1)}}var Oi=class i{role=c(ke);storeService=c(x);eventService=c(I);customerService=c(xt);dialog=c(Te);currentCustomer=u(()=>this.storeService.customer());isGetCustomerById=y(!1);isEnabledLoyaltyPoint=this.customerService.isEnabledLoyaltyPoint();isShowDebt=this.customerService.isShowDebt();onOptionSelected(e){if(this.isGetCustomerById()){let t=e?JSON.parse(e):null;this.eventService.emit({type:"[Customer] Add By Id",payload:{id:t?.Key,name:t?.Value}})}this.isGetCustomerById.set(!1)}onSearchByCode(e){this.eventService.emit({type:"[Customer] Add By Code",payload:{code:e}})}onSelectCustomer(){this.isGetCustomerById.set(!0)}onDeleteCustomer(){this.currentCustomer().Name&&this.dialog.open(pi,{data:{title:"Re-assign customer",message:"Are you sure to re-assign the customer?"}}).afterClosed().pipe(Se(e=>e)).subscribe(()=>{this.eventService.emit({type:"[Customer] Remove",payload:{id:this.currentCustomer()?.ID}})})}openCustomerModal(){}showPointModal(){}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=N({type:i,selectors:[["customer-autocomplete"]],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(t,n){if(t&1&&(a(0,"div",0)(1,"autocompleteV2",1),v("optionSelected",function(r){return n.onOptionSelected(r)})("onInputEnter",function(r){return n.onSearchByCode(r)})("onSelect",function(){return n.onSelectCustomer()})("clickInputValue",function(){return n.onDeleteCustomer()})("clickPrefixIcon",function(){return n.openCustomerModal()}),l()(),b(2,ds,4,1,"div",2)),t&2){let o,r;s(),f("useTooltip",!0)("inputTextValue",(o=n.currentCustomer())==null?null:o.Name)("readonly",(r=n.currentCustomer())==null?null:r.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),s(),C(n.isEnabledLoyaltyPoint||n.isShowDebt?2:-1)}},dependencies:[q,Zo,ft,zt,K],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)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V}from"./chunk-7QWL5TKZ.js";import{a as j}from"./chunk-
|
|
1
|
+
import{a as V}from"./chunk-7QWL5TKZ.js";import{a as j}from"./chunk-5O5ADSGP.js";import{E as M,a as H}from"./chunk-R36OIJC7.js";import{q as $}from"./chunk-ETYXTCKV.js";import{$ as f,$a as C,B as u,D as v,Db as a,Eb as b,Fb as y,Fc as w,Gc as k,R as S,Sb as O,X as g,d as p,db as P,ia as h,ja as d,l as m,ma as l,mc as _,nc as R,oc as N,od as A,r as o,vd as T,wc as I}from"./chunk-DUSKF5IQ.js";var s=class t{constructor(e,n){this.httpService=e;this.signalRService=n;this.initSalesPersons()}httpService;signalRService;salesPersonApi="/api/Contact/SelectSalesPersonOptions";salesPerson$=m([]);onOpenNgSelect=new p;_onOpenNgSelect$=this.onOpenNgSelect.asObservable();initSalesPersons(){this.salesPerson$=u(this._onOpenNgSelect$.pipe(S(),o(e=>({source:"select",value:e}))),this.signalRService.recacheSalesPerson$.pipe(o(e=>({source:"signalR",value:e})))).pipe(v(e=>e.value==!0),f(e=>(e.source=="signalR"&&this.signalRService.resetOutletCache(),this.httpService.get(this.salesPersonApi))),g(1))}onOpenNgselect(){this.onOpenNgSelect.next(!0)}static \u0275fac=function(n){return new(n||t)(l($),l(j))};static \u0275prov=d({token:t,factory:t.\u0275fac,providedIn:"root"})};var E=class t{constructor(e){this.salesPersonService=e}salesPersonService;value=null;onChange=()=>{};onTouched=()=>{};placeholder="Choose Sales Person";multiple=!1;clearable=!0;salesPerson$;ngOnInit(){this.salesPerson$=this.salesPersonService.salesPerson$}onClickSelect(){this.salesPersonService.onOpenNgselect()}writeValue(e){this.value=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}onSelectChange(){this.onChange(this.value)}static \u0275fac=function(n){return new(n||t)(C(s))};static \u0275cmp=P({type:t,selectors:[["sales-person-selector"]],inputs:{placeholder:"placeholder",multiple:"multiple",clearable:"clearable"},features:[I([{provide:H,useExisting:h(()=>t),multi:!0}])],decls:2,vars:5,consts:[["bindValue","k","bindLabel","v",3,"selectedChange","onOpen","items","selected","placeholder"]],template:function(n,i){n&1&&(b(0,"ng-select-infinite",0),w(1,"async"),N("selectedChange",function(r){return R(i.value,r)||(i.value=r),r}),O("selectedChange",function(){return i.onSelectChange()})("onOpen",function(){return i.onClickSelect()}),y()),n&2&&(a("items",k(1,3,i.salesPerson$)),_("selected",i.value),a("placeholder",i.placeholder))},dependencies:[T,M,V,A],encapsulation:2})};export{E as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as q}from"./chunk-S77FVPQM.js";import{a as x,b as $}from"./chunk-ZZ2RLD3G.js";import{a as h}from"./chunk-I3WUTJXX.js";import{a as K}from"./chunk-SKME2EES.js";import{b as W}from"./chunk-ZDITRPNK.js";import{a as A}from"./chunk-VEC6WZRR.js";import{b as Q,f as T}from"./chunk-6CVWPBUM.js";import{a as c}from"./chunk-DUAKLYOO.js";import{a as l}from"./chunk-PPTZHIIZ.js";import{a as J}from"./chunk-APP64NKL.js";import{n as C,q as P}from"./chunk-ETYXTCKV.js";import{$ as I,D as b,H as _,M as U,P as f,b as V,e as D,ja as d,m as L,ma as u,p as k,r as S,sd as F}from"./chunk-DUSKF5IQ.js";import{h as p}from"./chunk-NF7PG5F2.js";var O=class{ID;Number;Due;Date;CustomDateField;TimeCustom;SurchargePcg;TempSurchargePcg;ToP;Note;ReferenceInvoiceID;PaymentStateID;Sales;DateCustom;constructor(){this.ID=l.GuidEmpty,this.SurchargePcg=0,this.TempSurchargePcg=0,this.Due=null}};var z=(i=>(i[i.Unsent=0]="Unsent",i[i.AwaitingCollection=1]="AwaitingCollection",i[i.Partial=2]="Partial",i[i.Sent=3]="Sent",i))(z||{});var g=class{ID;EntityID;RegisterID;TypeID;Date;Number;CustomerID;SalesID;Discount=0;Discount2=0;DiscountAmount=0;CustomerDiscountRate=0;Note="";DeliveryOutletID;TaxTypeID;CurrencyID;CurrencyRate;PointUsed;InvoicedStateID;ReferenceNumber="";LogisticsServiceID;ParkLabel="";NumberOfPerson;ClientTimestamp;Created;PromotionCoupon="";CouponType=1;PromotionNote="";DeliveryStateID;CouponProvider="Internal";CurrencySymbol;constructor(){this.ID=l.GuidEmpty,this.EntityID=l.GuidEmpty,this.RegisterID=l.GuidEmpty,this.Number="",this.CustomerID=null,this.SalesID=null,this.Discount=0,this.Discount2=0,this.DiscountAmount=0,this.Note="",this.TaxTypeID=l.GuidEmpty,this.CurrencyID=1,this.CurrencyRate=1,this.DeliveryStateID=3,this.PointUsed=0,this.NumberOfPerson=1,this.Date=new Date}removeEnterNote(){this.Note&&(this.Note=this.Note.replace(/\n/g,""))}};var R=class{MethodID;Amount=0;Note;Index;Date;PaidAmount;Code;MethodName;InvoiceID;ID;TypeID;constructor(t,e,r,i){this.MethodID=t||0,this.Amount=e||0,this.PaidAmount=r||0,this.Date=i}};var v=class{Name;Phone;Address;City;constructor(){this.Name="",this.Phone="",this.Address="",this.City=""}};var y=class{DeliveryEntityID;Type;NewOrderID;constructor(){this.DeliveryEntityID="",this.Type=3}};var N=class{Amount;ApplyToProduct;Code;Type;TypeDescription;Coupon;Notification;MaxDiscount;Note};var m=class{Order;Invoice;Shipping;Action;Payments;Items;CartItems;Promotion;ContactName;SplitParkLabel;get cartQuantity(){let t=0;for(let e of this.CartItems)t+=e.Quantity;return t}constructor(){this.Order=new g,this.Invoice=new O,this.Shipping=new v,this.Action=new y,this.Payments=Array(),this.Items=Array(),this.CartItems=Array(),this.ContactName=""}get TotalPaidAmount(){let t=0;return this.Payments.forEach(e=>{t+=e.PaidAmount}),t}get RedeemableAmount(){let t=this.CartItems.filter(e=>e.Variant.PaymentTypeID!=1);return this.GetAmountByCart(t)}get TotalQuantity(){let t=0;return this.CartItems.forEach(e=>{e.PromotionGift||(t+=e.Quantity)}),t}get CashOnlyAmount(){let t=this.CartItems.filter(e=>e.Variant.PaymentTypeID==1);return this.GetAmountByCart(t)}get PointOnlyAmount(){let t=this.CartItems.filter(e=>e.Variant.PaymentTypeID==2);return this.GetAmountByCart(t)}get PrepaidPackageItem(){return this.CartItems.filter(e=>e.Variant.TypeID==10)}GetAmountByCart(t){let e=0;return t.forEach(r=>{e+=r.Total}),e=e*(100-this.Order.Discount)/100,e=e*(100-this.Order.Discount2)/100,e}getRewards(){return this.CartItems.filter(e=>e.PromotionGift)}};p([h(()=>g)],m.prototype,"Order",2),p([h(()=>O)],m.prototype,"Invoice",2),p([h(()=>v)],m.prototype,"Shipping",2),p([h(()=>y)],m.prototype,"Action",2),p([h(()=>R)],m.prototype,"Payments",2),p([h(()=>x)],m.prototype,"Items",2),p([h(()=>$)],m.prototype,"CartItems",2),p([h(()=>N)],m.prototype,"Promotion",2);var M=class{Success;Message;message;ObjectID;SalesOrderID;OutDeliveryID;Contact;LoyaltyPoint;InvoiceNumber;Creator;OrderTimeString;PrintMode;PaymentStateID;PaymentStateLabel;Final;InvoiceNumberResult;constructor(){this.Success=!0,this.Message="",this.ObjectID="",this.SalesOrderID="",this.OutDeliveryID="",this.Contact=null,this.LoyaltyPoint="",this.InvoiceNumber="",this.Creator="",this.OrderTimeString="",this.PrintMode=0,this.PaymentStateID=0,this.PaymentStateLabel="",this.Final=0}};var E=class s{constructor(t,e,r,i){this.httpService=t;this._localDataService=e;this._onlineStatusService=r;this._toastrService=i;this._onlineStatusService.getOnlineStatus$().subscribe(o=>{this.isOnline=o})}httpService;_localDataService;_onlineStatusService;_toastrService;_Data=new D(null);Data$=this._Data.pipe(f(),b(t=>t!==null));isOnline;get Data(){return this._Data.value}pushNewValue(t){this._Data.next(t)}getSalesOrderPrint(t){return this.httpService.post("/API/POS/GetSalesOrderPrint",{TemplateID:t})}submitOrder(t,e){let r=this.generatePOSDataForSubmission(t,this.isOnline);if(this.isOnline)return this.submitOnline(r).pipe(this.handleTimeOutError(r));if(e.ModuleSell.EnableOfflineTransaction)return this._localDataService.syncOrder(r).pipe(S(()=>this.generateCompleteData(r)));this._toastrService.warning("Offline order is not Supported!","Info!")}uploadOfflineOrder(t){return this._localDataService.uploadSingleOrder(t).pipe(_(e=>e?.message?.includes("objectStore does not exists")?this.submitOnline(t):L(()=>e)))}submitOnline(t){return this.httpService.post(c.SubmitOrder,t,J.pos.submitOrderTimeout)}handleTimeOutError(t){return V(_(e=>{if(e instanceof k||e?.name=="TimeoutError"){let r=this.generateCompleteData(t);this.pushNewValue(r)}throw e}))}generatePOSDataForSubmission(t,e=!0){let r=Object.assign(new m,t);r.Items=[],r.Order.CustomerID==null&&(r.Order.CustomerID=l.GuidEmpty),r.Order.SalesID==null&&(r.Order.SalesID=l.GuidEmpty);let i=1;r.Payments=r.Payments.map(a=>(a.Date=r.Order.Date,a.Index=i,i++,delete a.TypeID,a));let o=1;for(let a of r.CartItems){let n=new x;n.ID=a.ID,n.VariantID=a.VariantID,n.Quantity=a.Quantity,n.Cost=a.Cost,n.Price=a.Price,n.Discount=a.Discount,n.DiscountAmount=a.DiscountAmount,n.Note=a.Note,n.Taxable=a.Variant.Taxable,n.LoyaltyPoint=a.LoyaltyPoint,n.UnitCost=a.Cost,n.UnitPrice=a.Price,n.UnitPriceOriginal=a.UnitPriceOriginal,n.UnitExpense=a.UnitExpense,n.EntityID=a.EntityID,n.Index=o,n.LandedCost=a.LandedCost,n.UnitQuantity=a.UnitQuantity,n.PriceTypeID=a.PriceTypeID,n.PriceNote=a.PriceNote,n.Splited=a.SplitQuantity>0,n.SplitQuantity=a.SplitQuantity,n.InventoryTypeID=a.Variant.TypeID,n.SalesID="",n.Serial=a.Serial,a.SalesID&&(n.SalesID=a.SalesID),delete a.CouponDiscount,r.Items.push(n),o++}return e?(delete r.CartItems,delete r.Order.ClientTimestamp):r.Order.ClientTimestamp=new Date,r}generateCompleteData(t){let e=new M;return e.InvoiceNumber=t.Order.Number,e.OrderTimeString=new Date().toString(),e.PaymentStateID=t.Action?.Type,e.PaymentStateLabel="Offline",e.Success=!0,e.OutDeliveryID=t.Action.DeliveryEntityID,e}GetReturnInvoice(t,e){return this.httpService.get(c.ReturnInvoiceV2,[{key:"EntityID",value:e},{key:"Number",value:t}])}GetInvoiceBySoID(t){return this.httpService.get(c.GetPOSDataByID,[{key:"ID",value:t}])}UploadCSV(t,e){let r={CartItems:t,EntityID:e};return this.httpService.post(c.UploadCsv,r)}sendEmail(t,e){return new Promise((r,i)=>{this._localDataService.isProductFromServer().subscribe(o=>{if(o){let a={invoiceID:e,email:t};this.httpService.post(c.SendInvoiceEmail,a).subscribe({next:n=>{r(n)},error:n=>{i(n)}})}else i(Q.wrongOfflineAction)})})}sendWhatsaap(t,e){let r={InvoiceID:t,PhoneNumber:e};return this.httpService.post(c.SendInvoiceWhatsapp,r)}createCustomerByInvoice(t,e){let r={InvoiceID:t,Mobile:e};return this.httpService.post(c.CreateCustomerInvoice,r)}saveCommission(t,e){let r={SOID:t,commission:e};return this.httpService.POSText("/API/Transaction/SetCommission",r)}generateReceiptA4(t){let e={ID:t};return this.httpService.post(c.InvoiceA4,e)}getVacant(t){return this.httpService.get(c.GetVacant,[{key:"EntityID",value:t}])}static \u0275fac=function(e){return new(e||s)(u(P),u(T),u(A),u(C))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};var X=(o=>(o[o.cash=1]="cash",o[o.card=2]="card",o[o.emoney=3]="emoney",o[o.other=4]="other",o[o.ECR=99]="ECR",o))(X||{});var w=class s{constructor(t,e,r){this._OrderHttpService=t;this._customerHttpService=e;this._toastrService=r}_OrderHttpService;_customerHttpService;_toastrService;_Data=new D(new m);transaction_id;Data$=this._Data.asObservable();get Data(){return this._Data.value}pushNewValue(t){if(t)this._Data.next(t);else{let e=this.Data;this._Data.next(e)}}submitOrder(t){return new Promise((e,r)=>{this.checkTransactionId(),this._OrderHttpService.submitOrder(this.Data,t).subscribe({next:i=>{e(i)},error:i=>{this.Data.Items=[],r(i)}})})}uploadOfflineOrder(){return this.checkTransactionId(),this._OrderHttpService.uploadOfflineOrder(this.Data)}checkTransactionId(){let e=this.Data.Payments.find(r=>r.TypeID==3);l.IsNotEmpty(e)&&l.IsEmpty(this.transaction_id)&&this._toastrService.warning("Midtrans transaction_id is empty. Please verify manually!","Mobile Payment Failure")}updateCustomerID(t){return this.Data.Order.CustomerID=t,this.pushNewValue(this.Data),new Promise((e,r)=>{this._customerHttpService.GetPrivilegeByID(t,this.Data.Order.EntityID).subscribe({next:i=>{this._customerHttpService.Data=i,this.pushNewValue(this.Data),e(i)},error:i=>{this.Data.Order.CustomerID=null,this.Data.ContactName=null;let o=i.error?.Message;i.status==409?this._toastrService.warning(o,"Warning"):this._toastrService.error(o,`API Error - ${i.status}`),r(i)}})})}static \u0275fac=function(e){return new(e||s)(u(E),u(W),u(C))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};var H=class s{constructor(t,e,r){this._localDataService=t;this._onlineStatusService=e;this._httpService=r}_localDataService;_onlineStatusService;_httpService;_Data=new D(null);Data$=this._Data.asObservable().pipe(b(t=>t!==null),f());get Data(){return this._Data.value}pushNewValue(t){this._Data.next(t)}requestObservable(){return this._onlineStatusService.getOnlineStatus$().pipe(f(),U(1),I(t=>t?this._httpService.get(c.GetPOSStorage).pipe(S(e=>({data:e,type:"Online"}))):this._localDataService.getPOSStorage().pipe(b(e=>!!e),S(e=>({data:e,type:"Offline"})))))}getOutletName(t){return this.Data.Entities.find(r=>r.ID==t)?.Name}static \u0275fac=function(e){return new(e||s)(u(T),u(A),u(P))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};var Y=class{Prefix;Seed;Digit;constructor(){this.Prefix=null,this.Seed=null,this.Digit=null}static Generate(t){let e="";if(t.Seed){let r=t.Seed+"";for(;r.length<t.Digit;)r="0"+r;e=l.StringFormat(t.Prefix,r)}return e}};var G=class{ModuleSell;ApplicationLoyalty;ApplicationMath;CoreDefaults;ModuleDelivery;ApplicationParkAndRetrieve;ApplicationRegisterClosure;PaymentConfigGopay;PaymentConfigLink;PrintConfigInvoice;CorePrint;PaymentConfigEmpatKali;ApplicationSettings;PrintConfigGeneral;ModuleProducts;ModuleContact;ApplicationTransactionNumbering;ModuleOrders;ModuleShift;ModuleBuy;ModuleAdjustment;TadaCouponVisible;CouponRedemptionType;ProviderOption;WhatsAppConfigJSON};var Z=class s{constructor(t,e,r,i){this._orderDataService=t;this._posService=e;this.POSMATH=r;this.decimalPipe=i;this._orderDataService.Data$.pipe(I(o=>this._posService.Data$.pipe(S(a=>({appConfig:a.AppConfigJSON,salesOrder:o}))))).subscribe(o=>{this.salesOrderData=o.salesOrder,this.appConfigJSON=o.appConfig,this.calculateDiscountAmount(),this.pushNewValue(this.grandTotal)})}_orderDataService;_posService;POSMATH;decimalPipe;_Data=new D(0);Data$=this._Data.asObservable().pipe(f());tax=new q;discountAfterTax=0;currencySymbol="Rp";get Data(){return this._Data.value}salesOrderData=new m;appConfigJSON=new G;pushNewValue(t){this._Data.next(t)}get grandTotal(){let t=this.TotalAfterSurcharge;return isNaN(t)?0:t}setDecimalDigit(t){let e=this.decimalPipe.transform(t,"1.0-4");return t=parseFloat(e.split(",").join("")),t}get TotalAfterTax(){let t=this.TaxAmount,e=this.TotalBeforeTax+t;return e=this.POSMATH.Round(e,this.appConfigJSON.ApplicationMath.RoundingDigit.DecimalPlaceValue,this.appConfigJSON.ApplicationMath.RoundingDigit.RoundAlgorithm),e}get TotalBeforeTax(){let t=this.tax?.CalculationTypeID===1,e=0;return t?e=this.DiscountTotal-this.TaxAmount:e=this.DiscountTotal,e}get TotalAfterSurcharge(){let t=this.TotalAfterTax+this.SurchargeAmount;return this.POSMATH.Round(t,this.appConfigJSON.ApplicationMath.RoundingDigit.DecimalPlaceValue,this.appConfigJSON.ApplicationMath.RoundingDigit.RoundAlgorithm)}get TotalAfterDiscountTaxable(){return this.GrossTotalTaxable-this.DiscountTotal}get TaxAmount(){if(this.tax!=null){let t=0,e=this.appConfigJSON.ApplicationMath.RoundingTaxDigit.DecimalPlaceValue,r=this.appConfigJSON.ApplicationMath.RoundingTaxDigit.RoundAlgorithm,i=this.GrossTotalTaxable;return this.tax.CalculationTypeID==1?t=this.tax.Rate/(100+this.tax.Rate)*i:t=this.tax.Rate/100*i,t=this.POSMATH.Round(t,e,r),t}else return 0}get SurchargeAmount(){return this.TotalAfterTax*this.salesOrderData.Invoice.SurchargePcg/100}get Discount1Amount(){return this.GrossTotal*this.salesOrderData.Order.Discount/100}get AfterDiscount1Amount(){return this.GrossTotal-this.Discount1Amount}get Discount2Amount(){return this.AfterDiscount1Amount*this.salesOrderData.Order.Discount2/100}get AfterDiscount2Amount(){return this.AfterDiscount1Amount-this.Discount2Amount}get DiscountTotal(){return this.AfterDiscount2Amount-this.salesOrderData.Order.DiscountAmount}calculateDiscountAmount(){let t=this.salesOrderData.Order.DiscountAmount,e=0;this.AfterDiscount2Amount>=0&&t>0&&t>this.AfterDiscount2Amount&&(e=this.AfterDiscount2Amount),e!==0&&e<=t&&this.GrossTotal!==0&&(t=e),this.salesOrderData.Order.DiscountAmount=t}get GrossTotal(){return this.sum(this.salesOrderData.CartItems,"Total")}get GrossTotalTaxable(){let t=this.salesOrderData.CartItems.filter(r=>r.Taxable),e=this.sum(t,"Total");if(t.length!==0){let r=this.calculateDiscountTaxableItem(t);e=e*(100-this.salesOrderData.Order.Discount)/100,e=e*(100-this.salesOrderData.Order.Discount2)/100,e=e-r}return e}calculateDiscountTaxableItem(t){let e=this.GrossTotal,r=this.salesOrderData.Order.DiscountAmount,i=0,o=0,a=0,n=0;for(let B of t)i=B.getItemAfterDiscount/e,o=i*r,n=o*B.Quantity,a+=n;return a}get GrossTotalNonTaxable(){let t=this.salesOrderData.CartItems.filter(r=>r.Taxable==!1),e=this.sum(t,"Total");return e=e*(100-this.salesOrderData.Order.Discount)/100,e=e*(100-this.salesOrderData.Order.Discount2)/100,e=e-this.salesOrderData.Order.DiscountAmount,e}sum(t,e){let r=t.reduce((i,o)=>i+o[e],0);return r=this.setDecimalDigit(r),r}GetPointOnlyAmount(){let t=this.salesOrderData.CartItems.filter(e=>e.Variant.PaymentTypeID==2);return this.GetAmountByCart(t)}GetCashOnlyAmount(){let t=this.salesOrderData.CartItems.filter(e=>e.Variant.PaymentTypeID==1);return this.GetAmountByCart(t)}GetCashAndPointAmountCart(){let t=this.salesOrderData.CartItems.filter(e=>e.Variant.PaymentTypeID!=1);return this.GetAmountByCart(t)}GetAmountByCart(t){let e=this.sum(t,"Total");return e=e*(100-this.salesOrderData.Order.Discount)/100,e=e*(100-this.salesOrderData.Order.Discount2)/100,e}calculateGrossTotal(t){return this.sum(t,"Total")}static \u0275fac=function(e){return new(e||s)(u(w),u(H),u(K),u(F))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};export{Y as a,O as b,v as c,R as d,G as e,z as f,m as g,X as h,M as i,E as j,w as k,H as l,Z as m};
|
|
1
|
+
import{b as q}from"./chunk-S77FVPQM.js";import{a as x,b as $}from"./chunk-ZZ2RLD3G.js";import{a as h}from"./chunk-I3WUTJXX.js";import{a as K}from"./chunk-SKME2EES.js";import{b as W}from"./chunk-VY3BX3QS.js";import{a as A}from"./chunk-XCPZOGRM.js";import{b as Q,f as T}from"./chunk-YLGNXQKM.js";import{a as c}from"./chunk-DUAKLYOO.js";import{a as l}from"./chunk-PPTZHIIZ.js";import{a as J}from"./chunk-QWQ7KY5S.js";import{n as C,q as P}from"./chunk-ETYXTCKV.js";import{$ as I,D as b,H as _,M as U,P as f,b as V,e as D,ja as d,m as L,ma as u,p as k,r as S,sd as F}from"./chunk-DUSKF5IQ.js";import{h as p}from"./chunk-NF7PG5F2.js";var O=class{ID;Number;Due;Date;CustomDateField;TimeCustom;SurchargePcg;TempSurchargePcg;ToP;Note;ReferenceInvoiceID;PaymentStateID;Sales;DateCustom;constructor(){this.ID=l.GuidEmpty,this.SurchargePcg=0,this.TempSurchargePcg=0,this.Due=null}};var z=(i=>(i[i.Unsent=0]="Unsent",i[i.AwaitingCollection=1]="AwaitingCollection",i[i.Partial=2]="Partial",i[i.Sent=3]="Sent",i))(z||{});var g=class{ID;EntityID;RegisterID;TypeID;Date;Number;CustomerID;SalesID;Discount=0;Discount2=0;DiscountAmount=0;CustomerDiscountRate=0;Note="";DeliveryOutletID;TaxTypeID;CurrencyID;CurrencyRate;PointUsed;InvoicedStateID;ReferenceNumber="";LogisticsServiceID;ParkLabel="";NumberOfPerson;ClientTimestamp;Created;PromotionCoupon="";CouponType=1;PromotionNote="";DeliveryStateID;CouponProvider="Internal";CurrencySymbol;constructor(){this.ID=l.GuidEmpty,this.EntityID=l.GuidEmpty,this.RegisterID=l.GuidEmpty,this.Number="",this.CustomerID=null,this.SalesID=null,this.Discount=0,this.Discount2=0,this.DiscountAmount=0,this.Note="",this.TaxTypeID=l.GuidEmpty,this.CurrencyID=1,this.CurrencyRate=1,this.DeliveryStateID=3,this.PointUsed=0,this.NumberOfPerson=1,this.Date=new Date}removeEnterNote(){this.Note&&(this.Note=this.Note.replace(/\n/g,""))}};var R=class{MethodID;Amount=0;Note;Index;Date;PaidAmount;Code;MethodName;InvoiceID;ID;TypeID;constructor(t,e,r,i){this.MethodID=t||0,this.Amount=e||0,this.PaidAmount=r||0,this.Date=i}};var v=class{Name;Phone;Address;City;constructor(){this.Name="",this.Phone="",this.Address="",this.City=""}};var y=class{DeliveryEntityID;Type;NewOrderID;constructor(){this.DeliveryEntityID="",this.Type=3}};var N=class{Amount;ApplyToProduct;Code;Type;TypeDescription;Coupon;Notification;MaxDiscount;Note};var m=class{Order;Invoice;Shipping;Action;Payments;Items;CartItems;Promotion;ContactName;SplitParkLabel;get cartQuantity(){let t=0;for(let e of this.CartItems)t+=e.Quantity;return t}constructor(){this.Order=new g,this.Invoice=new O,this.Shipping=new v,this.Action=new y,this.Payments=Array(),this.Items=Array(),this.CartItems=Array(),this.ContactName=""}get TotalPaidAmount(){let t=0;return this.Payments.forEach(e=>{t+=e.PaidAmount}),t}get RedeemableAmount(){let t=this.CartItems.filter(e=>e.Variant.PaymentTypeID!=1);return this.GetAmountByCart(t)}get TotalQuantity(){let t=0;return this.CartItems.forEach(e=>{e.PromotionGift||(t+=e.Quantity)}),t}get CashOnlyAmount(){let t=this.CartItems.filter(e=>e.Variant.PaymentTypeID==1);return this.GetAmountByCart(t)}get PointOnlyAmount(){let t=this.CartItems.filter(e=>e.Variant.PaymentTypeID==2);return this.GetAmountByCart(t)}get PrepaidPackageItem(){return this.CartItems.filter(e=>e.Variant.TypeID==10)}GetAmountByCart(t){let e=0;return t.forEach(r=>{e+=r.Total}),e=e*(100-this.Order.Discount)/100,e=e*(100-this.Order.Discount2)/100,e}getRewards(){return this.CartItems.filter(e=>e.PromotionGift)}};p([h(()=>g)],m.prototype,"Order",2),p([h(()=>O)],m.prototype,"Invoice",2),p([h(()=>v)],m.prototype,"Shipping",2),p([h(()=>y)],m.prototype,"Action",2),p([h(()=>R)],m.prototype,"Payments",2),p([h(()=>x)],m.prototype,"Items",2),p([h(()=>$)],m.prototype,"CartItems",2),p([h(()=>N)],m.prototype,"Promotion",2);var M=class{Success;Message;message;ObjectID;SalesOrderID;OutDeliveryID;Contact;LoyaltyPoint;InvoiceNumber;Creator;OrderTimeString;PrintMode;PaymentStateID;PaymentStateLabel;Final;InvoiceNumberResult;constructor(){this.Success=!0,this.Message="",this.ObjectID="",this.SalesOrderID="",this.OutDeliveryID="",this.Contact=null,this.LoyaltyPoint="",this.InvoiceNumber="",this.Creator="",this.OrderTimeString="",this.PrintMode=0,this.PaymentStateID=0,this.PaymentStateLabel="",this.Final=0}};var E=class s{constructor(t,e,r,i){this.httpService=t;this._localDataService=e;this._onlineStatusService=r;this._toastrService=i;this._onlineStatusService.getOnlineStatus$().subscribe(o=>{this.isOnline=o})}httpService;_localDataService;_onlineStatusService;_toastrService;_Data=new D(null);Data$=this._Data.pipe(f(),b(t=>t!==null));isOnline;get Data(){return this._Data.value}pushNewValue(t){this._Data.next(t)}getSalesOrderPrint(t){return this.httpService.post("/API/POS/GetSalesOrderPrint",{TemplateID:t})}submitOrder(t,e){let r=this.generatePOSDataForSubmission(t,this.isOnline);if(this.isOnline)return this.submitOnline(r).pipe(this.handleTimeOutError(r));if(e.ModuleSell.EnableOfflineTransaction)return this._localDataService.syncOrder(r).pipe(S(()=>this.generateCompleteData(r)));this._toastrService.warning("Offline order is not Supported!","Info!")}uploadOfflineOrder(t){return this._localDataService.uploadSingleOrder(t).pipe(_(e=>e?.message?.includes("objectStore does not exists")?this.submitOnline(t):L(()=>e)))}submitOnline(t){return this.httpService.post(c.SubmitOrder,t,J.pos.submitOrderTimeout)}handleTimeOutError(t){return V(_(e=>{if(e instanceof k||e?.name=="TimeoutError"){let r=this.generateCompleteData(t);this.pushNewValue(r)}throw e}))}generatePOSDataForSubmission(t,e=!0){let r=Object.assign(new m,t);r.Items=[],r.Order.CustomerID==null&&(r.Order.CustomerID=l.GuidEmpty),r.Order.SalesID==null&&(r.Order.SalesID=l.GuidEmpty);let i=1;r.Payments=r.Payments.map(a=>(a.Date=r.Order.Date,a.Index=i,i++,delete a.TypeID,a));let o=1;for(let a of r.CartItems){let n=new x;n.ID=a.ID,n.VariantID=a.VariantID,n.Quantity=a.Quantity,n.Cost=a.Cost,n.Price=a.Price,n.Discount=a.Discount,n.DiscountAmount=a.DiscountAmount,n.Note=a.Note,n.Taxable=a.Variant.Taxable,n.LoyaltyPoint=a.LoyaltyPoint,n.UnitCost=a.Cost,n.UnitPrice=a.Price,n.UnitPriceOriginal=a.UnitPriceOriginal,n.UnitExpense=a.UnitExpense,n.EntityID=a.EntityID,n.Index=o,n.LandedCost=a.LandedCost,n.UnitQuantity=a.UnitQuantity,n.PriceTypeID=a.PriceTypeID,n.PriceNote=a.PriceNote,n.Splited=a.SplitQuantity>0,n.SplitQuantity=a.SplitQuantity,n.InventoryTypeID=a.Variant.TypeID,n.SalesID="",n.Serial=a.Serial,a.SalesID&&(n.SalesID=a.SalesID),delete a.CouponDiscount,r.Items.push(n),o++}return e?(delete r.CartItems,delete r.Order.ClientTimestamp):r.Order.ClientTimestamp=new Date,r}generateCompleteData(t){let e=new M;return e.InvoiceNumber=t.Order.Number,e.OrderTimeString=new Date().toString(),e.PaymentStateID=t.Action?.Type,e.PaymentStateLabel="Offline",e.Success=!0,e.OutDeliveryID=t.Action.DeliveryEntityID,e}GetReturnInvoice(t,e){return this.httpService.get(c.ReturnInvoiceV2,[{key:"EntityID",value:e},{key:"Number",value:t}])}GetInvoiceBySoID(t){return this.httpService.get(c.GetPOSDataByID,[{key:"ID",value:t}])}UploadCSV(t,e){let r={CartItems:t,EntityID:e};return this.httpService.post(c.UploadCsv,r)}sendEmail(t,e){return new Promise((r,i)=>{this._localDataService.isProductFromServer().subscribe(o=>{if(o){let a={invoiceID:e,email:t};this.httpService.post(c.SendInvoiceEmail,a).subscribe({next:n=>{r(n)},error:n=>{i(n)}})}else i(Q.wrongOfflineAction)})})}sendWhatsaap(t,e){let r={InvoiceID:t,PhoneNumber:e};return this.httpService.post(c.SendInvoiceWhatsapp,r)}createCustomerByInvoice(t,e){let r={InvoiceID:t,Mobile:e};return this.httpService.post(c.CreateCustomerInvoice,r)}saveCommission(t,e){let r={SOID:t,commission:e};return this.httpService.POSText("/API/Transaction/SetCommission",r)}generateReceiptA4(t){let e={ID:t};return this.httpService.post(c.InvoiceA4,e)}getVacant(t){return this.httpService.get(c.GetVacant,[{key:"EntityID",value:t}])}static \u0275fac=function(e){return new(e||s)(u(P),u(T),u(A),u(C))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};var X=(o=>(o[o.cash=1]="cash",o[o.card=2]="card",o[o.emoney=3]="emoney",o[o.other=4]="other",o[o.ECR=99]="ECR",o))(X||{});var w=class s{constructor(t,e,r){this._OrderHttpService=t;this._customerHttpService=e;this._toastrService=r}_OrderHttpService;_customerHttpService;_toastrService;_Data=new D(new m);transaction_id;Data$=this._Data.asObservable();get Data(){return this._Data.value}pushNewValue(t){if(t)this._Data.next(t);else{let e=this.Data;this._Data.next(e)}}submitOrder(t){return new Promise((e,r)=>{this.checkTransactionId(),this._OrderHttpService.submitOrder(this.Data,t).subscribe({next:i=>{e(i)},error:i=>{this.Data.Items=[],r(i)}})})}uploadOfflineOrder(){return this.checkTransactionId(),this._OrderHttpService.uploadOfflineOrder(this.Data)}checkTransactionId(){let e=this.Data.Payments.find(r=>r.TypeID==3);l.IsNotEmpty(e)&&l.IsEmpty(this.transaction_id)&&this._toastrService.warning("Midtrans transaction_id is empty. Please verify manually!","Mobile Payment Failure")}updateCustomerID(t){return this.Data.Order.CustomerID=t,this.pushNewValue(this.Data),new Promise((e,r)=>{this._customerHttpService.GetPrivilegeByID(t,this.Data.Order.EntityID).subscribe({next:i=>{this._customerHttpService.Data=i,this.pushNewValue(this.Data),e(i)},error:i=>{this.Data.Order.CustomerID=null,this.Data.ContactName=null;let o=i.error?.Message;i.status==409?this._toastrService.warning(o,"Warning"):this._toastrService.error(o,`API Error - ${i.status}`),r(i)}})})}static \u0275fac=function(e){return new(e||s)(u(E),u(W),u(C))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};var H=class s{constructor(t,e,r){this._localDataService=t;this._onlineStatusService=e;this._httpService=r}_localDataService;_onlineStatusService;_httpService;_Data=new D(null);Data$=this._Data.asObservable().pipe(b(t=>t!==null),f());get Data(){return this._Data.value}pushNewValue(t){this._Data.next(t)}requestObservable(){return this._onlineStatusService.getOnlineStatus$().pipe(f(),U(1),I(t=>t?this._httpService.get(c.GetPOSStorage).pipe(S(e=>({data:e,type:"Online"}))):this._localDataService.getPOSStorage().pipe(b(e=>!!e),S(e=>({data:e,type:"Offline"})))))}getOutletName(t){return this.Data.Entities.find(r=>r.ID==t)?.Name}static \u0275fac=function(e){return new(e||s)(u(T),u(A),u(P))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};var Y=class{Prefix;Seed;Digit;constructor(){this.Prefix=null,this.Seed=null,this.Digit=null}static Generate(t){let e="";if(t.Seed){let r=t.Seed+"";for(;r.length<t.Digit;)r="0"+r;e=l.StringFormat(t.Prefix,r)}return e}};var G=class{ModuleSell;ApplicationLoyalty;ApplicationMath;CoreDefaults;ModuleDelivery;ApplicationParkAndRetrieve;ApplicationRegisterClosure;PaymentConfigGopay;PaymentConfigLink;PrintConfigInvoice;CorePrint;PaymentConfigEmpatKali;ApplicationSettings;PrintConfigGeneral;ModuleProducts;ModuleContact;ApplicationTransactionNumbering;ModuleOrders;ModuleShift;ModuleBuy;ModuleAdjustment;TadaCouponVisible;CouponRedemptionType;ProviderOption;WhatsAppConfigJSON};var Z=class s{constructor(t,e,r,i){this._orderDataService=t;this._posService=e;this.POSMATH=r;this.decimalPipe=i;this._orderDataService.Data$.pipe(I(o=>this._posService.Data$.pipe(S(a=>({appConfig:a.AppConfigJSON,salesOrder:o}))))).subscribe(o=>{this.salesOrderData=o.salesOrder,this.appConfigJSON=o.appConfig,this.calculateDiscountAmount(),this.pushNewValue(this.grandTotal)})}_orderDataService;_posService;POSMATH;decimalPipe;_Data=new D(0);Data$=this._Data.asObservable().pipe(f());tax=new q;discountAfterTax=0;currencySymbol="Rp";get Data(){return this._Data.value}salesOrderData=new m;appConfigJSON=new G;pushNewValue(t){this._Data.next(t)}get grandTotal(){let t=this.TotalAfterSurcharge;return isNaN(t)?0:t}setDecimalDigit(t){let e=this.decimalPipe.transform(t,"1.0-4");return t=parseFloat(e.split(",").join("")),t}get TotalAfterTax(){let t=this.TaxAmount,e=this.TotalBeforeTax+t;return e=this.POSMATH.Round(e,this.appConfigJSON.ApplicationMath.RoundingDigit.DecimalPlaceValue,this.appConfigJSON.ApplicationMath.RoundingDigit.RoundAlgorithm),e}get TotalBeforeTax(){let t=this.tax?.CalculationTypeID===1,e=0;return t?e=this.DiscountTotal-this.TaxAmount:e=this.DiscountTotal,e}get TotalAfterSurcharge(){let t=this.TotalAfterTax+this.SurchargeAmount;return this.POSMATH.Round(t,this.appConfigJSON.ApplicationMath.RoundingDigit.DecimalPlaceValue,this.appConfigJSON.ApplicationMath.RoundingDigit.RoundAlgorithm)}get TotalAfterDiscountTaxable(){return this.GrossTotalTaxable-this.DiscountTotal}get TaxAmount(){if(this.tax!=null){let t=0,e=this.appConfigJSON.ApplicationMath.RoundingTaxDigit.DecimalPlaceValue,r=this.appConfigJSON.ApplicationMath.RoundingTaxDigit.RoundAlgorithm,i=this.GrossTotalTaxable;return this.tax.CalculationTypeID==1?t=this.tax.Rate/(100+this.tax.Rate)*i:t=this.tax.Rate/100*i,t=this.POSMATH.Round(t,e,r),t}else return 0}get SurchargeAmount(){return this.TotalAfterTax*this.salesOrderData.Invoice.SurchargePcg/100}get Discount1Amount(){return this.GrossTotal*this.salesOrderData.Order.Discount/100}get AfterDiscount1Amount(){return this.GrossTotal-this.Discount1Amount}get Discount2Amount(){return this.AfterDiscount1Amount*this.salesOrderData.Order.Discount2/100}get AfterDiscount2Amount(){return this.AfterDiscount1Amount-this.Discount2Amount}get DiscountTotal(){return this.AfterDiscount2Amount-this.salesOrderData.Order.DiscountAmount}calculateDiscountAmount(){let t=this.salesOrderData.Order.DiscountAmount,e=0;this.AfterDiscount2Amount>=0&&t>0&&t>this.AfterDiscount2Amount&&(e=this.AfterDiscount2Amount),e!==0&&e<=t&&this.GrossTotal!==0&&(t=e),this.salesOrderData.Order.DiscountAmount=t}get GrossTotal(){return this.sum(this.salesOrderData.CartItems,"Total")}get GrossTotalTaxable(){let t=this.salesOrderData.CartItems.filter(r=>r.Taxable),e=this.sum(t,"Total");if(t.length!==0){let r=this.calculateDiscountTaxableItem(t);e=e*(100-this.salesOrderData.Order.Discount)/100,e=e*(100-this.salesOrderData.Order.Discount2)/100,e=e-r}return e}calculateDiscountTaxableItem(t){let e=this.GrossTotal,r=this.salesOrderData.Order.DiscountAmount,i=0,o=0,a=0,n=0;for(let B of t)i=B.getItemAfterDiscount/e,o=i*r,n=o*B.Quantity,a+=n;return a}get GrossTotalNonTaxable(){let t=this.salesOrderData.CartItems.filter(r=>r.Taxable==!1),e=this.sum(t,"Total");return e=e*(100-this.salesOrderData.Order.Discount)/100,e=e*(100-this.salesOrderData.Order.Discount2)/100,e=e-this.salesOrderData.Order.DiscountAmount,e}sum(t,e){let r=t.reduce((i,o)=>i+o[e],0);return r=this.setDecimalDigit(r),r}GetPointOnlyAmount(){let t=this.salesOrderData.CartItems.filter(e=>e.Variant.PaymentTypeID==2);return this.GetAmountByCart(t)}GetCashOnlyAmount(){let t=this.salesOrderData.CartItems.filter(e=>e.Variant.PaymentTypeID==1);return this.GetAmountByCart(t)}GetCashAndPointAmountCart(){let t=this.salesOrderData.CartItems.filter(e=>e.Variant.PaymentTypeID!=1);return this.GetAmountByCart(t)}GetAmountByCart(t){let e=this.sum(t,"Total");return e=e*(100-this.salesOrderData.Order.Discount)/100,e=e*(100-this.salesOrderData.Order.Discount2)/100,e}calculateGrossTotal(t){return this.sum(t,"Total")}static \u0275fac=function(e){return new(e||s)(u(w),u(H),u(K),u(F))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};export{Y as a,O as b,v as c,R as d,G as e,z as f,m as g,X as h,M as i,E as j,w as k,H as l,Z as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-PPTZHIIZ.js";import{a as i}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-PPTZHIIZ.js";import{a as i}from"./chunk-QWQ7KY5S.js";import{$ as u,Cd as h,Gd as d,ja as m,na as g,r as s}from"./chunk-DUSKF5IQ.js";var c=class n{http=g(d);uploadFile(t,e){o.IsEmpty(e)&&(e="testfolder");let r=new h({"Cache-Control":"no-cache"});return this.http.put(`${i.uppy.storageHost}/api/upload/binary/${e}/${t.name}`,t,{headers:r})}uploadFileThroughPreSignedUrl(t,e,r=!0,a){o.IsEmpty(e)&&(e="testfolder");let l=new File([t],t.name.replace(/ /g,"_"),{type:t.type});return a=a||(r?"small":void 0),this.generatePreSignedURL(l,e,a).pipe(u(p=>this.http.put(p.Authorization,l).pipe(s(()=>({url:p.URL,thumbnail:p.Thumbnail})))))}uploadFileToServer(t,e){return this.uploadFile(t,e).pipe(s(r=>r.URL))}uploadWithSignedUrl(t,e){return this.http.put(t,e)}generatePreSignedURL(t,e,r){return this.http.get(`${i.uppy.storageHost}/api/GeneratePresigned/${e}/${t.name}${r?`?thumbnail=${r}`:""}`)}deleteImageInBucket(t,e){return this.http.delete(`${i.uppy.storageHost}/api/Upload/Delete/${e}/${t}`)}uploadRemoteURLToCloudflare(t){return this.http.post(`${i.uppy.storageHost}/api/upload/MultiURL`,t)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=m({token:n,factory:n.\u0275fac,providedIn:"root"})};export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ae}from"./chunk-N24DKJZX.js";import{p as ie}from"./chunk-ME5A6DKC.js";import{b as K,c as U}from"./chunk-7GBU7E7F.js";import{a as te}from"./chunk-
|
|
1
|
+
import{a as ae}from"./chunk-N24DKJZX.js";import{p as ie}from"./chunk-ME5A6DKC.js";import{b as K,c as U}from"./chunk-7GBU7E7F.js";import{a as te}from"./chunk-RSCYVQVF.js";import{a as X}from"./chunk-WDG3LESE.js";import{b as Z}from"./chunk-6623DFFS.js";import{g as ee}from"./chunk-HZCMDR2D.js";import{a as $}from"./chunk-C72Q7NCM.js";import{c as Y}from"./chunk-LCBHD53Y.js";import{h as Q,o as z}from"./chunk-R36OIJC7.js";import{b as J}from"./chunk-K74WZXBF.js";import{n as H,q as G}from"./chunk-ETYXTCKV.js";import{$a as C,Ab as M,Ac as B,Bb as V,Cb as P,Db as g,Dc as N,Eb as n,Fb as r,Fc as h,Gb as k,Hc as x,Lc as O,Nd as A,Pb as f,Qd as q,Sb as v,Ua as l,Ub as m,db as b,hc as o,ib as I,ic as T,jb as W,jc as R,mc as u,nc as y,oc as S,qd as j,ra as s,sa as d,wb as L,yb as E}from"./chunk-DUSKF5IQ.js";import{a as w,b as F}from"./chunk-NF7PG5F2.js";var re=(p,c,t,a,e,i)=>({LogisticServiceID:p,EntityID:c,From:t,To:a,StartTime:e,EndTime:i}),oe=(p,c,t)=>({From:p,To:c,LogisticsServiceID:t});function pe(p,c){if(p&1){let t=f();n(0,"button",4),v("click",function(){s(t);let e=m();return d(e.openExportModal())}),k(1,"i",5),o(2," Export "),r()}}function le(p,c){if(p&1){let t=f();n(0,"div",6)(1,"h6"),o(2,"Outlet"),r(),n(3,"outlet-selector",7),S("ngModelChange",function(e){s(t);let i=m();return y(i.pageData().Filter.EntityID,e)||(i.pageData().Filter.EntityID=e),d(e)}),r(),n(4,"h6"),o(5,"From"),r(),n(6,"datepicker",8),S("dateChange",function(e){s(t);let i=m();return y(i.pageData().Filter.From,e)||(i.pageData().Filter.From=e),d(e)}),r(),n(7,"h6"),o(8,"To"),r(),n(9,"datepicker",9),S("dateChange",function(e){s(t);let i=m();return y(i.pageData().Filter.To,e)||(i.pageData().Filter.To=e),d(e)}),r(),n(10,"h6"),o(11,"Time"),r(),n(12,"div",10)(13,"div",11)(14,"app-timepicker",12),S("timeChange",function(e){s(t);let i=m();return y(i.pageData().Filter.StartTime,e)||(i.pageData().Filter.StartTime=e),d(e)}),r()(),n(15,"div",11)(16,"app-timepicker",12),S("timeChange",function(e){s(t);let i=m();return y(i.pageData().Filter.EndTime,e)||(i.pageData().Filter.EndTime=e),d(e)}),r()()()()}if(p&2){let t,a=m();l(3),g("accessType",2),u("ngModel",a.pageData().Filter.EntityID),g("outlets",(t=a.pageData().Options)==null?null:t.Entities),l(3),u("date",a.pageData().Filter.From),l(3),u("date",a.pageData().Filter.To),l(5),g("fullWidth",!0),u("time",a.pageData().Filter.StartTime),l(2),g("fullWidth",!0),u("time",a.pageData().Filter.EndTime)}}function me(p,c){if(p&1&&(n(0,"tr")(1,"td"),o(2),r(),n(3,"td"),o(4),r(),n(5,"td",21)(6,"a",22),h(7,"date"),h(8,"date"),o(9),r()(),n(10,"td",21)(11,"a",23),h(12,"date"),h(13,"date"),o(14),r()(),n(15,"td",21),o(16),r()()),p&2){let t=c.$implicit,a=c.$index,e=m(2);l(2),T(a+1),l(2),T(t.Name),l(2),g("queryParams",N(19,re,t.ID,e.pageData().Filter.EntityID,x(7,7,e.pageData().Filter.From,"yyyy-MM-dd"),x(8,10,e.pageData().Filter.To,"yyyy-MM-dd"),e.pageData().Filter.StartTime,e.pageData().Filter.EndTime)),l(3),R(" ",t.Trans," "),l(2),g("queryParams",B(26,oe,x(12,13,e.pageData().Filter.From,"yyyy-MM-dd"),x(13,16,e.pageData().Filter.To,"yyyy-MM-dd"),t.ID)),l(3),R(" ",t.Qty," "),l(2),T(t.Weight)}}function ce(p,c){if(p&1){let t=f();n(0,"content")(1,"div",13)(2,"table",14),v("matSortChange",function(e){s(t);let i=m();return d(i.sortData(e))}),n(3,"thead",15)(4,"tr")(5,"th",16),o(6,"No"),r(),n(7,"th"),o(8,"Logistics Service Name"),r(),n(9,"th",17),o(10,"Trans"),r(),n(11,"th",18),o(12,"Qty"),r(),n(13,"th",19),o(14," Weight "),n(15,"small",20),o(16,"(gram)"),r()()()(),n(17,"tbody"),V(18,me,17,30,"tr",null,M),r()()()()}if(p&2){let t=m();l(18),P(t.data().Data)}}var ne=class p extends X{constructor(t,a,e,i,D,_){super(t,a,"Report/GetLogisticsService","ReportLoader/GetLogisticsService",e,i);this.matDialog=D;this.roleService=_}matDialog;roleService;originalData=[];postInit(t){this.originalData=t.Data}sortData(t){let a=this.data().Data.slice();if(!t.active||t.direction===""){this.data.update(i=>F(w({},i),{Data:this.originalData}));return}let e=a.sort((i,D)=>this.compare(i[t.active],D[t.active],t.direction==="asc"));this.data.update(i=>F(w({},i),{Data:e}))}openExportModal(){this.matDialog.open(Z,{data:{title:"Logistic Service",exportTypes:[{ID:"ReportExport/LogisticService",Value:"Default",FileName:"Logistics Service"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"",pagination:!1}})}onChangeTime(t,a){let e=t.toTimeString().split(" ")[0].slice(0,5);this.pageData().Filter[a]=e}static \u0275fac=function(a){return new(a||p)(C($),C(G),C(H),C(A),C(Y),C(J))};static \u0275cmp=b({type:p,selectors:[["POS-logistics-service-report"]],standalone:!1,features:[I],decls:9,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["routerLink","/menu/Logistics/Report/Outbound/Logistics_Service/Detail",1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6"],[3,"timeChange","fullWidth","time"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","50px"],["mat-sort-header","Trans",1,"align-right"],["mat-sort-header","Qty",1,"align-right"],["mat-sort-header","Weight",1,"align-right",2,"width","180px"],[1,"fst-italic","text-dark"],[1,"text-end"],["routerLink","/menu/Logistics/Report/Outbound/Logistics_Service/Detail",3,"queryParams"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(a,e){if(a&1){let i=f();n(0,"mainpanel-cmp",1),S("textChange",function(_){return s(i),y(e.pageData().Filter.Name,_)||(e.pageData().Filter.Name=_),d(_)}),v("onSubmit",function(){return e.searchFromPageOne()}),S("filterChange",function(_){return s(i),y(e.pageData().Filter,_)||(e.pageData().Filter=_),d(_)}),n(1,"actions"),L(2,pe,3,0,"button",2),n(3,"a",3),o(4," View Detail "),r()(),n(5,"filters"),W(6,le,17,9,"ng-template",null,0,O),r(),L(8,ce,20,0,"content"),r()}a&2&&(g("pageData",e.menuData()),u("text",e.pageData().Filter.Name),g("isFilterOnDropdown",!1),u("filter",e.pageData().Filter),l(2),E(e.roleService.global.Export?2:-1),l(6),E(e.data()?8:-1))},dependencies:[q,Q,z,ee,ie,K,U,ae,te,j],encapsulation:2,changeDetection:0})};export{ne as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-Q6MXTRRK.js";import{a as t}from"./chunk-NF7PG5F2.js";var i=class extends e{constructor(r,a,o,l,s,p,F){super(r,a,o,l,s,p,F)}preInitLoader(){this.loaderPayload.set(t({ListIDs:this.reportFilterService.initOutletFilter([])},this.loaderPayload()))}preInitList(){this.pageData().Filter.ListIDs=this.loaderPayload().ListIDs,this.pageData().Filter.From=this.reportFilterService.initDateFromFilter(this.pageData()?.Filter?.From),this.pageData().Filter.To=this.reportFilterService.initDateToFilter(this.pageData()?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData().Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData()?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData()?.Filter?.To)}};export{i as a};
|