dealpos 26.27.0 → 26.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-ZHFKK2TY.js → chunk-2MV5KVIA.js} +1 -1
- package/browser/{chunk-OSVSFFLO.js → chunk-2R7ZZH5Z.js} +1 -1
- package/browser/{chunk-DPXQXUDL.js → chunk-2W2QBSBZ.js} +1 -1
- package/browser/{chunk-L5I2WRDG.js → chunk-3B7H65X3.js} +1 -1
- package/browser/{chunk-5P4YLGSA.js → chunk-3KEKQH6A.js} +1 -1
- package/browser/{chunk-O56JQI2R.js → chunk-3LJ2CP4N.js} +1 -1
- package/browser/{chunk-CHWN4ZRP.js → chunk-4MQVLLUY.js} +1 -1
- package/browser/{chunk-HK4IX66A.js → chunk-4XAQBDYT.js} +1 -1
- package/browser/{chunk-TEN63UPD.js → chunk-4YYVCDNM.js} +1 -1
- package/browser/{chunk-IPY7AQF7.js → chunk-633FRUS5.js} +1 -1
- package/browser/{chunk-Z3TOPXSI.js → chunk-65M35W4S.js} +1 -1
- package/browser/{chunk-R5BHJOM2.js → chunk-67QS6EYV.js} +2 -2
- package/browser/{chunk-NYKWLHRU.js → chunk-6IHTUUH4.js} +1 -1
- package/browser/{chunk-37RMQAY3.js → chunk-7MTFWZIE.js} +1 -1
- package/browser/chunk-A5GEYJBQ.js +1 -0
- package/browser/{chunk-SLJO3XGQ.js → chunk-ABB42JIM.js} +1 -1
- package/browser/{chunk-TWHGELKU.js → chunk-AGSBLDA5.js} +12 -12
- package/browser/{chunk-MIT6FMZM.js → chunk-AJV3ZHWG.js} +1 -1
- package/browser/{chunk-D7IFPMOZ.js → chunk-AMURX7ST.js} +1 -1
- package/browser/{chunk-OMHCBDJP.js → chunk-ASV5HO24.js} +1 -1
- package/browser/{chunk-566RJ33S.js → chunk-AYOPP5VW.js} +1 -1
- package/browser/{chunk-5ARS536I.js → chunk-AYUCR6GN.js} +1 -1
- package/browser/{chunk-3VG6MUUN.js → chunk-BJ7YQSDZ.js} +1 -1
- package/browser/{chunk-PIMTXCDH.js → chunk-BMIDAO5U.js} +1 -1
- package/browser/{chunk-DP3URD6L.js → chunk-BVLBNLJF.js} +1 -1
- package/browser/{chunk-VI6JZFDW.js → chunk-C7QPL2ZR.js} +1 -1
- package/browser/{chunk-P4CHTDQE.js → chunk-CLKN3JB6.js} +1 -1
- package/browser/{chunk-SZRG2NWD.js → chunk-EAV6HDFE.js} +1 -1
- package/browser/{chunk-AQDNSORR.js → chunk-EB5BSUXE.js} +1 -1
- package/browser/{chunk-DBLPXWSR.js → chunk-EKY7G7VT.js} +1 -1
- package/browser/{chunk-FRVK7X3T.js → chunk-ELSQQXSW.js} +2 -2
- package/browser/{chunk-5WLKUVPJ.js → chunk-EP66QZUX.js} +1 -1
- package/browser/{chunk-EU7SDPRR.js → chunk-FNZRMZ6X.js} +1 -1
- package/browser/{chunk-L4DG7BMT.js → chunk-FPZNLFVS.js} +1 -1
- package/browser/{chunk-QOJ4DS7T.js → chunk-FVLDXU4M.js} +1 -1
- package/browser/{chunk-DPUBDQPJ.js → chunk-G5NPCBLQ.js} +1 -1
- package/browser/{chunk-JQOZDJKD.js → chunk-GFCDWDLP.js} +1 -1
- package/browser/{chunk-BXYK3EH6.js → chunk-GGHYRTMD.js} +1 -1
- package/browser/{chunk-Q5LNTINY.js → chunk-GXPECW4D.js} +1 -1
- package/browser/{chunk-3QS5HGAD.js → chunk-HGQTG5I4.js} +1 -1
- package/browser/{chunk-7ZWRQQVV.js → chunk-HTS2LI7U.js} +2 -2
- package/browser/{chunk-R4JYAXIW.js → chunk-I6QIHEX7.js} +1 -1
- package/browser/{chunk-5NCVVIOZ.js → chunk-IL7FAAJ5.js} +2 -2
- package/browser/{chunk-YDEHQ3ZP.js → chunk-ILQ3WZYZ.js} +1 -1
- package/browser/{chunk-IKZB5LE7.js → chunk-ITORJP4G.js} +1 -1
- package/browser/{chunk-PRT2B7SU.js → chunk-K44IWJ4I.js} +1 -1
- package/browser/{chunk-HNFMS3BA.js → chunk-KBBW3F5Q.js} +1 -1
- package/browser/{chunk-RBGR22WQ.js → chunk-KE4GAZNO.js} +2 -2
- package/browser/{chunk-QV6JTTJC.js → chunk-KPRPER2B.js} +1 -1
- package/browser/{chunk-W2IIXXFC.js → chunk-KTAQKPMS.js} +1 -1
- package/browser/{chunk-LTRIFCCM.js → chunk-KU7UZNJ6.js} +1 -1
- package/browser/{chunk-4NNI4J4D.js → chunk-L3CIISQE.js} +1 -1
- package/browser/chunk-LJKPEHL2.js +1 -0
- package/browser/{chunk-PNWJGCJI.js → chunk-M4BRJSPL.js} +1 -1
- package/browser/{chunk-A6GX7PFA.js → chunk-MTTGR5QJ.js} +1 -1
- package/browser/{chunk-TAIGI6QU.js → chunk-MTTLORH6.js} +1 -1
- package/browser/{chunk-LWURKTRS.js → chunk-MZCAAHG3.js} +1 -1
- package/browser/{chunk-777IDAPR.js → chunk-N64W57YG.js} +1 -1
- package/browser/{chunk-CW3RBBZ3.js → chunk-NCS3QPTB.js} +1 -1
- package/browser/{chunk-ZO2QPDZK.js → chunk-NTAQ64Z7.js} +1 -1
- package/browser/{chunk-AR4N6TYQ.js → chunk-NW5MHPAQ.js} +4 -4
- package/browser/{chunk-JHEYNOGM.js → chunk-O57EMUGS.js} +1 -1
- package/browser/{chunk-CLH4OOZC.js → chunk-OX6RKTK4.js} +1 -1
- package/browser/{chunk-V7EVOFL5.js → chunk-P5S3C3JS.js} +1 -1
- package/browser/{chunk-3LEBT3T2.js → chunk-PG5A2LDV.js} +1 -1
- package/browser/{chunk-TS6BPKQF.js → chunk-PK7KHYC2.js} +1 -1
- package/browser/{chunk-7XIOKBLQ.js → chunk-QGJKAVKL.js} +1 -1
- package/browser/{chunk-AFGBUFB6.js → chunk-QPAV7CUL.js} +1 -1
- package/browser/{chunk-KKEQLJ54.js → chunk-QXHC7WBD.js} +1 -1
- package/browser/{chunk-Z2RIFPJJ.js → chunk-R2RFD44H.js} +2 -2
- package/browser/{chunk-3N3H22LP.js → chunk-RLIFQL7B.js} +1 -1
- package/browser/{chunk-IY55AS53.js → chunk-RQO54LVJ.js} +1 -1
- package/browser/{chunk-B6Z3X5BS.js → chunk-RQT543Y2.js} +1 -1
- package/browser/{chunk-VLP7ODVV.js → chunk-RTCAJRBB.js} +1 -1
- package/browser/{chunk-NSJQHWDB.js → chunk-S2JOR54V.js} +1 -1
- package/browser/{chunk-F5B3VIWI.js → chunk-SPQCC6GH.js} +1 -1
- package/browser/{chunk-G3DUE5AS.js → chunk-SURY5MFM.js} +1 -1
- package/browser/{chunk-QZKGIQW2.js → chunk-T7X4KP7L.js} +1 -1
- package/browser/{chunk-A7UIEYJJ.js → chunk-TK46K4GX.js} +1 -1
- package/browser/{chunk-46C5UJIZ.js → chunk-TKWTC5AR.js} +1 -1
- package/browser/{chunk-XYKAVWGJ.js → chunk-TM3VICCM.js} +1 -1
- package/browser/{chunk-32Y3O6F4.js → chunk-TR4OOSPS.js} +1 -1
- package/browser/{chunk-GLGYPZKF.js → chunk-UBNURVIP.js} +1 -1
- package/browser/{chunk-SDLUJRLA.js → chunk-ULUCB23C.js} +1 -1
- package/browser/{chunk-4ITWTHEP.js → chunk-UWY3WE5K.js} +1 -1
- package/browser/{chunk-NERMDYVG.js → chunk-VB5GJDE2.js} +1 -1
- package/browser/{chunk-ZQUGUTTB.js → chunk-VFASU4X4.js} +1 -1
- package/browser/{chunk-RUER5CBO.js → chunk-WL7S6PLU.js} +1 -1
- package/browser/{chunk-TLONVMHZ.js → chunk-WQKQVTK2.js} +1 -1
- package/browser/{chunk-JX5X26FV.js → chunk-XXMNWQLV.js} +7 -7
- package/browser/{chunk-JER6CPVQ.js → chunk-Y5E4XPA2.js} +2 -2
- package/browser/{chunk-LKK7ANEQ.js → chunk-YB6MYOSW.js} +1 -1
- package/browser/{chunk-YHBRITRI.js → chunk-YCQQOVXL.js} +1 -1
- package/browser/{chunk-HSBZGQQH.js → chunk-YIFFZ4KI.js} +1 -1
- package/browser/{chunk-CEXOTUND.js → chunk-YQI4LPEX.js} +1 -1
- package/browser/{chunk-C3CVIFD2.js → chunk-YWYPFRBH.js} +1 -1
- package/browser/{chunk-YN6BKUMS.js → chunk-YYHQROLO.js} +1 -1
- package/browser/{chunk-7PVFC4LN.js → chunk-Z6FBE366.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-KCGGUDLM.js → main-KCZUFCQ5.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-BZMRCMGG.js +0 -1
- package/browser/chunk-GVHNZ26L.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as $}from"./chunk-S77FVPQM.js";import{a as T,b as Q}from"./chunk-NH6IWUZH.js";import{a as h}from"./chunk-NZXJPRXS.js";import{a as W}from"./chunk-LZAV46F7.js";import{a as A,c as q}from"./chunk-566RJ33S.js";import{b as J,c as P}from"./chunk-R4JYAXIW.js";import{a as c}from"./chunk-SY5NNN4M.js";import{a as l}from"./chunk-PTRS3UA6.js";import{a as F}from"./chunk-YN6BKUMS.js";import{n as I,q as C}from"./chunk-D3E5UKKJ.js";import{C as b,G,O as f,_ as U,b as B,e as D,ha as d,ka as u,m as V,p as L,pd as k,r as S}from"./chunk-M3O2GJ3M.js";import{h as p}from"./chunk-KMHZKFQS.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 K=(i=>(i[i.Unsent=0]="Unsent",i[i.AwaitingCollection=1]="AwaitingCollection",i[i.Partial=2]="Partial",i[i.Sent=3]="Sent",i))(K||{});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 x=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 R=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(()=>x)],m.prototype,"Payments",2),p([h(()=>T)],m.prototype,"Items",2),p([h(()=>Q)],m.prototype,"CartItems",2),p([h(()=>R)],m.prototype,"Promotion",2);var N=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 M=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})}_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(G(e=>e?.message?.includes("objectStore does not exists")?this.submitOnline(t):V(()=>e)))}submitOnline(t){return this.httpService.post(c.SubmitOrder,t,F.pos.submitOrderTimeout)}handleTimeOutError(t){return B(G(e=>{if(e instanceof L||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 T;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.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 N;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(J.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(C),u(P),u(A),u(I))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};var z=(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))(z||{});var E=class s{constructor(t,e,r){this._OrderHttpService=t;this._customerHttpService=e;this._toastrService=r}_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(M),u(q),u(I))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};var w=class s{constructor(t,e,r){this._localDataService=t;this._onlineStatusService=e;this._httpService=r;this._onlineStatusService.getOnlineStatus$().subscribe(i=>{this.isOnline=i})}_Data=new D(null);Data$=this._Data.asObservable().pipe(b(t=>t!==null),f());isOnline;get Data(){return this._Data.value}pushNewValue(t){this._Data.next(t)}requestObservable(){return this.isOnline?this._httpService.get(c.GetPOSStorage).pipe(S(t=>({data:t,type:"Online"}))):this._localDataService.getPOSStorage().pipe(b(t=>t!=null),S(t=>({data:t,type:"Offline"})))}getOutletName(t){return this.Data.Entities.find(r=>r.ID==t)?.Name}static \u0275fac=function(e){return new(e||s)(u(P),u(A),u(C))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};var X=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 H=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 Y=class s{constructor(t,e,r,i){this._orderDataService=t;this._posService=e;this.POSMATH=r;this.decimalPipe=i;this._orderDataService.Data$.pipe(U(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)})}_Data=new D(0);Data$=this._Data.asObservable().pipe(f());tax=new $;discountAfterTax=0;currencySymbol="Rp";get Data(){return this._Data.value}salesOrderData=new m;appConfigJSON=new H;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 j of t)i=j.getItemAfterDiscount/e,o=i*r,n=o*j.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(E),u(w),u(W),u(k))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};export{X as a,O as b,v as c,x as d,H as e,K as f,m as g,z as h,N as i,M as j,E as k,w as l,Y as m};
|
|
1
|
+
import{b as $}from"./chunk-S77FVPQM.js";import{a as T,b as Q}from"./chunk-NH6IWUZH.js";import{a as h}from"./chunk-NZXJPRXS.js";import{a as W}from"./chunk-LZAV46F7.js";import{a as A,c as q}from"./chunk-AYOPP5VW.js";import{b as J,c as P}from"./chunk-I6QIHEX7.js";import{a as c}from"./chunk-SY5NNN4M.js";import{a as l}from"./chunk-PTRS3UA6.js";import{a as F}from"./chunk-YYHQROLO.js";import{n as I,q as C}from"./chunk-D3E5UKKJ.js";import{C as b,G,O as f,_ as U,b as B,e as D,ha as d,ka as u,m as V,p as L,pd as k,r as S}from"./chunk-M3O2GJ3M.js";import{h as p}from"./chunk-KMHZKFQS.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 K=(i=>(i[i.Unsent=0]="Unsent",i[i.AwaitingCollection=1]="AwaitingCollection",i[i.Partial=2]="Partial",i[i.Sent=3]="Sent",i))(K||{});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 x=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 R=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(()=>x)],m.prototype,"Payments",2),p([h(()=>T)],m.prototype,"Items",2),p([h(()=>Q)],m.prototype,"CartItems",2),p([h(()=>R)],m.prototype,"Promotion",2);var N=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 M=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})}_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(G(e=>e?.message?.includes("objectStore does not exists")?this.submitOnline(t):V(()=>e)))}submitOnline(t){return this.httpService.post(c.SubmitOrder,t,F.pos.submitOrderTimeout)}handleTimeOutError(t){return B(G(e=>{if(e instanceof L||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 T;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.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 N;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(J.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(C),u(P),u(A),u(I))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};var z=(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))(z||{});var E=class s{constructor(t,e,r){this._OrderHttpService=t;this._customerHttpService=e;this._toastrService=r}_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(M),u(q),u(I))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};var w=class s{constructor(t,e,r){this._localDataService=t;this._onlineStatusService=e;this._httpService=r;this._onlineStatusService.getOnlineStatus$().subscribe(i=>{this.isOnline=i})}_Data=new D(null);Data$=this._Data.asObservable().pipe(b(t=>t!==null),f());isOnline;get Data(){return this._Data.value}pushNewValue(t){this._Data.next(t)}requestObservable(){return this.isOnline?this._httpService.get(c.GetPOSStorage).pipe(S(t=>({data:t,type:"Online"}))):this._localDataService.getPOSStorage().pipe(b(t=>t!=null),S(t=>({data:t,type:"Offline"})))}getOutletName(t){return this.Data.Entities.find(r=>r.ID==t)?.Name}static \u0275fac=function(e){return new(e||s)(u(P),u(A),u(C))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};var X=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 H=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 Y=class s{constructor(t,e,r,i){this._orderDataService=t;this._posService=e;this.POSMATH=r;this.decimalPipe=i;this._orderDataService.Data$.pipe(U(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)})}_Data=new D(0);Data$=this._Data.asObservable().pipe(f());tax=new $;discountAfterTax=0;currencySymbol="Rp";get Data(){return this._Data.value}salesOrderData=new m;appConfigJSON=new H;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 j of t)i=j.getItemAfterDiscount/e,o=i*r,n=o*j.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(E),u(w),u(W),u(k))};static \u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})};export{X as a,O as b,v as c,x as d,H as e,K as f,m as g,z as h,N as i,M as j,E as k,w as l,Y as m};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as St}from"./chunk-KYGIDMGO.js";import"./chunk-R2UNPOYE.js";import{a as Ot}from"./chunk-RXZDFS3M.js";import{a as v}from"./chunk-3UB7PEG5.js";import{a as Mt}from"./chunk-DVI52XSU.js";import"./chunk-6HNYSYBG.js";import{c as Et,i as S,j as It}from"./chunk-WIUSOID5.js";import{Ea as Pt,va as Tt,wa as I}from"./chunk-K7ICHNI3.js";import{E as yt,F as vt,a as ft,h as _t,i as ht,k as wt,o as Ct,p as xt}from"./chunk-POUQHZWU.js";import{a as mt}from"./chunk-
|
|
1
|
+
import{a as St}from"./chunk-KYGIDMGO.js";import"./chunk-R2UNPOYE.js";import{a as Ot}from"./chunk-RXZDFS3M.js";import{a as v}from"./chunk-3UB7PEG5.js";import{a as Mt}from"./chunk-DVI52XSU.js";import"./chunk-6HNYSYBG.js";import{c as Et,i as S,j as It}from"./chunk-WIUSOID5.js";import{Ea as Pt,va as Tt,wa as I}from"./chunk-K7ICHNI3.js";import{E as yt,F as vt,a as ft,h as _t,i as ht,k as wt,o as Ct,p as xt}from"./chunk-POUQHZWU.js";import{a as mt}from"./chunk-YYHQROLO.js";import{n as gt,q as bt}from"./chunk-D3E5UKKJ.js";import{Aa as Q,Ab as m,Bb as r,Ca as N,Cb as a,Db as E,Hb as O,Ib as M,Jb as J,Lc as rt,Mb as w,Md as ct,Pb as f,Qc as R,Ra as l,Rb as s,Rc as st,Ub as W,Wb as A,Xb as D,Ya as K,Zb as X,Zc as j,_b as tt,ab as T,bb as L,dc as y,eb as Y,ec as c,fb as G,fc as et,fd as at,ga as $,gb as P,gc as nt,ha as z,hd as pt,ia as U,id as lt,ja as q,kd as ut,la as x,pa as u,pb as Z,qa as d,qc as B,sd as dt,tb as _,tc as it,vb as h,wa as b,wc as H,xc as ot,za as g}from"./chunk-M3O2GJ3M.js";import{a as F,b as V}from"./chunk-KMHZKFQS.js";var kt=`
|
|
2
2
|
.p-inputotp {
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C}from"./chunk-
|
|
1
|
+
import{a as C}from"./chunk-HGQTG5I4.js";import{a as w}from"./chunk-MTTGR5QJ.js";import{a as A}from"./chunk-5OLVUC6J.js";import{a as x}from"./chunk-BC7YQBUB.js";import{a as I}from"./chunk-MMKYHF6F.js";import{a as c}from"./chunk-3UB7PEG5.js";import{a as l}from"./chunk-PTRS3UA6.js";import{ca as L,la as f,r as F,x as S,za as P}from"./chunk-M3O2GJ3M.js";import{a as y}from"./chunk-KMHZKFQS.js";var d=class{enabledDragItem;constructor(){this.enabledDragItem=!1}drop(o,t){A(t.Data,o.previousIndex,o.currentIndex)}toggleEnabledDragItem(){}onSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.postListID(o,t.data.Data)}onPutSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.putListID(o,t.data.Data)}};var D=class{constructor(o){this.httpService=o}exportCSV(o,t,e,i){e.pageData.Filter.Export=!0,e.pageData.Filter.FormatType=0,i=i||"export.csv",this.httpService.post(`/api/${t}`,e.pageData.Filter).subscribe(r=>{o.convertToCSV(r,i),e.pageData.Filter.Export=!1})}convertToCSV(o,t=!1,e){let i=this.ExportDataFromUI2(t);o.convertToCSV(i,e)}ExportDataFromUI2(o=!1){let t=document.getElementById("tableGrid"),e=[];return l.IsNotEmpty(t)&&t.querySelectorAll("tr").forEach(r=>{let a=new Object,s=0;r.querySelectorAll("th, td").forEach(n=>{s++;let v=parseInt(n.getAttribute("colspan"));for(let u=1;u<v;u++)a["column"+s]="",s++;let p=n.innerText,h=p.toString().split("");if(o&&h[0]==="0"&&h.length>1){let u="'"+p.trim();a["column"+s]=u}else a["column"+s]=p.trim()}),e.push(a)}),e}};var b=class{listTotal;pageSize;show;constructor(){this.listTotal=0,this.pageSize=0,this.show=!1}changePaginationData(o){this.pageSize=o.pageData.Filter.RowCount,this.listTotal=o.data?.ListTotal??o.data?.Data?.total?.value,this.show=this.pageSize<=this.listTotal}changePage(o,t,e){t.Filter.PageNumber=o.pageIndex+1,e.getListData()}};var M=class extends x{constructor(t,e,i,r,a,s,g,n="post",v="post"){super(t);this.httpService=e;this.dataAPI=i;this.pageAPI=r;this.toastrService=a;this.route=s;this.initOpenDialog=g;this.dataMethod=n;this.loaderMethod=v;this.exportHandler=new D(e),r?(s&&(this.loaderPayload=y({ListIDs:this.reportFilterService?.initOutletFilter()},s.snapshot.queryParams)),this.preInitLoader(),S([this.menuData$,this.callApi("/api/"+this.pageAPI,this.loaderPayload,this.loaderMethod)]).pipe(F(([p,h])=>h)).pipe(I()).subscribe(p=>{this.pageData=p,this.pageData.Filter||(this.pageData.Filter={},this.pageData.Filter.RowCount=20),this.pageData.Filter.PageNumber=1,this.pageData.Filter.ID=this.loaderPayload.ID,this.preInitList(),this.initOpenDialog?this.openDialogFilter.openDialog():this.getListData()})):(this.pageData.Filter.RowCount=20,this.pageData.Filter.PageNumber=1,this.preInitList(),S({menuData:this.menuData$,listData:this.getListData$()}).pipe(I()).subscribe())}openDialogFilter=f(w);reportFilterService=f(C);pageData={Filter:{},Options:{},Roles:{},Config:{}};data;pagination=new b;dragDrop=new d;exportHandler;comparation=0;loaderPayload={};reloadRowCount=P(!1);mapToKeyValueArray(t){return t?Object.keys(t).map(e=>({key:e,value:t[e]})):[]}callApi(t,e,i="post"){let r=t;if(i==="get"){let a=this.mapToKeyValueArray(e);return this.httpService.get(r,a)}return this.httpService[i](r,e)}preInitLoader(){}preInitList(){}getListData(t){this.preGetList(),this.dataAPI&&this.callApi("/api/"+this.dataAPI,this.pageData.Filter,this.dataMethod).subscribe(e=>{e.PageSubTitle&&(this.menuData.SH=e.PageSubTitle),this.data=e,this.postInit(e),this.reloadRowCount.set(!0),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)})}getListData$(t){return this.preGetList(),this.callApi("/api/"+this.dataAPI,this.pageData.Filter,this.dataMethod).pipe(L(e=>{this.data=e,this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)}))}searchFromPageOne(){this.preSearchFromPageOne(),this.pageData.Filter.PageNumber=1,this.getListData("filterMode")}postInit(t){t.PageTitle!=null&&(this.menuData.H=t.PageTitle)}preGetList(){this.pageData.Filter.From==null&&(this.pageData.Filter.From=l.MinDate),this.pageData.Filter.To==null&&(this.pageData.Filter.To=l.MinDate)}preSearchFromPageOne(){}onPaginationChange(t){this.pagination.changePage(t,this.pageData,this)}onSelectAllData(t){this.data.Data=this.data.Data.map(e=>(e.selected=t,e))}getSelectedData(){let t=[];return this.data&&(t=this.data.Data.filter(e=>e.selected)),t}httpPostListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.postListID(t,r,i)}httpPutListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.putListID(t,r,i)}httpDeleteListID(t,e,i){if(e||(e="Are you sure you want to delete selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.DeleteListID(t,r,i)}onSaveDragAndDrop(t){this.dragDrop.onSaveDragAndDrop(t,this)}onPutSaveDragAndDrop(t){this.dragDrop.onPutSaveDragAndDrop(t,this)}postListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.post(`/api/${t}`,r,1e6,!0).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.getListData()},a=>{let s=a.status+" "+a.statusText;this.toastrService.error(a.error.Message!=""?a.error.Message:"An unknown error has occured!",s,{enableHtml:!0})})}putListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.put(`/api/${t}`,r).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.delete(`/api/${t}`,{body:r}).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.getListData()})}postData(t,e){this.httpService.post("/API/"+t,e).subscribe(i=>{this.getListData(),this.toastrService.success(i.Message?i.Message:i,c.Success)})}compare(t,e,i){return(t<e?-1:1)*(i?1:-1)}exportCSV(t,e,i){this.exportHandler.exportCSV(t,e,this,i)}s2ab(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),r=0;r!=t.length;++r)i[r]=t.charCodeAt(r)&255;return e}exportXlsx(t,e){this.pageData.Filter.FormatType=1,this.pageData.Filter.Export=!0,this.httpService.post(`/api/${t}`,this.pageData.Filter).subscribe(i=>{e=decodeURI(e);let r=window.URL.createObjectURL(new Blob([this.s2ab(atob(i))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),a=document.createElement("a");a.href=r,a.setAttribute("download",e),document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(r),a.remove()})}convertToCSV(t,e=!1,i){let r=this.exportHandler.ExportDataFromUI2(e);t.convertToCSV(r,i)}OnCompare(t){let e=t?this.data[t]:this.data;if(e.length<1)return;let i=Object.assign({},this.pageData.Filter);i.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),i.To=new Date(new Date(this.pageData.Filter.To).getFullYear(),new Date(this.pageData.Filter.To).getMonth(),0).toDateString(),this.httpService.post("/API/"+this.dataAPI,i).subscribe(r=>{let a=t?r[t]:r;this.comparation=0,e.forEach(s=>{s.PrevIndex="-",s.CurrentIndex="-",s.Increase="-";let g=a.filter(n=>n.EntityID==s.EntityID);if(s.CurrentIndex=s.Rank,g.length>0){let n=g[0];s.PrevIndex=n.Rank,n.SalesNet?s.Increase=(s.SalesNet-n.SalesNet)/n.SalesNet*100:n.Sales&&(s.Increase=(s.Sales-n.Sales)/n.Sales*100),s.IsPositive=s.Increase>0,s.IsNegative=s.Increase<0,this.comparation+=s.Increase}})})}};export{M as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as C}from"./chunk-
|
|
1
|
+
import{c as C}from"./chunk-633FRUS5.js";import"./chunk-T7X4KP7L.js";import"./chunk-MNXZMQRB.js";import"./chunk-WYAHUX6O.js";import{a as E}from"./chunk-PTRS3UA6.js";import"./chunk-YYHQROLO.js";import{q as y}from"./chunk-D3E5UKKJ.js";import{Eb as e,Fb as t,Gb as m,Md as v,Nb as f,Qb as h,Ra as l,Ya as d,ab as p,cc as x,ec as o,fc as s,sd as b,tb as g,vb as u,za as c}from"./chunk-M3O2GJ3M.js";import"./chunk-KMHZKFQS.js";function O(r,i){r&1&&(e(0,"div",13)(1,"span",20),o(2,"Latitude and Longitude is empty, please allow your browser location permission!"),t(),e(3,"a",21),o(4,"Click here to learn how to manually activate the location permission"),t()())}var _=class r{constructor(i,a,n){this.auth=i;this.http=a;this.router=n}centerGeoPanelStyle="display: flex; flex-direction: column; justify-content: center;";latLong=c({latitude:"",longitude:""});ngOnInit(){this.checkOnRefreshPage(),document.body.classList.add("login-body"),this.getGeolocation()}ngOnDestroy(){document.body.classList.remove("login-body")}checkOnRefreshPage(){E.IsEmpty(this.auth.loginResponse)&&this.router.navigate(["/"])}getGeolocation(){if(!navigator.geolocation){this.latLong.set({latitude:"",longitude:""});return}navigator.geolocation.getCurrentPosition(i=>{this.latLong.set({latitude:i.coords.latitude.toString(),longitude:i.coords.longitude.toString()})},()=>{this.latLong.set({latitude:"",longitude:""})},{enableHighAccuracy:!0,maximumAge:0,timeout:8e3})}proceed(){let i=this.latLong();this.http.post("/api/Authentication/LoginGeoRestriction",{UserID:this.auth.loginResponse.UserID,Latitude:i.latitude,Longitude:i.longitude}).subscribe(a=>{this.auth.saveLoginConfigToStorage(a),this.router.navigate([this.auth.getRedirectUrl()])})}static \u0275fac=function(a){return new(a||r)(d(C),d(y),d(v))};static \u0275cmp=p({type:r,selectors:[["POS-auth-geolocation"]],decls:31,vars:6,consts:[[1,"container-fluid"],[1,"row","bg-white","mx-auto","totp-pane"],[1,"col-md-7","order-md-first","order-last","form-pane"],[1,"text-start"],[1,"text-start","mb-7"],[1,"d-flex","flex-column","flex-md-row",2,"column-gap","10px"],[1,"latlong-container","d-flex","flex-grow-1"],[1,"flex-grow-1","text-start","d-flex"],[1,"lat-label","fw-bold"],[1,"ps-5","lat-value","flex-grow-1","d-flex","align-items-center"],[1,"long-label","fw-bold"],[1,"ps-5","long-value","flex-grow-1","d-flex","align-items-center"],[1,"btn","btn-success","mt-5","mx-auto","mx-md-0","mt-md-0","w-25","w-md-100",3,"click","disabled"],[1,"text-start","mt-7"],[1,"col-md-5","order-md-last","order-first","border-start","border-secondary","d-flex","align-items-center","justify-content-center","img-pane","py-6"],["src","https://cdn.dealpos.xyz/web-image/geolocation-map.png",1,"border-0","w-100"],[1,"fixed-bottom"],[1,"d-flex","justify-content-start","mb-11","mx-11","footer-mobile"],["target","_blank","href","http://www.dealpos.com"],["src","https://cdn.dealpos.app/public/logo/dealpos_130.png",1,"ms-3","border-0"],[1,"text-danger"],["href","https://support.dealpos.com/en/articles/7963864-enable-location-services-for-several-browser","target","_blank",1,"d-block"]],template:function(a,n){a&1&&(e(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),o(4,"Geo Fencing"),t(),e(5,"p",4),o(6,"You are about to sign-in from this location"),t(),e(7,"div",5)(8,"div",6)(9,"div",7)(10,"span",8),o(11,"LAT"),t(),e(12,"span",9),o(13),t()(),e(14,"div",7)(15,"span",10),o(16,"LONG"),t(),e(17,"span",11),o(18),t()()(),e(19,"button",12),h("click",function(){return n.proceed()}),o(20," Proceed "),t()(),g(21,O,5,0,"div",13),t(),e(22,"div",14),m(23,"img",15),t()(),e(24,"div",16)(25,"div",17)(26,"div")(27,"span"),o(28,"powered by :"),t(),m(29,"a",18)(30,"img",19),t()()()()),a&2&&(l(2),x(n.latLong().latitude&&n.latLong().longitude?n.centerGeoPanelStyle:""),l(11),s(n.latLong().latitude),l(5),s(n.latLong().longitude),l(),f("disabled",!(n.latLong().latitude&&n.latLong().longitude)),l(2),u(n.latLong().latitude&&n.latLong().longitude?-1:21))},dependencies:[b],styles:["input[type=submit][_ngcontent-%COMP%]{font-size:1.125rem;width:11.25rem;font-family:Roboto Slab,serif}.totp-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:140px}@media(max-width:768px){.totp-pane[_ngcontent-%COMP%]{margin-top:0}}.form-pane[_ngcontent-%COMP%]{padding:2rem}@media(max-width:768px){.form-pane[_ngcontent-%COMP%]{padding:50px 24px 30px}}@media(max-width:768px){.img-pane[_ngcontent-%COMP%]{border:0px!important}}.otp-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-size:32px;letter-spacing:32px;width:325px;font-family:monospace;background:transparent;z-index:1;position:relative}.otp-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{outline:none!important}.otp-container[_ngcontent-%COMP%] .stripe[_ngcontent-%COMP%]{font-size:32px;letter-spacing:32px;font-family:monospace;position:absolute;padding-top:6px;z-index:0;bottom:0;left:14px}.latlong-container[_ngcontent-%COMP%]{background:#fff;border:1px solid #000000;border-radius:5px}.latlong-container[_ngcontent-%COMP%] .lat-label[_ngcontent-%COMP%], .latlong-container[_ngcontent-%COMP%] .long-label[_ngcontent-%COMP%]{display:inline-block;padding:12px;border-right:1px solid #000000}.latlong-container[_ngcontent-%COMP%] .long-label[_ngcontent-%COMP%]{border-left:1px solid #000000}.latlong-container[_ngcontent-%COMP%] .lat-value[_ngcontent-%COMP%], .latlong-container[_ngcontent-%COMP%] .long-value[_ngcontent-%COMP%]{background:#d9d9d94d}"],changeDetection:0})};export{_ as AuthGeolocationComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ft,b as gt}from"./chunk-DPUBDQPJ.js";import{a as ut,b as Ct}from"./chunk-LTRIFCCM.js";import"./chunk-GLGYPZKF.js";import"./chunk-HVIKQ3QZ.js";import"./chunk-VSRJ5RWQ.js";import"./chunk-CX4UNCT3.js";import"./chunk-JLHUBVOA.js";import"./chunk-CW3RBBZ3.js";import{a as pt}from"./chunk-5WLKUVPJ.js";import"./chunk-VXMTZTSH.js";import{a as ct}from"./chunk-BYGN2PS2.js";import{a as st}from"./chunk-PY4WMHXK.js";import{a as dt}from"./chunk-MS74SREK.js";import"./chunk-B5ZKZXDH.js";import"./chunk-NVGEU7SZ.js";import"./chunk-LDU2L7YC.js";import"./chunk-T5UW3VZA.js";import"./chunk-RYN2QXQA.js";import"./chunk-ULFJRUXF.js";import"./chunk-46C5UJIZ.js";import{a as ue}from"./chunk-BKC34W6M.js";import"./chunk-U6J62ETY.js";import"./chunk-JCUDUZIE.js";import"./chunk-P3KIIKY4.js";import"./chunk-RJIB64GS.js";import{a as mt}from"./chunk-CAYJHOZ3.js";import"./chunk-IEGHFCSK.js";import"./chunk-BYXBJQAS.js";import"./chunk-TUDEWC7P.js";import"./chunk-6ZKW6NGS.js";import{a as ze,b as Qe,c as Ke,d as Ye}from"./chunk-A3XPLCMP.js";import"./chunk-22VMH5K4.js";import"./chunk-VQQIQFUB.js";import"./chunk-HKSUQNKJ.js";import"./chunk-DLBX5RSU.js";import"./chunk-YHKX3K56.js";import"./chunk-O3LZKJY2.js";import"./chunk-WLNLF7ZT.js";import"./chunk-MPGXQK5L.js";import"./chunk-Q2COUO3I.js";import"./chunk-IDHUYY2U.js";import"./chunk-KMI7GZJI.js";import"./chunk-EWMMWD7T.js";import{c as it,d as nt}from"./chunk-A75ZS57D.js";import"./chunk-HSGXXXIK.js";import"./chunk-75C5S3PQ.js";import{b as rt,c as lt}from"./chunk-IA2WDKQU.js";import"./chunk-CEXOTUND.js";import"./chunk-N5GGRFDA.js";import"./chunk-7GHVZIGG.js";import"./chunk-DPXQXUDL.js";import"./chunk-3QS5HGAD.js";import"./chunk-6KJTU3AF.js";import"./chunk-TQ2YP2CL.js";import"./chunk-T7SY746R.js";import{g as tt,h as ot}from"./chunk-A6GX7PFA.js";import"./chunk-LIMLIVTQ.js";import"./chunk-WYKVRUIW.js";import"./chunk-LVIGLDQ4.js";import{a as Je}from"./chunk-KR74ZZ6U.js";import"./chunk-FSAQ7W4Y.js";import"./chunk-DA33S43F.js";import{b as L,c as at}from"./chunk-BSOZMEUZ.js";import"./chunk-KLLRDRG7.js";import"./chunk-GFPR5PLO.js";import"./chunk-7K5H76G7.js";import"./chunk-BXQZZ4SS.js";import"./chunk-J7XZRRKK.js";import"./chunk-FOEAOA4G.js";import"./chunk-DZAEKVKZ.js";import"./chunk-5OLVUC6J.js";import"./chunk-BC7YQBUB.js";import"./chunk-7XIOKBLQ.js";import{a as Xe}from"./chunk-ZO2QPDZK.js";import"./chunk-5E52ZWKI.js";import"./chunk-JFJGBJM3.js";import{b as ce,d as $e,e as et}from"./chunk-R4JYAXIW.js";import"./chunk-Q6MS4QZ6.js";import"./chunk-GMF3SGSZ.js";import"./chunk-5NWJYNJO.js";import"./chunk-36TOKQZQ.js";import"./chunk-XS4UTUMZ.js";import"./chunk-D3PKFTVO.js";import{a as I}from"./chunk-V25UXFNL.js";import"./chunk-YNQPX5G6.js";import{N as Ze}from"./chunk-VAJAIBT3.js";import"./chunk-ETHMD4GO.js";import"./chunk-DCS4THVW.js";import{d as pe}from"./chunk-RBBEZN3D.js";import"./chunk-VI6JZFDW.js";import{a as se,b as de,c as H}from"./chunk-R2YNXAPB.js";import"./chunk-MMKYHF6F.js";import"./chunk-LJWHBKHI.js";import"./chunk-SY5NNN4M.js";import{b as He}from"./chunk-KYGIDMGO.js";import"./chunk-R2UNPOYE.js";import"./chunk-RXZDFS3M.js";import{a as N,b as le,c as me}from"./chunk-3UB7PEG5.js";import"./chunk-DVI52XSU.js";import"./chunk-6HNYSYBG.js";import"./chunk-WIUSOID5.js";import"./chunk-K7ICHNI3.js";import{A as je,E as Ue,F as Ge,c as E,h as P,i as Re,k as Be,o as F,p as qe,z as ae}from"./chunk-POUQHZWU.js";import"./chunk-IPY7AQF7.js";import"./chunk-QZKGIQW2.js";import"./chunk-MNXZMQRB.js";import{b as G}from"./chunk-WYAHUX6O.js";import{a as b}from"./chunk-PTRS3UA6.js";import"./chunk-YN6BKUMS.js";import{n as W,q as re}from"./chunk-D3E5UKKJ.js";import{$b as D,Ab as p,Bb as n,C as U,Cb as a,Cc as Ae,Db as V,Ec as ke,Hb as ve,Ib as we,Kd as We,Mb as T,Md as Le,Nd as Oe,Pb as S,Ra as m,Rb as f,Vb as ie,Wb as Y,Xb as J,Ya as M,_ as oe,ab as x,bc as Ne,d as Te,ec as s,fb as Fe,fc as X,fd as k,gb as O,gc as Z,jc as c,kc as u,la as A,lc as C,nd as ne,pa as _,qa as h,r as j,tb as v,vb as w,vc as y,wa as Pe,xb as Ee,yb as Ie,za as K,zb as Ve}from"./chunk-M3O2GJ3M.js";import{a as ee,b as te}from"./chunk-KMHZKFQS.js";var St=r=>({selected:r}),z=class r{constructor(l,e,t){this.dialogRef=l;this.data=e;this.toastr=t;this.configModal=new le,this.configModal.title="Add New City",this.countries=e.countries}city="";configModal;countryID=null;countries;isNotEmpty(l){return b.IsNotEmpty(l)}onOk(){if(b.IsEmpty(this.city)){this.toastr.info("City is required",N.Info);return}if(b.IsEmpty(this.countryID)){this.toastr.info("Country is required",N.Info);return}else this.dialogRef.close({Name:this.city,CountryID:this.countryID})}static \u0275fac=function(e){return new(e||r)(M(se),M(de),M(W))};static \u0275cmp=x({type:r,selectors:[["POS-modal-add-city"]],standalone:!1,decls:14,vars:8,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row",2,"width","500px"],[1,"col-sm-12"],[1,"form-floating-outline"],["type","text","id","labelName","placeholder","City name",1,"form-control",3,"ngModelChange","ngModel"],["for","labelName"],[1,"form-floating-outline","flexRow",3,"ngClass"],["id","labelCity","bindLabel","Name","bindValue","ID","appendTo","body",1,"currency-select",3,"ngModelChange","ngModel","items","clearable"],["for","labelCity",1,"ng-select"]],template:function(e,t){e&1&&(n(0,"modal-material",0),S("onOk",function(){return t.onOk()})("onCancel",function(){return t.dialogRef.close()})("onClose",function(){return t.dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"input",5),C("ngModelChange",function(o){return u(t.city,o)||(t.city=o),o}),a(),n(7,"label",6),s(8,"City"),a()()(),n(9,"div",3)(10,"div",7)(11,"ng-select",8),C("ngModelChange",function(o){return u(t.countryID,o)||(t.countryID=o),o}),a(),n(12,"label",9),s(13,"Country"),a()()()()()()()),e&2&&(p("config",t.configModal),m(6),c("ngModel",t.city),m(4),p("ngClass",y(6,St,t.isNotEmpty(t.countryID))),m(),c("ngModel",t.countryID),p("items",t.countries)("clearable",!1))},dependencies:[k,E,P,F,me,pe],encapsulation:2})};var fe=class r{constructor(l){this.role=l}form={};options={};maskingFields;isStateEdit;maskingFieldMsg=ce.maskingField;isNotEmpty(l){return b.IsNotEmpty(l)}static \u0275fac=function(e){return new(e||r)(M(G))};static \u0275cmp=x({type:r,selectors:[["POS-customer-sales-price"]],inputs:{form:"form",options:"options",maskingFields:"maskingFields",isStateEdit:"isStateEdit"},standalone:!1,decls:40,vars:13,consts:[[1,"row","g-4"],[1,"col-sm-4"],["for","inputDefaultTax",1,"mb-2"],["appendTo","body","id","inputDefaultTax","optionLabel","Label","optionValue","ID","matTooltipPosition","above","matTooltip","Select Customer Default Tax",1,"w-100",3,"ngModelChange","ngModel","options","showClear"],["for","inputSales",1,"mb-2"],["id","inputSales","matTooltipPosition","above","matTooltip","Assign Sales Person for the Customer",3,"ngModelChange","ngModel"],["for","inputPersonInCharge",1,"mb-2"],["type","text","id","inputPersonInCharge","placeholder","Person in Charge","matTooltipPosition","above","matTooltip","Input Person in Charge for the Customer",1,"form-control","custom",3,"ngModelChange","ngModel"],[1,"col-sm-4","mt-6"],["for","inputNPWP",1,"mb-2"],["type","text","id","inputNPWP","placeholder","TaxID","matTooltipPosition","above","matTooltip","Input Tax ID/Number",1,"form-control","custom",3,"ngModelChange","ngModel"],["for","inputDebtLimit",1,"mb-2"],["type","text","id","inputDebtLimit","placeholder","Debt Limit","autoNum","","matTooltipPosition","above","matTooltip","Input Debt Limit for this Customer",1,"form-control","custom",3,"ngModelChange","ngModel"],["for","inputMaximumOverdue",1,"mb-2"],[1,"position-relative"],["type","text","autoNum","","id","inputMaximumOverdue","placeholder","Maximum Overdue","matTooltipPosition","above","matTooltip","Input maximum overdue days for the customer",1,"form-control","custom","me-2",3,"ngModelChange","ngModel"],[1,"position-absolute",2,"bottom","4px","right","8px"],["for","inputPricebook",1,"mb-2"],["appendTo","body","id","inputPricebook","optionLabel","Value","optionValue","Key","matTooltipPosition","above","matTooltip","Assign Pricebook for the customer",1,"w-100",3,"ngModelChange","ngModel","options","showClear"],["for","creditDueDays",1,"mb-2"],["type","text","autoNum","","id","creditDueDays","matTooltipPosition","above","matTooltip","Input Credit Due Days for the Customer",1,"form-control","custom","me-2",3,"ngModelChange","ngModel"],["for","creditDueMonths",1,"mb-2"],["type","text","autoNum","","id","creditDueMonths","matTooltipPosition","above","matTooltip","Input Credit Due Months for the Customer",1,"form-control","custom","me-2",3,"ngModelChange","ngModel"]],template:function(e,t){e&1&&(n(0,"div",0)(1,"div",1)(2,"label",2),s(3,"Tax"),a(),n(4,"p-select",3),C("ngModelChange",function(o){return u(t.form.Contact.TaxTypeId,o)||(t.form.Contact.TaxTypeId=o),o}),a()(),n(5,"div",1)(6,"label",4),s(7,"Sales Person"),a(),n(8,"sales-person-selector",5),C("ngModelChange",function(o){return u(t.form.Contact.SalesID,o)||(t.form.Contact.SalesID=o),o}),a()(),n(9,"div",1)(10,"label",6),s(11,"Person in Charge"),a(),n(12,"input",7),C("ngModelChange",function(o){return u(t.form.Contact.ContactPerson,o)||(t.form.Contact.ContactPerson=o),o}),a()(),n(13,"div",8)(14,"label",9),s(15,"Tax ID"),a(),n(16,"input",10),C("ngModelChange",function(o){return u(t.form.Contact.TaxIDNumber,o)||(t.form.Contact.TaxIDNumber=o),o}),a()(),n(17,"div",8)(18,"label",11),s(19,"Debt Limit"),a(),n(20,"input",12),C("ngModelChange",function(o){return u(t.form.Contact.DebtLimit,o)||(t.form.Contact.DebtLimit=o),o}),a()(),n(21,"div",8)(22,"label",13),s(23,"Debt Maximum Overdue"),a(),n(24,"div",14)(25,"input",15),C("ngModelChange",function(o){return u(t.form.Contact.MaximumOverdueDays,o)||(t.form.Contact.MaximumOverdueDays=o),o}),a(),n(26,"div",16),s(27," Day(s) "),a()()(),n(28,"div",8)(29,"label",17),s(30,"Pricebook"),a(),n(31,"p-select",18),C("ngModelChange",function(o){return u(t.form.Contact.PricebookID,o)||(t.form.Contact.PricebookID=o),o}),a()(),n(32,"div",8)(33,"label",19),s(34,"Credit Due Days"),a(),n(35,"input",20),C("ngModelChange",function(o){return u(t.form.DefaultDue.Days,o)||(t.form.DefaultDue.Days=o),o}),a()(),n(36,"div",8)(37,"label",21),s(38,"Credit Due Months"),a(),n(39,"input",22),C("ngModelChange",function(o){return u(t.form.DefaultDue.Months,o)||(t.form.DefaultDue.Months=o),o}),a()()()),e&2&&(m(4),c("ngModel",t.form.Contact.TaxTypeId),p("options",t.options.Taxes)("showClear",t.isNotEmpty(t.form.Contact.TaxTypeId)),m(4),c("ngModel",t.form.Contact.SalesID),m(4),c("ngModel",t.form.Contact.ContactPerson),m(4),c("ngModel",t.form.Contact.TaxIDNumber),m(4),c("ngModel",t.form.Contact.DebtLimit),m(5),c("ngModel",t.form.Contact.MaximumOverdueDays),m(6),c("ngModel",t.form.Contact.PricebookID),p("options",t.options.Pricebooks)("showClear",!0),m(4),c("ngModel",t.form.DefaultDue.Days),m(4),c("ngModel",t.form.DefaultDue.Months))},dependencies:[I,E,P,F,Je,st,L],styles:[".form-control.custom[_ngcontent-%COMP%]{border-radius:4px;padding:10px 12px}"],changeDetection:0})};var Dt=r=>({selected:r}),ge=class r{constructor(l,e,t){this.dialogRef=l;this.data=e;this.toastr=t;this.Model=e,this.configModal=new le,this.configModal.title="Add New address?",this.configModal.headerType=N.Success}Model;configModal;isNotEmpty(l){return b.IsNotEmpty(l)}changeSelect(l){this.Model.form.CityName=l.Name}onOk(){b.IsEmpty(this.Model.form.Label)?this.toastr.error("Label is required",N.Error):b.IsEmpty(this.Model.form.Address)?this.toastr.error("Address is required",N.Error):this.dialogRef.close(this.Model.form)}static \u0275fac=function(e){return new(e||r)(M(se),M(de),M(W))};static \u0275cmp=x({type:r,selectors:[["POS-modal-add-address"]],standalone:!1,decls:24,vars:10,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row",2,"width","500px"],[1,"col-sm-12"],[1,"form-floating-outline"],["type","text","id","labelName","placeholder","Label","matTooltipPosition","above","matTooltip","Input Label for the address",1,"form-control",3,"ngModelChange","ngModel"],["for","labelName"],["type","text","id","labelPhone","placeholder","Phone","matTooltipPosition","above","matTooltip","Input phone for the address",1,"form-control",3,"ngModelChange","ngModel"],["for","labelPhone"],["id","labelAddress","placeholder","Address","matTooltipPosition","above","matTooltip","Input detail for the address",1,"form-control",3,"ngModelChange","ngModel"],["for","labelAddress"],[1,"form-floating-outline","flexRow",3,"ngClass"],["id","labelCity","bindLabel","Name","bindValue","ID","appendTo","body","matTooltipPosition","above","matTooltip","Select City for the address",1,"currency-select",3,"ngModelChange","change","ngModel","items","clearable"],["for","labelCity",1,"ng-select"]],template:function(e,t){e&1&&(n(0,"modal-material",0),S("onOk",function(){return t.onOk()})("onCancel",function(){return t.dialogRef.close()})("onClose",function(){return t.dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"input",5),C("ngModelChange",function(o){return u(t.Model.form.Label,o)||(t.Model.form.Label=o),o}),a(),n(7,"label",6),s(8,"Label"),a()()(),n(9,"div",3)(10,"div",4)(11,"input",7),C("ngModelChange",function(o){return u(t.Model.form.Phone,o)||(t.Model.form.Phone=o),o}),a(),n(12,"label",8),s(13,"Phone"),a()()(),n(14,"div",3)(15,"div",4)(16,"textarea",9),C("ngModelChange",function(o){return u(t.Model.form.Address,o)||(t.Model.form.Address=o),o}),a(),n(17,"label",10),s(18,"Address"),a()()(),n(19,"div",3)(20,"div",11)(21,"ng-select",12),C("ngModelChange",function(o){return u(t.Model.form.City,o)||(t.Model.form.City=o),o}),S("change",function(o){return t.changeSelect(o)}),a(),n(22,"label",13),s(23,"City"),a()()()()()()()),e&2&&(p("config",t.configModal),m(6),c("ngModel",t.Model.form.Label),m(5),c("ngModel",t.Model.form.Phone),m(5),c("ngModel",t.Model.form.Address),m(4),p("ngClass",y(8,Dt,t.isNotEmpty(t.Model.form.City))),m(),c("ngModel",t.Model.form.City),p("items",t.Model.options.Cities)("clearable",!1))},dependencies:[I,k,E,P,F,me,pe],encapsulation:2})};var xt=["address"],Tt=r=>({required:r}),Pt=r=>({"is-invalid":r});function Ft(r,l){r&1&&(n(0,"div",3),s(1,"Address is mandatory."),a())}function Et(r,l){r&1&&(n(0,"tr")(1,"td",15),s(2," No alternative addresses available. "),a()())}function It(r,l){if(r&1){let e=T();n(0,"tr",17),S("click",function(){let i=_(e),o=i.$implicit,g=i.$index,d=f(2);return h(d.openModalAddress(o,g))}),n(1,"td",18)(2,"i",19),S("click",function(i){let o=_(e).$index;return f(2).deleteRow(o),h(i.stopPropagation())}),a()(),n(3,"td"),s(4),a(),n(5,"td"),s(6),a(),n(7,"td"),s(8),a(),n(9,"td"),s(10),a()()}if(r&2){let e=l.$implicit;m(4),X(e.Label),m(2),X(e.Phone),m(2),X(e.Address),m(2),X(e.CityName)}}function Vt(r,l){if(r&1&&Ie(0,It,11,4,"tr",16,Ee),r&2){let e=f();Ve(e.form.Addresses)}}var _e=class r{constructor(l){this.matDialog=l}form={};options={};config={};newAddressEvent=new Pe;addressCtrl;set onSubmitted(l){if(l){let e=this.addressCtrl?.control;e&&(typeof e.markAllAsTouched=="function"?e.markAllAsTouched():typeof e.markAsTouched=="function"&&e.markAsTouched())}}openModalAddress(l,e){let t={Address:null,City:null,CityName:null,Label:null,Phone:null,index:null};l&&(l.index=e,t=l),this.matDialog.open(ge,{data:{form:t,options:this.options}}).afterClosed().pipe(U(i=>b.IsNotEmpty(i))).subscribe(i=>{this.newAddressEvent.emit({address:i,index:i.index})})}deleteRow(l){this.form.Addresses.splice(l,1),this.form.Addresses.map((e,t)=>{e.index=t})}static \u0275fac=function(e){return new(e||r)(M(H))};static \u0275cmp=x({type:r,selectors:[["POS-customer-address"]],viewQuery:function(e,t){if(e&1&&ie(xt,5),e&2){let i;Y(i=J())&&(t.addressCtrl=i.first)}},inputs:{form:"form",options:"options",config:"config",onSubmitted:"onSubmitted"},outputs:{newAddressEvent:"newAddressEvent"},standalone:!1,decls:24,vars:10,consts:[["address","ngModel"],[1,"fw-normal","mb-4",3,"ngClass"],["name","address","id","inputAddress","placeholder","Input Customer Address","matTooltipPosition","above","matTooltip","Address",1,"form-control","custom",3,"ngModelChange","ngModel","required","ngClass"],[1,"invalid-feedback"],[1,"fw-normal","mb-4","mt-7"],[1,"table","table-bordered","mb-4"],[1,"thead-light","sticky-top-thead"],[1,"header"],["width","15px",1,"border-end"],["type","button","matTooltipPosition","above","matTooltip","Add an Address?",1,"btn","btn-outline-dark","btn-sm","bg-white","text-black",3,"click"],["aria-hidden","true",1,"fa","fa-plus"],["matTooltipPosition","above","matTooltip","Label for this address",1,"border-end",2,"width","120px"],["matTooltipPosition","above","matTooltip","Phone for this address",1,"border-end",2,"width","120px"],["matTooltipPosition","above","matTooltip","Detail for this address",1,"border-end"],["matTooltipPosition","above","matTooltip","City for this Address",1,"border-end",2,"width","120px"],["colspan","5",1,"text-center"],[1,"clickable"],[1,"clickable",3,"click"],[1,"text-center"],[1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"]],template:function(e,t){if(e&1){let i=T();n(0,"h4",1),s(1,` Main Address
|
|
1
|
+
import{a as ft,b as gt}from"./chunk-G5NPCBLQ.js";import{a as ut,b as Ct}from"./chunk-KU7UZNJ6.js";import"./chunk-UBNURVIP.js";import"./chunk-HVIKQ3QZ.js";import"./chunk-VSRJ5RWQ.js";import"./chunk-CX4UNCT3.js";import"./chunk-JLHUBVOA.js";import"./chunk-NCS3QPTB.js";import{a as pt}from"./chunk-EP66QZUX.js";import"./chunk-VXMTZTSH.js";import{a as ct}from"./chunk-BYGN2PS2.js";import{a as st}from"./chunk-PY4WMHXK.js";import{a as dt}from"./chunk-MS74SREK.js";import"./chunk-B5ZKZXDH.js";import"./chunk-NVGEU7SZ.js";import"./chunk-LDU2L7YC.js";import"./chunk-T5UW3VZA.js";import"./chunk-RYN2QXQA.js";import"./chunk-ULFJRUXF.js";import"./chunk-TKWTC5AR.js";import{a as ue}from"./chunk-BKC34W6M.js";import"./chunk-U6J62ETY.js";import"./chunk-JCUDUZIE.js";import"./chunk-P3KIIKY4.js";import"./chunk-RJIB64GS.js";import{a as mt}from"./chunk-CAYJHOZ3.js";import"./chunk-IEGHFCSK.js";import"./chunk-BYXBJQAS.js";import"./chunk-TUDEWC7P.js";import"./chunk-6ZKW6NGS.js";import{a as ze,b as Qe,c as Ke,d as Ye}from"./chunk-A3XPLCMP.js";import"./chunk-22VMH5K4.js";import"./chunk-VQQIQFUB.js";import"./chunk-HKSUQNKJ.js";import"./chunk-DLBX5RSU.js";import"./chunk-YHKX3K56.js";import"./chunk-O3LZKJY2.js";import"./chunk-WLNLF7ZT.js";import"./chunk-MPGXQK5L.js";import"./chunk-Q2COUO3I.js";import"./chunk-IDHUYY2U.js";import"./chunk-KMI7GZJI.js";import"./chunk-EWMMWD7T.js";import{c as it,d as nt}from"./chunk-A75ZS57D.js";import"./chunk-HSGXXXIK.js";import"./chunk-75C5S3PQ.js";import{b as rt,c as lt}from"./chunk-IA2WDKQU.js";import"./chunk-YQI4LPEX.js";import"./chunk-N5GGRFDA.js";import"./chunk-7GHVZIGG.js";import"./chunk-2W2QBSBZ.js";import"./chunk-HGQTG5I4.js";import"./chunk-6KJTU3AF.js";import"./chunk-TQ2YP2CL.js";import"./chunk-T7SY746R.js";import{g as tt,h as ot}from"./chunk-MTTGR5QJ.js";import"./chunk-LIMLIVTQ.js";import"./chunk-WYKVRUIW.js";import"./chunk-LVIGLDQ4.js";import{a as Je}from"./chunk-KR74ZZ6U.js";import"./chunk-FSAQ7W4Y.js";import"./chunk-DA33S43F.js";import{b as L,c as at}from"./chunk-BSOZMEUZ.js";import"./chunk-KLLRDRG7.js";import"./chunk-GFPR5PLO.js";import"./chunk-7K5H76G7.js";import"./chunk-BXQZZ4SS.js";import"./chunk-J7XZRRKK.js";import"./chunk-FOEAOA4G.js";import"./chunk-DZAEKVKZ.js";import"./chunk-5OLVUC6J.js";import"./chunk-BC7YQBUB.js";import"./chunk-QGJKAVKL.js";import{a as Xe}from"./chunk-NTAQ64Z7.js";import"./chunk-5E52ZWKI.js";import"./chunk-JFJGBJM3.js";import{b as ce,d as $e,e as et}from"./chunk-I6QIHEX7.js";import"./chunk-Q6MS4QZ6.js";import"./chunk-GMF3SGSZ.js";import"./chunk-5NWJYNJO.js";import"./chunk-36TOKQZQ.js";import"./chunk-XS4UTUMZ.js";import"./chunk-D3PKFTVO.js";import{a as I}from"./chunk-V25UXFNL.js";import"./chunk-YNQPX5G6.js";import{N as Ze}from"./chunk-VAJAIBT3.js";import"./chunk-ETHMD4GO.js";import"./chunk-DCS4THVW.js";import{d as pe}from"./chunk-RBBEZN3D.js";import"./chunk-C7QPL2ZR.js";import{a as se,b as de,c as H}from"./chunk-R2YNXAPB.js";import"./chunk-MMKYHF6F.js";import"./chunk-LJWHBKHI.js";import"./chunk-SY5NNN4M.js";import{b as He}from"./chunk-KYGIDMGO.js";import"./chunk-R2UNPOYE.js";import"./chunk-RXZDFS3M.js";import{a as N,b as le,c as me}from"./chunk-3UB7PEG5.js";import"./chunk-DVI52XSU.js";import"./chunk-6HNYSYBG.js";import"./chunk-WIUSOID5.js";import"./chunk-K7ICHNI3.js";import{A as je,E as Ue,F as Ge,c as E,h as P,i as Re,k as Be,o as F,p as qe,z as ae}from"./chunk-POUQHZWU.js";import"./chunk-633FRUS5.js";import"./chunk-T7X4KP7L.js";import"./chunk-MNXZMQRB.js";import{b as G}from"./chunk-WYAHUX6O.js";import{a as b}from"./chunk-PTRS3UA6.js";import"./chunk-YYHQROLO.js";import{n as W,q as re}from"./chunk-D3E5UKKJ.js";import{$b as D,Ab as p,Bb as n,C as U,Cb as a,Cc as Ae,Db as V,Ec as ke,Hb as ve,Ib as we,Kd as We,Mb as T,Md as Le,Nd as Oe,Pb as S,Ra as m,Rb as f,Vb as ie,Wb as Y,Xb as J,Ya as M,_ as oe,ab as x,bc as Ne,d as Te,ec as s,fb as Fe,fc as X,fd as k,gb as O,gc as Z,jc as c,kc as u,la as A,lc as C,nd as ne,pa as _,qa as h,r as j,tb as v,vb as w,vc as y,wa as Pe,xb as Ee,yb as Ie,za as K,zb as Ve}from"./chunk-M3O2GJ3M.js";import{a as ee,b as te}from"./chunk-KMHZKFQS.js";var St=r=>({selected:r}),z=class r{constructor(l,e,t){this.dialogRef=l;this.data=e;this.toastr=t;this.configModal=new le,this.configModal.title="Add New City",this.countries=e.countries}city="";configModal;countryID=null;countries;isNotEmpty(l){return b.IsNotEmpty(l)}onOk(){if(b.IsEmpty(this.city)){this.toastr.info("City is required",N.Info);return}if(b.IsEmpty(this.countryID)){this.toastr.info("Country is required",N.Info);return}else this.dialogRef.close({Name:this.city,CountryID:this.countryID})}static \u0275fac=function(e){return new(e||r)(M(se),M(de),M(W))};static \u0275cmp=x({type:r,selectors:[["POS-modal-add-city"]],standalone:!1,decls:14,vars:8,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row",2,"width","500px"],[1,"col-sm-12"],[1,"form-floating-outline"],["type","text","id","labelName","placeholder","City name",1,"form-control",3,"ngModelChange","ngModel"],["for","labelName"],[1,"form-floating-outline","flexRow",3,"ngClass"],["id","labelCity","bindLabel","Name","bindValue","ID","appendTo","body",1,"currency-select",3,"ngModelChange","ngModel","items","clearable"],["for","labelCity",1,"ng-select"]],template:function(e,t){e&1&&(n(0,"modal-material",0),S("onOk",function(){return t.onOk()})("onCancel",function(){return t.dialogRef.close()})("onClose",function(){return t.dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"input",5),C("ngModelChange",function(o){return u(t.city,o)||(t.city=o),o}),a(),n(7,"label",6),s(8,"City"),a()()(),n(9,"div",3)(10,"div",7)(11,"ng-select",8),C("ngModelChange",function(o){return u(t.countryID,o)||(t.countryID=o),o}),a(),n(12,"label",9),s(13,"Country"),a()()()()()()()),e&2&&(p("config",t.configModal),m(6),c("ngModel",t.city),m(4),p("ngClass",y(6,St,t.isNotEmpty(t.countryID))),m(),c("ngModel",t.countryID),p("items",t.countries)("clearable",!1))},dependencies:[k,E,P,F,me,pe],encapsulation:2})};var fe=class r{constructor(l){this.role=l}form={};options={};maskingFields;isStateEdit;maskingFieldMsg=ce.maskingField;isNotEmpty(l){return b.IsNotEmpty(l)}static \u0275fac=function(e){return new(e||r)(M(G))};static \u0275cmp=x({type:r,selectors:[["POS-customer-sales-price"]],inputs:{form:"form",options:"options",maskingFields:"maskingFields",isStateEdit:"isStateEdit"},standalone:!1,decls:40,vars:13,consts:[[1,"row","g-4"],[1,"col-sm-4"],["for","inputDefaultTax",1,"mb-2"],["appendTo","body","id","inputDefaultTax","optionLabel","Label","optionValue","ID","matTooltipPosition","above","matTooltip","Select Customer Default Tax",1,"w-100",3,"ngModelChange","ngModel","options","showClear"],["for","inputSales",1,"mb-2"],["id","inputSales","matTooltipPosition","above","matTooltip","Assign Sales Person for the Customer",3,"ngModelChange","ngModel"],["for","inputPersonInCharge",1,"mb-2"],["type","text","id","inputPersonInCharge","placeholder","Person in Charge","matTooltipPosition","above","matTooltip","Input Person in Charge for the Customer",1,"form-control","custom",3,"ngModelChange","ngModel"],[1,"col-sm-4","mt-6"],["for","inputNPWP",1,"mb-2"],["type","text","id","inputNPWP","placeholder","TaxID","matTooltipPosition","above","matTooltip","Input Tax ID/Number",1,"form-control","custom",3,"ngModelChange","ngModel"],["for","inputDebtLimit",1,"mb-2"],["type","text","id","inputDebtLimit","placeholder","Debt Limit","autoNum","","matTooltipPosition","above","matTooltip","Input Debt Limit for this Customer",1,"form-control","custom",3,"ngModelChange","ngModel"],["for","inputMaximumOverdue",1,"mb-2"],[1,"position-relative"],["type","text","autoNum","","id","inputMaximumOverdue","placeholder","Maximum Overdue","matTooltipPosition","above","matTooltip","Input maximum overdue days for the customer",1,"form-control","custom","me-2",3,"ngModelChange","ngModel"],[1,"position-absolute",2,"bottom","4px","right","8px"],["for","inputPricebook",1,"mb-2"],["appendTo","body","id","inputPricebook","optionLabel","Value","optionValue","Key","matTooltipPosition","above","matTooltip","Assign Pricebook for the customer",1,"w-100",3,"ngModelChange","ngModel","options","showClear"],["for","creditDueDays",1,"mb-2"],["type","text","autoNum","","id","creditDueDays","matTooltipPosition","above","matTooltip","Input Credit Due Days for the Customer",1,"form-control","custom","me-2",3,"ngModelChange","ngModel"],["for","creditDueMonths",1,"mb-2"],["type","text","autoNum","","id","creditDueMonths","matTooltipPosition","above","matTooltip","Input Credit Due Months for the Customer",1,"form-control","custom","me-2",3,"ngModelChange","ngModel"]],template:function(e,t){e&1&&(n(0,"div",0)(1,"div",1)(2,"label",2),s(3,"Tax"),a(),n(4,"p-select",3),C("ngModelChange",function(o){return u(t.form.Contact.TaxTypeId,o)||(t.form.Contact.TaxTypeId=o),o}),a()(),n(5,"div",1)(6,"label",4),s(7,"Sales Person"),a(),n(8,"sales-person-selector",5),C("ngModelChange",function(o){return u(t.form.Contact.SalesID,o)||(t.form.Contact.SalesID=o),o}),a()(),n(9,"div",1)(10,"label",6),s(11,"Person in Charge"),a(),n(12,"input",7),C("ngModelChange",function(o){return u(t.form.Contact.ContactPerson,o)||(t.form.Contact.ContactPerson=o),o}),a()(),n(13,"div",8)(14,"label",9),s(15,"Tax ID"),a(),n(16,"input",10),C("ngModelChange",function(o){return u(t.form.Contact.TaxIDNumber,o)||(t.form.Contact.TaxIDNumber=o),o}),a()(),n(17,"div",8)(18,"label",11),s(19,"Debt Limit"),a(),n(20,"input",12),C("ngModelChange",function(o){return u(t.form.Contact.DebtLimit,o)||(t.form.Contact.DebtLimit=o),o}),a()(),n(21,"div",8)(22,"label",13),s(23,"Debt Maximum Overdue"),a(),n(24,"div",14)(25,"input",15),C("ngModelChange",function(o){return u(t.form.Contact.MaximumOverdueDays,o)||(t.form.Contact.MaximumOverdueDays=o),o}),a(),n(26,"div",16),s(27," Day(s) "),a()()(),n(28,"div",8)(29,"label",17),s(30,"Pricebook"),a(),n(31,"p-select",18),C("ngModelChange",function(o){return u(t.form.Contact.PricebookID,o)||(t.form.Contact.PricebookID=o),o}),a()(),n(32,"div",8)(33,"label",19),s(34,"Credit Due Days"),a(),n(35,"input",20),C("ngModelChange",function(o){return u(t.form.DefaultDue.Days,o)||(t.form.DefaultDue.Days=o),o}),a()(),n(36,"div",8)(37,"label",21),s(38,"Credit Due Months"),a(),n(39,"input",22),C("ngModelChange",function(o){return u(t.form.DefaultDue.Months,o)||(t.form.DefaultDue.Months=o),o}),a()()()),e&2&&(m(4),c("ngModel",t.form.Contact.TaxTypeId),p("options",t.options.Taxes)("showClear",t.isNotEmpty(t.form.Contact.TaxTypeId)),m(4),c("ngModel",t.form.Contact.SalesID),m(4),c("ngModel",t.form.Contact.ContactPerson),m(4),c("ngModel",t.form.Contact.TaxIDNumber),m(4),c("ngModel",t.form.Contact.DebtLimit),m(5),c("ngModel",t.form.Contact.MaximumOverdueDays),m(6),c("ngModel",t.form.Contact.PricebookID),p("options",t.options.Pricebooks)("showClear",!0),m(4),c("ngModel",t.form.DefaultDue.Days),m(4),c("ngModel",t.form.DefaultDue.Months))},dependencies:[I,E,P,F,Je,st,L],styles:[".form-control.custom[_ngcontent-%COMP%]{border-radius:4px;padding:10px 12px}"],changeDetection:0})};var Dt=r=>({selected:r}),ge=class r{constructor(l,e,t){this.dialogRef=l;this.data=e;this.toastr=t;this.Model=e,this.configModal=new le,this.configModal.title="Add New address?",this.configModal.headerType=N.Success}Model;configModal;isNotEmpty(l){return b.IsNotEmpty(l)}changeSelect(l){this.Model.form.CityName=l.Name}onOk(){b.IsEmpty(this.Model.form.Label)?this.toastr.error("Label is required",N.Error):b.IsEmpty(this.Model.form.Address)?this.toastr.error("Address is required",N.Error):this.dialogRef.close(this.Model.form)}static \u0275fac=function(e){return new(e||r)(M(se),M(de),M(W))};static \u0275cmp=x({type:r,selectors:[["POS-modal-add-address"]],standalone:!1,decls:24,vars:10,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row",2,"width","500px"],[1,"col-sm-12"],[1,"form-floating-outline"],["type","text","id","labelName","placeholder","Label","matTooltipPosition","above","matTooltip","Input Label for the address",1,"form-control",3,"ngModelChange","ngModel"],["for","labelName"],["type","text","id","labelPhone","placeholder","Phone","matTooltipPosition","above","matTooltip","Input phone for the address",1,"form-control",3,"ngModelChange","ngModel"],["for","labelPhone"],["id","labelAddress","placeholder","Address","matTooltipPosition","above","matTooltip","Input detail for the address",1,"form-control",3,"ngModelChange","ngModel"],["for","labelAddress"],[1,"form-floating-outline","flexRow",3,"ngClass"],["id","labelCity","bindLabel","Name","bindValue","ID","appendTo","body","matTooltipPosition","above","matTooltip","Select City for the address",1,"currency-select",3,"ngModelChange","change","ngModel","items","clearable"],["for","labelCity",1,"ng-select"]],template:function(e,t){e&1&&(n(0,"modal-material",0),S("onOk",function(){return t.onOk()})("onCancel",function(){return t.dialogRef.close()})("onClose",function(){return t.dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"input",5),C("ngModelChange",function(o){return u(t.Model.form.Label,o)||(t.Model.form.Label=o),o}),a(),n(7,"label",6),s(8,"Label"),a()()(),n(9,"div",3)(10,"div",4)(11,"input",7),C("ngModelChange",function(o){return u(t.Model.form.Phone,o)||(t.Model.form.Phone=o),o}),a(),n(12,"label",8),s(13,"Phone"),a()()(),n(14,"div",3)(15,"div",4)(16,"textarea",9),C("ngModelChange",function(o){return u(t.Model.form.Address,o)||(t.Model.form.Address=o),o}),a(),n(17,"label",10),s(18,"Address"),a()()(),n(19,"div",3)(20,"div",11)(21,"ng-select",12),C("ngModelChange",function(o){return u(t.Model.form.City,o)||(t.Model.form.City=o),o}),S("change",function(o){return t.changeSelect(o)}),a(),n(22,"label",13),s(23,"City"),a()()()()()()()),e&2&&(p("config",t.configModal),m(6),c("ngModel",t.Model.form.Label),m(5),c("ngModel",t.Model.form.Phone),m(5),c("ngModel",t.Model.form.Address),m(4),p("ngClass",y(8,Dt,t.isNotEmpty(t.Model.form.City))),m(),c("ngModel",t.Model.form.City),p("items",t.Model.options.Cities)("clearable",!1))},dependencies:[I,k,E,P,F,me,pe],encapsulation:2})};var xt=["address"],Tt=r=>({required:r}),Pt=r=>({"is-invalid":r});function Ft(r,l){r&1&&(n(0,"div",3),s(1,"Address is mandatory."),a())}function Et(r,l){r&1&&(n(0,"tr")(1,"td",15),s(2," No alternative addresses available. "),a()())}function It(r,l){if(r&1){let e=T();n(0,"tr",17),S("click",function(){let i=_(e),o=i.$implicit,g=i.$index,d=f(2);return h(d.openModalAddress(o,g))}),n(1,"td",18)(2,"i",19),S("click",function(i){let o=_(e).$index;return f(2).deleteRow(o),h(i.stopPropagation())}),a()(),n(3,"td"),s(4),a(),n(5,"td"),s(6),a(),n(7,"td"),s(8),a(),n(9,"td"),s(10),a()()}if(r&2){let e=l.$implicit;m(4),X(e.Label),m(2),X(e.Phone),m(2),X(e.Address),m(2),X(e.CityName)}}function Vt(r,l){if(r&1&&Ie(0,It,11,4,"tr",16,Ee),r&2){let e=f();Ve(e.form.Addresses)}}var _e=class r{constructor(l){this.matDialog=l}form={};options={};config={};newAddressEvent=new Pe;addressCtrl;set onSubmitted(l){if(l){let e=this.addressCtrl?.control;e&&(typeof e.markAllAsTouched=="function"?e.markAllAsTouched():typeof e.markAsTouched=="function"&&e.markAsTouched())}}openModalAddress(l,e){let t={Address:null,City:null,CityName:null,Label:null,Phone:null,index:null};l&&(l.index=e,t=l),this.matDialog.open(ge,{data:{form:t,options:this.options}}).afterClosed().pipe(U(i=>b.IsNotEmpty(i))).subscribe(i=>{this.newAddressEvent.emit({address:i,index:i.index})})}deleteRow(l){this.form.Addresses.splice(l,1),this.form.Addresses.map((e,t)=>{e.index=t})}static \u0275fac=function(e){return new(e||r)(M(H))};static \u0275cmp=x({type:r,selectors:[["POS-customer-address"]],viewQuery:function(e,t){if(e&1&&ie(xt,5),e&2){let i;Y(i=J())&&(t.addressCtrl=i.first)}},inputs:{form:"form",options:"options",config:"config",onSubmitted:"onSubmitted"},outputs:{newAddressEvent:"newAddressEvent"},standalone:!1,decls:24,vars:10,consts:[["address","ngModel"],[1,"fw-normal","mb-4",3,"ngClass"],["name","address","id","inputAddress","placeholder","Input Customer Address","matTooltipPosition","above","matTooltip","Address",1,"form-control","custom",3,"ngModelChange","ngModel","required","ngClass"],[1,"invalid-feedback"],[1,"fw-normal","mb-4","mt-7"],[1,"table","table-bordered","mb-4"],[1,"thead-light","sticky-top-thead"],[1,"header"],["width","15px",1,"border-end"],["type","button","matTooltipPosition","above","matTooltip","Add an Address?",1,"btn","btn-outline-dark","btn-sm","bg-white","text-black",3,"click"],["aria-hidden","true",1,"fa","fa-plus"],["matTooltipPosition","above","matTooltip","Label for this address",1,"border-end",2,"width","120px"],["matTooltipPosition","above","matTooltip","Phone for this address",1,"border-end",2,"width","120px"],["matTooltipPosition","above","matTooltip","Detail for this address",1,"border-end"],["matTooltipPosition","above","matTooltip","City for this Address",1,"border-end",2,"width","120px"],["colspan","5",1,"text-center"],[1,"clickable"],[1,"clickable",3,"click"],[1,"text-center"],[1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"]],template:function(e,t){if(e&1){let i=T();n(0,"h4",1),s(1,` Main Address
|
|
2
2
|
`),a(),n(2,"textarea",2,0),C("ngModelChange",function(g){return _(i),u(t.form.Contact.Address,g)||(t.form.Contact.Address=g),h(g)}),a(),v(4,Ft,2,0,"div",3),n(5,"h4",4),s(6,"Alternative Address"),a(),n(7,"table",5)(8,"thead",6)(9,"tr",7)(10,"th",8)(11,"button",9),S("click",function(){return t.openModalAddress(null)}),V(12,"i",10),a()(),n(13,"th",11),s(14," Label "),a(),n(15,"th",12),s(16," Phone "),a(),n(17,"th",13),s(18," Address "),a(),n(19,"th",14),s(20," City "),a()()(),n(21,"tbody"),v(22,Et,3,0,"tr")(23,Vt,2,0),a()()}if(e&2){let i=D(3);p("ngClass",y(6,Tt,t.config.RequireContactAddress)),m(2),c("ngModel",t.form.Contact.Address),p("required",t.config.RequireContactAddress)("ngClass",y(8,Pt,i.invalid&&(i.dirty||i.touched)&&t.config.RequireContactAddress)),m(2),w(i.invalid&&(i.dirty||i.touched)&&t.config.RequireContactAddress?4:-1),m(18),w(t.form.Addresses.length===0?22:23)}},dependencies:[I,k,E,P,ae,F],styles:['.form-control.custom[_ngcontent-%COMP%]{border-radius:4px;padding:10px 12px}.required[_ngcontent-%COMP%]:after{content:"*";color:red}'],changeDetection:0})};var ht=r=>({"is-invalid":r});function At(r,l){if(r&1&&(n(0,"div",17),s(1),a()),r&2){f();let e=D(26);m(),Z(" ",e==null||e.errors==null||e.errors.minLength==null?null:e.errors.minLength.message," ")}}function kt(r,l){if(r&1&&(n(0,"div",17),s(1),a()),r&2){f();let e=D(32);m(),Z(" ",e==null||e.errors==null||e.errors.minLength==null?null:e.errors.minLength.message," ")}}var he=class r{form={};options={};maskingFields;isStateEdit;maskingFieldMsg;config;countries;matDialog=A(H);httpService=A(re);roleService=A(G);ngOnInit(){this.httpService.post("/api/ContactSetup/Country").pipe(j(l=>l.List)).subscribe(l=>this.countries=l)}isNotEmpty(l){return b.IsNotEmpty(l)}checkedIsNotEmpty(l){return b.IsNotEmpty(l)}openAddCityDialog(){this.matDialog.open(z,{data:{countries:this.countries}}).afterClosed().pipe(U(l=>l.CountryID&&l.Name),oe(l=>this.httpService.post("/api/ContactSetup/SubmitCity",l).pipe(j(e=>te(ee({},l),{ID:e.ID}))))).subscribe(l=>{this.options.Cities=[...this.options.Cities,l],this.form.Contact.City=l.ID})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=x({type:r,selectors:[["POS-customer-information"]],inputs:{form:"form",options:"options",maskingFields:"maskingFields",isStateEdit:"isStateEdit",maskingFieldMsg:"maskingFieldMsg",config:"config"},standalone:!1,decls:34,vars:24,consts:[["nationalId","ngModel"],["phoneNumber","ngModel"],[1,"row","g-4",2,"padding","0","margin-top","-20px"],[1,"col-sm-4","mb-2"],["for","inputCity",1,"mb-2","d-flex","align-items-center","gap-1"],["matTooltip","Add New City","matTooltipPosition","above",1,"fa-sharp","fa-thin","fa-circle-plus","cursor-pointer",3,"click"],["optionLabel","Name","optionValue","ID","placeholder","Choose an Options","matTooltipPosition","above","matTooltip","Select Customer City","name","city","appendTo","body",1,"w-100",3,"ngModelChange","options","ngModel"],["for","inputFax",1,"mb-2"],["type","text","id","inputFax","placeholder","Customer fax number","matTooltipPosition","above","matTooltip","Input Customer Fax Number",1,"form-control","custom",3,"ngModelChange","ngModel"],["for","inputNationality",1,"mb-2"],["optionLabel","Name","optionValue","ID","placeholder","Choose an Options","matTooltipPosition","above","matTooltip","Input Customer Nationaly","name","nationality","appendTo","body",1,"w-100",3,"ngModelChange","options","ngModel","showClear"],["for","inputRace",1,"mb-2"],["optionLabel","Name","optionValue","ID","placeholder","Choose an Options","matTooltipPosition","above","matTooltip","Select Customer Race","name","race","appendTo","body",1,"w-100",3,"ngModelChange","options","ngModel","showClear"],["for","inputDocument",1,"mb-2"],["type","text","id","inputDocument","placeholder","Customer document - Resource URL","matTooltipPosition","above","matTooltip","Input Customer Document-Resource URL",1,"form-control","custom",3,"ngModelChange","ngModel"],["for","inputIdentification",1,"mb-2"],["type","text","id","inputIdentification","matTooltipPosition","above","placeholder","Nationaly ID","numericInputOnly","nationalId","name","nationalId",1,"form-control","custom",3,"ngModelChange","matTooltip","ngModel","ngClass","disabled"],[1,"invalid-feedback","fst-italic"],["for","inputPhone",1,"mb-2"],["type","text","id","inputPhone","name","phoneNumber","matTooltipPosition","above","placeholder","Phone","numericInputOnly","phone",1,"form-control","custom",3,"ngModelChange","matTooltip","ngModel","ngClass","disabled"]],template:function(e,t){if(e&1){let i=T();n(0,"div",2)(1,"div",3)(2,"label",4),s(3," City "),n(4,"i",5),S("click",function(){return t.openAddCityDialog()}),a()(),n(5,"p-select",6),C("ngModelChange",function(g){return _(i),u(t.form.Contact.City,g)||(t.form.Contact.City=g),h(g)}),a()(),n(6,"div",3)(7,"label",7),s(8,"Fax"),a(),n(9,"input",8),C("ngModelChange",function(g){return _(i),u(t.form.Contact.Fax,g)||(t.form.Contact.Fax=g),h(g)}),a()(),n(10,"div",3)(11,"label",9),s(12,"Nationaly"),a(),n(13,"p-select",10),C("ngModelChange",function(g){return _(i),u(t.form.Contact.NationalityID,g)||(t.form.Contact.NationalityID=g),h(g)}),a()(),n(14,"div",3)(15,"label",11),s(16,"Race"),a(),n(17,"p-select",12),C("ngModelChange",function(g){return _(i),u(t.form.Contact.RaceID,g)||(t.form.Contact.RaceID=g),h(g)}),a()(),n(18,"div",3)(19,"label",13),s(20,"Document"),a(),n(21,"input",14),C("ngModelChange",function(g){return _(i),u(t.form.Contact.ResourceUrl,g)||(t.form.Contact.ResourceUrl=g),h(g)}),a()(),n(22,"div",3)(23,"label",15),s(24,"Nationaly ID"),a(),n(25,"input",16,0),C("ngModelChange",function(g){return _(i),u(t.form.Contact.NationalIDNumber,g)||(t.form.Contact.NationalIDNumber=g),h(g)}),a(),v(27,At,2,1,"div",17),a(),n(28,"div",3)(29,"label",18),s(30,"Work Phone"),a(),n(31,"input",19,1),C("ngModelChange",function(g){return _(i),u(t.form.Contact.Phone,g)||(t.form.Contact.Phone=g),h(g)}),a(),v(33,kt,2,1,"div",17),a()()}if(e&2){let i=D(26),o=D(32);m(5),p("options",t.options.Cities),c("ngModel",t.form.Contact.City),m(4),c("ngModel",t.form.Contact.Fax),m(4),p("options",t.options.Nationalities),c("ngModel",t.form.Contact.NationalityID),p("showClear",!0),m(4),p("options",t.options.Races),c("ngModel",t.form.Contact.RaceID),p("showClear",!0),m(4),c("ngModel",t.form.Contact.ResourceUrl),m(4),p("matTooltip",t.roleService.global.SensitiveField?"Input Nationaly ID":t.maskingFieldMsg),c("ngModel",t.form.Contact.NationalIDNumber),p("ngClass",y(20,ht,i.invalid&&(i.dirty||i.touched)))("disabled",!t.roleService.global.SensitiveField&&t.maskingFields.NationalIDNumber),m(2),w(i.invalid&&(i.dirty||i.touched)?27:-1),m(4),p("matTooltip",t.roleService.global.SensitiveField?"Input Work Phone":t.maskingFieldMsg),c("ngModel",t.form.Contact.Phone),p("ngClass",y(22,ht,o.invalid&&(o.dirty||o.touched)))("disabled",!t.roleService.global.SensitiveField&&t.maskingFields.Phone),m(2),w(o.invalid&&(o.dirty||o.touched)?33:-1)}},dependencies:[I,k,E,P,F,ue,L],styles:[".form-control.custom[_ngcontent-%COMP%]{border-radius:4px;padding:10px 12px}[_nghost-%COMP%] .p-select .p-dropdown{border-radius:10px!important;border:1px solid #dee2e6!important;background:#fff!important}[_nghost-%COMP%] .p-select .p-dropdown .p-dropdown-label, [_nghost-%COMP%] .p-select .p-dropdown .p-dropdown-label-container{padding:10px 12px!important}[_nghost-%COMP%] .p-select{width:100%;border-radius:4px}"],changeDetection:0})};var ye=class r{form={};editorApiKey="zc58cdrrftek5r5igtmjiar7ed4n3wr00hzd4w4mvtx8mpxa";static \u0275fac=function(e){return new(e||r)};static \u0275cmp=x({type:r,selectors:[["POS-customer-description"]],inputs:{form:"form"},standalone:!1,decls:14,vars:2,consts:[[1,"row","g-4"],[1,"fw-normal","mb-5"],[1,"col-sm-12"],["matTooltipPosition","above","matTooltip","Input Description for the customer",2,"height","240px"],["height","220px",3,"ngModelChange","ngModel"],[1,"form-floating-outline"],["id","inputDescriptionExtra","placeholder","Description Extra","matTooltipPosition","above","matTooltip","Input extra description for the customer",1,"form-control",2,"height","100px",3,"ngModelChange","ngModel"],["for","inputDescriptionExtra"]],template:function(e,t){e&1&&(n(0,"div",0)(1,"h4",1),s(2,"Description"),a(),n(3,"div",2)(4,"div",3)(5,"POS-tinymce-editor",4),C("ngModelChange",function(o){return u(t.form.Contact.Description,o)||(t.form.Contact.Description=o),o}),a()()(),n(6,"h4",1),s(7,"Internal Description"),a(),n(8,"div",2)(9,"div",5)(10,"textarea",6),C("ngModelChange",function(o){return u(t.form.Contact.Description2,o)||(t.form.Contact.Description2=o),o}),s(11," "),a(),n(12,"label",7),s(13,"Description Extra"),a()()()()),e&2&&(m(5),c("ngModel",t.form.Contact.Description),m(5),c("ngModel",t.form.Contact.Description2))},dependencies:[I,E,P,F,mt],encapsulation:2,changeDetection:0})};var be=class r{form={};options={};toastr=A(W);ac=A($e);isNotEmpty(l){return b.IsNotEmpty(l)}onAssignCustomer(l){l!=this.form.Contact.ID?this.form.Contact.ReferredBy=l:(this.toastr.warning("You cannot assign referred by field whose is the same as the referred customer",N.Warning),this.ac.form.setValue(""))}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=x({type:r,selectors:[["POS-customer-acquisition"]],inputs:{form:"form",options:"options"},standalone:!1,decls:9,vars:6,consts:[[1,"row","g-4"],[1,"col-sm-4"],["for","media",1,"ng-select"],["customLabel","Referred By","name","Key","requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModelChange","customStyle","ngModel","inputTextValue"],["appendTo","body","id","media","optionLabel","Name","optionValue","ID","matTooltipPosition","above","matTooltip","Assign Acquisition Media for the Customer",1,"w-100",3,"ngModelChange","ngModel","options","showClear"]],template:function(e,t){e&1&&(n(0,"div",0)(1,"div",1)(2,"label",2),s(3,"Referred By"),a(),n(4,"autocompleteV2",3),C("ngModelChange",function(o){return u(t.form.Contact.ReferredBy,o)||(t.form.Contact.ReferredBy=o),o}),S("ngModelChange",function(o){return t.onAssignCustomer(o)}),a()(),n(5,"div",1)(6,"label",2),s(7,"Acquisition Media"),a(),n(8,"p-select",4),C("ngModelChange",function(o){return u(t.form.Contact.AcquisitionMediaID,o)||(t.form.Contact.AcquisitionMediaID=o),o}),a()()()),e&2&&(m(4),p("customStyle",!0),c("ngModel",t.form.Contact.ReferredBy),p("inputTextValue",t.form.Contact.ReferredByName),m(4),c("ngModel",t.form.Contact.AcquisitionMediaID),p("options",t.options.MediaList)("showClear",!1))},dependencies:[I,P,F,et,L],styles:["label[_ngcontent-%COMP%]{font-size:.813rem}[_nghost-%COMP%] .ng-select .ng-select-container{border-color:#dee2e6;border-radius:.25rem;min-height:2.375rem}[_nghost-%COMP%] .ng-select.ng-select-single .ng-select-container{height:2.375rem}[_nghost-%COMP%] .ng-select input{padding-top:0!important}[_nghost-%COMP%] .ng-select.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border-color:#86b7fe;box-shadow:0 0 0 .25rem #0d6efd40}[_nghost-%COMP%] autocompleteV2{display:block}[_nghost-%COMP%] autocompleteV2 .mat-mdc-text-field-wrapper{height:2.375rem;padding:0!important;border:1px solid #dee2e6!important;border-radius:.25rem!important;background:#fff!important}[_nghost-%COMP%] autocompleteV2 .mat-mdc-form-field-flex{height:100%;padding:0 .75rem!important;align-items:center}[_nghost-%COMP%] autocompleteV2 .mat-mdc-form-field-infix{padding-top:0!important;padding-bottom:0!important;min-height:unset!important;width:100%;display:flex;align-items:center}[_nghost-%COMP%] autocompleteV2 label{display:none!important}[_nghost-%COMP%] autocompleteV2 input.form-control{border-radius:4px!important;background:transparent!important;box-shadow:none!important;height:2.375rem;font-size:.75rem}[_nghost-%COMP%] autocompleteV2 .mdc-line-ripple{display:none}[_nghost-%COMP%] autocompleteV2 .mat-mdc-form-field-subscript-wrapper{display:none}[_nghost-%COMP%] autocompleteV2:focus-within .mat-mdc-text-field-wrapper{border-color:#86b7fe!important;box-shadow:0 0 0 .25rem #0d6efd40!important}"]})};var Rt=["mySelect"],Bt=["customerForm"],qt=r=>[r],jt=r=>({ID:r}),Q=r=>({"is-invalid":r}),Me=r=>({required:r}),Ut=r=>({selected:r});function Gt(r,l){r&1&&(n(0,"div",29),s(1," First name is mandatory "),a())}function Ht(r,l){if(r&1&&(n(0,"div",29),s(1),a()),r&2){f(2);let e=D(42);m(),Z(" ",e==null||e.errors==null||e.errors.minLength==null?null:e.errors.minLength.message," ")}}function zt(r,l){r&1&&(n(0,"div",29),s(1," Mobile Phone is mandatory. "),a())}function Qt(r,l){if(r&1&&v(0,Ht,2,1,"div",29)(1,zt,2,0,"div",29),r&2){f();let e=D(42),t=f();w(e.getError("minLength")?0:e.getError("required")&&t.data.Config.RequireContactMobile?1:-1)}}function Kt(r,l){if(r&1){let e=T();n(0,"i",67),S("click",function(){_(e);let i=f(3);return h(i.mobileVerified=!i.mobileVerified)}),a()}}function Yt(r,l){if(r&1){let e=T();n(0,"i",68),S("click",function(){_(e);let i=f(3);return h(i.mobileVerified=!i.mobileVerified)}),a()}}function Jt(r,l){if(r&1&&(n(0,"span",38),v(1,Kt,1,0,"i",65)(2,Yt,1,0,"i",66),a()),r&2){let e=f(2);m(),w(e.mobileVerified?2:1)}}function Xt(r,l){r&1&&(n(0,"div",29),s(1," Email is mandatory. "),a())}function Zt(r,l){r&1&&(n(0,"div",29),s(1," Email must be a valid email address. "),a())}function $t(r,l){if(r&1&&v(0,Xt,2,0,"div",29)(1,Zt,2,0,"div",29),r&2){f();let e=D(50),t=f();w(e.hasError("required")&&t.data.Config.RequireContactEmail?0:e.hasError("email")?1:-1)}}function eo(r,l){r&1&&(n(0,"div",29),s(1," Display Name is mandatory "),a())}function to(r,l){r&1&&(n(0,"div",29),s(1,"Code is mandatory."),a())}function oo(r,l){if(r&1&&(V(0,"input",54),Ae(1,"date")),r&2){let e=f(2);p("matTooltip",!e.roleService.global.SensitiveField&&e.maskingFields.Birthdate?e.maskingFieldMsg:"Input Customer Birth Date")("value",ke(1,3,e.formData.Contact.Birthdate,"dd MMM yyyy"))("disabled",!0)}}function io(r,l){r&1&&(n(0,"div",29),s(1," Date of Birth is mandatory. "),a())}function no(r,l){if(r&1){let e=T();n(0,"p-datepicker",69,6),C("ngModelChange",function(i){_(e);let o=f(2);return u(o.formData.Contact.Birthdate,i)||(o.formData.Contact.Birthdate=i),h(i)}),a(),v(2,io,2,0,"div",29)}if(r&2){let e=D(1),t=f(2);c("ngModel",t.formData.Contact.Birthdate),p("ngClass",y(4,Q,e.invalid&&(e.dirty||e.touched)&&t.data.Config.RequireContactBirthdate))("required",t.data.Config.RequireContactBirthdate),m(2),w(e.invalid&&(e.dirty||e.touched)&&t.data.Config.RequireContactBirthdate?2:-1)}}function ao(r,l){r&1&&(n(0,"div",70),V(1,"i",71),n(2,"span"),s(3,"Personal"),a()())}function ro(r,l){if(r&1){let e=T();n(0,"div",72),V(1,"div",73),n(2,"div",73),V(3,"div",74),a()(),n(4,"POS-customer-information",75),C("formChange",function(i){_(e);let o=f(2);return u(o.data.Form,i)||(o.data.Form=i),h(i)}),a()}if(r&2){let e=f(2);m(4),c("form",e.data.Form),p("options",e.data.Options)("maskingFields",e.maskingFields)("isStateEdit",e.isStateEdit)("maskingFieldMsg",e.maskingFieldMsg)("config",e.data.Config)}}function lo(r,l){r&1&&(n(0,"div",70),V(1,"i",76),n(2,"span"),s(3,"Sales & Debt"),a()())}function mo(r,l){if(r&1){let e=T();n(0,"div",77)(1,"POS-customer-sales-price",78),C("formChange",function(i){_(e);let o=f(2);return u(o.data.Form,i)||(o.data.Form=i),h(i)}),a()()}if(r&2){let e=f(2);m(),p("maskingFields",e.maskingFields)("options",e.data.Options),c("form",e.data.Form),p("isStateEdit",e.isStateEdit)}}function so(r,l){r&1&&(n(0,"div",70),V(1,"i",79),n(2,"span"),s(3,"Address"),a()())}function po(r,l){if(r&1){let e=T();n(0,"div",77)(1,"POS-customer-address",80),S("newAddressEvent",function(i){_(e);let o=f(2);return h(o.onNewAddress(i))}),C("formChange",function(i){_(e);let o=f(2);return u(o.data.Form,i)||(o.data.Form=i),h(i)}),a()()}if(r&2){let e=f(2);m(),c("form",e.data.Form),p("options",e.data.Options)("config",e.data.Config)("onSubmitted",e.isSubmitted())}}function co(r,l){r&1&&(n(0,"div",70),V(1,"i",81),n(2,"span"),s(3,"Membership"),a()())}function uo(r,l){if(r&1){let e=T();n(0,"div",77)(1,"POS-customer-membersip",82),C("formChange",function(i){_(e);let o=f(2);return u(o.data.Form,i)||(o.data.Form=i),h(i)}),a()()}if(r&2){let e=f(2);m(),p("maskingFields",e.maskingFields),c("form",e.data.Form),p("options",e.data.Options)("data",e.data)("isStateEdit",e.isStateEdit)("onSubmitted",e.isSubmitted())("requiredFields",e.data.Config)}}function Co(r,l){r&1&&(n(0,"div",70),V(1,"i",83),n(2,"span"),s(3,"Description"),a()())}function fo(r,l){if(r&1){let e=T();n(0,"div",77)(1,"POS-customer-description",84),C("formChange",function(i){_(e);let o=f(2);return u(o.data.Form,i)||(o.data.Form=i),h(i)}),a()()}if(r&2){let e=f(2);m(),c("form",e.data.Form)}}function go(r,l){r&1&&(n(0,"div",70),V(1,"i",85),n(2,"span"),s(3,"Acquisition"),a()())}function _o(r,l){if(r&1){let e=T();n(0,"div",77)(1,"POS-customer-acquisition",86),C("formChange",function(i){_(e);let o=f(2);return u(o.data.Form,i)||(o.data.Form=i),h(i)}),a()()}if(r&2){let e=f(2);m(),c("form",e.data.Form),p("options",e.data.Options)}}function ho(r,l){if(r&1){let e=T();n(0,"mainpanel-cmp",7),ve(1,8),n(2,"a",9),s(3,"Cancel"),a(),n(4,"button",10),S("click",function(){_(e);let i=D(9),o=f();return h(o.onValidateForm(i))}),s(5," Save "),a(),we(),ve(6,11),n(7,"div",12)(8,"form",13,0)(10,"div",14)(11,"div",15)(12,"div",16)(13,"div",17)(14,"div",18)(15,"div",19)(16,"POS-photo-image-uploader",20),S("imageChange",function(i){_(e);let o=f();return h(o.onPhotoImageChange(i))}),a()(),n(17,"div",21)(18,"div",22)(19,"div",23)(20,"div")(21,"label",24),s(22,"Title"),a(),n(23,"input",25),C("ngModelChange",function(i){_(e);let o=f();return u(o.formData.Contact.Title,i)||(o.formData.Contact.Title=i),h(i)}),a()()(),n(24,"div",26)(25,"div")(26,"label",27),s(27," First Name "),a(),n(28,"input",28,1),C("ngModelChange",function(i){_(e);let o=f();return u(o.formData.Contact.FirstName,i)||(o.formData.Contact.FirstName=i),h(i)}),S("ngModelChange",function(){_(e);let i=f();return h(i.UpdateName())}),a(),v(30,Gt,2,0,"div",29),a()(),n(31,"div",30)(32,"div")(33,"label",31),s(34," Last Name "),a(),n(35,"input",32),C("ngModelChange",function(i){_(e);let o=f();return u(o.formData.Contact.LastName,i)||(o.formData.Contact.LastName=i),h(i)}),S("ngModelChange",function(){_(e);let i=f();return h(i.UpdateName())}),a()()()()()(),n(36,"div",33)(37,"div",34)(38,"label",35),s(39," Mobile Phone "),a(),n(40,"div",36)(41,"input",37,2),C("ngModelChange",function(i){_(e);let o=f();return u(o.formData.Contact.Mobile,i)||(o.formData.Contact.Mobile=i),h(i)}),a(),v(43,Qt,2,1),v(44,Jt,3,1,"span",38),a()(),n(45,"div",34)(46,"label",39),s(47,"Email"),a(),n(48,"div",40)(49,"input",41,3),C("ngModelChange",function(i){_(e);let o=f();return u(o.formData.Contact.Email,i)||(o.formData.Contact.Email=i),h(i)}),a(),v(51,$t,2,1),a()()(),n(52,"div",33)(53,"div",34)(54,"div")(55,"label",42),s(56," Display Name "),a(),n(57,"div",43)(58,"input",44,4),C("ngModelChange",function(i){_(e);let o=f();return u(o.formData.Contact.Name,i)||(o.formData.Contact.Name=i),h(i)}),a(),n(60,"div",45),S("click",function(){_(e);let i=f();return h(i.isDisplayNameDisabled.update(o=>!o))}),V(61,"i",46),a()(),v(62,eo,2,0,"div",29),a()(),n(63,"div",34)(64,"label",47),s(65," Customer Code "),a(),n(66,"input",48,5),C("ngModelChange",function(i){_(e);let o=f();return u(o.formData.Contact.Code,i)||(o.formData.Contact.Code=i),h(i)}),a(),v(68,to,2,0,"div",29),a()()()()(),n(69,"div",30)(70,"div",49)(71,"div",17)(72,"div",50)(73,"div",51)(74,"div",52)(75,"label",53),s(76," Date of Birth "),a(),v(77,oo,2,6,"input",54)(78,no,3,6),a()(),n(79,"div",51)(80,"div",52)(81,"label",55),s(82," Groups "),a(),n(83,"p-multiselect",56),C("ngModelChange",function(i){_(e);let o=f();return u(o.formData.Groups,i)||(o.formData.Groups=i),h(i)}),a()()(),n(84,"div",51)(85,"div",57)(86,"label",58),s(87," Status "),a(),n(88,"p-select",59),C("ngModelChange",function(i){_(e);let o=f();return u(o.formData.Contact.StateID,i)||(o.formData.Contact.StateID=i),h(i)}),a()()(),n(89,"div",51)(90,"div",52)(91,"label",60),s(92,"Gender"),a(),n(93,"p-select",61),C("ngModelChange",function(i){_(e);let o=f();return u(o.formData.Contact.Gender,i)||(o.formData.Contact.Gender=i),h(i)}),a()()()()()()(),n(94,"div",51)(95,"div",49)(96,"div",17)(97,"mat-tab-group",62)(98,"mat-tab"),O(99,ao,4,0,"ng-template",63)(100,ro,5,6,"ng-template",64),a(),n(101,"mat-tab"),O(102,lo,4,0,"ng-template",63)(103,mo,2,4,"ng-template",64),a(),n(104,"mat-tab"),O(105,so,4,0,"ng-template",63)(106,po,2,4,"ng-template",64),a(),n(107,"mat-tab"),O(108,co,4,0,"ng-template",63)(109,uo,2,7,"ng-template",64),a(),n(110,"mat-tab"),O(111,Co,4,0,"ng-template",63)(112,fo,2,1,"ng-template",64),a(),n(113,"mat-tab"),O(114,go,4,0,"ng-template",63)(115,_o,2,2,"ng-template",64),a()()()()()()()(),we(),a()}if(r&2){let e=D(29),t=D(42),i=D(50),o=D(59),g=D(67),d=f();p("pageData",d.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),m(2),p("routerLink",y(61,qt,d.formData.Contact.ID==d.emptyGuid?"/menu/Contacts/Contact/Customers":"/menu/Contacts/Contact/Customers/Info"))("queryParams",y(63,jt,d.formData.Contact.ID==d.emptyGuid?null:d.formData.Contact.ID)),m(2),p("disabled",d.isSaveBtnDisabled),m(12),p("image",d.formData==null||d.formData.Contact==null?null:d.formData.Contact.ImageURLClient)("iconClass","fa-light fa-circle-user-circle-plus")("width","102px")("height","102px")("cloudinaryFolder",(d.data==null?null:d.data.CloudinaryFolder)??"")("label","Upload Photo")("disabled",!(d.roleService.contact!=null&&d.roleService.contact.ContactImageEditor)),m(7),c("ngModel",d.formData.Contact.Title),m(5),c("ngModel",d.formData.Contact.FirstName),p("required",!0)("ngClass",y(65,Q,e.invalid&&(e.dirty||e.touched))),m(2),w(e.invalid&&(e.dirty||e.touched)?30:-1),m(5),c("ngModel",d.formData.Contact.LastName),m(3),p("ngClass",y(67,Me,d.data.Config.RequireContactMobile)),!d.roleService.global.SensitiveField&&d.maskingFields.Mobile&&d.maskingFieldMsg,m(3),c("ngModel",d.formData.Contact.Mobile),p("required",d.data.Config.RequireContactMobile)("matTooltip",!d.roleService.global.SensitiveField&&d.maskingFields.Mobile?d.maskingFieldMsg:"Input Mobile Phone")("ngClass",y(69,Q,t.invalid&&(t.dirty||t.touched)))("disabled",!d.roleService.global.SensitiveField&&d.maskingFields.Mobile),m(2),w(t.invalid&&(t.dirty||t.touched)?43:-1),m(),w(d.formData.Contact.Mobile&&(!d.maskingFields.Mobile&&d.roleService.global.SensitiveField||!d.isStateEdit)&&!t.invalid?44:-1),m(2),p("ngClass",y(71,Me,d.data.Config.RequireContactEmail)),m(3),Ne("has-suffix",d.formData.Contact.Email&&(!d.maskingFields.Email&&!!d.roleService.global.SensitiveField||!d.isStateEdit)&&!i.invalid),c("ngModel",d.formData.Contact.Email),p("required",d.data.Config.RequireContactEmail)("matTooltip",!d.roleService.global.SensitiveField&&d.maskingFields.Email?d.maskingFieldMsg:"Input Customer Email")("ngClass",y(73,Q,i.invalid&&(i.dirty||i.touched)&&(d.data.Config.RequireContactEmail||i.hasError("email"))))("disabled",!d.roleService.global.SensitiveField&&d.maskingFields.Email),m(2),w(i.invalid&&(i.dirty||i.touched)?51:-1),m(7),p("ngClass",y(75,Q,o.touched&&o.invalid)),c("ngModel",d.formData.Contact.Name),p("disabled",d.isDisplayNameDisabled()),m(2),p("matTooltip",d.isDisplayNameDisabled()?"Override First & Last Name Formula":"Lock Display Name"),m(2),w(o.invalid&&(o.dirty||o.touched)?62:-1),m(2),p("ngClass",y(77,Me,d.data.Config.RequireContactCode)),m(2),p("matTooltip",!d.roleService.global.SensitiveField&&d.maskingFields.Code?d.maskingFieldMsg:"Input Customer Code"),c("ngModel",d.formData.Contact.Code),p("required",d.data.Config.RequireContactCode)("ngClass",y(79,Q,g.invalid&&(g.dirty||g.touched)&&d.data.Config.RequireContactCode))("disabled",!d.roleService.global.SensitiveField&&d.maskingFields.Code),m(2),w(g.invalid&&(g.dirty||g.touched)&&d.data.Config.RequireContactCode?68:-1),m(7),p("ngClass",y(81,Me,d.data.Config.RequireContactBirthdate)),m(2),w(!d.roleService.global.SensitiveField&&d.maskingFields.Birthdate?77:78),m(6),p("showClear",!0)("options",d.options.Groups)("maxSelectedLabels",1),c("ngModel",d.formData.Groups),m(2),p("ngClass",y(83,Ut,d.checkedIsNotEmpty(d.formData.Contact.StateID))),m(3),p("options",d.options.States),c("ngModel",d.formData.Contact.StateID),p("disabled",d.data.Config.RequireEmailActivation),m(5),p("options",d.options.Genders),c("ngModel",d.formData.Contact.Gender),m(4),p("dynamicHeight",!0)}}var yt=class r extends ct{constructor(e,t,i,o,g,d,yo,bo,Mo){super(e,t,"ContactLoader/ContactForm",i);this.httpService=t;this.activatedRoute=i;this.router=o;this.toaster=g;this.datePipe=d;this.roleService=yo;this.matDialog=bo;this.customerService=Mo;this.destroy$=new Te,this.httpService.post("/api/ContactSetup/Country").pipe(j(Se=>Se.List)).subscribe(Se=>this.countries=Se)}emptyGuid=b.GuidEmpty;bigPicture=A(dt);removeImg=!1;countries;emailVerified;mobileVerified;maskingFields;isStateEdit=!1;maskingFieldMsg=ce.maskingField;isSubmitted=K(!1);uppyCoreConfiguration={restrictions:{allowedFileTypes:["image/*",".jpg",".jpeg",".png"]}};dashboardPropsConfiguration={height:80};destroy$;processUppy=A(pt);uploadThumbnail=K(null);uploadImageUrlClient=K(null);selectComponent;customerForm;isDisplayNameDisabled=K(!0);onOpen(){setTimeout(()=>{let e=document.querySelector(".ng-dropdown-panel");if(e){let t=e.clientHeight;console.log("Panel Height:",t,"px")}},0)}postBindForm(e){this.menuData.H=e.PageTitle,this.maskingFields=b.generateMaskingField(this.data?.Options?.MaskFields),this.checkIsStateEdit(),e.Form.DefaultDue||(e.Form.DefaultDue.Days=0),e.Form.DefaultDue||(e.Form.DefaultDue.Months=0),e.Form.LoyaltyPoint.Point||(e.Form.LoyaltyPoint.Point=0);let t=e.Form.Contact.CreatorEntityID;if(b.IsEmpty(t)&&(e.Form.Contact.CreatorEntityID=null),this.initVerifiedContact(),b.IsEmpty(e.Form.Contact.Birthdate))e.Form.Contact.Birthdate=null;else try{e.Form.Contact.Birthdate=new Date(e.Form.Contact.Birthdate)}catch(i){}e.Config.RequireEmailActivation&&(e.Form.Contact.StateID=2)}checkedIsNotEmpty(e){return b.IsNotEmpty(e)}dateChange(e){this.formData.Contact.Birthdate=e}UpdateName(){this.formData.Contact.Name=(this.formData.Contact.Title==null?"":this.formData.Contact.Title)+" "+(this.formData.Contact.FirstName==null?"":this.formData.Contact.FirstName)+(this.formData.Contact.LastName==null?"":" "+this.formData.Contact.LastName)}preSubmitForm(){this.data.Form={CloudinaryID:this.data.CloudinaryID,Form:this.formData,RemoveImage:this.removeImg}}onSubmitSuccess(){this.toaster.success("Contact successfully updated",N.Success),this.router.navigate(["/menu/Contacts/Contact/Customers"])}onSubmitError(){this.data.Form=this.formData.Form}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}onValidateForm(e){if(this.assignVerifiedContact(),e.control.markAllAsTouched(),this.isSubmitted.set(!0),e.control.invalid){this.toaster.warning("Please fill in all required fields before creating the customer data","Incomplete Information");return}let t=this.data.Form.Contact.Description;if(t&&t.length>500){this.toaster.warning("The description cannot exceed 500 characters. Please shorten your input","Character Limit Exceeded");return}this.onSubmit("Contact/ContactForm")}onNewAddress(e){e.index==null?this.formData.Addresses.push(e.address):this.formData.Addresses[e.index]=e.address}openAddCityDialog(){this.matDialog.open(z,{data:{countries:this.countries}}).afterClosed().pipe(U(e=>e.CountryID&&e.Name),oe(e=>this.httpService.post("/api/ContactSetup/SubmitCity",e).pipe(j(t=>te(ee({},e),{ID:t.ID}))))).subscribe(e=>{this.options.Cities=[...this.options.Cities,e],this.formData.Contact.City=e.ID})}onUploadFile(e){e instanceof File&&this.processUppy.uploadFileThroughPreSignedUrl(e,this.data.CloudinaryFolder,!1,"medium").subscribe(t=>{this.formData.Contact.ImageURLClient=t.url,this.formData.Contact.Thumbnail=t.thumbnail,this.formData.Contact.ImageURL=e.name})}removeImage(){this.formData.Contact.ImageURLClient=null,this.formData.Contact.ImageURL=null,this.formData.Contact.Thumbnail=null,this.removeImg=!0}onPhotoImageChange(e){if(console.log("Photo change result:",e),!e){this.removeImage();return}this.formData.Contact.ImageURLClient=e.ImageURL??null,this.formData.Contact.Thumbnail=e.Thumbnail??null,this.formData.Contact.ImageURL=e.ImageName??null,this.removeImg=!1}openBigPicture(e,t){this.bigPicture.openBiggerPicture(t,e)}checkIsStateEdit(){let e=this.activatedRoute.snapshot.queryParams;this.isStateEdit=Object.values(e).length>0}initVerifiedContact(){this.emailVerified=this.formData.Contact.EmailVerified,this.mobileVerified=this.formData.Contact.MobileVerified}assignVerifiedContact(){this.formData.Contact.EmailVerified=this.emailVerified,this.formData.Contact.MobileVerified=this.mobileVerified}get isSaveBtnDisabled(){if(this.customerForm?.invalid)return!0;let e=this.data?.Config,t=this.formData?.Contact;return!!(!e||!t||e.RequireContactPhoto&&!t.Thumbnail&&!t.ImageURLClient||e.RequireContactAddress&&!t.Address)}static \u0275fac=function(t){return new(t||r)(M(Xe),M(re),M(We),M(Le),M(W),M(ne),M(G),M(H),M(ut))};static \u0275cmp=x({type:r,selectors:[["POS-customer-form-v2"]],viewQuery:function(t,i){if(t&1&&ie(Rt,5)(Bt,5),t&2){let o;Y(o=J())&&(i.selectComponent=o.first),Y(o=J())&&(i.customerForm=o.first)}},features:[Fe],decls:1,vars:1,consts:[["customerForm","ngForm"],["firstName","ngModel"],["mobilePhone","ngModel"],["emailCtrl","ngModel"],["displayName","ngModel"],["code","ngModel"],["birthdateCtrl","ngModel"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","actions",5,["actions"]],["role","button","matTooltipPosition","above","matTooltip","Cancel",1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],["type","button","role","button",1,"btn","btn-success",3,"click","disabled"],["ngProjectAs","content",5,["content"]],[1,"container-fluid","py-6"],["name","form"],[1,"row"],[1,"col-12","col-lg-8"],[1,"card","pb-2"],[1,"card-body"],[1,"row","border-bottom","pb-6"],[1,"col-12","col-md-4","col-lg-2","d-flex","align-items-center","justify-content-center","py-2","ps-6","pe-2"],[3,"imageChange","image","iconClass","width","height","cloudinaryFolder","label","disabled"],[1,"col","d-flex","align-items-center"],[1,"row","g-4","w-100"],[1,"col-12","col-md-6","col-lg-2"],["for","inputTitle"],["type","text","id","inputTitle","name","title","placeholder","Title",1,"form-control","custom",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-lg-5"],["for","inputFirstName",1,"text-muted","required"],["type","text","matTooltipPosition","above","matTooltip","Input Customer First Name","id","inputFirstName","name","firstName","autofocus","","placeholder","First Name",1,"form-control","custom",3,"ngModelChange","ngModel","required","ngClass"],[1,"invalid-feedback"],[1,"col"],["for","inputLastName",1,"text-muted"],["type","text","matTooltipPosition","above","matTooltip","Input Customer Last Name","id","inputLastName","name","lastName","placeholder","Last Name",1,"form-control","custom",3,"ngModelChange","ngModel"],[1,"row","mt-4","g-4"],[1,"col-12","col-md-6","col-lg-6"],["for","inputMobilePhone",1,"text-muted",3,"ngClass"],[1,"d-flex","flex-column","align-items-center"],["type","text","id","inputMobilePhone","placeholder","Mobile Phone","numericInputOnly","phone","matTooltipPosition","above","name","mobilePhone",1,"form-control","custom",3,"ngModelChange","ngModel","required","matTooltip","ngClass","disabled"],[1,"fs-2","input-suffix",2,"position","absolute","right","10px","top","55%","transform","translateY(-50%)","z-index","2"],["for","inputEmail",1,"text-muted",3,"ngClass"],[1,"d-flex","flex-column","align-items-center","flex-grow-1"],["type","email","email","","id","inputEmail","name","email","placeholder","Email","matTooltipPosition","above",1,"form-control","custom",3,"ngModelChange","ngModel","required","matTooltip","ngClass","disabled"],["for","inputDisplayName",1,"text-muted","required"],[1,"d-flex","justify-content-center","align-items-center"],["type","text","id","inputDisplayName","name","displayName","placeholder","Mr John Doe","required","","matTooltipPosition","above","matTooltip","First Name and Last Name",1,"form-control","custom",2,"border-top-right-radius","0px","border-bottom-right-radius","0px",3,"ngModelChange","ngClass","ngModel","disabled"],["role","button","matTooltipPosition","above",1,"border","d-flex","justify-content-center","align-items-center","lock-btn",3,"click","matTooltip"],[1,"fa-solid","fa-lock"],["for","inputCode",1,"text-muted",3,"ngClass"],["type","text","matTooltipPosition","above","name","code","placeholder","Customer Code",1,"form-control","custom",3,"ngModelChange","matTooltip","ngModel","required","ngClass","disabled"],[1,"card"],[1,"row","row-gap-4"],[1,"col-12"],[1,"ng-select"],["for","inputSelectBirthdate",1,"ng-select","mb-3",3,"ngClass"],["type","text","matTooltipPosition","above","name","birthdate","placeholder","Birthdate",1,"form-control","custom",3,"matTooltip","value","disabled"],["for","inputSelectGroups",1,"ng-select","mb-3"],["placeholder","Customer Groups","optionLabel","Name","optionValue","ID","selectedItemsLabel","{0} Groups Selected","matTooltipPosition","above","matTooltip","Select Customer Group","name","customerGroups",3,"ngModelChange","showClear","options","maxSelectedLabels","ngModel"],[1,"ng-select",3,"ngClass"],["for","inputSelectCity",1,"ng-select","mb-3"],["placeholder","Select a City","optionLabel","Value","optionValue","Key","placeholder","Choose an Options","matTooltipPosition","above","matTooltip","Select Customer Status","id","inputSelectCity","name","customerStatus",1,"w-full","md:w-56",3,"ngModelChange","options","ngModel","disabled"],["for","inputGender",1,"ng-select","mb-3"],["optionLabel","Value","optionValue","Key","placeholder","Choose an Options","matTooltipPosition","above","matTooltip","Select Customer Gender","name","gender","appendTo","body",1,"w-100",3,"ngModelChange","options","ngModel"],[3,"dynamicHeight"],["mat-tab-label",""],["matTabContent",""],["matTooltip","Click to Verified",1,"cursor-pointer","fa-solid","fa-badge"],["matTooltipPosition","above","matTooltip","Mobile Phone is Verified",1,"fa-solid","fa-badge-check","text-primary","cursor-pointer"],["matTooltip","Click to Verified",1,"cursor-pointer","fa-solid","fa-badge",3,"click"],["matTooltipPosition","above","matTooltip","Mobile Phone is Verified",1,"fa-solid","fa-badge-check","text-primary","cursor-pointer",3,"click"],["placeholder","Birthdate","name","birthdate",3,"ngModelChange","ngModel","ngClass","required"],[1,"d-flex","align-items-center","gap-3"],[1,"fa-regular","fa-user"],[1,"row","py-8"],[1,"col-3"],[1,"d-flex"],[3,"formChange","form","options","maskingFields","isStateEdit","maskingFieldMsg","config"],[1,"fa-regular","fa-tag"],[1,"py-8"],[3,"formChange","maskingFields","options","form","isStateEdit"],[1,"fa-regular","fa-address-book"],[3,"newAddressEvent","formChange","form","options","config","onSubmitted"],[1,"fa-address-book","fas"],[3,"formChange","maskingFields","form","options","data","isStateEdit","onSubmitted","requiredFields"],[1,"fa-solid","fa-text"],[3,"formChange","form"],[1,"fa-regular","fa-building"],[3,"formChange","form","options"]],template:function(t,i){t&1&&v(0,ho,116,85,"mainpanel-cmp",7),t&2&&w(i.formData!=null&&i.formData.Contact&&i.data?0:-1)},dependencies:[Ue,qe,E,P,Re,ae,je,F,Be,ot,tt,I,Ze,Ge,Oe,k,ue,Ye,Ke,ze,Qe,gt,fe,_e,he,ye,be,ft,He,at,L,nt,it,lt,rt,Ct,ne],styles:['*[_ngcontent-%COMP%]{font-size:13px}.container-fluid[_ngcontent-%COMP%]{background:#f7f7f8} .mat-mdc-tab-body-content{overflow:visible!important} .mat-mdc-tab-body-wrapper{overflow:visible!important}.ng-dropdown-panel[_ngcontent-%COMP%]{z-index:1100!important}[_nghost-%COMP%] .uppy-Dashboard-inner{width:100%!important;min-height:100px} mat-tab-group mat-tab-header{border-bottom:1px solid #e0e0e0}.form-control.custom[_ngcontent-%COMP%]{border-radius:4px;padding:10px 12px;margin-top:6px}.form-control.custom.has-suffix[_ngcontent-%COMP%]{padding-right:44px}.position-relative[_ngcontent-%COMP%] .invalid-feedback[_ngcontent-%COMP%]{margin-top:6px;position:relative;z-index:0;font-size:10.5px}.required[_ngcontent-%COMP%]:after{content:"*";color:red}[_nghost-%COMP%] .p-select .p-dropdown{border-radius:10px!important;border:1px solid #dee2e6!important;background:#fff!important}[_nghost-%COMP%] .p-select .p-dropdown .p-dropdown-label, [_nghost-%COMP%] .p-select .p-dropdown .p-dropdown-label-container{padding:10px 12px!important}[_nghost-%COMP%] .p-select{width:100%;border-radius:4px}.lock-btn[_ngcontent-%COMP%]{height:100%;width:50px;padding-top:13px;padding-bottom:13.5px;margin-top:6px;border-top-right-radius:4px;border-bottom-right-radius:4px;cursor:pointer}h3[_ngcontent-%COMP%]{font-size:16px} p-datepicker .p-inputtext{padding:10px 12px!important}']})};export{yt as CustomerFormV2Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as w}from"./chunk-KR74ZZ6U.js";import{g as S}from"./chunk-
|
|
1
|
+
import{a as w}from"./chunk-KR74ZZ6U.js";import{g as S}from"./chunk-I6QIHEX7.js";import{a as I,b as F}from"./chunk-R2YNXAPB.js";import{c as D}from"./chunk-3UB7PEG5.js";import{F as x,c as T,e as m,h as y,l as b,s as M}from"./chunk-POUQHZWU.js";import{Ab as d,Bb as n,Cb as i,Db as c,Pb as h,Ra as r,ab as v,ec as o,fc as C,fd as _,la as f,sd as R,tb as p,vb as u,vc as g}from"./chunk-M3O2GJ3M.js";var E=class{};var k=t=>({"is-invalid":t});function W(t,l){t&1&&(n(0,"div",8)(1,"span"),o(2,"Host URL is required."),i()())}function U(t,l){t&1&&(n(0,"span",9),o(1,"Enter the port or device URL used by your middleware."),i())}function O(t,l){t&1&&(n(0,"div",8)(1,"span"),o(2,"Buffer Time must be at least 100 ms."),i()())}function P(t,l){t&1&&(n(0,"span",9),o(1,"Enter the buffer time in milliseconds for your RFID device."),i())}var N=class t{dialogRef=f(I);data=f(F);config=new S;urlCtrl=new b(this.data?.url,[m.required]);bufferTimeCtrl=new b(this.data?.bufferTime??100,[m.required,m.min(100)]);isConnected=this.data?.isConnected;constructor(){this.initModalConfig()}initModalConfig(){this.config.title="Connect RFID",this.config.customWidth="450px",this.config.hideCancel=!0,this.config.okText=this.isConnected?"Disconnect":"Connect Now"}onClose(){this.dialogRef.close()}onConnect(){this.isConnected?this.dialogRef.close({disconnect:!0}):this.urlCtrl.valid&&this.bufferTimeCtrl.valid&&this.dialogRef.close({url:this.urlCtrl.value,bufferTime:this.bufferTimeCtrl.value})}get modalContentWording(){let l="RFID Connected",a="Your RFID device is successfully connected.",e="RFID Not Connected",s="Please connect your RFID device to process items",A=this.isConnected?l:e,L=this.isConnected?a:s;return{title:A,description:L}}static \u0275fac=function(a){return new(a||t)};static \u0275cmp=v({type:t,selectors:[["app-modal-connect-rfid"]],decls:20,vars:15,consts:[[3,"onCancel","onClose","onOk","config","dynamicValidated"],[1,"d-flex","flex-column",2,"row-gap","1.5rem"],[1,"text-center","d-flex","flex-column","align-items-center",2,"row-gap","0.8rem"],[1,"fa-solid","fa-wifi","fa-3x","d-flex","align-items-center","justify-content-center","bg-light",2,"border-radius","50%","width","80px","height","80px",3,"ngClass"],[1,"fw-normal"],[1,"card","d-flex","justify-content-center","p-8","bg-light-gray",2,"border-radius","12px","margin","0"],["for","floatingInput",1,"fw-semibold","mb-2"],["id","floatingInput","placeholder","Host URL","type","text",1,"form-control",2,"border-radius","8px","padding","12px 16px",3,"ngClass","formControl"],[1,"invalid-feedback","mt-4"],[1,"text-muted","mt-2"],["for","floatingInput",1,"fw-semibold","mb-2","mt-4"],["id","floatingInput","placeholder","Buffer Time (ms)","type","text","autoNum","",1,"form-control",2,"border-radius","8px","padding","12px 16px",3,"ngClass","formControl"]],template:function(a,e){a&1&&(n(0,"modal-material",0),h("onCancel",function(){return e.onClose()})("onClose",function(){return e.onClose()})("onOk",function(){return e.onConnect()}),n(1,"content")(2,"div",1)(3,"div",2),c(4,"i",3),n(5,"h2"),o(6),i(),n(7,"span",4),o(8),i()(),n(9,"div",5)(10,"label",6),o(11,"Port / URL"),i(),c(12,"input",7),p(13,W,3,0,"div",8)(14,U,2,0,"span",9),n(15,"label",10),o(16,"Buffer Time"),i(),c(17,"input",11),p(18,O,3,0,"div",8)(19,P,2,0,"span",9),i()()()()),a&2&&(d("config",e.config)("dynamicValidated",e.urlCtrl.valid),r(4),d("ngClass",e.isConnected?"text-success":"text-danger"),r(2),C(e.modalContentWording.title),r(2),C(e.modalContentWording.description),r(4),d("ngClass",g(11,k,e.urlCtrl.invalid&&(e.urlCtrl.touched||e.urlCtrl.dirty)))("formControl",e.urlCtrl),r(),u(e.urlCtrl.invalid&&(e.urlCtrl.touched||e.urlCtrl.dirty)?13:14),r(4),d("ngClass",g(13,k,e.bufferTimeCtrl.invalid&&(e.bufferTimeCtrl.touched||e.bufferTimeCtrl.dirty)))("formControl",e.bufferTimeCtrl),r(),u(e.bufferTimeCtrl.invalid&&(e.bufferTimeCtrl.touched||e.bufferTimeCtrl.dirty)?18:19))},dependencies:[R,_,x,T,y,M,D,w],encapsulation:2})};export{E as a,N as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ge}from"./chunk-566RJ33S.js";import{p as L}from"./chunk-VQQIQFUB.js";import{N as pe}from"./chunk-VAJAIBT3.js";import{d as F}from"./chunk-RBBEZN3D.js";import{a as me,b as ue}from"./chunk-R2YNXAPB.js";import{b as ce,c as W}from"./chunk-3UB7PEG5.js";import{A as le,E as de,F as se,c as Y,g as Z,h as $,i as ee,k as te,o as ie,p as ne,x as oe,y as re,z as ae}from"./chunk-POUQHZWU.js";import{a as X}from"./chunk-PTRS3UA6.js";import{$b as M,Ab as c,Bb as a,Cb as r,Da as R,Db as z,Mb as v,Pb as w,Qc as P,Ra as o,Rb as u,Ya as E,ab as G,bb as A,cb as H,ec as m,fd as J,gc as x,ia as B,jc as f,kc as b,la as D,lc as h,pa as C,qa as _,qc as O,sd as Q,tb as p,vb as g,vc as y,xb as j,yb as K,za as q,zb as U}from"./chunk-M3O2GJ3M.js";var V=class i{elementRef=D(R);control=D(Z,{optional:!0,self:!0});trimInputPrefix=P(null);trimInputSuffix=P(null);trimInputWhitespace=P(!0);onBlur(){let d=this.elementRef.nativeElement;if(!d)return;let e=d.value??"",t=e,l=this.trimInputPrefix(),s=this.trimInputSuffix(),n=this.trimInputWhitespace();n&&(e=e.trim()),l&&e.startsWith(l)&&(e=e.slice(l.length)),s&&e.endsWith(s)&&(e=e.slice(0,e.length-s.length)),n&&(e=e.trim()),e!==t&&(d.value=e,this.control?.control?(this.control.control.setValue(e,{emitEvent:!1}),this.control.control.updateValueAndValidity()):d.dispatchEvent(new Event("input",{bubbles:!0})))}static \u0275fac=function(e){return new(e||i)};static \u0275dir=H({type:i,selectors:[["","trimInput",""]],hostBindings:function(e,t){e&1&&w("blur",function(){return t.onBlur()})},inputs:{trimInputPrefix:[1,"trimInputPrefix"],trimInputSuffix:[1,"trimInputSuffix"],trimInputWhitespace:[1,"trimInputWhitespace"]}})};var T=i=>({selected:i}),he=i=>({"border border-danger":i}),I=i=>({"is-invalid":i}),Me=i=>({"is-invalid border border-danger":i}),ye=i=>({"has-error":i});function ve(i,d){if(i&1){let e=v();a(0,"a",12),w("click",function(){C(e);let l=u();return _(l.chooiceDetail("id"))}),m(1," ID "),r()}if(i&2){let e=u();c("ngClass",y(1,T,e.tabState=="id"))}}function we(i,d){if(i&1&&z(0,"option",21),i&2){let e=d.$implicit;c("value",e.Name)}}function xe(i,d){if(i&1&&(a(0,"div",24)(1,"i",47),m(2," Name is mandatory."),r()()),i&2){u();let e=M(26);c("ngClass",y(1,ye,e.touched&&e.invalid))}}function Se(i,d){i&1&&(a(0,"div",40),m(1," Mobile Phone is mandatory "),r())}function Ne(i,d){if(i&1&&(a(0,"div",40),m(1),r()),i&2){u(2);let e=M(38);o(),x(" ",e.errors==null||e.errors.minLength==null?null:e.errors.minLength.message," ")}}function Ie(i,d){if(i&1&&(p(0,Se,2,0,"div",40),p(1,Ne,2,1,"div",40)),i&2){u();let e=M(38);g(e.getError("required")&&!e.getError("minLength")?0:-1),o(),g(e.getError("minLength")?1:-1)}}function Te(i,d){i&1&&(a(0,"div",40),m(1," Email must be a valid email address "),r())}function Ee(i,d){i&1&&(a(0,"div",40),m(1,"Email is mandatory"),r())}function Pe(i,d){if(i&1&&(p(0,Te,2,0,"div",40),p(1,Ee,2,0,"div",40)),i&2){u();let e=M(45);g(e.errors!=null&&e.errors.email?0:-1),o(),g(e.errors!=null&&e.errors.required?1:-1)}}function Ve(i,d){i&1&&(a(0,"div",40),m(1," Birthdate is mandatory "),r())}function De(i,d){if(i&1&&p(0,Ve,2,0,"div",40),i&2){u();let e=M(3);g(e.invalid?0:-1)}}function Oe(i,d){if(i&1){let e=v();a(0,"div",33)(1,"div",17)(2,"datepicker",48,6),h("ngModelChange",function(l){C(e);let s=u();return b(s.customer.Birthdate,l)||(s.customer.Birthdate=l),_(l)}),r(),p(4,De,1,1),r()()}if(i&2){let e=M(3),t=u();o(2),f("ngModel",t.customer.Birthdate),c("required",t.requiredField().Birthdate)("ngClass",y(4,I,e.invalid&&(e.dirty||e.touched))),o(2),g(e.dirty||e.touched?4:-1)}}function We(i,d){if(i&1&&(a(0,"div",40),m(1),r()),i&2){let e=u(2);o(),x(" ",e.type=="supplier"?"Supplier":"Customer"," code is mandatory. ")}}function Fe(i,d){if(i&1){let e=v();a(0,"div",33)(1,"div",17)(2,"input",49,7),h("ngModelChange",function(l){C(e);let s=u();return b(s.customer.Code,l)||(s.customer.Code=l),_(l)}),r(),p(4,We,2,1,"div",40),a(5,"label",50),m(6),r()()()}if(i&2){let e=M(3),t=u();o(2),c("placeholder",O("",t.type=="supplier"?"Supplier":"Member"," code")),f("ngModel",t.customer.Code),c("required",t.requiredField().Code)("ngClass",y(7,I,e.invalid&&(e.dirty||e.touched))),o(2),g(e.invalid&&(e.dirty||e.touched)?4:-1),o(2),x("",t.type=="supplier"?"Supplier":"Member"," Code")}}function Le(i,d){if(i&1&&(a(0,"div",40),m(1),r()),i&2){let e=u(2);o(),x(" ",e.type=="supplier"?"Supplier":"Customer"," code is mandatory. ")}}function ke(i,d){if(i&1){let e=v();a(0,"div",36)(1,"div",17)(2,"input",49,7),h("ngModelChange",function(l){C(e);let s=u();return b(s.customer.Code,l)||(s.customer.Code=l),_(l)}),r(),p(4,Le,2,1,"div",40),a(5,"label",50),m(6),r()()()}if(i&2){let e=M(3),t=u();o(2),c("placeholder",O("",t.type=="supplier"?"Supplier":"Member"," code")),f("ngModel",t.customer.Code),c("required",t.requiredField().Code)("ngClass",y(7,I,e.invalid&&(e.dirty||e.touched))),o(2),g(e.invalid&&(e.dirty||e.touched)?4:-1),o(2),x("",t.type=="supplier"?"Supplier":"Member"," Code")}}function Be(i,d){if(i&1){let e=v();a(0,"div",36)(1,"div",51)(2,"ng-select",52),h("ngModelChange",function(l){C(e);let s=u();return b(s.customer.Group,l)||(s.customer.Group=l),_(l)}),r(),a(3,"label",53),m(4,"Group"),r()()()}if(i&2){let e=u();o(),c("ngClass",y(3,T,e.isNotEmpty(e.customer.Group))),o(),f("ngModel",e.customer.Group),c("items",e.options==null?null:e.options.Groups)}}function qe(i,d){if(i&1){let e=v();a(0,"div",36)(1,"div",51)(2,"ng-select",54),h("ngModelChange",function(l){C(e);let s=u();return b(s.customer.City,l)||(s.customer.City=l),_(l)}),r(),a(3,"label",55),m(4,"City"),r()()()}if(i&2){let e=u();o(),c("ngClass",y(3,T,e.isNotEmpty(e.customer.City))),o(),f("ngModel",e.customer.City),c("items",e.options==null?null:e.options.Cities)}}function Re(i,d){i&1&&(a(0,"div",40),m(1,"Address is mandatory."),r())}function Ge(i,d){if(i&1&&(a(0,"div",40),m(1),r()),i&2){u();let e=M(68);o(),x(" ",e.errors==null||e.errors.minLength==null?null:e.errors.minLength.message," ")}}var Ce=class i{constructor(d,e,t){this.dialogRef=d;this.data=e;this._CustomerHttpService=t;this.modalConfig=new ce,this.modalConfig.title=this.data.title,this.modalConfig.customWidth="650px",this.options=this.data.options,this.options?.Genders||(this.options.Genders=[{Key:0,Value:"Male"},{Key:1,Value:"Female"}]),this.config=this.data.config,this.type=this.data.type}customer;options;type;config;more;modalConfig;detailVisible;tabState="general";requiredField=q({Mobile:!1,Email:!1,Code:!1,Address:!1,SignUpOutlet:!1,Birthdate:!1});ngOnInit(){this.customer=new k,this.initFirstName(),this.customer.Gender=this.config.DefaultValue.Gender,this.more=!1,this.initRequiredField()}initRequiredField(){let d=this.config.Advance?.RequiredFields;d&&this.type!="supplier"&&d.forEach(e=>{this.requiredField.update(t=>(t[e]=!0,t))})}initFirstName(){this.data&&this.data.inputTextName&&(this.customer.FirstName=this.data.inputTextName)}onOk(d){if(d.form?.markAllAsTouched(),d.form.invalid)return;let e=this.customer.Title?this.customer.Title:"";e+=" "+this.customer.FirstName,e+=" "+(this.customer.LastName?this.customer.LastName:""),e=e.trim(),this.customer.Name=e,this.type=="customer"?this._CustomerHttpService.addCustomer(this.customer).then(t=>{this.dialogRef.close({ContactName:e,CustomerID:t.ID})}).catch(t=>{this.dialogRef.close({Error:t})}):this.type=="supplier"&&this.dialogRef.close({supplier:this.customer})}chooiceDetail(d){this.tabState=d}isNotEmpty(d){return X.IsNotEmpty(d)||d==0}static \u0275fac=function(e){return new(e||i)(E(me),E(ue),E(ge))};static \u0275cmp=G({type:i,selectors:[["POS-modal-customer"]],standalone:!1,decls:81,vars:55,consts:[["f","ngForm"],["FirstName","ngModel"],["phoneNumber","ngModel"],["Email","ngModel"],["addressCtrl","ngModel"],["nationalId","ngModel"],["birthdateCtrl","ngModel"],["codeCtrl","ngModel"],[3,"onOk","onCancel","onClose","config"],[1,"container",2,"height","270px"],["name","form"],[1,"row","align-items-center","border-bottom"],[1,"btn","btn-link",3,"click","ngClass"],[1,"btn","btn-link",3,"ngClass"],[1,"mt-6"],[1,"row","g-4",3,"hidden"],[1,"col-md-2","mt-4"],[1,"form-floating-outline"],["list","cust-title","id","Title","name","Title","placeholder","Title",1,"form-control",3,"ngModelChange","ngModel"],["for","Title"],["id","cust-title"],[3,"value"],[1,"col-md-5","mt-4"],["type","text","id","FirstName","name","FirstName","placeholder","First Name","trimInput","",1,"form-control",3,"ngModelChange","ngClass","ngModel","required"],[3,"ngClass"],["for","FirstName"],["type","text","id","LastName","name","LastName","placeholder","Last Name","trimInput","",1,"form-control",3,"ngModelChange","ngModel"],["for","LastName"],[1,"col-md-6","mt-4"],["type","text","name","Phone","placeholder","Mobile",1,"form-control",3,"ngModelChange","ngModel","required","ngClass"],["for","Phone"],["type","email","name","Email","placeholder","Email","email","",1,"form-control",3,"ngModelChange","ngClass","ngModel","required"],["for","email"],[1,"col-6","mt-4"],["name","gender","bindLabel","Value","bindValue","Key","placeholder","Gender","dropdownPosition","buttom",1,"tall","outlet","auto-grow",3,"ngModelChange","ngModel","items"],[1,"row","g-4","mt-2",3,"hidden"],[1,"col-4","mt-4"],[1,"col-md-12","mt-4"],["id","address","name","address","placeholder","Address",1,"form-control","h-100",3,"ngModelChange","rows","ngModel","required","ngClass"],["for","address"],[1,"invalid-feedback"],["type","text","id","Identification","name","Identification","placeholder","NationalID","numericInputOnly","nationalId",1,"form-control",3,"ngModelChange","ngModel","ngClass"],["for","Identification"],["type","text","id","TaxId","name","TaxId","placeholder","TaxID",1,"form-control",3,"ngModelChange","ngModel"],["for","TaxId"],["name","NationalityID","bindLabel","Name","bindValue","ID","placeholder","Nationality","appendTo","body",1,"tall","outlet","auto-grow",3,"ngModelChange","ngModel","items"],["name","race","bindLabel","Name","bindValue","ID","placeholder","Race","appendTo","body",1,"tall","outlet","auto-grow",3,"ngModelChange","ngModel","items"],[1,"control-label","text-danger"],["placeholder","Birthdate","name","birthDate",3,"ngModelChange","ngModel","required","ngClass"],["type","text","name","code","id","code",1,"form-control",3,"ngModelChange","ngModel","placeholder","required","ngClass"],["for","code"],[1,"form-floating-outline","flexRow",3,"ngClass"],["id","customerGroup","bindLabel","Name","bindValue","ID","name","customerGroup","appendTo","body",1,"productform","tall",3,"ngModelChange","ngModel","items"],["for","customerGroup",1,"ng-select"],["id","city","bindLabel","Name","bindValue","ID","name","city","appendTo","body",1,"productform","tall",3,"ngModelChange","ngModel","items"],["for","city",1,"ng-select"]],template:function(e,t){if(e&1){let l=v();a(0,"modal-material",8),w("onOk",function(){C(l);let n=M(4);return _(t.onOk(n))})("onCancel",function(){return t.dialogRef.close()})("onClose",function(){return t.dialogRef.close()}),a(1,"content")(2,"div",9)(3,"form",10,0)(5,"div",11)(6,"div")(7,"a",12),w("click",function(){return t.chooiceDetail("general")}),m(8," General "),r(),a(9,"a",12),w("click",function(){return t.chooiceDetail("detail")}),m(10," Detail "),r(),p(11,ve,2,3,"a",13),r()(),a(12,"div")(13,"div",14)(14,"div",15)(15,"div",16)(16,"div",17)(17,"input",18),h("ngModelChange",function(n){return C(l),b(t.customer.Title,n)||(t.customer.Title=n),_(n)}),r(),a(18,"label",19),m(19,"Title"),r(),a(20,"datalist",20),K(21,we,1,1,"option",21,j),r()()(),a(23,"div",22)(24,"div",17)(25,"input",23,1),h("ngModelChange",function(n){return C(l),b(t.customer.FirstName,n)||(t.customer.FirstName=n),_(n)}),r(),p(27,xe,3,3,"div",24),a(28,"label",25),m(29,"First Name"),r()()(),a(30,"div",22)(31,"div",17)(32,"input",26),h("ngModelChange",function(n){return C(l),b(t.customer.LastName,n)||(t.customer.LastName=n),_(n)}),r(),a(33,"label",27),m(34,"Last Name"),r()()(),a(35,"div",28)(36,"div",17)(37,"input",29,2),h("ngModelChange",function(n){return C(l),b(t.customer.Mobile,n)||(t.customer.Mobile=n),_(n)}),r(),p(39,Ie,2,2),a(40,"label",30),m(41,"Mobile"),r()()(),a(42,"div",28)(43,"div",17)(44,"input",31,3),h("ngModelChange",function(n){return C(l),b(t.customer.Email,n)||(t.customer.Email=n),_(n)}),r(),p(46,Pe,2,2),a(47,"label",32),m(48,"Email"),r()()(),p(49,Oe,5,6,"div",33),p(50,Fe,7,9,"div",33),a(51,"div",28)(52,"ng-select",34),h("ngModelChange",function(n){return C(l),b(t.customer.Gender,n)||(t.customer.Gender=n),_(n)}),r()()(),a(53,"div",35),p(54,ke,7,9,"div",36),p(55,Be,5,5,"div",36),p(56,qe,5,5,"div",36),a(57,"div",37)(58,"div",17)(59,"textarea",38,4),h("ngModelChange",function(n){return C(l),b(t.customer.Address,n)||(t.customer.Address=n),_(n)}),r(),a(61,"label",39),m(62,"Address"),r(),p(63,Re,2,0,"div",40),r()()(),a(64,"div",35)(65,"div",28)(66,"div",17)(67,"input",41,5),h("ngModelChange",function(n){return C(l),b(t.customer.NationalIDNumber,n)||(t.customer.NationalIDNumber=n),_(n)}),r(),p(69,Ge,2,1,"div",40),a(70,"label",42),m(71,"National ID"),r()()(),a(72,"div",28)(73,"div",17)(74,"input",43),h("ngModelChange",function(n){return C(l),b(t.customer.TaxIDNumber,n)||(t.customer.TaxIDNumber=n),_(n)}),r(),a(75,"label",44),m(76,"Tax ID"),r()()(),a(77,"div",28)(78,"ng-select",45),h("ngModelChange",function(n){return C(l),b(t.customer.NationalityID,n)||(t.customer.NationalityID=n),_(n)}),r()(),a(79,"div",33)(80,"ng-select",46),h("ngModelChange",function(n){return C(l),b(t.customer.RaceID,n)||(t.customer.RaceID=n),_(n)}),r()()()()()()()()()}if(e&2){let l=M(26),s=M(38),n=M(45),S=M(60),N=M(68);c("config",t.modalConfig),o(7),c("ngClass",y(41,T,t.tabState=="general")),o(2),c("ngClass",y(43,T,t.tabState=="detail")),o(2),g(t.type!="supplier"?11:-1),o(3),c("hidden",t.tabState!="general"),o(3),f("ngModel",t.customer.Title),o(4),U(t.options==null?null:t.options.Titles),o(4),c("ngClass",y(45,he,l.touched&&l.invalid)),f("ngModel",t.customer.FirstName),c("required",!0),o(2),g(l.touched&&l.invalid?27:-1),o(5),f("ngModel",t.customer.LastName),o(5),f("ngModel",t.customer.Mobile),c("required",t.requiredField().Mobile)("ngClass",y(47,I,s.invalid&&(s.dirty||s.touched))),o(2),g(s.invalid&&(s.dirty||s.touched)?39:-1),o(5),c("ngClass",y(49,Me,n.invalid&&(n.dirty||n.touched))),f("ngModel",t.customer.Email),c("required",t.requiredField().Email),o(2),g(n.invalid&&(n.dirty||n.touched)?46:-1),o(3),g(t.type!="supplier"?49:-1),o(),g(t.type=="supplier"?50:-1),o(2),f("ngModel",t.customer.Gender),c("items",t.options==null?null:t.options.Genders),o(),c("hidden",t.tabState!="detail"),o(),g(t.type!="supplier"?54:-1),o(),g(t.type!="supplier"?55:-1),o(),g(t.type!="supplier"?56:-1),o(3),c("rows",t.type!="supplier"?6:9),f("ngModel",t.customer.Address),c("required",t.requiredField().Address)("ngClass",y(51,I,S.invalid&&(S.dirty||S.touched))),o(4),g(S.invalid&&(S.dirty||S.touched)?63:-1),o(),c("hidden",t.tabState!="id"),o(3),f("ngModel",t.customer.NationalIDNumber),c("ngClass",y(53,I,N.invalid&&(N.dirty||N.touched))),o(2),g(N.invalid&&(N.dirty||N.touched)?69:-1),o(5),f("ngModel",t.customer.TaxIDNumber),o(4),f("ngModel",t.customer.NationalityID),c("items",t.options==null?null:t.options.Nationalities),o(2),f("ngModel",t.customer.RaceID),c("items",t.options==null?null:t.options.Races)}},dependencies:()=>[J,W,ne,oe,re,Y,$,ee,ae,le,ie,te,L,F,V],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:2px solid #07a519}.form-floating-outline[_ngcontent-%COMP%]{margin-bottom:.2rem!important}"]})},_e=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=A({type:i});static \u0275inj=B({imports:[Q,pe,W,de,se,L,F]})},k=class{Title;FirstName;LastName;Name;Gender;Mobile;Email;TaxIDNumber;TaxID;Group;Code;City;Address;Birthdate;MemberIdentification;NationalIDNumber;NationalityID;RaceID;CreatorEntityID};export{V as a,Ce as b,_e as c,k as d};
|
|
1
|
+
import{c as ge}from"./chunk-AYOPP5VW.js";import{p as L}from"./chunk-VQQIQFUB.js";import{N as pe}from"./chunk-VAJAIBT3.js";import{d as F}from"./chunk-RBBEZN3D.js";import{a as me,b as ue}from"./chunk-R2YNXAPB.js";import{b as ce,c as W}from"./chunk-3UB7PEG5.js";import{A as le,E as de,F as se,c as Y,g as Z,h as $,i as ee,k as te,o as ie,p as ne,x as oe,y as re,z as ae}from"./chunk-POUQHZWU.js";import{a as X}from"./chunk-PTRS3UA6.js";import{$b as M,Ab as c,Bb as a,Cb as r,Da as R,Db as z,Mb as v,Pb as w,Qc as P,Ra as o,Rb as u,Ya as E,ab as G,bb as A,cb as H,ec as m,fd as J,gc as x,ia as B,jc as f,kc as b,la as D,lc as h,pa as C,qa as _,qc as O,sd as Q,tb as p,vb as g,vc as y,xb as j,yb as K,za as q,zb as U}from"./chunk-M3O2GJ3M.js";var V=class i{elementRef=D(R);control=D(Z,{optional:!0,self:!0});trimInputPrefix=P(null);trimInputSuffix=P(null);trimInputWhitespace=P(!0);onBlur(){let d=this.elementRef.nativeElement;if(!d)return;let e=d.value??"",t=e,l=this.trimInputPrefix(),s=this.trimInputSuffix(),n=this.trimInputWhitespace();n&&(e=e.trim()),l&&e.startsWith(l)&&(e=e.slice(l.length)),s&&e.endsWith(s)&&(e=e.slice(0,e.length-s.length)),n&&(e=e.trim()),e!==t&&(d.value=e,this.control?.control?(this.control.control.setValue(e,{emitEvent:!1}),this.control.control.updateValueAndValidity()):d.dispatchEvent(new Event("input",{bubbles:!0})))}static \u0275fac=function(e){return new(e||i)};static \u0275dir=H({type:i,selectors:[["","trimInput",""]],hostBindings:function(e,t){e&1&&w("blur",function(){return t.onBlur()})},inputs:{trimInputPrefix:[1,"trimInputPrefix"],trimInputSuffix:[1,"trimInputSuffix"],trimInputWhitespace:[1,"trimInputWhitespace"]}})};var T=i=>({selected:i}),he=i=>({"border border-danger":i}),I=i=>({"is-invalid":i}),Me=i=>({"is-invalid border border-danger":i}),ye=i=>({"has-error":i});function ve(i,d){if(i&1){let e=v();a(0,"a",12),w("click",function(){C(e);let l=u();return _(l.chooiceDetail("id"))}),m(1," ID "),r()}if(i&2){let e=u();c("ngClass",y(1,T,e.tabState=="id"))}}function we(i,d){if(i&1&&z(0,"option",21),i&2){let e=d.$implicit;c("value",e.Name)}}function xe(i,d){if(i&1&&(a(0,"div",24)(1,"i",47),m(2," Name is mandatory."),r()()),i&2){u();let e=M(26);c("ngClass",y(1,ye,e.touched&&e.invalid))}}function Se(i,d){i&1&&(a(0,"div",40),m(1," Mobile Phone is mandatory "),r())}function Ne(i,d){if(i&1&&(a(0,"div",40),m(1),r()),i&2){u(2);let e=M(38);o(),x(" ",e.errors==null||e.errors.minLength==null?null:e.errors.minLength.message," ")}}function Ie(i,d){if(i&1&&(p(0,Se,2,0,"div",40),p(1,Ne,2,1,"div",40)),i&2){u();let e=M(38);g(e.getError("required")&&!e.getError("minLength")?0:-1),o(),g(e.getError("minLength")?1:-1)}}function Te(i,d){i&1&&(a(0,"div",40),m(1," Email must be a valid email address "),r())}function Ee(i,d){i&1&&(a(0,"div",40),m(1,"Email is mandatory"),r())}function Pe(i,d){if(i&1&&(p(0,Te,2,0,"div",40),p(1,Ee,2,0,"div",40)),i&2){u();let e=M(45);g(e.errors!=null&&e.errors.email?0:-1),o(),g(e.errors!=null&&e.errors.required?1:-1)}}function Ve(i,d){i&1&&(a(0,"div",40),m(1," Birthdate is mandatory "),r())}function De(i,d){if(i&1&&p(0,Ve,2,0,"div",40),i&2){u();let e=M(3);g(e.invalid?0:-1)}}function Oe(i,d){if(i&1){let e=v();a(0,"div",33)(1,"div",17)(2,"datepicker",48,6),h("ngModelChange",function(l){C(e);let s=u();return b(s.customer.Birthdate,l)||(s.customer.Birthdate=l),_(l)}),r(),p(4,De,1,1),r()()}if(i&2){let e=M(3),t=u();o(2),f("ngModel",t.customer.Birthdate),c("required",t.requiredField().Birthdate)("ngClass",y(4,I,e.invalid&&(e.dirty||e.touched))),o(2),g(e.dirty||e.touched?4:-1)}}function We(i,d){if(i&1&&(a(0,"div",40),m(1),r()),i&2){let e=u(2);o(),x(" ",e.type=="supplier"?"Supplier":"Customer"," code is mandatory. ")}}function Fe(i,d){if(i&1){let e=v();a(0,"div",33)(1,"div",17)(2,"input",49,7),h("ngModelChange",function(l){C(e);let s=u();return b(s.customer.Code,l)||(s.customer.Code=l),_(l)}),r(),p(4,We,2,1,"div",40),a(5,"label",50),m(6),r()()()}if(i&2){let e=M(3),t=u();o(2),c("placeholder",O("",t.type=="supplier"?"Supplier":"Member"," code")),f("ngModel",t.customer.Code),c("required",t.requiredField().Code)("ngClass",y(7,I,e.invalid&&(e.dirty||e.touched))),o(2),g(e.invalid&&(e.dirty||e.touched)?4:-1),o(2),x("",t.type=="supplier"?"Supplier":"Member"," Code")}}function Le(i,d){if(i&1&&(a(0,"div",40),m(1),r()),i&2){let e=u(2);o(),x(" ",e.type=="supplier"?"Supplier":"Customer"," code is mandatory. ")}}function ke(i,d){if(i&1){let e=v();a(0,"div",36)(1,"div",17)(2,"input",49,7),h("ngModelChange",function(l){C(e);let s=u();return b(s.customer.Code,l)||(s.customer.Code=l),_(l)}),r(),p(4,Le,2,1,"div",40),a(5,"label",50),m(6),r()()()}if(i&2){let e=M(3),t=u();o(2),c("placeholder",O("",t.type=="supplier"?"Supplier":"Member"," code")),f("ngModel",t.customer.Code),c("required",t.requiredField().Code)("ngClass",y(7,I,e.invalid&&(e.dirty||e.touched))),o(2),g(e.invalid&&(e.dirty||e.touched)?4:-1),o(2),x("",t.type=="supplier"?"Supplier":"Member"," Code")}}function Be(i,d){if(i&1){let e=v();a(0,"div",36)(1,"div",51)(2,"ng-select",52),h("ngModelChange",function(l){C(e);let s=u();return b(s.customer.Group,l)||(s.customer.Group=l),_(l)}),r(),a(3,"label",53),m(4,"Group"),r()()()}if(i&2){let e=u();o(),c("ngClass",y(3,T,e.isNotEmpty(e.customer.Group))),o(),f("ngModel",e.customer.Group),c("items",e.options==null?null:e.options.Groups)}}function qe(i,d){if(i&1){let e=v();a(0,"div",36)(1,"div",51)(2,"ng-select",54),h("ngModelChange",function(l){C(e);let s=u();return b(s.customer.City,l)||(s.customer.City=l),_(l)}),r(),a(3,"label",55),m(4,"City"),r()()()}if(i&2){let e=u();o(),c("ngClass",y(3,T,e.isNotEmpty(e.customer.City))),o(),f("ngModel",e.customer.City),c("items",e.options==null?null:e.options.Cities)}}function Re(i,d){i&1&&(a(0,"div",40),m(1,"Address is mandatory."),r())}function Ge(i,d){if(i&1&&(a(0,"div",40),m(1),r()),i&2){u();let e=M(68);o(),x(" ",e.errors==null||e.errors.minLength==null?null:e.errors.minLength.message," ")}}var Ce=class i{constructor(d,e,t){this.dialogRef=d;this.data=e;this._CustomerHttpService=t;this.modalConfig=new ce,this.modalConfig.title=this.data.title,this.modalConfig.customWidth="650px",this.options=this.data.options,this.options?.Genders||(this.options.Genders=[{Key:0,Value:"Male"},{Key:1,Value:"Female"}]),this.config=this.data.config,this.type=this.data.type}customer;options;type;config;more;modalConfig;detailVisible;tabState="general";requiredField=q({Mobile:!1,Email:!1,Code:!1,Address:!1,SignUpOutlet:!1,Birthdate:!1});ngOnInit(){this.customer=new k,this.initFirstName(),this.customer.Gender=this.config.DefaultValue.Gender,this.more=!1,this.initRequiredField()}initRequiredField(){let d=this.config.Advance?.RequiredFields;d&&this.type!="supplier"&&d.forEach(e=>{this.requiredField.update(t=>(t[e]=!0,t))})}initFirstName(){this.data&&this.data.inputTextName&&(this.customer.FirstName=this.data.inputTextName)}onOk(d){if(d.form?.markAllAsTouched(),d.form.invalid)return;let e=this.customer.Title?this.customer.Title:"";e+=" "+this.customer.FirstName,e+=" "+(this.customer.LastName?this.customer.LastName:""),e=e.trim(),this.customer.Name=e,this.type=="customer"?this._CustomerHttpService.addCustomer(this.customer).then(t=>{this.dialogRef.close({ContactName:e,CustomerID:t.ID})}).catch(t=>{this.dialogRef.close({Error:t})}):this.type=="supplier"&&this.dialogRef.close({supplier:this.customer})}chooiceDetail(d){this.tabState=d}isNotEmpty(d){return X.IsNotEmpty(d)||d==0}static \u0275fac=function(e){return new(e||i)(E(me),E(ue),E(ge))};static \u0275cmp=G({type:i,selectors:[["POS-modal-customer"]],standalone:!1,decls:81,vars:55,consts:[["f","ngForm"],["FirstName","ngModel"],["phoneNumber","ngModel"],["Email","ngModel"],["addressCtrl","ngModel"],["nationalId","ngModel"],["birthdateCtrl","ngModel"],["codeCtrl","ngModel"],[3,"onOk","onCancel","onClose","config"],[1,"container",2,"height","270px"],["name","form"],[1,"row","align-items-center","border-bottom"],[1,"btn","btn-link",3,"click","ngClass"],[1,"btn","btn-link",3,"ngClass"],[1,"mt-6"],[1,"row","g-4",3,"hidden"],[1,"col-md-2","mt-4"],[1,"form-floating-outline"],["list","cust-title","id","Title","name","Title","placeholder","Title",1,"form-control",3,"ngModelChange","ngModel"],["for","Title"],["id","cust-title"],[3,"value"],[1,"col-md-5","mt-4"],["type","text","id","FirstName","name","FirstName","placeholder","First Name","trimInput","",1,"form-control",3,"ngModelChange","ngClass","ngModel","required"],[3,"ngClass"],["for","FirstName"],["type","text","id","LastName","name","LastName","placeholder","Last Name","trimInput","",1,"form-control",3,"ngModelChange","ngModel"],["for","LastName"],[1,"col-md-6","mt-4"],["type","text","name","Phone","placeholder","Mobile",1,"form-control",3,"ngModelChange","ngModel","required","ngClass"],["for","Phone"],["type","email","name","Email","placeholder","Email","email","",1,"form-control",3,"ngModelChange","ngClass","ngModel","required"],["for","email"],[1,"col-6","mt-4"],["name","gender","bindLabel","Value","bindValue","Key","placeholder","Gender","dropdownPosition","buttom",1,"tall","outlet","auto-grow",3,"ngModelChange","ngModel","items"],[1,"row","g-4","mt-2",3,"hidden"],[1,"col-4","mt-4"],[1,"col-md-12","mt-4"],["id","address","name","address","placeholder","Address",1,"form-control","h-100",3,"ngModelChange","rows","ngModel","required","ngClass"],["for","address"],[1,"invalid-feedback"],["type","text","id","Identification","name","Identification","placeholder","NationalID","numericInputOnly","nationalId",1,"form-control",3,"ngModelChange","ngModel","ngClass"],["for","Identification"],["type","text","id","TaxId","name","TaxId","placeholder","TaxID",1,"form-control",3,"ngModelChange","ngModel"],["for","TaxId"],["name","NationalityID","bindLabel","Name","bindValue","ID","placeholder","Nationality","appendTo","body",1,"tall","outlet","auto-grow",3,"ngModelChange","ngModel","items"],["name","race","bindLabel","Name","bindValue","ID","placeholder","Race","appendTo","body",1,"tall","outlet","auto-grow",3,"ngModelChange","ngModel","items"],[1,"control-label","text-danger"],["placeholder","Birthdate","name","birthDate",3,"ngModelChange","ngModel","required","ngClass"],["type","text","name","code","id","code",1,"form-control",3,"ngModelChange","ngModel","placeholder","required","ngClass"],["for","code"],[1,"form-floating-outline","flexRow",3,"ngClass"],["id","customerGroup","bindLabel","Name","bindValue","ID","name","customerGroup","appendTo","body",1,"productform","tall",3,"ngModelChange","ngModel","items"],["for","customerGroup",1,"ng-select"],["id","city","bindLabel","Name","bindValue","ID","name","city","appendTo","body",1,"productform","tall",3,"ngModelChange","ngModel","items"],["for","city",1,"ng-select"]],template:function(e,t){if(e&1){let l=v();a(0,"modal-material",8),w("onOk",function(){C(l);let n=M(4);return _(t.onOk(n))})("onCancel",function(){return t.dialogRef.close()})("onClose",function(){return t.dialogRef.close()}),a(1,"content")(2,"div",9)(3,"form",10,0)(5,"div",11)(6,"div")(7,"a",12),w("click",function(){return t.chooiceDetail("general")}),m(8," General "),r(),a(9,"a",12),w("click",function(){return t.chooiceDetail("detail")}),m(10," Detail "),r(),p(11,ve,2,3,"a",13),r()(),a(12,"div")(13,"div",14)(14,"div",15)(15,"div",16)(16,"div",17)(17,"input",18),h("ngModelChange",function(n){return C(l),b(t.customer.Title,n)||(t.customer.Title=n),_(n)}),r(),a(18,"label",19),m(19,"Title"),r(),a(20,"datalist",20),K(21,we,1,1,"option",21,j),r()()(),a(23,"div",22)(24,"div",17)(25,"input",23,1),h("ngModelChange",function(n){return C(l),b(t.customer.FirstName,n)||(t.customer.FirstName=n),_(n)}),r(),p(27,xe,3,3,"div",24),a(28,"label",25),m(29,"First Name"),r()()(),a(30,"div",22)(31,"div",17)(32,"input",26),h("ngModelChange",function(n){return C(l),b(t.customer.LastName,n)||(t.customer.LastName=n),_(n)}),r(),a(33,"label",27),m(34,"Last Name"),r()()(),a(35,"div",28)(36,"div",17)(37,"input",29,2),h("ngModelChange",function(n){return C(l),b(t.customer.Mobile,n)||(t.customer.Mobile=n),_(n)}),r(),p(39,Ie,2,2),a(40,"label",30),m(41,"Mobile"),r()()(),a(42,"div",28)(43,"div",17)(44,"input",31,3),h("ngModelChange",function(n){return C(l),b(t.customer.Email,n)||(t.customer.Email=n),_(n)}),r(),p(46,Pe,2,2),a(47,"label",32),m(48,"Email"),r()()(),p(49,Oe,5,6,"div",33),p(50,Fe,7,9,"div",33),a(51,"div",28)(52,"ng-select",34),h("ngModelChange",function(n){return C(l),b(t.customer.Gender,n)||(t.customer.Gender=n),_(n)}),r()()(),a(53,"div",35),p(54,ke,7,9,"div",36),p(55,Be,5,5,"div",36),p(56,qe,5,5,"div",36),a(57,"div",37)(58,"div",17)(59,"textarea",38,4),h("ngModelChange",function(n){return C(l),b(t.customer.Address,n)||(t.customer.Address=n),_(n)}),r(),a(61,"label",39),m(62,"Address"),r(),p(63,Re,2,0,"div",40),r()()(),a(64,"div",35)(65,"div",28)(66,"div",17)(67,"input",41,5),h("ngModelChange",function(n){return C(l),b(t.customer.NationalIDNumber,n)||(t.customer.NationalIDNumber=n),_(n)}),r(),p(69,Ge,2,1,"div",40),a(70,"label",42),m(71,"National ID"),r()()(),a(72,"div",28)(73,"div",17)(74,"input",43),h("ngModelChange",function(n){return C(l),b(t.customer.TaxIDNumber,n)||(t.customer.TaxIDNumber=n),_(n)}),r(),a(75,"label",44),m(76,"Tax ID"),r()()(),a(77,"div",28)(78,"ng-select",45),h("ngModelChange",function(n){return C(l),b(t.customer.NationalityID,n)||(t.customer.NationalityID=n),_(n)}),r()(),a(79,"div",33)(80,"ng-select",46),h("ngModelChange",function(n){return C(l),b(t.customer.RaceID,n)||(t.customer.RaceID=n),_(n)}),r()()()()()()()()()}if(e&2){let l=M(26),s=M(38),n=M(45),S=M(60),N=M(68);c("config",t.modalConfig),o(7),c("ngClass",y(41,T,t.tabState=="general")),o(2),c("ngClass",y(43,T,t.tabState=="detail")),o(2),g(t.type!="supplier"?11:-1),o(3),c("hidden",t.tabState!="general"),o(3),f("ngModel",t.customer.Title),o(4),U(t.options==null?null:t.options.Titles),o(4),c("ngClass",y(45,he,l.touched&&l.invalid)),f("ngModel",t.customer.FirstName),c("required",!0),o(2),g(l.touched&&l.invalid?27:-1),o(5),f("ngModel",t.customer.LastName),o(5),f("ngModel",t.customer.Mobile),c("required",t.requiredField().Mobile)("ngClass",y(47,I,s.invalid&&(s.dirty||s.touched))),o(2),g(s.invalid&&(s.dirty||s.touched)?39:-1),o(5),c("ngClass",y(49,Me,n.invalid&&(n.dirty||n.touched))),f("ngModel",t.customer.Email),c("required",t.requiredField().Email),o(2),g(n.invalid&&(n.dirty||n.touched)?46:-1),o(3),g(t.type!="supplier"?49:-1),o(),g(t.type=="supplier"?50:-1),o(2),f("ngModel",t.customer.Gender),c("items",t.options==null?null:t.options.Genders),o(),c("hidden",t.tabState!="detail"),o(),g(t.type!="supplier"?54:-1),o(),g(t.type!="supplier"?55:-1),o(),g(t.type!="supplier"?56:-1),o(3),c("rows",t.type!="supplier"?6:9),f("ngModel",t.customer.Address),c("required",t.requiredField().Address)("ngClass",y(51,I,S.invalid&&(S.dirty||S.touched))),o(4),g(S.invalid&&(S.dirty||S.touched)?63:-1),o(),c("hidden",t.tabState!="id"),o(3),f("ngModel",t.customer.NationalIDNumber),c("ngClass",y(53,I,N.invalid&&(N.dirty||N.touched))),o(2),g(N.invalid&&(N.dirty||N.touched)?69:-1),o(5),f("ngModel",t.customer.TaxIDNumber),o(4),f("ngModel",t.customer.NationalityID),c("items",t.options==null?null:t.options.Nationalities),o(2),f("ngModel",t.customer.RaceID),c("items",t.options==null?null:t.options.Races)}},dependencies:()=>[J,W,ne,oe,re,Y,$,ee,ae,le,ie,te,L,F,V],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:2px solid #07a519}.form-floating-outline[_ngcontent-%COMP%]{margin-bottom:.2rem!important}"]})},_e=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=A({type:i});static \u0275inj=B({imports:[Q,pe,W,de,se,L,F]})},k=class{Title;FirstName;LastName;Name;Gender;Mobile;Email;TaxIDNumber;TaxID;Group;Code;City;Address;Birthdate;MemberIdentification;NationalIDNumber;NationalityID;RaceID;CreatorEntityID};export{V as a,Ce as b,_e as c,k as d};
|